commit ae4bfd52deecfccbbeb20ac852564b75a1bb83ff (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Wed Feb 13 00:50:19 2019 -0800 Don’t assume CURRENT_TIME_LIST * lisp/progmodes/cc-cmds.el (c-progress-init) (c-progress-update): * lisp/progmodes/cperl-mode.el (cperl-time-fontification): * lisp/progmodes/vhdl-mode.el (vhdl-update-progress-info) (vhdl-fix-case-region-1): Don’t assume (current-time) returns a list. Fix unlikely bug if we’re called 65536 seconds apart. diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index c0a688195c..efc6747de4 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -3609,7 +3609,7 @@ Otherwise reindent just the current line." (save-excursion (goto-char end) (point-marker)) - (nth 1 (current-time)) + (encode-time nil 'integer) context)) (message "Indenting region...")) )) @@ -3617,7 +3617,7 @@ Otherwise reindent just the current line." (defun c-progress-update () (if (not (and c-progress-info c-progress-interval)) nil - (let ((now (nth 1 (current-time))) + (let ((now (encode-time nil 'integer)) (start (aref c-progress-info 0)) (end (aref c-progress-info 1)) (lastsecs (aref c-progress-info 2))) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index b83947f903..cb69a43b63 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -8675,9 +8675,7 @@ start with default arguments, then refine the slowdown regions." (or l (setq l 1)) (or step (setq step 500)) (or lim (setq lim 40)) - (let* ((timems (function (lambda () - (let ((tt (current-time))) - (+ (* 1000 (nth 1 tt)) (/ (nth 2 tt) 1000)))))) + (let* ((timems (function (lambda () (car (encode-time nil 1000))))) (tt (funcall timems)) (c 0) delta tot) (goto-char (point-min)) (forward-line (1- l)) diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index 3bcf9e50f0..27380b33ad 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -7392,8 +7392,8 @@ only-lines." (defun vhdl-update-progress-info (string pos) "Update progress information." (when (and vhdl-progress-info (not noninteractive) - (< vhdl-progress-interval - (- (nth 1 (current-time)) (aref vhdl-progress-info 2)))) + (time-less-p vhdl-progress-interval + (time-subtract nil (aref vhdl-progress-info 2)))) (let ((delta (- (aref vhdl-progress-info 1) (aref vhdl-progress-info 0)))) (message "%s... (%2d%%)" string @@ -7401,7 +7401,7 @@ only-lines." 100 (floor (* 100.0 (- pos (aref vhdl-progress-info 0))) delta)))) - (aset vhdl-progress-info 2 (nth 1 (current-time))))) + (aset vhdl-progress-info 2 (encode-time nil 'integer)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Indentation commands @@ -8142,12 +8142,12 @@ depending on parameter UPPER-CASE." (upcase-word -1) (downcase-word -1))) (when (and count vhdl-progress-interval (not noninteractive) - (< vhdl-progress-interval - (- (nth 1 (current-time)) last-update))) + (time-less-p vhdl-progress-interval + (time-subtract nil last-update))) (message "Fixing case... (%2d%s)" (+ (* count 20) (/ (* 20 (- (point) beg)) (- end beg))) "%") - (setq last-update (nth 1 (current-time))))) + (setq last-update (encode-time nil 'integer)))) (goto-char end))))) (defun vhdl-fix-case-region (beg end &optional arg) commit 8e0d35802cda844ccb6ddf417672b5a5845f4874 Author: Paul Eggert Date: Wed Feb 13 00:23:23 2019 -0800 Don’t assume CURRENT_TIME_LIST * lisp/url/url-util.el (url-lazy-message): Don’t assume (current-time) returns a list. Fix unlikely bug if we’re called 65536 seconds apart. diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el index 1ca257210a..c2baa69d5a 100644 --- a/lisp/url/url-util.el +++ b/lisp/url/url-util.el @@ -182,7 +182,7 @@ Will not do anything if `url-show-status' is nil." (null url-show-status) (active-minibuffer-window) (= url-lazy-message-time - (setq url-lazy-message-time (nth 1 (current-time))))) + (setq url-lazy-message-time (encode-time nil 'integer)))) nil (apply 'message args))) commit 7ee12d95fb646fed16c953dc00f8e5bffde959cc Author: Paul Eggert Date: Tue Feb 12 18:24:59 2019 -0800 Simplify nnspool-request-newgroups arithmetic * lisp/gnus/nnspool.el (nnspool-request-newgroups): Simplify by compute time stamps as integers, not floats, since integers don’t overflow any more. diff --git a/lisp/gnus/nnspool.el b/lisp/gnus/nnspool.el index 0f032f9a42..767631c685 100644 --- a/lisp/gnus/nnspool.el +++ b/lisp/gnus/nnspool.el @@ -305,25 +305,18 @@ there.") (while (and (not (looking-at "\\([^ ]+\\) +\\([0-9]+\\)[0-9][0-9][0-9] ")) (zerop (forward-line -1)))) - ;; We require nnheader which requires gnus-util. - (let ((seconds (float-time (date-to-time date))) + (let ((seconds (encode-time (date-to-time date) 'integer)) groups) ;; Go through lines and add the latest groups to a list. (while (and (looking-at "\\([^ ]+\\) +[0-9]+ ") (progn - ;; We insert a .0 to make the list reader - ;; interpret the number as a float. It is far - ;; too big to be stored in a lisp integer. - (goto-char (1- (match-end 0))) - (insert ".0") - (> (progn - (goto-char (match-end 1)) - (read (current-buffer))) - seconds)) - (push (buffer-substring - (match-beginning 1) (match-end 1)) - groups) - (zerop (forward-line -1)))) + (goto-char (match-end 1)) + (< seconds (read (current-buffer)))) + (progn + (push (buffer-substring + (match-beginning 1) (match-end 1)) + groups) + (zerop (forward-line -1))))) (erase-buffer) (dolist (group groups) (insert group " 0 0 y\n"))) commit 21eef9fa7f5abc7587251a6671add780b7370bb7 Author: Jackson Ray Hamilton Date: Sat Feb 9 12:26:21 2019 -0800 Indent arrows’ expression bodies like function bodies (Bug#25904) * lisp/progmodes/js.el (js--continued-expression-p): Don’t confuse ‘=>’ for a ‘>’ operator. (js--line-terminating-arrow-re): New variable. (js--looking-at-broken-arrow-function-p): New function. (js--proper-indentation): Don’t align arrow functions’ expression bodies starting on new lines like list continuations, instead align them like function bodies (js-indent-align-list-continuation need not be nil). * test/manual/indent/js.js: Add test for Bug#25904. Co-authored-by: Felipe Ochoa diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 6e18e30517..b0bb8213dc 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -1835,7 +1835,7 @@ This performs fontification according to `js--class-styles'." (skip-chars-backward " \t") (or (bobp) (backward-char)) (and (> (point) (point-min)) - (save-excursion (backward-char) (not (looking-at "[/*]/"))) + (save-excursion (backward-char) (not (looking-at "[/*]/\\|=>"))) (js--looking-at-operator-p) (and (progn (backward-char) (not (looking-at "+\\+\\|--\\|/[/*]")))))))))) @@ -2064,6 +2064,24 @@ indentation is aligned to that column." (when comma-p (goto-char (1+ declaration-keyword-end)))))))) +(defconst js--line-terminating-arrow-re "\\s-*=>\\s-*\\(/[/*]\\|$\\)" + "Regexp matching the last \"=>\" (arrow) token on a line. +Whitespace and comments around the arrow are ignored.") + +(defun js--looking-at-broken-arrow-function-p () + "Helper function for `js--proper-indentation'. +Return t if point is at the start of a (possibly async) arrow +function and the last non-comment, non-whitespace token of the +current line is the \"=>\" token." + (when (looking-at "\\s-*async\\s-*") + (goto-char (match-end 0))) + (cond + ((eq (char-after) ?\() + (forward-list) + (looking-at-p js--line-terminating-arrow-re)) + (t (looking-at-p + (concat js--name-re js--line-terminating-arrow-re))))) + (defun js--proper-indentation (parse-status) "Return the proper indentation for the current line." (save-excursion @@ -2094,7 +2112,8 @@ indentation is aligned to that column." (continued-expr-p (js--continued-expression-p))) (goto-char (nth 1 parse-status)) ; go to the opening char (if (or (not js-indent-align-list-continuation) - (looking-at "[({[]\\s-*\\(/[/*]\\|$\\)")) + (looking-at "[({[]\\s-*\\(/[/*]\\|$\\)") + (save-excursion (forward-char) (js--looking-at-broken-arrow-function-p))) (progn ; nothing following the opening paren/bracket (skip-syntax-backward " ") (when (eq (char-before) ?\)) (backward-list)) diff --git a/test/manual/indent/js.js b/test/manual/indent/js.js index df79098694..647d7438f4 100644 --- a/test/manual/indent/js.js +++ b/test/manual/indent/js.js @@ -151,6 +151,15 @@ let b = { ` } +// bug#25904 +foo.bar.baz(very => // A comment + very +).biz(([baz={a: [123]}, boz]) => + baz +).snarf((snorf) => /* Another comment */ + snorf +); + // Local Variables: // indent-tabs-mode: nil // js-indent-level: 2 commit dd319f2711f895eec87c1017b82cd9d88d9ecd0a Author: Jackson Ray Hamilton Date: Sat Feb 9 11:50:05 2019 -0800 js-indent-align-list-continuation: Make variable safe * lisp/progmodes/js.el (js-indent-align-list-continuation): Indicate variable is safe as a file-local variable. This fixes the js-indent-align-list-continuation-nil test when run with make. diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index a94a2fe134..6e18e30517 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -477,6 +477,7 @@ This applies to function movement, marking, and so on." "Align continuation of non-empty ([{ lines in `js-mode'." :version "26.1" :type 'boolean + :safe 'booleanp :group 'js) (defcustom js-comment-lineup-func #'c-lineup-C-comments commit e05ea0ea3117aa0ddd963585d5647fe116b8ffa0 Author: Paul Eggert Date: Tue Feb 12 15:20:40 2019 -0800 Make xterm-mouse-truncate-wrap obsolete * lisp/xt-mouse.el (xterm-mouse-truncate-wrap): Now obsolete, since we no longer need to worry about integer overflow. (xterm-mouse-event): Use plain ‘truncate’ instead. diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index fc00d1d99a..770aecfcbe 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el @@ -123,20 +123,7 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." (terminal-parameter nil 'xterm-mouse-y)))) pos) -(defun xterm-mouse-truncate-wrap (f) - "Truncate with wrap-around." - (condition-case nil - ;; First try the built-in truncate, in case there's no overflow. - (truncate f) - ;; In case of overflow, do wraparound by hand. - (range-error - ;; In our case, we wrap around every 3 days or so, so if we assume - ;; a maximum of 65536 wraparounds, we're safe for a couple years. - ;; Using a power of 2 makes rounding errors less likely. - (let* ((maxwrap (* 65536 2048)) - (dbig (truncate (/ f maxwrap))) - (fdiff (- f (* 1.0 maxwrap dbig)))) - (+ (truncate fdiff) (* maxwrap dbig)))))) +(define-obsolete-function-alias 'xterm-mouse-truncate-wrap 'truncate "27.1") (defcustom xterm-mouse-utf-8 nil "Non-nil if UTF-8 coordinates should be used to read mouse coordinates. @@ -256,7 +243,7 @@ which is the \"1006\" extension implemented in Xterm >= 277." (y (nth 2 click)) ;; Emulate timestamp information. This is accurate enough ;; for default value of mouse-1-click-follows-link (450msec). - (timestamp (xterm-mouse-truncate-wrap + (timestamp (truncate (* 1000 (- (float-time) (or xt-mouse-epoch @@ -266,8 +253,8 @@ which is the \"1006\" extension implemented in Xterm >= 277." (left (nth 0 ltrb)) (top (nth 1 ltrb)) (posn (if w - (posn-at-x-y (- x left) (- y top) w t) - (append (list nil 'menu-bar) + (posn-at-x-y (- x left) (- y top) w t) + (append (list nil 'menu-bar) (nthcdr 2 (posn-at-x-y x y))))) (event (list type posn))) (setcar (nthcdr 3 posn) timestamp) commit 5abaf16ab49b86ca5add981c2ddcaea6db0c8a08 Author: Glenn Morris Date: Tue Feb 12 13:57:34 2019 -0500 * admin/notes/hydra: Small updates. diff --git a/admin/notes/hydra b/admin/notes/hydra index 49c995f3f7..da8d98693e 100644 --- a/admin/notes/hydra +++ b/admin/notes/hydra @@ -10,8 +10,6 @@ https://hydra.nixos.org/jobset/gnu/emacs-trunk * It builds Emacs on various platforms. Sometimes jobs fail due to hydra problems rather than Emacs problems. -Eg it seems like the darwin build will never work again. -https://lists.gnu.org/r/hydra-users/2016-01/msg00000.html * Mail notifications In addition to the web interface, Hydra can send notifications by @@ -22,6 +20,8 @@ Emacs trunk to emacs-buildstatus@gnu.org. If you want to receive these notifications, please subscribe at https://lists.gnu.org/mailman/listinfo/emacs-buildstatus +(This feature seems to have been broken for ages.) + * The Emacs jobset consists of the following jobs: ** The 'tarball' job