GNU bug report logs - #31086
[PATCH] xref: Make xref-push-marker-stack interactive

Previous Next

Package: emacs;

Reported by: George Kadianakis <desnacked <at> riseup.net>

Date: Sat, 7 Apr 2018 08:47:02 UTC

Severity: wishlist

Tags: patch, wontfix

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31086 in the body.
You can then email your comments to 31086 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#31086; Package emacs. (Sat, 07 Apr 2018 08:47:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to George Kadianakis <desnacked <at> riseup.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 07 Apr 2018 08:47:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: George Kadianakis <desnacked <at> riseup.net>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] xref: Make xref-push-marker-stack interactive
Date: Sat, 07 Apr 2018 03:05:45 +0300
Greetings emacs wizards,

here is a small patch that allows xref users to push markers to the
stack without using xref-find-definitions. This allows users to mark
arbitrary positions in the code that they consider interesting
(e.g. documentation) even tho it's not actually an xref definition.

Let me know if you don't like it! :)

Have a good one!

---

From 9ddda3d1724b9a40e7e9a0c413b883abc4aeab33 Mon Sep 17 00:00:00 2001
From: George Kadianakis <desnacked <at> riseup.net>
Date: Fri, 6 Apr 2018 21:42:51 +0300
Subject: [PATCH] Make xref-push-marker-stack interactive

You can now call 'xref-push-marker-stack' interactively to push the
current point to the xref marker stack.  This can be used to mark
interesting places that you want to visit later using
'xref-pop-marker-stack'.

* lisp/progmodes/xref.el (xref-push-marker-stack): Make function interactive.
---
 etc/NEWS               | 6 ++++++
 lisp/progmodes/xref.el | 7 ++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/etc/NEWS b/etc/NEWS
index 02b31ecff4..db6122d901 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -345,6 +345,12 @@ when the PGP keyring contains a public key for every recipient.  To
 achieve this, add 'message-add-encrypt-tag-if-can-encrypt' to
 'message-send-hook'.
 
+** Xref
+++++
+*** You can now call 'xref-push-marker-stack' interactively to push
+the current point to the xref marker stack.  This can be used to mark
+interesting places that you want to visit later using 'xref-pop-marker-stack'.
+
 * New Modes and Packages in Emacs 27.1
 
 +++
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 5a9a7a925a..5c70005d13 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -352,9 +352,14 @@ xref-after-return-hook
 (defvar xref--marker-ring (make-ring xref-marker-ring-length)
   "Ring of markers to implement the marker stack.")
 
