mirror of
https://github.com/doomemacs/doomemacs.git
synced 2026-03-07 14:21:47 -08:00
feat(lib): doom-special-buffer-p: consider special-mode parents
This commit is contained in:
parent
279d27a981
commit
28cb499225
3 changed files with 9 additions and 10 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue