From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thomas S. Dye" Subject: Re: Re: One org file, multiple exports, is it possible? Date: Wed, 26 May 2010 12:28:12 -1000 Message-ID: <2FF8A80C-C4F3-4FDE-B0D2-50D03EE4110B@tsdye.com> References: <855B9DE3-A7FD-42B4-A863-DE036065EBD1@gmail.com> <6B0AFD3C-BF59-4DB6-823F-471107A380F4@tsdye.com> <81206149-B01D-4837-A7A5-0ABF94920FE1@gmail.com> <56FE52EC-18B8-46FE-B0B8-266DE70E0A38@tsdye.com> <646DB2B5-DFE0-422F-BD11-AA2117E76644@tsdye.com> <87632cljw4.fsf@gollum.intra.norang.ca> <36A649F1-C9F6-43C4-9B81-CD6A51F9B515@tsdye.com> <19272.1274909875@alphaville.usa.hp.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: multipart/mixed; boundary="===============1242879337==" Return-path: Received: from [140.186.70.92] (port=41445 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OHP5F-0006qc-P6 for emacs-orgmode@gnu.org; Wed, 26 May 2010 18:28:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OHP5E-00087u-9r for emacs-orgmode@gnu.org; Wed, 26 May 2010 18:28:17 -0400 Received: from oproxy1-pub.bluehost.com ([66.147.249.253]:35961 helo=outbound-mail-359.bluehost.com) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1OHP5D-00087l-SQ for emacs-orgmode@gnu.org; Wed, 26 May 2010 18:28:16 -0400 In-Reply-To: <19272.1274909875@alphaville.usa.hp.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: kmartino@pobox.com, Bernt Hansen , emacs-orgmode@gnu.org, Carsten Dominik --===============1242879337== Content-Type: multipart/alternative; boundary=Apple-Mail-4-252948794 --Apple-Mail-4-252948794 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On May 26, 2010, at 11:37 AM, Nick Dokos wrote: > Thomas S. Dye wrote: > > >> ("work" >> :base-directory "~/org/temp/" >> :base-extension "org" >> :publishing-directory "~/org/temp/publish-work/" >> :publishing-function org-publish-org-to-latex >> :select-tags ("@WORK") >> :title "Work Notes" >> :include ("index.org") <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >> :exclude "\\.org$" >> ) >> )) >> ---- .minimal.emacs ----- >> >> Debugger entered--Lisp error: (wrong-type-argument stringp >> ("index.org")) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > > This is complaining that ``("index.org")'' is not a string, and indeed > it isn't: it's a list with one element. Should the :include line above > be > > :include "index.org" > > perhaps? But I'm shooting from the hip here, so take it with the > appropriate > grain of salt. > > Nick Hi Nick, The documentation for org-publish-projects-alist suggests that :include wants a list: > The :include property may be used to include extra files. Its > value may be a list of filenames to include. The filenames are > considered relative to the base directory. When I tried :include "index.org" I got this: Debugger entered--Lisp error: (wrong-type-argument sequencep 105) concat("~/org/temp/" 105) (expand-file-name (concat base-dir f)) ... I'm not going to pretend I know what I'm talking about here, but AFAICT the variable i in the following code needs some attention before it goes to string-match. According to the documentation, plist- get just returns the value assigned to a property (or nil) without doing anything to it, so i should be a list when it is passed to string-match. string-match wants REGEXP here, apparently not as a list. I couldn't persuade emacs to cough up the definition of REGEXP, but my brief forays into the emacs and org-mode source code lead me to believe it is probably a string. > (defun org-publish-get-project-from-filename (filename &optional up) > "Return the project FILENAME belongs." > (let* ((filename (expand-file-name filename)) > project-name) > > (catch 'p-found > (dolist (prj org-publish-project-alist) > (unless (plist-get (cdr prj) :components) > ;; [[info:org:Selecting%20files]] shows how this is supposed to > work: > (let* ((r (plist-get (cdr prj) :recursive)) > (b (expand-file-name (plist-get (cdr prj) :base-directory))) > (x (plist-get (cdr prj) :base-extension)) > (e (plist-get (cdr prj) :exclude)) > (i (plist-get (cdr prj) :include)) > (xm (concat "^" b (if r ".+" "[^/]+") "\\.\\(" x "\\)$"))) > (when (or > (and i (string-match i filename)) All the best, Tom --Apple-Mail-4-252948794 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable
On May 26, 2010, = at 11:37 AM, Nick Dokos wrote:

Thomas = S. Dye <tsd@tsdye.com> = wrote:


= ("work"
= :base-directory "~/org/temp/"
= :base-extension "org"
= :publishing-directory = "~/org/temp/publish-work/"
= :publishing-function = org-publish-org-to-latex
= :select-tags ("@WORK")
:title = "Work Notes"
:include = ("index.org") =  <<<<<<<<<<<<<<<<<= <<<<<<<<<<<<<<<<<<&l= t;<
:exclude = "\\.org$"
= )
))
---- .minimal.emacs -----

Debugger = entered--Lisp error: (wrong-type-argument = stringp
("index.org")) = <<<<<<<<<<<<<<<<<<&l= t;<<<<<<<<<<<<<<<<<<= <<<<<<<<<<<<<<<<

This is complaining that ``("index.org")'' is not a string, = and indeed
it isn't: it's a list with one element. Should the = :include line above
be

=        :include = "index.org"

perhaps? But I'm shooting from the hip here, so take = it with the appropriate
grain of = salt.

Nick

Hi = Nick,

The documentation for = org-publish-projects-alist suggests that :include wants a = list:

The :include property may be used to include extra = files.  Its
value may be a list of filenames to include. = The filenames are
considered relative to the base = directory.

When I tried :include = "index.org" I got this:

Debugger = entered--Lisp error: (wrong-type-argument sequencep = 105)
  concat("~/org/temp/" = 105)
  (expand-file-name (concat base-dir = f)) 
  ...

I'm = not going to pretend I know what I'm talking about here, but AFAICT the = variable i in the following code needs some attention before it goes to = string-match.  According to the documentation, plist-get just = returns the value assigned to a property (or nil) without doing anything = to it, so i should be a list when it is passed to string-match. =  string-match wants REGEXP here, apparently not as a list.  I = couldn't persuade emacs to cough up the definition of REGEXP, but my = brief forays into the emacs and org-mode source code lead me to believe = it is probably a string.

(defun org-publish-get-project-from-filename (filename = &optional up)
  "Return the project FILENAME = belongs."
  (let* ((filename (expand-file-name = filename))
project-name)

    (catch = 'p-found
      (dolist (prj = org-publish-project-alist)
(unless (plist-get (cdr prj) = :components)
 ;; [[info:org:Selecting%20files]] shows how = this is supposed to work:
 (let* ((r (plist-get (cdr prj) = :recursive))
(b (expand-file-name = (plist-get (cdr prj) :base-directory)))
= (x = (plist-get (cdr prj) :base-extension))
= (e = (plist-get (cdr prj) :exclude))
= (i = (plist-get (cdr prj) :include))
= (xm = (concat "^" b (if r ".+" "[^/]+") "\\.\\(" x = "\\)$")))
   (when (or
=   = (and i (string-match i filename))

All the = best,
Tom
= --Apple-Mail-4-252948794-- --===============1242879337== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1242879337==--