Fix 'command not found' errors for hidden commands

This commit is contained in:
Henrik Lissner 2019-07-22 04:46:14 +02:00
parent c24567a545
commit 1c4215c187
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
15 changed files with 120 additions and 106 deletions

View file

@ -5,7 +5,7 @@
:hidden t :hidden t
(apply #'doom-cli-install args)) (apply #'doom-cli-install args))
(def-command! (install i) () (def-command! (install i) (&rest args)
"A wizard for installing Doom for the first time. "A wizard for installing Doom for the first time.
This command does the following: This command does the following:

View file

@ -57,13 +57,14 @@ commands like `doom-packages-install', `doom-packages-update' and
(line-end-position))))) (line-end-position)))))
(defun doom--dispatch-help-1 (command) (defun doom--dispatch-help-1 (command)
(cl-destructuring-bind (&key aliases _group) (cl-destructuring-bind (&key aliases hidden _group)
(gethash command doom--cli-commands) (gethash command doom--cli-commands)
(print! "%-11s\t%s\t%s" (unless hidden
command (if aliases (string-join aliases ",") "") (print! "%-11s\t%s\t%s"
(doom--dispatch-format command (if aliases (string-join aliases ",") "")
(documentation (doom--dispatch-command command)) (doom--dispatch-format
t)))) (documentation (doom--dispatch-command command))
t)))))
(defun doom--dispatch-help (&optional fn &rest args) (defun doom--dispatch-help (&optional fn &rest args)
"Display help documentation for a dispatcher command. If fn and DESC are "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)))) collect (pop body))))
(macroexp-progn (macroexp-progn
(reverse (reverse
`((unless ,(plist-get plist :hidden) `((let ((plist ',plist))
(let ((plist ',plist)) (setq plist (plist-put plist :aliases ',(cdr names)))
(setq plist (plist-put plist :aliases ',(cdr names))) (unless (or (plist-member plist :group)
(unless (or (plist-member plist :group) (null doom--cli-group))
(null doom--cli-group)) (plist-put plist :group 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 (defun ,fn ,arglist
,docstring ,docstring
,@body)))))) ,@body))))))

View file

@ -12,7 +12,7 @@
(defvar +modeline--old-bar-height nil) (defvar +modeline--old-bar-height nil)
;;;###autoload ;;;###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 "Adjust the modeline's height when the font size is changed by
`doom/increase-font-size' or `doom/decrease-font-size'. `doom/increase-font-size' or `doom/decrease-font-size'.

View file

@ -32,13 +32,13 @@
(add-hook 'doom-modeline-mode-hook #'size-indication-mode) ; filesize in modeline (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-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-load-theme-hook #'doom-modeline-refresh-bars)
(add-hook '+doom-dashboard-mode-hook #'doom-modeline-set-project-modeline) (add-hook '+doom-dashboard-mode-hook #'doom-modeline-set-project-modeline)
(add-hook 'magit-mode-hook (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." "Show minimal modeline in magit-status buffer, no modeline elsewhere."
(if (eq major-mode 'magit-status-mode) (if (eq major-mode 'magit-status-mode)
(doom-modeline-set-project-modeline) (doom-modeline-set-project-modeline)

View file

@ -46,10 +46,10 @@
;; `+neotree--indent-cursor-a' change that behavior so that the cursor is ;; `+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. ;; always on the first non-blank character on the line, in the neo buffer.
(add-hook 'neo-enter-hook (add-hook 'neo-enter-hook
(defun +neotree--fix-cursor-h (&rest _) (defun +neotree-fix-cursor-h (&rest _)
(with-current-buffer neo-global--buffer (with-current-buffer neo-global--buffer
(+neotree*indent-cursor)))) (+neotree*indent-cursor))))
(def-advice! +neotree--indent-cursor-a (&rest _) (def-advice! +neotree-indent-cursor-a (&rest _)
:after '(neotree-next-line neotree-previous-line) :after '(neotree-next-line neotree-previous-line)
(beginning-of-line) (beginning-of-line)
(skip-chars-forward " \t\r"))) (skip-chars-forward " \t\r")))

