diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/emacs-lisp/pcase.el | 18 | ||||
-rw-r--r-- | lisp/emacs-lisp/rx.el | 2 | ||||
-rw-r--r-- | lisp/mail/rmailsum.el | 2 | ||||
-rw-r--r-- | lisp/simple.el | 2 |
4 files changed, 15 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index 57c2d6c3cb5..2746738d41a 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -266,7 +266,8 @@ variable name being but a special case of it)." (defmacro pcase-let* (bindings &rest body) "Like `let*' but where you can use `pcase' patterns for bindings. BODY should be an expression, and BINDINGS should be a list of bindings -of the form (PAT EXP)." +of the form (PATTERN EXP). +See `pcase-let' for discussion of how PATTERN is matched." (declare (indent 1) (debug ((&rest (pcase-PAT &optional form)) body))) (let ((cached (gethash bindings pcase--memoize))) @@ -281,10 +282,11 @@ of the form (PAT EXP)." (defmacro pcase-let (bindings &rest body) "Like `let' but where you can use `pcase' patterns for bindings. BODY should be a list of expressions, and BINDINGS should be a list of bindings -of the form (PAT EXP). -The macro is expanded and optimized under the assumption that those -patterns *will* match, so a mismatch may go undetected or may cause -any kind of error." +of the form (PATTERN EXP). +The PATTERNs are only used to extract data, so the code does not test +whether the data does match the corresponding patterns: a mismatch +may signal an error or may go undetected, binding variables to arbitrary +values, such as nil." (declare (indent 1) (debug pcase-let*)) (if (null (cdr bindings)) `(pcase-let* ,bindings ,@body) @@ -302,7 +304,11 @@ any kind of error." ;;;###autoload (defmacro pcase-dolist (spec &rest body) - "Like `dolist' but where the binding can be a `pcase' pattern. + "Superset of `dolist' where the VAR binding can be a `pcase' PATTERN. +More specifically, this is just a shorthand for the following combination +of `dolist' and `pcase-let': + + (dolist (x LIST) (pcase-let ((PATTERN x)) BODY...)) \n(fn (PATTERN LIST) BODY...)" (declare (indent 1) (debug ((pcase-PAT form) body))) (if (pcase--trivial-upat-p (car spec)) diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index bb759011513..1230df4f15d 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el @@ -1060,7 +1060,7 @@ CHAR `chinese-two-byte' (\\cC) `greek-two-byte' (\\cG) `japanese-hiragana-two-byte' (\\cH) - `indian-tow-byte' (\\cI) + `indian-two-byte' (\\cI) `japanese-katakana-two-byte' (\\cK) `korean-hangul-two-byte' (\\cN) `cyrillic-two-byte' (\\cY) diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index 10345b63ae2..f8adf774002 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el @@ -1694,7 +1694,7 @@ Deleted messages are skipped and don't count. When called from Lisp code, N may be omitted and defaults to 1. This command always outputs the complete message header, -even the header display is currently pruned." +even if the header display is currently pruned." (interactive (progn (require 'rmailout) (list (rmail-output-read-file-name) diff --git a/lisp/simple.el b/lisp/simple.el index 6a7d210e483..245675504a3 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4266,7 +4266,7 @@ unless a hook has been set. Use `filter-buffer-substring' instead of `buffer-substring', `buffer-substring-no-properties', or `delete-and-extract-region' when you want to allow filtering to take place. For example, major or minor -modes can use `filter-buffer-substring-function' to extract characters +modes can use `filter-buffer-substring-function' to exclude text properties that are special to a buffer, and should not be copied into other buffers." (funcall filter-buffer-substring-function beg end delete)) |