diff options
| author | Glenn Morris | 2020-02-23 07:50:28 -0800 |
|---|---|---|
| committer | Glenn Morris | 2020-02-23 07:50:28 -0800 |
| commit | 3f01a17d68644cc3d802e1565e6f2a3b89d9279a (patch) | |
| tree | 5e1a60be7a5b935af4f04ffd4d6dba866b4cf34d | |
| parent | b6be1ce644a07b6dc30eaa24dec082effd7add40 (diff) | |
| parent | dd5756436c580cc0d00ee875d6645861daf5a867 (diff) | |
| download | emacs-3f01a17d68644cc3d802e1565e6f2a3b89d9279a.tar.gz emacs-3f01a17d68644cc3d802e1565e6f2a3b89d9279a.zip | |
Merge from origin/emacs-27
dd5756436c Move more logic to vc-ignore from vc-default-ignore
2aed279be1 Warn about the likes of "[:alnum:]" in regexps
0273f261a7 Don't write absolute filenames and duplicate strings to CV...
d7c22338d2 Fix cursor-sensor--detect when current buf != selected win...
2e39fc83bb * doc/emacs/sending.texi (Mail Sending): Fix index entries.
b410f902d5 Document 'message-send-mail-function' in the Emacs manual
ac0546612d Fix reference to 'message-send-and-exit' in Emacs manual
cd6a9b8f65 Skip shell prompt on current line in Eshell even if it's p...
| -rw-r--r-- | doc/emacs/sending.texi | 11 | ||||
| -rw-r--r-- | doc/lispref/searching.texi | 9 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cursor-sensor.el | 7 | ||||
| -rw-r--r-- | lisp/eshell/em-prompt.el | 2 | ||||
| -rw-r--r-- | lisp/vc/pcvs.el | 4 | ||||
| -rw-r--r-- | lisp/vc/vc-cvs.el | 45 | ||||
| -rw-r--r-- | lisp/vc/vc-dir.el | 4 | ||||
| -rw-r--r-- | lisp/vc/vc.el | 57 |
8 files changed, 86 insertions, 53 deletions
diff --git a/doc/emacs/sending.texi b/doc/emacs/sending.texi index 283a59a2912..190549a194e 100644 --- a/doc/emacs/sending.texi +++ b/doc/emacs/sending.texi | |||
| @@ -338,14 +338,14 @@ Send the message, and leave the mail buffer selected (@code{message-send}). | |||
| 338 | @kindex C-c C-s @r{(Message mode)} | 338 | @kindex C-c C-s @r{(Message mode)} |
| 339 | @kindex C-c C-c @r{(Message mode)} | 339 | @kindex C-c C-c @r{(Message mode)} |
| 340 | @findex message-send | 340 | @findex message-send |
| 341 | @findex message-send-and-exit | ||
| 341 | @vindex message-kill-buffer-on-exit | 342 | @vindex message-kill-buffer-on-exit |
| 342 | The usual command to send a message is @kbd{C-c C-c} | 343 | The usual command to send a message is @kbd{C-c C-c} |
| 343 | (@code{mail-send-and-exit}). This sends the message and then | 344 | (@code{message-send-and-exit}). This sends the message and then |
| 344 | buries the mail buffer, putting it at the lowest priority for | 345 | buries the mail buffer, putting it at the lowest priority for |
| 345 | reselection. If you want it to kill the mail buffer instead, change | 346 | reselection. If you want it to kill the mail buffer instead, change |
| 346 | the variable @code{message-kill-buffer-on-exit} to @code{t}. | 347 | the variable @code{message-kill-buffer-on-exit} to @code{t}. |
| 347 | 348 | ||
| 348 | @findex message-send-and-exit | ||
| 349 | The command @kbd{C-c C-s} (@code{message-send}) sends the message | 349 | The command @kbd{C-c C-s} (@code{message-send}) sends the message |
| 350 | and leaves the buffer selected. Use this command if you want to | 350 | and leaves the buffer selected. Use this command if you want to |
| 351 | modify the message (perhaps with new recipients) and send it again. | 351 | modify the message (perhaps with new recipients) and send it again. |
| @@ -361,9 +361,12 @@ twice). | |||
| 361 | @cindex Feedmail | 361 | @cindex Feedmail |
| 362 | @cindex Sendmail | 362 | @cindex Sendmail |
| 363 | @cindex Mailclient | 363 | @cindex Mailclient |
| 364 | @vindex message-send-mail-function | ||
| 364 | @vindex send-mail-function | 365 | @vindex send-mail-function |
| 365 | The variable @code{send-mail-function} controls how the message is | 366 | The variable @code{message-send-mail-function} controls how the |
| 366 | delivered. Its value should be one of the following functions: | 367 | message is delivered (@code{send-mail-function} is used for Mail mode). |
| 368 | The value of @code{send-mail-function} should be one of the following | ||
| 369 | functions: | ||
| 367 | 370 | ||
| 368 | @table @code | 371 | @table @code |
| 369 | @item sendmail-query-once | 372 | @item sendmail-query-once |
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 1f6db0643e8..a4d5a27203f 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi | |||
| @@ -582,8 +582,13 @@ an unquoted @samp{[} is special again and a @samp{]} not. | |||
| 582 | @cindex alpha character class, regexp | 582 | @cindex alpha character class, regexp |
| 583 | @cindex xdigit character class, regexp | 583 | @cindex xdigit character class, regexp |
| 584 | 584 | ||
| 585 | Here is a table of the classes you can use in a character alternative, | 585 | Below is a table of the classes you can use in a character |
| 586 | and what they mean: | 586 | alternative, and what they mean. Note that the @samp{[} and @samp{]} |
| 587 | characters that enclose the class name are part of the name, so a | ||
| 588 | regular expression using these classes needs one more pair of | ||
| 589 | brackets. For example, a regular expression matching a sequence of | ||
| 590 | one or more letters and digits would be @samp{[[:alnum:]]+}, not | ||
| 591 | @samp{[:alnum:]+}. | ||
| 587 | 592 | ||
| 588 | @table @samp | 593 | @table @samp |
| 589 | @item [:ascii:] | 594 | @item [:ascii:] |
diff --git a/lisp/emacs-lisp/cursor-sensor.el b/lisp/emacs-lisp/cursor-sensor.el index d8e8eeb16ef..7728e78c471 100644 --- a/lisp/emacs-lisp/cursor-sensor.el +++ b/lisp/emacs-lisp/cursor-sensor.el | |||
| @@ -146,9 +146,10 @@ By convention, this is a list of symbols where each symbol stands for the | |||
| 146 | ;; It's often desirable to make the cursor-sensor-functions property | 146 | ;; It's often desirable to make the cursor-sensor-functions property |
| 147 | ;; non-sticky on both ends, but that means get-pos-property might | 147 | ;; non-sticky on both ends, but that means get-pos-property might |
| 148 | ;; never see it. | 148 | ;; never see it. |
| 149 | (new (or (get-char-property point 'cursor-sensor-functions) | 149 | (new (and (eq (current-buffer) (window-buffer)) |
| 150 | (unless (<= (point-min) point) | 150 | (or (get-char-property point 'cursor-sensor-functions) |
| 151 | (get-char-property (1- point) 'cursor-sensor-functions)))) | 151 | (unless (<= (point-min) point) |
| 152 | (get-char-property (1- point) 'cursor-sensor-functions))))) | ||
| 152 | (old (window-parameter window 'cursor-sensor--last-state)) | 153 | (old (window-parameter window 'cursor-sensor--last-state)) |
| 153 | (oldposmark (car old)) | 154 | (oldposmark (car old)) |
| 154 | (oldpos (or (if oldposmark (marker-position oldposmark)) | 155 | (oldpos (or (if oldposmark (marker-position oldposmark)) |
diff --git a/lisp/eshell/em-prompt.el b/lisp/eshell/em-prompt.el index 25b8ccaba17..9ae5ae12816 100644 --- a/lisp/eshell/em-prompt.el +++ b/lisp/eshell/em-prompt.el | |||
| @@ -187,7 +187,7 @@ See `eshell-prompt-regexp'." | |||
| 187 | "Move to end of Nth previous prompt in the buffer. | 187 | "Move to end of Nth previous prompt in the buffer. |
| 188 | See `eshell-prompt-regexp'." | 188 | See `eshell-prompt-regexp'." |
| 189 | (interactive "p") | 189 | (interactive "p") |
| 190 | (beginning-of-line) ; Don't count prompt on current line. | 190 | (forward-line 0) ; Don't count prompt on current line. |
| 191 | (eshell-next-prompt (- n))) | 191 | (eshell-next-prompt (- n))) |
| 192 | 192 | ||
| 193 | (defun eshell-skip-prompt () | 193 | (defun eshell-skip-prompt () |
diff --git a/lisp/vc/pcvs.el b/lisp/vc/pcvs.el index dcba504401c..cb0494ee91c 100644 --- a/lisp/vc/pcvs.el +++ b/lisp/vc/pcvs.el | |||
| @@ -106,7 +106,6 @@ | |||
| 106 | ;; right now, it's killed without further ado. | 106 | ;; right now, it's killed without further ado. |
| 107 | ;; - make `cvs-mode-ignore' allow manually entering a pattern. | 107 | ;; - make `cvs-mode-ignore' allow manually entering a pattern. |
| 108 | ;; to which dir should it apply ? | 108 | ;; to which dir should it apply ? |
| 109 | ;; - cvs-mode-ignore should try to remove duplicate entries. | ||
| 110 | ;; - maybe poll/check CVS/Entries files to react to external `cvs' commands ? | 109 | ;; - maybe poll/check CVS/Entries files to react to external `cvs' commands ? |
| 111 | ;; - some kind of `cvs annotate' support ? | 110 | ;; - some kind of `cvs annotate' support ? |
| 112 | ;; but vc-annotate can be used instead. | 111 | ;; but vc-annotate can be used instead. |
| @@ -1972,7 +1971,8 @@ This command ignores files that are not flagged as `Unknown'." | |||
| 1972 | (interactive) | 1971 | (interactive) |
| 1973 | (dolist (fi (cvs-mode-marked 'ignore)) | 1972 | (dolist (fi (cvs-mode-marked 'ignore)) |
| 1974 | (vc-cvs-append-to-ignore (cvs-fileinfo->dir fi) (cvs-fileinfo->file fi) | 1973 | (vc-cvs-append-to-ignore (cvs-fileinfo->dir fi) (cvs-fileinfo->file fi) |
| 1975 | (eq (cvs-fileinfo->subtype fi) 'NEW-DIR)) | 1974 | (eq (cvs-fileinfo->subtype fi) 'NEW-DIR) |
| 1975 | cvs-sort-ignore-file) | ||
| 1976 | (setf (cvs-fileinfo->type fi) 'DEAD)) | 1976 | (setf (cvs-fileinfo->type fi) 'DEAD)) |
| 1977 | (cvs-cleanup-collection cvs-cookies nil nil nil)) | 1977 | (cvs-cleanup-collection cvs-cookies nil nil nil)) |
| 1978 | 1978 | ||
diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index 16566a8902c..b6afda69198 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el | |||
| @@ -1220,14 +1220,33 @@ is non-nil." | |||
| 1220 | "Return the administrative directory of FILE." | 1220 | "Return the administrative directory of FILE." |
| 1221 | (vc-find-root file "CVS")) | 1221 | (vc-find-root file "CVS")) |
| 1222 | 1222 | ||
| 1223 | (defun vc-cvs-ignore (file &optional _directory _remove) | 1223 | (defun vc-cvs-ignore (file &optional directory _remove) |
| 1224 | "Ignore FILE under CVS." | 1224 | "Ignore FILE under CVS. |
| 1225 | (vc-cvs-append-to-ignore (file-name-directory file) file)) | 1225 | FILE is either absolute or relative to DIRECTORY. The basename |
| 1226 | 1226 | of FILE is written unmodified into the ignore file and is | |
| 1227 | (defun vc-cvs-append-to-ignore (dir str &optional old-dir) | 1227 | therefore evaluated by CVS as an ignore pattern which follows |
| 1228 | glob(7) syntax. If the pattern should match any of the special | ||
| 1229 | characters ‘?*[\\\’ literally, they must be escaped with a | ||
| 1230 | backslash. | ||
| 1231 | |||
| 1232 | CVS processes one ignore file for each subdirectory. Patterns | ||
| 1233 | are separated by whitespace and only match files in the same | ||
| 1234 | directory. Since FILE can be a relative filename with leading | ||
| 1235 | diretories, FILE is expanded against DIRECTORY to determine the | ||
| 1236 | correct absolute filename. The directory name of this path is | ||
| 1237 | then used to determine the location of the ignore file. The base | ||
| 1238 | name of this path is used as pattern for the ignore file. | ||
| 1239 | |||
| 1240 | Since patterns are whitespace sparated, it is usually better to | ||
| 1241 | replace spaces in filenames with question marks ‘?’." | ||
| 1242 | (setq file (directory-file-name (expand-file-name file directory))) | ||
| 1243 | (vc-cvs-append-to-ignore (file-name-directory file) (file-name-nondirectory file))) | ||
| 1244 | |||
| 1245 | (defun vc-cvs-append-to-ignore (dir str &optional old-dir sort) | ||
| 1228 | "In DIR, add STR to the .cvsignore file. | 1246 | "In DIR, add STR to the .cvsignore file. |
| 1229 | If OLD-DIR is non-nil, then this is a directory that we don't want | 1247 | If OLD-DIR is non-nil, then this is a directory that we don't want |
| 1230 | to hear about anymore." | 1248 | to hear about anymore. If SORT is non-nil, sort the lines of the |
| 1249 | ignore file." | ||
| 1231 | (with-current-buffer | 1250 | (with-current-buffer |
| 1232 | (find-file-noselect (expand-file-name ".cvsignore" dir)) | 1251 | (find-file-noselect (expand-file-name ".cvsignore" dir)) |
| 1233 | (when (ignore-errors | 1252 | (when (ignore-errors |
| @@ -1236,13 +1255,13 @@ to hear about anymore." | |||
| 1236 | (not (vc-editable-p buffer-file-name)))) | 1255 | (not (vc-editable-p buffer-file-name)))) |
| 1237 | ;; CVSREAD=on special case | 1256 | ;; CVSREAD=on special case |
| 1238 | (vc-checkout buffer-file-name t)) | 1257 | (vc-checkout buffer-file-name t)) |
| 1239 | (goto-char (point-max)) | 1258 | (goto-char (point-min)) |
| 1240 | (unless (bolp) (insert "\n")) | 1259 | (save-match-data |
| 1241 | (insert str (if old-dir "/\n" "\n")) | 1260 | (unless (re-search-forward (concat "^" (regexp-quote str) "$") nil 'move) |
| 1242 | ;; FIXME this is a pcvs variable. | 1261 | (unless (bolp) (insert "\n")) |
| 1243 | (if (bound-and-true-p cvs-sort-ignore-file) | 1262 | (insert str (if old-dir "/\n" "\n")) |
| 1244 | (sort-lines nil (point-min) (point-max))) | 1263 | (if sort (sort-lines nil (point-min) (point-max))) |
| 1245 | (save-buffer))) | 1264 | (save-buffer))))) |
| 1246 | 1265 | ||
| 1247 | (provide 'vc-cvs) | 1266 | (provide 'vc-cvs) |
| 1248 | 1267 | ||
diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el index 033cb27e33e..e5c5e16a17a 100644 --- a/lisp/vc/vc-dir.el +++ b/lisp/vc/vc-dir.el | |||
| @@ -879,7 +879,9 @@ If a prefix argument is given, ignore all marked files." | |||
| 879 | (vc-ignore (vc-dir-fileinfo->name filearg)) | 879 | (vc-ignore (vc-dir-fileinfo->name filearg)) |
| 880 | t)) | 880 | t)) |
| 881 | vc-ewoc) | 881 | vc-ewoc) |
| 882 | (vc-ignore (vc-dir-current-file)))) | 882 | (vc-ignore |
| 883 | (file-relative-name (vc-dir-current-file)) | ||
| 884 | default-directory))) | ||
| 883 | 885 | ||
| 884 | (defun vc-dir-current-file () | 886 | (defun vc-dir-current-file () |
| 885 | (let ((node (ewoc-locate vc-ewoc))) | 887 | (let ((node (ewoc-locate vc-ewoc))) |
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index f7d651fac6f..ec10265df6b 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el | |||
| @@ -480,8 +480,8 @@ | |||
| 480 | ;; | 480 | ;; |
| 481 | ;; - ignore (file &optional directory) | 481 | ;; - ignore (file &optional directory) |
| 482 | ;; | 482 | ;; |
| 483 | ;; Ignore FILE under the VCS of DIRECTORY (default is `default-directory'). | 483 | ;; Ignore FILE under DIRECTORY (default is 'default-directory'). |
| 484 | ;; FILE is a file wildcard. | 484 | ;; FILE is a file wildcard relative to DIRECTORY. |
| 485 | ;; When called interactively and with a prefix argument, remove FILE | 485 | ;; When called interactively and with a prefix argument, remove FILE |
| 486 | ;; from ignored files. | 486 | ;; from ignored files. |
| 487 | ;; When called from Lisp code, if DIRECTORY is non-nil, the | 487 | ;; When called from Lisp code, if DIRECTORY is non-nil, the |
| @@ -1427,40 +1427,43 @@ When called interactively, prompt for a FILE to ignore, unless a | |||
| 1427 | prefix argument is given, in which case prompt for a file FILE to | 1427 | prefix argument is given, in which case prompt for a file FILE to |
| 1428 | remove from the list of ignored files." | 1428 | remove from the list of ignored files." |
| 1429 | (interactive | 1429 | (interactive |
| 1430 | (list | 1430 | (let* ((backend (vc-responsible-backend default-directory)) |
| 1431 | (if (not current-prefix-arg) | 1431 | (rel-dir |
| 1432 | (read-file-name "File to ignore: ") | 1432 | (condition-case nil |
| 1433 | (completing-read | 1433 | (file-name-directory |
| 1434 | "File to remove: " | 1434 | (vc-call-backend backend 'find-ignore-file |
| 1435 | (vc-call-backend | 1435 | default-directory)) |
| 1436 | (or (vc-responsible-backend default-directory) | 1436 | (vc-not-supported |
| 1437 | (error "Unknown backend")) | 1437 | default-directory))) |
| 1438 | 'ignore-completion-table default-directory))) | 1438 | (file (read-file-name "File to ignore: "))) |
| 1439 | nil current-prefix-arg)) | 1439 | (when (and (file-name-absolute-p file) |
| 1440 | (file-in-directory-p file rel-dir)) | ||
| 1441 | (setq file (file-relative-name file rel-dir))) | ||
| 1442 | (list file | ||
| 1443 | rel-dir | ||
| 1444 | current-prefix-arg))) | ||
| 1440 | (let* ((directory (or directory default-directory)) | 1445 | (let* ((directory (or directory default-directory)) |
| 1441 | (backend (or (vc-responsible-backend default-directory) | 1446 | (backend (or (vc-responsible-backend default-directory) |
| 1442 | (error "Unknown backend")))) | 1447 | (error "Unknown backend")))) |
| 1443 | (vc-call-backend backend 'ignore file directory remove))) | 1448 | (vc-call-backend backend 'ignore file directory remove))) |
| 1444 | 1449 | ||
| 1445 | (defun vc-default-ignore (backend file &optional directory remove) | 1450 | (defun vc-default-ignore (backend file &optional directory remove) |
| 1446 | "Ignore FILE under the VCS of DIRECTORY (default is `default-directory'). | 1451 | "Ignore FILE under DIRECTORY (default is `default-directory'). |
| 1447 | FILE is a wildcard specification, either relative to | 1452 | FILE is a wildcard specification relative to DIRECTORY. |
| 1448 | DIRECTORY or absolute. | 1453 | |
| 1449 | When called from Lisp code, if DIRECTORY is non-nil, the | 1454 | When called from Lisp code, if DIRECTORY is non-nil, the |
| 1450 | repository to use will be deduced by DIRECTORY; if REMOVE is | 1455 | repository to use will be deduced by DIRECTORY. |
| 1451 | non-nil, remove FILE from ignored files. | 1456 | |
| 1452 | Argument BACKEND is the backend you are using." | 1457 | If REMOVE is non-nil, remove FILE from ignored files instead. |
| 1458 | |||
| 1459 | Argument BACKEND is the backend to use." | ||
| 1453 | (let ((ignore | 1460 | (let ((ignore |
| 1454 | (vc-call-backend backend 'find-ignore-file (or directory default-directory))) | 1461 | (vc-call-backend backend |
| 1455 | file-path root-dir pattern) | 1462 | 'find-ignore-file |
| 1456 | (setq file-path (expand-file-name file directory)) | 1463 | (or directory default-directory)))) |
| 1457 | (setq root-dir (file-name-directory ignore)) | ||
| 1458 | (when (not (string= (substring file-path 0 (length root-dir)) root-dir)) | ||
| 1459 | (error "Ignore spec %s is not below project root %s" file-path root-dir)) | ||
| 1460 | (setq pattern (substring file-path (length root-dir))) | ||
| 1461 | (if remove | 1464 | (if remove |
| 1462 | (vc--remove-regexp (concat "^" (regexp-quote pattern ) "\\(\n\\|$\\)") ignore) | 1465 | (vc--remove-regexp (concat "^" (regexp-quote file) "\\(\n\\|$\\)") ignore) |
| 1463 | (vc--add-line pattern ignore)))) | 1466 | (vc--add-line file ignore)))) |
| 1464 | 1467 | ||
| 1465 | (defun vc-default-ignore-completion-table (backend file) | 1468 | (defun vc-default-ignore-completion-table (backend file) |
| 1466 | "Return the list of ignored files under BACKEND." | 1469 | "Return the list of ignored files under BACKEND." |