master 59518a3c210 2/2: ; Improve last change.
Sean Whitton <[email protected]>
| Newsgroups | gmane.emacs.diffs |
|---|---|
| Message-ID | <[email protected]> |
branch: master commit 59518a3c2104cfd8747bd4248f9621439818f82f Author: Sean Whitton <[email protected]> Commit: Sean Whitton <[email protected]> ; Improve last change. --- etc/NEWS | 4 ++-- lisp/speedbar.el | 34 +++++++++++++++++----------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 38ec8d994ab..9ddf8d41028 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -251,10 +251,10 @@ To install the grammars, use 'M-x markdown-ts-mode-install-parsers'. ** Speedbar --- -*** A nil value for 'speedbar-directory-unshown-regexp' means "show all" +*** A nil value for 'speedbar-directory-unshown-regexp' means "show all". --- -*** A nil value for 'speedbar-file-unshown-regexp' means "show all" +*** A nil value for 'speedbar-file-unshown-regexp' means "show all". * Incompatible Lisp Changes in Emacs 32.1 diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 92d96ef81b0..e5fde873a08 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -661,21 +661,20 @@ before speedbar has been loaded." (speedbar-extension-list-to-regex val)))) (defcustom speedbar-directory-unshown-regexp "^\\(\\..*\\)\\'" - "Hide matching directories. + "How to hide matching directories. The value can either be nil or a regular expression: -- The nil value means to not hide any directory. +- nil means to not hide any directory. -- The regular expression means to hide the matching directories. Note - that it is no longer necessary to include version-control directories - here; see `vc-directory-exclusion-list'. +- A regular expression means to hide matching directories. + It is no longer necessary to include version-control directories here; + see `vc-directory-exclusion-list'. -The default value is a regular expression. It hides all directories +The default value is a regular expression that hides all directories whose name starts with a dot." :group 'speedbar - :type '(choice - (regexp :tag "Hide matches of regular expression") - (const :tag "Do not hide anything" nil)) + :type '(choice (regexp :tag "Hide matches of regular expression") + (const :tag "Do not hide anything" nil)) :version "32.1") (defcustom speedbar-file-unshown-regexp @@ -2021,17 +2020,18 @@ the file-system." (dirs nil) (files nil) (hide-p (lambda (name user-option) - (let ((value (symbol-value user-option))) - (or (and value - (not (stringp value)) - (user-error "The `%s' must either be a string or nil" user-option)) - (and value - (string-match value name))))))) + (and-let* ((value (symbol-value user-option))) + (if (stringp value) + (string-match value name) + (user-error "`%s' must either be a string or nil" + user-option)))))) (while dir (if (not - (or (funcall hide-p (car dir) 'speedbar-file-unshown-regexp) + (or (funcall hide-p (car dir) + 'speedbar-file-unshown-regexp) (member (car dir) vc-directory-exclusion-list) - (funcall hide-p (car dir) 'speedbar-directory-unshown-regexp))) + (funcall hide-p (car dir) + 'speedbar-directory-unshown-regexp))) (if (file-directory-p (car dir)) (setq dirs (cons (car dir) dirs)) (setq files (cons (car dir) files))))