From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: my capture template generates a literal "%?" Date: Fri, 10 Aug 2012 11:49:34 +0200 Message-ID: <87pq6zkrf5.fsf@gnu.org> References: <502364D2.7030208@googlemail.com> <18245.1344523075@alphaville> <18545.1344523720@alphaville> <19288.1344526546@alphaville> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:42930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Szlq9-0006tR-5r for emacs-orgmode@gnu.org; Fri, 10 Aug 2012 05:49:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Szlq6-0008NK-U9 for emacs-orgmode@gnu.org; Fri, 10 Aug 2012 05:49:09 -0400 Received: from mail-we0-f169.google.com ([74.125.82.169]:43928) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Szlq6-0008NE-N2 for emacs-orgmode@gnu.org; Fri, 10 Aug 2012 05:49:06 -0400 Received: by weys10 with SMTP id s10so1000391wey.0 for ; Fri, 10 Aug 2012 02:49:05 -0700 (PDT) In-Reply-To: <19288.1344526546@alphaville> (Nick Dokos's message of "Thu, 09 Aug 2012 11:35:46 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: G , emacs-orgmode@gnu.org Hi, Nick Dokos 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