emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master b1c7207 1/3: Merge from origin/emacs-25


From: Paul Eggert
Subject: [Emacs-diffs] master b1c7207 1/3: Merge from origin/emacs-25
Date: Sun, 03 Apr 2016 20:42:53 +0000

branch: master
commit b1c7207dbbc5b35aa2fa6e69a3041299e881dbb6
Merge: f7c5f79 b787d55
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Merge from origin/emacs-25
    
    b787d55 More format-time-string change fixups
    13c8f29 make-xwidget unused arg cleanup
    36e05f0 Remove unused arguments from make-xwidget
    1042217 Document incompatible changes in 'format-time-string'
    7228eb8 Improve documentation of byte-code objects
    0020047 Adapt calls to 'format-time-string' to changes in Emacs 25
    17b5152 Improve vc-diff with Git backend
    c28f87a (js--continued-expression-p): Special-case unary plus and minus
    2d02a5f ; * lisp/vc/vc-annotate.el (vc-annotate): Clarify commentary.
    9151f16 Prevent C++ Mode wrongly fontifying some identifiers near tem...
    b3b523c Avoid crashes due to insanely large columns in tabulated-list...
    a3daa34 Teach M-x disassemble a default argument.
    e30c3e9 Fix EOL decoding in vc-annotate with SVN back-end on MS-Windows
    df441b3 Fix OS X specific settings in tramp-tests
    2244331 Finish fixing a cacheing bug in CC Mode (see 2016-03-09)
    
    # Conflicts:
    #   lisp/net/tramp-sh.el
    #   lisp/progmodes/cc-engine.el
---
 doc/lispref/compile.texi    |   25 +++--
 doc/lispref/display.texi    |    9 +-
 etc/NEWS                    |    5 +
 lisp/emacs-lisp/disass.el   |   10 ++-
 lisp/gnus/gmm-utils.el      |    2 +-
 lisp/net/tramp.el           |   20 ++++
 lisp/org/org.el             |    9 +-
 lisp/org/ox-icalendar.el    |    3 +-
 lisp/progmodes/cc-cmds.el   |  249 +++++++++++++++++++++----------------------
 lisp/progmodes/cc-defs.el   |   52 ++++++---
 lisp/progmodes/cc-engine.el |   38 +++++--
 lisp/progmodes/cc-fonts.el  |   13 ++-
 lisp/progmodes/js.el        |   24 +++--
 lisp/vc/pcvs-info.el        |    2 +-
 lisp/vc/vc-annotate.el      |    9 ++
 lisp/vc/vc-git.el           |    9 +-
 lisp/xwidget.el             |    7 +-
 src/term.c                  |    1 +
 src/xdisp.c                 |   11 ++-
 src/xwidget.c               |   28 ++---
 test/manual/indent/js.js    |    6 +
 21 files changed, 313 insertions(+), 219 deletions(-)

diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi
index f7fed5e..c943a6a 100644
--- a/doc/lispref/compile.texi
+++ b/doc/lispref/compile.texi
@@ -533,8 +533,19 @@ there is no maximum number, but only the first six 
elements have any
 normal use.  They are:
 
 @table @var
address@hidden arglist
-The list of argument symbols.
address@hidden argdesc
+The descriptor of the arguments.  This can either be a list of
+arguments, as described in @ref{Argument List}, or an integer encoding
+the required number of arguments.  In the latter case, the value of
+the descriptor specifies the minimum number of arguments in the bits
+zero to 6, and the maximum number of arguments in bits 8 to 14.  If
+the argument list uses @code{&rest}, then bit 7 is set; otherwise it's
+cleared.
+
+If @var{argdesc} is a list, the arguments will be dynamically bound
+before executing the byte code.  If @var{argdesc} is an integer, the
+arguments will be instead pushed onto the stack of the byte-code
+interpreter, before executing the code.
 
 @item byte-code
 The string containing the byte-code instructions.
@@ -562,11 +573,11 @@ representation.  It is the definition of the command
 @code{backward-sexp}.
 
 @example
-#[(&optional arg)
-  "^H\204^F^@@\301^P\302^H[!\207"
-  [arg 1 forward-sexp]
-  2
-  254435
+#[256
+  "\211\204^G^@@\300\262^A\301^A[!\207"
+  [1 forward-sexp]
+  3
+  1793299
   "^p"]
 @end example
 
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 93c927c..1e45501 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -5804,17 +5804,16 @@ xwidget object, and then use that object as the display 
specifier
 in a @code{display} text or overlay property (@pxref{Display
 Property}).
 
address@hidden make-xwidget beg end type title width height arguments &optional 
buffer
-This creates an xwidget object between @var{beg} and @var{end}, buffer
-positions in @var{buffer}, and returns the new object.  If
address@hidden make-xwidget type title width height arguments &optional buffer
+This creates and returns an xwidget object.  If
 @var{buffer} is omitted or @code{nil}, it defaults to the current
 buffer.  If @var{buffer} names a buffer that doesn't exist, it will be
 created.  The @var{type} identifies the type of the xwidget component,
 it can be one of the following:
 
 @table @code
address@hidden webkit-osr
-The WebKit OSR (@dfn{on-stack replacement}) component.
address@hidden webkit
+The WebKit component.
 @end table
 
 The @var{width} and @var{height} arguments specify the widget size in
diff --git a/etc/NEWS b/etc/NEWS
index 88e101e..34f18e9 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2101,6 +2101,11 @@ rule.  The affected functions are 'current-time-string',
 function 'encode-time', which already accepted a simple time zone rule
 argument, has been extended to accept all the new forms.
 
