diff options
| author | Glenn Morris | 2014-02-26 23:42:57 -0800 |
|---|---|---|
| committer | Glenn Morris | 2014-02-26 23:42:57 -0800 |
| commit | d926361813de2d50b42e63f1b9b603220ead6c7d (patch) | |
| tree | 15ab49ea5d3dec69b42dbb6010677ad4317ba9e1 | |
| parent | 51f213c35fbd45fbf068f2667b8af7ba31c29de4 (diff) | |
| download | emacs-d926361813de2d50b42e63f1b9b603220ead6c7d.tar.gz emacs-d926361813de2d50b42e63f1b9b603220ead6c7d.zip | |
Some crm.el doc
* lisp/emacs-lisp/crm.el: Remove commentary that duplicates doc strings.
(crm-default-separator, crm-separator) (completing-read-multiple):
Doc fixes.
* etc/NEWS: Related edit.
| -rw-r--r-- | etc/NEWS | 5 | ||||
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/emacs-lisp/crm.el | 62 |
3 files changed, 25 insertions, 47 deletions
| @@ -1173,8 +1173,9 @@ as a function to call to provide default values. | |||
| 1173 | 1173 | ||
| 1174 | ** Completion changes | 1174 | ** Completion changes |
| 1175 | 1175 | ||
| 1176 | *** The separator for `completing-read-multiple' can now be a regexp. | 1176 | --- |
| 1177 | The default separator has been changed to allow surrounding spaces | 1177 | *** The separator used by `completing-read-multiple' is now a regexp. |
| 1178 | The default `crm-separator' has been changed to allow surrounding spaces | ||
| 1178 | around the comma. | 1179 | around the comma. |
| 1179 | 1180 | ||
| 1180 | *** The `common-substring' arg of `display-completion-list' is obsolete. | 1181 | *** The `common-substring' arg of `display-completion-list' is obsolete. |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3182666b483..0198c0f8dc5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-02-27 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * emacs-lisp/crm.el (crm-default-separator, crm-separator) | ||
| 4 | (completing-read-multiple): Doc fixes. | ||
| 5 | |||
| 1 | 2014-02-27 Daniel Colascione <dancol@dancol.org> | 6 | 2014-02-27 Daniel Colascione <dancol@dancol.org> |
| 2 | 7 | ||
| 3 | * minibuffer.el (completion--nth-completion): Fix indentation. | 8 | * minibuffer.el (completion--nth-completion): Fix indentation. |
diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el index 15960192664..e991c4782f7 100644 --- a/lisp/emacs-lisp/crm.el +++ b/lisp/emacs-lisp/crm.el | |||
| @@ -24,27 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | ;; This code defines a function, `completing-read-multiple', which | 25 | ;; This code defines a function, `completing-read-multiple', which |
| 26 | ;; provides the ability to read multiple strings in the minibuffer, | 26 | ;; provides the ability to read multiple strings in the minibuffer, |
| 27 | ;; with completion. | 27 | ;; with completion. See that function's documentation for details. |
| 28 | |||
| 29 | ;; By using this functionality, a user may specify multiple strings at | ||
| 30 | ;; a single prompt, optionally using completion. | ||
| 31 | |||
| 32 | ;; Multiple strings are specified by separating each of the strings | ||
| 33 | ;; with a prespecified separator regexp. For example, if the | ||
| 34 | ;; separator regexp is ",", the strings 'alice', 'bob', and | ||
| 35 | ;; 'eve' would be specified as 'alice,bob,eve'. | ||
| 36 | |||
| 37 | ;; The default value for the separator regexp is the value of | ||
| 38 | ;; `crm-default-separator' (comma). The separator regexp may be | ||
| 39 | ;; changed by modifying the value of `crm-separator'. | ||
| 40 | |||
| 41 | ;; Contiguous strings of non-separator-characters are referred to as | ||
| 42 | ;; 'elements'. In the aforementioned example, the elements are: | ||
| 43 | ;; 'alice', 'bob', and 'eve'. | ||
| 44 | |||
| 45 | ;; Completion is available on a per-element basis. For example, if | ||
| 46 | ;; the contents of the minibuffer are 'alice,bob,eve' and point is | ||
| 47 | ;; between 'l' and 'i', pressing TAB operates on the element 'alice'. | ||
| 48 | 28 | ||
| 49 | ;; For the moment, I have decided to not bind any special behavior to | 29 | ;; For the moment, I have decided to not bind any special behavior to |
| 50 | ;; the separator key. In the future, the separator key might be used | 30 | ;; the separator key. In the future, the separator key might be used |
| @@ -96,14 +76,16 @@ | |||
| 96 | ;; first revamped version | 76 | ;; first revamped version |
| 97 | 77 | ||
| 98 | ;;; Code: | 78 | ;;; Code: |
| 79 | |||
| 80 | ;; FIXME I don't see that this needs to exist as a separate variable. | ||
| 81 | ;; crm-separator should suffice. | ||
| 99 | (defconst crm-default-separator "[ \t]*,[ \t]*" | 82 | (defconst crm-default-separator "[ \t]*,[ \t]*" |
| 100 | "Default separator regexp for `completing-read-multiple'.") | 83 | "Default value of `crm-separator'.") |
| 101 | 84 | ||
| 102 | (defvar crm-separator crm-default-separator | 85 | (defvar crm-separator crm-default-separator |
| 103 | "Separator regexp used for separating strings in `completing-read-multiple'. | 86 | "Separator regexp used for separating strings in `completing-read-multiple'. |
| 104 | It should be a regexp that does not match the list of completion candidates. | 87 | It should be a regexp that does not match the list of completion candidates. |
| 105 | Modify this value to make `completing-read-multiple' use a separator other | 88 | The default value is `crm-default-separator'.") |
| 106 | than `crm-default-separator'.") | ||
| 107 | 89 | ||
| 108 | (defvar crm-local-completion-map | 90 | (defvar crm-local-completion-map |
| 109 | (let ((map (make-sparse-keymap))) | 91 | (let ((map (make-sparse-keymap))) |
| @@ -247,32 +229,22 @@ exiting the minibuffer." | |||
| 247 | (prompt table &optional predicate require-match initial-input | 229 | (prompt table &optional predicate require-match initial-input |
| 248 | hist def inherit-input-method) | 230 | hist def inherit-input-method) |
| 249 | "Read multiple strings in the minibuffer, with completion. | 231 | "Read multiple strings in the minibuffer, with completion. |
| 250 | By using this functionality, a user may specify multiple strings at a | 232 | The arguments are the same as those of `completing-read'. |
| 251 | single prompt, optionally using completion. | ||
| 252 | \\<crm-local-completion-map> | 233 | \\<crm-local-completion-map> |
| 253 | Multiple strings are specified by separating each of the strings with | 234 | Input multiple strings by separating each one with a string that |
| 254 | a prespecified separator regexp. For example, if the separator | 235 | matches the regexp `crm-separator'. For example, if the separator |
| 255 | regexp is \",\", the strings 'alice', 'bob', and 'eve' would be | 236 | regexp is \",\", entering \"alice,bob,eve\" specifies the strings |
| 256 | specified as 'alice,bob,eve'. | 237 | \"alice\", \"bob\", and \"eve\". |
| 257 | 238 | ||
| 258 | The default value for the separator regexp is the value of | 239 | We refer to contiguous strings of non-separator-characters as |
| 259 | `crm-default-separator'. You can change the separator regexp by | 240 | \"elements\". In this example there are three elements. |
| 260 | modifying the value of `crm-separator'. | ||
| 261 | |||
| 262 | Contiguous strings of non-separator-characters are referred to as | ||
| 263 | 'elements'. In the aforementioned example, the elements are: 'alice', | ||
| 264 | 'bob', and 'eve'. | ||
| 265 | 241 | ||
| 266 | Completion is available on a per-element basis. For example, if the | 242 | Completion is available on a per-element basis. For example, if the |
| 267 | contents of the minibuffer are 'alice,bob,eve' and point is between | 243 | contents of the minibuffer are \"alice,bob,eve\" and point is between |
| 268 | 'l' and 'i', pressing TAB operates on the element 'alice'. | 244 | \"l\" and \"i\", pressing \\[minibuffer-complete] operates on the element \"alice\". |
| 269 | |||
| 270 | The return value of this function is a list of the read strings | ||
| 271 | with empty strings removed. | ||
| 272 | 245 | ||
| 273 | See the documentation for `completing-read' for details on the arguments: | 246 | This function returns a list of the strings that were read, |
| 274 | PROMPT, TABLE, PREDICATE, REQUIRE-MATCH, INITIAL-INPUT, HIST, DEF, and | 247 | with empty strings removed." |
| 275 | INHERIT-INPUT-METHOD." | ||
| 276 | (unwind-protect | 248 | (unwind-protect |
| 277 | (progn | 249 | (progn |
| 278 | (add-hook 'choose-completion-string-functions | 250 | (add-hook 'choose-completion-string-functions |