View file

@ -27,7 +27,7 @@
;;; Core functions ;;; Core functions
;; Don't try to resize popup windows ;; 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))) (setq evil-command-window-current-buffer nil)))
;; Don't mess with popups ;; Don't mess with popups
(advice-add #'+evil--window-swap :around #'+popup*save) (advice-add #'+evil--window-swap :around #'+popup-save-a)
(advice-add #'evil-window-move-very-bottom :around #'+popup*save) (advice-add #'evil-window-move-very-bottom :around #'+popup-save-a)
(advice-add #'evil-window-move-very-top :around #'+popup*save) (advice-add #'evil-window-move-very-top :around #'+popup-save-a)
(advice-add #'evil-window-move-far-left :around #'+popup*save) (advice-add #'evil-window-move-far-left :around #'+popup-save-a)
(advice-add #'evil-window-move-far-right :around #'+popup*save)) (advice-add #'evil-window-move-far-right :around #'+popup-save-a))
;;;###package help-mode ;;;###package help-mode
@ -169,7 +169,7 @@ the command buffer."
;;;###package helm ;;;###package helm
;;;###package helm-ag ;;;###package helm-ag
(when (featurep! :completion helm) (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 ;; 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) (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 ;;;###package pdf-tools
(after! pdf-tools (after! pdf-tools
(setq tablist-context-window-display-action (setq tablist-context-window-display-action
'((+popup-display-buffer-stacked-side-window) '((+popup-display-buffer-stacked-side-window-fn)
(side . left) (side . left)
(slot . 2) (slot . 2)
(window-height . 0.3) (window-height . 0.3)
(inhibit-same-window . t)) (inhibit-same-window . t))
pdf-annot-list-display-buffer-action pdf-annot-list-display-buffer-action
'((+popup-display-buffer-stacked-side-window) '((+popup-display-buffer-stacked-side-window-fn)
(side . left) (side . left)
(slot . 3) (slot . 3)
(inhibit-same-window . t))) (inhibit-same-window . t)))
@ -344,8 +344,8 @@ instead of switch-to-buffer-*."
;;;###package wgrep ;;;###package wgrep
(progn (progn
;; close the popup after you're done with a wgrep buffer ;; close the popup after you're done with a wgrep buffer
(advice-add #'wgrep-abort-changes :after #'+popup*close) (advice-add #'wgrep-abort-changes :after #'+popup-close-a)
(advice-add #'wgrep-finish-edit :after #'+popup*close)) (advice-add #'wgrep-finish-edit :after #'+popup-close-a))
;;;###package which-key ;;;###package which-key
@ -358,7 +358,7 @@ instead of switch-to-buffer-*."
(lambda (act-popup-dim) (lambda (act-popup-dim)
(cl-letf (((symbol-function 'display-buffer-in-side-window) (cl-letf (((symbol-function 'display-buffer-in-side-window)
(lambda (buffer alist) (lambda (buffer alist)
(+popup-display-buffer-stacked-side-window (+popup-display-buffer-stacked-side-window-fn
buffer (append '((vslot . -9999)) alist))))) buffer (append '((vslot . -9999)) alist)))))
(which-key--show-buffer-side-window act-popup-dim)))))) (which-key--show-buffer-side-window act-popup-dim))))))

View file

@ -88,7 +88,7 @@ The mode-line is hidden in popups, by default. To disable this, you can either:
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
;; in ~/.doom.d/config.el ;; 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 #+END_SRC
* Appendix * Appendix
@ -112,10 +112,10 @@ The mode-line is hidden in popups, by default. To disable this, you can either:
+ ~without-popups!~ + ~without-popups!~
+ ~save-popups!~ + ~save-popups!~
+ Hooks + Hooks
+ ~+popup|adjust-fringes~ + ~+popup-adjust-fringes-h~
+ ~+popup|set-modeline~ + ~+popup|set-modeline~
+ ~+popup|close-on-escape~ + ~+popup-close-on-escape-h~
+ ~+popup|cleanup-rules~ + ~+popup-cleanup-rules-h~
+ Minor modes + Minor modes
+ ~+popup-mode~ + ~+popup-mode~
+ ~+popup-buffer-mode~ + ~+popup-buffer-mode~

View file

@ -15,7 +15,7 @@
the buffer is visible, then set another timer and try again later." the buffer is visible, then set another timer and try again later."
(when (buffer-live-p buffer) (when (buffer-live-p buffer)
(let ((inhibit-quit t) (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) (cond ((get-buffer-window buffer t)
(with-current-buffer buffer (with-current-buffer buffer
(setq +popup--timer (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))) (signal 'wrong-type-argument (list 'integerp ttl)))
((= ttl 0) ((= ttl 0)
(+popup--kill-buffer buffer 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 (setq +popup--timer
(run-at-time ttl nil #'+popup--kill-buffer (run-at-time ttl nil #'+popup--kill-buffer
buffer ttl)))))))))) 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 param alist) size))
(setf (alist-get 'window-parameters alist) (setf (alist-get 'window-parameters alist)
parameters) 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) (defun +popup--split-window (window size side)
"Ensure a non-dedicated/popup window is selected when splitting a window." "Ensure a non-dedicated/popup window is selected when splitting a window."
@ -233,14 +246,14 @@ Uses `shrink-window-if-larger-than-buffer'."
;; Hooks ;; Hooks
;;;###autoload ;;;###autoload
(defun +popup|adjust-fringes () (defun +popup-adjust-fringes-h ()
"Hides the fringe in popup windows, restoring them if `+popup-buffer-mode' is "Hides the fringe in popup windows, restoring them if `+popup-buffer-mode' is
disabled." disabled."
(let ((f (if (bound-and-true-p +popup-buffer-mode) 0))) (let ((f (if (bound-and-true-p +popup-buffer-mode) 0)))
(set-window-fringes nil f f fringes-outside-margins))) (set-window-fringes nil f f fringes-outside-margins)))
;;;###autoload ;;;###autoload
(defun +popup|adjust-margins () (defun +popup-adjust-margins-h ()
"Creates padding for the popup window determined by `+popup-margin-width', "Creates padding for the popup window determined by `+popup-margin-width',
restoring it if `+popup-buffer-mode' is disabled." restoring it if `+popup-buffer-mode' is disabled."
(when +popup-margin-width (when +popup-margin-width
@ -250,7 +263,7 @@ restoring it if `+popup-buffer-mode' is disabled."
(defvar hide-mode-line-format) (defvar hide-mode-line-format)
;;;###autoload ;;;###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. "Don't show modeline in popup windows without a `modeline' window-parameter.
Possible values for this parameter are: 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) (funcall modeline)
modeline))) modeline)))
(hide-mode-line-mode +1))))))) (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 ;;;###autoload
(defun +popup|unset-modeline-on-disable () (defun +popup-unset-modeline-on-disable-h ()
"Restore the modeline when `+popup-buffer-mode' is deactivated." "Restore the modeline when `+popup-buffer-mode' is deactivated."
(when (and (not (bound-and-true-p +popup-buffer-mode)) (when (and (not (bound-and-true-p +popup-buffer-mode))
(bound-and-true-p hide-mode-line-mode)) (bound-and-true-p hide-mode-line-mode))
(hide-mode-line-mode -1))) (hide-mode-line-mode -1)))
;;;###autoload ;;;###autoload
(defun +popup|close-on-escape () (defun +popup-close-on-escape-h ()
"If called inside a popup, try to close that popup window (see "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'). If called outside, try to close all popup windows (see
`+popup/close-all')." `+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))) (+popup/close-all)))
;;;###autoload ;;;###autoload
(defun +popup|cleanup-rules () (defun +popup-cleanup-rules-h ()
"Cleans up any duplicate popup rules." "Cleans up any duplicate popup rules."
(interactive) (interactive)
(setq +popup--display-buffer-alist (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))) (setq display-buffer-alist +popup--display-buffer-alist)))
;;;###autoload ;;;###autoload
(defun +popup|kill-buffer-hook () (defun +popup-kill-buffer-hook-h ()
"TODO" "TODO"
(when-let (window (get-buffer-window)) (when-let (window (get-buffer-window))
(when (+popup-window-p 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." "Open this buffer in a popup window."
(interactive) (interactive)
(let ((+popup-default-display-buffer-actions (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) (display-buffer-alist +popup--display-buffer-alist)
(buffer (current-buffer))) (buffer (current-buffer)))
(push (+popup--make "." +popup-defaults) display-buffer-alist) (push (+popup--make "." +popup-defaults) display-buffer-alist)
@ -425,21 +438,21 @@ the message buffer in a popup window."
;; ;;
;; Advice ;;; Advice
;;;###autoload ;;;###autoload
(defun +popup*close (&rest _) (defun +popup-close-a (&rest _)
"TODO" "TODO"
(+popup/close nil t)) (+popup/close nil t))
;;;###autoload ;;;###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 "Sets aside all popups before executing the original function, usually to
prevent the popup(s) from messing up the UI (or vice versa)." prevent the popup(s) from messing up the UI (or vice versa)."
(save-popups! (apply orig-fn args))) (save-popups! (apply orig-fn args)))
;;;###autoload ;;;###autoload
(defun +popup-display-buffer-fullframe (buffer alist) (defun +popup-display-buffer-fullframe-fn (buffer alist)
"Displays the buffer fullscreen." "Displays the buffer fullscreen."
(let ((wconf (current-window-configuration))) (let ((wconf (current-window-configuration)))
(when-let (window (or (display-buffer-reuse-window buffer alist) (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))) window)))
;;;###autoload ;;;###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 "A `display-buffer' action that serves as an alternative to
`display-buffer-in-side-window', but allows for stacking popups with the `vslot' `display-buffer-in-side-window', but allows for stacking popups with the `vslot'
alist entry. alist entry.
@ -587,16 +600,17 @@ Accepts the same arguments as `display-buffer-in-side-window'. You must set
;; Emacs backwards compatibility ;; Emacs backwards compatibility
(unless EMACS27+ (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'. "Ensure `window--dispaly-buffer' respects `display-buffer-mark-dedicated'.
This was not so until recent Emacs 27 builds, where it causes breaking errors. This was not so until recent Emacs 27 builds, where it causes breaking errors.
This advice ensures backwards compatibility for Emacs <= 26 users." This advice ensures backwards compatibility for Emacs <= 26 users."
:filter-return #'window--display-buffer
(when (and (windowp window) display-buffer-mark-dedicated) (when (and (windowp window) display-buffer-mark-dedicated)
(set-window-dedicated-p window display-buffer-mark-dedicated)) (set-window-dedicated-p window display-buffer-mark-dedicated))
window) window))
(advice-add #'window--display-buffer :filter-return #'+popup*set-window-dedicated))
;; DEPRECATED
(unless EMACS26+ (unless EMACS26+
(defvar window-sides-reversed nil) (defvar window-sides-reversed nil)

View file

@ -74,7 +74,7 @@ PLIST can be made up of any of the following properties:
:side 'bottom|'top|'left|'right :side 'bottom|'top|'left|'right
Which side of the frame to open the popup on. This is only respected if 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'. is in :actions or `+popup-default-display-buffer-actions'.
:size/:width/:height FLOAT|INT|FN :size/:width/:height FLOAT|INT|FN
@ -93,7 +93,7 @@ PLIST can be made up of any of the following properties:
:slot/:vslot INT :slot/:vslot INT
(This only applies to popups with a :side and only if :actions is blank or (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 how multiple popups are laid out. INT can be any integer, positive and
negative. negative.

View file

@ -5,7 +5,7 @@
Modifying this has no effect, unless done before ui/popup loads.") Modifying this has no effect, unless done before ui/popup loads.")
(defvar +popup-default-display-buffer-actions (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.") "The functions to use to display the popup buffer.")
(defvar +popup-default-alist (defvar +popup-default-alist
@ -55,17 +55,17 @@ adjustment.")
:global t :global t
:keymap +popup-mode-map :keymap +popup-mode-map
(cond (+popup-mode (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 (setq +popup--old-display-buffer-alist display-buffer-alist
display-buffer-alist +popup--display-buffer-alist display-buffer-alist +popup--display-buffer-alist
window--sides-inhibit-check t) window--sides-inhibit-check t)
(dolist (prop +popup-window-parameters) (dolist (prop +popup-window-parameters)
(push (cons prop 'writable) window-persistent-parameters))) (push (cons prop 'writable) window-persistent-parameters)))
(t (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 (setq display-buffer-alist +popup--old-display-buffer-alist
window--sides-inhibit-check nil) window--sides-inhibit-check nil)
(+popup|cleanup-rules) (+popup-cleanup-rules-h)
(dolist (prop +popup-window-parameters) (dolist (prop +popup-window-parameters)
(delq (assq prop window-persistent-parameters) (delq (assq prop window-persistent-parameters)
window-persistent-parameters))))) window-persistent-parameters)))))
@ -78,16 +78,16 @@ that window has been changed or closed."
:init-value nil :init-value nil
:keymap +popup-buffer-mode-map :keymap +popup-buffer-mode-map
(if (not +popup-buffer-mode) (if (not +popup-buffer-mode)
(remove-hook 'after-change-major-mode-hook #'+popup|set-modeline-on-enable 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 nil t) (add-hook 'after-change-major-mode-hook #'+popup-set-modeline-on-enable-h nil t)
(when (timerp +popup--timer) (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) (cancel-timer +popup--timer)
(setq +popup--timer nil)))) (setq +popup--timer nil))))
(put '+popup-buffer-mode 'permanent-local t) (put '+popup-buffer-mode 'permanent-local t)
(put '+popup-buffer-mode 'permanent-local-hook 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) :vslot -11 :size 0.35 :select t)
("^\\*info\\*$" ; `Info-mode' ("^\\*info\\*$" ; `Info-mode'
:slot 2 :vslot 2 :size 0.45 :select t))) :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) ("^\\*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))) ("^\\*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 'doom-init-ui-hook #'+popup-mode :append)
(add-hook! '+popup-buffer-mode-hook (add-hook! '+popup-buffer-mode-hook
#'(+popup|adjust-fringes #'(+popup-adjust-fringes-h
+popup|adjust-margins +popup-adjust-margins-h
+popup|set-modeline-on-enable +popup-set-modeline-on-enable-h
+popup|unset-modeline-on-disable)) +popup-unset-modeline-on-disable-h))
;; ;;

View file

@ -21,7 +21,7 @@
(before-each (before-each
(setq display-buffer-alist nil (setq display-buffer-alist nil
+popup--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))) +popup-defaults '(:side bottom :select ignore :ttl nil :slot 1 :vslot 1)))
(after-each (after-each
(set-window-configuration wconf)) (set-window-configuration wconf))

View file

@ -8,14 +8,14 @@
;;;###autoload ;;;###autoload
(defun +tabbar-window-tab-list () (defun +tabbar-window-tab-list ()
(+tabbar-window-buffer-list)) (+tabbar-window-buffer-list-fn))
;;;###autoload ;;;###autoload
(defun +tabbar-window-buffer-list () (defun +tabbar-window-buffer-list-fn ()
(cl-delete-if-not #'buffer-live-p (window-parameter nil 'tabbar-buffers))) (cl-delete-if-not #'buffer-live-p (window-parameter nil 'tabbar-buffers)))
;;;###autoload ;;;###autoload
(defun +tabbar-buffer-groups () (defun +tabbar-buffer-groups-fn ()
(list (list
(cond ((or (string-equal "*" (substring (buffer-name) 0 1)) (cond ((or (string-equal "*" (substring (buffer-name) 0 1))
(memq major-mode '(magit-process-mode (memq major-mode '(magit-process-mode
@ -53,11 +53,11 @@
;;; Advice ;;; Advice
;;;###autoload ;;;###autoload
(defun +tabbar*kill-current-buffer (&rest _) (defun +tabbar-kill-current-buffer-a (&rest _)
(+tabbar|remove-buffer)) (+tabbar|remove-buffer))
;;;###autoload ;;;###autoload
(defun +tabbar*bury-buffer (orig-fn &rest args) (defun +tabbar-bury-buffer-a (orig-fn &rest args)
(if centaur-tabs-mode (if centaur-tabs-mode
(let ((b (current-buffer))) (let ((b (current-buffer)))
(apply orig-fn args) (apply orig-fn args)
@ -67,7 +67,7 @@
(apply orig-fn args))) (apply orig-fn args)))
;;;###autoload ;;;###autoload
(defun +tabbar*kill-tab-maybe (tab) (defun +tabbar-kill-tab-maybe-a (tab)
(let ((buffer (centaur-tabs-tab-value tab))) (let ((buffer (centaur-tabs-tab-value tab)))
(with-current-buffer buffer (with-current-buffer buffer
;; `kill-current-buffer' is advised not to kill buffers visible in another ;; `kill-current-buffer' is advised not to kill buffers visible in another
@ -80,7 +80,7 @@
;;; Hooks ;;; Hooks
;;;###autoload ;;;###autoload
(defun +tabbar|add-buffer () (defun +tabbar-add-buffer-h ()
(when (and centaur-tabs-mode (when (and centaur-tabs-mode
(doom-real-buffer-p (current-buffer))) (doom-real-buffer-p (current-buffer)))
(let* ((this-buf (current-buffer)) (let* ((this-buf (current-buffer))
@ -97,7 +97,7 @@
'tabbar-buffers (delete (current-buffer) (window-parameter nil 'tabbar-buffers))))) 'tabbar-buffers (delete (current-buffer) (window-parameter nil 'tabbar-buffers)))))
;;;###autoload ;;;###autoload
(defun +tabbar|new-window () (defun +tabbar-new-window-h ()
(when centaur-tabs-mode (when centaur-tabs-mode
(unless (window-parameter nil 'tabbar-buffers) (unless (window-parameter nil 'tabbar-buffers)
(+tabbar|add-buffer)))) (+tabbar-add-buffer-h))))

View file

@ -7,22 +7,22 @@
centaur-tabs-set-bar 'left centaur-tabs-set-bar 'left
centaur-tabs-set-modified-marker t) centaur-tabs-set-modified-marker t)
(defun +tabbar|init-frames () (add-hook 'centaur-tabs-mode-hook
(dolist (frame (frame-list)) (defun +tabbar-init-frames-h ()
(if (not centaur-tabs-mode) (dolist (frame (frame-list))
(set-frame-parameter frame 'buffer-predicate (frame-parameter frame 'old-buffer-predicate)) (if (not centaur-tabs-mode)
(set-frame-parameter frame 'old-buffer-predicate (frame-parameter frame 'buffer-predicate)) (set-frame-parameter frame 'buffer-predicate (frame-parameter frame 'old-buffer-predicate))
(set-frame-parameter frame 'buffer-predicate #'+tabbar-buffer-predicate)))) (set-frame-parameter frame 'old-buffer-predicate (frame-parameter frame '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 (setq centaur-tabs-buffer-list-function #'+tabbar-window-buffer-list-fn
centaur-tabs-buffer-groups-function #'+tabbar-buffer-groups) centaur-tabs-buffer-groups-function #'+tabbar-buffer-groups-fn)
(advice-add #'centaur-tabs-buffer-close-tab :override #'+tabbar*kill-tab-maybe) (advice-add #'centaur-tabs-buffer-close-tab :override #'+tabbar-kill-tab-maybe-a)
(advice-add #'bury-buffer :around #'+tabbar*bury-buffer) (advice-add #'bury-buffer :around #'+tabbar-bury-buffer-a)
(advice-add #'kill-current-buffer :before #'+tabbar*kill-current-buffer) (advice-add #'kill-current-buffer :before #'+tabbar-kill-current-buffer-a)
(add-hook 'doom-switch-buffer-hook #'+tabbar|add-buffer) (add-hook 'doom-switch-buffer-hook #'+tabbar-add-buffer-h)
(add-hook 'doom-switch-window-hook #'+tabbar|new-window) (add-hook 'doom-switch-window-hook #'+tabbar-new-window-h)
(add-hook '+doom-dashboard-mode-hook #'centaur-tabs-local-mode) (add-hook '+doom-dashboard-mode-hook #'centaur-tabs-local-mode)

View file

@ -6,6 +6,7 @@
treemacs-persist-file (concat doom-cache-dir "treemacs-persist") treemacs-persist-file (concat doom-cache-dir "treemacs-persist")
treemacs-last-error-persist-file (concat doom-cache-dir "treemacs-last-error-persist")) treemacs-last-error-persist-file (concat doom-cache-dir "treemacs-last-error-persist"))
(after! treemacs-persistence (after! treemacs-persistence
;; This variable is defined with defconst, so we must wait to change it until ;; This variable is defined with defconst, so we must wait to change it until
;; it has loaded. ;; it has loaded.
@ -25,7 +26,7 @@
(treemacs-follow-mode -1) (treemacs-follow-mode -1)
(after! ace-window (after! ace-window
(setq aw-ignored-buffers (delq 'treemacs-mode aw-ignored-buffers)))) (delq! aw-ignored-buffers 'treemacs-mode)))
(def-package! treemacs-evil (def-package! treemacs-evil

View file

@ -1,20 +1,18 @@
;;; ui/unicode/autoload.el -*- lexical-binding: t; -*- ;;; ui/unicode/autoload.el -*- lexical-binding: t; -*-
;;;###autoload ;;;###autoload
(add-hook 'doom-init-ui-hook #'+unicode|init-fonts) (add-hook 'doom-init-ui-hook
(defun +unicode-init-fonts-h ()
;;;###autoload "Set up `unicode-fonts' to eventually run; accomodating the daemon, if
(defun +unicode|init-fonts ()
"Set up `unicode-fonts' to eventually run; accomodating the daemon, if
necessary." necessary."
(setq-default bidi-display-reordering t (setq-default bidi-display-reordering t
doom-unicode-font nil) doom-unicode-font nil)
(if initial-window-system (if initial-window-system
(+unicode|setup-fonts (selected-frame)) (+unicode-setup-fonts-h (selected-frame))
(add-hook 'after-make-frame-functions #'+unicode|setup-fonts))) (add-hook 'after-make-frame-functions #'+unicode-setup-fonts-h))))
;;;###autoload ;;;###autoload
(defun +unicode|setup-fonts (&optional frame) (defun +unicode-setup-fonts-h (&optional frame)
"Initialize `unicode-fonts', if in a GUI session." "Initialize `unicode-fonts', if in a GUI session."
(when (and frame (display-graphic-p frame)) (when (and frame (display-graphic-p frame))
(with-selected-frame frame (with-selected-frame frame