aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2016-04-03 13:39:52 -0700
committerPaul Eggert2016-04-03 13:39:52 -0700
commitb1c7207dbbc5b35aa2fa6e69a3041299e881dbb6 (patch)
tree823364dde3da94970a5ae79f7d131f127eb547f4
parentf7c5f79ca565d3ef3feeb1e0af5ca261f1bcf58a (diff)
parentb787d5501bad8036016d835faa2f90bb0904c038 (diff)
downloademacs-b1c7207dbbc5b35aa2fa6e69a3041299e881dbb6.tar.gz
emacs-b1c7207dbbc5b35aa2fa6e69a3041299e881dbb6.zip
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
-rw-r--r--doc/lispref/compile.texi25
-rw-r--r--doc/lispref/display.texi9
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/emacs-lisp/disass.el10
-rw-r--r--lisp/gnus/gmm-utils.el2
-rw-r--r--lisp/net/tramp.el20
-rw-r--r--lisp/org/org.el9
-rw-r--r--lisp/org/ox-icalendar.el3
-rw-r--r--lisp/progmodes/cc-cmds.el245
-rw-r--r--lisp/progmodes/cc-defs.el52
-rw-r--r--lisp/progmodes/cc-engine.el38
-rw-r--r--lisp/progmodes/cc-fonts.el13
-rw-r--r--lisp/progmodes/js.el24
-rw-r--r--lisp/vc/pcvs-info.el2
-rw-r--r--lisp/vc/vc-annotate.el9
-rw-r--r--lisp/vc/vc-git.el9
-rw-r--r--lisp/xwidget.el7
-rw-r--r--src/term.c1
-rw-r--r--src/xdisp.c11
-rw-r--r--src/xwidget.c28
-rw-r--r--test/manual/indent/js.js6
21 files changed, 311 insertions, 217 deletions
diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi
index f7fed5e18d2..c943a6a29c1 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
533normal use. They are: 533normal use. They are:
534 534
535@table @var 535@table @var
536@item arglist 536@item argdesc
537The list of argument symbols. 537The descriptor of the arguments. This can either be a list of
538arguments, as described in @ref{Argument List}, or an integer encoding
539the required number of arguments. In the latter case, the value of
540the descriptor specifies the minimum number of arguments in the bits
541zero to 6, and the maximum number of arguments in bits 8 to 14. If
542the argument list uses @code{&rest}, then bit 7 is set; otherwise it's
543cleared.
544
545If @var{argdesc} is a list, the arguments will be dynamically bound
546before executing the byte code. If @var{argdesc} is an integer, the
547arguments will be instead pushed onto the stack of the byte-code
548interpreter, before executing the code.
538 549
539@item byte-code 550@item byte-code
540The string containing the byte-code instructions. 551The string containing the byte-code instructions.
@@ -562,11 +573,11 @@ representation. It is the definition of the command
562@code{backward-sexp}. 573@code{backward-sexp}.
563 574
564@example 575@example
565#[(&optional arg) 576#[256
566 "^H\204^F^@@\301^P\302^H[!\207" 577 "\211\204^G^@@\300\262^A\301^A[!\207"
567 [arg 1 forward-sexp] 578 [1 forward-sexp]
568 2 579 3
569 254435 580 1793299
570 "^p"] 581 "^p"]
571@end example 582@end example
572 583
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 93c927cbe2a..1e45501482c 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
5804in a @code{display} text or overlay property (@pxref{Display 5804in a @code{display} text or overlay property (@pxref{Display
5805Property}). 5805Property}).
5806 5806
5807@defun make-xwidget beg end type title width height arguments &optional buffer 5807@defun make-xwidget type title width height arguments &optional buffer
5808This creates an xwidget object between @var{beg} and @var{end}, buffer 5808This creates and returns an xwidget object. If
5809positions in @var{buffer}, and returns the new object. If
5810@var{buffer} is omitted or @code{nil}, it defaults to the current 5809@var{buffer} is omitted or @code{nil}, it defaults to the current
5811buffer. If @var{buffer} names a buffer that doesn't exist, it will be 5810buffer. If @var{buffer} names a buffer that doesn't exist, it will be
5812created. The @var{type} identifies the type of the xwidget component, 5811created. The @var{type} identifies the type of the xwidget component,
5813it can be one of the following: 5812it can be one of the following:
5814 5813
5815@table @code 5814@table @code
5816@item webkit-osr 5815@item webkit
5817The WebKit OSR (@dfn{on-stack replacement}) component. 5816The WebKit component.
5818@end table 5817@end table
5819 5818
5820The @var{width} and @var{height} arguments specify the widget size in 5819The @var{width} and @var{height} arguments specify the widget size in
diff --git a/etc/NEWS b/etc/NEWS
index 88e101ee0f0..34f18e98562 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -2101,6 +2101,11 @@ rule. The affected functions are 'current-time-string',
2101function 'encode-time', which already accepted a simple time zone rule 2101function 'encode-time', which already accepted a simple time zone rule
2102argument, has been extended to accept all the new forms. 2102argument, has been extended to accept all the new forms.
2103 2103
2104*** Incompatible change in the third argument of 'format-time-string'.
2105Previously, any non-nil argument was interpreted as a UTC time zone.
2106This is no longer true; packages that want UTC time zone should pass t
2107as the third argument.
2108
2104*** Time-related functions now consistently accept numbers 2109*** Time-related functions now consistently accept numbers
2105(representing seconds since the epoch) and nil (representing the 2110(representing seconds since the epoch) and nil (representing the
2106current time) as well as the usual list-of-integer representation. 2111current 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 e67b0220e14..8506ed69669 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
54\(a lambda expression or a compiled-function object). 54\(a lambda expression or a compiled-function object).
55If OBJECT is not already compiled, we compile it, but do not 55If OBJECT is not already compiled, we compile it, but do not
56redefine OBJECT if it is a symbol." 56redefine OBJECT if it is a symbol."
57 (interactive (list (intern (completing-read "Disassemble function: " 57 (interactive
58 obarray 'fboundp t)) 58 (let* ((fn (function-called-at-point))
59 nil 0 t)) 59 (prompt (if fn (format "Disassemble function (default %s): " fn)
60 "Disassemble function: "))
61 (def (and fn (symbol-name fn))))
62 (list (intern (completing-read prompt obarray 'fboundp t nil nil def))
63 nil 0 t)))
60 (if (and (consp object) (not (functionp object))) 64 (if (and (consp object) (not (functionp object)))
61 (setq object `(lambda () ,object))) 65 (setq object `(lambda () ,object)))
62 (or indent (setq indent 0)) ;Default indent to zero 66 (or indent (setq indent 0)) ;Default indent to zero
diff --git a/lisp/gnus/gmm-utils.el b/lisp/gnus/gmm-utils.el
index 785a286c915..f6455cf9f1a 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. "
286 (setq st nd)) 286 (setq st nd))
287 (push (substring format-string st) rest) 287 (push (substring format-string st) rest)
288 (format-time-string (apply 'concat (nreverse rest)) time)) 288 (format-time-string (apply 'concat (nreverse rest)) time))
289 (format-time-string format-string time tz))) 289 (format-time-string format-string time t)))
290 290
291(provide 'gmm-utils) 291(provide 'gmm-utils)
292 292
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 4edca5a5998..e101c42a494 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'."
3764 (when vec (tramp-message vec 7 "locale %s" (or locale "C"))) 3764 (when vec (tramp-message vec 7 "locale %s" (or locale "C")))
3765 (or locale "C")))) 3765 (or locale "C"))))
3766 3766
3767(defun tramp-get-local-locale (&optional vec)
3768 ;; We use key nil for local connection properties.
3769 (with-tramp-connection-property nil "locale"
3770 (let ((candidates '("en_US.utf8" "C.utf8" "en_US.UTF-8"))
3771 locale)
3772 (with-temp-buffer
3773 (unless (or (memq system-type '(windows-nt))
3774 (not (zerop (tramp-call-process
3775 nil "locale" nil t nil "-a"))))
3776 (while candidates
3777 (goto-char (point-min))
3778 (if (string-match (format "^%s\r?$" (regexp-quote (car candidates)))
3779 (buffer-string))
3780 (setq locale (car candidates)
3781 candidates nil)
3782 (setq candidates (cdr candidates))))))
3783 ;; Return value.
3784 (when vec (tramp-message vec 7 "locale %s" (or locale "C")))
3785 (or locale "C"))))
3786
3767;;;###tramp-autoload 3787;;;###tramp-autoload
3768(defun tramp-check-cached-permissions (vec access) 3788(defun tramp-check-cached-permissions (vec access)
3769 "Check `file-attributes' caches for VEC. 3789 "Check `file-attributes' caches for VEC.
diff --git a/lisp/org/org.el b/lisp/org/org.el
index 6e7d54d39c0..d2b48a64e45 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -22663,7 +22663,7 @@ contains commented lines. Otherwise, comment them."
22663 "Non-nil when TIMESTAMP has a time specified." 22663 "Non-nil when TIMESTAMP has a time specified."
22664 (org-element-property :hour-start timestamp)) 22664 (org-element-property :hour-start timestamp))
22665 22665
22666(defun org-timestamp-format (timestamp format &optional end utc) 22666(defun org-timestamp-format (timestamp format &optional end zone)
22667 "Format a TIMESTAMP element into a string. 22667 "Format a TIMESTAMP element into a string.
22668 22668
22669FORMAT is a format specifier to be passed to 22669FORMAT is a format specifier to be passed to
@@ -22672,8 +22672,9 @@ FORMAT is a format specifier to be passed to
22672When optional argument END is non-nil, use end of date-range or 22672When optional argument END is non-nil, use end of date-range or
22673time-range, if possible. 22673time-range, if possible.
22674 22674
22675When optional argument UTC is non-nil, time will be expressed as 22675The optional ZONE is omitted or nil for Emacs local time, t for
22676Universal Time." 22676Universal Time, `wall' for system wall clock time, or a string as in
22677`set-time-zone-rule' for a time zone rule."
22677 (format-time-string 22678 (format-time-string
22678 format 22679 format
22679 (apply 'encode-time 22680 (apply 'encode-time
@@ -22683,7 +22684,7 @@ Universal Time."
22683 (if end '(:minute-end :hour-end :day-end :month-end :year-end) 22684 (if end '(:minute-end :hour-end :day-end :month-end :year-end)
22684 '(:minute-start :hour-start :day-start :month-start 22685 '(:minute-start :hour-start :day-start :month-start
22685 :year-start))))) 22686 :year-start)))))
22686 utc)) 22687 zone))
22687 22688
22688(defun org-timestamp-split-range (timestamp &optional end) 22689(defun org-timestamp-split-range (timestamp &optional end)
22689 "Extract a timestamp object from a date or time range. 22690 "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 0d34ba19f45..cd54d1ee8de 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'."
393 ;; Convert timestamp into internal time in order to use 393 ;; Convert timestamp into internal time in order to use
394 ;; `format-time-string' and fix any mistake (i.e. MI >= 60). 394 ;; `format-time-string' and fix any mistake (i.e. MI >= 60).
395 (encode-time 0 mi h d m y) 395 (encode-time 0 mi h d m y)
396 (or utc (and with-time-p (org-icalendar-use-UTC-date-time-p))))))) 396 (not (not (or utc (and with-time-p
397 (org-icalendar-use-UTC-date-time-p)))))))))
397 398
398(defun org-icalendar-dtstamp () 399(defun org-icalendar-dtstamp ()
399 "Return DTSTAMP property, as a string." 400 "Return DTSTAMP property, as a string."
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 764f44a8dd8..59f2729c43d 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -1594,70 +1594,69 @@ defun."
1594 (c-region-is-active-p) 1594 (c-region-is-active-p)
1595 (push-mark)) 1595 (push-mark))
1596 1596
1597 (c-self-bind-state-cache ; We must not share with other users of c-state-cache. 1597 (c-save-buffer-state
1598 (c-save-buffer-state 1598 (beginning-of-defun-function
1599 (beginning-of-defun-function 1599 end-of-defun-function
1600 end-of-defun-function 1600 (start (point))
1601 (start (point)) 1601 (paren-state (c-parse-state))
1602 (paren-state (c-parse-state)) 1602 (orig-point-min (point-min)) (orig-point-max (point-max))
1603 (orig-point-min (point-min)) (orig-point-max (point-max)) 1603 lim ; Position of { which has been widened to.
1604 lim ; Position of { which has been widened to. 1604 where pos case-fold-search)
1605 where pos case-fold-search) 1605
1606 1606 (save-restriction
1607 (save-restriction 1607 (if (eq c-defun-tactic 'go-outward)
1608 (if (eq c-defun-tactic 'go-outward) 1608 (setq lim (c-widen-to-enclosing-decl-scope ; e.g. class, namespace.
1609 (setq lim (c-widen-to-enclosing-decl-scope ; e.g. class, namespace. 1609 paren-state orig-point-min orig-point-max)))
1610 paren-state orig-point-min orig-point-max))) 1610
1611 1611 ;; Move back out of any macro/comment/string we happen to be in.
1612 ;; Move back out of any macro/comment/string we happen to be in. 1612 (c-beginning-of-macro)
1613 (c-beginning-of-macro) 1613 (setq pos (c-literal-limits))
1614 (setq pos (c-literal-limits)) 1614 (if pos (goto-char (car pos)))
1615 (if pos (goto-char (car pos))) 1615
1616 1616 (setq where (c-where-wrt-brace-construct))
1617 (setq where (c-where-wrt-brace-construct)) 1617
1618 1618 (if (< arg 0)
1619 (if (< arg 0) 1619 ;; Move forward to the closing brace of a function.
1620 ;; Move forward to the closing brace of a function. 1620 (progn
1621 (progn 1621 (if (memq where '(at-function-end outwith-function))
1622 (if (memq where '(at-function-end outwith-function)) 1622 (setq arg (1+ arg)))
1623 (setq arg (1+ arg))) 1623 (if (< arg 0)
1624 (if (< arg 0) 1624 (c-while-widening-to-decl-block
1625 (c-while-widening-to-decl-block 1625 (< (setq arg (- (c-forward-to-nth-EOF-} (- arg) where))) 0)))
1626 (< (setq arg (- (c-forward-to-nth-EOF-} (- arg) where))) 0))) 1626 ;; Move forward to the next opening brace....
1627 ;; Move forward to the next opening brace.... 1627 (when (and (= arg 0)
1628 (when (and (= arg 0) 1628 (progn
1629 (progn 1629 (c-while-widening-to-decl-block
1630 (c-while-widening-to-decl-block 1630 (not (c-syntactic-re-search-forward "{" nil 'eob)))
1631 (not (c-syntactic-re-search-forward "{" nil 'eob))) 1631 (eq (char-before) ?{)))
1632 (eq (char-before) ?{))) 1632 (backward-char)
1633 (backward-char) 1633 ;; ... and backward to the function header.
1634 ;; ... and backward to the function header. 1634 (c-beginning-of-decl-1)
1635 (c-beginning-of-decl-1) 1635 t))
1636 t)) 1636
1637 1637 ;; Move backward to the opening brace of a function, making successively
1638 ;; Move backward to the opening brace of a function, making successively 1638 ;; larger portions of the buffer visible as necessary.
1639 ;; larger portions of the buffer visible as necessary. 1639 (when (> arg 0)
1640 (when (> arg 0) 1640 (c-while-widening-to-decl-block
1641 (c-while-widening-to-decl-block 1641 (> (setq arg (c-backward-to-nth-BOF-{ arg where)) 0)))
1642 (> (setq arg (c-backward-to-nth-BOF-{ arg where)) 0))) 1642
1643 1643 (when (eq arg 0)
1644 (when (eq arg 0) 1644 ;; Go backward to this function's header.
1645 ;; Go backward to this function's header. 1645 (c-beginning-of-decl-1)
1646 (c-beginning-of-decl-1) 1646
1647 1647 (setq pos (point))
1648 (setq pos (point)) 1648 ;; We're now there, modulo comments and whitespace.
1649 ;; We're now there, modulo comments and whitespace. 1649 ;; Try to be line oriented; position point at the closest
1650 ;; Try to be line oriented; position point at the closest 1650 ;; preceding boi that isn't inside a comment, but if we hit
1651 ;; preceding boi that isn't inside a comment, but if we hit 1651 ;; the previous declaration then we use the current point
1652 ;; the previous declaration then we use the current point 1652 ;; instead.
1653 ;; instead. 1653 (while (and (/= (point) (c-point 'boi))
1654 (while (and (/= (point) (c-point 'boi)) 1654 (c-backward-single-comment)))
1655 (c-backward-single-comment))) 1655 (if (/= (point) (c-point 'boi))
1656 (if (/= (point) (c-point 'boi)) 1656 (goto-char pos)))
1657 (goto-char pos))) 1657
1658 1658 (c-keep-region-active)
1659 (c-keep-region-active) 1659 (= arg 0)))))
1660 (= arg 0))))))
1661 1660
1662(defun c-forward-to-nth-EOF-} (n where) 1661(defun c-forward-to-nth-EOF-} (n where)
1663 ;; Skip to the closing brace of the Nth function after point. If 1662 ;; 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'."
1719 (c-region-is-active-p) 1718 (c-region-is-active-p)
1720 (push-mark)) 1719 (push-mark))
1721 1720
1722 (c-self-bind-state-cache ; c-state-cache's list structure must not be shared 1721 (c-save-buffer-state
1723 ; with other users. 1722 (beginning-of-defun-function
1724 (c-save-buffer-state 1723 end-of-defun-function
1725 (beginning-of-defun-function 1724 (start (point))
1726 end-of-defun-function 1725 (paren-state (c-parse-state))
1727 (start (point)) 1726 (orig-point-min (point-min)) (orig-point-max (point-max))
1728 (paren-state (c-parse-state)) 1727 lim
1729 (orig-point-min (point-min)) (orig-point-max (point-max)) 1728 where pos case-fold-search)
1730 lim
1731 where pos case-fold-search)
1732
1733 (save-restriction
1734 (if (eq c-defun-tactic 'go-outward)
1735 (setq lim (c-widen-to-enclosing-decl-scope ; e.g. class, namespace
1736 paren-state orig-point-min orig-point-max)))
1737
1738 ;; Move back out of any macro/comment/string we happen to be in.
1739 (c-beginning-of-macro)
1740 (setq pos (c-literal-limits))
1741 (if pos (goto-char (car pos)))
1742
1743 (setq where (c-where-wrt-brace-construct))
1744
1745 (if (< arg 0)
1746 ;; Move backwards to the } of a function
1747 (progn
1748 (if (memq where '(at-header outwith-function))
1749 (setq arg (1+ arg)))
1750 (if (< arg 0)
1751 (c-while-widening-to-decl-block
1752 (< (setq arg (- (c-backward-to-nth-BOF-{ (- arg) where))) 0)))
1753 (if (= arg 0)
1754 (c-while-widening-to-decl-block
1755 (progn (c-syntactic-skip-backward "^}")
1756 (not (eq (char-before) ?}))))))
1757
1758 ;; Move forward to the } of a function
1759 (if (> arg 0)
1760 (c-while-widening-to-decl-block
1761 (> (setq arg (c-forward-to-nth-EOF-} arg where)) 0))))
1762
1763 ;; Do we need to move forward from the brace to the semicolon?
1764 (when (eq arg 0)
1765 (if (c-in-function-trailer-p) ; after "}" of struct/enum, etc.
1766 (c-syntactic-re-search-forward ";"))
1767 1729
1768 (setq pos (point)) 1730 (save-restriction
1769 ;; We're there now, modulo comments and whitespace. 1731 (if (eq c-defun-tactic 'go-outward)
1770 ;; Try to be line oriented; position point after the next 1732 (setq lim (c-widen-to-enclosing-decl-scope ; e.g. class, namespace
1771 ;; newline that isn't inside a comment, but if we hit the 1733 paren-state orig-point-min orig-point-max)))
1772 ;; next declaration then we use the current point instead.
1773 (while (and (not (bolp))
1774 (not (looking-at "\\s *$"))
1775 (c-forward-single-comment)))
1776 (cond ((bolp))
1777 ((looking-at "\\s *$")
1778 (forward-line 1))
1779 (t
1780 (goto-char pos))))
1781 1734
1782 (c-keep-region-active) 1735 ;; Move back out of any macro/comment/string we happen to be in.
1783 (= arg 0))))) 1736 (c-beginning-of-macro)
1737 (setq pos (c-literal-limits))
1738 (if pos (goto-char (car pos)))
1739
1740 (setq where (c-where-wrt-brace-construct))
1741
1742 (if (< arg 0)
1743 ;; Move backwards to the } of a function
1744 (progn
1745 (if (memq where '(at-header outwith-function))
1746 (setq arg (1+ arg)))
1747 (if (< arg 0)
1748 (c-while-widening-to-decl-block
1749 (< (setq arg (- (c-backward-to-nth-BOF-{ (- arg) where))) 0)))
1750 (if (= arg 0)
1751 (c-while-widening-to-decl-block
1752 (progn (c-syntactic-skip-backward "^}")
1753 (not (eq (char-before) ?}))))))
1754
1755 ;; Move forward to the } of a function
1756 (if (> arg 0)
1757 (c-while-widening-to-decl-block
1758 (> (setq arg (c-forward-to-nth-EOF-} arg where)) 0))))
1759
1760 ;; Do we need to move forward from the brace to the semicolon?
1761 (when (eq arg 0)
1762 (if (c-in-function-trailer-p) ; after "}" of struct/enum, etc.
1763 (c-syntactic-re-search-forward ";"))
1764
1765 (setq pos (point))
1766 ;; We're there now, modulo comments and whitespace.
1767 ;; Try to be line oriented; position point after the next
1768 ;; newline that isn't inside a comment, but if we hit the
1769 ;; next declaration then we use the current point instead.
1770 (while (and (not (bolp))
1771 (not (looking-at "\\s *$"))
1772 (c-forward-single-comment)))
1773 (cond ((bolp))
1774 ((looking-at "\\s *$")
1775 (forward-line 1))
1776 (t
1777 (goto-char pos))))
1778
1779 (c-keep-region-active)
1780 (= arg 0))))
1784 1781
1785(defun c-defun-name () 1782(defun c-defun-name ()
1786 "Return the name of the current defun, or NIL if there isn't one. 1783 "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 ba15d7f13e0..64e57017174 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."
1402 (c-set-cpp-delimiters ,beg ,end))))) 1402 (c-set-cpp-delimiters ,beg ,end)))))
1403 1403
1404(defmacro c-self-bind-state-cache (&rest forms) 1404(defmacro c-self-bind-state-cache (&rest forms)
1405 ;; Bind the state cache to itself and execute the FORMS. It is assumed that no 1405 ;; Bind the state cache to itself and execute the FORMS. Return the result
1406 ;; buffer changes will happen in FORMS, and no hidden buffer changes which could 1406 ;; of the last FORM executed. It is assumed that no buffer changes will
1407 ;; affect the parsing will be made by FORMS. 1407 ;; happen in FORMS, and no hidden buffer changes which could affect the
1408 `(let ((c-state-cache (copy-tree c-state-cache)) 1408 ;; parsing will be made by FORMS.
1409 (c-state-cache-good-pos c-state-cache-good-pos) 1409 `(let* ((c-state-cache (copy-tree c-state-cache))
1410 ;(c-state-nonlit-pos-cache (copy-tree c-state-nonlit-pos-cache)) 1410 (c-state-cache-good-pos c-state-cache-good-pos)
1411 ;(c-state-nonlit-pos-cache-limit c-state-nonlit-pos-cache-limit) 1411 ;(c-state-nonlit-pos-cache (copy-tree c-state-nonlit-pos-cache))
1412 ;(c-state-semi-nonlit-pos-cache (copy-tree c-state-semi-nonlit-pos-cache)) 1412 ;(c-state-nonlit-pos-cache-limit c-state-nonlit-pos-cache-limit)
1413 ;(c-state-semi-nonlit-pos-cache-limit c-state-semi-nonlit-pos-cache) 1413 ;(c-state-semi-nonlit-pos-cache (copy-tree c-state-semi-nonlit-pos-cache))
1414 (c-state-brace-pair-desert (copy-tree c-state-brace-pair-desert)) 1414 ;(c-state-semi-nonlit-pos-cache-limit c-state-semi-nonlit-pos-cache)
1415 (c-state-point-min c-state-point-min) 1415 (c-state-brace-pair-desert (copy-tree c-state-brace-pair-desert))
1416 (c-state-point-min-lit-type c-state-point-min-lit-type) 1416 (c-state-point-min c-state-point-min)
1417 (c-state-point-min-lit-start c-state-point-min-lit-start) 1417 (c-state-point-min-lit-type c-state-point-min-lit-type)
1418 (c-state-min-scan-pos c-state-min-scan-pos) 1418 (c-state-point-min-lit-start c-state-point-min-lit-start)
1419 (c-state-old-cpp-beg c-state-old-cpp-beg) 1419 (c-state-min-scan-pos c-state-min-scan-pos)
1420 (c-state-old-cpp-end c-state-old-cpp-end)) 1420 (c-state-old-cpp-beg-marker (if (markerp c-state-old-cpp-beg-marker)
1421 ,@forms)) 1421 (copy-marker c-state-old-cpp-beg-marker)
1422 c-state-old-cpp-beg-marker))
1423 (c-state-old-cpp-beg (if (markerp c-state-old-cpp-beg)
1424 c-state-old-cpp-beg-marker
1425 c-state-old-cpp-beg))
1426 (c-state-old-cpp-end-marker (if (markerp c-state-old-cpp-end-marker)
1427 (copy-marker c-state-old-cpp-end-marker)
1428 c-state-old-cpp-end-marker))
1429 (c-state-old-cpp-end (if (markerp c-state-old-cpp-end)
1430 c-state-old-cpp-end-marker
1431 c-state-old-cpp-end))
1432 (c-parse-state-state c-parse-state-state))
1433 (prog1
1434 (progn ,@forms)
1435 (if (markerp c-state-old-cpp-beg-marker)
1436 (move-marker c-state-old-cpp-beg-marker nil))
1437 (if (markerp c-state-old-cpp-end-marker)
1438 (move-marker c-state-old-cpp-end-marker nil)))))
1422 1439
1423
1424;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1440;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1425;; The following macros are to be used only in `c-parse-state' and its 1441;; The following macros are to be used only in `c-parse-state' and its
1426;; subroutines. Their main purpose is to simplify the handling of C++/Java 1442;; 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 e04929a7226..4aff0dc14e0 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."
3501(make-variable-buffer-local 'c-parse-state-state) 3501(make-variable-buffer-local 'c-parse-state-state)
3502(defun c-record-parse-state-state () 3502(defun c-record-parse-state-state ()
3503 (setq c-parse-state-point (point)) 3503 (setq c-parse-state-point (point))
3504 (when (markerp (cdr (assq 'c-state-old-cpp-beg c-parse-state-state)))
3505 (move-marker (cdr (assq 'c-state-old-cpp-beg c-parse-state-state)) nil)
3506 (move-marker (cdr (assq 'c-state-old-cpp-end c-parse-state-state)) nil))
3504 (setq c-parse-state-state 3507 (setq c-parse-state-state
3505 (mapcar 3508 (mapcar
3506 (lambda (arg) 3509 (lambda (arg)
@@ -5841,10 +5844,11 @@ comment at the start of cc-engine.el for more info."
5841 ((and c-opt-cpp-prefix 5844 ((and c-opt-cpp-prefix
5842 (looking-at c-noise-macro-with-parens-name-re)) 5845 (looking-at c-noise-macro-with-parens-name-re))
5843 (c-forward-noise-clause))))) 5846 (c-forward-noise-clause)))))
5844 (when (memq res '(t known found prefix)) 5847 (when (memq res '(t known found prefix maybe))
5845 ,(when (eq type 'ref) 5848 (when c-record-type-identifiers
5846 `(when c-record-type-identifiers 5849 ,(if (eq type 'type)
5847 (c-record-ref-id c-last-identifier-range))) 5850 `(c-record-type-id c-last-identifier-range)
5851 `(c-record-ref-id c-last-identifier-range)))
5848 t))) 5852 t)))
5849 5853
5850(defmacro c-forward-id-comma-list (type update-safe-pos) 5854(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."
6411 (eq (char-after) ?<)) 6415 (eq (char-after) ?<))
6412 ;; Maybe an angle bracket arglist. 6416 ;; Maybe an angle bracket arglist.
6413 (when (let ((c-record-type-identifiers t) 6417 (when (let ((c-record-type-identifiers t)
6414 (c-record-found-types t)) 6418 (c-record-found-types t)
6419 (c-last-identifier-range))
6415 (c-forward-<>-arglist nil)) 6420 (c-forward-<>-arglist nil))
6416 6421
6417 (c-add-type start (1+ pos))
6418 (c-forward-syntactic-ws) 6422 (c-forward-syntactic-ws)
6419 (setq pos (point) 6423 (unless (eq (char-after) ?\()
6420 c-last-identifier-range nil) 6424 (setq c-last-identifier-range nil)
6425 (c-add-type start (1+ pos)))
6426 (setq pos (point))
6421 6427
6422 (if (and c-opt-identifier-concat-key 6428 (if (and c-opt-identifier-concat-key
6423 (looking-at c-opt-identifier-concat-key)) 6429 (looking-at c-opt-identifier-concat-key))
@@ -6431,7 +6437,8 @@ comment at the start of cc-engine.el for more info."
6431 (c-forward-syntactic-ws) 6437 (c-forward-syntactic-ws)
6432 t) 6438 t)
6433 6439
6434 (when (and c-record-type-identifiers id-start) 6440 (when (and c-record-type-identifiers id-start
6441 (not (eq (char-after) ?\()))
6435 (c-record-type-id (cons id-start id-end))) 6442 (c-record-type-id (cons id-start id-end)))
6436 (setq res 'template) 6443 (setq res 'template)
6437 nil))) 6444 nil)))
@@ -6613,9 +6620,18 @@ comment at the start of cc-engine.el for more info."
6613 ;; It's an identifier that might be a type. 6620 ;; It's an identifier that might be a type.
6614 'maybe)))) 6621 'maybe))))
6615 ((eq name-res 'template) 6622 ((eq name-res 'template)
6616 ;; A template is a type. 6623 ;; A template is sometimes a type.
6617 (goto-char id-end) 6624 (goto-char id-end)
6618 (setq res t)) 6625 (c-forward-syntactic-ws)
6626 (setq res
6627 (if (eq (char-after) ?\()
6628 (if (c-check-type id-start id-end)
6629 ;; It's an identifier that has been used as
6630 ;; a type somewhere else.
6631 'found
6632 ;; It's an identifier that might be a type.
6633 'maybe)
6634 t)))
6619 (t 6635 (t
6620 ;; Otherwise it's an operator identifier, which is not a type. 6636 ;; Otherwise it's an operator identifier, which is not a type.
6621 (goto-char start) 6637 (goto-char start)
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index 67e88a34bf9..e171b20f328 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."
914 ;; 914 ;;
915 ;; Fontify types and references in names containing angle bracket 915 ;; Fontify types and references in names containing angle bracket
916 ;; arglists from the point to LIMIT. Note that 916 ;; arglists from the point to LIMIT. Note that
917 ;; `c-font-lock-declarations' already has handled many of them. 917 ;; `c-font-lock-declarations' has already handled many of them.
918 ;; 918 ;;
919 ;; This function might do hidden buffer changes. 919 ;; This function might do hidden buffer changes.
920 920
@@ -976,11 +976,12 @@ casts and declarations are fontified. Used on level 2 and higher."
976 (when (and c-opt-identifier-concat-key 976 (when (and c-opt-identifier-concat-key
977 (not (get-text-property id-start 'face))) 977 (not (get-text-property id-start 'face)))
978 (c-forward-syntactic-ws) 978 (c-forward-syntactic-ws)
979 (if (looking-at c-opt-identifier-concat-key) 979 (cond ((looking-at c-opt-identifier-concat-key)
980 (c-put-font-lock-face id-start id-end 980 (c-put-font-lock-face id-start id-end
981 c-reference-face-name) 981 c-reference-face-name))
982 (c-put-font-lock-face id-start id-end 982 ((eq (char-after) ?\())
983 'font-lock-type-face))))) 983 (t (c-put-font-lock-face id-start id-end
984 'font-lock-type-face))))))
984 985
985 (goto-char pos))) 986 (goto-char pos)))
986 (goto-char pos))))) 987 (goto-char pos)))))
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 15a52ba8cdc..8c93ffa8731 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -1770,16 +1770,20 @@ This performs fontification according to `js--class-styles'."
1770 "Return non-nil if the current line continues an expression." 1770 "Return non-nil if the current line continues an expression."
1771 (save-excursion 1771 (save-excursion
1772 (back-to-indentation) 1772 (back-to-indentation)
1773 (or (js--looking-at-operator-p) 1773 (if (js--looking-at-operator-p)
1774 (and (js--re-search-backward "\n" nil t) 1774 (or (not (memq (char-after) '(?- ?+)))
1775 (progn 1775 (progn
1776 (skip-chars-backward " \t") 1776 (forward-comment (- (point)))
1777 (or (bobp) (backward-char)) 1777 (not (memq (char-before) '(?, ?\[ ?\()))))
1778 (and (> (point) (point-min)) 1778 (and (js--re-search-backward "\n" nil t)
1779 (save-excursion (backward-char) (not (looking-at "[/*]/"))) 1779 (progn
1780 (js--looking-at-operator-p) 1780 (skip-chars-backward " \t")
1781 (and (progn (backward-char) 1781 (or (bobp) (backward-char))
1782 (not (looking-at "+\\+\\|--\\|/[/*]")))))))))) 1782 (and (> (point) (point-min))
1783 (save-excursion (backward-char) (not (looking-at "[/*]/")))
1784 (js--looking-at-operator-p)
1785 (and (progn (backward-char)
1786 (not (looking-at "+\\+\\|--\\|/[/*]"))))))))))
1783 1787
1784 1788
1785(defun js--end-of-do-while-loop-p () 1789(defun js--end-of-do-while-loop-p ()
diff --git a/lisp/vc/pcvs-info.el b/lisp/vc/pcvs-info.el
index 1abc7729045..b9ecc892540 100644
--- a/lisp/vc/pcvs-info.el
+++ b/lisp/vc/pcvs-info.el
@@ -465,7 +465,7 @@ DIR can also be a file."
465 ((equal date "Result of merge") (setq subtype 'MERGED)) 465 ((equal date "Result of merge") (setq subtype 'MERGED))
466 ((let ((mtime (nth 5 (file-attributes (concat dir f)))) 466 ((let ((mtime (nth 5 (file-attributes (concat dir f))))
467 (system-time-locale "C")) 467 (system-time-locale "C"))
468 (setq timestamp (format-time-string "%c" mtime 'utc)) 468 (setq timestamp (format-time-string "%c" mtime t))
469 ;; Solaris sometimes uses "Wed Sep 05", not "Wed Sep 5". 469 ;; Solaris sometimes uses "Wed Sep 05", not "Wed Sep 5".
470 ;; See "grep '[^a-z_]ctime' cvs/src/*.c" for reference. 470 ;; See "grep '[^a-z_]ctime' cvs/src/*.c" for reference.
471 (if (= (aref timestamp 8) ?0) 471 (if (= (aref timestamp 8) ?0)
diff --git a/lisp/vc/vc-annotate.el b/lisp/vc/vc-annotate.el
index ed038f1d4e5..774453f8b54 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."
432 (with-output-to-temp-buffer temp-buffer-name 432 (with-output-to-temp-buffer temp-buffer-name
433 (let ((backend (or vc-bk (vc-backend file))) 433 (let ((backend (or vc-bk (vc-backend file)))
434 (coding-system-for-read buffer-file-coding-system)) 434 (coding-system-for-read buffer-file-coding-system))
435 ;; For a VC backend running on DOS/Windows, it's normal to
436 ;; produce CRLF EOLs even if the original file has Unix EOLs,
437 ;; which will show ^M characters in the Annotate buffer. (One
438 ;; known case in point is "svn annotate".) Prevent that by
439 ;; forcing DOS EOL decoding.
440 (if (memq system-type '(windows-nt ms-dos))
441 (setq coding-system-for-read
442 (coding-system-change-eol-conversion coding-system-for-read
443 'dos)))
435 (vc-call-backend backend 'annotate-command file 444 (vc-call-backend backend 'annotate-command file
436 (get-buffer temp-buffer-name) rev) 445 (get-buffer temp-buffer-name) rev)
437 ;; we must setup the mode first, and then set our local 446 ;; 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 8498cc82761..f2466d86493 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'.
853\(This requires at least Git version 1.5.6, for the --graph option.) 853\(This requires at least Git version 1.5.6, for the --graph option.)
854If START-REVISION is non-nil, it is the newest revision to show. 854If START-REVISION is non-nil, it is the newest revision to show.
855If LIMIT is non-nil, show no more than this many entries." 855If LIMIT is non-nil, show no more than this many entries."
856 (let ((coding-system-for-read vc-git-commits-coding-system)) 856 (let ((coding-system-for-read
857 (or coding-system-for-read vc-git-commits-coding-system)))
857 ;; `vc-do-command' creates the buffer, but we need it before running 858 ;; `vc-do-command' creates the buffer, but we need it before running
858 ;; the command. 859 ;; the command.
859 (vc-setup-buffer buffer) 860 (vc-setup-buffer buffer)
@@ -1387,8 +1388,10 @@ This command shares argument histories with \\[rgrep] and \\[grep]."
1387 "A wrapper around `vc-do-command' for use in vc-git.el. 1388 "A wrapper around `vc-do-command' for use in vc-git.el.
1388The difference to vc-do-command is that this function always invokes 1389The difference to vc-do-command is that this function always invokes
1389`vc-git-program'." 1390`vc-git-program'."
1390 (let ((coding-system-for-read vc-git-commits-coding-system) 1391 (let ((coding-system-for-read
1391 (coding-system-for-write vc-git-commits-coding-system)) 1392 (or coding-system-for-read vc-git-commits-coding-system))
1393 (coding-system-for-write
1394 (or coding-system-for-write vc-git-commits-coding-system)))
1392 (apply 'vc-do-command (or buffer "*vc*") okstatus vc-git-program 1395 (apply 'vc-do-command (or buffer "*vc*") okstatus vc-git-program
1393 ;; http://debbugs.gnu.org/16897 1396 ;; http://debbugs.gnu.org/16897
1394 (unless (and (not (cdr-safe file-or-list)) 1397 (unless (and (not (cdr-safe file-or-list))
diff --git a/lisp/xwidget.el b/lisp/xwidget.el
index cd8ec0ec29d..19f631f17f3 100644
--- a/lisp/xwidget.el
+++ b/lisp/xwidget.el
@@ -42,7 +42,7 @@ The possible values are: `native' or `image'."
42 :type '(choice (const native) (const image))) 42 :type '(choice (const native) (const image)))
43 43
44(declare-function make-xwidget "xwidget.c" 44(declare-function make-xwidget "xwidget.c"
45 (beg end type title width height arguments &optional buffer)) 45 (type title width height arguments &optional buffer))
46(declare-function xwidget-set-adjustment "xwidget.c" 46(declare-function xwidget-set-adjustment "xwidget.c"
47 (xwidget axis relative value)) 47 (xwidget axis relative value))
48(declare-function xwidget-buffer "xwidget.c" (xwidget)) 48(declare-function xwidget-buffer "xwidget.c" (xwidget))
@@ -66,8 +66,7 @@ See `make-xwidget' for the possible TYPE values.
66The usage of optional argument ARGS depends on the xwidget. 66The usage of optional argument ARGS depends on the xwidget.
67This returns the result of `make-xwidget'." 67This returns the result of `make-xwidget'."
68 (goto-char pos) 68 (goto-char pos)
69 (let ((id (make-xwidget (point) (point) 69 (let ((id (make-xwidget type title width height args)))
70 type title width height args)))
71 (put-text-property (point) (+ 1 (point)) 70 (put-text-property (point) (+ 1 (point))
72 'display (list 'xwidget ':xwidget id)) 71 'display (list 'xwidget ':xwidget id))
73 id)) 72 id))
@@ -454,7 +453,7 @@ For example, use this to display an anchor."
454 (setq xwidget-webkit-last-session-buffer (switch-to-buffer 453 (setq xwidget-webkit-last-session-buffer (switch-to-buffer
455 (get-buffer-create bufname))) 454 (get-buffer-create bufname)))
456 (insert " 'a' adjusts the xwidget size.") 455 (insert " 'a' adjusts the xwidget size.")
457 (setq xw (xwidget-insert 1 'webkit-osr bufname 1000 1000)) 456 (setq xw (xwidget-insert 1 'webkit bufname 1000 1000))
458 (xwidget-put xw 'callback 'xwidget-webkit-callback) 457 (xwidget-put xw 'callback 'xwidget-webkit-callback)
459 (xwidget-webkit-mode) 458 (xwidget-webkit-mode)
460 (xwidget-webkit-goto-uri (xwidget-webkit-last-session) url))) 459 (xwidget-webkit-goto-uri (xwidget-webkit-last-session) url)))
diff --git a/src/term.c b/src/term.c
index a77e5729b5b..43972109655 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1676,6 +1676,7 @@ append_composite_glyph (struct it *it)
1676 glyph = it->glyph_row->glyphs[it->area]; 1676 glyph = it->glyph_row->glyphs[it->area];
1677 } 1677 }
1678 glyph->type = COMPOSITE_GLYPH; 1678 glyph->type = COMPOSITE_GLYPH;
1679 eassert (it->pixel_width <= SHRT_MAX);
1679 glyph->pixel_width = it->pixel_width; 1680 glyph->pixel_width = it->pixel_width;
1680 glyph->u.cmp.id = it->cmp_it.id; 1681 glyph->u.cmp.id = it->cmp_it.id;
1681 if (it->cmp_it.ch < 0) 1682 if (it->cmp_it.ch < 0)
diff --git a/src/xdisp.c b/src/xdisp.c
index 11b20f99a27..457f28a3e6a 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -25792,6 +25792,7 @@ append_glyph (struct it *it)
25792 glyph->object = it->object; 25792 glyph->object = it->object;
25793 if (it->pixel_width > 0) 25793 if (it->pixel_width > 0)
25794 { 25794 {
25795 eassert (it->pixel_width <= SHRT_MAX);
25795 glyph->pixel_width = it->pixel_width; 25796 glyph->pixel_width = it->pixel_width;
25796 glyph->padding_p = false; 25797 glyph->padding_p = false;
25797 } 25798 }
@@ -25872,6 +25873,7 @@ append_composite_glyph (struct it *it)
25872 } 25873 }
25873 glyph->charpos = it->cmp_it.charpos; 25874 glyph->charpos = it->cmp_it.charpos;
25874 glyph->object = it->object; 25875 glyph->object = it->object;
25876 eassert (it->pixel_width <= SHRT_MAX);
25875 glyph->pixel_width = it->pixel_width; 25877 glyph->pixel_width = it->pixel_width;
25876 glyph->ascent = it->ascent; 25878 glyph->ascent = it->ascent;
25877 glyph->descent = it->descent; 25879 glyph->descent = it->descent;
@@ -26081,7 +26083,7 @@ produce_image_glyph (struct it *it)
26081 { 26083 {
26082 glyph->charpos = CHARPOS (it->position); 26084 glyph->charpos = CHARPOS (it->position);
26083 glyph->object = it->object; 26085 glyph->object = it->object;
26084 glyph->pixel_width = it->pixel_width; 26086 glyph->pixel_width = clip_to_bounds (-1, it->pixel_width, SHRT_MAX);
26085 glyph->ascent = glyph_ascent; 26087 glyph->ascent = glyph_ascent;
26086 glyph->descent = it->descent; 26088 glyph->descent = it->descent;
26087 glyph->voffset = it->voffset; 26089 glyph->voffset = it->voffset;
@@ -26185,7 +26187,7 @@ produce_xwidget_glyph (struct it *it)
26185 { 26187 {
26186 glyph->charpos = CHARPOS (it->position); 26188 glyph->charpos = CHARPOS (it->position);
26187 glyph->object = it->object; 26189 glyph->object = it->object;
26188 glyph->pixel_width = it->pixel_width; 26190 glyph->pixel_width = clip_to_bounds (-1, it->pixel_width, SHRT_MAX);
26189 glyph->ascent = glyph_ascent; 26191 glyph->ascent = glyph_ascent;
26190 glyph->descent = it->descent; 26192 glyph->descent = it->descent;
26191 glyph->voffset = it->voffset; 26193 glyph->voffset = it->voffset;
@@ -26271,7 +26273,9 @@ append_stretch_glyph (struct it *it, Lisp_Object object,
26271 } 26273 }
26272 glyph->charpos = CHARPOS (it->position); 26274 glyph->charpos = CHARPOS (it->position);
26273 glyph->object = object; 26275 glyph->object = object;
26274 glyph->pixel_width = width; 26276 /* FIXME: It would be better to use TYPE_MAX here, but
26277 __typeof__ is not portable enough... */
26278 glyph->pixel_width = clip_to_bounds (-1, width, SHRT_MAX);
26275 glyph->ascent = ascent; 26279 glyph->ascent = ascent;
26276 glyph->descent = height - ascent; 26280 glyph->descent = height - ascent;
26277 glyph->voffset = it->voffset; 26281 glyph->voffset = it->voffset;
@@ -26722,6 +26726,7 @@ append_glyphless_glyph (struct it *it, int face_id, bool for_no_font, int len,
26722 } 26726 }
26723 glyph->charpos = CHARPOS (it->position); 26727 glyph->charpos = CHARPOS (it->position);
26724 glyph->object = it->object; 26728 glyph->object = it->object;
26729 eassert (it->pixel_width <= SHRT_MAX);
26725 glyph->pixel_width = it->pixel_width; 26730 glyph->pixel_width = it->pixel_width;
26726 glyph->ascent = it->ascent; 26731 glyph->ascent = it->ascent;
26727 glyph->descent = it->descent; 26732 glyph->descent = it->descent;
diff --git a/src/xwidget.c b/src/xwidget.c
index c24475f5312..8ff4c23b1f2 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -156,27 +156,23 @@ webkit_navigation_policy_decision_requested_cb (WebKitWebView *,
156 156
157DEFUN ("make-xwidget", 157DEFUN ("make-xwidget",
158 Fmake_xwidget, Smake_xwidget, 158 Fmake_xwidget, Smake_xwidget,
159 7, 8, 0, 159 5, 6, 0,
160 doc: /* Make an xwidget from BEG to END of TYPE. 160 doc: /* Make an xwidget of TYPE.
161If BUFFER is nil, use the current buffer. 161If BUFFER is nil, use the current buffer.
162If BUFFER is a string and no such buffer exists, create it. 162If BUFFER is a string and no such buffer exists, create it.
163TYPE is a symbol which can take one of the following values: 163TYPE is a symbol which can take one of the following values:
164 164
165- webkit-osr 165- webkit
166 166
167Returns the newly constructed xwidget, or nil if construction fails. */) 167Returns the newly constructed xwidget, or nil if construction fails. */)
168 (Lisp_Object beg, Lisp_Object end, Lisp_Object type, 168 (Lisp_Object type,
169 Lisp_Object title, Lisp_Object width, Lisp_Object height, 169 Lisp_Object title, Lisp_Object width, Lisp_Object height,
170 Lisp_Object arguments, Lisp_Object buffer) 170 Lisp_Object arguments, Lisp_Object buffer)
171{ 171{
172 CHECK_SYMBOL (type); 172 CHECK_SYMBOL (type);
173 CHECK_NATNUM (width); 173 CHECK_NATNUM (width);
174 CHECK_NATNUM (height); 174 CHECK_NATNUM (height);
175 /* This should work a bit like "make-button" 175
176 (make-button BEG END &rest PROPERTIES)
177 TYPE etc. should be keyword args eventually.
178 (make-xwidget 3 3 'button "oei" 31 31 nil)
179 (xwidget-info (car xwidget-list)) */
180 struct xwidget *xw = allocate_xwidget (); 176 struct xwidget *xw = allocate_xwidget ();
181 Lisp_Object val; 177 Lisp_Object val;
182 xw->type = type; 178 xw->type = type;
@@ -191,7 +187,7 @@ Returns the newly constructed xwidget, or nil if construction fails. */)
191 xw->widget_osr = NULL; 187 xw->widget_osr = NULL;
192 xw->plist = Qnil; 188 xw->plist = Qnil;
193 189
194 if (EQ (xw->type, Qwebkit_osr)) 190 if (EQ (xw->type, Qwebkit))
195 { 191 {
196 block_input (); 192 block_input ();
197 xw->widgetwindow_osr = gtk_offscreen_window_new (); 193 xw->widgetwindow_osr = gtk_offscreen_window_new ();
@@ -201,7 +197,7 @@ Returns the newly constructed xwidget, or nil if construction fails. */)
201 /* WebKit OSR is the only scrolled component at the moment. */ 197 /* WebKit OSR is the only scrolled component at the moment. */
202 xw->widgetscrolledwindow_osr = NULL; 198 xw->widgetscrolledwindow_osr = NULL;
203 199
204 if (EQ (xw->type, Qwebkit_osr)) 200 if (EQ (xw->type, Qwebkit))
205 { 201 {
206 xw->widgetscrolledwindow_osr = gtk_scrolled_window_new (NULL, NULL); 202 xw->widgetscrolledwindow_osr = gtk_scrolled_window_new (NULL, NULL);
207 gtk_scrolled_window_set_min_content_height 203 gtk_scrolled_window_set_min_content_height
@@ -222,7 +218,7 @@ Returns the newly constructed xwidget, or nil if construction fails. */)
222 gtk_widget_set_size_request (GTK_WIDGET (xw->widget_osr), xw->width, 218 gtk_widget_set_size_request (GTK_WIDGET (xw->widget_osr), xw->width,
223 xw->height); 219 xw->height);
224 220
225 if (EQ (xw->type, Qwebkit_osr)) 221 if (EQ (xw->type, Qwebkit))
226 { 222 {
227 gtk_container_add (GTK_CONTAINER (xw->widgetwindow_osr), 223 gtk_container_add (GTK_CONTAINER (xw->widgetwindow_osr),
228 xw->widgetscrolledwindow_osr); 224 xw->widgetscrolledwindow_osr);
@@ -243,7 +239,7 @@ Returns the newly constructed xwidget, or nil if construction fails. */)
243 g_object_set_data (G_OBJECT (xw->widgetwindow_osr), XG_XWIDGET, xw); 239 g_object_set_data (G_OBJECT (xw->widgetwindow_osr), XG_XWIDGET, xw);
244 240
245 /* signals */ 241 /* signals */
246 if (EQ (xw->type, Qwebkit_osr)) 242 if (EQ (xw->type, Qwebkit))
247 { 243 {
248 g_signal_connect (G_OBJECT (xw->widget_osr), 244 g_signal_connect (G_OBJECT (xw->widget_osr),
249 "document-load-finished", 245 "document-load-finished",
@@ -501,7 +497,7 @@ xwidget_init_view (struct xwidget *xww,
501 XSETWINDOW (xv->w, s->w); 497 XSETWINDOW (xv->w, s->w);
502 XSETXWIDGET (xv->model, xww); 498 XSETXWIDGET (xv->model, xww);
503 499
504 if (EQ (xww->type, Qwebkit_osr)) 500 if (EQ (xww->type, Qwebkit))
505 { 501 {
506 xv->widget = gtk_drawing_area_new (); 502 xv->widget = gtk_drawing_area_new ();
507 /* Expose event handling. */ 503 /* Expose event handling. */
@@ -512,7 +508,7 @@ xwidget_init_view (struct xwidget *xww,
512 g_signal_connect (G_OBJECT (xww->widgetwindow_osr), "damage-event", 508 g_signal_connect (G_OBJECT (xww->widgetwindow_osr), "damage-event",
513 G_CALLBACK (offscreen_damage_event), xv->widget); 509 G_CALLBACK (offscreen_damage_event), xv->widget);
514 510
515 if (EQ (xww->type, Qwebkit_osr)) 511 if (EQ (xww->type, Qwebkit))
516 { 512 {
517 g_signal_connect (G_OBJECT (xv->widget), "button-press-event", 513 g_signal_connect (G_OBJECT (xv->widget), "button-press-event",
518 G_CALLBACK (xwidget_osr_event_forward), NULL); 514 G_CALLBACK (xwidget_osr_event_forward), NULL);
@@ -987,7 +983,7 @@ syms_of_xwidget (void)
987 defsubr (&Sxwidget_webkit_goto_uri); 983 defsubr (&Sxwidget_webkit_goto_uri);
988 defsubr (&Sxwidget_webkit_execute_script); 984 defsubr (&Sxwidget_webkit_execute_script);
989 defsubr (&Sxwidget_webkit_get_title); 985 defsubr (&Sxwidget_webkit_get_title);
990 DEFSYM (Qwebkit_osr, "webkit-osr"); 986 DEFSYM (Qwebkit, "webkit");
991 987
992 defsubr (&Sxwidget_size_request); 988 defsubr (&Sxwidget_size_request);
993 defsubr (&Sdelete_xwidget_view); 989 defsubr (&Sdelete_xwidget_view);
diff --git a/test/manual/indent/js.js b/test/manual/indent/js.js
index d843f615fd8..61c7b440ea3 100644
--- a/test/manual/indent/js.js
+++ b/test/manual/indent/js.js
@@ -95,6 +95,12 @@ Foobar
95 console.log(num); 95 console.log(num);
96 }); 96 });
97 97
98var arr = [
99 -1, 2,
100 -3, 4 +
101 -5
102];
103
98// Local Variables: 104// Local Variables:
99// indent-tabs-mode: nil 105// indent-tabs-mode: nil
100// js-indent-level: 2 106// js-indent-level: 2