[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/replace-region-contents 4d8c446: Merge branch 'ori
From: |
Tassilo Horn |
Subject: |
[Emacs-diffs] scratch/replace-region-contents 4d8c446: Merge branch 'origin/master' into scratch/replace-region-contents |
Date: |
Wed, 13 Feb 2019 12:01:14 -0500 (EST) |
branch: scratch/replace-region-contents
commit 4d8c446c0bf33cee0e8df69c7cd0c87dedc3ca24
Merge: 814f0c0 10527fc
Author: Tassilo Horn <address@hidden>
Commit: Tassilo Horn <address@hidden>
Merge branch 'origin/master' into scratch/replace-region-contents
---
admin/notes/hydra | 4 ++--
lisp/gnus/nnspool.el | 23 ++++++++---------------
lisp/progmodes/cc-cmds.el | 4 ++--
lisp/progmodes/cperl-mode.el | 4 +---
lisp/progmodes/js.el | 24 ++++++++++++++++++++++--
lisp/progmodes/vhdl-mode.el | 12 ++++++------
lisp/url/url-util.el | 2 +-
lisp/xt-mouse.el | 21 ++++-----------------
src/keyboard.c | 16 +++++++++++-----
test/manual/indent/js.js | 9 +++++++++
10 files changed, 66 insertions(+), 53 deletions(-)
diff --git a/admin/notes/hydra b/admin/notes/hydra
index 49c995f..da8d986 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 address@hidden
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
diff --git a/lisp/gnus/nnspool.el b/lisp/gnus/nnspool.el
index 0f032f9..767631c 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")))
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index c0a6881..efc6747 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 b83947f..cb69a43 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/js.el b/lisp/progmodes/js.el
index a94a2fe..b0bb821 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
@@ -1834,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 "+\\+\\|--\\|/[/*]"))))))))))
@@ -2063,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
@@ -2093,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/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 3bcf9e5..27380b3 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)
diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el
index 1ca2572..c2baa69 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)))
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el
index fc00d1d..770aecf 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)
diff --git a/src/keyboard.c b/src/keyboard.c
index cd1747e..1d67c3e 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -360,7 +360,7 @@ static Lisp_Object make_lispy_focus_in (Lisp_Object);
static Lisp_Object make_lispy_focus_out (Lisp_Object);
static bool help_char_p (Lisp_Object);
static void save_getcjmp (sys_jmp_buf);
-static void restore_getcjmp (sys_jmp_buf);
+static void restore_getcjmp (void *);
static Lisp_Object apply_modifiers (int, Lisp_Object);
static void restore_kboard_configuration (int);
static void handle_interrupt (bool);
@@ -2126,12 +2126,14 @@ read_event_from_main_queue (struct timespec *end_time,
return c;
/* Actually read a character, waiting if necessary. */
+ ptrdiff_t count = SPECPDL_INDEX ();
save_getcjmp (save_jump);
+ record_unwind_protect_ptr (restore_getcjmp, save_jump);
restore_getcjmp (local_getcjmp);
if (!end_time)
timer_start_idle ();
c = kbd_buffer_get_event (&kb, used_mouse_menu, end_time);
- restore_getcjmp (save_jump);
+ unbind_to (count, Qnil);
if (! NILP (c) && (kb != current_kboard))
{
@@ -2620,10 +2622,12 @@ read_char (int commandflag, Lisp_Object map,
{
Lisp_Object tem0;
+ ptrdiff_t count = SPECPDL_INDEX ();
save_getcjmp (save_jump);
+ record_unwind_protect_ptr (restore_getcjmp, save_jump);
restore_getcjmp (local_getcjmp);
tem0 = sit_for (Vecho_keystrokes, 1, 1);
- restore_getcjmp (save_jump);
+ unbind_to (count, Qnil);
if (EQ (tem0, Qt)
&& ! CONSP (Vunread_command_events))
echo_now ();
@@ -2694,10 +2698,12 @@ read_char (int commandflag, Lisp_Object map,
timeout = min (timeout, MOST_POSITIVE_FIXNUM / delay_level * 4);
timeout = delay_level * timeout / 4;
+ ptrdiff_t count1 = SPECPDL_INDEX ();
save_getcjmp (save_jump);
+ record_unwind_protect_ptr (restore_getcjmp, save_jump);
restore_getcjmp (local_getcjmp);
tem0 = sit_for (make_fixnum (timeout), 1, 1);
- restore_getcjmp (save_jump);
+ unbind_to (count1, Qnil);
if (EQ (tem0, Qt)
&& ! CONSP (Vunread_command_events))
@@ -3320,7 +3326,7 @@ save_getcjmp (sys_jmp_buf temp)
}
static void
-restore_getcjmp (sys_jmp_buf temp)
+restore_getcjmp (void *temp)
{
memcpy (getcjmp, temp, sizeof getcjmp);
}
diff --git a/test/manual/indent/js.js b/test/manual/indent/js.js
index df79098..647d743 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