all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* apparent bug in org-insert-link with active region
@ 2007-10-03 15:56 William Henney
  2007-10-03 21:15 ` Bastien
  2007-10-04  7:26 ` Carsten Dominik
  0 siblings, 2 replies; 6+ messages in thread
From: William Henney @ 2007-10-03 15:56 UTC (permalink / raw)
  To: org-mode

Hi list

If I call org-insert-link with the region active, then the region
content is instantly deleted while I am prompted for the link. This is
rather disconcerting, but for most link types the region content
magically reappears as the default value of the description. However,
for "file:" links the default value of the description becomes the
link itself, and the previous content of the region is lost (as far as
I can see). Is this intended?

This is with Org version 5.09 - I'm sure it used to work at some time
in the past.

Cheers

Will

-- 

  Dr William Henney, Centro de Radioastronomía y Astrofísica,
  Universidad Nacional Autónoma de México, Campus Morelia

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: apparent bug in org-insert-link with active region
  2007-10-03 15:56 apparent bug in org-insert-link with active region William Henney
@ 2007-10-03 21:15 ` Bastien
  2007-10-04  0:16   ` William Henney
  2007-10-04  7:26 ` Carsten Dominik
  1 sibling, 1 reply; 6+ messages in thread
From: Bastien @ 2007-10-03 21:15 UTC (permalink / raw)
  To: emacs-orgmode

"William Henney" <whenney@gmail.com> writes:

> If I call org-insert-link with the region active, then the region
> content is instantly deleted while I am prompted for the link. This is
> rather disconcerting, but for most link types the region content
> magically reappears as the default value of the description.

Yes, maybe the region shouldn't be deleted before the link is actually
inserted.

> However, for "file:" links the default value of the description
> becomes the link itself, and the previous content of the region is
> lost (as far as I can see). Is this intended?

For me, the default value for the description is *always* the active
region, this one being a simple string or a file link. So I expect the
default value of the description itself being "the link itself", since
it equals the active region...  or did I miss something?

-- 
Bastien

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: apparent bug in org-insert-link with active region
  2007-10-03 21:15 ` Bastien
@ 2007-10-04  0:16   ` William Henney
  2007-10-04 10:44     ` Bastien
  0 siblings, 1 reply; 6+ messages in thread
From: William Henney @ 2007-10-04  0:16 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Hi Bastien

Thanks for looking into this.

On 10/3/07, Bastien <bzg@altern.org> wrote:
> "William Henney" <whenney@gmail.com> writes:
>
> > If I call org-insert-link with the region active, then the region
> > content is instantly deleted while I am prompted for the link. This is
> > rather disconcerting, but for most link types the region content
> > magically reappears as the default value of the description.
>
> Yes, maybe the region shouldn't be deleted before the link is actually
> inserted.
>
> > However, for "file:" links the default value of the description
> > becomes the link itself, and the previous content of the region is
> > lost (as far as I can see). Is this intended?
>
> For me, the default value for the description is *always* the active
> region, this one being a simple string or a file link. So I expect the
> default value of the description itself being "the link itself", since
> it equals the active region...  or did I miss something?
>

Yes, I think you are... I wasn't saying that the active region was of
the form "file:something", but rather that the link target was of that
form. What happens for me is the following (when I do org-insert-link
with the region active)

1. The region is deleted in the org buffer

2. I am shown the "Link:" prompt in the mini-buffer

3. I type in the link (or use arrows or return to grab a stored link)

4. I am shown the "Description:" prompt in the mini-buffer

5a. If the link I entered in step 3 was something like
"http://foo.org", then all is well - the deleted region from step 1
appears as the default description.

5b. However, if the link I inserted in step 3 was something like
"file:/etc/whatever", then I no longer get the deleted region as the
default description. Instead, I just get "file:/etc/whatever"

I hope this is clearer. I thought perhaps the problem was with my
personal set-up, so I tried it with "emacs -Q -q -l minimal-org.el",
where the file minimal-org.el is given below. I still see the problem
(that is, behaviour 5b instead of 5a) whenever the link is of the form
"file:/path/to/myfile"

I have also found another apparent bug. When I do C-u C-c C-l, then
(as described in the docs) I get prompted for a filename with path
completion. However, this time the default description is blank
(whether or not the region was active).

Cheers

Will

;;;--------------------- minimal-org.el ----------------------------
(add-to-list 'load-path (expand-file-name "~/emacs/lisp/org"))
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(define-key global-map "\C-cl" 'org-store-link)
(require 'org-install)
;;;--------------------- minimal-org.el ----------------------------


-- 

  Dr William Henney, Centro de Radioastronomía y Astrofísica,
  Universidad Nacional Autónoma de México, Campus Morelia

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: apparent bug in org-insert-link with active region
  2007-10-03 15:56 apparent bug in org-insert-link with active region William Henney
  2007-10-03 21:15 ` Bastien
@ 2007-10-04  7:26 ` Carsten Dominik
  2007-10-04 14:37   ` William Henney
  1 sibling, 1 reply; 6+ messages in thread
From: Carsten Dominik @ 2007-10-04  7:26 UTC (permalink / raw)
  To: William Henney; +Cc: org-mode


On Oct 3, 2007, at 17:56, William Henney wrote:

> Hi list
>
> If I call org-insert-link with the region active, then the region
> content is instantly deleted while I am prompted for the link. This is
> rather disconcerting, but for most link types the region content
> magically reappears as the default value of the description. However,
> for "file:" links the default value of the description becomes the
> link itself, and the previous content of the region is lost (as far as
> I can see). Is this intended?
>
> This is with Org version 5.09 - I'm sure it used to work at some time
> in the past.

You have found a bug - fixed for 5.11.  I am also keeping the region
in the buffer until the last moment now, to ease your discomfort :-)
Thanks.

- Carsten



--
Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: apparent bug in org-insert-link with active region
  2007-10-04  0:16   ` William Henney
@ 2007-10-04 10:44     ` Bastien
  0 siblings, 0 replies; 6+ messages in thread
From: Bastien @ 2007-10-04 10:44 UTC (permalink / raw)
  To: emacs-orgmode

"William Henney" <whenney@gmail.com> writes:

> 5a. If the link I entered in step 3 was something like
> "http://foo.org", then all is well - the deleted region from step 1
> appears as the default description.
>
> 5b. However, if the link I inserted in step 3 was something like
> "file:/etc/whatever", then I no longer get the deleted region as the
> default description. Instead, I just get "file:/etc/whatever"
>
> I hope this is clearer. 

Yes, much clearer!  Thanks for the detailed explanations.

-- 
Bastien

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: apparent bug in org-insert-link with active region
  2007-10-04  7:26 ` Carsten Dominik
@ 2007-10-04 14:37   ` William Henney
  0 siblings, 0 replies; 6+ messages in thread
From: William Henney @ 2007-10-04 14:37 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: org-mode

On 10/4/07, Carsten Dominik <dominik@science.uva.nl> wrote:
> You have found a bug - fixed for 5.11.  I am also keeping the region
> in the buffer until the last moment now, to ease your discomfort :-)

Great, thanks. I am feeling more comfortable already :)

Cheers

Will

-- 

  Dr William Henney, Centro de Radioastronomía y Astrofísica,
  Universidad Nacional Autónoma de México, Campus Morelia

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-10-04 14:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-03 15:56 apparent bug in org-insert-link with active region William Henney
2007-10-03 21:15 ` Bastien
2007-10-04  0:16   ` William Henney
2007-10-04 10:44     ` Bastien
2007-10-04  7:26 ` Carsten Dominik
2007-10-04 14:37   ` William Henney

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.