branch: externals/consult
commit 3cadc1031495661dc2c884fc307e8d59852f3b54
Author: Daniel Mendler <m...@daniel-mendler.de>
Commit: Daniel Mendler <m...@daniel-mendler.de>

    Improve some defcustoms
---
 README.org | 86 +++++++++++++++++++++++++++++++-------------------------------
 consult.el | 29 +++++++++++----------
 2 files changed, 59 insertions(+), 56 deletions(-)

diff --git a/README.org b/README.org
index 30a5e341c8..b05e15a64c 100644
--- a/README.org
+++ b/README.org
@@ -914,49 +914,49 @@ configuration examples.
 values and abbreviated description. Alternatively, type =C-h a ^consult= to get
 an overview of all Consult variables and functions with their descriptions.
 
-| Variable                         | Description                               
           |
-|----------------------------------+------------------------------------------------------|
-| consult-after-jump-hook          | Functions to call after jumping to a 
location        |
-| consult-async-input-debounce     | Input debounce for asynchronous commands  
           |
-| consult-async-input-throttle     | Input throttle for asynchronous commands  
           |
-| consult-async-min-input          | Minimum numbers of letters needed for 
async process  |
-| consult-async-refresh-delay      | Refresh delay for asynchronous commands   
           |
-| consult-async-split-style        | Splitting style used for async commands   
           |
-| consult-async-split-styles-alist | Available splitting styles used for async 
commands   |
-| consult-bookmark-narrow          | Narrowing configuration for 
=consult-bookmark=         |
-| consult-buffer-filter            | Filter for =consult-buffer=               
             |
-| consult-buffer-sources           | List of virtual buffer sources            
           |
-| consult-fd-args                  | Command line arguments for fd             
           |
-| consult-find-args                | Command line arguments for find           
           |
-| consult-fontify-max-size         | Buffers larger than this limit are not 
fontified     |
-| consult-fontify-preserve         | Preserve fontification for line-based 
commands.      |
-| consult-git-grep-args            | Command line arguments for git-grep       
           |
-| consult-goto-line-numbers        | Show line numbers for =consult-goto-line= 
             |
-| consult-grep-max-columns         | Maximal number of columns of the matching 
lines      |
-| consult-grep-args                | Command line arguments for grep           
           |
-| consult-imenu-config             | Mode-specific configuration for 
=consult-imenu=        |
-| consult-line-numbers-widen       | Show absolute line numbers when narrowing 
is active. |
-| consult-line-start-from-top      | Start the =consult-line= search from the 
top           |
-| consult-locate-args              | Command line arguments for locate         
           |
-| consult-man-args                 | Command line arguments for man            
           |
-| consult-mode-command-filter      | Filter for =consult-mode-command=         
             |
-| consult-mode-histories           | Mode-specific history variables           
           |
-| consult-narrow-key               | Narrowing prefix key during completion    
           |
-| consult-point-placement          | Placement of the point when jumping to 
matches       |
-| consult-preview-key              | Keys which triggers preview               
           |
-| consult-preview-allowed-hooks    | List of =find-file= hooks to enable 
during preview     |
-| consult-preview-excluded-files   | Regexps matched against file names during 
preview    |
-| consult-preview-max-count        | Maximum number of files to keep open 
during preview  |
-| consult-preview-partial-size     | Files larger than this size are previewed 
partially  |
-| consult-preview-partial-chunk    | Size of the file chunk which is previewed 
partially  |
-| consult-preview-variables        | Alist of variables to bind during preview 
           |
-| consult-project-buffer-sources   | List of virtual project buffer sources    
           |
-| consult-project-function         | Function which returns current project 
root          |
-| consult-register-prefix          | Prefix string for register keys during 
completion    |
-| consult-ripgrep-args             | Command line arguments for ripgrep        
           |
-| consult-themes                   | List of themes to be presented for 
selection         |
-| consult-widen-key                | Widening key during completion            
           |
-| consult-yank-rotate              | Rotate kill ring                          
           |
+| Variable                         | Description                               
          |
+|----------------------------------+-----------------------------------------------------|
+| consult-after-jump-hook          | Functions to call after jumping to a 
location       |
+| consult-async-input-debounce     | Input debounce for asynchronous commands  
          |
+| consult-async-input-throttle     | Input throttle for asynchronous commands  
          |
+| consult-async-min-input          | Minimum numbers of input characters       
          |
+| consult-async-refresh-delay      | Refresh delay for asynchronous commands   
          |
+| consult-async-split-style        | Splitting style used for async commands   
          |
+| consult-async-split-styles-alist | Available splitting styles used for async 
commands  |
+| consult-bookmark-narrow          | Narrowing configuration for 
=consult-bookmark=        |
+| consult-buffer-filter            | Filter for =consult-buffer=               
            |
+| consult-buffer-sources           | List of virtual buffer sources            
          |
+| consult-fd-args                  | Command line arguments for fd             
          |
+| consult-find-args                | Command line arguments for find           
          |
+| consult-fontify-max-size         | Buffers larger than this limit are not 
fontified    |
+| consult-fontify-preserve         | Preserve fontification for line-based 
commands.     |
+| consult-git-grep-args            | Command line arguments for git-grep       
          |
+| consult-goto-line-numbers        | Show line numbers for =consult-goto-line= 
            |
+| consult-grep-max-columns         | Maximal number of columns of the matching 
lines     |
+| consult-grep-args                | Command line arguments for grep           
          |
+| consult-imenu-config             | Mode-specific configuration for 
=consult-imenu=       |
+| consult-line-numbers-widen       | Show absolute line numbers when narrowing 
is active |
+| consult-line-start-from-top      | Start the =consult-line= search from the 
top          |
+| consult-locate-args              | Command line arguments for locate         
          |