+*** Incompatible change in the third argument of 'format-time-string'.
+Previously, any non-nil argument was interpreted as a UTC time zone.
+This is no longer true; packages that want UTC time zone should pass t
+as the third argument.
+
 *** Time-related functions now consistently accept numbers
 (representing seconds since the epoch) and nil (representing the
 current time) as well as the usual list-of-integer representation.
diff --git a/lisp/emacs-lisp/disass.el b/lisp/emacs-lisp/disass.el
index e67b022..8506ed6 100644
--- a/lisp/emacs-lisp/disass.el
+++ b/lisp/emacs-lisp/disass.el
@@ -54,9 +54,13 @@ OBJECT can be a symbol defined as a function, or a function 
itself
 \(a lambda expression or a compiled-function object).
 If OBJECT is not already compiled, we compile it, but do not
 redefine OBJECT if it is a symbol."
-  (interactive (list (intern (completing-read "Disassemble function: "
-                                             obarray 'fboundp t))
-                    nil 0 t))
+  (interactive
+   (let* ((fn (function-called-at-point))
+          (prompt (if fn (format "Disassemble function (default %s): " fn)
+                    "Disassemble function: "))
+          (def (and fn (symbol-name fn))))
+     (list (intern (completing-read prompt obarray 'fboundp t nil nil def))
+           nil 0 t)))
   (if (and (consp object) (not (functionp object)))
       (setq object `(lambda () ,object)))
   (or indent (setq indent 0))          ;Default indent to zero
diff --git a/lisp/gnus/gmm-utils.el b/lisp/gnus/gmm-utils.el
index 785a286..f6455cf 100644
--- a/lisp/gnus/gmm-utils.el
+++ b/lisp/gnus/gmm-utils.el
@@ -286,7 +286,7 @@ specifiers `%Z' and `%z' will be replaced with a numeric 
form. "
          (setq st nd))
        (push (substring format-string st) rest)
        (format-time-string (apply 'concat (nreverse rest)) time))
-    (format-time-string format-string time tz)))
+    (format-time-string format-string time t)))
 
 (provide 'gmm-utils)
 
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 4edca5a..e101c42 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3764,6 +3764,26 @@ This is used internally by `tramp-file-mode-from-int'."
       (when vec (tramp-message vec 7 "locale %s" (or locale "C")))
       (or locale "C"))))
 
+(defun tramp-get-local-locale (&optional vec)
+  ;; We use key nil for local connection properties.
+  (with-tramp-connection-property nil "locale"
+    (let ((candidates '("en_US.utf8" "C.utf8" "en_US.UTF-8"))
+         locale)
+      (with-temp-buffer
+       (unless (or (memq system-type '(windows-nt))
+                    (not (zerop (tramp-call-process
+                                 nil "locale" nil t nil "-a"))))
+         (while candidates
+           (goto-char (point-min))
+           (if (string-match (format "^%s\r?$" (regexp-quote (car candidates)))
+                             (buffer-string))
+               (setq locale (car candidates)
+                     candidates nil)
+             (setq candidates (cdr candidates))))))
+      ;; Return value.
+      (when vec (tramp-message vec 7 "locale %s" (or locale "C")))
+      (or locale "C"))))
+
 ;;;###tramp-autoload
 (defun tramp-check-cached-permissions (vec access)
   "Check `file-attributes' caches for VEC.
diff --git a/lisp/org/org.el b/lisp/org/org.el
index 6e7d54d..d2b48a6 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -22663,7 +22663,7 @@ contains commented lines.  Otherwise, comment them."
   "Non-nil when TIMESTAMP has a time specified."
   (org-element-property :hour-start timestamp))
 
-(defun org-timestamp-format (timestamp format &optional end utc)
+(defun org-timestamp-format (timestamp format &optional end zone)
   "Format a TIMESTAMP element into a string.
 
 FORMAT is a format specifier to be passed to
@@ -22672,8 +22672,9 @@ FORMAT is a format specifier to be passed to
 When optional argument END is non-nil, use end of date-range or
 time-range, if possible.
 
-When optional argument UTC is non-nil, time will be expressed as
-Universal Time."
+The optional ZONE is omitted or nil for Emacs local time, t for
+Universal Time, `wall' for system wall clock time, or a string as in
+`set-time-zone-rule' for a time zone rule."
   (format-time-string
    format
    (apply 'encode-time
@@ -22683,7 +22684,7 @@ Universal Time."
                  (if end '(:minute-end :hour-end :day-end :month-end :year-end)
                    '(:minute-start :hour-start :day-start :month-start
                                    :year-start)))))
-   utc))
+   zone))
 
 (defun org-timestamp-split-range (timestamp &optional end)
   "Extract a timestamp object from a date or time range.
diff --git a/lisp/org/ox-icalendar.el b/lisp/org/ox-icalendar.el
index 0d34ba1..cd54d1e 100644
--- a/lisp/org/ox-icalendar.el
+++ b/lisp/org/ox-icalendar.el
@@ -393,7 +393,8 @@ Universal Time, ignoring `org-icalendar-date-time-format'."
       ;; Convert timestamp into internal time in order to use
       ;; `format-time-string' and fix any mistake (i.e. MI >= 60).
       (encode-time 0 mi h d m y)
-      (or utc (and with-time-p (org-icalendar-use-UTC-date-time-p)))))))
+      (not (not (or utc (and with-time-p
+                             (org-icalendar-use-UTC-date-time-p)))))))))
 
 (defun org-icalendar-dtstamp ()
   "Return DTSTAMP property, as a string."
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 764f44a..59f2729 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -1594,70 +1594,69 @@ defun."
       (c-region-is-active-p)
       (push-mark))
 
