From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rafael Laboissiere Subject: Re: Contradiction between code and doc as regards commented lines Date: Sun, 28 Oct 2012 17:50:21 +0100 Message-ID: <20121028165021.GR31999@laboissiere.net> References: <20121027190405.GL31999@laboissiere.net> <871ugjlmxs.fsf@bzg.ath.cx> <20121027215041.GM31999@laboissiere.net> <87ehkikits.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="j2AXaZ4YhVcLc+PQ" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:48661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TSW49-0000FV-BM for emacs-orgmode@gnu.org; Sun, 28 Oct 2012 12:50:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TSW48-0004v0-6R for emacs-orgmode@gnu.org; Sun, 28 Oct 2012 12:50:25 -0400 Received: from xvm-168-252.ghst.net ([95.142.168.252]:59970 helo=laboissiere.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TSW48-0004un-0Z for emacs-orgmode@gnu.org; Sun, 28 Oct 2012 12:50:24 -0400 Content-Disposition: inline In-Reply-To: <87ehkikits.fsf@bzg.ath.cx> 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: Bastien Cc: emacs-orgmode@gnu.org --j2AXaZ4YhVcLc+PQ Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline * Bastien [2012-10-28 11:10]: > Rafael Laboissiere writes: > >> You might be interested in applying the patch attached below, which fixes >> the comments in the *Remember* buffer, allowing them to get correctly >> fontified. > > Applied, thanks! Thanks. I just noticed that my patch have a bad side effect, since the commented lines at the beginning of the *Remember* buffer are not filtered out before inclusion into the destination org file. The patch attached below fixes this. Also, the org-remember-handler function attempts to strip comment lines at the end of the buffer. I changed the code such that only lines that really respect the definition of comment lines (as per the documentation) are actually stripped. Rafael --j2AXaZ4YhVcLc+PQ Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0002-org-remember.el-Correctly-strip-the-comment-lines-in.patch" >From 72ad3f6f97a87da5b5dfd0df03ca2aed147a61af Mon Sep 17 00:00:00 2001 From: Rafael Laboissiere Date: Sun, 28 Oct 2012 17:38:19 +0100 Subject: [PATCH 2/2] org-remember.el: Correctly strip the comment lines in remember buffer * org-remember.el (org-remember-handler): Correctly strip the comment lines in the temporary buffer *Remember* when handling a remember note. --- lisp/org-remember.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org-remember.el b/lisp/org-remember.el index bfbca73..5cfe70f 100644 --- a/lisp/org-remember.el +++ b/lisp/org-remember.el @@ -840,12 +840,12 @@ See also the variable `org-reverse-note-order'." (if (= end beg) (setq beg (1- beg))) (put-text-property beg end 'org-position-cursor t))) (goto-char (point-min)) - (while (looking-at "^[ \t]*\n\\|^##.*\n") + (while (looking-at "^[ \t]*\n\\|^# .*\n") (replace-match "")) (when org-remember-delete-empty-lines-at-end (goto-char (point-max)) (beginning-of-line 1) - (while (and (looking-at "[ \t]*$\\|##.*") (> (point) 1)) + (while (and (looking-at "[ \t]*$\\|[ \t]*# .*") (> (point) 1)) (delete-region (1- (point)) (point-max)) (beginning-of-line 1))) (catch 'quit -- 1.7.10.4 --j2AXaZ4YhVcLc+PQ--