+;;;###autoload
 (defun xref-push-marker-stack (&optional m)
   "Add point M (defaults to `point-marker') to the marker stack."
-  (ring-insert xref--marker-ring (or m (point-marker))))
+  (interactive)
+  (ring-insert xref--marker-ring (or m (point-marker)))
+  ; If called interactively, output a message for the user
+  (when (called-interactively-p 'any)
+        (message "xref marker set for current position.")))
 
 ;;;###autoload
 (defun xref-pop-marker-stack ()
-- 
2.16.2






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31086; Package emacs. (Wed, 11 Apr 2018 07:29:01 GMT) Full text and rfc822 format available.

Message #8 received at 31086 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: George Kadianakis <desnacked <at> riseup.net>, 31086 <at> debbugs.gnu.org
Subject: Re: bug#31086: [PATCH] xref: Make xref-push-marker-stack interactive
Date: Wed, 11 Apr 2018 10:28:17 +0300
Hey!

On 4/7/18 3:05 AM, George Kadianakis wrote:

> here is a small patch that allows xref users to push markers to the
> stack without using xref-find-definitions. This allows users to mark
> arbitrary positions in the code that they consider interesting
> (e.g. documentation) even tho it's not actually an xref definition.

Thank you for the patch, but I'm not quite sure we want this behavior, 
at least not until we have a common marker stack for many different 
operations. But let's hear what others think.

In the meantime, it should be easy for you to use advice, or define a 
command in your init file that would call xref-push-marker-stack.




Severity set to 'wishlist' from 'normal' Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 17 Apr 2018 00:25:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31086; Package emacs. (Mon, 24 Jun 2019 15:27:02 GMT) Full text and rfc822 format available.

Message #13 received at 31086 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: George Kadianakis <desnacked <at> riseup.net>, 31086 <at> debbugs.gnu.org
Subject: Re: bug#31086: [PATCH] xref: Make xref-push-marker-stack interactive
Date: Mon, 24 Jun 2019 17:25:57 +0200
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> On 4/7/18 3:05 AM, George Kadianakis wrote:
>
>> here is a small patch that allows xref users to push markers to the
>> stack without using xref-find-definitions. This allows users to mark
>> arbitrary positions in the code that they consider interesting
>> (e.g. documentation) even tho it's not actually an xref definition.
>
> Thank you for the patch, but I'm not quite sure we want this behavior,
> at least not until we have a common marker stack for many different
> operations. But let's hear what others think.

It didn't sound like anybody else had an opinion here...  Dmitry, do you
still think that this is probably something we don't want?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31086; Package emacs. (Mon, 24 Jun 2019 23:31:02 GMT) Full text and rfc822 format available.

Message #16 received at 31086 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: George Kadianakis <desnacked <at> riseup.net>, 31086 <at> debbugs.gnu.org
Subject: Re: bug#31086: [PATCH] xref: Make xref-push-marker-stack interactive
Date: Tue, 25 Jun 2019 02:29:54 +0300
Hi Lars,

On 24.06.2019 18:25, Lars Ingebrigtsen wrote:

> It didn't sound like anybody else had an opinion here...  Dmitry, do you
> still think that this is probably something we don't want?

Still not convinced, no. It's a customization that is easy to set up in 
a personal init script, so unless we see similar requests, I'd rather 
hold off installing it in the core.

It's not a strong opinion, though.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31086; Package emacs. (Tue, 25 Jun 2019 07:54:02 GMT) Full text and rfc822 format available.

Message #19 received at 31086 <at> debbugs.gnu.org (full text, mbox):

From: George Kadianakis <desnacked <at> riseup.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>, Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 31086 <at> debbugs.gnu.org
Subject: Re: bug#31086: [PATCH] xref: Make xref-push-marker-stack interactive
Date: Tue, 25 Jun 2019 10:53:07 +0300
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> Hi Lars,
>
> On 24.06.2019 18:25, Lars Ingebrigtsen wrote:
>
>> It didn't sound like anybody else had an opinion here...  Dmitry, do you
>> still think that this is probably something we don't want?
>
> Still not convinced, no. It's a customization that is easy to set up in 
> a personal init script, so unless we see similar requests, I'd rather 
> hold off installing it in the core.
>
> It's not a strong opinion, though.

Makes sense to me. For me, this was just an ugly hack and perhaps the
xref subsystem is not meant to do this sort of interactive stuff.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31086; Package emacs. (Tue, 25 Jun 2019 11:07:02 GMT) Full text and rfc822 format available.

Message #22 received at 31086 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: George Kadianakis <desnacked <at> riseup.net>, 31086 <at> debbugs.gnu.org
Subject: Re: bug#31086: [PATCH] xref: Make xref-push-marker-stack interactive
Date: Tue, 25 Jun 2019 13:06:00 +0200
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> Hi Lars,
>
> On 24.06.2019 18:25, Lars Ingebrigtsen wrote:
>
>> It didn't sound like anybody else had an opinion here...  Dmitry, do you
>> still think that this is probably something we don't want?
>
> Still not convinced, no. It's a customization that is easy to set up
> in a personal init script, so unless we see similar requests, I'd
> rather hold off installing it in the core.

OK; closing the bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 25 Jun 2019 11:07:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 31086 <at> debbugs.gnu.org and George Kadianakis <desnacked <at> riseup.net> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 25 Jun 2019 11:07:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 23 Jul 2019 11:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 337 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.