GNU bug report logs - #19471
Can't copy display-string text

Previous Next

Package: emacs;

Reported by: "Kelly Dean" <kelly <at> prtime.org>

Date: Tue, 30 Dec 2014 09:57:01 UTC

Severity: wishlist

Merged with 25131, 29286

Found in version 25.0.95

To reply to this bug, email your comments to 19471 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#19471; Package emacs. (Tue, 30 Dec 2014 09:57:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Kelly Dean" <kelly <at> prtime.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 30 Dec 2014 09:57:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Kelly Dean" <kelly <at> prtime.org>
To: bug-gnu-emacs <at> gnu.org
Subject: Emacs can't copy text
Date: Tue, 30 Dec 2014 09:53:52 +0000
Do:
C-h i g (elisp)translation keymaps RET
C-HOME C-SPACE DOWN M-w
C-x b foo RET C-y

What it looks like you copied is ⌜(elisp)Top > Keymaps > Translation Keymaps⌝. But when you paste it, you instead get
⌜File: elisp.info,  Node: Translation Keymaps,  Next: Key Binding Commands,  Prev: Remapping Commands,  Up: Keymaps⌝

I suppose that's rational in some twisted sense, but it's unreasonable user-unfriendliness for a text editor.
See my message ⌜Re: Correspondence between web-pages and Info-pages⌝ in emacs-devel for why this matters.

I tried switching the buffer to fundamental mode in order to copy the text, but that didn't solve the problem, so Emacs apparently has some kind of low-level text-mangling voodoo that hijacks kill-ring-save.

Yes, the Info page name is effectively like an HTML page title, and web browsers don't let you copy the title either, at least not without some special effort. But at least web browsers don't mislead you by letting you select the title text and perform an apparently-successful copy operation, which you only discover copied the wrong text when you try to paste it.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19471; Package emacs. (Mon, 04 Jul 2016 03:32:02 GMT) Full text and rfc822 format available.

Message #8 received at 19471 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: "Kelly Dean" <kelly <at> prtime.org>
Cc: 19471 <at> debbugs.gnu.org
Subject: Re: bug#19471: Emacs can't copy text
Date: Sun, 03 Jul 2016 23:31:09 -0400
retitle 19471 Can't copy display-string text
severity 19471 wishlist
found 19471 25.0.95
quit

"Kelly Dean" <kelly <at> prtime.org> writes:

> Do:
> C-h i g (elisp)translation keymaps RET
> C-HOME C-SPACE DOWN M-w
> C-x b foo RET C-y
>
> What it looks like you copied is ⌜(elisp)Top > Keymaps > Translation Keymaps⌝. But when you paste it, you instead get
> ⌜File: elisp.info,  Node: Translation Keymaps,  Next: Key Binding Commands,  Prev: Remapping Commands,  Up: Keymaps⌝
>
> I suppose that's rational in some twisted sense, but it's unreasonable user-unfriendliness for a text editor.
> See my message ⌜Re: Correspondence between web-pages and Info-pages⌝ in emacs-devel for why this matters.
>
> I tried switching the buffer to fundamental mode in order to copy the
> text, but that didn't solve the problem, so Emacs apparently has some
> kind of low-level text-mangling voodoo that hijacks kill-ring-save.

It's implemented by an overlay with a display property.  Normal Emacs
text copying commands work on the underlying text, rather than the
displayed one.  You can see the what overlays/properties are in effect
by doing C-u C-x = on the string in question.

Perhaps we could add some feature to be able to copy the displayed
string instead of the underlying text.




Changed bug title to 'Can't copy display-string text' from 'Emacs can't copy text' Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Mon, 04 Jul 2016 03:32:02 GMT) Full text and rfc822 format available.

Severity set to 'wishlist' from 'minor' Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Mon, 04 Jul 2016 03:32:02 GMT) Full text and rfc822 format available.

bug Marked as found in versions 25.0.95. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Mon, 04 Jul 2016 03:32:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19471; Package emacs. (Mon, 04 Jul 2016 09:05:01 GMT) Full text and rfc822 format available.

Message #17 received at 19471 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: npostavs <at> users.sourceforge.net
Cc: Kelly Dean <kelly <at> prtime.org>, 19471 <at> debbugs.gnu.org
Subject: Re: bug#19471: Emacs can't copy text
Date: Mon, 04 Jul 2016 11:03:39 +0200
On Sun, 03 Jul 2016 23:31:09 -0400 npostavs <at> users.sourceforge.net wrote:

