From mboxrd@z Thu Jan 1 00:00:00 1970 From: Manuel Hermenegildo Subject: patch for :index-title Date: Sat, 24 May 2008 19:38:46 +0200 Message-ID: <18488.21158.163869.995461@clip.dia.fi.upm.es> Reply-To: Manuel Hermenegildo Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jzxp5-0003iF-2S for emacs-orgmode@gnu.org; Sat, 24 May 2008 13:46:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jzxp3-0003i3-Fu for emacs-orgmode@gnu.org; Sat, 24 May 2008 13:46:25 -0400 Received: from [199.232.76.173] (port=33348 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jzxp3-0003i0-BE for emacs-orgmode@gnu.org; Sat, 24 May 2008 13:46:25 -0400 Received: from relay.fi.upm.es ([138.100.8.25]:58421 helo=relay2.fi.upm.es) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Jzxp2-0003nU-T6 for emacs-orgmode@gnu.org; Sat, 24 May 2008 13:46:25 -0400 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: Carsten Dominik Cc: emacs-orgmode@gnu.org 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) -------------------------------------------------------------------------------