From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose 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 Message-ID: <87zl6ijfn2.fsf@gmx.de> References: <649C26F5-AB40-4757-86A9-658FEBB08CD6@iu.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBFnH-0001eB-Fz for emacs-orgmode@gnu.org; Thu, 19 Nov 2009 17:48:03 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBFnC-0001aE-U5 for emacs-orgmode@gnu.org; Thu, 19 Nov 2009 17:48:03 -0500 Received: from [199.232.76.173] (port=50884 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBFnC-0001a3-Ij for emacs-orgmode@gnu.org; Thu, 19 Nov 2009 17:47:58 -0500 Received: from mail.gmx.net ([213.165.64.20]:38295) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1NBFnB-0003hT-Op for emacs-orgmode@gnu.org; Thu, 19 Nov 2009 17:47:58 -0500 In-Reply-To: (Andrew J. Korty's message of "Thu, 19 Nov 2009 16:22:37 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Andrew J. Korty" Cc: Org Mode , carsten.dominik@gmail.com --=-=-= "Andrew J. Korty" 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. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=org-protocol-remember-title-and-initial.patch Content-Description: org-protocol-remember: take users mistakes in account 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)) --=-=-= Best wishes Sebastian --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --=-=-=--