feat(tazjin/emacs): add M-x-always-same-window
Following a discussion on Telegram about window management ... might come in useful! Change-Id: If50741e4281c658bccc55e2f591ef945ef4b3b5d Reviewed-on: https://cl.tvl.fyi/c/depot/+/10592 Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
parent
c541273d22
commit
c806ee0eb8
1 changed files with 8 additions and 0 deletions
|
@ -341,4 +341,12 @@ installed (and visible) XDG apps, and let users launch them."
|
||||||
(interactive "aFunction symbol: ")
|
(interactive "aFunction symbol: ")
|
||||||
(advice-mapc (lambda (advice _props) (advice-remove sym advice)) sym))
|
(advice-mapc (lambda (advice _props) (advice-remove sym advice)) sym))
|
||||||
|
|
||||||
|
(defun M-x-always-same-window ()
|
||||||
|
"Run `execute-extended-command', but ensure that whatever it does
|
||||||
|
always opens in the same window in which the command was invoked."
|
||||||
|
(interactive)
|
||||||
|
(let ((display-buffer-overriding-action
|
||||||
|
'((display-buffer-same-window) . ((inhibit-same-window . nil)))))
|
||||||
|
(call-interactively #'execute-extended-command)))
|
||||||
|
|
||||||
(provide 'functions)
|
(provide 'functions)
|
||||||
|
|
Loading…
Reference in a new issue