From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Org-mode version 6.32b; org-remember only indents first line of %i substitution Date: Fri, 20 Nov 2009 06:48:38 +0100 Message-ID: References: <649C26F5-AB40-4757-86A9-658FEBB08CD6@iu.edu> <87zl6ijfn2.fsf@gmx.de> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBMMS-0002qQ-ET for emacs-orgmode@gnu.org; Fri, 20 Nov 2009 00:48:48 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBMMN-0002ky-4n for emacs-orgmode@gnu.org; Fri, 20 Nov 2009 00:48:47 -0500 Received: from [199.232.76.173] (port=36686 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBMMM-0002kh-MP for emacs-orgmode@gnu.org; Fri, 20 Nov 2009 00:48:42 -0500 Received: from ey-out-1920.google.com ([74.125.78.144]:23868) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NBMMM-0000uR-56 for emacs-orgmode@gnu.org; Fri, 20 Nov 2009 00:48:42 -0500 Received: by ey-out-1920.google.com with SMTP id 26so351653eyw.2 for ; Thu, 19 Nov 2009 21:48:41 -0800 (PST) In-Reply-To: <87zl6ijfn2.fsf@gmx.de> 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: Sebastian Rose Cc: Org Mode 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" 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!!! 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))) > remember-annotation-functions) > (setq org-stored-links > (cons (list url title) org-stored-links)) > > > > > > Best wishes > > > Sebastian - Carsten