commit 7ca9bb7849c47f061f1e887fe1c2de9960654648 (HEAD, refs/remotes/origin/master) Author: Glenn Morris Date: Wed Dec 19 18:37:04 2018 -0500 Skip rather than fail in flymake tests * test/lisp/progmodes/flymake-tests.el (flymake-tests--wait-for-backends): Skip rather than fail if backends are slow to respond. This always seems like a temporary system glitch and not something that should be reported as a failure. diff --git a/test/lisp/progmodes/flymake-tests.el b/test/lisp/progmodes/flymake-tests.el index bba1f12e69..ef1fd19e86 100644 --- a/test/lisp/progmodes/flymake-tests.el +++ b/test/lisp/progmodes/flymake-tests.el @@ -53,7 +53,7 @@ while notdone unless noninteractive do (read-event "" nil 0.1) do (sleep-for (+ 0.5 flymake-no-changes-timeout)) - finally (when notdone (ert-fail + finally (when notdone (ert-skip (format "Some backends not reporting yet %s" notdone))))) commit 88215d242f9a1741ae8b30298633c901932e4c8f Author: Eric Abrahamsen Date: Wed Dec 19 14:11:14 2018 -0800 Make gnus-newsgroup-name local var available to gnus-summary-mode * lisp/gnus/gnus-sum.el (gnus-summary-mode-group): New defvar for passing gnus-newsgroup-name (a local variable) into the body of gnus-summary-mode, so that it's available to gnus-summary-mode-hook. diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 3f5362ba17..267b367fff 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -3064,6 +3064,7 @@ The following commands are available: (let ((gnus-summary-local-variables gnus-newsgroup-variables)) (gnus-summary-make-local-variables)) (gnus-summary-make-local-variables) + (setq gnus-newsgroup-name gnus-summary-mode-group) (when (gnus-visual-p 'summary-menu 'menu) (gnus-summary-make-menu-bar) (gnus-summary-make-tool-bar)) @@ -3457,6 +3458,11 @@ display only a single character." (point) (current-buffer)))))) +(defvar gnus-summary-mode-group nil + "Variable for communication with `gnus-summary-mode'. +Allows the `gnus-newsgroup-name' local variable to be set before +the summary mode hooks are run.") + (defun gnus-summary-setup-buffer (group) "Initialize summary buffer for GROUP. This function does all setup work that relies on the specific @@ -3476,10 +3482,10 @@ Returns non-nil if the setup was successful." (not gnus-newsgroup-prepared)) (set-buffer (gnus-get-buffer-create buffer)) (setq gnus-summary-buffer (current-buffer)) - (gnus-summary-mode) + (let ((gnus-summary-mode-group group)) + (gnus-summary-mode)) (when (gnus-group-quit-config group) (set (make-local-variable 'gnus-single-article-buffer) nil)) - (setq gnus-newsgroup-name group) (turn-on-gnus-mailing-list-mode) ;; These functions don't currently depend on GROUP, but might in ;; the future. commit 3a1d7227c24f59668dd0ed24527485d4010de2cb Author: Juri Linkov Date: Wed Dec 19 23:55:32 2018 +0200 * lisp/vc/diff-mode.el (diff-syntax-fontify-props): Use font-lock-ensure unconditionally. (Bug#33798) diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 043d22d14b..dd3a04b4e7 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -2525,14 +2525,7 @@ hunk text is not found in the source file." (when (and beg end) (goto-char beg) - (if file - ;; In a temporary or cached buffer - (when (text-property-not-all beg end 'fontified t) - (save-excursion - (font-lock-fontify-region beg end) - (put-text-property beg end 'fontified t))) - ;; In an existing buffer - (font-lock-ensure beg end)) + (font-lock-ensure beg end) (while (< (point) end) (let* ((bol (point)) commit 5bd6074415e8d572931ee51112d9b70b70e2ba55 Author: Paul Eggert Date: Wed Dec 19 12:57:25 2018 -0800 Minor fixes/simplifications to time functions * doc/lispintro/emacs-lisp-intro.texi (Files List): Simplify. * doc/lispref/os.texi (Time of Day): Mention format-time-string as an alternative to current-time-string. * lisp/arc-mode.el (archive-unixdate, archive-unixtime): Port better to future versions of Emacs where (COUNT . HZ) will take precedence to (HI . LO). * lisp/arc-mode.el (archive-unixtime): * lisp/calendar/todo-mode.el (todo-insert-item--basic) (todo-item-done, todo-read-time): Prefer format-time-string to substringing current-time-string. * lisp/calc/calc-forms.el (calc-time, calcFunc-now): Prefer decode-time to parsing the output of current-time-string. * lisp/emacs-lisp/cl-extra.el (cl--random-time): Prefer encode-time to hashing the output of current-time-string. * lisp/gnus/gnus-score.el (gnus-score-headers) (gnus-score-adaptive): Avoid stringifying and then reparsing timestamp. * src/timefns.c (Fencode_time): Omit redundant assignment. diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index 0b0c0a167d..1a1518b2c5 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -15599,7 +15599,7 @@ like this: (recursive-lengths-list-many-files (files-in-below-directory "/usr/local/src/emacs/lisp/")) '<) - (insert (format "%s" (current-time-string)))) + (insert (current-time-string))) @end ignore @node Counting function definitions diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 41753859e5..60697f2e29 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -1313,9 +1313,10 @@ This function returns the current time and date as a human-readable string. The format does not vary for the initial part of the string, which contains the day of week, month, day of month, and time of day in that order: the number of characters used for these fields is -always the same, so you can reliably -use @code{substring} to extract them. You should count -characters from the beginning of the string rather than from the end, +always the same, although (unless you require English weekday or +month abbreviations regardless of locale) it is typically more +convenient to use @code{format-time-string} than to extract +fields from the output of @code{current-time-string}, as the year might not have exactly four digits, and additional information may some day be added at the end. diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index 068702bc71..9d63a2a579 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@ -637,7 +637,7 @@ the mode is invalid. If ERROR is nil then nil will be returned." (defun archive-unixdate (low high) "Stringify Unix (LOW HIGH) date." - (let* ((time (cons high low)) + (let* ((time (list high low)) (str (current-time-string time))) (format "%s-%s-%s" (substring str 8 10) @@ -646,8 +646,7 @@ the mode is invalid. If ERROR is nil then nil will be returned." (defun archive-unixtime (low high) "Stringify Unix (LOW HIGH) time." - (let ((str (current-time-string (cons high low)))) - (substring str 11 19))) + (format-time-string "%H:%M:%S" (list high low))) (defun archive-get-lineno () (if (>= (point) archive-file-list-start) diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el index f7586288ca..ccd52d370d 100644 --- a/lisp/calc/calc-forms.el +++ b/lisp/calc/calc-forms.el @@ -37,13 +37,11 @@ (defun calc-time () (interactive) (calc-wrapper - (let ((time (current-time-string))) + (let ((time (decode-time))) (calc-enter-result 0 "time" (list 'mod (list 'hms - (string-to-number (substring time 11 13)) - (string-to-number (substring time 14 16)) - (string-to-number (substring time 17 19))) + (nth 2 time) (nth 1 time) (nth 0 time)) (list 'hms 24 0 0)))))) (defun calc-to-hms (arg) @@ -1341,16 +1339,15 @@ as measured in the integer number of days before December 31, 1 BC (Gregorian)." (math-parse-iso-date-validate isoyear isoweek isoweekday hour minute second))))) (defun calcFunc-now (&optional zone) - (let ((date (let ((calc-date-format nil)) - (math-parse-date (current-time-string))))) - (if (consp date) - (if zone - (math-add date (math-div (math-sub (calcFunc-tzone nil date) - (calcFunc-tzone zone date)) - '(float 864 2))) - date) - (calc-record-why "*Unable to interpret current date from system") - (append (list 'calcFunc-now) (and zone (list zone)))))) + (let ((date (let ((now (decode-time))) + (list 'date (math-dt-to-date + (list (nth 5 now) (nth 4 now) (nth 3 now) + (nth 2 now) (nth 1 now) (nth 0 now))))))) + (if zone + (math-add date (math-div (math-sub (calcFunc-tzone nil date) + (calcFunc-tzone zone date)) + '(float 864 2))) + date))) (defun calcFunc-year (date) (car (math-date-to-dt date))) diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index 41fe57e60c..145cf78e6d 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el @@ -1931,7 +1931,7 @@ their associated keys and their effects." (calendar-current-date) t t)))) (time-string (or (and time (todo-read-time)) (and todo-always-add-time-string - (substring (current-time-string) 11 16))))) + (format-time-string "%H:%M"))))) (setq todo-date-from-calendar nil) (find-file-noselect file 'nowarn) (set-window-buffer (selected-window) @@ -2881,8 +2881,7 @@ visible." (not marked)) (let* ((date-string (calendar-date-string (calendar-current-date) t t)) (time-string (if todo-always-add-time-string - (concat " " (substring (current-time-string) - 11 16)) + (format-time-string " %H:%M") "")) (done-prefix (concat "[" todo-done-string date-string time-string "] ")) @@ -6091,7 +6090,7 @@ the empty string (i.e., no time string)." (while (not valid) (setq answer (read-string "Enter a clock time: " nil nil (when todo-always-add-time-string - (substring (current-time-string) 11 16)))) + (format-time-string "%H:%M")))) (when (or (string= "" answer) (string-match diary-time-regexp answer)) (setq valid t))) diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index 13988db9a8..78484fcfa3 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -438,9 +438,7 @@ as an integer unless JUNK-ALLOWED is non-nil." ;; Random numbers. (defun cl--random-time () - (let* ((time (copy-sequence (current-time-string))) (i (length time)) (v 0)) - (while (>= (cl-decf i) 0) (setq v (+ (* v 3) (aref time i)))) - v)) + (car (encode-time nil t))) ;;;###autoload (autoload 'cl-random-state-p "cl-extra") (cl-defstruct (cl--random-state diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index 327cc69392..f777163cc3 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el @@ -1501,7 +1501,7 @@ If FORMAT, also format the current score file." (when (and gnus-summary-default-score scores) (let* ((entries gnus-header-index) - (now (date-to-day (current-time-string))) + (now (time-to-days (current-time))) (expire (and gnus-score-expiry-days (- now gnus-score-expiry-days))) (headers gnus-newsgroup-headers) @@ -2380,7 +2380,7 @@ score in `gnus-newsgroup-scored' by SCORE." (memq 'word gnus-newsgroup-adaptive)) (with-temp-buffer (let* ((hashtb (gnus-make-hashtable 1000)) - (date (date-to-day (current-time-string))) + (date (time-to-days (current-time))) (data gnus-newsgroup-data) word d score val) (with-syntax-table gnus-adaptive-word-syntax-table diff --git a/src/timefns.c b/src/timefns.c index f527d5ed7f..58dda1c706 100644 --- a/src/timefns.c +++ b/src/timefns.c @@ -1475,7 +1475,6 @@ usage: (encode-time &optional TIME FORM &rest OBSOLESCENT-ARGUMENTS) */) { if (6 < nargs) zone = args[nargs - 1]; - form = Qnil; tm.tm_sec = check_tm_member (a, 0); tm.tm_min = check_tm_member (args[1], 0); tm.tm_hour = check_tm_member (args[2], 0); commit 3fa8bdca88153ff442ca22d8c298525c1b716e7e Author: Michael Albinus Date: Wed Dec 19 20:29:29 2018 +0100 * lisp/net/tramp-sh.el (tramp-set-remote-path): Send a warning, if $PATH exceeds PATH_MAX on the remote system. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index e4ec735a96..14ae2cb51b 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3885,10 +3885,22 @@ This function expects to be in the right *tramp* buffer." I.e., for each directory in `tramp-remote-path', it is tested whether it exists and if so, it is added to the environment variable PATH." - (tramp-message vec 5 "Setting $PATH environment variable") - (tramp-send-command - vec (format "PATH=%s; export PATH" - (mapconcat 'identity (tramp-get-remote-path vec) ":")))) + (let ((path (mapconcat 'identity (tramp-get-remote-path vec) ":")) + (path-max + (with-tramp-connection-property vec "path-max" + (tramp-send-command-and-read vec "getconf PATH_MAX /"))) + index) + (tramp-message vec 5 "Setting $PATH environment variable") + (unless (< (length path) path-max) + (setq index path-max) + (while (not (string-equal (substring path (1- index) index) ":")) + (setq index (1- index))) + ;; FIXME: Is this sufficient? Or shall we raise an error? + (tramp-message + vec 2 "$PATH environment variable is too long. Ignoring \"%s\"" + (substring path index)) + (setq path (substring path 0 (1- index)))) + (tramp-send-command vec (format "PATH=%s; export PATH" path)))) ;; ------------------------------------------------------------ ;; -- Communication with external shell -- commit 5d6258518e4ba5312fc7d6564bba2232e06bf0a6 Author: Nicholas Drozd Date: Wed Dec 19 08:55:54 2018 -0800 * src/editfns.c (Finsert_char): Skip unnecessary fixnum check. diff --git a/src/editfns.c b/src/editfns.c index 8df4ed107e..9bfab74a9a 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -1471,7 +1471,8 @@ called interactively, INHERIT is t. */) CHECK_CHARACTER (character); if (NILP (count)) XSETFASTINT (count, 1); - CHECK_FIXNUM (count); + else + CHECK_FIXNUM (count); c = XFIXNAT (character); if (!NILP (BVAR (current_buffer, enable_multibyte_characters)))