aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Belaïche2017-07-13 23:25:34 +0200
committerVincent Belaïche2017-07-13 23:25:34 +0200
commitab87dbad1d26fba4e33b62b4b5a840be77ae9aa5 (patch)
treeed0f2173d1cc363246db44102b52c78a5c75e952
parentb048351a0f01124b770d6584c3797fde67e30793 (diff)
parent7eef16a923fa54ec0a88e00e75176a844dbd2944 (diff)
downloademacs-ab87dbad1d26fba4e33b62b4b5a840be77ae9aa5.tar.gz
emacs-ab87dbad1d26fba4e33b62b4b5a840be77ae9aa5.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
-rw-r--r--etc/NEWS2
-rw-r--r--lisp/cus-start.el2
-rw-r--r--lisp/frame.el2
-rw-r--r--lisp/progmodes/cc-cmds.el27
-rw-r--r--lisp/progmodes/cc-defs.el12
-rw-r--r--lisp/progmodes/cc-engine.el9
-rw-r--r--lisp/progmodes/cc-mode.el66
-rw-r--r--src/xdisp.c39
-rw-r--r--test/Makefile.in6
-rw-r--r--test/lisp/net/tramp-tests.el6
10 files changed, 104 insertions, 67 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 68ebdb3c15c..71a2da1b637 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -442,7 +442,7 @@ new face 'line-number-current-line' can be customized to display the
442current line's number differently from all the other line numbers; by 442current line's number differently from all the other line numbers; by
443default these two faces are identical. 443default these two faces are identical.
444 444
445You can also customize the new variable 'display-line-number-width' to 445You can also customize the new variable 'display-line-numbers-width' to
446specify a fixed minimal with of the area allocated to line-number 446specify a fixed minimal with of the area allocated to line-number
447display. The default is nil, meaning that Emacs will dynamically 447display. The default is nil, meaning that Emacs will dynamically
448calculate the area width, enlarging or shrinking it as needed. 448calculate the area width, enlarging or shrinking it as needed.
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index e0290395ade..ed913e32688 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -594,7 +594,7 @@ since it could result in memory overflow and make Emacs crash."
594 (const :tag "Visually relative line numbers" 594 (const :tag "Visually relative line numbers"
595 :value visual)) 595 :value visual))
596 "26.1") 596 "26.1")
597 (display-line-number-width display 597 (display-line-numbers-width display
598 (choice 598 (choice
599 (const :tag "Dynamically computed" 599 (const :tag "Dynamically computed"
600 :value nil) 600 :value nil)
diff --git a/lisp/frame.el b/lisp/frame.el
index 0e9f38589f9..7d571791e23 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -2473,7 +2473,7 @@ See also `toggle-frame-maximized'."
2473 wrap-prefix 2473 wrap-prefix
2474 truncate-lines 2474 truncate-lines
2475 display-line-numbers 2475 display-line-numbers
2476 display-line-number-width 2476 display-line-numbers-width
2477 display-line-numbers-current-absolute 2477 display-line-numbers-current-absolute
2478 display-line-numbers-widen 2478 display-line-numbers-widen
2479 bidi-paragraph-direction 2479 bidi-paragraph-direction
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 121ba24f090..dec59c58090 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -1843,19 +1843,25 @@ with a brace block."
1843 (unless (eq where 'at-header) 1843 (unless (eq where 'at-header)
1844 (c-backward-to-nth-BOF-{ 1 where) 1844 (c-backward-to-nth-BOF-{ 1 where)
1845 (c-beginning-of-decl-1)) 1845 (c-beginning-of-decl-1))
1846 (when (looking-at c-typedef-key)
1847 (goto-char (match-end 0))
1848 (c-forward-syntactic-ws))
1846 1849
1847 ;; Pick out the defun name, according to the type of defun. 1850 ;; Pick out the defun name, according to the type of defun.
1848 (cond 1851 (cond
1849 ;; struct, union, enum, or similar: 1852 ;; struct, union, enum, or similar:
1850 ((and (looking-at c-type-prefix-key) 1853 ((looking-at c-type-prefix-key)
1851 (progn (c-forward-token-2 2) ; over "struct foo " 1854 (let ((key-pos (point)))
1852 (or (eq (char-after) ?\{) 1855 (c-forward-token-2 1) ; over "struct ".
1853 (looking-at c-symbol-key)))) ; "struct foo bar ..." 1856 (cond
1854 (save-match-data (c-forward-token-2)) 1857 ((looking-at c-symbol-key) ; "struct foo { ..."
1855 (when (eq (char-after) ?\{) 1858 (buffer-substring-no-properties key-pos (match-end 0)))
1856 (c-backward-token-2) 1859 ((eq (char-after) ?{) ; "struct { ... } foo"
1857 (looking-at c-symbol-key)) 1860 (when (c-go-list-forward)
1858 (match-string-no-properties 0)) 1861 (c-forward-syntactic-ws)
1862 (when (looking-at c-symbol-key) ; a bit bogus - there might
1863 ; be several identifiers.
1864 (match-string-no-properties 0)))))))
1859 1865
1860 ((looking-at "DEFUN\\s-*(") ;"DEFUN\\_>") think of XEmacs! 1866 ((looking-at "DEFUN\\s-*(") ;"DEFUN\\_>") think of XEmacs!
1861 ;; DEFUN ("file-name-directory", Ffile_name_directory, Sfile_name_directory, ...) ==> Ffile_name_directory 1867 ;; DEFUN ("file-name-directory", Ffile_name_directory, Sfile_name_directory, ...) ==> Ffile_name_directory
@@ -1900,7 +1906,8 @@ with a brace block."
1900 (c-backward-syntactic-ws)) 1906 (c-backward-syntactic-ws))
1901 (setq name-end (point)) 1907 (setq name-end (point))
1902 (c-back-over-compound-identifier) 1908 (c-back-over-compound-identifier)
1903 (buffer-substring-no-properties (point) name-end))))))))) 1909 (and (looking-at c-symbol-start)
1910 (buffer-substring-no-properties (point) name-end))))))))))
1904 1911
1905(defun c-declaration-limits (near) 1912(defun c-declaration-limits (near)
1906 ;; Return a cons of the beginning and end positions of the current 1913 ;; Return a cons of the beginning and end positions of the current
diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index eb7bde0f767..ab910ab7dec 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -417,6 +417,17 @@ to it is returned. This function does not modify the point or the mark."
417 ;; Emacs. 417 ;; Emacs.
418 `(setq mark-active ,activate))) 418 `(setq mark-active ,activate)))
419 419
420(defmacro c-set-keymap-parent (map parent)
421 (cond
422 ;; XEmacs
423 ((cc-bytecomp-fboundp 'set-keymap-parents)
424 `(set-keymap-parents ,map ,parent))
425 ;; Emacs
426 ((cc-bytecomp-fboundp 'set-keymap-parent)
427 `(set-keymap-parent ,map ,parent))
428 ;; incompatible
429 (t (error "CC Mode is incompatible with this version of Emacs"))))
430
420(defmacro c-delete-and-extract-region (start end) 431(defmacro c-delete-and-extract-region (start end)
421 "Delete the text between START and END and return it." 432 "Delete the text between START and END and return it."
422 (if (cc-bytecomp-fboundp 'delete-and-extract-region) 433 (if (cc-bytecomp-fboundp 'delete-and-extract-region)
@@ -1266,6 +1277,7 @@ with value CHAR in the region [FROM to)."
1266(def-edebug-spec cc-eval-when-compile (&rest def-form)) 1277(def-edebug-spec cc-eval-when-compile (&rest def-form))
1267(def-edebug-spec c-point t) 1278(def-edebug-spec c-point t)
1268(def-edebug-spec c-set-region-active t) 1279(def-edebug-spec c-set-region-active t)
1280(def-edebug-spec c-set-keymap-parent t)
1269(def-edebug-spec c-safe t) 1281(def-edebug-spec c-safe t)
1270(def-edebug-spec c-save-buffer-state let*) 1282(def-edebug-spec c-save-buffer-state let*)
1271(def-edebug-spec c-tentative-buffer-changes t) 1283(def-edebug-spec c-tentative-buffer-changes t)
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index e880bd39321..22f5b906e4e 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -6091,6 +6091,13 @@ comment at the start of cc-engine.el for more info."
6091 ;; Clears `c-found-types'. 6091 ;; Clears `c-found-types'.
6092 (setq c-found-types (make-vector 53 0))) 6092 (setq c-found-types (make-vector 53 0)))
6093 6093
6094(defun c-copy-found-types ()
6095 (let ((copy (make-vector 53 0)))
6096 (mapatoms (lambda (sym)
6097 (intern (symbol-name sym) copy))
6098 c-found-types)
6099 copy))
6100
6094(defun c-add-type (from to) 6101(defun c-add-type (from to)
6095 ;; Add the given region as a type in `c-found-types'. If the region 6102 ;; Add the given region as a type in `c-found-types'. If the region
6096 ;; doesn't match an existing type but there is a type which is equal 6103 ;; doesn't match an existing type but there is a type which is equal
@@ -7059,6 +7066,7 @@ comment at the start of cc-engine.el for more info."
7059 ;; This function might do hidden buffer changes. 7066 ;; This function might do hidden buffer changes.
7060 7067
7061 (let ((start (point)) 7068 (let ((start (point))
7069 (old-found-types (c-copy-found-types))
7062 ;; If `c-record-type-identifiers' is set then activate 7070 ;; If `c-record-type-identifiers' is set then activate
7063 ;; recording of any found types that constitute an argument in 7071 ;; recording of any found types that constitute an argument in
7064 ;; the arglist. 7072 ;; the arglist.
@@ -7074,6 +7082,7 @@ comment at the start of cc-engine.el for more info."
7074 (nconc c-record-found-types c-record-type-identifiers))) 7082 (nconc c-record-found-types c-record-type-identifiers)))
7075 t) 7083 t)
7076 7084
7085 (setq c-found-types old-found-types)
7077 (goto-char start) 7086 (goto-char start)
7078 nil))) 7087 nil)))
7079 7088
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 9b89681c3bf..bf0439ffe8a 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -225,18 +225,7 @@ control). See \"cc-mode.el\" for more info."
225 225
226(defun c-make-inherited-keymap () 226(defun c-make-inherited-keymap ()
227 (let ((map (make-sparse-keymap))) 227 (let ((map (make-sparse-keymap)))
228 ;; Necessary to use `cc-bytecomp-fboundp' below since this 228 (c-set-keymap-parent map c-mode-base-map)
229 ;; function is called from top-level forms that are evaluated
230 ;; while cc-bytecomp is active when one does M-x eval-buffer.
231 (cond
232 ;; Emacs
233 ((cc-bytecomp-fboundp 'set-keymap-parent)
234 (set-keymap-parent map c-mode-base-map))
235 ;; XEmacs
236 ((fboundp 'set-keymap-parents)
237 (set-keymap-parents map c-mode-base-map))
238 ;; incompatible
239 (t (error "CC Mode is incompatible with this version of Emacs")))
240 map)) 229 map))
241 230
242(defun c-define-abbrev-table (name defs &optional doc) 231(defun c-define-abbrev-table (name defs &optional doc)
@@ -276,6 +265,8 @@ control). See \"cc-mode.el\" for more info."
276 nil 265 nil
277 266
278 (setq c-mode-base-map (make-sparse-keymap)) 267 (setq c-mode-base-map (make-sparse-keymap))
268 (when (boundp 'prog-mode-map)
269 (c-set-keymap-parent c-mode-base-map prog-mode-map))
279 270
280 ;; Separate M-BS from C-M-h. The former should remain 271 ;; Separate M-BS from C-M-h. The former should remain
281 ;; backward-kill-word. 272 ;; backward-kill-word.
@@ -446,27 +437,36 @@ preferably use the `c-mode-menu' language constant directly."
446 t)))) 437 t))))
447 438
448(defun c-unfind-coalesced-tokens (beg end) 439(defun c-unfind-coalesced-tokens (beg end)
449 ;; unless the non-empty region (beg end) is entirely WS and there's at 440 ;; If removing the region (beg end) would coalesce an identifier ending at
450 ;; least one character of WS just before or after this region, remove 441 ;; beg with an identifier (fragment) beginning at end, or an identifier
451 ;; the tokens which touch the region from `c-found-types' should they 442 ;; fragment ending at beg with an identifier beginning at end, remove the
452 ;; be present. 443 ;; pertinent identifier(s) from `c-found-types'.
453 (or (c-partial-ws-p beg end) 444 (save-excursion
454 (save-excursion 445 (when (< beg end)
455 (progn 446 (goto-char beg)
456 (goto-char beg) 447 (when
457 (or (eq beg (point-min)) 448 (and (not (bobp))
458 (c-skip-ws-backward (1- beg)) 449 (progn (c-backward-syntactic-ws) (eq (point) beg))
459 (/= (point) beg) 450 (/= (skip-chars-backward c-symbol-chars (1- (point))) 0)
460 (= (c-backward-token-2) 1) 451 (progn (goto-char beg) (c-forward-syntactic-ws) (<= (point) end))
461 (c-unfind-type (buffer-substring-no-properties 452 (> (point) beg)
462 (point) beg))) 453 (goto-char end)
463 (goto-char end) 454 (looking-at c-symbol-char-key))
464 (or (eq end (point-max)) 455 (goto-char beg)
465 (c-skip-ws-forward (1+ end)) 456 (c-simple-skip-symbol-backward)
466 (/= (point) end) 457 (c-unfind-type (buffer-substring-no-properties (point) beg)))
467 (progn (forward-char) (c-end-of-current-token) nil) 458
468 (c-unfind-type (buffer-substring-no-properties 459 (goto-char end)
469 end (point)))))))) 460 (when
461 (and (not (eobp))
462 (progn (c-forward-syntactic-ws) (eq (point) end))
463 (looking-at c-symbol-char-key)
464 (progn (c-backward-syntactic-ws) (>= (point) beg))
465 (< (point) end)
466 (/= (skip-chars-backward c-symbol-chars (1- (point))) 0))
467 (goto-char (1+ end))
468 (c-end-of-current-token)
469 (c-unfind-type (buffer-substring-no-properties end (point)))))))
470 470
471;; c-maybe-stale-found-type records a place near the region being 471;; c-maybe-stale-found-type records a place near the region being
472;; changed where an element of `found-types' might become stale. It 472;; changed where an element of `found-types' might become stale. It
diff --git a/src/xdisp.c b/src/xdisp.c
index 91e9d8abcee..6b0532d95f5 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -20904,8 +20904,8 @@ maybe_produce_line_number (struct it *it)
20904 /* Compute the required width if needed. */ 20904 /* Compute the required width if needed. */
20905 if (!it->lnum_width) 20905 if (!it->lnum_width)
20906 { 20906 {
20907 if (NATNUMP (Vdisplay_line_number_width)) 20907 if (NATNUMP (Vdisplay_line_numbers_width))
20908 it->lnum_width = XFASTINT (Vdisplay_line_number_width); 20908 it->lnum_width = XFASTINT (Vdisplay_line_numbers_width);
20909 20909
20910 /* Max line number to be displayed cannot be more than the one 20910 /* Max line number to be displayed cannot be more than the one
20911 corresponding to the last row of the desired matrix. */ 20911 corresponding to the last row of the desired matrix. */
@@ -32686,35 +32686,38 @@ To add a prefix to continuation lines, use `wrap-prefix'. */);
32686 32686
32687 DEFVAR_LISP ("display-line-numbers", Vdisplay_line_numbers, 32687 DEFVAR_LISP ("display-line-numbers", Vdisplay_line_numbers,
32688 doc: /* Non-nil means display line numbers. 32688 doc: /* Non-nil means display line numbers.
32689If the value is t, display absolute line numbers starting at the 32689If the value is t, display the absolute number of each line of a buffer
32690beginning of the current narrowing, or at buffer beginning. 32690shown in a window. Absolute line numbers count from the beginning of
32691If the value is `relative', display line numbers relative to the 32691the current narrowing, or from buffer beginning. If the value is
32692line showing point. 32692`relative', display for each line not containing the window's point its
32693The value `visual' countse lative screen lines rather than 32693relative number instead, i.e. the number of the line relative to the
32694physical line: by default, line numbers are displayed before each 32694line showing the window's point.
32695non-continuation line that displays buffer text, i.e. after each 32695
32696newline that came from buffer text. However, if the value is `visual', 32696In either case, line numbers are displayed at the beginning of each
32697every screen line will have a number. 32697non-continuation line that displays buffer text, i.e. after each newline
32698character that comes from the buffer. The value `visual' is like
32699`relative' but counts screen lines instead of buffer lines. In practice
32700this means that continuation lines count as well when calculating the
32701relative number of a line.
32698 32702
32699Lisp programs can disable display of a line number of a particular 32703Lisp programs can disable display of a line number of a particular
32700screen line by putting the `display-line-numbers-disable' text 32704buffer line by putting the `display-line-numbers-disable' text property
32701property or overlay property on the first visible character of 32705or overlay property on the first visible character of that line. */);
32702that line. */);
32703 Vdisplay_line_numbers = Qnil; 32706 Vdisplay_line_numbers = Qnil;
32704 DEFSYM (Qdisplay_line_numbers, "display-line-numbers"); 32707 DEFSYM (Qdisplay_line_numbers, "display-line-numbers");
32705 Fmake_variable_buffer_local (Qdisplay_line_numbers); 32708 Fmake_variable_buffer_local (Qdisplay_line_numbers);
32706 DEFSYM (Qrelative, "relative"); 32709 DEFSYM (Qrelative, "relative");
32707 DEFSYM (Qvisual, "visual"); 32710 DEFSYM (Qvisual, "visual");
32708 32711
32709 DEFVAR_LISP ("display-line-number-width", Vdisplay_line_number_width, 32712 DEFVAR_LISP ("display-line-numbers-width", Vdisplay_line_numbers_width,
32710 doc: /* Minimum width of space reserved for line number display. 32713 doc: /* Minimum width of space reserved for line number display.
32711A positive number means reserve that many columns for line numbers, 32714A positive number means reserve that many columns for line numbers,
32712even if the actual number needs less space. 32715even if the actual number needs less space.
32713The default value of nil means compute the space dynamically. 32716The default value of nil means compute the space dynamically.
32714Any other value is treated as nil. */); 32717Any other value is treated as nil. */);
32715 Vdisplay_line_number_width = Qnil; 32718 Vdisplay_line_numbers_width = Qnil;
32716 DEFSYM (Qdisplay_line_number_width, "display-line-number-width"); 32719 DEFSYM (Qdisplay_line_numbers_width, "display-line-number-width");
32717 Fmake_variable_buffer_local (Qdisplay_line_number_width); 32720 Fmake_variable_buffer_local (Qdisplay_line_numbers_width);
32718 32721
32719 DEFVAR_LISP ("display-line-numbers-current-absolute", 32722 DEFVAR_LISP ("display-line-numbers-current-absolute",
32720 Vdisplay_line_numbers_current_absolute, 32723 Vdisplay_line_numbers_current_absolute,
diff --git a/test/Makefile.in b/test/Makefile.in
index 11373db8ca9..4e1a120d5c2 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -136,7 +136,8 @@ endif
136 $(AM_V_ELC)$(emacs) -f batch-byte-compile $< 136 $(AM_V_ELC)$(emacs) -f batch-byte-compile $<
137 137
138## Save logs, and show logs for failed tests. 138## Save logs, and show logs for failed tests.
139WRITE_LOG = > $@ 2>&1 || { STAT=$$?; cat $@; exit $$STAT; } 139WRITE_LOG = $(if $(and ${NIX_STORE}, $(findstring tramp, $@)), |& tee $@, > $@ 2>&1) \
140 || { STAT=$$?; cat $@; exit $$STAT; }
140 141
141ifeq ($(TEST_LOAD_EL), yes) 142ifeq ($(TEST_LOAD_EL), yes)
142testloadfile = $*.el 143testloadfile = $*.el
@@ -147,8 +148,7 @@ endif
147%.log: %.elc 148%.log: %.elc
148 $(AM_V_at)${MKDIR_P} $(dir $@) 149 $(AM_V_at)${MKDIR_P} $(dir $@)
149 $(AM_V_GEN)HOME=/nonexistent $(emacs) -l ert -l $(testloadfile) \ 150 $(AM_V_GEN)HOME=/nonexistent $(emacs) -l ert -l $(testloadfile) \
150 --eval "(ert-run-tests-batch-and-exit ${SELECTOR_ACTUAL})" \ 151 --eval "(ert-run-tests-batch-and-exit ${SELECTOR_ACTUAL})" ${WRITE_LOG}
151 $(if $(and ${NIX_STORE}, $(findstring tramp, $(testloadfile))), , ${WRITE_LOG})
152 152
153ifeq (@HAVE_MODULES@, yes) 153ifeq (@HAVE_MODULES@, yes)
154maybe_exclude_module_tests := 154maybe_exclude_module_tests :=
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 8001d9433a0..263e1359066 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -3787,9 +3787,15 @@ process sentinels. They shall not disturb each other."
3787 (should-not (file-attributes file)) 3787 (should-not (file-attributes file))
3788 (should (file-attributes file))) 3788 (should (file-attributes file)))
3789 ;; Send string to process. 3789 ;; Send string to process.
3790 (tramp--test-message
3791 "Trace 1 action %d %s %s" count buf (current-time-string))
3790 (process-send-string proc (format "%s\n" (buffer-name buf))) 3792 (process-send-string proc (format "%s\n" (buffer-name buf)))
3793 (tramp--test-message
3794 "Trace 2 action %d %s %s" count buf (current-time-string))
3791 (accept-process-output proc 0.1 nil 0) 3795 (accept-process-output proc 0.1 nil 0)
3792 ;; Regular operation. 3796 ;; Regular operation.
3797 (tramp--test-message
3798 "Trace 3 action %d %s %s" count buf (current-time-string))
3793 (if (= count 2) 3799 (if (= count 2)
3794 (should-not (file-attributes file)) 3800 (should-not (file-attributes file))
3795 (should (file-attributes file))) 3801 (should (file-attributes file)))