Fix 'command not found' errors for hidden commands
This commit is contained in:
parent
c24567a545
commit
1c4215c187
15 changed files with 120 additions and 106 deletions
|
@ -5,7 +5,7 @@
|
|||
:hidden t
|
||||
(apply #'doom-cli-install args))
|
||||
|
||||
(def-command! (install i) ()
|
||||
(def-command! (install i) (&rest args)
|
||||
"A wizard for installing Doom for the first time.
|
||||
|
||||
This command does the following:
|
||||
|
|
|
@ -57,13 +57,14 @@ commands like `doom-packages-install', `doom-packages-update' and
|
|||
(line-end-position)))))
|
||||
|
||||
(defun doom--dispatch-help-1 (command)
|
||||
(cl-destructuring-bind (&key aliases _group)
|
||||
(cl-destructuring-bind (&key aliases hidden _group)
|
||||
(gethash command doom--cli-commands)
|
||||
(unless hidden
|
||||
(print! "%-11s\t%s\t%s"
|
||||
command (if aliases (string-join aliases ",") "")
|
||||
(doom--dispatch-format
|
||||
(documentation (doom--dispatch-command command))
|
||||
t))))
|
||||
t)))))
|
||||
|
||||
(defun doom--dispatch-help (&optional fn &rest args)
|
||||
"Display help documentation for a dispatcher command. If fn and DESC are
|
||||
|
@ -129,13 +130,12 @@ BODY will be run when this dispatcher is called."
|
|||
collect (pop body))))
|
||||
(macroexp-progn
|
||||
(reverse
|
||||
`((unless ,(plist-get plist :hidden)
|
||||
(let ((plist ',plist))
|
||||
`((let ((plist ',plist))
|
||||
(setq plist (plist-put plist :aliases ',(cdr names)))
|
||||
(unless (or (plist-member plist :group)
|
||||
(null doom--cli-group))
|
||||
(plist-put plist :group doom--cli-group))
|
||||
(puthash ,(car names) plist doom--cli-commands)))
|
||||
(puthash ,(car names) plist doom--cli-commands))
|
||||
(defun ,fn ,arglist
|
||||
,docstring
|
||||
,@body))))))
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
(defvar +modeline--old-bar-height nil)
|
||||
;;;###autoload
|
||||
(defun +modeline--resize-for-font-h ()
|
||||
(defun +modeline-resize-for-font-h ()
|
||||
"Adjust the modeline's height when the font size is changed by
|
||||
`doom/increase-font-size' or `doom/decrease-font-size'.
|
||||
|
||||
|
|
|
@ -32,13 +32,13 @@
|
|||
(add-hook 'doom-modeline-mode-hook #'size-indication-mode) ; filesize in modeline
|
||||
(add-hook 'doom-modeline-mode-hook #'column-number-mode) ; cursor column in modeline
|
||||
|
||||
(add-hook 'doom-change-font-size-hook #'+modeline--resize-for-font-h)
|
||||
(add-hook 'doom-change-font-size-hook #'+modeline-resize-for-font-h)
|
||||
(add-hook 'doom-load-theme-hook #'doom-modeline-refresh-bars)
|
||||
|
||||
(add-hook '+doom-dashboard-mode-hook #'doom-modeline-set-project-modeline)
|
||||
|
||||
(add-hook 'magit-mode-hook
|
||||
(defun +modeline--hide-in-non-status-buffer-h ()
|
||||
(defun +modeline-hide-in-non-status-buffer-h ()
|
||||
"Show minimal modeline in magit-status buffer, no modeline elsewhere."
|
||||
(if (eq major-mode 'magit-status-mode)
|
||||
(doom-modeline-set-project-modeline)
|
||||
|
|
|
@ -46,10 +46,10 @@
|
|||
;; `+neotree--indent-cursor-a' change that behavior so that the cursor is
|
||||
;; always on the first non-blank character on the line, in the neo buffer.
|
||||
(add-hook 'neo-enter-hook
|
||||
(defun +neotree--fix-cursor-h (&rest _)
|
||||
(defun +neotree-fix-cursor-h (&rest _)
|
||||
(with-current-buffer neo-global--buffer
|
||||
(+neotree*indent-cursor))))
|
||||
(def-advice! +neotree--indent-cursor-a (&rest _)
|
||||
(def-advice! +neotree-indent-cursor-a (&rest _)
|
||||
:after '(neotree-next-line neotree-previous-line)
|
||||
(beginning-of-line)
|
||||
(skip-chars-forward " \t\r")))
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
;;; Core functions
|
||||
|
||||
;; Don't try to resize popup windows
|
||||
(advice-add #'balance-windows :around #'+popup*save)
|
||||
(advice-add #'balance-windows :around #'+popup-save-a)
|
||||
|
||||
|
||||
;;
|
||||
|
@ -100,11 +100,11 @@ the command buffer."
|
|||
(setq evil-command-window-current-buffer nil)))
|
||||
|
||||
;; Don't mess with popups
|
||||
(advice-add #'+evil--window-swap :around #'+popup*save)
|
||||
(advice-add #'evil-window-move-very-bottom :around #'+popup*save)
|
||||
(advice-add #'evil-window-move-very-top :around #'+popup*save)
|
||||
(advice-add #'evil-window-move-far-left :around #'+popup*save)
|
||||
(advice-add #'evil-window-move-far-right :around #'+popup*save))
|
||||
(advice-add #'+evil--window-swap :around #'+popup-save-a)
|
||||
(advice-add #'evil-window-move-very-bottom :around #'+popup-save-a)
|
||||
(advice-add #'evil-window-move-very-top :around #'+popup-save-a)
|
||||
(advice-add #'evil-window-move-far-left :around #'+popup-save-a)
|
||||
(advice-add #'evil-window-move-far-right :around #'+popup-save-a))
|
||||
|
||||
|
||||
;;;###package help-mode
|
||||
|
@ -169,7 +169,7 @@ the command buffer."
|
|||
;;;###package helm
|
||||
;;;###package helm-ag
|
||||
(when (featurep! :completion helm)
|
||||
(setq helm-default-display-buffer-functions '(+popup-display-buffer-stacked-side-window))
|
||||
(setq helm-default-display-buffer-functions '(+popup-display-buffer-stacked-side-window-fn))
|
||||
|
||||
;; Fix #897: "cannot open side window" error when TAB-completing file links
|
||||
(def-advice! +popup--helm-hide-org-links-popup-a (orig-fn &rest args)
|
||||
|
@ -318,13 +318,13 @@ instead of switch-to-buffer-*."
|
|||
;;;###package pdf-tools
|
||||
(after! pdf-tools
|
||||
(setq tablist-context-window-display-action
|
||||
'((+popup-display-buffer-stacked-side-window)
|
||||
'((+popup-display-buffer-stacked-side-window-fn)
|
||||
(side . left)
|
||||
(slot . 2)
|
||||
(window-height . 0.3)
|
||||
(inhibit-same-window . t))
|
||||
pdf-annot-list-display-buffer-action
|
||||
'((+popup-display-buffer-stacked-side-window)
|
||||
'((+popup-display-buffer-stacked-side-window-fn)
|
||||
(side . left)
|
||||
(slot . 3)
|
||||
(inhibit-same-window . t)))
|
||||
|
@ -344,8 +344,8 @@ instead of switch-to-buffer-*."
|
|||
;;;###package wgrep
|
||||
(progn
|
||||
;; close the popup after you're done with a wgrep buffer
|
||||
(advice-add #'wgrep-abort-changes :after #'+popup*close)
|
||||
(advice-add #'wgrep-finish-edit :after #'+popup*close))
|
||||
(advice-add #'wgrep-abort-changes :after #'+popup-close-a)
|
||||
(advice-add #'wgrep-finish-edit :after #'+popup-close-a))
|
||||
|
||||
|
||||
;;;###package which-key
|
||||
|
@ -358,7 +358,7 @@ instead of switch-to-buffer-*."
|
|||
(lambda (act-popup-dim)
|
||||
(cl-letf (((symbol-function 'display-buffer-in-side-window)
|
||||
(lambda (buffer alist)
|
||||
(+popup-display-buffer-stacked-side-window
|
||||
(+popup-display-buffer-stacked-side-window-fn
|
||||
buffer (append '((vslot . -9999)) alist)))))
|
||||
(which-key--show-buffer-side-window act-popup-dim))))))
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ The mode-line is hidden in popups, by default. To disable this, you can either:
|
|||
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
;; in ~/.doom.d/config.el
|
||||
(remove-hook '+popup-buffer-mode-hook #'+popup|set-modeline-on-enable)
|
||||
(remove-hook '+popup-buffer-mode-hook #'+popup-set-modeline-on-enable-h)
|
||||
#+END_SRC
|
||||
|
||||
* Appendix
|
||||
|
@ -112,10 +112,10 @@ The mode-line is hidden in popups, by default. To disable this, you can either:
|
|||
+ ~without-popups!~
|
||||
+ ~save-popups!~
|
||||
+ Hooks
|
||||
+ ~+popup|adjust-fringes~
|
||||
+ ~+popup-adjust-fringes-h~
|
||||
+ ~+popup|set-modeline~
|
||||
+ ~+popup|close-on-escape~
|
||||
+ ~+popup|cleanup-rules~
|
||||
+ ~+popup-close-on-escape-h~
|
||||
+ ~+popup-cleanup-rules-h~
|
||||
+ Minor modes
|
||||
+ ~+popup-mode~
|
||||
+ ~+popup-buffer-mode~
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
the buffer is visible, then set another timer and try again later."
|
||||
(when (buffer-live-p buffer)
|
||||
(let ((inhibit-quit t)
|
||||
(kill-buffer-hook (remq '+popup|kill-buffer-hook kill-buffer-hook)))
|
||||
(kill-buffer-hook (remq '+popup-kill-buffer-hook-h kill-buffer-hook)))
|
||||
(cond ((get-buffer-window buffer t)
|
||||
(with-current-buffer buffer
|
||||
(setq +popup--timer
|
||||
|
@ -68,7 +68,7 @@ the buffer is visible, then set another timer and try again later."
|
|||
(signal 'wrong-type-argument (list 'integerp ttl)))
|
||||
((= ttl 0)
|
||||
(+popup--kill-buffer buffer 0))
|
||||
((add-hook 'kill-buffer-hook #'+popup|kill-buffer-hook nil t)
|
||||
((add-hook 'kill-buffer-hook #'+popup-kill-buffer-hook-h nil t)
|
||||
(setq +popup--timer
|
||||
(run-at-time ttl nil #'+popup--kill-buffer
|
||||
buffer ttl))))))))))
|
||||
|
@ -102,7 +102,20 @@ the buffer is visible, then set another timer and try again later."
|
|||
(setf (alist-get param alist) size))
|
||||
(setf (alist-get 'window-parameters alist)
|
||||
parameters)
|
||||
alist)))
|
||||
;; Fixes #1305: addresses an edge case where a popup with a :size, :width
|
||||
;; or :height greater than the current frame's dimensions causes
|
||||
;; hanging/freezing (a bug in Emacs' `display-buffer' API perhaps?)
|
||||
(let ((width (cdr (assq 'window-width alist)))
|
||||
(height (cdr (assq 'window-height alist))))
|
||||
(setf (alist-get 'window-width alist)
|
||||
(if (numberp width)
|
||||
(min width (frame-width))
|
||||
width))
|
||||
(setf (alist-get 'window-height alist)
|
||||
(if (numberp height)
|
||||
(min height (frame-height))
|
||||
height))
|
||||
alist))))
|
||||
|
||||
(defun +popup--split-window (window size side)
|
||||
"Ensure a non-dedicated/popup window is selected when splitting a window."
|
||||
|
@ -233,14 +246,14 @@ Uses `shrink-window-if-larger-than-buffer'."
|
|||
;; Hooks
|
||||
|
||||
;;;###autoload
|
||||
(defun +popup|adjust-fringes ()
|
||||
(defun +popup-adjust-fringes-h ()
|
||||
"Hides the fringe in popup windows, restoring them if `+popup-buffer-mode' is
|
||||
disabled."
|
||||
(let ((f (if (bound-and-true-p +popup-buffer-mode) 0)))
|
||||
(set-window-fringes nil f f fringes-outside-margins)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +popup|adjust-margins ()
|
||||
(defun +popup-adjust-margins-h ()
|
||||
"Creates padding for the popup window determined by `+popup-margin-width',
|
||||
restoring it if `+popup-buffer-mode' is disabled."
|
||||
(when +popup-margin-width
|
||||
|
@ -250,7 +263,7 @@ restoring it if `+popup-buffer-mode' is disabled."
|
|||
|
||||
(defvar hide-mode-line-format)
|
||||
;;;###autoload
|
||||
(defun +popup|set-modeline-on-enable ()
|
||||
(defun +popup-set-modeline-on-enable-h ()
|
||||
"Don't show modeline in popup windows without a `modeline' window-parameter.
|
||||
Possible values for this parameter are:
|
||||
|
||||
|
@ -271,17 +284,17 @@ Any non-nil value besides the above will be used as the raw value for
|
|||
(funcall modeline)
|
||||
modeline)))
|
||||
(hide-mode-line-mode +1)))))))
|
||||
(put '+popup|set-modeline-on-enable 'permanent-local-hook t)
|
||||
(put '+popup-set-modeline-on-enable-h 'permanent-local-hook t)
|
||||
|
||||
;;;###autoload
|
||||
(defun +popup|unset-modeline-on-disable ()
|
||||
(defun +popup-unset-modeline-on-disable-h ()
|
||||
"Restore the modeline when `+popup-buffer-mode' is deactivated."
|
||||
(when (and (not (bound-and-true-p +popup-buffer-mode))
|
||||
(bound-and-true-p hide-mode-line-mode))
|
||||
(hide-mode-line-mode -1)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +popup|close-on-escape ()
|
||||
(defun +popup-close-on-escape-h ()
|
||||
"If called inside a popup, try to close that popup window (see
|
||||
`+popup/close'). If called outside, try to close all popup windows (see
|
||||
`+popup/close-all')."
|
||||
|
@ -290,7 +303,7 @@ Any non-nil value besides the above will be used as the raw value for
|
|||
(+popup/close-all)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +popup|cleanup-rules ()
|
||||
(defun +popup-cleanup-rules-h ()
|
||||
"Cleans up any duplicate popup rules."
|
||||
(interactive)
|
||||
(setq +popup--display-buffer-alist
|
||||
|
@ -300,7 +313,7 @@ Any non-nil value besides the above will be used as the raw value for
|
|||
(setq display-buffer-alist +popup--display-buffer-alist)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +popup|kill-buffer-hook ()
|
||||
(defun +popup-kill-buffer-hook-h ()
|
||||
"TODO"
|
||||
(when-let (window (get-buffer-window))
|
||||
(when (+popup-window-p window)
|
||||
|
@ -319,7 +332,7 @@ Any non-nil value besides the above will be used as the raw value for
|
|||
"Open this buffer in a popup window."
|
||||
(interactive)
|
||||
(let ((+popup-default-display-buffer-actions
|
||||
'(+popup-display-buffer-stacked-side-window))
|
||||
'(+popup-display-buffer-stacked-side-window-fn))
|
||||
(display-buffer-alist +popup--display-buffer-alist)
|
||||
(buffer (current-buffer)))
|
||||
(push (+popup--make "." +popup-defaults) display-buffer-alist)
|
||||
|
@ -425,21 +438,21 @@ the message buffer in a popup window."
|
|||
|
||||
|
||||
;;
|
||||
;; Advice
|
||||
;;; Advice
|
||||
|
||||
;;;###autoload
|
||||
(defun +popup*close (&rest _)
|
||||
(defun +popup-close-a (&rest _)
|
||||
"TODO"
|
||||
(+popup/close nil t))
|
||||
|
||||
;;;###autoload
|
||||
(defun +popup*save (orig-fn &rest args)
|
||||
(defun +popup-save-a (orig-fn &rest args)
|
||||
"Sets aside all popups before executing the original function, usually to
|
||||
prevent the popup(s) from messing up the UI (or vice versa)."
|
||||
(save-popups! (apply orig-fn args)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +popup-display-buffer-fullframe (buffer alist)
|
||||
(defun +popup-display-buffer-fullframe-fn (buffer alist)
|
||||
"Displays the buffer fullscreen."
|
||||
(let ((wconf (current-window-configuration)))
|
||||
(when-let (window (or (display-buffer-reuse-window buffer alist)
|
||||
|
@ -452,7 +465,7 @@ prevent the popup(s) from messing up the UI (or vice versa)."
|
|||
window)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +popup-display-buffer-stacked-side-window (buffer alist)
|
||||
(defun +popup-display-buffer-stacked-side-window-fn (buffer alist)
|
||||
"A `display-buffer' action that serves as an alternative to
|
||||
`display-buffer-in-side-window', but allows for stacking popups with the `vslot'
|
||||
alist entry.
|
||||
|
@ -587,16 +600,17 @@ Accepts the same arguments as `display-buffer-in-side-window'. You must set
|
|||
;; Emacs backwards compatibility
|
||||
|
||||
(unless EMACS27+
|
||||
(defun +popup*set-window-dedicated (window)
|
||||
(def-advice! +popup-set-window-dedicated-a (window)
|
||||
"Ensure `window--dispaly-buffer' respects `display-buffer-mark-dedicated'.
|
||||
|
||||
This was not so until recent Emacs 27 builds, where it causes breaking errors.
|
||||
This advice ensures backwards compatibility for Emacs <= 26 users."
|
||||
:filter-return #'window--display-buffer
|
||||
(when (and (windowp window) display-buffer-mark-dedicated)
|
||||
(set-window-dedicated-p window display-buffer-mark-dedicated))
|
||||
window)
|
||||
(advice-add #'window--display-buffer :filter-return #'+popup*set-window-dedicated))
|
||||
window))
|
||||
|
||||
;; DEPRECATED
|
||||
(unless EMACS26+
|
||||
(defvar window-sides-reversed nil)
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ PLIST can be made up of any of the following properties:
|
|||
|
||||
:side 'bottom|'top|'left|'right
|
||||
Which side of the frame to open the popup on. This is only respected if
|
||||
`+popup-display-buffer-stacked-side-window' or `display-buffer-in-side-window'
|
||||
`+popup-display-buffer-stacked-side-window-fn' or `display-buffer-in-side-window'
|
||||
is in :actions or `+popup-default-display-buffer-actions'.
|
||||
|
||||
:size/:width/:height FLOAT|INT|FN
|
||||
|
@ -93,7 +93,7 @@ PLIST can be made up of any of the following properties:
|
|||
|
||||
:slot/:vslot INT
|
||||
(This only applies to popups with a :side and only if :actions is blank or
|
||||
contains the `+popup-display-buffer-stacked-side-window' action) These control
|
||||
contains the `+popup-display-buffer-stacked-side-window-fn' action) These control
|
||||
how multiple popups are laid out. INT can be any integer, positive and
|
||||
negative.
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
Modifying this has no effect, unless done before ui/popup loads.")
|
||||
|
||||
(defvar +popup-default-display-buffer-actions
|
||||
'(+popup-display-buffer-stacked-side-window)
|
||||
'(+popup-display-buffer-stacked-side-window-fn)
|
||||
"The functions to use to display the popup buffer.")
|
||||
|
||||
(defvar +popup-default-alist
|
||||
|
@ -55,17 +55,17 @@ adjustment.")
|
|||
:global t
|
||||
:keymap +popup-mode-map
|
||||
(cond (+popup-mode
|
||||
(add-hook 'doom-escape-hook #'+popup|close-on-escape t)
|
||||
(add-hook 'doom-escape-hook #'+popup-close-on-escape-h t)
|
||||
(setq +popup--old-display-buffer-alist display-buffer-alist
|
||||
display-buffer-alist +popup--display-buffer-alist
|
||||
window--sides-inhibit-check t)
|
||||
(dolist (prop +popup-window-parameters)
|
||||
(push (cons prop 'writable) window-persistent-parameters)))
|
||||
(t
|
||||
(remove-hook 'doom-escape-hook #'+popup|close-on-escape)
|
||||
(remove-hook 'doom-escape-hook #'+popup-close-on-escape-h)
|
||||
(setq display-buffer-alist +popup--old-display-buffer-alist
|
||||
window--sides-inhibit-check nil)
|
||||
(+popup|cleanup-rules)
|
||||
(+popup-cleanup-rules-h)
|
||||
(dolist (prop +popup-window-parameters)
|
||||
(delq (assq prop window-persistent-parameters)
|
||||
window-persistent-parameters)))))
|
||||
|
@ -78,16 +78,16 @@ that window has been changed or closed."
|
|||
:init-value nil
|
||||
:keymap +popup-buffer-mode-map
|
||||
(if (not +popup-buffer-mode)
|
||||
(remove-hook 'after-change-major-mode-hook #'+popup|set-modeline-on-enable t)
|
||||
(add-hook 'after-change-major-mode-hook #'+popup|set-modeline-on-enable nil t)
|
||||
(remove-hook 'after-change-major-mode-hook #'+popup-set-modeline-on-enable-h t)
|
||||
(add-hook 'after-change-major-mode-hook #'+popup-set-modeline-on-enable-h nil t)
|
||||
(when (timerp +popup--timer)
|
||||
(remove-hook 'kill-buffer-hook #'+popup|kill-buffer-hook t)
|
||||
(remove-hook 'kill-buffer-hook #'+popup-kill-buffer-hook-h t)
|
||||
(cancel-timer +popup--timer)
|
||||
(setq +popup--timer nil))))
|
||||
|
||||
(put '+popup-buffer-mode 'permanent-local t)
|
||||
(put '+popup-buffer-mode 'permanent-local-hook t)
|
||||
(put '+popup|set-modeline-on-enable 'permanent-local-hook t)
|
||||
(put '+popup-set-modeline-on-enable-h 'permanent-local-hook t)
|
||||
|
||||
|
||||
;;
|
||||
|
@ -155,17 +155,18 @@ prevent the popup(s) from messing up the UI (or vice versa)."
|
|||
:vslot -11 :size 0.35 :select t)
|
||||
("^\\*info\\*$" ; `Info-mode'
|
||||
:slot 2 :vslot 2 :size 0.45 :select t)))
|
||||
'(("^\\*Backtrace" :vslot 99 :size 0.4 :quit nil)
|
||||
'(("^\\*Warnings" :vslot 99 :size 0.25)
|
||||
("^\\*Backtrace" :vslot 99 :size 0.4 :quit nil)
|
||||
("^\\*CPU-Profiler-Report " :side bottom :vslot 100 :slot 1 :height 0.4 :width 0.5 :quit nil)
|
||||
("^\\*Memory-Profiler-Report " :side bottom :vslot 100 :slot 2 :height 0.4 :width 0.5 :quit nil)))
|
||||
|
||||
(add-hook 'doom-init-ui-hook #'+popup-mode :append)
|
||||
|
||||
(add-hook! '+popup-buffer-mode-hook
|
||||
#'(+popup|adjust-fringes
|
||||
+popup|adjust-margins
|
||||
+popup|set-modeline-on-enable
|
||||
+popup|unset-modeline-on-disable))
|
||||
#'(+popup-adjust-fringes-h
|
||||
+popup-adjust-margins-h
|
||||
+popup-set-modeline-on-enable-h
|
||||
+popup-unset-modeline-on-disable-h))
|
||||
|
||||
|
||||
;;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
(before-each
|
||||
(setq display-buffer-alist nil
|
||||
+popup--display-buffer-alist nil
|
||||
+popup-default-display-buffer-actions '(+popup-display-buffer-stacked-side-window)
|
||||
+popup-default-display-buffer-actions '(+popup-display-buffer-stacked-side-window-fn)
|
||||
+popup-defaults '(:side bottom :select ignore :ttl nil :slot 1 :vslot 1)))
|
||||
(after-each
|
||||
(set-window-configuration wconf))
|
||||
|
|
|
@ -8,14 +8,14 @@
|
|||
|
||||
;;;###autoload
|
||||
(defun +tabbar-window-tab-list ()
|
||||
(+tabbar-window-buffer-list))
|
||||
(+tabbar-window-buffer-list-fn))
|
||||
|
||||
;;;###autoload
|
||||
(defun +tabbar-window-buffer-list ()
|
||||
(defun +tabbar-window-buffer-list-fn ()
|
||||
(cl-delete-if-not #'buffer-live-p (window-parameter nil 'tabbar-buffers)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +tabbar-buffer-groups ()
|
||||
(defun +tabbar-buffer-groups-fn ()
|
||||
(list
|
||||
(cond ((or (string-equal "*" (substring (buffer-name) 0 1))
|
||||
(memq major-mode '(magit-process-mode
|
||||
|
@ -53,11 +53,11 @@
|
|||
;;; Advice
|
||||
|
||||
;;;###autoload
|
||||
(defun +tabbar*kill-current-buffer (&rest _)
|
||||
(defun +tabbar-kill-current-buffer-a (&rest _)
|
||||
(+tabbar|remove-buffer))
|
||||
|
||||
;;;###autoload
|
||||
(defun +tabbar*bury-buffer (orig-fn &rest args)
|
||||
(defun +tabbar-bury-buffer-a (orig-fn &rest args)
|
||||
(if centaur-tabs-mode
|
||||
(let ((b (current-buffer)))
|
||||
(apply orig-fn args)
|
||||
|
@ -67,7 +67,7 @@
|
|||
(apply orig-fn args)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +tabbar*kill-tab-maybe (tab)
|
||||
(defun +tabbar-kill-tab-maybe-a (tab)
|
||||
(let ((buffer (centaur-tabs-tab-value tab)))
|
||||
(with-current-buffer buffer
|
||||
;; `kill-current-buffer' is advised not to kill buffers visible in another
|
||||
|
@ -80,7 +80,7 @@
|
|||
;;; Hooks
|
||||
|
||||
;;;###autoload
|
||||
(defun +tabbar|add-buffer ()
|
||||
(defun +tabbar-add-buffer-h ()
|
||||
(when (and centaur-tabs-mode
|
||||
(doom-real-buffer-p (current-buffer)))
|
||||
(let* ((this-buf (current-buffer))
|
||||
|
@ -97,7 +97,7 @@
|
|||
'tabbar-buffers (delete (current-buffer) (window-parameter nil 'tabbar-buffers)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +tabbar|new-window ()
|
||||
(defun +tabbar-new-window-h ()
|
||||
(when centaur-tabs-mode
|
||||
(unless (window-parameter nil 'tabbar-buffers)
|
||||
(+tabbar|add-buffer))))
|
||||
(+tabbar-add-buffer-h))))
|
||||
|
|
|
@ -7,22 +7,22 @@
|
|||
centaur-tabs-set-bar 'left
|
||||
centaur-tabs-set-modified-marker t)
|
||||
|
||||
(defun +tabbar|init-frames ()
|
||||
(add-hook 'centaur-tabs-mode-hook
|
||||
(defun +tabbar-init-frames-h ()
|
||||
(dolist (frame (frame-list))
|
||||
(if (not centaur-tabs-mode)
|
||||
(set-frame-parameter frame 'buffer-predicate (frame-parameter frame 'old-buffer-predicate))
|
||||
(set-frame-parameter frame 'old-buffer-predicate (frame-parameter frame 'buffer-predicate))
|
||||
(set-frame-parameter frame 'buffer-predicate #'+tabbar-buffer-predicate))))
|
||||
(add-hook 'centaur-tabs-mode-hook #'+tabbar|init-frames)
|
||||
(set-frame-parameter frame 'buffer-predicate #'+tabbar-buffer-predicate)))))
|
||||
|
||||
(setq centaur-tabs-buffer-list-function #'+tabbar-window-buffer-list
|
||||
centaur-tabs-buffer-groups-function #'+tabbar-buffer-groups)
|
||||
(setq centaur-tabs-buffer-list-function #'+tabbar-window-buffer-list-fn
|
||||
centaur-tabs-buffer-groups-function #'+tabbar-buffer-groups-fn)
|
||||
|
||||
(advice-add #'centaur-tabs-buffer-close-tab :override #'+tabbar*kill-tab-maybe)
|
||||
(advice-add #'bury-buffer :around #'+tabbar*bury-buffer)
|
||||
(advice-add #'kill-current-buffer :before #'+tabbar*kill-current-buffer)
|
||||
(add-hook 'doom-switch-buffer-hook #'+tabbar|add-buffer)
|
||||
(add-hook 'doom-switch-window-hook #'+tabbar|new-window)
|
||||
(advice-add #'centaur-tabs-buffer-close-tab :override #'+tabbar-kill-tab-maybe-a)
|
||||
(advice-add #'bury-buffer :around #'+tabbar-bury-buffer-a)
|
||||
(advice-add #'kill-current-buffer :before #'+tabbar-kill-current-buffer-a)
|
||||
(add-hook 'doom-switch-buffer-hook #'+tabbar-add-buffer-h)
|
||||
(add-hook 'doom-switch-window-hook #'+tabbar-new-window-h)
|
||||
|
||||
(add-hook '+doom-dashboard-mode-hook #'centaur-tabs-local-mode)
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
treemacs-persist-file (concat doom-cache-dir "treemacs-persist")
|
||||
treemacs-last-error-persist-file (concat doom-cache-dir "treemacs-last-error-persist"))
|
||||
|
||||
|
||||
(after! treemacs-persistence
|
||||
;; This variable is defined with defconst, so we must wait to change it until
|
||||
;; it has loaded.
|
||||
|
@ -25,7 +26,7 @@
|
|||
(treemacs-follow-mode -1)
|
||||
|
||||
(after! ace-window
|
||||
(setq aw-ignored-buffers (delq 'treemacs-mode aw-ignored-buffers))))
|
||||
(delq! aw-ignored-buffers 'treemacs-mode)))
|
||||
|
||||
|
||||
(def-package! treemacs-evil
|
||||
|
|
|
@ -1,20 +1,18 @@
|
|||
;;; ui/unicode/autoload.el -*- lexical-binding: t; -*-
|
||||
|
||||
;;;###autoload
|
||||
(add-hook 'doom-init-ui-hook #'+unicode|init-fonts)
|
||||
|
||||
;;;###autoload
|
||||
(defun +unicode|init-fonts ()
|
||||
(add-hook 'doom-init-ui-hook
|
||||
(defun +unicode-init-fonts-h ()
|
||||
"Set up `unicode-fonts' to eventually run; accomodating the daemon, if
|
||||
necessary."
|
||||
(setq-default bidi-display-reordering t
|
||||
doom-unicode-font nil)
|
||||
(if initial-window-system
|
||||
(+unicode|setup-fonts (selected-frame))
|
||||
(add-hook 'after-make-frame-functions #'+unicode|setup-fonts)))
|
||||
(+unicode-setup-fonts-h (selected-frame))
|
||||
(add-hook 'after-make-frame-functions #'+unicode-setup-fonts-h))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +unicode|setup-fonts (&optional frame)
|
||||
(defun +unicode-setup-fonts-h (&optional frame)
|
||||
"Initialize `unicode-fonts', if in a GUI session."
|
||||
(when (and frame (display-graphic-p frame))
|
||||
(with-selected-frame frame
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue