From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: patch for :index-title Date: Sat, 24 May 2008 21:54:57 +0200 Message-ID: <83372A57-0C9B-4ECA-B00D-46DEC9F40ADF@gmail.com> References: <18488.21158.163869.995461@clip.dia.fi.upm.es> Mime-Version: 1.0 (Apple Message framework v919.2) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JzzpZ-0007H2-KS for emacs-orgmode@gnu.org; Sat, 24 May 2008 15:55:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JzzpY-0007F7-6g for emacs-orgmode@gnu.org; Sat, 24 May 2008 15:55:04 -0400 Received: from [199.232.76.173] (port=55106 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JzzpX-0007El-Uk for emacs-orgmode@gnu.org; Sat, 24 May 2008 15:55:03 -0400 Received: from nf-out-0910.google.com ([64.233.182.184]:27138) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JzzpX-0000dT-AC for emacs-orgmode@gnu.org; Sat, 24 May 2008 15:55:03 -0400 Received: by nf-out-0910.google.com with SMTP id c7so669049nfi.26 for ; Sat, 24 May 2008 12:55:02 -0700 (PDT) In-Reply-To: <18488.21158.163869.995461@clip.dia.fi.upm.es> 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: Manuel Hermenegildo Cc: emacs-orgmode@gnu.org Applied, thanks. - Carsten On May 24, 2008, at 7:38 PM, Manuel Hermenegildo wrote: > > Hi Carsten, > > :index-title (which I need) was not working and I saw that the > implementation was not there yet in the (git) code, so I added it to > org-publish-org-index (hopefully correctly). I send you the diff and > the new version of org-publish-org-index. > > Btw, a minor thing I noticed in the manual: in the documentation for > org-publish-project-alist it says: > > "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 publishing directory." > > I think it should say "base directory". > > Cheers --Manuel > > > ================================================================= > > Diff: > > 589,590d588 > < (index-title (or (plist-get project-plist :index-title) > < (concat "Index for project " (car project)))) > 598d595 > < (insert (concat index-title "\n\n")) > > ================================================================= > > (defun org-publish-org-index (project &optional index-filename) > "Create an index of pages in set defined by PROJECT. > Optionally set the filename of the index with INDEX-FILENAME. > Default for INDEX-FILENAME is 'index.org'." > (let* ((project-plist (cdr project)) > (dir (file-name-as-directory > (plist-get project-plist :base-directory))) > (exclude-regexp (plist-get project-plist :exclude)) > (files (org-publish-get-base-files project exclude-regexp)) > (index-filename (concat dir (or index-filename "index.org"))) > (index-title (or (plist-get project-plist :index-title) > (concat "Index for project " (car project)))) > (index-buffer (find-buffer-visiting index-filename)) > (ifn (file-name-nondirectory index-filename)) > file) > ;; if buffer is already open, kill it to prevent error message > (if index-buffer > (kill-buffer index-buffer)) > (with-temp-buffer > (insert (concat index-title "\n\n")) > (while (setq file (pop files)) > (let ((fn (file-name-nondirectory file))) > ;; index shouldn't index itself > (unless (string= fn ifn) > (insert (concat " + [[file:" fn "][" > (file-name-sans-extension fn) > "]]\n"))))) > (write-file index-filename) > (kill-buffer (current-buffer))))) > > ================================================================= > > > -- > ------------------------------------------------------------------------------- > Manuel Hermenegildo | Prof., C.S. > Department > Director, IMDEA-Software and CLIP Group | T.U. of > Madrid (UPM) > http://www.cliplab.org/herme | +34-91-336-7435 (W) > -352-4819 (Fax) > ------------------------------------------------------------------------------- > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode