emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] lisp/ox-publish.el: Handle includes with searches


From: Nicolas Goaziou
Subject: Re: [O] [PATCH] lisp/ox-publish.el: Handle includes with searches
Date: Tue, 29 Dec 2015 22:17:02 +0100

Hello,

aman <address@hidden> writes:

>     I was using org-publish which was already applied with this patch.
>     but I got following error message when I published an org file including
> another one.
>     <error message>
>     org-publish-cache-ctime-of-src: No such file:
> "/home/emacs/gtd/inbox.org::writing"
>     </error>
>     
>    here's the including block:
>    <block>
>    * including file
>       #+INCLUDE: "../../inbox.org::writing blog" :only-contents t
>    </block>
>
>     This patch works fine if there's spaces between "inbox.org" and
> "::writing blog".

Indeed.

> -                           (string-match "^\\(\".+?\"\\|\\S-+\\)" value)
> -                           ;; Ignore search suffix.
> -                           (car (split-string
> -                                 (org-remove-double-quotes
> -                                  (match-string 1 value)))))))))
> +                           (string-match 
> "^\\(\".+?\"\\|\\S-+\\)\\(?:\\s-+\\|$\\)" value)
> +                              (let ((matched (match-string 1 value)))
> +                                (when (string-match "\\(::\\(.*?\\)\\)\"?\\'"
> +                                                matched)
> +                                  (setq matched
> +                                        (replace-match "" nil nil matched 1))
> +                                  (print matched))
> +                                (org-remove-double-quotes matched))
> +                              )))))

You should remove (print matched). Also, parenthesis should not be alone
on their own line.

I suggest to replace it with:

  (let ((matched (match-string 1 value)))
    (org-remove-double-quotes
     (if (string-match "\\(::\\(.*?\\)\\)\"?\\'" matched)
         (substring matched 0 (match-beginning 0))
       matched)))

>           (when included-file
> -           (push (org-publish-cache-ctime-of-src
> +           (push (org-publish-cache-ctime-oef-src

Typo.


Eventually, could you provide an appropriate commit message?

Thank you.


Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]