feat(lib): doom-special-buffer-p: consider special-mode parents

This commit is contained in:
Henrik Lissner 2026-02-20 20:02:43 -05:00
parent 279d27a981
commit 28cb499225
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
3 changed files with 9 additions and 10 deletions

View file

@ -560,7 +560,7 @@ on."
:before-while #'so-long-statistics-excessive-p
:before-while #'so-long-detected-long-line-p
(not (or (doom-temp-buffer-p (current-buffer))
(doom-special-buffer-p (current-buffer)))))
(doom-special-buffer-p (current-buffer) t))))
;; Don't disable syntax highlighting and line numbers, or make the buffer
;; read-only, in `so-long-minor-mode', so we can have a basic editing

View file

@ -83,15 +83,14 @@ If no project is active, return all buffers."
finally return (hash-table-keys projects)))
;;;###autoload
(defun doom-dired-buffer-p (buf)
"Returns non-nil if BUF is a dired buffer."
(provided-mode-derived-p (buffer-local-value 'major-mode buf)
'dired-mode))
(defun doom-special-buffer-p (buf &optional consider-mode?)
"Returns non-nil if BUF's name starts with an *.
;;;###autoload
(defun doom-special-buffer-p (buf)
"Returns non-nil if BUF's name starts and ends with an *."
(char-equal ?* (aref (buffer-name buf) 0)))
If CONSIDER-MODE? is non-nil, returns non-nil if BUF's mode is derived from
`special-mode'."
(or (char-equal ?* (aref (buffer-name buf) 0))
(and consider-mode?
(provided-mode-derived-p (buffer-local-value 'major-mode buf) 'special-mode))))
;;;###autoload
(defun doom-temp-buffer-p (buf)

View file

@ -62,7 +62,7 @@ be enabled. If any function returns non-nil, the mode will not be activated."
(and (not (derived-mode-p 'text-mode 'prog-mode 'conf-mode))
(or buffer-read-only
(bound-and-true-p cursor-intangible-mode)
(derived-mode-p 'special-mode))))
(doom-special-buffer-p (current-buffer) t))))
;; Org's virtual indentation messes up indent-guides.
(defun +indent-guides-in-org-indent-mode-p ()
(bound-and-true-p org-indent-mode))