+| consult-man-args                 | Command line arguments for man            
          |
+| consult-mode-command-filter      | Filter for =consult-mode-command=         
            |
+| consult-mode-histories           | Mode-specific history variables           
          |
+| consult-narrow-key               | Narrowing prefix key during completion    
          |
+| consult-point-placement          | Placement of the point when jumping to 
matches      |
+| consult-preview-key              | Keys which triggers preview               
          |
+| consult-preview-allowed-hooks    | List of =find-file= hooks to enable 
during preview    |
+| consult-preview-excluded-files   | Regexps matched against file names during 
preview   |
+| consult-preview-max-count        | Maximum number of files to keep open 
during preview |
+| consult-preview-partial-size     | Files larger than this size are previewed 
partially |
+| consult-preview-partial-chunk    | Size of the file chunk which is previewed 
partially |
+| consult-preview-variables        | Alist of variables to bind during preview 
          |
+| consult-project-buffer-sources   | List of virtual project buffer sources    
          |
+| consult-project-function         | Function which returns current project 
root         |
+| consult-register-prefix          | Prefix string for register keys during 
completion   |
+| consult-ripgrep-args             | Command line arguments for ripgrep        
          |
+| consult-themes                   | List of themes to be presented for 
selection        |
+| consult-widen-key                | Widening key during completion            
          |
+| consult-yank-rotate              | Rotate kill ring                          
          |
 
 ** Fine-tuning of individual commands
 :properties:
diff --git a/consult.el b/consult.el
index b7e4f8f8c2..a8a1faecfe 100644
--- a/consult.el
+++ b/consult.el
@@ -73,14 +73,14 @@
 
 Good choices for this key are \"<\" and \"C-+\" for example. The
 key must be a string accepted by `key-valid-p'."
-  :type '(choice key (const nil)))
+  :type '(choice key (const :tag "None" nil)))
 
 (defcustom consult-widen-key nil
   "Key used for widening during completion.
 
 If this key is unset, defaults to twice the `consult-narrow-key'.
 The key must be a string accepted by `key-valid-p'."
-  :type '(choice key (const nil)))
+  :type '(choice key (const :tag "None" nil)))
 
 (defcustom consult-project-function
   #'consult--default-project-function
@@ -89,7 +89,10 @@ The function takes one boolean argument MAY-PROMPT.  If
 MAY-PROMPT is non-nil, the function may ask the prompt the user
 for a project directory.  The root directory is used by
 `consult-buffer' and `consult-grep'."
-  :type '(choice function (const nil)))
+  :type '(choice
+          (const :tag "Default project function" 
#'consult--default-project-function)
+          (function :tag "Custom function")
+          (const :tag "No project integration" nil)))
 
 (defcustom consult-async-refresh-delay 0.2
   "Refreshing delay of the completion UI for asynchronous commands.
@@ -97,7 +100,7 @@ for a project directory.  The root directory is used by
 The completion UI is only updated every
 `consult-async-refresh-delay' seconds.  This applies to
 asynchronous commands like for example `consult-grep'."
-  :type 'float)
+  :type '(float :tag "Delay in seconds"))
 
 (defcustom consult-async-input-throttle 0.4
   "Input throttle for asynchronous commands.
@@ -105,7 +108,7 @@ asynchronous commands like for example `consult-grep'."
 The asynchronous process is started only every
 `consult-async-input-throttle' seconds.  This applies to asynchronous
 commands, e.g., `consult-grep'."
-  :type 'float)
+  :type '(float :tag "Delay in seconds"))
 
 (defcustom consult-async-input-debounce 0.2
   "Input debounce for asynchronous commands.
@@ -113,13 +116,13 @@ commands, e.g., `consult-grep'."
 The asynchronous process is started only when there has not been new
 input for `consult-async-input-debounce' seconds.  This applies to
 asynchronous commands, e.g., `consult-grep'."
-  :type 'float)
+  :type '(float :tag "Delay in seconds"))
 
 (defcustom consult-async-min-input 3
-  "Minimum number of letters needed, before asynchronous process is called.
+  "Minimum number of characters needed, before asynchronous process is called.
 
 This applies to asynchronous commands, e.g., `consult-grep'."
-  :type 'natnum)
+  :type '(natnum :tag "Number of characters"))
 
 (defcustom consult-async-split-style 'perl
   "Async splitting style, see `consult-async-split-styles-alist'."
@@ -197,7 +200,7 @@ See also `display-line-numbers-widen'."
 
 This is necessary in order to prevent a large startup time
 for navigation commands like `consult-line'."
-  :type 'natnum)
+  :type '(natnum :tag "Buffer size in bytes"))
 
 (defcustom consult-buffer-filter
   '("\\` "
@@ -322,17 +325,17 @@ individual keys must be strings accepted by 
`key-valid-p'."
 
 (defcustom consult-preview-partial-size 1048576
   "Files larger than this byte limit are previewed partially."
-  :type 'natnum)
+  :type '(natnum :tag "File size in bytes"))
 
 (defcustom consult-preview-partial-chunk 102400
   "Partial preview chunk size in bytes.
 If a file is larger than `consult-preview-partial-size' only the
 chunk from the beginning of the file is previewed."
-  :type 'natnum)
+  :type '(natnum :tag "Chunk size in bytes"))
 
 (defcustom consult-preview-max-count 10
-  "Number of files to keep open at once during preview."
-  :type 'natnum)
+  "Number of file buffers to keep open temporarily during preview."
+  :type '(natnum :tag "Number of buffers"))
 
 (defcustom consult-preview-excluded-files
   '("\\`/[^/|:]+:") ;; Do not preview remote files

Reply via email to