From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#29110: 25.2; Should push-mark allow duplicates? Date: Wed, 1 Nov 2017 15:43:14 -0700 (PDT) Message-ID: References: <87h8udiqv3.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1509576253 2294 195.159.176.226 (1 Nov 2017 22:44:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 1 Nov 2017 22:44:13 +0000 (UTC) To: Pierre Neidhardt , 29110@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 01 23:44:09 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 1eA1k1-0000Eg-HH for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 Nov 2017 23:44:09 +0100 Original-Received: from localhost ([::1]:57968 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eA1k8-0003sm-TC for geb-bug-gnu-emacs@m.gmane.org; Wed, 01 Nov 2017 18:44:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eA1k1-0003sf-25 for bug-gnu-emacs@gnu.org; Wed, 01 Nov 2017 18:44:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eA1jw-00065n-5k for bug-gnu-emacs@gnu.org; Wed, 01 Nov 2017 18:44:09 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37878) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eA1jw-00065U-1m for bug-gnu-emacs@gnu.org; Wed, 01 Nov 2017 18:44:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eA1ju-0005ra-Fw for bug-gnu-emacs@gnu.org; Wed, 01 Nov 2017 18:44:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Nov 2017 22:44:02 +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.150957620722487 (code B ref 29110); Wed, 01 Nov 2017 22:44:02 +0000 Original-Received: (at 29110) by debbugs.gnu.org; 1 Nov 2017 22:43:27 +0000 Original-Received: from localhost ([127.0.0.1]:46559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eA1jL-0005qd-DG for submit@debbugs.gnu.org; Wed, 01 Nov 2017 18:43:27 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:46859) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eA1jI-0005qM-AY for 29110@debbugs.gnu.org; Wed, 01 Nov 2017 18:43:24 -0400 Original-Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id vA1MhGGp027540 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 1 Nov 2017 22:43:17 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id vA1MhFBX026751 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 1 Nov 2017 22:43:16 GMT Original-Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id vA1MhFob017077; Wed, 1 Nov 2017 22:43:15 GMT In-Reply-To: <87h8udiqv3.fsf@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4600.0 (x86)] X-Source-IP: userv0022.oracle.com [156.151.31.74] 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:139338 Archived-At: > The `push-mark' function allows for duplicate marks. I fail to see a > use case, but otherwise I think it's rather inconvenient: It's not necessarily inconvenient for everyone or every use case. If you or Helm or whatever wants to remove duplicates you can always do so. You can also prevent a duplicate from being added. And you can choose whether pushing what would otherwise become a duplicate should remove an "older" duplicate member or prevent the "newer" potentially duplicate member. There are lots of possibilities. Consider the simple case of someone using vanilla `C-u C-SPC'. Someone might want to have duplicates at different positions in the ring, visiting them in order. I, like you apparently, use an interface that lets me cycle among marks in various ways (various orders), cycle among various subsets of the available marks (filtering), or access marks directly. And with the interface I use (Icicles) I can choose to remove duplicates, in general. (And the default command that moves among markers does remove duplicates.) But I can imagine other interfaces and other use cases. I think this kind of choice should be up to the user or the interface author. Helm can decide to remove/prevent duplicates, or you can as one user. I don't see why Emacs itself should. (Just one opinion, though.) > - 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. It depends on the interface, the user, and the use case. > - Functions working with rings will probably want to remove the > duplicates, so they end up calling `remove' and the like over and over > again. Why "over and over again"? You can prevent adding duplicates, no? > - It eats up more memory. Seriously? Bof. > - 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. Bof. Developers should get beyond depending on any such naive "intuition". > I got bitten hard by this And now you know. ;-) > 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. It's a fine individual solution, IMO, if you never want duplicates.