> retitle 19471 Can't copy display-string text
> severity 19471 wishlist
> found 19471 25.0.95
> quit
>
> "Kelly Dean" <kelly <at> prtime.org> writes:
>
>> Do:
>> C-h i g (elisp)translation keymaps RET
>> C-HOME C-SPACE DOWN M-w
>> C-x b foo RET C-y
>>
>> What it looks like you copied is ⌜(elisp)Top > Keymaps > Translation
>> Keymaps⌝. But when you paste it, you instead get
>> ⌜File: elisp.info, Node: Translation Keymaps, Next: Key Binding Commands,
>> Prev: Remapping Commands, Up: Keymaps⌝
>>
>> I suppose that's rational in some twisted sense, but it's unreasonable
>> user-unfriendliness for a text editor.
>> See my message ⌜Re: Correspondence between web-pages and Info-pages⌝ in
>> emacs-devel for why this matters.
>>
>> I tried switching the buffer to fundamental mode in order to copy the
>> text, but that didn't solve the problem, so Emacs apparently has some
>> kind of low-level text-mangling voodoo that hijacks kill-ring-save.
>
> It's implemented by an overlay with a display property.  Normal Emacs
> text copying commands work on the underlying text, rather than the
> displayed one.  You can see the what overlays/properties are in effect
> by doing C-u C-x = on the string in question.
>
> Perhaps we could add some feature to be able to copy the displayed
> string instead of the underlying text.

In fact, with text properties instead of overlays, the displayed string
is copied (cf. the variable yank-handled-properties), as can be seen by
copying the first line below the section title of the above Info node:

   When the ‘read-key-sequence’ function reads a key sequence (*note Key

"see " is a display text property, but appears when this text is yanked.

So the disparity between copying and yanking the two bits of text here
does seem user-unfriendly.

Steve Berman




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19471; Package emacs. (Mon, 04 Jul 2016 09:23:02 GMT) Full text and rfc822 format available.

Message #20 received at 19471 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: npostavs <at> users.sourceforge.net
Cc: Kelly Dean <kelly <at> prtime.org>, 19471 <at> debbugs.gnu.org
Subject: Re: bug#19471: Emacs can't copy text
Date: Mon, 04 Jul 2016 11:21:45 +0200
On Mon, 04 Jul 2016 11:03:39 +0200 Stephen Berman <stephen.berman <at> gmx.net> wrote:

> In fact, with text properties instead of overlays, the displayed string
> is copied (cf. the variable yank-handled-properties), as can be seen by
> copying the first line below the section title of the above Info node:
>
>    When the ‘read-key-sequence’ function reads a key sequence (*note Key
>
> "see " is a display text property, but appears when this text is yanked.

Well, what showed up here as "*note " did appear as "see " when I yanked
that text into the Message mode buffer...

Steve Berman




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19471; Package emacs. (Mon, 04 Jul 2016 14:47:01 GMT) Full text and rfc822 format available.

Message #23 received at 19471 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: npostavs <at> users.sourceforge.net
Cc: kelly <at> prtime.org, 19471 <at> debbugs.gnu.org
Subject: Re: bug#19471: Emacs can't copy text
Date: Mon, 04 Jul 2016 17:46:24 +0300
> From: npostavs <at> users.sourceforge.net
> Date: Sun, 03 Jul 2016 23:31:09 -0400
> Cc: 19471 <at> debbugs.gnu.org
> 
> Perhaps we could add some feature to be able to copy the displayed
> string instead of the underlying text.

Indeed, this would be useful, IMO.  The tricky part is to figure out
what is actually displayed, when there are several overlays at point.

Volunteers are welcome.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19471; Package emacs. (Mon, 04 Jul 2016 15:01:02 GMT) Full text and rfc822 format available.

Message #26 received at 19471 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: kelly <at> prtime.org, 19471 <at> debbugs.gnu.org, npostavs <at> users.sourceforge.net
Subject: Re: bug#19471: Emacs can't copy text
Date: Mon, 04 Jul 2016 18:00:04 +0300
> From: Stephen Berman <stephen.berman <at> gmx.net>
> Date: Mon, 04 Jul 2016 11:21:45 +0200
> Cc: Kelly Dean <kelly <at> prtime.org>, 19471 <at> debbugs.gnu.org
> 
> On Mon, 04 Jul 2016 11:03:39 +0200 Stephen Berman <stephen.berman <at> gmx.net> wrote:
> 
> > In fact, with text properties instead of overlays, the displayed string
> > is copied (cf. the variable yank-handled-properties), as can be seen by
> > copying the first line below the section title of the above Info node:
> >
> >    When the ‘read-key-sequence’ function reads a key sequence (*note Key
> >
> > "see " is a display text property, but appears when this text is yanked.
> 
> Well, what showed up here as "*note " did appear as "see " when I yanked
> that text into the Message mode buffer...

And that's the crux of the issue, AFAIU: the OP wanted to be able to
copy/paste the display string so that it would be visible even outside
of Emacs, e.g. when sent in an email message or written to a disk
file.  In that case, text properties and overlay properties/strings
behave the same: you lose them.

The fact that text properties are copied with the text, while overlay
strings and properties aren't is the intended behavior, Emacs does
that since the day overlays were introduced.




Forcibly Merged 19471 25131. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Wed, 07 Dec 2016 16:28:02 GMT) Full text and rfc822 format available.

Merged 19471 25131 29286. Request was from Noam Postavsky <npostavs <at> users.sourceforge.net> to control <at> debbugs.gnu.org. (Mon, 13 Nov 2017 22:18:01 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 213 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.