[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] my capture template generates a literal "%?"
From: |
Bastien |
Subject: |
Re: [O] my capture template generates a literal "%?" |
Date: |
Fri, 10 Aug 2012 11:49:34 +0200 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1.50 (gnu/linux) |
Hi,
Nick Dokos <address@hidden> writes:
> D'oh^2: everything else is interpreted, so why not %? ?
>
> The problem seems to be in org-capture-place-plain-text: the insertion
> of the text happens like this
>
> ,----
> | ...
> | (setq beg (point))
> | (insert txt)
> | (org-capture-empty-lines-after 1)
> | (org-capture-position-for-last-stored beg)
> | (setq end (point))
> | (org-capture-mark-kill-region beg (1- end))
> | (org-capture-narrow beg (1- end))
> | (if (re-search-forward "%\\?" end t) (replace-match ""))))
> `----
>
> but it seesm that just before the re-search-forward, point is at
> end, not at beg, so the search is fruitless. We could search backwards
> to beg instead (but what is the semantics of multiple %? markers in the
> template?), or we could just (goto-char beg) before the search.
There was indeed a problem here, I just fixed it.
Thanks for the directions,
--
Bastien