[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] Org-mode version 6.32b; org-remember only indents first li
Re: [Orgmode] Org-mode version 6.32b; org-remember only indents first line of %i substitution
Fri, 20 Nov 2009 06:48:38 +0100
Hi Sebastian - I am confused - which is the patch I should apply?
On Nov 19, 2009, at 11:47 PM, Sebastian Rose wrote:
"Andrew J. Korty" <address@hidden> writes:
I've learned some more details. The behavior I describe only
occurs when remember is called via org-protocol. When that
happens, `initial' is nil, so the following code in org-remember.el
(let* ((lead (buffer-substring
(point-at-bol) (match-beginning 0))))
(setq v-i (mapconcat 'identity
(org-split-string initial "\n")
(concat "\n" lead)))))
I'm not sure of the best way to fix it.
As `initial' was not set, so might `title' in some cases. Hence this
patch is better.
Carsten: Not sure about the link - but looking at
`org-make-link-string', a string that consists of spaces only, might
create a link like this:
(let ((orglink (org-make-link-string
"http://www.google.de" " ")))
Which is invisible in Org-files!!!
I have fixed this also, in a diffeerent way.
My patch works around that, too.
diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el
index 5c65fb0..0d40c2c 100644
@@ -470,9 +470,10 @@ Now template ?b will be used."
(url (org-protocol-sanitize-uri (car parts)))
(type (if (string-match "^\\([a-z]+\\):" url)
(match-string 1 url)))
- (title (cadr parts))
- (region (caddr parts))
- (orglink (org-make-link-string url title))
+ (title (or (cadr parts) ""))
+ (region (or (caddr parts) ""))
+ (orglink (org-make-link-string
+ url (if (string-match "[^[:space:]]" title) title url)))
(cons (list url title) org-stored-links))