emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Sebastian Rose <sebastian_rose@gmx.de>
Cc: Org Mode <emacs-orgmode@gnu.org>
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	[thread overview]
Message-ID: <DD23969D-F3E8-4DF9-A89E-8939153A2C8A@gmail.com> (raw)
In-Reply-To: <87zl6ijfn2.fsf@gmx.de>

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" <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!!!

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

  reply	other threads:[~2009-11-20  5: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
2009-11-20  5:48       ` Carsten Dominik [this message]
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=DD23969D-F3E8-4DF9-A89E-8939153A2C8A@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=sebastian_rose@gmx.de \
    /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).