From: Noam Postavsky <npostavs@users.sourceforge.net>
To: Pierre Neidhardt <ambrevar@gmail.com>
Cc: 29110@debbugs.gnu.org
Subject: bug#29110: 25.2; Should push-mark allow duplicates?
Date: Wed, 01 Nov 2017 19:30:24 -0400 [thread overview]
Message-ID: <8760ata86n.fsf@users.sourceforge.net> (raw)
In-Reply-To: <87fu9xioo6.fsf@gmail.com> (Pierre Neidhardt's message of "Thu, 02 Nov 2017 00:07:05 +0100")
Pierre Neidhardt <ambrevar@gmail.com> writes:
>>> - It eats up more memory.
>>
>> Seriously? Bof.
>
> Indeed, bof, that was more of a wink. I do not know the Emacs standard
> in memory consumption though.
>
> But consider this: with Evil, jumping between two marks (so just
> navigating between them) will duplicate each mark every time. You might
> argue that this is bad code on Evil's side. But then high-level
> functions might call the jumping functions in loops... And so on.
Consider this:
mark-ring-max is a variable defined in ‘simple.el’.
Its value is 16
Documentation:
Maximum size of mark ring. Start discarding off end if gets this big.
You can customize this variable.
global-mark-ring-max is the same idea.
> Regardless, I realize that I failed to formulate a proper query in my
> initial report: Does anybody have a hunch as for why duplicate marks
> could potentially interfere with code manipulating the mark-ring? See
> the issues on Helm and Evil.
Both threads seem pretty hard to follow. One thing to note is that
push-mark resets markers before discarding (so that they no longer point
to any buffer). Maybe Helm or Evil keep another reference to a
discarded marker, and try to use it without checking? If you have a way
to reproduce the problem, you can check if bumping up mark-ring-max to a
very large number has any effect.
(defun push-mark (&optional location nomsg activate)
...
(when (> (length mark-ring) mark-ring-max)
(move-marker (car (nthcdr mark-ring-max mark-ring)) nil)
(setcdr (nthcdr (1- mark-ring-max) mark-ring) nil)))
...
(when (> (length global-mark-ring) global-mark-ring-max)
(move-marker (car (nthcdr global-mark-ring-max global-mark-ring)) nil)
(setcdr (nthcdr (1- global-mark-ring-max) global-mark-ring) nil)))
next prev parent reply other threads:[~2017-11-01 23:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8760ata86n.fsf@users.sourceforge.net \
--to=npostavs@users.sourceforge.net \
--cc=29110@debbugs.gnu.org \
--cc=ambrevar@gmail.com \
/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.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).