all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Matthias Meulien <orontee@gmail.com>
Cc: 39722@debbugs.gnu.org
Subject: bug#39722: Support for bookmark.el in VC directory buffers
Date: Sun, 07 Jun 2020 02:52:21 +0300	[thread overview]
Message-ID: <875zc3bvr2.fsf@mail.linkov.net> (raw)
In-Reply-To: <87img6ihby.fsf@mail.linkov.net> (Juri Linkov's message of "Fri,  05 Jun 2020 01:42:09 +0300")

[-- Attachment #1: Type: text/plain, Size: 297 bytes --]

> 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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: debounce-display-buffer-override-next-command.patch --]
[-- Type: text/x-diff, Size: 1883 bytes --]

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)))))
 

  reply	other threads:[~2020-06-06 23:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-21 21:19 bug#39722: Support for bookmark.el in VC directory buffers Matthias Meulien
2020-05-12 22:46 ` Juri Linkov
2020-05-13  0:35   ` Matthias Meulien
2020-05-20 22:38     ` Juri Linkov
2020-06-04 22:42 ` Juri Linkov
2020-06-06 23:52   ` Juri Linkov [this message]
2020-06-21 23:36     ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875zc3bvr2.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=39722@debbugs.gnu.org \
    --cc=orontee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.