From: Sebastian Rose <sebastian_rose@gmx.de>
To: "Andrew J. Korty" <ajk@iu.edu>
Cc: Org Mode <emacs-orgmode@gnu.org>, carsten.dominik@gmail.com
Subject: Re: Org-mode version 6.32b; org-remember only indents first line of %i substitution
Date: Thu, 19 Nov 2009 23:47:45 +0100 [thread overview]
Message-ID: <87zl6ijfn2.fsf@gmx.de> (raw)
In-Reply-To: <A2973C82-953D-486C-B4F1-4E22A9F074B6@iu.edu> (Andrew J. Korty's message of "Thu, 19 Nov 2009 16:22:37 -0500")
[-- Attachment #1: Type: text/plain, Size: 995 bytes --]
"Andrew J. Korty" <ajk@iu.edu> 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.
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][ ]]
Test:
(let ((orglink (org-make-link-string
"http://www.google.de" " ")))
(insert orglink))
Which is invisible in Org-files!!!
My patch works around that, too.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-protocol-remember: take users mistakes in account --]
[-- Type: text/x-diff, Size: 823 bytes --]
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)))
remember-annotation-functions)
(setq org-stored-links
(cons (list url title) org-stored-links))
[-- Attachment #3: Type: text/plain, Size: 31 bytes --]
Best wishes
Sebastian
[-- Attachment #4: Type: text/plain, Size: 204 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
next prev parent reply other threads:[~2009-11-19 22:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-12 15:27 Org-mode version 6.32b; org-remember only indents first line of %i substitution Andrew J. Korty
2009-11-18 22:54 ` Carsten Dominik
2009-11-19 21:22 ` Andrew J. Korty
2009-11-19 22:24 ` Sebastian Rose
2009-11-19 22:47 ` Sebastian Rose [this message]
2009-11-20 5:48 ` Carsten Dominik
2009-11-20 22:10 ` Sebastian Rose
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zl6ijfn2.fsf@gmx.de \
--to=sebastian_rose@gmx.de \
--cc=ajk@iu.edu \
--cc=carsten.dominik@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).