-  (c-self-bind-state-cache ; We must not share with other users of 
c-state-cache.
-   (c-save-buffer-state
-       (beginning-of-defun-function
-       end-of-defun-function
-       (start (point))
-       (paren-state (c-parse-state))
-       (orig-point-min (point-min)) (orig-point-max (point-max))
-       lim                 ; Position of { which has been widened to.
-       where pos case-fold-search)
-
-     (save-restriction
-       (if (eq c-defun-tactic 'go-outward)
-          (setq lim (c-widen-to-enclosing-decl-scope ; e.g. class, namespace.
-                     paren-state orig-point-min orig-point-max)))
-
-       ;; Move back out of any macro/comment/string we happen to be in.
-       (c-beginning-of-macro)
-       (setq pos (c-literal-limits))
-       (if pos (goto-char (car pos)))
-
-       (setq where (c-where-wrt-brace-construct))
-
-       (if (< arg 0)
-          ;; Move forward to the closing brace of a function.
-          (progn
-            (if (memq where '(at-function-end outwith-function))
-                (setq arg (1+ arg)))
-            (if (< arg 0)
-                (c-while-widening-to-decl-block
-                 (< (setq arg (- (c-forward-to-nth-EOF-} (- arg) where))) 0)))
-            ;; Move forward to the next opening brace....
-            (when (and (= arg 0)
-                       (progn
-                         (c-while-widening-to-decl-block
-                          (not (c-syntactic-re-search-forward "{" nil 'eob)))
-                         (eq (char-before) ?{)))
-              (backward-char)
-              ;; ... and backward to the function header.
-              (c-beginning-of-decl-1)
-              t))
-
-        ;; Move backward to the opening brace of a function, making 
successively
-        ;; larger portions of the buffer visible as necessary.
-        (when (> arg 0)
-          (c-while-widening-to-decl-block
-           (> (setq arg (c-backward-to-nth-BOF-{ arg where)) 0)))
-
-        (when (eq arg 0)
-          ;; Go backward to this function's header.
-          (c-beginning-of-decl-1)
-
-          (setq pos (point))
-          ;; We're now there, modulo comments and whitespace.
-          ;; Try to be line oriented; position point at the closest
-          ;; preceding boi that isn't inside a comment, but if we hit
-          ;; the previous declaration then we use the current point
-          ;; instead.
-          (while (and (/= (point) (c-point 'boi))
-                      (c-backward-single-comment)))
-          (if (/= (point) (c-point 'boi))
-              (goto-char pos)))
-
-        (c-keep-region-active)
-        (= arg 0))))))
+  (c-save-buffer-state
+      (beginning-of-defun-function
+       end-of-defun-function
+       (start (point))
+       (paren-state (c-parse-state))
+       (orig-point-min (point-min)) (orig-point-max (point-max))
+       lim                 ; Position of { which has been widened to.
+       where pos case-fold-search)
+
+    (save-restriction
+      (if (eq c-defun-tactic 'go-outward)
+         (setq lim (c-widen-to-enclosing-decl-scope ; e.g. class, namespace.
+                    paren-state orig-point-min orig-point-max)))
+
+      ;; Move back out of any macro/comment/string we happen to be in.
+      (c-beginning-of-macro)
+      (setq pos (c-literal-limits))
+      (if pos (goto-char (car pos)))
+
+      (setq where (c-where-wrt-brace-construct))
+
+      (if (< arg 0)
+         ;; Move forward to the closing brace of a function.
+         (progn
+           (if (memq where '(at-function-end outwith-function))
+               (setq arg (1+ arg)))
+           (if (< arg 0)
+               (c-while-widening-to-decl-block
+                (< (setq arg (- (c-forward-to-nth-EOF-} (- arg) where))) 0)))
+           ;; Move forward to the next opening brace....
+           (when (and (= arg 0)
+                      (progn
+                        (c-while-widening-to-decl-block
+                         (not (c-syntactic-re-search-forward "{" nil 'eob)))
+                        (eq (char-before) ?{)))
+             (backward-char)
+             ;; ... and backward to the function header.
+             (c-beginning-of-decl-1)
+             t))
+
+       ;; Move backward to the opening brace of a function, making successively
+       ;; larger portions of the buffer visible as necessary.
+       (when (> arg 0)
+         (c-while-widening-to-decl-block
+          (> (setq arg (c-backward-to-nth-BOF-{ arg where)) 0)))
+
+       (when (eq arg 0)
+         ;; Go backward to this function's header.
+         (c-beginning-of-decl-1)
+
+         (setq pos (point))
+         ;; We're now there, modulo comments and whitespace.
+         ;; Try to be line oriented; position point at the closest
+         ;; preceding boi that isn't inside a comment, but if we hit
+         ;; the previous declaration then we use the current point
+         ;; instead.
+         (while (and (/= (point) (c-point 'boi))
+                     (c-backward-single-comment)))
+         (if (/= (point) (c-point 'boi))
+             (goto-char pos)))
+
+       (c-keep-region-active)
+       (= arg 0)))))
 
 (defun c-forward-to-nth-EOF-} (n where)
   ;; Skip to the closing brace of the Nth function after point.  If
@@ -1719,68 +1718,66 @@ the open-parenthesis that starts a defun; see 
`beginning-of-defun'."
       (c-region-is-active-p)
       (push-mark))
 
-  (c-self-bind-state-cache ; c-state-cache's list structure must not be shared
-                          ; with other users.
-   (c-save-buffer-state
-       (beginning-of-defun-function
-       end-of-defun-function
-       (start (point))
-       (paren-state (c-parse-state))
-       (orig-point-min (point-min)) (orig-point-max (point-max))
-       lim
-       where pos case-fold-search)
-
-     (save-restriction
-       (if (eq c-defun-tactic 'go-outward)
-          (setq lim (c-widen-to-enclosing-decl-scope ; e.g. class, namespace
-                     paren-state orig-point-min orig-point-max)))
-
-       ;; Move back out of any macro/comment/string we happen to be in.
-       (c-beginning-of-macro)
-       (setq pos (c-literal-limits))
-       (if pos (goto-char (car pos)))
-
-       (setq where (c-where-wrt-brace-construct))
-
-       (if (< arg 0)
-          ;; Move backwards to the } of a function
-          (progn
-            (if (memq where '(at-header outwith-function))
-                (setq arg (1+ arg)))
-            (if (< arg 0)
-                (c-while-widening-to-decl-block
-                 (< (setq arg (- (c-backward-to-nth-BOF-{ (- arg) where))) 0)))
-            (if (= arg 0)
-                (c-while-widening-to-decl-block
-                 (progn (c-syntactic-skip-backward "^}")
-                        (not (eq (char-before) ?}))))))
-
-        ;; Move forward to the } of a function
-        (if (> arg 0)
-            (c-while-widening-to-decl-block
-             (> (setq arg (c-forward-to-nth-EOF-} arg where)) 0))))
-
-       ;; Do we need to move forward from the brace to the semicolon?
-       (when (eq arg 0)
-        (if (c-in-function-trailer-p)  ; after "}" of struct/enum, etc.
-            (c-syntactic-re-search-forward ";"))
+  (c-save-buffer-state
+      (beginning-of-defun-function
+       end-of-defun-function
+       (start (point))
+       (paren-state (c-parse-state))
+       (orig-point-min (point-min)) (orig-point-max (point-max))
+       lim
+       where pos case-fold-search)
 
-        (setq pos (point))
-        ;; We're there now, modulo comments and whitespace.
-        ;; Try to be line oriented; position point after the next
-        ;; newline that isn't inside a comment, but if we hit the
-        ;; next declaration then we use the current point instead.
-        (while (and (not (bolp))
-                    (not (looking-at "\\s *$"))
-                    (c-forward-single-comment)))
-        (cond ((bolp))
-              ((looking-at "\\s *$")
-               (forward-line 1))
-              (t
-               (goto-char pos))))
+    (save-restriction
+      (if (eq c-defun-tactic 'go-outward)
+         (setq lim (c-widen-to-enclosing-decl-scope ; e.g. class, namespace
+                    paren-state orig-point-min orig-point-max)))
 
-       (c-keep-region-active)
-       (= arg 0)))))
+      ;; Move back out of any macro/comment/string we happen to be in.
+      (c-beginning-of-macro)
+      (setq pos (c-literal-limits))
+      (if pos (goto-char (car pos)))
+
+      (setq where (c-where-wrt-brace-construct))
+
+      (if (< arg 0)
+         ;; Move backwards to the } of a function
+         (progn
+           (if (memq where '(at-header outwith-function))
+               (setq arg (1+ arg)))
+           (if (< arg 0)
+               (c-while-widening-to-decl-block
+                (< (setq arg (- (c-backward-to-nth-BOF-{ (- arg) where))) 0)))
+           (if (= arg 0)
+               (c-while-widening-to-decl-block
+                (progn (c-syntactic-skip-backward "^}")
+                       (not (eq (char-before) ?}))))))
+
+       ;; Move forward to the } of a function
+       (if (> arg 0)
+           (c-while-widening-to-decl-block
+            (> (setq arg (c-forward-to-nth-EOF-} arg where)) 0))))
+
+      ;; Do we need to move forward from the brace to the semicolon?
+      (when (eq arg 0)
+       (if (c-in-function-trailer-p)   ; after "}" of struct/enum, etc.
+           (c-syntactic-re-search-forward ";"))
+
+       (setq pos (point))
+       ;; We're there now, modulo comments and whitespace.
+       ;; Try to be line oriented; position point after the next
+       ;; newline that isn't inside a comment, but if we hit the
+       ;; next declaration then we use the current point instead.
+       (while (and (not (bolp))
+                   (not (looking-at "\\s *$"))
+                   (c-forward-single-comment)))
+       (cond ((bolp))
+             ((looking-at "\\s *$")
+              (forward-line 1))
+             (t
+              (goto-char pos))))
+
+      (c-keep-region-active)
+      (= arg 0))))
 
 (defun c-defun-name ()
   "Return the name of the current defun, or NIL if there isn't one.
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index ba15d7f..64e5701 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -1402,25 +1402,41 @@ been put there by c-put-char-property.  POINT remains 
unchanged."
         (c-set-cpp-delimiters ,beg ,end)))))
 
 (defmacro c-self-bind-state-cache (&rest forms)
-  ;; Bind the state cache to itself and execute the FORMS.  It is assumed that 
no
-  ;; buffer changes will happen in FORMS, and no hidden buffer changes which 
could
-  ;; affect the parsing will be made by FORMS.
-  `(let ((c-state-cache (copy-tree c-state-cache))
-        (c-state-cache-good-pos c-state-cache-good-pos)
-        ;(c-state-nonlit-pos-cache (copy-tree c-state-nonlit-pos-cache))
-        ;(c-state-nonlit-pos-cache-limit c-state-nonlit-pos-cache-limit)
-        ;(c-state-semi-nonlit-pos-cache (copy-tree 
c-state-semi-nonlit-pos-cache))
-        ;(c-state-semi-nonlit-pos-cache-limit c-state-semi-nonlit-pos-cache)
-        (c-state-brace-pair-desert (copy-tree c-state-brace-pair-desert))
-        (c-state-point-min c-state-point-min)
-        (c-state-point-min-lit-type c-state-point-min-lit-type)
-        (c-state-point-min-lit-start c-state-point-min-lit-start)
-        (c-state-min-scan-pos c-state-min-scan-pos)
-        (c-state-old-cpp-beg c-state-old-cpp-beg)
-        (c-state-old-cpp-end c-state-old-cpp-end))
-     ,@forms))
+  ;; Bind the state cache to itself and execute the FORMS.  Return the result
+  ;; of the last FORM executed.  It is assumed that no buffer changes will
+  ;; happen in FORMS, and no hidden buffer changes which could affect the
+  ;; parsing will be made by FORMS.
+  `(let* ((c-state-cache (copy-tree c-state-cache))
+         (c-state-cache-good-pos c-state-cache-good-pos)
+         ;(c-state-nonlit-pos-cache (copy-tree c-state-nonlit-pos-cache))
+          ;(c-state-nonlit-pos-cache-limit c-state-nonlit-pos-cache-limit)
+          ;(c-state-semi-nonlit-pos-cache (copy-tree 
c-state-semi-nonlit-pos-cache))
+          ;(c-state-semi-nonlit-pos-cache-limit c-state-semi-nonlit-pos-cache)
+         (c-state-brace-pair-desert (copy-tree c-state-brace-pair-desert))
+         (c-state-point-min c-state-point-min)
+         (c-state-point-min-lit-type c-state-point-min-lit-type)
+         (c-state-point-min-lit-start c-state-point-min-lit-start)
+         (c-state-min-scan-pos c-state-min-scan-pos)
+         (c-state-old-cpp-beg-marker (if (markerp c-state-old-cpp-beg-marker)
+                                         (copy-marker 
c-state-old-cpp-beg-marker)
+                                       c-state-old-cpp-beg-marker))
+         (c-state-old-cpp-beg (if (markerp c-state-old-cpp-beg)
+                                  c-state-old-cpp-beg-marker
+                                c-state-old-cpp-beg))
+         (c-state-old-cpp-end-marker (if (markerp c-state-old-cpp-end-marker)
+                                         (copy-marker 
c-state-old-cpp-end-marker)
+                                       c-state-old-cpp-end-marker))
+         (c-state-old-cpp-end (if (markerp c-state-old-cpp-end)
+                                  c-state-old-cpp-end-marker
+                                c-state-old-cpp-end))
+         (c-parse-state-state c-parse-state-state))
+     (prog1
+        (progn ,@forms)
+       (if (markerp c-state-old-cpp-beg-marker)
+          (move-marker c-state-old-cpp-beg-marker nil))
+       (if (markerp c-state-old-cpp-end-marker)
+          (move-marker c-state-old-cpp-end-marker nil)))))
 
-
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; The following macros are to be used only in `c-parse-state' and its
 ;; subroutines.  Their main purpose is to simplify the handling of C++/Java
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index e04929a..4aff0dc 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -3501,6 +3501,9 @@ comment at the start of cc-engine.el for more info."
 (make-variable-buffer-local 'c-parse-state-state)
 (defun c-record-parse-state-state ()
   (setq c-parse-state-point (point))
+  (when (markerp (cdr (assq 'c-state-old-cpp-beg c-parse-state-state)))
+    (move-marker (cdr (assq 'c-state-old-cpp-beg c-parse-state-state)) nil)
+    (move-marker (cdr (assq 'c-state-old-cpp-end c-parse-state-state)) nil))
   (setq c-parse-state-state
        (mapcar
         (lambda (arg)
@@ -5841,10 +5844,11 @@ comment at the start of cc-engine.el for more info."
                    ((and c-opt-cpp-prefix
                          (looking-at c-noise-macro-with-parens-name-re))
                     (c-forward-noise-clause)))))
-     (when (memq res '(t known found prefix))
-       ,(when (eq type 'ref)
-         `(when c-record-type-identifiers
-            (c-record-ref-id c-last-identifier-range)))
+     (when (memq res '(t known found prefix maybe))
+       (when c-record-type-identifiers
+        ,(if (eq type 'type)
+             `(c-record-type-id c-last-identifier-range)
+           `(c-record-ref-id c-last-identifier-range)))
        t)))
 
 (defmacro c-forward-id-comma-list (type update-safe-pos)
@@ -6411,13 +6415,15 @@ comment at the start of cc-engine.el for more info."
                    (eq (char-after) ?<))
               ;; Maybe an angle bracket arglist.
               (when (let ((c-record-type-identifiers t)
-                          (c-record-found-types t))
+                          (c-record-found-types t)
+                          (c-last-identifier-range))
                       (c-forward-<>-arglist nil))
 
-                (c-add-type start (1+ pos))
                 (c-forward-syntactic-ws)
-                (setq pos (point)
-                      c-last-identifier-range nil)
+                (unless (eq (char-after) ?\()
+                  (setq c-last-identifier-range nil)
+                  (c-add-type start (1+ pos)))
+                (setq pos (point))
 
                 (if (and c-opt-identifier-concat-key
                          (looking-at c-opt-identifier-concat-key))
@@ -6431,7 +6437,8 @@ comment at the start of cc-engine.el for more info."
                       (c-forward-syntactic-ws)
                       t)
 
-                  (when (and c-record-type-identifiers id-start)
+                  (when (and c-record-type-identifiers id-start
+                             (not (eq (char-after) ?\()))
                     (c-record-type-id (cons id-start id-end)))
                   (setq res 'template)
                   nil)))
@@ -6613,9 +6620,18 @@ comment at the start of cc-engine.el for more info."
                           ;; It's an identifier that might be a type.
                           'maybe))))
            ((eq name-res 'template)
-            ;; A template is a type.
+            ;; A template is sometimes a type.
             (goto-char id-end)
-            (setq res t))
+            (c-forward-syntactic-ws)
+            (setq res
+                  (if (eq (char-after) ?\()
+                      (if (c-check-type id-start id-end)
+                          ;; It's an identifier that has been used as
+                          ;; a type somewhere else.
+                          'found
+                        ;; It's an identifier that might be a type.
+                        'maybe)
+                    t)))
            (t
             ;; Otherwise it's an operator identifier, which is not a type.
             (goto-char start)
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index 67e88a3..e171b20 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -914,7 +914,7 @@ casts and declarations are fontified.  Used on level 2 and 
higher."
   ;;
   ;; Fontify types and references in names containing angle bracket
   ;; arglists from the point to LIMIT.  Note that
-  ;; `c-font-lock-declarations' already has handled many of them.
+  ;; `c-font-lock-declarations' has already handled many of them.
   ;;
   ;; This function might do hidden buffer changes.
 
@@ -976,11 +976,12 @@ casts and declarations are fontified.  Used on level 2 
and higher."
                    (when (and c-opt-identifier-concat-key
                               (not (get-text-property id-start 'face)))
                      (c-forward-syntactic-ws)
-                     (if (looking-at c-opt-identifier-concat-key)
-                         (c-put-font-lock-face id-start id-end
-                                               c-reference-face-name)
-                       (c-put-font-lock-face id-start id-end
-                                             'font-lock-type-face)))))
+                     (cond ((looking-at c-opt-identifier-concat-key)
+                            (c-put-font-lock-face id-start id-end
+                                               c-reference-face-name))
+                           ((eq (char-after) ?\())
+                           (t (c-put-font-lock-face id-start id-end
+                                             'font-lock-type-face))))))
 
                (goto-char pos)))
          (goto-char pos)))))
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 15a52ba..8c93ffa 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -1770,16 +1770,20 @@ This performs fontification according to 
`js--class-styles'."
   "Return non-nil if the current line continues an expression."
   (save-excursion
     (back-to-indentation)
-    (or (js--looking-at-operator-p)
-        (and (js--re-search-backward "\n" nil t)
-            (progn
-              (skip-chars-backward " \t")
-              (or (bobp) (backward-char))
-              (and (> (point) (point-min))
-                    (save-excursion (backward-char) (not (looking-at "[/*]/")))
-                    (js--looking-at-operator-p)
-                   (and (progn (backward-char)
-                               (not (looking-at "+\\+\\|--\\|/[/*]"))))))))))
+    (if (js--looking-at-operator-p)
+        (or (not (memq (char-after) '(?- ?+)))
+            (progn
+              (forward-comment (- (point)))
+              (not (memq (char-before) '(?, ?\[ ?\()))))
+      (and (js--re-search-backward "\n" nil t)
+           (progn
+             (skip-chars-backward " \t")
+             (or (bobp) (backward-char))
+             (and (> (point) (point-min))
+                  (save-excursion (backward-char) (not (looking-at "[/*]/")))
+                  (js--looking-at-operator-p)
+                  (and (progn (backward-char)
+                              (not (looking-at "+\\+\\|--\\|/[/*]"))))))))))
 
 
 (defun js--end-of-do-while-loop-p ()
diff --git a/lisp/vc/pcvs-info.el b/lisp/vc/pcvs-info.el
index 1abc772..b9ecc89 100644
--- a/lisp/vc/pcvs-info.el
+++ b/lisp/vc/pcvs-info.el
@@ -465,7 +465,7 @@ DIR can also be a file."
               ((equal date "Result of merge") (setq subtype 'MERGED))
               ((let ((mtime (nth 5 (file-attributes (concat dir f))))
                      (system-time-locale "C"))
-                 (setq timestamp (format-time-string "%c" mtime 'utc))
+                 (setq timestamp (format-time-string "%c" mtime t))
                  ;; Solaris sometimes uses "Wed Sep 05", not "Wed Sep  5".
                  ;; See "grep '[^a-z_]ctime' cvs/src/*.c" for reference.
                  (if (= (aref timestamp 8) ?0)
diff --git a/lisp/vc/vc-annotate.el b/lisp/vc/vc-annotate.el
index ed038f1..774453f 100644
--- a/lisp/vc/vc-annotate.el
+++ b/lisp/vc/vc-annotate.el
@@ -432,6 +432,15 @@ should be applied to the background or to the foreground."
     (with-output-to-temp-buffer temp-buffer-name
       (let ((backend (or vc-bk (vc-backend file)))
            (coding-system-for-read buffer-file-coding-system))
+        ;; For a VC backend running on DOS/Windows, it's normal to
+        ;; produce CRLF EOLs even if the original file has Unix EOLs,
+        ;; which will show ^M characters in the Annotate buffer.  (One
+        ;; known case in point is "svn annotate".)  Prevent that by
+        ;; forcing DOS EOL decoding.
+        (if (memq system-type '(windows-nt ms-dos))
+            (setq coding-system-for-read
+                  (coding-system-change-eol-conversion coding-system-for-read
+                                                       'dos)))
         (vc-call-backend backend 'annotate-command file
                          (get-buffer temp-buffer-name) rev)
         ;; we must setup the mode first, and then set our local
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 8498cc8..f2466d8 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -853,7 +853,8 @@ If SHORTLOG is non-nil, use a short format based on 
`vc-git-root-log-format'.
 \(This requires at least Git version 1.5.6, for the --graph option.)
 If START-REVISION is non-nil, it is the newest revision to show.
 If LIMIT is non-nil, show no more than this many entries."
-  (let ((coding-system-for-read vc-git-commits-coding-system))
+  (let ((coding-system-for-read
+         (or coding-system-for-read vc-git-commits-coding-system)))
     ;; `vc-do-command' creates the buffer, but we need it before running
     ;; the command.
     (vc-setup-buffer buffer)
@@ -1387,8 +1388,10 @@ This command shares argument histories with \\[rgrep] 
and \\[grep]."
   "A wrapper around `vc-do-command' for use in vc-git.el.
 The difference to vc-do-command is that this function always invokes
 `vc-git-program'."
-  (let ((coding-system-for-read vc-git-commits-coding-system)
-       (coding-system-for-write vc-git-commits-coding-system))
+  (let ((coding-system-for-read
+         (or coding-system-for-read vc-git-commits-coding-system))
+       (coding-system-for-write
+         (or coding-system-for-write vc-git-commits-coding-system)))
     (apply 'vc-do-command (or buffer "*vc*") okstatus vc-git-program
           ;; http://debbugs.gnu.org/16897
           (unless (and (not (cdr-safe file-or-list))
diff --git a/lisp/xwidget.el b/lisp/xwidget.el
index cd8ec0e..19f631f 100644
--- a/lisp/xwidget.el
+++ b/lisp/xwidget.el
@@ -42,7 +42,7 @@ The possible values are: `native' or `image'."
   :type '(choice (const native) (const image)))
 
 (declare-function make-xwidget "xwidget.c"
-                  (beg end type title width height arguments &optional buffer))
+                  (type title width height arguments &optional buffer))
 (declare-function xwidget-set-adjustment "xwidget.c"
                   (xwidget axis relative value))
 (declare-function xwidget-buffer "xwidget.c" (xwidget))
@@ -66,8 +66,7 @@ See `make-xwidget' for the possible TYPE values.
 The usage of optional argument ARGS depends on the xwidget.
 This returns the result of `make-xwidget'."
   (goto-char pos)
-  (let ((id (make-xwidget (point) (point)
-                          type title width height args)))
+  (let ((id (make-xwidget type title width height args)))
     (put-text-property (point) (+ 1 (point))
                        'display (list 'xwidget ':xwidget id))
     id))
@@ -454,7 +453,7 @@ For example, use this to display an anchor."
     (setq xwidget-webkit-last-session-buffer (switch-to-buffer
                                               (get-buffer-create bufname)))
     (insert " 'a' adjusts the xwidget size.")
-    (setq xw (xwidget-insert 1 'webkit-osr  bufname 1000 1000))
+    (setq xw (xwidget-insert 1 'webkit  bufname 1000 1000))
     (xwidget-put xw 'callback 'xwidget-webkit-callback)
     (xwidget-webkit-mode)
     (xwidget-webkit-goto-uri (xwidget-webkit-last-session) url)))
diff --git a/src/term.c b/src/term.c
index a77e572..4397210 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1676,6 +1676,7 @@ append_composite_glyph (struct it *it)
          glyph = it->glyph_row->glyphs[it->area];
        }
       glyph->type = COMPOSITE_GLYPH;
+      eassert (it->pixel_width <= SHRT_MAX);
       glyph->pixel_width = it->pixel_width;
       glyph->u.cmp.id = it->cmp_it.id;
       if (it->cmp_it.ch < 0)
diff --git a/src/xdisp.c b/src/xdisp.c
index 11b20f9..457f28a 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -25792,6 +25792,7 @@ append_glyph (struct it *it)
       glyph->object = it->object;
       if (it->pixel_width > 0)
        {
+         eassert (it->pixel_width <= SHRT_MAX);
          glyph->pixel_width = it->pixel_width;
          glyph->padding_p = false;
        }
@@ -25872,6 +25873,7 @@ append_composite_glyph (struct it *it)
        }
       glyph->charpos = it->cmp_it.charpos;
       glyph->object = it->object;
+      eassert (it->pixel_width <= SHRT_MAX);
       glyph->pixel_width = it->pixel_width;
       glyph->ascent = it->ascent;
       glyph->descent = it->descent;
@@ -26081,7 +26083,7 @@ produce_image_glyph (struct it *it)
        {
          glyph->charpos = CHARPOS (it->position);
          glyph->object = it->object;
-         glyph->pixel_width = it->pixel_width;
+         glyph->pixel_width = clip_to_bounds (-1, it->pixel_width, SHRT_MAX);
          glyph->ascent = glyph_ascent;
          glyph->descent = it->descent;
          glyph->voffset = it->voffset;
@@ -26185,7 +26187,7 @@ produce_xwidget_glyph (struct it *it)
        {
          glyph->charpos = CHARPOS (it->position);
          glyph->object = it->object;
-         glyph->pixel_width = it->pixel_width;
+         glyph->pixel_width = clip_to_bounds (-1, it->pixel_width, SHRT_MAX);
          glyph->ascent = glyph_ascent;
          glyph->descent = it->descent;
          glyph->voffset = it->voffset;
@@ -26271,7 +26273,9 @@ append_stretch_glyph (struct it *it, Lisp_Object object,
        }
       glyph->charpos = CHARPOS (it->position);
       glyph->object = object;
-      glyph->pixel_width = width;
+      /* FIXME: It would be better to use TYPE_MAX here, but
+        __typeof__ is not portable enough...  */
+      glyph->pixel_width = clip_to_bounds (-1, width, SHRT_MAX);
       glyph->ascent = ascent;
       glyph->descent = height - ascent;
       glyph->voffset = it->voffset;
@@ -26722,6 +26726,7 @@ append_glyphless_glyph (struct it *it, int face_id, 
bool for_no_font, int len,
        }
       glyph->charpos = CHARPOS (it->position);
       glyph->object = it->object;
+      eassert (it->pixel_width <= SHRT_MAX);
       glyph->pixel_width = it->pixel_width;
       glyph->ascent = it->ascent;
       glyph->descent = it->descent;
diff --git a/src/xwidget.c b/src/xwidget.c
index c24475f..8ff4c23 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -156,27 +156,23 @@ webkit_navigation_policy_decision_requested_cb 
(WebKitWebView *,
 
 DEFUN ("make-xwidget",
        Fmake_xwidget, Smake_xwidget,
-       7, 8, 0,
-       doc: /* Make an xwidget from BEG to END of TYPE.
+       5, 6, 0,
+       doc: /* Make an xwidget of TYPE.
 If BUFFER is nil, use the current buffer.
 If BUFFER is a string and no such buffer exists, create it.
 TYPE is a symbol which can take one of the following values:
 
-- webkit-osr
+- webkit
 
 Returns the newly constructed xwidget, or nil if construction fails.  */)
-  (Lisp_Object beg, Lisp_Object end, Lisp_Object type,
+  (Lisp_Object type,
    Lisp_Object title, Lisp_Object width, Lisp_Object height,
    Lisp_Object arguments, Lisp_Object buffer)
 {
   CHECK_SYMBOL (type);
   CHECK_NATNUM (width);
   CHECK_NATNUM (height);
-  /* This should work a bit like "make-button"
-     (make-button BEG END &rest PROPERTIES)
-     TYPE etc. should be keyword args eventually.
-     (make-xwidget 3 3 'button "oei" 31 31 nil)
-     (xwidget-info (car xwidget-list))  */
+
   struct xwidget *xw = allocate_xwidget ();
   Lisp_Object val;
   xw->type = type;
@@ -191,7 +187,7 @@ Returns the newly constructed xwidget, or nil if 
construction fails.  */)
   xw->widget_osr = NULL;
   xw->plist = Qnil;
 
-  if (EQ (xw->type, Qwebkit_osr))
+  if (EQ (xw->type, Qwebkit))
     {
       block_input ();
       xw->widgetwindow_osr = gtk_offscreen_window_new ();
@@ -201,7 +197,7 @@ Returns the newly constructed xwidget, or nil if 
construction fails.  */)
       /* WebKit OSR is the only scrolled component at the moment.  */
       xw->widgetscrolledwindow_osr = NULL;
 
-      if (EQ (xw->type, Qwebkit_osr))
+      if (EQ (xw->type, Qwebkit))
         {
           xw->widgetscrolledwindow_osr = gtk_scrolled_window_new (NULL, NULL);
           gtk_scrolled_window_set_min_content_height
@@ -222,7 +218,7 @@ Returns the newly constructed xwidget, or nil if 
construction fails.  */)
       gtk_widget_set_size_request (GTK_WIDGET (xw->widget_osr), xw->width,
                                    xw->height);
 
-      if (EQ (xw->type, Qwebkit_osr))
+      if (EQ (xw->type, Qwebkit))
         {
           gtk_container_add (GTK_CONTAINER (xw->widgetwindow_osr),
                              xw->widgetscrolledwindow_osr);
@@ -243,7 +239,7 @@ Returns the newly constructed xwidget, or nil if 
construction fails.  */)
       g_object_set_data (G_OBJECT (xw->widgetwindow_osr), XG_XWIDGET, xw);
 
       /* signals */
-      if (EQ (xw->type, Qwebkit_osr))
+      if (EQ (xw->type, Qwebkit))
         {
           g_signal_connect (G_OBJECT (xw->widget_osr),
                             "document-load-finished",
@@ -501,7 +497,7 @@ xwidget_init_view (struct xwidget *xww,
   XSETWINDOW (xv->w, s->w);
   XSETXWIDGET (xv->model, xww);
 
-  if (EQ (xww->type, Qwebkit_osr))
+  if (EQ (xww->type, Qwebkit))
     {
       xv->widget = gtk_drawing_area_new ();
       /* Expose event handling.  */
@@ -512,7 +508,7 @@ xwidget_init_view (struct xwidget *xww,
       g_signal_connect (G_OBJECT (xww->widgetwindow_osr), "damage-event",
                         G_CALLBACK (offscreen_damage_event), xv->widget);
 
-      if (EQ (xww->type, Qwebkit_osr))
+      if (EQ (xww->type, Qwebkit))
         {
           g_signal_connect (G_OBJECT (xv->widget), "button-press-event",
                             G_CALLBACK (xwidget_osr_event_forward), NULL);
@@ -987,7 +983,7 @@ syms_of_xwidget (void)
   defsubr (&Sxwidget_webkit_goto_uri);
   defsubr (&Sxwidget_webkit_execute_script);
   defsubr (&Sxwidget_webkit_get_title);
-  DEFSYM (Qwebkit_osr, "webkit-osr");
+  DEFSYM (Qwebkit, "webkit");
 
   defsubr (&Sxwidget_size_request);
   defsubr (&Sdelete_xwidget_view);
diff --git a/test/manual/indent/js.js b/test/manual/indent/js.js
index d843f61..61c7b44 100644
--- a/test/manual/indent/js.js
+++ b/test/manual/indent/js.js
@@ -95,6 +95,12 @@ Foobar
     console.log(num);
   });
 
+var arr = [
+  -1, 2,
+  -3, 4 +
+    -5
+];
+
 // Local Variables:
 // indent-tabs-mode: nil
 // js-indent-level: 2



reply via email to

[Prev in Thread] Current Thread [Next in Thread]