emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Some developement questions


From: Drew Adams
Subject: RE: Some developement questions
Date: Mon, 10 Sep 2018 07:13:50 -0700 (PDT)

> Is there a way to make it so that the frame used to display a branch
> deletes itself when the cloned buffer it has been created for is killed?

(This thread is all over the place now...)

I use ` kill-buffer-and-its-windows', defined in `misc-cmds.el':

https://www.emacswiki.org/emacs/download/misc-cmds.el

I do this:
(remap-command 'kill-buffer 'kill-buffer-and-its-windows global-map)

And I use this, from `frame-cmds.el':

;; If WINDOW is the only one in its frame, `delete-frame'.
(defadvice delete-window (around delete-frame-if-one-win activate)
  "If WINDOW is the only one in its frame, then `delete-frame' too."
  (if (fboundp 'with-selected-window)   ; Emacs 22+
      (with-selected-window
          (or (ad-get-arg 0)  (selected-window))
        (if (one-window-p t) (delete-frame) ad-do-it))
    (save-current-buffer
      (select-window (or (ad-get-arg 0)  (selected-window)))
      (if (one-window-p t) (delete-frame) ad-do-it))))

https://www.emacswiki.org/emacs/download/frame-cmds.el

(Be aware too that `q' in Info does not kill the buffer. Use `C-x k'
or similar if you really want to kill the buffer.)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]