From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: A feature to go to last edit locations Date: Mon, 13 Feb 2023 09:50:51 +0200 Organization: LINKOV.NET Message-ID: <86r0uuf0zt.fsf@mail.linkov.net> References: <834jrqhiu7.fsf@gnu.org> <83y1p2fzwq.fsf@gnu.org> <874jrqmo4m.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4791"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: Daniel =?iso-8859-1?Q?Mart=EDn?= , =?iso-8859-1?Q?andr=E9s_ram=EDrez?= , Eli Zaretskii , emacs-devel@gnu.org To: "Dr. Arne Babenhauserheide" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Feb 13 09:12:19 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pRTwh-0000vh-G1 for ged-emacs-devel@m.gmane-mx.org; Mon, 13 Feb 2023 09:12:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRTvt-000561-2P; Mon, 13 Feb 2023 03:11:29 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRTvr-00055e-E7 for emacs-devel@gnu.org; Mon, 13 Feb 2023 03:11:27 -0500 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRTvp-0003S6-Nk; Mon, 13 Feb 2023 03:11:27 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id D022C1BF20D; Mon, 13 Feb 2023 08:11:17 +0000 (UTC) In-Reply-To: <874jrqmo4m.fsf@web.de> (Arne Babenhauserheide's message of "Mon, 13 Feb 2023 00:54:16 +0100") Received-SPF: pass client-ip=217.70.183.201; envelope-from=juri@linkov.net; helo=relay8-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:303209 Archived-At: >> Daniel Martín writes: >> I see that Evil uses the NonGNU ELPA package goto-chg >> (https://elpa.nongnu.org/nongnu/goto-chg.html) to implement that >> functionality. > > I use that package outside Evil all the time. Any mode that clobbers the > shortcut I assigned to it (C-.) blocks my productivity a lot. That’s the > main reason why I don’t have flyspell active while writing emails. You can unbind this key: ``` (with-eval-after-load 'flyspell (keymap-unset flyspell-mode-map "C-.")) ``` > It only works inside buffers, but with ido for changing buffers and > dumb-jump/xref support for jumping back after cross-file navigation, I > don’t need more. This jumping back after an explicit cross-file > navigation command is actually closer to what I need than what intellij > offers. I don’t want to go back to the buffer I selected via > switch-buffer, but if "find reference" takes me to another file, I need > a way to jump back. Something like this will get the most recently used buffer with undo, then the logic from goto-chg can navigate to the last undo entry: ``` (seq-sort (lambda (b1 b2) (time-less-p (with-current-buffer b2 buffer-display-time) (with-current-buffer b1 buffer-display-time))) (seq-remove (lambda (b) (with-current-buffer b (or (not buffer-undo-list) (eq buffer-undo-list t) buffer-read-only (not buffer-display-time) (string-match-p "\\` " (buffer-name b))))) (buffer-list))) ```