diff options
| -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}). @kindex C-c C-s @r{(Message mode)} @kindex C-c C-c @r{(Message mode)} @findex message-send +@findex message-send-and-exit @vindex message-kill-buffer-on-exit The usual command to send a message is @kbd{C-c C-c} -(@code{mail-send-and-exit}). This sends the message and then +(@code{message-send-and-exit}). This sends the message and then buries the mail buffer, putting it at the lowest priority for reselection. If you want it to kill the mail buffer instead, change the variable @code{message-kill-buffer-on-exit} to @code{t}. -@findex message-send-and-exit The command @kbd{C-c C-s} (@code{message-send}) sends the message and leaves the buffer selected. Use this command if you want to modify the message (perhaps with new recipients) and send it again. @@ -361,9 +361,12 @@ twice). @cindex Feedmail @cindex Sendmail @cindex Mailclient +@vindex message-send-mail-function @vindex send-mail-function - The variable @code{send-mail-function} controls how the message is -delivered. Its value should be one of the following functions: + The variable @code{message-send-mail-function} controls how the +message is delivered (@code{send-mail-function} is used for Mail mode). +The value of @code{send-mail-function} should be one of the following +functions: @table @code @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. @cindex alpha character class, regexp @cindex xdigit character class, regexp - Here is a table of the classes you can use in a character alternative, -and what they mean: + Below is a table of the classes you can use in a character +alternative, and what they mean. Note that the @samp{[} and @samp{]} +characters that enclose the class name are part of the name, so a +regular expression using these classes needs one more pair of +brackets. For example, a regular expression matching a sequence of +one or more letters and digits would be @samp{[[:alnum:]]+}, not +@samp{[:alnum:]+}. @table @samp @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 ;; It's often desirable to make the cursor-sensor-functions property ;; non-sticky on both ends, but that means get-pos-property might ;; never see it. - (new (or (get-char-property point 'cursor-sensor-functions) - (unless (<= (point-min) point) - (get-char-property (1- point) 'cursor-sensor-functions)))) + (new (and (eq (current-buffer) (window-buffer)) + (or (get-char-property point 'cursor-sensor-functions) + (unless (<= (point-min) point) + (get-char-property (1- point) 'cursor-sensor-functions))))) (old (window-parameter window 'cursor-sensor--last-state)) (oldposmark (car old)) (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'." "Move to end of Nth previous prompt in the buffer. See `eshell-prompt-regexp'." (interactive "p") - (beginning-of-line) ; Don't count prompt on current line. + (forward-line 0) ; Don't count prompt on current line. (eshell-next-prompt (- n))) (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 @@ ;; right now, it's killed without further ado. ;; - make `cvs-mode-ignore' allow manually entering a pattern. ;; to which dir should it apply ? -;; - cvs-mode-ignore should try to remove duplicate entries. ;; - maybe poll/check CVS/Entries files to react to external `cvs' commands ? ;; - some kind of `cvs annotate' support ? ;; but vc-annotate can be used instead. @@ -1972,7 +1971,8 @@ This command ignores files that are not flagged as `Unknown'." (interactive) (dolist (fi (cvs-mode-marked 'ignore)) (vc-cvs-append-to-ignore (cvs-fileinfo->dir fi) (cvs-fileinfo->file fi) - (eq (cvs-fileinfo->subtype fi) 'NEW-DIR)) + (eq (cvs-fileinfo->subtype fi) 'NEW-DIR) + cvs-sort-ignore-file) (setf (cvs-fileinfo->type fi) 'DEAD)) (cvs-cleanup-collection cvs-cookies nil nil nil)) 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." "Return the administrative directory of FILE." (vc-find-root file "CVS")) -(defun vc-cvs-ignore (file &optional _directory _remove) - "Ignore FILE under CVS." - (vc-cvs-append-to-ignore (file-name-directory file) file)) - -(defun vc-cvs-append-to-ignore (dir str &optional old-dir) +(defun vc-cvs-ignore (file &optional directory _remove) + "Ignore FILE under CVS. +FILE is either absolute or relative to DIRECTORY. The basename +of FILE is written unmodified into the ignore file and is +therefore evaluated by CVS as an ignore pattern which follows +glob(7) syntax. If the pattern should match any of the special +characters ‘?*[\\\’ literally, they must be escaped with a +backslash. + +CVS processes one ignore file for each subdirectory. Patterns +are separated by whitespace and only match files in the same +directory. Since FILE can be a relative filename with leading +diretories, FILE is expanded against DIRECTORY to determine the +correct absolute filename. The directory name of this path is +then used to determine the location of the ignore file. The base +name of this path is used as pattern for the ignore file. + +Since patterns are whitespace sparated, it is usually better to +replace spaces in filenames with question marks ‘?’." + (setq file (directory-file-name (expand-file-name file directory))) + (vc-cvs-append-to-ignore (file-name-directory file) (file-name-nondirectory file))) + +(defun vc-cvs-append-to-ignore (dir str &optional old-dir sort) "In DIR, add STR to the .cvsignore file. If OLD-DIR is non-nil, then this is a directory that we don't want -to hear about anymore." +to hear about anymore. If SORT is non-nil, sort the lines of the +ignore file." (with-current-buffer (find-file-noselect (expand-file-name ".cvsignore" dir)) (when (ignore-errors @@ -1236,13 +1255,13 @@ to hear about anymore." (not (vc-editable-p buffer-file-name)))) ;; CVSREAD=on special case (vc-checkout buffer-file-name t)) - (goto-char (point-max)) - (unless (bolp) (insert "\n")) - (insert str (if old-dir "/\n" "\n")) - ;; FIXME this is a pcvs variable. - (if (bound-and-true-p cvs-sort-ignore-file) - (sort-lines nil (point-min) (point-max))) - (save-buffer))) + (goto-char (point-min)) + (save-match-data + (unless (re-search-forward (concat "^" (regexp-quote str) "$") nil 'move) + (unless (bolp) (insert "\n")) + (insert str (if old-dir "/\n" "\n")) + (if sort (sort-lines nil (point-min) (point-max))) + (save-buffer))))) (provide 'vc-cvs) 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." (vc-ignore (vc-dir-fileinfo->name filearg)) t)) vc-ewoc) - (vc-ignore (vc-dir-current-file)))) + (vc-ignore + (file-relative-name (vc-dir-current-file)) + default-directory))) (defun vc-dir-current-file () (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 @@ ;; ;; - ignore (file &optional directory) ;; -;; Ignore FILE under the VCS of DIRECTORY (default is `default-directory'). -;; FILE is a file wildcard. +;; Ignore FILE under DIRECTORY (default is 'default-directory'). +;; FILE is a file wildcard relative to DIRECTORY. ;; When called interactively and with a prefix argument, remove FILE ;; from ignored files. ;; 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 prefix argument is given, in which case prompt for a file FILE to remove from the list of ignored files." (interactive - (list - (if (not current-prefix-arg) - (read-file-name "File to ignore: ") - (completing-read - "File to remove: " - (vc-call-backend - (or (vc-responsible-backend default-directory) - (error "Unknown backend")) - 'ignore-completion-table default-directory))) - nil current-prefix-arg)) + (let* ((backend (vc-responsible-backend default-directory)) + (rel-dir + (condition-case nil + (file-name-directory + (vc-call-backend backend 'find-ignore-file + default-directory)) + (vc-not-supported + default-directory))) + (file (read-file-name "File to ignore: "))) + (when (and (file-name-absolute-p file) + (file-in-directory-p file rel-dir)) + (setq file (file-relative-name file rel-dir))) + (list file + rel-dir + current-prefix-arg))) (let* ((directory (or directory default-directory)) (backend (or (vc-responsible-backend default-directory) (error "Unknown backend")))) (vc-call-backend backend 'ignore file directory remove))) (defun vc-default-ignore (backend file &optional directory remove) - "Ignore FILE under the VCS of DIRECTORY (default is `default-directory'). -FILE is a wildcard specification, either relative to -DIRECTORY or absolute. + "Ignore FILE under DIRECTORY (default is `default-directory'). +FILE is a wildcard specification relative to DIRECTORY. + When called from Lisp code, if DIRECTORY is non-nil, the -repository to use will be deduced by DIRECTORY; if REMOVE is -non-nil, remove FILE from ignored files. -Argument BACKEND is the backend you are using." +repository to use will be deduced by DIRECTORY. + +If REMOVE is non-nil, remove FILE from ignored files instead. + +Argument BACKEND is the backend to use." (let ((ignore - (vc-call-backend backend 'find-ignore-file (or directory default-directory))) - file-path root-dir pattern) - (setq file-path (expand-file-name file directory)) - (setq root-dir (file-name-directory ignore)) - (when (not (string= (substring file-path 0 (length root-dir)) root-dir)) - (error "Ignore spec %s is not below project root %s" file-path root-dir)) - (setq pattern (substring file-path (length root-dir))) + (vc-call-backend backend + 'find-ignore-file + (or directory default-directory)))) (if remove - (vc--remove-regexp (concat "^" (regexp-quote pattern ) "\\(\n\\|$\\)") ignore) - (vc--add-line pattern ignore)))) + (vc--remove-regexp (concat "^" (regexp-quote file) "\\(\n\\|$\\)") ignore) + (vc--add-line file ignore)))) (defun vc-default-ignore-completion-table (backend file) "Return the list of ignored files under BACKEND." |
