From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#29110: 25.2; Should push-mark allow duplicates? Date: Wed, 01 Nov 2017 19:30:24 -0400 Message-ID: <8760ata86n.fsf@users.sourceforge.net> References: <87h8udiqv3.fsf@gmail.com> <87fu9xioo6.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1509579074 8661 195.159.176.226 (1 Nov 2017 23:31:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 1 Nov 2017 23:31:14 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) Cc: 29110@debbugs.gnu.org To: Pierre Neidhardt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 02 00:31:10 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eA2TT-0001aE-Bb for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 Nov 2017 00:31:07 +0100 Original-Received: from localhost ([::1]:58064 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eA2Ta-00016r-OW for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 Nov 2017 19:31:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eA2TU-00016a-TV for bug-gnu-emacs@gnu.org; Wed, 01 Nov 2017 19:31:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eA2TP-0007L3-Ss for bug-gnu-emacs@gnu.org; Wed, 01 Nov 2017 19:31:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37913) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eA2TP-0007Kd-PL for bug-gnu-emacs@gnu.org; Wed, 01 Nov 2017 19:31:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eA2TP-0003P8-4k for bug-gnu-emacs@gnu.org; Wed, 01 Nov 2017 19:31:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Nov 2017 23:31:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29110 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 29110-submit@debbugs.gnu.org id=B29110.150957903611296 (code B ref 29110); Wed, 01 Nov 2017 23:31:03 +0000 Original-Received: (at 29110) by debbugs.gnu.org; 1 Nov 2017 23:30:36 +0000 Original-Received: from localhost ([127.0.0.1]:46594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eA2Sw-0002ta-GT for submit@debbugs.gnu.org; Wed, 01 Nov 2017 19:30:36 -0400 Original-Received: from mail-io0-f178.google.com ([209.85.223.178]:54627) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eA2Su-0002m2-T9 for 29110@debbugs.gnu.org; Wed, 01 Nov 2017 19:30:33 -0400 Original-Received: by mail-io0-f178.google.com with SMTP id e89so9786785ioi.11 for <29110@debbugs.gnu.org>; Wed, 01 Nov 2017 16:30:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=KozKx+oEk7sPGQ7+AqXrt2aQwmdLudXhADwxGEEO+5I=; b=bV8BmyuvY+Skb2HPZgjUP70ELe2pYMWU9cLqH8rjyTAxhjl7v6r196X57EIkHsLQ4C uWnYyPpjoKecM4dnlnELpeErh2T103mR67n7XHy+knNxYg2QraYew12B4eq6l5fhlrmE 7QcrLX3tsqoumV+SuDvKWGUW57hzduGhaTNxgWnZC8E3p/tQ79X0RH1vNLQW5GFOVZHY 1SM9YBhvBww5w34qafJ9FCzMYzgOwAfjZh4UN4E6r3wJRDwYPZxynxr4cpYzzpHr+PP1 IKZ60ccF4e6cJWE/4fa+l3HexR5VS+9m1XGEjpsdD1c2VoGZ9UdmXXqprH/0pq/MAzGc Rl/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version :content-transfer-encoding; bh=KozKx+oEk7sPGQ7+AqXrt2aQwmdLudXhADwxGEEO+5I=; b=JWe/wBGazBBA+mQF0wYENk5/9RkJ8fqLbUR1k8MbZqQrjKh5XUe1LEhK+mhZ2taYW+ X6GCReHqxk2jLEdE8nGdgGOz4g+p95Hqri3iCNZIYuYh7Y2XSW95LhcrGVbX1qXHfwcb N3rZvwqhw0mvUCva+jVxkVYbMeFYC11jTal6FYuWoP0L6e4tielHJ9QPeHcxxOtOYUul gna3A2nbdQ1/ywgujRzdljDJQjtu0cjZP2I2bEhDceenEzsRoECaBifkpJ/6tiQUKt36 upMQbZ0tb5LA8Fc8oK1TkThMiHtSz7/EGKP14WF/BLwHP/uIen3E0IAYDhYPOs/cTs77 MDLQ== X-Gm-Message-State: AMCzsaX9zSaVA7I5jvR1xYGmlT/iNobnmGKgbSgdA+8Sh/uljt+o/ySl aDskIkJM1oTh4DVsCR4tnkeguw== X-Google-Smtp-Source: ABhQp+TT5RJ9VG+GT4vWD/ugGxc+QOAndJWzQ8WttJWIxV32/A2WQOv7wf5MGS2/wRp0ZgqP+lcmbA== X-Received: by 10.36.141.65 with SMTP id w62mr44548itd.152.1509579026927; Wed, 01 Nov 2017 16:30:26 -0700 (PDT) Original-Received: from zebian ([45.2.119.34]) by smtp.googlemail.com with ESMTPSA id q191sm217649itb.1.2017.11.01.16.30.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Nov 2017 16:30:26 -0700 (PDT) In-Reply-To: <87fu9xioo6.fsf@gmail.com> (Pierre Neidhardt's message of "Thu, 02 Nov 2017 00:07:05 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:139341 Archived-At: Pierre Neidhardt 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 =E2=80=98simple.el=E2=80=99. 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)))