GNU bug report logs - #29013
25.3; [wishlist] do not yank whitespace

Previous Next

Package: emacs;

Reported by: Alex Branham <alex.branham <at> gmail.com>

Date: Thu, 26 Oct 2017 15:41:02 UTC

Severity: wishlist

Found in version 25.3

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 29013 in the body.
You can then email your comments to 29013 AT debbugs.gnu.org in the normal way.

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#29013; Package emacs. (Thu, 26 Oct 2017 15:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Alex Branham <alex.branham <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 26 Oct 2017 15:41:02 GMT) Full text and rfc822 format available.

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

From: Alex Branham <alex.branham <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.3; [wishlist] do not yank whitespace
Date: Thu, 26 Oct 2017 10:40:13 -0500
It would be nice to have an option so that yank never returns pure whitespace. The current behavior is such that if we have:

#+BEGIN_EXAMPLE
some text here

some text there|
#+END_EXAMPLE

with | representing where point is, if you execute C-SPC C-a M-w C-p C-k C-p C-y then you end up with:

#+BEGIN_EXAMPLE

some text here
some text there
#+END_EXAMPLE

but I would like to end up with:

#+BEGIN_EXAMPLE
some text there
some text here
some text there
#+END_EXAMPLE

Thanks,
Alex


In GNU Emacs 25.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.19)
 of 2017-09-16 built on juergen
Windowing system distributor 'The X.Org Foundation', version 11.0.11905000
Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=gtk3 --with-xft --with-modules
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong
 -fno-plt' CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 MODULES

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29013; Package emacs. (Thu, 26 Oct 2017 15:53:01 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> suse.de>
To: Alex Branham <alex.branham <at> gmail.com>
Cc: 29013 <at> debbugs.gnu.org
Subject: Re: bug#29013: 25.3; [wishlist] do not yank whitespace
Date: Thu, 26 Oct 2017 17:52:34 +0200
On Okt 26 2017, Alex Branham <alex.branham <at> gmail.com> wrote:

> It would be nice to have an option so that yank never returns pure whitespace. The current behavior is such that if we have:
>
> #+BEGIN_EXAMPLE
> some text here
>
> some text there|
> #+END_EXAMPLE
>
>
> with | representing where point is, if you execute C-SPC C-a M-w C-p C-k C-p C-y then you end up with:
>
> #+BEGIN_EXAMPLE
>
> some text here
> some text there
> #+END_EXAMPLE
>
>
> but I would like to end up with:
>
> #+BEGIN_EXAMPLE
> some text there
> some text here
> some text there
> #+END_EXAMPLE

Just type M-y (yank-pop) to get the next element from the kill ring.
You can also use DEL to delete the empty line without polluting the kill
ring.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab <at> suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29013; Package emacs. (Thu, 26 Oct 2017 15:57:02 GMT) Full text and rfc822 format available.

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

From: Alex Branham <alex.branham <at> gmail.com>
To: Andreas Schwab <schwab <at> suse.de>
Cc: 29013 <at> debbugs.gnu.org
Subject: Re: bug#29013: 25.3; [wishlist] do not yank whitespace
Date: Thu, 26 Oct 2017 10:56:40 -0500
On Thu 26 Oct 2017 at 15:52, Andreas Schwab <schwab <at> suse.de> wrote:

> Just type M-y (yank-pop) to get the next element from the kill ring.
> You can also use DEL to delete the empty line without polluting the kill
> ring.

Thanks for the response.

Yes, I know I can work around this. However, I rarely (if ever) want to yank pure whitespace. It'd be nice not to have to think about it.

Alex





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#29013; Package emacs. (Wed, 30 Jun 2021 13:57:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Alex Branham <alex.branham <at> gmail.com>
Cc: 29013 <at> debbugs.gnu.org
Subject: Re: bug#29013: 25.3; [wishlist] do not yank whitespace
Date: Wed, 30 Jun 2021 15:56:12 +0200
Alex Branham <alex.branham <at> gmail.com> writes:

> It would be nice to have an option so that yank never returns pure
> whitespace.

I think that's a good idea -- or, to be more general, I think it would
be nice if there was a way to transform texts before they're put on the
kill ring, and possibly discard them.

So for this particular use case, the transformation function could
return nil to indicate that it shouldn't land in the kill ring.

So I've now added this to Emacs 28 under the name kill-transform-function.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 29013 <at> debbugs.gnu.org and Alex Branham <alex.branham <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 30 Jun 2021 13:57:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 29 Jul 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 284 days ago.

Previous Next


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