From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#39722: Support for bookmark.el in VC directory buffers Date: Sun, 07 Jun 2020 02:52:21 +0300 Organization: LINKOV.NET Message-ID: <875zc3bvr2.fsf@mail.linkov.net> References: <4738c0198ff32df9ea59906ef055e68838e921f0.camel@gmail.com> <87img6ihby.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="92415"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 39722@debbugs.gnu.org To: Matthias Meulien Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 07 02:06:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1jhipG-000Nzz-AR for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Jun 2020 02:06:10 +0200 Original-Received: from localhost ([::1]:47888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhipF-00076S-Co for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Jun 2020 20:06:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhifS-000426-QW for bug-gnu-emacs@gnu.org; Sat, 06 Jun 2020 19:56:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41229) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jhifS-0002CW-Gj for bug-gnu-emacs@gnu.org; Sat, 06 Jun 2020 19:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jhifS-0004gr-FQ for bug-gnu-emacs@gnu.org; Sat, 06 Jun 2020 19:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Jun 2020 23:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39722 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch fixed Original-Received: via spool by 39722-submit@debbugs.gnu.org id=B39722.159148771217967 (code B ref 39722); Sat, 06 Jun 2020 23:56:02 +0000 Original-Received: (at 39722) by debbugs.gnu.org; 6 Jun 2020 23:55:12 +0000 Original-Received: from localhost ([127.0.0.1]:52775 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhied-0004fe-QX for submit@debbugs.gnu.org; Sat, 06 Jun 2020 19:55:12 -0400 Original-Received: from relay10.mail.gandi.net ([217.70.178.230]:40681) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhieW-0004ev-JT for 39722@debbugs.gnu.org; Sat, 06 Jun 2020 19:55:05 -0400 Original-Received: from mail.gandi.net (m91-129-108-6.cust.tele2.ee [91.129.108.6]) (Authenticated sender: juri@linkov.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 14E93240002; Sat, 6 Jun 2020 23:54:56 +0000 (UTC) In-Reply-To: <87img6ihby.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 05 Jun 2020 01:42:09 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:181653 Archived-At: --=-=-= Content-Type: text/plain > But I wonder what could be a proper solution? I still have no idea how to avoid double call of display-buffer, but at least here is the patch that avoids creating two tabs. It creates a new tab only for the first call of display-buffer, and resets display-buffer-overriding-action afterwards: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=debounce-display-buffer-override-next-command.patch diff --git a/lisp/window.el b/lisp/window.el index c047150413..2249b8d1d1 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -8590,15 +8590,18 @@ display-buffer-override-next-command (let* ((old-window (or (minibuffer-selected-window) (selected-window))) (new-window nil) (minibuffer-depth (minibuffer-depth)) + (clearfun (make-symbol "clear-display-buffer-overriding-action")) (action (lambda (buffer alist) (unless (> (minibuffer-depth) minibuffer-depth) (let* ((ret (funcall pre-function buffer alist)) (window (car ret)) (type (cdr ret))) (setq new-window (window--display-buffer buffer window - type alist)))))) + type alist)) + (funcall clearfun) + (setq post-function nil) + new-window)))) (command this-command) - (clearfun (make-symbol "clear-display-buffer-overriding-action")) (exitfun (lambda () (setq display-buffer-overriding-action diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index a86c37c24a..e9ec22c86e 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el @@ -1496,8 +1496,9 @@ vc-dir-bookmark-jump This implements the `handler' function interface for the record type returned by `vc-dir-bookmark-make-record'." (let* ((file (bookmark-prop-get bmk 'filename)) - (buf (save-window-excursion - (vc-dir file) (current-buffer)))) + (buf (progn + (vc-dir file) + (current-buffer)))) (bookmark-default-handler `("" (buffer . ,buf) . ,(bookmark-get-bookmark-record bmk))))) --=-=-=--