commit 1e34d7579c21b96235ba1a06d97cfae0a5d3f2eb (HEAD, refs/remotes/origin/master) Author: Martin Rudalics Date: Tue Dec 11 08:56:15 2018 +0100 Fix typo in 'dired-restore-positions' * lisp/dired.el (dired-restore-positions): Fix typo in last change fixing Bug#33458. diff --git a/lisp/dired.el b/lisp/dired.el index e5dc8623a4..72725dc8a0 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1530,7 +1530,7 @@ change; the point does." ;; Sanity check of the point marker. (when (and (markerp point) (eq (marker-buffer point) buffer)) - (unless (and (nth 0 prev) + (unless (and (nth 1 prev) (dired-goto-file (nth 1 prev))) (goto-char (point-min)) (forward-line (1- (nth 2 prev)))) commit 7f95e1aec3014f32366129bcbf61675ab858f053 Author: Glenn Morris Date: Mon Dec 10 20:40:16 2018 -0500 Add test/Makefile machinery to exclude test .el files * test/Makefile.in (EXCLUDE_TESTS): New variable. (ELFILES): Filter out any specified exclude files. diff --git a/test/Makefile.in b/test/Makefile.in index adb316c3d9..4548323f26 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -190,6 +190,12 @@ else maybe_exclude_module_tests := -name emacs-module-tests.el -prune -o endif +## Optional list of .el files to exclude from testing. +## Intended for use in automated testing where one or more files +## has some problem and needs to be excluded. +## To avoid writing full name, can use eg %foo-tests.el. +EXCLUDE_TESTS = + ## To speed up parallel builds, put these slow test files (which can ## take longer than all the rest combined) at the start of the list. SLOW_TESTS = ${srcdir}/lisp/net/tramp-tests.el @@ -202,6 +208,8 @@ ELFILES := $(sort $(shell find ${srcdir} -path "${srcdir}/manual" -prune -o \ $(foreach slow,${SLOW_TESTS},$(eval ELFILES:= ${slow} $(filter-out ${slow},${ELFILES}))) +$(foreach exclude,${EXCLUDE_TESTS},$(eval ELFILES:= $(filter-out ${exclude},${ELFILES}))) + ## .log files may be in a different directory for out of source builds LOGFILES := $(patsubst %.el,%.log, \ $(patsubst $(srcdir)/%,%,$(ELFILES))) commit 3729a3f88fd7ce1d8a1a7f2ea61e8c4d05e954ab Author: Nobuyoshi Nakada Date: Tue Dec 11 03:12:46 2018 +0200 Support Ruby block arguments ending with , or * * lisp/progmodes/ruby-mode.el (ruby-smie--forward-token): Recognize punctuation before "closing-|" as a separate token. (ruby-smie--backward-token): Same (bug#33487). * test/lisp/progmodes/ruby-mode-tests.el (ruby-forward-sexp-jumps-do-end-block-with-no-args) (ruby-backward-sexp-jumps-do-end-block-with-no-args) (ruby-forward-sexp-jumps-do-end-block-with-empty-args) (ruby-backward-sexp-jumps-do-end-block-with-empty-args) (ruby-forward-sexp-jumps-do-end-block-with-args) (ruby-backward-sexp-jumps-do-end-block-with-args) (ruby-forward-sexp-jumps-do-end-block-with-any-args) (ruby-forward-sexp-jumps-do-end-block-with-expanded-one-arg) (ruby-forward-sexp-jumps-do-end-block-with-one-and-any-args) (ruby-backward-sexp-jumps-do-end-block-with-one-and-any-args): New tests. diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 2f68f004e7..d60899cf18 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -517,6 +517,9 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'." ((ruby-smie--opening-pipe-p) "opening-|") ((ruby-smie--closing-pipe-p) "closing-|") (t tok))) + ((string-match "\\`[^|]+|\\'" tok) + (forward-char -1) + (substring tok 0 -1)) ((and (equal tok "") (looking-at "\\\\\n")) (goto-char (match-end 0)) (ruby-smie--forward-token)) ((equal tok "do") @@ -559,6 +562,7 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'." ((ruby-smie--opening-pipe-p) "opening-|") ((ruby-smie--closing-pipe-p) "closing-|") (t tok))) + ((string-match-p "\\`[^|]+|\\'" tok) "closing-|") ((string-match-p "\\`|[*&]\\'" tok) (forward-char 1) (substring tok 1)) diff --git a/test/lisp/progmodes/ruby-mode-tests.el b/test/lisp/progmodes/ruby-mode-tests.el index 72d83affae..afd6d65c9d 100644 --- a/test/lisp/progmodes/ruby-mode-tests.el +++ b/test/lisp/progmodes/ruby-mode-tests.el @@ -718,6 +718,96 @@ VALUES-PLIST is a list with alternating index and value elements." (ruby-backward-sexp) (should (= 2 (line-number-at-pos))))) +(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-no-args () + (ruby-with-temp-buffer + (ruby-test-string + "proc do + |end") + (search-backward "do\n") + (ruby-forward-sexp) + (should (eobp)))) + +(ert-deftest ruby-backward-sexp-jumps-do-end-block-with-no-args () + (ruby-with-temp-buffer + (ruby-test-string + "proc do + |end") + (goto-char (point-max)) + (ruby-backward-sexp) + (should (looking-at "do$")))) + +(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-empty-args () + (ruby-with-temp-buffer + (ruby-test-string + "proc do || + |end") + (search-backward "do ") + (ruby-forward-sexp) + (should (eobp)))) + +(ert-deftest ruby-backward-sexp-jumps-do-end-block-with-empty-args () + (ruby-with-temp-buffer + (ruby-test-string + "proc do || + |end") + (goto-char (point-max)) + (ruby-backward-sexp) + (should (looking-at "do ")))) + +(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-args () + (ruby-with-temp-buffer + (ruby-test-string + "proc do |a,b| + |end") + (search-backward "do ") + (ruby-forward-sexp) + (should (eobp)))) + +(ert-deftest ruby-backward-sexp-jumps-do-end-block-with-args () + (ruby-with-temp-buffer + (ruby-test-string + "proc do |a,b| + |end") + (goto-char (point-max)) + (ruby-backward-sexp) + (should (looking-at "do ")))) + +(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-any-args () + (ruby-with-temp-buffer + (ruby-test-string + "proc do |*| + |end") + (search-backward "do ") + (ruby-forward-sexp) + (should (eobp)))) + +(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-expanded-one-arg () + (ruby-with-temp-buffer + (ruby-test-string + "proc do |a,| + |end") + (search-backward "do ") + (ruby-forward-sexp) + (should (eobp)))) + +(ert-deftest ruby-forward-sexp-jumps-do-end-block-with-one-and-any-args () + (ruby-with-temp-buffer + (ruby-test-string + "proc do |a,*| + |end") + (search-backward "do ") + (ruby-forward-sexp) + (should (eobp)))) + +(ert-deftest ruby-backward-sexp-jumps-do-end-block-with-one-and-any-args () + (ruby-with-temp-buffer + (ruby-test-string + "proc do |a,*| + |end") + (goto-char (point-max)) + (ruby-backward-sexp) + (should (looking-at "do ")))) + (ert-deftest ruby-toggle-string-quotes-quotes-correctly () (let ((pairs '(("puts '\"foo\"\\''" . "puts \"\\\"foo\\\"'\"") commit 0054961acf319378a588bda1df7d32d2bc0f284d Author: Juri Linkov Date: Tue Dec 11 02:36:46 2018 +0200 * lisp/isearch.el (isearch-pre-command-hook): Support `isearch-move' command properties with values `enabled' and `disabled' also for the value `shift' of isearch-yank-on-move. (Bug#15839) diff --git a/lisp/isearch.el b/lisp/isearch.el index dcd119a517..dd0973d4ea 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2811,10 +2811,10 @@ the bottom." If `shift', extend the search string by motion commands while holding down the shift key. The search string is extended by yanking text that ends at the new position after moving point in the current buffer. -If t, extend the search string without the shift key pressed -by motion commands that have the `isearch-move' property on their -symbols equal to `enabled', or for which the shift-translated command -is not disabled by the value `disabled' of property `isearch-move'." +If t, extend the search string without the shift key pressed. +To enable motion commands, put the `isearch-move' property on their +symbols to `enabled', or to disable an automatically detected +shift-translated command, use the property value `disabled'." :type '(choice (const :tag "Motion keys exit Isearch" nil) (const :tag "Motion keys extend the search string" t) (const :tag "Shifted motion keys extend the search string" shift)) @@ -2864,14 +2864,15 @@ See more for options in `search-exit-option'." (read-event) (setq this-command 'isearch-edit-string)) ;; Don't terminate the search for motion commands. - ((or (and (eq isearch-yank-on-move t) - (symbolp this-command) - (or (eq (get this-command 'isearch-move) 'enabled) - (and (not (eq (get this-command 'isearch-move) 'disabled)) - (stringp (nth 1 (interactive-form this-command))) - (string-match-p "^^" (nth 1 (interactive-form this-command)))))) - (and (eq isearch-yank-on-move 'shift) - this-command-keys-shift-translated)) + ((and isearch-yank-on-move + (symbolp this-command) + (not (eq (get this-command 'isearch-move) 'disabled)) + (or (eq (get this-command 'isearch-move) 'enabled) + (and (eq isearch-yank-on-move t) + (stringp (nth 1 (interactive-form this-command))) + (string-match-p "^^" (nth 1 (interactive-form this-command)))) + (and (eq isearch-yank-on-move 'shift) + this-command-keys-shift-translated))) (setq this-command-keys-shift-translated nil) (setq isearch-pre-move-point (point))) ;; Append control characters to the search string commit 712e74a9fbd24fe350b860238b152f297d16aa5e Author: Juri Linkov Date: Tue Dec 11 01:54:20 2018 +0200 * lisp/vc/vc.el (vc-root-version-diff): New command (bug#33650). (vc-root-diff): Call it interactively on a prefix argument. diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 4527c23d9e..6a848f9d14 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -831,6 +831,14 @@ working tree containing the current VC fileset). If you invoke this command from a Dired buffer, it applies to the working tree containing the directory. +@findex vc-root-version-diff +@kindex C-u C-x v D + To compare two arbitrary revisions of the whole trees, call +@code{vc-root-diff} with a prefix argument: @kbd{C-u C-x v D}. This +prompts for two revision IDs (@pxref{VCS Concepts}), and displays a +diff between those versions of the entire version-controlled directory +trees (RCS, SCCS, CVS, and SRC do not support this feature). + @vindex vc-diff-switches You can customize the @command{diff} options that @kbd{C-x v =} and @kbd{C-x v D} use for generating diffs. The options used are taken @@ -963,6 +971,7 @@ and the maximum number of revisions to display. Directory Mode}) or a Dired buffer (@pxref{Dired}), it applies to the file listed on the current line. +@kindex C-x v L @findex vc-print-root-log @findex log-view-toggle-entry-display @kbd{C-x v L} (@code{vc-print-root-log}) displays a diff --git a/etc/NEWS b/etc/NEWS index 6ae994d594..e20fb14d3e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -398,6 +398,10 @@ with conflicts existed in earlier versions of Emacs, but incorrectly never detected a conflict due to invalid assumptions about cached values. ++++ +*** 'C-u C-x v D' ('vc-root-version-diff') prompts for two revisions +and compares their entire trees. + ** Diff mode *** Hunks are now automatically refined by default. To disable it, set the new defcustom 'diff-font-lock-refine' to nil. diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index dbbc3e2038..5ff9f4d5be 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1817,7 +1817,7 @@ Return t if the buffer had changes, nil otherwise." ;;;###autoload (defun vc-version-diff (_files rev1 rev2) - "Report diffs between revisions of the fileset in the repository history." + "Report diffs between REV1 and REV2 revisions of the fileset." (interactive (vc-diff-build-argument-list-internal)) ;; All that was just so we could do argument completion! (when (and (not rev1) rev2) @@ -1827,6 +1827,28 @@ Return t if the buffer had changes, nil otherwise." (vc-diff-internal t (vc-deduce-fileset t) rev1 rev2 (called-interactively-p 'interactive))) +;;;###autoload +(defun vc-root-version-diff (_files rev1 rev2) + "Report diffs between REV1 and REV2 revisions of the whole tree." + (interactive (vc-diff-build-argument-list-internal)) + ;; This is a mix of `vc-root-diff' and `vc-version-diff' + (when (and (not rev1) rev2) + (error "Not a valid revision range")) + (let ((backend (vc-deduce-backend)) + (default-directory default-directory) + rootdir) + (if backend + (setq rootdir (vc-call-backend backend 'root default-directory)) + (setq rootdir (read-directory-name "Directory for VC root-diff: ")) + (setq backend (vc-responsible-backend rootdir)) + (if backend + (setq default-directory rootdir) + (error "Directory is not version controlled"))) + (let ((default-directory rootdir)) + (vc-diff-internal + t (list backend (list rootdir)) rev1 rev2 + (called-interactively-p 'interactive))))) + ;;;###autoload (defun vc-diff (&optional historic not-urgent) "Display diffs between file revisions. @@ -1900,10 +1922,8 @@ The optional argument NOT-URGENT non-nil means it is ok to say no to saving the buffer." (interactive (list current-prefix-arg t)) (if historic - ;; FIXME: this does not work right, `vc-version-diff' ends up - ;; calling `vc-deduce-fileset' to find the files to diff, and - ;; that's not what we want here, we want the diff for the VC root dir. - (call-interactively 'vc-version-diff) + ;; We want the diff for the VC root dir. + (call-interactively 'vc-root-version-diff) (when buffer-file-name (vc-buffer-sync not-urgent)) (let ((backend (vc-deduce-backend)) (default-directory default-directory) commit 0249277925c216d06dfe584bb72c3b03078de74b Author: Matthias Meulien Date: Tue Sep 4 22:50:56 2018 +0200 Support git commit --no-verify * lisp/vc/vc-git.el (vc-git-log-edit-toggle-no-verify): New function. (vc-git-log-edit-mode-map): Add binding. (vc-git-checkin): Add an entry for that header. diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index f317400530..aa6809f626 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -757,6 +757,11 @@ the commit message." (interactive) (log-edit-toggle-header "Sign-Off" "yes")) +(defun vc-git-log-edit-toggle-no-verify () + "Toggle whether to bypass the pre-commit and commit-msg hooks." + (interactive) + (log-edit-toggle-header "No-Verify" "yes")) + (defun vc-git-log-edit-toggle-amend () "Toggle whether this will amend the previous commit. If toggling on, also insert its message into the buffer." @@ -782,6 +787,7 @@ If toggling on, also insert its message into the buffer." (defvar vc-git-log-edit-mode-map (let ((map (make-sparse-keymap "Git-Log-Edit"))) (define-key map "\C-c\C-s" 'vc-git-log-edit-toggle-signoff) + (define-key map "\C-c\C-n" 'vc-git-log-edit-toggle-no-verify) (define-key map "\C-c\C-e" 'vc-git-log-edit-toggle-amend) map)) @@ -825,6 +831,7 @@ It is based on `log-edit-mode', and has Git-specific extensions.") `(("Author" . "--author") ("Date" . "--date") ("Amend" . ,(boolean-arg-fn "--amend")) + ("No-Verify" . ,(boolean-arg-fn "--no-verify")) ("Sign-Off" . ,(boolean-arg-fn "--signoff"))) comment))) (when msg-file commit c8431a06e4f2209f1c5ba30e2d6a70f284dc4678 Author: Paul Eggert Date: Mon Dec 10 13:40:43 2018 -0800 Fix bug when hashing reversed buffer regions * src/fns.c (extract_data_from_object): When checking file-coding-system-alist, calculate the coding system correctly even if START and END are out of order. Use bool for booleans. diff --git a/src/fns.c b/src/fns.c index 9ef9601e06..79d0a9634f 100644 --- a/src/fns.c +++ b/src/fns.c @@ -4997,7 +4997,8 @@ extract_data_from_object (Lisp_Object spec, } if (STRING_MULTIBYTE (object)) - object = code_convert_string (object, coding_system, Qnil, 1, 0, 1); + object = code_convert_string (object, coding_system, + Qnil, true, false, true); ptrdiff_t size = SCHARS (object), start_char, end_char; validate_subarray (object, start, end, size, &start_char, &end_char); @@ -5052,7 +5053,7 @@ extract_data_from_object (Lisp_Object spec, coding_system = Vcoding_system_for_write; else { - bool force_raw_text = 0; + bool force_raw_text = false; coding_system = BVAR (XBUFFER (object), buffer_file_coding_system); if (NILP (coding_system) @@ -5060,14 +5061,15 @@ extract_data_from_object (Lisp_Object spec, { coding_system = Qnil; if (NILP (BVAR (current_buffer, enable_multibyte_characters))) - force_raw_text = 1; + force_raw_text = true; } if (NILP (coding_system) && !NILP (Fbuffer_file_name (object))) { /* Check file-coding-system-alist. */ Lisp_Object val = CALLN (Ffind_operation_coding_system, - Qwrite_region, start, end, + Qwrite_region, + make_fixnum (b), make_fixnum (e), Fbuffer_file_name (object)); if (CONSP (val) && !NILP (XCDR (val))) coding_system = XCDR (val); @@ -5103,14 +5105,15 @@ extract_data_from_object (Lisp_Object spec, } } - object = make_buffer_string (b, e, 0); + object = make_buffer_string (b, e, false); set_buffer_internal (prev); /* Discard the unwind protect for recovering the current buffer. */ specpdl_ptr--; if (STRING_MULTIBYTE (object)) - object = code_convert_string (object, coding_system, Qnil, 1, 0, 0); + object = code_convert_string (object, coding_system, + Qnil, true, false, false); *start_byte = 0; *end_byte = SBYTES (object); } @@ -5395,7 +5398,7 @@ invoked by mouse clicks and mouse menu items. On some platforms, file selection dialogs are also enabled if this is non-nil. */); - use_dialog_box = 1; + use_dialog_box = true; DEFVAR_BOOL ("use-file-dialog", use_file_dialog, doc: /* Non-nil means mouse commands use a file dialog to ask for files. @@ -5403,7 +5406,7 @@ This applies to commands from menus and tool bar buttons even when they are initiated from the keyboard. If `use-dialog-box' is nil, that disables the use of a file dialog, regardless of the value of this variable. */); - use_file_dialog = 1; + use_file_dialog = true; defsubr (&Sidentity); defsubr (&Srandom); commit 037aabba49bae55bafb10a7284bde85ca1b6a88c Merge: fd1afe2d2a 2075864c77 Author: Glenn Morris Date: Mon Dec 10 09:43:05 2018 -0800 Merge from origin/emacs-26 2075864 (origin/emacs-26) CC Mode: stop extra parens on expression ca... commit fd1afe2d2ae9565149407b32bcde8ac691f2ce22 Merge: e60fc320e3 0220391c00 Author: Glenn Morris Date: Mon Dec 10 09:43:05 2018 -0800 ; Merge from origin/emacs-26 The following commit was skipped: 0220391 Fix cairo scrolling for side-by-side windows commit e60fc320e3cf72327544d17db2542f56ab042e5a Merge: 6383844952 5a7451c383 Author: Glenn Morris Date: Mon Dec 10 09:43:05 2018 -0800 Merge from origin/emacs-26 5a7451c CC Mode: stop wrongly recognizing "func(a * 9)" as "pointer t... b0ed9d1 * lisp/emacs-lisp/cursor-sensor.el: Add motivation commit 63838449521ca1abf5acb2c1b8ab59841a4b2727 Merge: 3d353ce585 ee1ebe8246 Author: Glenn Morris Date: Mon Dec 10 09:43:05 2018 -0800 ; Merge from origin/emacs-26 The following commit was skipped: ee1ebe8 Guard occur against an undefined orig-line commit 3d353ce585e4f9726b59b054218aaa0923d77fea Merge: 874f69acec 908af9dfc4 Author: Glenn Morris Date: Mon Dec 10 09:43:05 2018 -0800 Merge from origin/emacs-26 908af9d Indexing followup to recent changes 505ac9a Improve documentation of cursor-sensor.el (bug#33664) d817d2c * doc/lispref/commands.texi (Adjusting Point): Bug#33662 18442da Tramp multi-hop methods must be inline 1e3e24d ; * src/xterm.c (x_update_begin): Fix whitespace. 1d743d2 Fix scaling problem in Cairo builds 2b9e993 ; * doc/lispref/text.texi (Special Properties): Fix wording. ... e568202 * lisp/simple.el (next-line-or-history-element): Use current-... c7897c2 A few further fixes of window internals description # Conflicts: # doc/misc/tramp.texi commit 874f69acecf0c6c3c4886375c092fb389d207241 Author: Glenn Morris Date: Mon Dec 10 12:42:17 2018 -0500 * admin/gitmerge.el (gitmerge-skip-regexp): Add yet another variant. diff --git a/admin/gitmerge.el b/admin/gitmerge.el index 6dedee8dd1..e7d25674c8 100644 --- a/admin/gitmerge.el +++ b/admin/gitmerge.el @@ -51,7 +51,7 @@ ;; We used to include "sync" in there, but in my experience it only ;; caused false positives. --Stef (let ((skip "back[- ]?port\\|cherry picked from commit\\|\ -\\(do\\( no\\|n['’]\\)t\\|no need to\\) merge\\|\ +\\(do\\( no\\|n['’]\\)t\\|no need to\\) merge\\|not to be merged\\|\ bump \\(Emacs \\)?version\\|Auto-commit")) (if noninteractive skip ;; "Regenerate" is quite prone to false positives. commit edd0c241162ed7242767c16a3737d84be336d4f9 Author: Michael Albinus Date: Mon Dec 10 16:52:21 2018 +0100 * lisp/net/tramp-compat.el (tramp-compat-flatten-list): New defun. diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 01377240ad..046966e019 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -270,6 +270,19 @@ A nil value for either argument stands for the current time." (unload-feature 'tramp-loaddefs 'force) (unload-feature 'tramp-compat 'force))) +;; There does not exist a common `flatten-list' yet, this is discussed +;; in Bug#33309. For the time being we implement our own version, +;; derived from `eshell-flatten-list'. +(defun tramp-compat-flatten-list (args) + "Flatten any lists within ARGS, so that there are no sublists." + (let ((new-list (list t))) + (dolist (a args) + (if (and (listp a) + (listp (cdr a))) + (nconc new-list (tramp-compat-flatten-list a)) + (nconc new-list (list a)))) + (cdr new-list))) + (provide 'tramp-compat) ;;; TODO: commit 063d8c02c2bd3010156a9da040ec6bb0ad4be5ac Author: Stefan Monnier Date: Mon Dec 10 10:06:34 2018 -0500 * lisp/Makefile.in (compile-main): Use a more selective regexp. diff --git a/lisp/Makefile.in b/lisp/Makefile.in index c447598298..32f2c1d28a 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -321,14 +321,16 @@ compile-targets: $(TARGETS) # Compile all the Elisp files that need it. Beware: it approximates # 'no-byte-compile', so watch out for false-positives! compile-main: gen-lisp compile-clean - @(cd $(lisp) && \ + @(cd $(lisp) && \ els=`echo "${SUBDIRS_REL} " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \ - for el in ${MAIN_FIRST} $$els; do \ - test -f $$el || continue; \ - test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t' $$el > /dev/null && continue; \ - echo "$${el}c"; \ - done | xargs $(XARGS_LIMIT) echo) | \ - while read chunk; do \ + for el in ${MAIN_FIRST} $$els; do \ + test -f $$el || continue; \ + test ! -f $${el}c && \ + GREP_OPTIONS= grep '^;.*[^a-zA-Z]no-byte-compile: *t' $$el > /dev/null && \ + continue; \ + echo "$${el}c"; \ + done | xargs $(XARGS_LIMIT) echo) | \ + while read chunk; do \ $(MAKE) compile-targets TARGETS="$$chunk"; \ done commit 2075864c7717491f1156998120535ce72ed8f0cc Author: Alan Mackenzie Date: Mon Dec 10 14:30:40 2018 +0000 CC Mode: stop extra parens on expression causing false fontification as type * lisp/progmodes/cc-fonts.el (c-get-fontification-context): recognize arithmetic operator followed by several open parentheses, not just one, as not being an argument list. diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index fa9b8f354e..39d167f019 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el @@ -1279,12 +1279,14 @@ casts and declarations are fontified. Used on level 2 and higher." (c-put-char-property (1- match-pos) 'c-type 'c-decl-arg-start) (cons 'decl nil)) - ;; Got an open paren preceded by an arith operator. + ;; Got (an) open paren(s) preceded by an arith operator. ((and (eq (char-before match-pos) ?\() (save-excursion (goto-char match-pos) - (and (zerop (c-backward-token-2 2)) - (looking-at c-arithmetic-op-regexp)))) + (while + (progn (c-backward-token-2) + (eq (char-after) ?\())) + (looking-at c-arithmetic-op-regexp))) (cons nil nil)) ;; In a C++ member initialization list. ((and (eq (char-before match-pos) ?,) commit 0220391c0015bdec0e658c7ab206c6226bb335ca Author: Ari Roponen Date: Sun May 6 15:29:28 2018 +0300 Fix cairo scrolling for side-by-side windows Backport: Fixes Bug#33442. * src/xterm.c (x_scroll_run) [USE_CAIRO]: Fix scrolling for side-by-side split windows. (Bug#31288) (cherry picked from commit 6e362a32bc9d21f73a0f29ca6f45481edeea6f29) diff --git a/src/xterm.c b/src/xterm.c index 577c87a93b..97a0d97de7 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -4251,6 +4251,7 @@ x_scroll_run (struct window *w, struct run *run) #ifdef USE_CAIRO if (FRAME_CR_CONTEXT (f)) { + int wx = WINDOW_LEFT_EDGE_X (w); cairo_surface_t *s = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height); cairo_t *cr = cairo_create (s); @@ -4261,8 +4262,8 @@ x_scroll_run (struct window *w, struct run *run) cr = FRAME_CR_CONTEXT (f); cairo_save (cr); - cairo_set_source_surface (cr, s, 0, to_y); - cairo_rectangle (cr, x, to_y, width, height); + cairo_set_source_surface (cr, s, wx, to_y); + cairo_rectangle (cr, wx, to_y, width, height); cairo_fill (cr); cairo_restore (cr); cairo_surface_destroy (s); commit 5a7451c383be5e6be52c986a9392ff551e656f6a Author: Alan Mackenzie Date: Mon Dec 10 12:12:02 2018 +0000 CC Mode: stop wrongly recognizing "func(a * 9)" as "pointer to type a" * lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1): When testing for an identifier after "a *", on failure additionally check for a digit, setting a new flag variable got-number if one is found. In the test for CASE 18, check this flag. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 317968aafd..4bd85d740d 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -8514,6 +8514,8 @@ comment at the start of cc-engine.el for more info." got-parens ;; True if there is an identifier in the declarator. got-identifier + ;; True if we find a number where an identifier was expected. + got-number ;; True if there's a non-close-paren match of ;; `c-type-decl-suffix-key'. got-suffix @@ -8591,7 +8593,9 @@ comment at the start of cc-engine.el for more info." (and (looking-at c-identifier-start) (setq pos (point)) (setq got-identifier (c-forward-name)) - (setq name-start pos))) + (setq name-start pos)) + (when (looking-at "[0-9]") + (setq got-number t))) ; We've probably got an arithmetic expression. ;; Skip over type decl suffix operators and trailing noise macros. (while @@ -9056,7 +9060,7 @@ comment at the start of cc-engine.el for more info." ;; CASE 18 (when (and (not (memq context '(nil top))) - (or got-prefix + (or (and got-prefix (not got-number)) (and (eq context 'decl) (not c-recognize-paren-inits) (or got-parens got-suffix)))) commit b0ed9d143333827ee8481da0fe7821887a3c6c94 Author: Stefan Monnier Date: Sun Dec 9 20:56:35 2018 -0500 * lisp/emacs-lisp/cursor-sensor.el: Add motivation diff --git a/lisp/emacs-lisp/cursor-sensor.el b/lisp/emacs-lisp/cursor-sensor.el index 21c48f830f..6c33d04ded 100644 --- a/lisp/emacs-lisp/cursor-sensor.el +++ b/lisp/emacs-lisp/cursor-sensor.el @@ -38,6 +38,27 @@ ;; called just before redisplay happens, according to the movement of ;; the cursor since the last redisplay. +;;;; Motivation + +;; The old properties were very problematic in practice because they +;; operate at a much lower level and hence affect all motion +;; *functions* like goto-char, forward-char, ... hence breaking +;; invariants like: +;; +;; (forward-char N) == (progn (forward-char N1) (forward-char (- N N1))) +;; (point) == (progn (forward-char N) (forward-char -N) (point)) +;; (+ N (point)) == (progn (forward-char N) (point)) +;; +;; The problems would usually show up due to interaction between +;; unrelated code working in the same buffer, where one code used those +;; properties and the other (unknowingly) assumed those aren't used. +;; In practice a *lot* of code assumes there's no such funny business. +;; +;; Worse: all(?) packages using those properties don't actually want those +;; properties to affect motion at such a low-level, they only want to +;; affect the overall effect of commands, but not the effect of every +;; single point-motion that a given command happened to use internally. + ;;; Code: ;;;###autoload commit ee1ebe8246c333e9ca0e3454f357d12c713c129b Author: Raimon Grau Date: Mon Dec 10 01:42:41 2018 +0200 Guard occur against an undefined orig-line ; Not to be merged to master * lisp/replace.el (occur-engine): Avoid inserting the current line if orig-line is nil. This happens, for example, when reverting an occur buffer with `list-matching-lines-jump-to-current-line' set to t. (Bug#33476) diff --git a/lisp/replace.el b/lisp/replace.el index 940bf56650..4f0cbf4b95 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -1748,6 +1748,7 @@ See also `multi-occur'." (when (and list-matching-lines-jump-to-current-line (not multi-occur-p) (not orig-line-shown-p) + orig-line (>= curr-line orig-line)) (insert (concat @@ -1774,7 +1775,8 @@ See also `multi-occur'." ;; Insert original line if haven't done yet. (when (and list-matching-lines-jump-to-current-line (not multi-occur-p) - (not orig-line-shown-p)) + (not orig-line-shown-p) + orig-line) (with-current-buffer out-buf (insert (concat commit 908af9dfc46f783c89d06cb48d9499eb6a582d3e Author: Eli Zaretskii Date: Sun Dec 9 17:14:55 2018 +0200 Indexing followup to recent changes * doc/lispref/text.texi (Special Properties): Index 'cursor-sensor-inhibit'. (Bug#33664) diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 78d51c6dbb..b790b28fc2 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -3398,8 +3398,10 @@ When the minor mode @code{cursor-intangible-mode} is turned on, point is moved away from any position that has a non-@code{nil} @code{cursor-intangible} property, just before redisplay happens. +@vindex cursor-sensor-inhibit When the variable @code{cursor-sensor-inhibit} is non-@code{nil}, the -@code{cursor-intangible} property is ignored. +@code{cursor-intangible} property and the +@code{cursor-sensor-functions} property (described below) are ignored. @item field @kindex field @r{(text property)} commit 505ac9a0b1fcf2aa505ad551911c98761b77b6f8 Author: Stefan Monnier Date: Sun Dec 9 08:59:20 2018 -0500 Improve documentation of cursor-sensor.el (bug#33664) * doc/lispref/text.texi (Special Properties): Mention cursor-sensor-inhibit. * lisp/emacs-lisp/cursor-sensor.el (Commentary): Add cursor-sensor-mode. (cursor-sensor-inhibit): Add docstring. diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 14cc4fba45..78d51c6dbb 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -3398,6 +3398,9 @@ When the minor mode @code{cursor-intangible-mode} is turned on, point is moved away from any position that has a non-@code{nil} @code{cursor-intangible} property, just before redisplay happens. +When the variable @code{cursor-sensor-inhibit} is non-@code{nil}, the +@code{cursor-intangible} property is ignored. + @item field @kindex field @r{(text property)} Consecutive characters with the same @code{field} property constitute a @@ -3579,6 +3582,9 @@ depending on whether the cursor is entering the text that has this property or leaving it. The functions are called only when the minor mode @code{cursor-sensor-mode} is turned on. +When the variable @code{cursor-sensor-inhibit} is non-@code{nil}, the +@code{cursor-sensor-functions} property is ignored. + @item composition @kindex composition @r{(text property)} This text property is used to display a sequence of characters as a diff --git a/lisp/emacs-lisp/cursor-sensor.el b/lisp/emacs-lisp/cursor-sensor.el index 7e3088dd91..21c48f830f 100644 --- a/lisp/emacs-lisp/cursor-sensor.el +++ b/lisp/emacs-lisp/cursor-sensor.el @@ -22,17 +22,29 @@ ;;; Commentary: -;; This package implements the `cursor-intangible' property, which is -;; meant to replace the old `intangible' property. To use it, just enable the -;; `cursor-intangible-mode', after which this package will move point away from -;; any position that has a non-nil `cursor-intangible' property. This is only -;; done just before redisplay happens, contrary to the old `intangible' -;; property which was done at a much lower level. +;; This package implements the `cursor-intangible' and +;; `cursor-sensor-functions' properties, which are meant to replace +;; the old `intangible', `point-entered', and `point-left' properties. + +;; To use `cursor-intangible', just enable the +;; `cursor-intangible-mode' minor mode, after which this package will +;; move point away from any position that has a non-nil +;; `cursor-intangible' property. This is only done just before +;; redisplay happens, contrary to the old `intangible' property which +;; was done at a much lower level. + +;; To use `cursor-sensor-functions', enable the `cursor-sensor-mode' +;; minor mode, after which the `cursor-sensor-functions' will be +;; called just before redisplay happens, according to the movement of +;; the cursor since the last redisplay. ;;; Code: ;;;###autoload -(defvar cursor-sensor-inhibit nil) +(defvar cursor-sensor-inhibit nil + "When non-nil, suspend `cursor-sensor-mode' and `cursor-intangible-mode'. +By convention, this is a list of symbols where each symbol stands for the +\"cause\" of the suspension.") (defun cursor-sensor--intangible-p (pos) (let ((p (get-pos-property pos 'cursor-intangible))) commit d817d2cfb9bdb71fb3ed540d6601be4577272acc Author: Stefan Monnier Date: Sun Dec 9 08:34:35 2018 -0500 * doc/lispref/commands.texi (Adjusting Point): Bug#33662 Tweak text to clarify intangibility. diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 427379bc79..b6749d0a0c 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -1012,7 +1012,8 @@ If the last event came from a keyboard macro, the value is @code{macro}. sequence of text that has the @code{display} or @code{composition} property, or is invisible. Therefore, after a command finishes and returns to the command loop, if point is within such a sequence, the -command loop normally moves point to the edge of the sequence. +command loop normally moves point to the edge of the sequence, making this +sequence effectively intangible. A command can inhibit this feature by setting the variable @code{disable-point-adjustment}: commit 18442da60fd7f1afd453c5264f133ebb7733c746 Author: Michael Albinus Date: Sun Dec 9 09:55:29 2018 +0100 Tramp multi-hop methods must be inline * doc/misc/tramp.texi (Ad-hoc multi-hops): Involved methods must be inline methods. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 6e02683707..d8bd85025c 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -2594,6 +2594,8 @@ proxy @samp{bird@@bastion} to a remote file on @samp{you@@remotehost}: @kbd{C-x C-f @value{prefix}ssh@value{postfixhop}bird@@bastion|ssh@value{postfixhop}you@@remotehost@value{postfix}/path @key{RET}} @end example +Each involved method must be an inline method (@pxref{Inline methods}). + Proxies can take patterns @code{%h} or @code{%u}. @value{tramp} adds the ad-hoc definitions on the fly to commit 1e3e24d957eb6b1bc5d25f506ef080d1ad553ec8 Author: Eli Zaretskii Date: Sat Dec 8 11:50:58 2018 +0200 ; * src/xterm.c (x_update_begin): Fix whitespace. diff --git a/src/xterm.c b/src/xterm.c index 8157612b29..577c87a93b 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1013,7 +1013,7 @@ x_update_begin (struct frame *f) GdkWindow *w = gtk_widget_get_window (FRAME_GTK_WIDGET (f)); int scale = xg_get_scale (f); width = scale * gdk_window_get_width (w); - height = scale * gdk_window_get_height (w); + height = scale * gdk_window_get_height (w); } else #endif commit 1d743d2461a5a90893a0cbe62239f31b321a844d Author: Ari Roponen Date: Fri Nov 30 14:09:09 2018 +0200 Fix scaling problem in Cairo builds * src/xterm.c (x_begin_cr_clip) [USE_GTK]: (x_update_begin) [USE_CAIRO && USE_GTK]: Support scaling. (Bug#33442) diff --git a/src/xterm.c b/src/xterm.c index b2d1b5c198..8157612b29 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -360,10 +360,15 @@ x_begin_cr_clip (struct frame *f, GC gc) if (! FRAME_CR_SURFACE (f)) { + int scale = 1; +#ifdef USE_GTK + scale = xg_get_scale (f); +#endif + FRAME_CR_SURFACE (f) = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, - FRAME_PIXEL_WIDTH (f), - FRAME_PIXEL_HEIGHT (f)); + scale * FRAME_PIXEL_WIDTH (f), + scale * FRAME_PIXEL_HEIGHT (f)); } cr = cairo_create (FRAME_CR_SURFACE (f)); FRAME_CR_CONTEXT (f) = cr; @@ -1006,8 +1011,9 @@ x_update_begin (struct frame *f) if (FRAME_GTK_WIDGET (f)) { GdkWindow *w = gtk_widget_get_window (FRAME_GTK_WIDGET (f)); - width = gdk_window_get_width (w); - height = gdk_window_get_height (w); + int scale = xg_get_scale (f); + width = scale * gdk_window_get_width (w); + height = scale * gdk_window_get_height (w); } else #endif commit 2b9e9937b41b4d5b20d551ac04bdcc253eeaa37a Author: Eli Zaretskii Date: Fri Dec 7 17:14:32 2018 +0200 ; * doc/lispref/text.texi (Special Properties): Fix wording. (Bug#33663) diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 477b8fce71..14cc4fba45 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -3395,7 +3395,7 @@ property is obsolete; use the @code{cursor-intangible} property instead. @kindex cursor-intangible @r{(text property)} @findex cursor-intangible-mode When the minor mode @code{cursor-intangible-mode} is turned on, point -is moved away of any position that has a non-@code{nil} +is moved away from any position that has a non-@code{nil} @code{cursor-intangible} property, just before redisplay happens. @item field commit e5682025e6eb2393f1ec6b3d0a827adc0af908ab Author: Juri Linkov Date: Fri Dec 7 00:30:51 2018 +0200 * lisp/simple.el (next-line-or-history-element): Use current-column in all position calculations. (previous-line-or-history-element): Idem. (Bug#33640) diff --git a/lisp/simple.el b/lisp/simple.el index 08f622ad8e..2116facd58 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2120,7 +2120,11 @@ next element of the minibuffer history in the minibuffer." (prompt-end (minibuffer-prompt-end)) (old-column (unless (and (eolp) (> (point) prompt-end)) (if (= (line-number-at-pos) 1) - (max (- (current-column) (1- prompt-end)) 0) + (max (- (current-column) + (save-excursion + (goto-char (1- prompt-end)) + (current-column))) + 0) (current-column))))) (condition-case nil (with-no-warnings @@ -2139,7 +2143,10 @@ next element of the minibuffer history in the minibuffer." (goto-char (point-max)) (when old-column (if (= (line-number-at-pos) 1) - (move-to-column (+ old-column (1- (minibuffer-prompt-end)))) + (move-to-column (+ old-column + (save-excursion + (goto-char (1- (minibuffer-prompt-end))) + (current-column)))) (move-to-column old-column))))))) (defun previous-line-or-history-element (&optional arg) @@ -2154,7 +2161,11 @@ previous element of the minibuffer history in the minibuffer." (prompt-end (minibuffer-prompt-end)) (old-column (unless (and (eolp) (> (point) prompt-end)) (if (= (line-number-at-pos) 1) - (max (- (current-column) (1- prompt-end)) 0) + (max (- (current-column) + (save-excursion + (goto-char (1- prompt-end)) + (current-column))) + 0) (current-column))))) (condition-case nil (with-no-warnings @@ -2173,7 +2184,10 @@ previous element of the minibuffer history in the minibuffer." (goto-char (minibuffer-prompt-end)) (if old-column (if (= (line-number-at-pos) 1) - (move-to-column (+ old-column (1- (minibuffer-prompt-end)))) + (move-to-column (+ old-column + (save-excursion + (goto-char (1- (minibuffer-prompt-end))) + (current-column)))) (move-to-column old-column)) ;; Put the cursor at the end of the visual line instead of the ;; logical line, so the next `previous-line-or-history-element' commit c7897c27861fd8b2690f40e77402edced6aa0ceb Author: Martin Rudalics Date: Mon Dec 3 09:35:33 2018 +0100 A few further fixes of window internals description * doc/lispref/internals.texi (Window Internals): Add a few more items and clarify description of some others. diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index 6c9bba126e..b95a15fec5 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -2049,45 +2049,76 @@ if that window no longer displays this buffer. The frame that this window is on, as a Lisp object. @item mini -Non-zero if this window is a minibuffer window. +Non-zero if this window is a minibuffer window, a window showing the +minibuffer or the echo area. + +@item pseudo_window_p +@cindex pseudo window +Non-zero if this window is a @dfn{pseudo window}. A pseudo window is +either a window used to display the menu bar or the tool bar (when +Emacs uses toolkits that don't display their own menu bar and tool +bar) or a window showing a tooltip on a tooltip frame. Pseudo windows +are in general not accessible from Lisp code. @item parent -Internally, Emacs arranges windows in a tree; each group of siblings has -a parent window whose area includes all the siblings. This field points -to a window's parent, as a Lisp object. +Internally, Emacs arranges windows in a tree; each group of siblings +has a parent window whose area includes all the siblings. This field +points to the window's parent in that tree, as a Lisp object. For the +root window of the tree and a minibuffer window this is always +@code{nil}. Parent windows do not display buffers, and play little role in display -except to shape their child windows. Emacs Lisp programs usually have -no access to the parent windows; they operate on the windows at the +except to shape their child windows. Emacs Lisp programs cannot +directly manipulate parent windows; they operate on the windows at the leaves of the tree, which actually display buffers. +@item contents +For a leaf window and windows showing a tooltip, this is the buffer, +as a Lisp object, that the window is displaying. For an internal +(``parent'') window, this is its first child window. For a pseudo +window showing a menu or tool bar this is @code{nil}. It is also +@code{nil} for a window that has been deleted. + @item next @itemx prev -The next sibling and previous sibling of this window. @code{next} is -@code{nil} if the window is the right-most or bottom-most in its group; -@code{prev} is @code{nil} if it is the left-most or top-most in its -group. Whether the sibling is left/right or up/down is determined by -the @code{horizontal} field: if it's non-zero, the siblings are -arranged horizontally. +The next and previous sibling of this window as Lisp objects. +@code{next} is @code{nil} if the window is the right-most or +bottom-most in its group; @code{prev} is @code{nil} if it is the +left-most or top-most in its group. Whether the sibling is left/right +or up/down is determined by the @code{horizontal} field of the +sibling's parent: if it's non-zero, the siblings are arranged +horizontally. + +As a special case, @code{next} of a frame's root window points to the +frame's minibuffer window, provided this is not a minibuffer-only or +minibuffer-less frame. On such frames @code{prev} of the minibuffer +window points to that frame's root window. In any other case, the +root window's @code{next} and the minibuffer window's (if present) +@code{prev} fields are @code{nil}. @item left_col The left-hand edge of the window, measured in columns, relative to the -leftmost column in the frame (column 0). +leftmost column (column 0) of the window's native frame. @item top_line The top edge of the window, measured in lines, relative to the topmost -line in the frame (line 0). +line (line 0) of the window's native frame. + +@item pixel_left +@itemx pixel_top +The left-hand and top edges of this window, measured in pixels, +relative to the top-left corner (0, 0) of the window's native frame. @item total_cols @itemx total_lines -The width and height of the window, measured in columns and lines -respectively. The width includes the scroll bar and fringes, and/or -the separator line on the right of the window (if any). +The total width and height of the window, measured in columns and +lines respectively. The values include scroll bars and fringes, +dividers and/or the separator line on the right of the window (if +any). -@item contents -For leaf windows, this is the buffer, as a Lisp object, that the -window is displaying. For an internal (``parent'') window, this is -its child window. It can also be @code{nil}, for a pseudo-window. +@item pixel_width; +@itemx pixel_height; +The total width and height of the window measured in pixels. @item start A marker pointing to the position in the buffer that is the first @@ -2141,8 +2172,14 @@ in this window. A non-zero value means the window's buffer was modified when the window was last updated. -@item vertical_scroll_bar -This window's vertical scroll bar, a Lisp object. +@item vertical_scroll_bar_type +@itemx horizontal_scroll_bar_type +The types of this window's vertical and horizontal scroll bars. + +@item scroll_bar_width +@itemx scroll_bar_height +The width of this window's vertical scroll bar and the height of this +window's horizontal scroll bar, in pixels. @item left_margin_cols @itemx right_margin_cols @@ -2226,6 +2263,14 @@ Vertical scroll amount, in pixels. Normally, this is 0. @item dedicated Non-@code{nil} if this window is dedicated to its buffer. +@item combination_limit +This window's combination limit, meaningful only for a parent window. +If this is @code{t}, then it is not allowed to delete this window and +recombine its child windows with other siblings of this window. + +@item window_parameters +The alist of this window's parameters. + @item display_table The window's display table, or @code{nil} if none is specified for it. @@ -2250,11 +2295,6 @@ the line number as long as the window shows that buffer. The column number currently displayed in this window's mode line, or @minus{}1 if column numbers are not being displayed. -@item pseudo_window_p -This is non-zero for windows that display the menu bar and the tool -bar (when Emacs uses toolkits that don't display their own menu bar -and tool bar). - @item current_matrix @itemx desired_matrix Glyph matrices describing the current and desired display of this window. diff --git a/src/window.h b/src/window.h index c7f525e270..96e9a9f30e 100644 --- a/src/window.h +++ b/src/window.h @@ -24,57 +24,69 @@ along with GNU Emacs. If not, see . */ INLINE_HEADER_BEGIN -/* Windows are allocated as if they were vectors, but then the -Lisp data type is changed to Lisp_Window. They are garbage -collected along with the vectors. +/* Windows are allocated as if they were vectors, but then the Lisp +data type is changed to Lisp_Window. They are garbage collected along +with the vectors. All windows in use are arranged into a tree, with pointers up and down. -Windows that are leaves of the tree are actually displayed -and show the contents of buffers. Windows that are not leaves -are used for representing the way groups of leaf windows are -arranged on the frame. Leaf windows never become non-leaves. -They are deleted only by calling delete-window on them (but -this can be done implicitly). Combination windows can be created -and deleted at any time. - -A leaf window has a buffer stored in contents field and markers in its start -and pointm fields. Non-leaf windows have nil in the latter two fields. - -Non-leaf windows are either vertical or horizontal combinations. - -A vertical combination window has children that are arranged on the frame -one above the next. Its contents field points to the uppermost child. -The parent field of each of the children points to the vertical -combination window. The next field of each child points to the -child below it, or is nil for the lowest child. The prev field -of each child points to the child above it, or is nil for the -highest child. - -A horizontal combination window has children that are side by side. -Its contents field points to the leftmost child. In each child -the next field points to the child to the right and the prev field -points to the child to the left. - -The children of a vertical combination window may be leaf windows -or horizontal combination windows. The children of a horizontal -combination window may be leaf windows or vertical combination windows. - -At the top of the tree are two windows which have nil as parent. -The second of these is minibuf_window. The first one manages all -the frame area that is not minibuffer, and is called the root window. -Different windows can be the root at different times; -initially the root window is a leaf window, but if more windows -are created then that leaf window ceases to be root and a newly -made combination window becomes root instead. - -In any case, on screens which have an ordinary window and a -minibuffer, prev of the minibuf window is the root window and next of -the root window is the minibuf window. On minibufferless screens or -minibuffer-only screens, the root window and the minibuffer window are -one and the same, so its prev and next members are nil. - -A dead window has its contents field set to nil. */ +Windows that are leaves of the tree are actually displayed and show +the contents of buffers. Windows that are not leaves are used for +representing the way groups of leaf windows are arranged on the frame. +Leaf windows never become non-leaves. They are deleted only by +calling `delete-window' on them (but this can be done implicitly). +Non-leaf windows never become leaf windows and can be created and +deleted at any time by the window management code. Non-leaf windows +can be seen but not directly manipulated by Lisp functions. + +A leaf window has a buffer stored in its contents field and markers in +its 'start' and 'pointm' fields. Non-leaf windows have nil in the +latter two fields. Non-leaf windows are either vertical or horizontal +combinations. + +A vertical combination window has children that are arranged on the +frame one above the next. Its 'contents' field points to the +uppermost child. The 'parent' field of each of the children points to +the vertical combination window. The 'next' field of each child +points to the child below it, or is nil for the lowest child. The +'prev' field of each child points to the child above it, or is nil for +the highest child. + +A horizontal combination window has children that are arranged side by +side. Its 'contents' field points to the leftmost child. In each +child the 'next' field points to the child to the right and the 'prev' +field points to the child to the left. + +On each frame there are at least one and at most two windows which +have nil as parent. The second of these, if present, is the frame's +minibuffer window and shows the minibuffer or the echo area. The +first one manages the remaining frame area and is called the frame's +root window. Different windows can be the root at different times; +initially the root window is a leaf window, but if more windows are +created, then that leaf window ceases to be root and a newly made +combination window becomes the root instead. + +On frames which have an ordinary window and a minibuffer window, +'prev' of the minibuffer window is the root window and 'next' of the +root window is the minibuffer window. On minibuffer-less frames there +is only a root window and 'next' of the root window is nil. On +minibuffer-only frames, the root window and the minibuffer window are +one and the same, so its 'prev' and 'next' members are nil. In any +case, 'prev' of a root window and 'next' of a minibuffer window are +always nil. + +In Lisp parlance, leaf windows are called "live windows" and non-leaf +windows are called "internal windows". Together, live and internal +windows form the set of "valid windows". A window that has been +deleted is considered "dead" regardless of whether it formerly was a +leaf or a non-leaf window. A dead window has its 'contents' field set +to nil. + +Frames may also contain pseudo windows, windows that are not exposed +directly to Lisp code. Pseudo windows are currently either used to +display the menu bar or the tool bar (when Emacs uses toolkits that +don't display their own menu bar and tool bar) or a tooltip in a +tooltip frame (when tooltips are not display by the toolkit). */ struct cursor_pos { @@ -95,29 +107,39 @@ struct window /* Following (to right or down) and preceding (to left or up) child at same level of tree. Whether this is left/right or - up/down is determined by the 'horizontal' flag, see below. - A minibuffer window has the frame's root window pointed by 'prev'. */ + up/down is determined by the parent window's 'horizontal' flag, + see below. On a frame that is neither a minibuffer-only nor a + minibuffer-less frame, 'next' of the root window points to the + frame's minibuffer window and 'prev' of the minibuffer window + points to the frame's root window. In all other cases, 'next' + of the root window and 'prev' of the minibuffer window, if + present, are nil. 'prev' of the root window and 'next' of the + minibuffer window are always nil. */ Lisp_Object next; Lisp_Object prev; - /* The window this one is a child of. For a minibuffer window: nil. */ + /* The window this one is a child of. For the root and a + minibuffer window this is always nil. */ Lisp_Object parent; - /* The normal size of the window. These are fractions, but we do - not use C doubles to avoid creating new Lisp_Float objects while - interfacing Lisp in Fwindow_normal_size. */ + /* The "normal" size of the window. These are fractions, but we + do not use C doubles to avoid creating new Lisp_Float objects + while interfacing Lisp in Fwindow_normal_size. */ Lisp_Object normal_lines; Lisp_Object normal_cols; - /* New sizes of the window. Note that Lisp code may set new_normal - to something beyond an integer, so C int can't be used here. */ + /* The new sizes of the window as proposed by the window resizing + functions. Note that Lisp code may set new_normal to something + beyond an integer, so C int can't be used here. */ Lisp_Object new_total; Lisp_Object new_normal; Lisp_Object new_pixel; - /* For a leaf window: a buffer; for an internal window: a window; - for a pseudo-window (such as menu bar or tool bar): nil. It is - a buffer for a minibuffer window as well. */ + /* For a leaf window or a tooltip window this is the buffer shown + in the window; for a combination window this is the first of + its child windows; for a pseudo window showing the menu bar or + tool bar this is nil. It is a buffer for a minibuffer window + as well. */ Lisp_Object contents; /* A marker pointing to where in the text to start displaying. @@ -192,7 +214,7 @@ struct window /* The two Lisp_Object fields below are marked in a special way, which is why they're placed after `current_matrix'. */ - /* Alist of triples listing + /* A list of triples listing buffers previously shown in this window. */ Lisp_Object prev_buffers; /* List of buffers re-shown in this window. */