all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#29110: 25.2; Should push-mark allow duplicates?
@ 2017-11-01 22:19 Pierre Neidhardt
  2017-11-01 22:43 ` Drew Adams
  2022-02-08  6:24 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 11+ messages in thread
From: Pierre Neidhardt @ 2017-11-01 22:19 UTC (permalink / raw)
  To: 29110


The `push-mark' function allows for duplicate marks.  I fail to see a
use case, but otherwise I think it's rather inconvenient:

- It makes traversing the ring tedious with respect to end-user
interaction.  (Think Ivy / Helm for the mark ring.)
Duplicates are probably not the expected behaviour for the end-user.

- Functions working with rings will probably want to remove the
duplicates, so they end up calling `remove' and the like over and over
again.

- It eats up more memory.

- It's counter-intuitive to developers who may in turn write code
without being careful that rings may contain duplicates.  This may
result in unexpected behaviour.


I got bitten hard by this while trying to figure out why
`helm-mark-ring` would randomly fail to follow the marks when Evil mode
was `require'd (not even turned on).

I reported the issues on both bug trackers:

- https://github.com/emacs-evil/evil/issues/845

- https://github.com/emacs-helm/helm/issues/1891

We could not find out the root of the issue, but we discovered that
advising `push-mark' so that it does not duplicate marks would do it.  I
know it's not a solution per se, but at least we've got a lead.

To reproduce, start emacs -Q and use "C-SPC C-SPC" a few times at
different spots.  Then move point somewhere and eval:

	(set-marker (mark-marker) (point))
	(push-mark)
	mark-ring

You should now have one duplicate in the ring.

Here is the proposed fix implemented in Helm:

https://github.com/emacs-helm/helm/commit/ffd2abf5c4bdfc998c09730387b11d2bf9ac1032




In GNU Emacs 25.2.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.16)
 of 2017-09-02 built on dhiov23k
Windowing system distributor 'The X.Org Foundation', version 11.0.11905000
System Description:	Gentoo Base System release 2.4.1

Configured using:
 'configure --prefix=/usr --build=x86_64-pc-linux-gnu
 --host=x86_64-pc-linux-gnu --mandir=/usr/share/man
 --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
 --localstatedir=/var/lib --disable-dependency-tracking
 --disable-silent-rules --docdir=/usr/share/doc/emacs-25.2
 --htmldir=/usr/share/doc/emacs-25.2/html --libdir=/usr/lib64
 --program-suffix=-emacs-25 --infodir=/usr/share/info/emacs-25
 --localstatedir=/var
 --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
 --with-gameuser=:gamestat --without-compress-install
 --with-file-notification=inotify --enable-acl --without-dbus
 --without-modules --without-gpm --without-hesiod --without-kerberos
 --without-kerberos5 --with-xml2 --without-selinux --with-gnutls
 --without-wide-int --with-zlib --with-sound=alsa --with-x --without-ns
 --without-gconf --without-gsettings --without-toolkit-scroll-bars
 --with-gif --with-jpeg --with-png --with-rsvg --with-tiff --with-xpm
 --with-imagemagick --with-xft --without-cairo --without-libotf
 --without-m17n-flt --with-x-toolkit=gtk3 --without-xwidgets
 GENTOO_PACKAGE=app-editors/emacs-25.2 'CFLAGS=-march=ivybridge -O2
 -pipe' CPPFLAGS= 'LDFLAGS=-Wl,-O1 -Wl,--as-needed''

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND NOTIFY ACL GNUTLS LIBXML2
FREETYPE XFT ZLIB GTK3 X11

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

Major mode: Debbugs





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

end of thread, other threads:[~2022-02-08  6:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-01 22:19 bug#29110: 25.2; Should push-mark allow duplicates? Pierre Neidhardt
2017-11-01 22:43 ` Drew Adams
2017-11-01 23:07   ` Pierre Neidhardt
2017-11-01 23:30     ` Noam Postavsky
2017-11-02  6:43       ` Pierre Neidhardt
2017-11-02  0:53     ` Drew Adams
2017-11-02  6:40       ` Pierre Neidhardt
2017-11-02 13:34         ` Drew Adams
2017-11-05 14:59           ` Pierre Neidhardt
2017-11-05 18:41             ` Drew Adams
2022-02-08  6:24 ` Lars Ingebrigtsen

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.