diff options
| author | Phil Sainty | 2026-01-02 18:34:25 +1300 |
|---|---|---|
| committer | Phil Sainty | 2026-01-11 22:31:49 +1300 |
| commit | 4484a9f87536ee0caff4b1f53fde8f4f3ac4adbe (patch) | |
| tree | 1d7f377be844eede62ef2381e6ce4f4639f4b931 | |
| parent | 38092d879b747b829fb80328925c3f282d8936e9 (diff) | |
| download | emacs-4484a9f87536ee0caff4b1f53fde8f4f3ac4adbe.tar.gz emacs-4484a9f87536ee0caff4b1f53fde8f4f3ac4adbe.zip | |
Avoid byte-compiled code in `ibuffer-maybe-show-predicates' value (bug#80117)
* lisp/ibuffer.el (ibuffer-hidden-buffer-p): New function.
(ibuffer-maybe-show-predicates): Use it.
(ibuffer-fontification-alist): Use it (for consistency).
This prevents byte-compiled code appearing in the *Help* buffer
and in the customize UI for `ibuffer-maybe-show-predicates'.
| -rw-r--r-- | lisp/ibuffer.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index d8692595ee0..99fe5cd2f5a 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el | |||
| @@ -166,9 +166,7 @@ elisp byte-compiler." | |||
| 166 | buffer-file-name)) | 166 | buffer-file-name)) |
| 167 | font-lock-doc-face) | 167 | font-lock-doc-face) |
| 168 | (20 (string-match "^\\*" (buffer-name)) font-lock-keyword-face) | 168 | (20 (string-match "^\\*" (buffer-name)) font-lock-keyword-face) |
| 169 | (25 (and (string-match "^ " (buffer-name)) | 169 | (25 (ibuffer-hidden-buffer-p) italic) |
| 170 | (null buffer-file-name)) | ||
| 171 | italic) | ||
| 172 | (30 (memq major-mode ibuffer-help-buffer-modes) font-lock-comment-face) | 170 | (30 (memq major-mode ibuffer-help-buffer-modes) font-lock-comment-face) |
| 173 | (35 (derived-mode-p 'dired-mode) font-lock-function-name-face) | 171 | (35 (derived-mode-p 'dired-mode) font-lock-function-name-face) |
| 174 | (40 (and (boundp 'emacs-lock-mode) emacs-lock-mode) ibuffer-locked-buffer)) | 172 | (40 (and (boundp 'emacs-lock-mode) emacs-lock-mode) ibuffer-locked-buffer)) |
| @@ -236,9 +234,7 @@ view of the buffers." | |||
| 236 | "The string to use for eliding long columns." | 234 | "The string to use for eliding long columns." |
| 237 | :type 'string) | 235 | :type 'string) |
| 238 | 236 | ||
| 239 | (defcustom ibuffer-maybe-show-predicates `(,(lambda (buf) | 237 | (defcustom ibuffer-maybe-show-predicates '(ibuffer-hidden-buffer-p) |
| 240 | (and (string-match "^ " (buffer-name buf)) | ||
| 241 | (null buffer-file-name)))) | ||
| 242 | "A list of predicates for buffers to display conditionally. | 238 | "A list of predicates for buffers to display conditionally. |
| 243 | 239 | ||
| 244 | A predicate can be a regexp or a function. | 240 | A predicate can be a regexp or a function. |
| @@ -2035,6 +2031,13 @@ the value of point at the beginning of the line for that buffer." | |||
| 2035 | e))) | 2031 | e))) |
| 2036 | bmarklist)))) | 2032 | bmarklist)))) |
| 2037 | 2033 | ||
| 2034 | (defun ibuffer-hidden-buffer-p (&optional buf) | ||
| 2035 | "The default member of `ibuffer-maybe-show-predicates'. | ||
| 2036 | Non-nil if BUF is not visiting a file and its name begins with a space. | ||
| 2037 | BUF defaults to the current buffer." | ||
| 2038 | (and (string-match "^ " (buffer-name buf)) | ||
| 2039 | (null (buffer-file-name buf)))) | ||
| 2040 | |||
| 2038 | (defun ibuffer-visible-p (buf all &optional ibuffer-buf) | 2041 | (defun ibuffer-visible-p (buf all &optional ibuffer-buf) |
| 2039 | (and (or all | 2042 | (and (or all |
| 2040 | (not | 2043 | (not |