From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Albert Newsgroups: gmane.emacs.bugs Subject: bug#11491: 23.0.96; org-mode: in org-publish.el: #+INCLUDE: cannot deal with spaces in a filename, like this "file name.org" Date: Wed, 16 May 2012 21:49:34 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1337197800 8627 80.91.229.3 (16 May 2012 19:50:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 16 May 2012 19:50:00 +0000 (UTC) To: 11491@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 16 21:49:59 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SUkEQ-0007aq-ES for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 May 2012 21:49:58 +0200 Original-Received: from localhost ([::1]:35077 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUkEP-0000Sm-Uu for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 May 2012 15:49:57 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUkEM-0000SU-9s for bug-gnu-emacs@gnu.org; Wed, 16 May 2012 15:49:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SUkEK-0001G8-65 for bug-gnu-emacs@gnu.org; Wed, 16 May 2012 15:49:53 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48555) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUkEJ-0001Fz-Ve for bug-gnu-emacs@gnu.org; Wed, 16 May 2012 15:49:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SUkEU-0002JE-90 for bug-gnu-emacs@gnu.org; Wed, 16 May 2012 15:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Albert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 16 May 2012 19:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11491 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13371978018864 (code B ref -1); Wed, 16 May 2012 19:50:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 May 2012 19:50:01 +0000 Original-Received: from localhost ([127.0.0.1]:58101 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUkET-0002Iu-7u for submit@debbugs.gnu.org; Wed, 16 May 2012 15:50:01 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56682) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUkEQ-0002Ii-QD for submit@debbugs.gnu.org; Wed, 16 May 2012 15:49:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SUkE8-0001E7-Ty for submit@debbugs.gnu.org; Wed, 16 May 2012 15:49:42 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:44651) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUkE8-0001Dw-Ob for submit@debbugs.gnu.org; Wed, 16 May 2012 15:49:40 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37597) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUkE6-0000SA-SN for bug-gnu-emacs@gnu.org; Wed, 16 May 2012 15:49:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SUkE4-0001Ct-Qx for bug-gnu-emacs@gnu.org; Wed, 16 May 2012 15:49:38 -0400 Original-Received: from mail-we0-f169.google.com ([74.125.82.169]:45286) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUkE4-0001CT-J0 for bug-gnu-emacs@gnu.org; Wed, 16 May 2012 15:49:36 -0400 Original-Received: by wefh52 with SMTP id h52so930782wef.0 for ; Wed, 16 May 2012 12:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=yWIM1wE5E2al5+rJxvEeqgnemn9klX/LoHze/UtAE+Y=; b=DD5tbqPbEpbeH6Wzk6KjARwBV0aYQ4G3gdHwcoKcwuwSgEGSzvK3wiCcFrzeUBWs/x aVNrvDKD8Tr7vGJlPeMc8kmuOAWQop61aW2pRAt2l9YxNnEfCHTQDjLki48iy08P7Svl +S9RrhW6H6GHjGNHM/KI1vS0+uANTT1fREgKI0cpm5d/HrOmaTtWh3GvMa+fl0Vf7jYq OBupNkiNdoMxdj1/WRTXXN/tkBdKZMwhvH+ZB35FvoJQoIGrCQcPQfar49XYmnXjITV2 8UDXKvqg6OxlC6BSd6AoBMZf0MhghA0rQyAIdkKOBgrMSdnswqN59uHs35e6UyGybW+t VegQ== Original-Received: by 10.180.84.4 with SMTP id u4mr11205040wiy.2.1337197774523; Wed, 16 May 2012 12:49:34 -0700 (PDT) Original-Received: by 10.216.173.141 with HTTP; Wed, 16 May 2012 12:49:34 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:60080 Archived-At: It showed up in a quite difficult set-up, but looking at the regexp used it seems obvious the code has problems with this: in the function org-publish-cache-file-needs-publishing there is the line (the only line in org-publish containing the string "INCLUDE") (while (re-search-forward "^#\\+INCLUDE:[ \t]+\"?\\([^ \t\n\r\"]*\\)\"?[ \t]*.*$" nil t) this tries to catch a filename, see #+INCLUDE in the org manual, if I see it correctly (and I have seen the result confirming this) the parentheses catch everything from after the first ", if there is one, up till the first space, tab, newline, carriage return or second ". Up till the first space is a problem. If needed I can try to provide a simple recipe to reproduce my problem, but I think the problem is obvious. I myself removed the ? 's after the " 's to make the " around the filename mandatory and then also removed the space after the ^, as in (while (re-search-forward "^#\\+INCLUDE:[ \t]+\"\\([^\t\n\r\"]*\\)\"[ \t]*.*$" nil t) This solves my problem. For easy reference I have included here the whole defun: (defun org-publish-cache-file-needs-publishing (filename &optional pub-dir pub-func) "Check the timestamp of the last publishing of FILENAME. Return `t', if the file needs publishing. The function also checks if any included files have been more recently published, so that the file including them will be republished as well." (unless org-publish-cache (error "%s" "`org-publish-cache-file-needs-publishing' called, but no cache present")) (let* ((key (org-publish-timestamp-filename filename pub-dir pub-func)) (pstamp (org-publish-cache-get key)) (visiting (find-buffer-visiting filename)) included-files-ctime buf) (when (equal (file-name-extension filename) "org") (setq buf (find-file (expand-file-name filename))) (with-current-buffer buf (goto-char (point-min)) (while (re-search-forward "^#\\+INCLUDE:[ \t]+\"?\\([^ \t\n\r\"]*\\)\"?[ \t]*.*$" nil t) (let* ((included-file (expand-file-name (match-string 1)))) (add-to-list 'included-files-ctime (org-publish-cache-ctime-of-src included-file) t)))) ;; FIXME don't kill current buffer (unless visiting (kill-buffer buf))) (if (null pstamp) t (let ((ctime (org-publish-cache-ctime-of-src filename))) (or (< pstamp ctime) (when included-files-ctime (not (null (delq nil (mapcar (lambda(ct) (< ctime ct)) included-files-ctime)))))))))) Best regards, Albert.