From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#34908: Push mark in xref-push-marker-stack Date: Wed, 20 Mar 2019 23:59:49 +0200 Organization: LINKOV.NET Message-ID: <87lg192omi.fsf@mail.linkov.net> References: <87h8bz29ht.fsf@mail.linkov.net> <871s32h91o.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="67085"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 34908@debbugs.gnu.org, =?UTF-8?Q?jo=C3=A3o_?= =?UTF-8?Q?t=C3=A1vora?= To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 20 23:44:58 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6jxA-000HFq-MI for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Mar 2019 23:44:57 +0100 Original-Received: from localhost ([127.0.0.1]:54413 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6jx9-0000Gn-Jz for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Mar 2019 18:44:55 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:36247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6jvv-0007hk-4R for bug-gnu-emacs@gnu.org; Wed, 20 Mar 2019 18:43:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h6joZ-0001oN-Hf for bug-gnu-emacs@gnu.org; Wed, 20 Mar 2019 18:36:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38783) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h6joZ-0001oF-AI for bug-gnu-emacs@gnu.org; Wed, 20 Mar 2019 18:36:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h6joZ-0002oZ-5k for bug-gnu-emacs@gnu.org; Wed, 20 Mar 2019 18:36:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Mar 2019 22:36:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34908 X-GNU-PR-Package: emacs Original-Received: via spool by 34908-submit@debbugs.gnu.org id=B34908.155312131910721 (code B ref 34908); Wed, 20 Mar 2019 22:36:03 +0000 Original-Received: (at 34908) by debbugs.gnu.org; 20 Mar 2019 22:35:19 +0000 Original-Received: from localhost ([127.0.0.1]:52322 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h6jnr-0002mr-48 for submit@debbugs.gnu.org; Wed, 20 Mar 2019 18:35:19 -0400 Original-Received: from common.maple.relay.mailchannels.net ([23.83.214.38]:34290) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h6jnp-0002mi-Dx for 34908@debbugs.gnu.org; Wed, 20 Mar 2019 18:35:18 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id DD3715C4A17; Wed, 20 Mar 2019 22:35:15 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a45.g.dreamhost.com (unknown [100.96.20.50]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 209E25C4004; Wed, 20 Mar 2019 22:35:15 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a45.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Wed, 20 Mar 2019 22:35:15 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Shade-Eyes: 0d843dea60c79748_1553121315465_1649853553 X-MC-Loop-Signature: 1553121315464:1763041751 X-MC-Ingress-Time: 1553121315464 Original-Received: from pdx1-sub0-mail-a45.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a45.g.dreamhost.com (Postfix) with ESMTP id 7BA9C81B1D; Wed, 20 Mar 2019 15:35:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=linkov.net; bh=krTzVB 4AYLJCCj3wwZhDkwpDZUE=; b=dKJwsrcjDbs/94I7bVWllXvfZ7+5EQ+W+jxLsW hylsyQGk8rHxrsRcikea58LvYN2SphnRh5GF1VQ/TzNyyeib2r+4/pLgWk1dLKTB CGlqZsHcO421EZqK/UnQdHNWoBvlrko+in7uQwnEnCd+Uz2hj0U/7eDrj6A9+0Nt MoEag= Original-Received: from mail.jurta.org (m91-129-108-250.cust.tele2.ee [91.129.108.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a45.g.dreamhost.com (Postfix) with ESMTPSA id D7E2481B2A; Wed, 20 Mar 2019 15:35:10 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a45 In-Reply-To: (Dmitry Gutov's message of "Wed, 20 Mar 2019 03:47:32 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedutddrieeigdduieefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgfgsehtkeertddtreejnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtkedrvdehtdenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdekrddvhedtpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepughguhhtohhvseihrghnuggvgidrrhhunecuvehluhhsthgvrhfuihiivgepvd 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: 209.51.188.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:156552 Archived-At: >> I'm not sure where to call push-mark: closer to the command, >> or closer to ring-insert. It seems a suitable place for >> push-mark is in xref-push-marker-stack as its name suggests. > > I'd rather have a more localized change, at least for now. And leave > xref-push-marker-stack to only modify its own data structure. Do you think other commands that use xref-push-marker-stack won't need setting the mark? > So how about this? > > diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el > index 6974d00048..015ea16f34 100644 > --- a/lisp/progmodes/xref.el > +++ b/lisp/progmodes/xref.el > @@ -797,6 +797,7 @@ xref--read-identifier-history > (defvar xref--read-pattern-history nil) > > (defun xref--show-xrefs (xrefs display-action &optional always-show-li= st) > + (push-mark nil t) push-mark is usually called closer to the end of the command. > (cond > ((and (not (cdr xrefs)) (not always-show-list)) > (xref-push-marker-stack) Some commands like e.g. =E2=80=98goto-line=E2=80=99 use such idiom: (or (region-active-p) (push-mark)) documented in its docstring as Prior to moving point, this function sets the mark (without activating it), unless Transient Mark mode is enabled and the mark is already active.