commit 178feeec4609e021ae9aa09c673ae19d86529228 (HEAD, refs/remotes/origin/master) Author: Stefan Kangas Date: Sun Aug 16 13:11:16 2020 +0200 Remove some compat code from cperl-mode * lisp/progmodes/cperl-mode.el (cperl-use-syntax-table-text-property) (cperl-syntaxify-by-font-lock, cperl-mode-map, cperl-mode) (cperl-windowed-init, cperl-init-faces, cperl-write-tags): Remove some XEmacs and <21 compat code. diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 2d2713a36a..c47aa2ea8c 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -451,8 +451,7 @@ Older version of this page was called `perl5', newer `perl'." :type 'string :group 'cperl-help-system) -(defcustom cperl-use-syntax-table-text-property - (boundp 'parse-sexp-lookup-properties) +(defcustom cperl-use-syntax-table-text-property t "Non-nil means CPerl sets up and uses `syntax-table' text property." :type 'boolean :group 'cperl-speed) @@ -535,8 +534,7 @@ One should tune up `cperl-close-paren-offset' as well." :type 'boolean :group 'cperl-indentation-details) -(defcustom cperl-syntaxify-by-font-lock - (boundp 'parse-sexp-lookup-properties) +(defcustom cperl-syntaxify-by-font-lock t "Non-nil means that CPerl uses the `font-lock' routines for syntaxification." :type '(choice (const message) boolean) :group 'cperl-speed) @@ -1081,10 +1079,6 @@ versions of Emacs." (define-key map [(control ?c) (control ?h) ?v] ;;(concat (char-to-string help-char) "v") ; does not work 'cperl-get-help)) - (or (boundp 'fill-paragraph-function) - (substitute-key-definition - 'fill-paragraph 'cperl-fill-paragraph - map global-map)) (substitute-key-definition 'indent-sexp 'cperl-indent-exp map global-map) @@ -1637,9 +1631,8 @@ or as help on variables `cperl-tips', `cperl-problems', "\\)" cperl-maybe-white-and-comment-rex)) (set (make-local-variable 'comment-indent-function) #'cperl-comment-indent) - (and (boundp 'fill-paragraph-function) - (set (make-local-variable 'fill-paragraph-function) - #'cperl-fill-paragraph)) + (set (make-local-variable 'fill-paragraph-function) + #'cperl-fill-paragraph) (set (make-local-variable 'parse-sexp-ignore-comments) t) (set (make-local-variable 'indent-region-function) #'cperl-indent-region) ;;(setq auto-fill-function #'cperl-do-auto-fill) ; Need to switch on and off! @@ -1701,13 +1694,8 @@ or as help on variables `cperl-tips', `cperl-problems', ;; to make font-lock think that font-lock-syntactic-keywords ;; are defined. '(t))))) - (if (boundp 'font-lock-multiline) ; Newer font-lock; use its facilities - (progn - (setq cperl-font-lock-multiline t) ; Not localized... - (set (make-local-variable 'font-lock-multiline) t)) - (set (make-local-variable 'font-lock-fontify-region-function) - ;; not present with old Emacs - #'cperl-font-lock-fontify-region-function)) + (setq cperl-font-lock-multiline t) ; Not localized... + (set (make-local-variable 'font-lock-multiline) t) (set (make-local-variable 'font-lock-fontify-region-function) #'cperl-font-lock-fontify-region-function) (make-local-variable 'cperl-old-style) @@ -5451,8 +5439,7 @@ indentation and initial hashes. Behaves usually outside of comment." (cond ((featurep 'ps-print) (or cperl-faces-init (progn - (and (boundp 'font-lock-multiline) - (setq cperl-font-lock-multiline t)) + (setq cperl-font-lock-multiline t) (cperl-init-faces)))) ((not cperl-faces-init) (add-hook 'font-lock-mode-hook @@ -5499,12 +5486,8 @@ indentation and initial hashes. Behaves usually outside of comment." (condition-case errs (progn (require 'font-lock) - (and (fboundp 'font-lock-fontify-anchored-keywords) - (featurep 'font-lock-extra) - (message "You have an obsolete package `font-lock-extra'. Install `choose-color'.")) (let (t-font-lock-keywords t-font-lock-keywords-1 font-lock-anchored) - (if (fboundp 'font-lock-fontify-anchored-keywords) - (setq font-lock-anchored t)) + (setq font-lock-anchored t) (setq t-font-lock-keywords (list @@ -6857,7 +6840,7 @@ Use as (insert (cperl-find-tags file xs topdir)))))) (if inbuffer nil ; Delegate to the caller (save-buffer 0) ; No backup - (if (fboundp 'initialize-new-tags-table) ; Do we need something special in XEmacs? + (if (fboundp 'initialize-new-tags-table) (initialize-new-tags-table)))))) (defvar cperl-tags-hier-regexp-list commit 165fd028d858daee3e08e4308b24e5d497971c77 Author: Lars Ingebrigtsen Date: Fri Aug 21 01:29:26 2020 +0200 Make image cache lookups work again after previous patch * src/image.c (search_image_cache): Fix reversed logic in previous patch. diff --git a/src/image.c b/src/image.c index 643b3d0a1f..123de54ba2 100644 --- a/src/image.c +++ b/src/image.c @@ -1633,7 +1633,7 @@ search_image_cache (struct frame *f, Lisp_Object spec, EMACS_UINT hash) for (img = c->buckets[i]; img; img = img->next) if (img->hash == hash - && !equal_lists (img->spec, spec) + && equal_lists (img->spec, spec) && img->frame_foreground == FRAME_FOREGROUND_PIXEL (f) && img->frame_background == FRAME_BACKGROUND_PIXEL (f)) break; commit 4c5043c50b52e404c211c18da8cd59a2ee86253d Author: Juri Linkov Date: Fri Aug 21 02:21:26 2020 +0300 * lisp/simple.el (previous-line-or-history-element): Handle logical lines. When 'line-move-visual' is nil, use 'end-of-line' to move point to the end of the first logical line (bug#42862) Thanks to Michael Welsh Duggan . diff --git a/lisp/simple.el b/lisp/simple.el index f08015372a..b106d4b0ba 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2416,15 +2416,17 @@ previous element of the minibuffer history in the minibuffer." (goto-char (1- (minibuffer-prompt-end))) (current-column)))) (move-to-column old-column)) - ;; Put the cursor at the end of the visual line instead of the - ;; logical line, so the next `previous-line-or-history-element' - ;; would move to the previous history element, not to a possible upper - ;; visual line from the end of logical line in `line-move-visual' mode. - (end-of-visual-line) - ;; Since `end-of-visual-line' puts the cursor at the beginning - ;; of the next visual line, move it one char back to the end - ;; of the first visual line (bug#22544). - (unless (eolp) (backward-char 1))))))) + (if (not line-move-visual) ; Handle logical lines (bug#42862) + (end-of-line) + ;; Put the cursor at the end of the visual line instead of the + ;; logical line, so the next `previous-line-or-history-element' + ;; would move to the previous history element, not to a possible upper + ;; visual line from the end of logical line in `line-move-visual' mode. + (end-of-visual-line) + ;; Since `end-of-visual-line' puts the cursor at the beginning + ;; of the next visual line, move it one char back to the end + ;; of the first visual line (bug#22544). + (unless (eolp) (backward-char 1)))))))) (defun next-complete-history-element (n) "Get next history element that completes the minibuffer before the point. commit cb9fc5e7731e506e4e0facd3d060d19e388b32ac Author: Lars Ingebrigtsen Date: Fri Aug 21 00:38:23 2020 +0200 Fix off-by-one error in decoded-time-add (with months) * lisp/calendar/time-date.el (decoded-time-add): Fix month addition, which was off-by-one. diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el index 125f9acc70..638d8c1f88 100644 --- a/lisp/calendar/time-date.el +++ b/lisp/calendar/time-date.el @@ -401,10 +401,10 @@ changes in daylight saving time are not taken into account." (when (decoded-time-year delta) (cl-incf (decoded-time-year time) (decoded-time-year delta))) - ;; Months are pretty simple. + ;; Months are pretty simple, but start at 1 (for January). (when (decoded-time-month delta) - (let ((new (+ (decoded-time-month time) (decoded-time-month delta)))) - (setf (decoded-time-month time) (mod new 12)) + (let ((new (+ (1- (decoded-time-month time)) (decoded-time-month delta)))) + (setf (decoded-time-month time) (1+ (mod new 12))) (cl-incf (decoded-time-year time) (/ new 12)))) ;; Adjust for month length (as described in the doc string). diff --git a/test/lisp/calendar/time-date-tests.el b/test/lisp/calendar/time-date-tests.el index fe1460cf29..233d43cd01 100644 --- a/test/lisp/calendar/time-date-tests.el +++ b/test/lisp/calendar/time-date-tests.el @@ -123,4 +123,24 @@ (should (equal (decoded-time-period '((135 . 10) 0 0 0 0 0 nil nil nil)) 13.5))) +(ert-deftest test-time-wrap-addition () + (should (equal (decoded-time-add '(0 0 0 1 11 2008 nil nil nil) + (make-decoded-time :month 1)) + '(0 0 0 1 12 2008 nil nil nil))) + (should (equal (decoded-time-add '(0 0 0 1 12 2008 nil nil nil) + (make-decoded-time :month 1)) + '(0 0 0 1 1 2009 nil nil nil))) + (should (equal (decoded-time-add '(0 0 0 1 11 2008 nil nil nil) + (make-decoded-time :month 12)) + '(0 0 0 1 11 2009 nil nil nil))) + (should (equal (decoded-time-add '(0 0 0 1 11 2008 nil nil nil) + (make-decoded-time :month 13)) + '(0 0 0 1 12 2009 nil nil nil))) + (should (equal (decoded-time-add '(0 0 0 30 12 2008 nil nil nil) + (make-decoded-time :day 1)) + '(0 0 0 31 12 2008 nil nil nil))) + (should (equal (decoded-time-add '(0 0 0 30 12 2008 nil nil nil) + (make-decoded-time :day 2)) + '(0 0 0 1 1 2009 nil nil nil)))) + ;;; time-date-tests.el ends here commit 9b277a2f8e5c22a05830e61d83876571b8eb56b4 Author: Lars Ingebrigtsen Date: Thu Aug 20 22:23:35 2020 +0200 Fix problem with non-ASCII characters in ediff error messages * lisp/vc/ediff-diff.el (ediff-prepare-error-list): Decode the data from diff before displaying (bug#5050). This fixes a problem with displaying raw bytes in the error messages in non-ASCII locales. diff --git a/lisp/vc/ediff-diff.el b/lisp/vc/ediff-diff.el index ef466741b2..ccf5a7807f 100644 --- a/lisp/vc/ediff-diff.el +++ b/lisp/vc/ediff-diff.el @@ -325,6 +325,10 @@ one optional arguments, diff-number to refine.") (error-buf ediff-error-buffer)) (ediff-skip-unsuitable-frames) (switch-to-buffer error-buf) + ;; We output data from the diff command using `raw-text' as + ;; the coding system, so decode before displaying. + (when (eq ediff-coding-system-for-read 'raw-text) + (decode-coding-region (point-min) (point-max) 'undecided)) (ediff-kill-buffer-carefully ctl-buf) (user-error "Errors in diff output. Diff output is in %S" diff-buff)))) commit ec990559180254c59d80308655b11df4223dd23d Author: Lars Ingebrigtsen Date: Thu Aug 20 20:09:51 2020 +0200 Make image-mode give better feedback when the buffer is empty * lisp/image-mode.el (image-mode): Give a less confusing message if we don't have any image data (bug#16062). Also leave the buffer in fundamental mode. diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 948e62e10d..4c719f7cda 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -612,6 +612,15 @@ Key bindings: (setq major-mode 'image-mode) (setq image-transform-resize image-auto-resize) + ;; Bail out early if we have no image data. + (if (zerop (buffer-size)) + (funcall (if (called-interactively-p 'any) 'error 'message) + (if (file-exists-p buffer-file-name) + "Empty file" + "(New file)")) + (image-mode--display))) + +(defun image-mode--display () (if (not (image-get-display-property)) (progn (when (condition-case err commit bf60338d6dd02b4d848229878c8e14182f6f861f Author: Mattias EngdegÄrd Date: Tue Aug 18 12:58:12 2020 +0200 Fix NS crash on invalid frame title string (bug#42904) Instead of blindly assuming that all Emacs strings are valid UTF-8, which they are not, use a more careful conversion going via UTF-16 which is what NSString uses internally. Unpaired surrogates will still go through to the NSString objects, but the NS libs handle them gracefully. * src/nsterm.h (EmacsString): New category. * src/nsfns.m (all_nonzero_ascii): New helper function. ([NSString stringWithLispString:]): New method. (ns_set_name_internal): Use new conversion method. diff --git a/src/nsfns.m b/src/nsfns.m index 628233ea0d..5fca15588d 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -401,26 +401,15 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side. static void ns_set_name_internal (struct frame *f, Lisp_Object name) { - Lisp_Object encoded_name, encoded_icon_name; - NSString *str; NSView *view = FRAME_NS_VIEW (f); - - - encoded_name = ENCODE_UTF_8 (name); - - str = [NSString stringWithUTF8String: SSDATA (encoded_name)]; - + NSString *str = [NSString stringWithLispString: name]; /* Don't change the name if it's already NAME. */ if (! [[[view window] title] isEqualToString: str]) [[view window] setTitle: str]; - if (!STRINGP (f->icon_name)) - encoded_icon_name = encoded_name; - else - encoded_icon_name = ENCODE_UTF_8 (f->icon_name); - - str = [NSString stringWithUTF8String: SSDATA (encoded_icon_name)]; + if (STRINGP (f->icon_name)) + str = [NSString stringWithLispString: f->icon_name]; if ([[view window] miniwindowTitle] && ! [[[view window] miniwindowTitle] isEqualToString: str]) @@ -3031,6 +3020,54 @@ - (NSString *)panel: (id)sender userEnteredFilename: (NSString *)filename #endif +/* Whether N bytes at STR are in the [0,127] range. */ +static bool +all_nonzero_ascii (unsigned char *str, ptrdiff_t n) +{ + for (ptrdiff_t i = 0; i < n; i++) + if (str[i] < 1 || str[i] > 127) + return false; + return true; +} + +@implementation NSString (EmacsString) +/* Make an NSString from a Lisp string. */ ++ (NSString *)stringWithLispString:(Lisp_Object)string +{ + /* Shortcut for the common case. */ + if (all_nonzero_ascii (SDATA (string), SBYTES (string))) + return [NSString stringWithCString: SSDATA (string) + encoding: NSASCIIStringEncoding]; + string = string_to_multibyte (string); + + /* Now the string is multibyte; convert to UTF-16. */ + unichar *chars = xmalloc (4 * SCHARS (string)); + unichar *d = chars; + const unsigned char *s = SDATA (string); + const unsigned char *end = s + SBYTES (string); + while (s < end) + { + int c = string_char_advance (&s); + /* We pass unpaired surrogates through, because they are typically + handled fairly well by the NS libraries (displayed with distinct + glyphs etc). */ + if (c <= 0xffff) + *d++ = c; + else if (c <= 0x10ffff) + { + *d++ = 0xd800 + (c & 0x3ff); + *d++ = 0xdc00 + ((c - 0x10000) >> 10); + } + else + *d++ = 0xfffd; /* Not valid for UTF-16. */ + } + NSString *str = [NSString stringWithCharacters: chars + length: d - chars]; + xfree (chars); + return str; +} +@end + /* ========================================================================== Lisp interface declaration diff --git a/src/nsterm.h b/src/nsterm.h index a511fef5b9..ab868ed344 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -361,6 +361,11 @@ typedef id instancetype; @end + +@interface NSString (EmacsString) ++ (NSString *)stringWithLispString:(Lisp_Object)string; +@end + /* ========================================================================== The Emacs application commit 3b8a6ef18543cc56ed4524ac3d6a6843e818f6fb Author: Lars Ingebrigtsen Date: Thu Aug 20 17:18:46 2020 +0200 Fix compilation warning in vc-cvs from previous change * lisp/vc/vc-cvs.el (log-edit-extract-headers): Fix compilation warning. diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index a2bed1ef40..fdbf44e0f1 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el @@ -337,6 +337,8 @@ its parents." (directory-file-name dir)))) (eq dir t))) +(declare-function log-edit-extract-headers "log-edit" (headers string)) + (defun vc-cvs-checkin (files comment &optional rev) "CVS-specific version of `vc-backend-checkin'." (unless (or (not rev) (vc-cvs-valid-revision-number-p rev)) commit ea8ead6a8bf889679f794d9a4e1daf181b2e5c3b Author: Lars Ingebrigtsen Date: Thu Aug 20 17:17:48 2020 +0200 Fix message.el compilation warning * lisp/gnus/message.el (smtpmail-stream-type): Fix compilation warning from last change. diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index e2f813339f..e10322417d 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -4852,6 +4852,7 @@ Each line should be no more than 79 characters long." (defvar smtpmail-smtp-server) (defvar smtpmail-smtp-service) (defvar smtpmail-smtp-user) +(defvar smtpmail-stream-type) (defun message-multi-smtp-send-mail () "Send the current buffer to `message-send-mail-function'. commit 44f75f0d9d1db0571b59759f1b2922ff8b099cdb Author: Lars Ingebrigtsen Date: Thu Aug 20 17:03:04 2020 +0200 Allow specifying the TLS port in X-Message-SMTP-Method * lisp/gnus/message.el (message-multi-smtp-send-mail): If the user has specified the TLS SMTP port, then force a TLS connection (bug#38066). diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 8ae5eb2f62..e2f813339f 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -4870,6 +4870,11 @@ that instead." (let* ((smtpmail-smtp-server (nth 1 method)) (service (nth 2 method)) (port (string-to-number service)) + ;; If we're talking to the TLS SMTP port, then force a + ;; TLS connection. + (smtpmail-stream-type (if (= port 465) + 'tls + smtpmail-stream-type)) (smtpmail-smtp-service (if (> port 0) port service)) (smtpmail-smtp-user (or (nth 3 method) smtpmail-smtp-user))) (message-smtpmail-send-it))) commit bd0523901bd022ae94503dcedda3fc879e6d0702 Author: Lars Ingebrigtsen Date: Thu Aug 20 16:52:57 2020 +0200 Don't message the hunk status when just going to it * lisp/vc/diff-mode.el (diff-goto-source): Don't output a status about the hunk just when jumping to it (bug#38370). This would output "Hunk already applied" when browsing diffs. diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index bd5ac9b9a6..aff20b6e6e 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -1988,8 +1988,7 @@ revision of the file otherwise." (diff-find-source-location other-file reverse))) (pop-to-buffer buf) (goto-char (+ (car pos) (cdr src))) - (when buffer (next-error-found buffer (current-buffer))) - (diff-hunk-status-msg line-offset (xor reverse switched) t)))) + (when buffer (next-error-found buffer (current-buffer)))))) (defun diff-current-defun () commit b19b942f7228cf9536f3cf5b279b93a83d2a7d64 Author: Lars Ingebrigtsen Date: Thu Aug 20 16:42:06 2020 +0200 Add a new way to encode unprintable characters in Message: url-encode * lisp/gnus/message.el (message-fix-before-sending): Add a new conversion method for invalid characters -- URL-encoding (bug#38955). diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 0fd490be5c..8ae5eb2f62 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -4466,6 +4466,7 @@ conformance." ,(format "Replace non-printable characters with \"%s\" and send" message-replacement-char)) + (?u "url-encode" "Use URL %hex encoding") (?s "send" "Send as is without removing anything") (?e "edit" "Continue editing"))))) (if (eq choice ?e) @@ -4487,11 +4488,17 @@ conformance." control-1)) (not (get-text-property (point) 'untranslated-utf-8))))) - (if (eq choice ?i) - (message-kill-all-overlays) + (cond + ((eq choice ?i) + (message-kill-all-overlays)) + ((eq choice ?u) + (let ((char (get-byte (point)))) + (delete-char 1) + (insert (format "%%%x" char)))) + (t (delete-char 1) (when (eq choice ?r) - (insert message-replacement-char)))) + (insert message-replacement-char))))) (forward-char) (skip-chars-forward mm-7bit-chars))))) (message-check 'bogus-recipient commit ac79d73760c6789ec8b47f7795b1a8040758647a Author: Lars Ingebrigtsen Date: Thu Aug 20 16:33:29 2020 +0200 Fix problem with unprintable characters in Message headers * lisp/gnus/message.el (message-fix-before-sending): Remove unprintable characters from the entire buffer, not just the body (bug#38955). diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index d4b057f593..0fd490be5c 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -4430,7 +4430,7 @@ conformance." (error "Invisible text found and made visible"))))) (message-check 'illegible-text (let (char found choice nul-chars) - (message-goto-body) + (goto-char (point-min)) (setq nul-chars (save-excursion (search-forward "\000" nil t))) (while (progn @@ -4470,7 +4470,7 @@ conformance." (?e "edit" "Continue editing"))))) (if (eq choice ?e) (error "Non-printable characters")) - (message-goto-body) + (goto-char (point-min)) (skip-chars-forward mm-7bit-chars) (while (not (eobp)) (when (let ((char (char-after))) @@ -4811,7 +4811,7 @@ If you always want Gnus to send messages in one piece, set message-courtesy-message))) ;; If this was set, `sendmail-program' takes care of encoding. (unless message-inhibit-body-encoding - ;; Let's make sure we encoded all the body. + ;; Let's make sure we encoded everything in the buffer. (cl-assert (save-excursion (goto-char (point-min)) (not (re-search-forward "[^\000-\377]" nil t))))) commit 63ac91a2ec8e03e1b5d1ed68e79de2a0dcc5ec8e Author: Lars Ingebrigtsen Date: Thu Aug 20 16:12:07 2020 +0200 Fix interactive spec of message-beginning-of-line * lisp/gnus/message.el (message-beginning-of-line): Fix problem with C-S-a getting translated to C-a in message-mode (bug#39545). diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 417982731e..d4b057f593 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -6497,7 +6497,7 @@ When called without a prefix argument, header value spanning multiple lines is treated as a single line. Otherwise, even if N is 1, when point is on a continuation header line, it will be moved to the beginning " - (interactive "p") + (interactive "^p") (cond ;; Go to beginning of header or beginning of line. ((and message-beginning-of-line (message-point-in-header-p)) commit 0faa2c95904914731ec68d09fe5fcbbc375db6b1 Author: Lars Ingebrigtsen Date: Thu Aug 20 15:54:38 2020 +0200 Remove the "Summary: " but from cvs checkins * lisp/vc/vc-cvs.el (vc-cvs-checkin): Remove the "Summary:" bit from the comment (bug#40506). diff --git a/lisp/vc/vc-cvs.el b/lisp/vc/vc-cvs.el index e8231ecb28..a2bed1ef40 100644 --- a/lisp/vc/vc-cvs.el +++ b/lisp/vc/vc-cvs.el @@ -339,30 +339,31 @@ its parents." (defun vc-cvs-checkin (files comment &optional rev) "CVS-specific version of `vc-backend-checkin'." - (unless (or (not rev) (vc-cvs-valid-revision-number-p rev)) - (if (not (vc-cvs-valid-symbolic-tag-name-p rev)) + (unless (or (not rev) (vc-cvs-valid-revision-number-p rev)) + (if (not (vc-cvs-valid-symbolic-tag-name-p rev)) (error "%s is not a valid symbolic tag name" rev) - ;; If the input revision is a valid symbolic tag name, we create it - ;; as a branch, commit and switch to it. - (apply 'vc-cvs-command nil 0 files "tag" "-b" (list rev)) - (apply 'vc-cvs-command nil 0 files "update" "-r" (list rev)) - (mapc (lambda (file) (vc-file-setprop file 'vc-cvs-sticky-tag rev)) + ;; If the input revision is a valid symbolic tag name, we create it + ;; as a branch, commit and switch to it. + (apply 'vc-cvs-command nil 0 files "tag" "-b" (list rev)) + (apply 'vc-cvs-command nil 0 files "update" "-r" (list rev)) + (mapc (lambda (file) (vc-file-setprop file 'vc-cvs-sticky-tag rev)) files))) - (let ((status (apply 'vc-cvs-command nil 1 files - "ci" (if rev (concat "-r" rev)) - (concat "-m" comment) - (vc-switches 'CVS 'checkin)))) + (let ((status (apply + 'vc-cvs-command nil 1 files + "ci" (if rev (concat "-r" rev)) + (concat "-m" (car (log-edit-extract-headers nil comment))) + (vc-switches 'CVS 'checkin)))) (set-buffer "*vc*") (goto-char (point-min)) (when (not (zerop status)) ;; Check checkin problem. (cond ((re-search-forward "Up-to-date check failed" nil t) - (mapc (lambda (file) (vc-file-setprop file 'vc-state 'needs-merge)) + (mapc (lambda (file) (vc-file-setprop file 'vc-state 'needs-merge)) files) (error "%s" (substitute-command-keys - (concat "Up-to-date check failed: " - "type \\[vc-next-action] to merge in changes")))) + (concat "Up-to-date check failed: " + "type \\[vc-next-action] to merge in changes")))) (t (pop-to-buffer (current-buffer)) (goto-char (point-min)) @@ -372,7 +373,7 @@ its parents." ;; Otherwise we can't necessarily tell what goes with what; clear ;; its properties so they have to be refetched. (if (= (length files) 1) - (vc-file-setprop + (vc-file-setprop (car files) 'vc-working-revision (vc-parse-buffer "^\\(new\\|initial\\) revision: \\([0-9.]+\\)" 2)) (mapc 'vc-file-clearprops files)) @@ -385,7 +386,7 @@ its parents." ;; if this was an explicit check-in (does not include creation of ;; a branch), remove the sticky tag. (if (and rev (not (vc-cvs-valid-symbolic-tag-name-p rev))) - (vc-cvs-command nil 0 files "update" "-A")))) + (vc-cvs-command nil 0 files "update" "-A")))) (defun vc-cvs-find-revision (file rev buffer) (apply 'vc-cvs-command commit 219e80f0a37124777803723d0f8bbc84b0cc0b0f Author: Lars Ingebrigtsen Date: Thu Aug 20 15:27:07 2020 +0200 message-sendmail-f-is-evil doc string fix * lisp/gnus/message.el (message-sendmail-f-is-evil): Make doc string less confusing by removing a joke (bug#41096). diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 07ff489038..417982731e 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -854,7 +854,8 @@ symbol `never', the posting is not allowed. If it is the symbol ;; differently (bug#36937). nil "Non-nil means don't add \"-f username\" to the sendmail command line. -Doing so would be even more evil than leaving it out." +See `feedmail-sendmail-f-doesnt-sell-me-out' for an explanation +of what the \"-f\" parameter does." :group 'message-sending :link '(custom-manual "(message)Mail Variables") :type 'boolean) commit 80628df778c2608e0d0d934ed884365ae94f9ddd Author: Noah Swainland Date: Thu Aug 20 15:17:19 2020 +0200 Add global-goto-address-mode * doc/emacs/misc.texi (Goto Address mode): Document it. * lisp/net/goto-addr.el (global-goto-address-mode) (goto-addr-mode--turn-on): New functions (bug#42937). diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 317a1979e9..c8b21e701c 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -2945,6 +2945,9 @@ browse-url @key{RET}}. @table @kbd @item M-x goto-address-mode Activate URLs and e-mail addresses in the current buffer. + +@item M-x global-goto-address-mode +Activate @code{goto-address-mode} in all buffers. @end table @kindex C-c RET @r{(Goto Address mode)} diff --git a/etc/NEWS b/etc/NEWS index bbd34a5d6f..53391f91f7 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -820,6 +820,10 @@ window after starting). This variable defaults to nil. ** Miscellaneous ++++ +*** New global mode 'global-goto-address-mode' +This will enable 'goto-address-mode' in all buffers. + --- *** 'C-s' in 'M-x' now searches over completions again. In Emacs 23, typing 'M-x' ('read-extended-command') and then 'C-s' (to diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el index 9436f45aa3..43bea76a6b 100644 --- a/lisp/net/goto-addr.el +++ b/lisp/net/goto-addr.el @@ -280,6 +280,16 @@ Also fontifies the buffer appropriately (see `goto-address-fontify-p' and (widen) (goto-address-unfontify (point-min) (point-max))))) +(defun goto-addr-mode--turn-on () + (when (not goto-address-mode) + (goto-address-mode 1))) + +;;;###autoload +(define-globalized-minor-mode global-goto-address-mode + goto-address-mode goto-addr-mode--turn-on + :group 'goto-address + :version "28.1") + ;;;###autoload (define-minor-mode goto-address-prog-mode "Like `goto-address-mode', but only for comments and strings."