aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2020-02-23 07:50:28 -0800
committerGlenn Morris2020-02-23 07:50:28 -0800
commit3f01a17d68644cc3d802e1565e6f2a3b89d9279a (patch)
tree5e1a60be7a5b935af4f04ffd4d6dba866b4cf34d
parentb6be1ce644a07b6dc30eaa24dec082effd7add40 (diff)
parentdd5756436c580cc0d00ee875d6645861daf5a867 (diff)
downloademacs-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.texi11
-rw-r--r--doc/lispref/searching.texi9
-rw-r--r--lisp/emacs-lisp/cursor-sensor.el7
-rw-r--r--lisp/eshell/em-prompt.el2
-rw-r--r--lisp/vc/pcvs.el4
-rw-r--r--lisp/vc/vc-cvs.el45
-rw-r--r--lisp/vc/vc-dir.el4
-rw-r--r--lisp/vc/vc.el57
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
344buries the mail buffer, putting it at the lowest priority for 345buries the mail buffer, putting it at the lowest priority for
345reselection. If you want it to kill the mail buffer instead, change 346reselection. If you want it to kill the mail buffer instead, change
346the variable @code{message-kill-buffer-on-exit} to @code{t}. 347the 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
350and leaves the buffer selected. Use this command if you want to 350and leaves the buffer selected. Use this command if you want to
351modify the message (perhaps with new recipients) and send it again. 351modify 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
366delivered. Its value should be one of the following functions: 367message is delivered (@code{send-mail-function} is used for Mail mode).
368The value of @code{send-mail-function} should be one of the following
369functions:
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
586and what they mean: 586alternative, and what they mean. Note that the @samp{[} and @samp{]}
587characters that enclose the class name are part of the name, so a
588regular expression using these classes needs one more pair of
589brackets. For example, a regular expression matching a sequence of
590one 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.
188See `eshell-prompt-regexp'." 188See `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)) 1225FILE is either absolute or relative to DIRECTORY. The basename
1226 1226of FILE is written unmodified into the ignore file and is
1227(defun vc-cvs-append-to-ignore (dir str &optional old-dir) 1227therefore evaluated by CVS as an ignore pattern which follows
1228glob(7) syntax. If the pattern should match any of the special
1229characters ‘?*[\\\’ literally, they must be escaped with a
1230backslash.
1231
1232CVS processes one ignore file for each subdirectory. Patterns
1233are separated by whitespace and only match files in the same
1234directory. Since FILE can be a relative filename with leading
1235diretories, FILE is expanded against DIRECTORY to determine the
1236correct absolute filename. The directory name of this path is
1237then used to determine the location of the ignore file. The base
1238name of this path is used as pattern for the ignore file.
1239
1240Since patterns are whitespace sparated, it is usually better to
1241replace 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.
1229If OLD-DIR is non-nil, then this is a directory that we don't want 1247If OLD-DIR is non-nil, then this is a directory that we don't want
1230to hear about anymore." 1248to hear about anymore. If SORT is non-nil, sort the lines of the
1249ignore 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
1427prefix argument is given, in which case prompt for a file FILE to 1427prefix argument is given, in which case prompt for a file FILE to
1428remove from the list of ignored files." 1428remove 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').
1447FILE is a wildcard specification, either relative to 1452FILE is a wildcard specification relative to DIRECTORY.
1448DIRECTORY or absolute. 1453
1449When called from Lisp code, if DIRECTORY is non-nil, the 1454When called from Lisp code, if DIRECTORY is non-nil, the
1450repository to use will be deduced by DIRECTORY; if REMOVE is 1455repository to use will be deduced by DIRECTORY.
1451non-nil, remove FILE from ignored files. 1456
1452Argument BACKEND is the backend you are using." 1457If REMOVE is non-nil, remove FILE from ignored files instead.
1458
1459Argument 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."