[Top][All Lists]
[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
From: |
Sebastian Rose |
Subject: |
Re: [Orgmode] Org-mode version 6.32b; org-remember only indents first line of %i substitution |
Date: |
Thu, 19 Nov 2009 23:24:58 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
"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 doesn't run:
>
> (save-match-data
> (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.
>
> ajk
Hi Andrew,
the best way to fix it will be to fix the function
`org-protocol-remember'. If the behaviour occurs solely when called
through org-protocol, this is the place to fix it.
I'll take a look in it....
Hm - initial _should_ be set...
It is here actually. My `?w' template depends on it:
(setq org-remember-templates
'(
;; ... more templates here... ;;
;; Default org-protocol:
( ?w "* %^{Title}\n\n Quelle: %u, %c\n\n %i" nil "Notizen"))
Ahhh - OK, patch is here - please test:
diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el
index 5c65fb0..0684f7a 100644
--- a/lisp/org-protocol.el
+++ b/lisp/org-protocol.el
@@ -471,7 +471,7 @@ Now template ?b will be used."
(type (if (string-match "^\\([a-z]+\\):" url)
(match-string 1 url)))
(title (cadr parts))
- (region (caddr parts))
+ (region (or (caddr parts) ""))
(orglink (org-make-link-string url title))
remember-annotation-functions)
(setq org-stored-links
Best wishes
Sebastian