Re: [O] Contradiction between code and doc as regards commented lines

2012-10-29 Thread Bastien
Hi Rafael,

Rafael Laboissiere raf...@laboissiere.net writes:

 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.

Applied, thanks.  I just added the TINYCHANGE cookie to your patch.

-- 
 Bastien



Re: [O] Contradiction between code and doc as regards commented lines

2012-10-28 Thread Bastien
Rafael Laboissiere raf...@laboissiere.net 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!

-- 
 Bastien



Re: [O] Contradiction between code and doc as regards commented lines

2012-10-28 Thread Rafael Laboissiere

* Bastien b...@altern.org [2012-10-28 11:10]:


Rafael Laboissiere raf...@laboissiere.net 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



From 72ad3f6f97a87da5b5dfd0df03ca2aed147a61af Mon Sep 17 00:00:00 2001
From: Rafael Laboissiere raf...@laboissiere.net
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



[O] Contradiction between code and doc as regards commented lines

2012-10-27 Thread Rafael Laboissiere
Before Git commit e8046d2, lines like this were treated as comments in 
org-mode:


### This used to be a comment

At present, lines as the above are not highlighted as comments and will 
be exported verbatim.  Only lines like the following are considered to be 
comments, currently:


# Only this is now a comment

This behavior is clearly in contradiction with the documentation, 
according to this relevant part of doc/org.texi:


@node Comment lines,  , Horizontal rules, Structural markup elements
[snip]
Lines starting with zero or more whitespace characters followed by @samp{#}
are treated as comments and will never be exported.

Please, fix the documentation (or restore the previous behavior, if the 
documentation is meant to be correct).


Cheers,

Rafael











Re: [O] Contradiction between code and doc as regards commented lines

2012-10-27 Thread Bastien
Rafael Laboissiere raf...@laboissiere.net writes:

 Please, fix the documentation (or restore the previous behavior, if the
 documentation is meant to be correct).

Done, thanks.

-- 
 Bastien



Re: [O] Contradiction between code and doc as regards commented lines

2012-10-27 Thread Rafael Laboissiere

* Bastien b...@altern.org [2012-10-27 21:44]:


Rafael Laboissiere raf...@laboissiere.net writes:

Please, fix the documentation (or restore the previous behavior, if the 
documentation is meant to be correct).


Done, thanks.


Thanks.

You might be interested in applying the patch attached below, which fixes 
the comments in the *Remember* buffer, allowing them to get correctly 
fontified.


Rafael

From b1ae1021338a156dc7f65256cc6f085b6b2bf103 Mon Sep 17 00:00:00 2001
From: Rafael Laboissiere raf...@laboissiere.net
Date: Sat, 27 Oct 2012 23:40:39 +0200
Subject: [PATCH] org-remember.el: Start the commented lines with the
 appropriate characters

* org-remember.el (org-remember-apply-template): Start the commented
  lines in the Remember temporary buffer with the appropriate
  characters.

TINYCHANGE
---
 lisp/org-remember.el |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lisp/org-remember.el b/lisp/org-remember.el
index d555ca6..bfbca73 100644
--- a/lisp/org-remember.el
+++ b/lisp/org-remember.el
@@ -472,12 +472,12 @@ to be run from that hook to function properly.
 	(erase-buffer)
 	(insert (substitute-command-keys
 		 (format
-		  ## %s  \%s\ - \* %s\
-## C-u C-c C-c  like C-c C-c, and immediately visit note at target location
-## C-0 C-c C-c  \%s\ - \* %s\
-## %s  to select file and header location interactively.
-## C-2 C-c C-c  as child (C-3: as sibling) of the currently clocked item
-## To switch templates, use `\\[org-remember]'.  To abort use `C-c C-k'.\n\n
+		  # %s  \%s\ - \* %s\
+# C-u C-c C-c  like C-c C-c, and immediately visit note at target location
+# C-0 C-c C-c  \%s\ - \* %s\
+# %s  to select file and header location interactively.
+# C-2 C-c C-c  as child (C-3: as sibling) of the currently clocked item
+# To switch templates, use `\\[org-remember]'.  To abort use `C-c C-k'.\n\n
 		  (if org-remember-store-without-prompt C-c C-c C-1 C-c C-c)
 		  (abbreviate-file-name (or file org-default-notes-file))
 		  (or headline )
-- 
1.7.10.4