From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: charles@aurox.ch (Charles A. Roelli) Newsgroups: gmane.emacs.bugs Subject: bug#31027: 27.0.50; xref, tags-location-ring equivalent Date: Thu, 05 Apr 2018 20:56:22 +0200 Message-ID: References: <4540850e-1f76-22d9-cf7b-bd680eb34c6b@yandex.ru> <399191a7-2570-75da-d9b7-12ca8172dc4e@yandex.ru> <871sfubsda.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1522954451 3714 195.159.176.226 (5 Apr 2018 18:54:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 5 Apr 2018 18:54:11 +0000 (UTC) Cc: 31027@debbugs.gnu.org, juri@linkov.net To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 05 20:54:06 2018 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 1f4A1N-0000qq-SY for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Apr 2018 20:54:06 +0200 Original-Received: from localhost ([::1]:47981 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4A3R-0005RE-SN for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Apr 2018 14:56:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4A3J-0005QS-Gc for bug-gnu-emacs@gnu.org; Thu, 05 Apr 2018 14:56:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f4A3G-00045j-6G for bug-gnu-emacs@gnu.org; Thu, 05 Apr 2018 14:56:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60005) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f4A3F-00045Y-Tm for bug-gnu-emacs@gnu.org; Thu, 05 Apr 2018 14:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f4A3F-0001qJ-H4 for bug-gnu-emacs@gnu.org; Thu, 05 Apr 2018 14:56:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: charles@aurox.ch (Charles A. Roelli) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Apr 2018 18:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31027 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31027-submit@debbugs.gnu.org id=B31027.15229545307044 (code B ref 31027); Thu, 05 Apr 2018 18:56:01 +0000 Original-Received: (at 31027) by debbugs.gnu.org; 5 Apr 2018 18:55:30 +0000 Original-Received: from localhost ([127.0.0.1]:39669 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4A2j-0001pX-Tr for submit@debbugs.gnu.org; Thu, 05 Apr 2018 14:55:30 -0400 Original-Received: from sinyavsky.aurox.ch ([37.35.109.145]:41265) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4A2i-0001pK-2Z for 31027@debbugs.gnu.org; Thu, 05 Apr 2018 14:55:28 -0400 Original-Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id 96DC522701 for <31027@debbugs.gnu.org>; Thu, 5 Apr 2018 18:56:28 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= references:subject:subject:in-reply-to:to:from:from:message-id :date:date; s=dkim; t=1522954587; x=1523818588; bh=K4cQXmd1E8MNZ pw9ALm7ZC/N1JhxU0amJl219rJ44LY=; b=nT++d32GsIUbJt+RpII38WoVyGk9c Z2dY/zPMFvCLNBlXWjjaeOvOPxlUpRecfmwGAB3t0ad5lwvvdoJAa/vzzDLQNwkz K8nsKsJ+I/pagBH2fcFlttxF+w+SlS8Rni6kPmqeWmqYiJh7TddN1Pc9PHo6nHXa fN+FZeo7QT0RPY= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Original-Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Ig8jkJVzfS-V for <31027@debbugs.gnu.org>; Thu, 5 Apr 2018 18:56:27 +0000 (UTC) Original-Received: from gray (202.100.1.85.dynamic.wline.res.cust.swisscom.ch [85.1.100.202]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id 26F35226C2; Thu, 5 Apr 2018 18:56:27 +0000 (UTC) In-reply-to: (message from Dmitry Gutov on Thu, 5 Apr 2018 01:14:14 +0300) 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:144935 Archived-At: > From: Dmitry Gutov > Date: Thu, 5 Apr 2018 01:14:14 +0300 > > >> What's simpler about that? You'd need some new commands to use it as > >> well, right? > > > > Is the idea to use a ring of next-error capable buffers? > > So that the next-error command in the current buffer > > will return a list of all potentially next-error capable buffers > > and allow the user to select the required one. > > Umm, I don't think the request is anything so ambitious. > > Charles has been asking for a ring to store the navigation locations > visited by xref only. Exactly, this feature request is only about xref. Nevertheless, the idea of a "ring of next-error capable buffers" does sound like it could be useful in its own right -- if anybody wants to open up a bug for that, feel free. Anyway, I suggest we follow the etags implementation of "tags-location-ring". This is all there is to it, in simplified terms: (defun find-tag-noselect ... ... (if (eq '- PREFIX-ARG) ;; Pop back to a previous location. (if (ring-empty-p tags-location-ring) (user-error "No previous tag locations") (let ((marker (ring-remove tags-location-ring 0))) (prog1 ;; Move to the saved location. (set-buffer (or (marker-buffer marker) (error "The marked buffer has been deleted"))) (goto-char (marker-position marker)) ;; Kill that marker so it doesn't slow down editing. (set-marker marker nil nil)))) ;; Else, we jump to wherever we wanted to go, and record and add a ;; marker to tags-location-ring. (let ((marker (make-marker))) (with-current-buffer (find-tag-in-order ...) (set-marker marker (point)) (run-hooks 'local-find-tag-hook) (ring-insert tags-location-ring marker) (current-buffer))))))