]> git.eshelyaron.com Git - emacs.git/commitdiff
Add a basic widget type for buffer predicates
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 4 Sep 2022 14:29:06 +0000 (16:29 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 4 Sep 2022 14:29:06 +0000 (16:29 +0200)
* lisp/paren.el (show-paren-predicate):
* lisp/outline.el (outline-minor-mode-use-buttons): Use it.
* lisp/wid-edit.el (buffer-predicate): New widget type.

lisp/outline.el
lisp/paren.el
lisp/wid-edit.el

index 2e18fd5b8fed1b4595f5bce93feb67115d86f91e..178cbe30715f7ac83c18e18a2dfc82f0205d436a 100644 (file)
@@ -288,8 +288,7 @@ The value should be a `buffer-match-p' condition.
 These buttons can be used to hide and show the body under the heading.
 Note that this feature is not meant to be used in editing
 buffers (yet) -- that will be amended in a future version."
-  ;; FIXME -- is there a `buffer-match-p' defcustom type somewhere?
-  :type 'sexp
+  :type 'buffer-predicate
   :safe #'booleanp
   :version "29.1")
 
index 13e219c8f609525a0720fffcad6702c8bd96ca05..e2c060ceb965d579e81249d0f091ec9e4ab242a3 100644 (file)
@@ -123,7 +123,7 @@ On non-graphical frames, the context is shown in the echo area."
 The default is to enable the mode in all buffers that have don't
 derive from `special-mode', which means that it's on (by default)
 in all editing buffers."
-  :type 'sexp
+  :type 'buffer-predicate
   :safe #'booleanp
   :version "29.1")
 
index ec2eb146e9016143b649913b98c278089a6ae646..9aec6b02441accd57ae0ea0a37b8c8bcebf3c438 100644 (file)
@@ -4145,6 +4145,15 @@ is inline."
 (define-obsolete-function-alias 'widget-visibility-value-create
   #'widget-toggle-value-create "29.1")
 
+;;; Buffer predicates.
+(define-widget 'buffer-predicate 'lazy
+  "A buffer predicate."
+  :tag "Buffer predicate"
+  :type '(choice (const :tag "All buffers" t)
+                 (const :tag "No buffers" nil)
+                 ;; FIXME: This should be expanded somehow.
+                 sexp))
+
 (provide 'wid-edit)
 
 ;;; wid-edit.el ends here