[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: Carsten Dominik
Subject: Re: [Orgmode] Org-mode version 6.32b; org-remember only indents first line of %i substitution
Date: Fri, 20 Nov 2009 06:48:38 +0100

Hi Sebastian - I am confused - which is the patch I should apply?

- Carsten

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 doesn't run:

   (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:

 [[url][ ]]


(let ((orglink (org-make-link-string
               "http://www.google.de"; " ")))
 (insert orglink))
Which is invisible in Org-files!!!

I have fixed this also, in a diffeerent way.

- Carsten

My patch works around that, too.

diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el
index 5c65fb0..0d40c2c 100644
--- a/lisp/org-protocol.el
+++ b/lisp/org-protocol.el
@@ -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)))
        (setq org-stored-links
              (cons (list url title) org-stored-links))

Best wishes


- Carsten

reply via email to

[Prev in Thread] Current Thread [Next in Thread]