commit 35221a7bd55e18244604376497097f4259c7351b (HEAD, refs/remotes/origin/master) Author: Stefan Monnier Date: Mon Nov 7 00:38:43 2022 -0500 (itree_insert_gap, itree_delete_gap): Minor optimization `limit` can get smaller in either of the two children of a node. It can also happen that the root node itself has a low enough limit that the loop can be interrupted right away. The previous code only checked `limit` when going down to a left child, which is not wrong, but tests suggest that it is also very common to reach this limit when going to a right child, so move the test accordingly. * src/itree.c (itree_insert_gap, itree_delete_gap): Check `limit` for all nodes, rather than only when following a `left` pointer. diff --git a/src/itree.c b/src/itree.c index d73fbffd2b..989173db4e 100644 --- a/src/itree.c +++ b/src/itree.c @@ -1240,6 +1240,8 @@ itree_insert_gap (struct itree_tree *tree, { /* Process in pre-order. */ interval_tree_inherit_offset (tree->otick, node); + if (pos > node->limit) + continue; if (node->right != NULL) { if (node->begin > pos) @@ -1251,8 +1253,7 @@ itree_insert_gap (struct itree_tree *tree, else interval_stack_push (stack, node->right); } - if (node->left != NULL - && pos <= node->left->limit + node->left->offset) + if (node->left != NULL) interval_stack_push (stack, node->left); if (before_markers @@ -1312,6 +1313,8 @@ itree_delete_gap (struct itree_tree *tree, { node = nav_nodeptr (nav); interval_tree_inherit_offset (tree->otick, node); + if (pos > node->limit) + continue; if (node->right != NULL) { if (node->begin > pos + length) @@ -1323,8 +1326,7 @@ itree_delete_gap (struct itree_tree *tree, else interval_stack_push (stack, node->right); } - if (node->left != NULL - && pos <= node->left->limit + node->left->offset) + if (node->left != NULL) interval_stack_push (stack, node->left); if (pos < node->begin) commit 61d55ce3bb4dc1f7deac552439c61bbe0909dcdb Merge: 8fe62b2ab5 70fb03a49a Author: Stefan Kangas Date: Sun Nov 6 23:21:01 2022 +0100 Merge from origin/emacs-28 70fb03a49a ; * doc/emacs/search.texi (Lax Search): Improve suggestion... 5779df0c5b ; * doc/lispref/searching.texi: Remove reference to Posix.... 46929f6b73 ; Improve documentation of character classes in regexps commit 8fe62b2ab571ba313587e8543006eca03ff36025 Author: Philip Kaludercic Date: Sun Nov 6 22:18:24 2022 +0100 Revert "* lisp/vc/vc-git.el (vc-git--rev-parse): Allow abbreviating commits" This reverts commit 307ad210040251ea0de2e7f453350c4497bda874. diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 376892c720..74536309e2 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -373,9 +373,8 @@ in the order given by `git status'." (defun vc-git-working-revision (_file) "Git-specific version of `vc-working-revision'." - (let* ((process-file-side-effects nil) - (commit (vc-git--rev-parse "HEAD" t))) - (or (vc-git-symbolic-commit commit) commit))) + (let (process-file-side-effects) + (vc-git--rev-parse "HEAD"))) (defun vc-git--symbolic-ref (file) (or @@ -1694,15 +1693,11 @@ This requires git 1.8.4 or later, for the \"-L\" option of \"git log\"." ;; does not (and cannot) quote. (vc-git--rev-parse (concat rev "~1")))) -(defun vc-git--rev-parse (rev &optional short) +(defun vc-git--rev-parse (rev) (with-temp-buffer (and - (if short - (vc-git--out-ok "rev-parse" "--short" rev) - (vc-git--out-ok "rev-parse" rev)) - (string-trim-right - (buffer-substring-no-properties (point-min) (min (+ (point-min) 40) - (point-max))))))) + (vc-git--out-ok "rev-parse" rev) + (buffer-substring-no-properties (point-min) (+ (point-min) 40))))) (defun vc-git-next-revision (file rev) "Git-specific version of `vc-next-revision'." commit 4103b6c4079e94550e0e8434e21ad8504b9e3a7c Author: Ingo Lohmar Date: Sun Nov 6 17:31:05 2022 +0100 Fix sql-{beginning,end}-of-statement counting * lisp/progmodes/sql.el (sql-beginning-of-statement, sql-end-of-statement): Do not count statement separators if inside a string. diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index b950f93f2a..4121e4dc3c 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -3030,9 +3030,10 @@ displayed." ;; Our start must be between them (goto-char last) - ;; Find a beginning-of-stmt that's not in a comment + ;; Find a beginning-of-stmt that's not in a string or comment (while (and (re-search-forward regexp next t 1) - (nth 7 (syntax-ppss))) + (or (nth 3 (syntax-ppss)) + (nth 7 (syntax-ppss)))) (goto-char (match-end 0))) (goto-char (if (match-data) @@ -3062,8 +3063,9 @@ displayed." ;; If we found another end-of-stmt (if (not (apply re-search term nil t n nil)) (setq arg 0) - ;; count it if we're not in a comment - (unless (nth 7 (syntax-ppss)) + ;; count it if we're not in a string or comment + (unless (or (nth 3 (syntax-ppss)) + (nth 7 (syntax-ppss))) (setq arg (- arg (cl-signum arg)))))) (goto-char (if (match-data) (match-end 0) commit e46f6804892ad67a5fbfd096da568d86f0a4a2f8 Author: Mattias EngdegÄrd Date: Sun Nov 6 15:59:58 2022 +0100 ; * lisp/emacs-lisp/package.el (package-load-all-descriptors): Use \` diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 27324f2b9b..a7bcdd214c 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -741,7 +741,7 @@ description file containing a call to `define-package', which updates `package-alist'." (dolist (dir (cons package-user-dir package-directory-list)) (when (file-directory-p dir) - (dolist (pkg-dir (directory-files dir t "^[^.]" t)) + (dolist (pkg-dir (directory-files dir t "\\`[^.]" t)) (when (file-directory-p pkg-dir) (package-load-descriptor pkg-dir)))))) commit 6cb963ff193ae351538160c2b59b623db44231ab Author: Eli Zaretskii Date: Sun Nov 6 16:45:30 2022 +0200 ; Avoid compiler warnings in 'extend_face_to_end_of_line' * src/xdisp.c (extend_face_to_end_of_line): Return if no default_face is cached or could be realized. This avoids compilation warnings about NULL pointer dereferences. diff --git a/src/xdisp.c b/src/xdisp.c index 054adb9d9d..95da704a07 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -23156,6 +23156,9 @@ extend_face_to_end_of_line (struct it *it) /* The default face, possibly remapped. */ struct face *default_face = FACE_FROM_ID_OR_NULL (f, lookup_basic_face (it->w, f, DEFAULT_FACE_ID)); + if (!default_face) + return; + const int extend_face_id = (it->face_id == default_face->id || it->s != NULL) ? it->face_id commit 9c0b90e6a927c95993a97069b28dc58c5b045e53 Author: Stefan Kangas Date: Sun Nov 6 15:40:19 2022 +0100 Prefer defvar-keymap in octave.el * lisp/progmodes/octave.el (octave-mode-map): Prefer defvar-keymap. diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 18b9899169..bce5bc3ba7 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -1,6 +1,6 @@ ;;; octave.el --- editing octave source files under emacs -*- lexical-binding: t; -*- -;; Copyright (C) 1997, 2001-2022 Free Software Foundation, Inc. +;; Copyright (C) 1997-2022 Free Software Foundation, Inc. ;; Author: Kurt Hornik ;; John Eaton @@ -65,43 +65,39 @@ The string `function' and its name are given by the first and third parenthetical grouping.") -(defvar octave-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "\M-." 'octave-find-definition) - (define-key map "\M-\C-j" 'octave-indent-new-comment-line) - (define-key map "\C-c\C-p" 'octave-previous-code-line) - (define-key map "\C-c\C-n" 'octave-next-code-line) - (define-key map "\C-c\C-a" 'octave-beginning-of-line) - (define-key map "\C-c\C-e" 'octave-end-of-line) - (define-key map [remap down-list] 'smie-down-list) - (define-key map "\C-c\M-\C-h" 'octave-mark-block) - (define-key map "\C-c]" 'smie-close-block) - (define-key map "\C-c/" 'smie-close-block) - (define-key map "\C-c;" 'octave-update-function-file-comment) - (define-key map "\C-hd" 'octave-help) - (define-key map "\C-ha" 'octave-lookfor) - (define-key map "\C-c\C-l" 'octave-source-file) - (define-key map "\C-c\C-f" 'octave-insert-defun) - (define-key map "\C-c\C-il" 'octave-send-line) - (define-key map "\C-c\C-ib" 'octave-send-block) - (define-key map "\C-c\C-if" 'octave-send-defun) - (define-key map "\C-c\C-ir" 'octave-send-region) - (define-key map "\C-c\C-ia" 'octave-send-buffer) - (define-key map "\C-c\C-is" 'octave-show-process-buffer) - (define-key map "\C-c\C-iq" 'octave-hide-process-buffer) - (define-key map "\C-c\C-ik" 'octave-kill-process) - (define-key map "\C-c\C-i\C-l" 'octave-send-line) - (define-key map "\C-c\C-i\C-b" 'octave-send-block) - (define-key map "\C-c\C-i\C-f" 'octave-send-defun) - (define-key map "\C-c\C-i\C-r" 'octave-send-region) - (define-key map "\C-c\C-i\C-a" 'octave-send-buffer) - (define-key map "\C-c\C-i\C-s" 'octave-show-process-buffer) - (define-key map "\C-c\C-i\C-q" 'octave-hide-process-buffer) - (define-key map "\C-c\C-i\C-k" 'octave-kill-process) - map) - "Keymap used in Octave mode.") - - +(defvar-keymap octave-mode-map + :doc "Keymap used in Octave mode." + "M-." #'octave-find-definition + "C-M-j" #'octave-indent-new-comment-line + "C-c C-p" #'octave-previous-code-line + "C-c C-n" #'octave-next-code-line + "C-c C-a" #'octave-beginning-of-line + "C-c C-e" #'octave-end-of-line + " " #'smie-down-list + "C-c C-M-h" #'octave-mark-block + "C-c ]" #'smie-close-block + "C-c /" #'smie-close-block + "C-c ;" #'octave-update-function-file-comment + "C-h d" #'octave-help + "C-h a" #'octave-lookfor + "C-c C-l" #'octave-source-file + "C-c C-f" #'octave-insert-defun + "C-c C-i l" #'octave-send-line + "C-c C-i b" #'octave-send-block + "C-c C-i f" #'octave-send-defun + "C-c C-i r" #'octave-send-region + "C-c C-i a" #'octave-send-buffer + "C-c C-i s" #'octave-show-process-buffer + "C-c C-i q" #'octave-hide-process-buffer + "C-c C-i k" #'octave-kill-process + "C-c C-i C-l" #'octave-send-line + "C-c C-i C-b" #'octave-send-block + "C-c C-i C-f" #'octave-send-defun + "C-c C-i C-r" #'octave-send-region + "C-c C-i C-a" #'octave-send-buffer + "C-c C-i C-s" #'octave-show-process-buffer + "C-c C-i C-q" #'octave-hide-process-buffer + "C-c C-i C-k" #'octave-kill-process) (easy-menu-define octave-mode-menu octave-mode-map "Menu for Octave mode." commit 2ea9f69f0702c330121d12b9e34ff9c139c479f6 Author: Stefan Kangas Date: Sun Nov 6 15:34:58 2022 +0100 Fix failing eshell alias tests * test/lisp/eshell/esh-var-tests.el (esh-var-test/alias/function) (esh-var-test/alias/symbol-pair): Fix tests. (Bug#59062) diff --git a/test/lisp/eshell/esh-var-tests.el b/test/lisp/eshell/esh-var-tests.el index d9b2585a32..245a8e6a26 100644 --- a/test/lisp/eshell/esh-var-tests.el +++ b/test/lisp/eshell/esh-var-tests.el @@ -497,12 +497,13 @@ inside double-quotes" (ert-deftest esh-var-test/alias/function () "Test using a variable alias defined as a function." - (with-temp-eshell - (push `("ALIAS" ,(lambda () "value") nil t) eshell-variable-aliases-list) - (eshell-match-command-output "echo $ALIAS" "value\n") - (eshell-match-command-output "set ALIAS hello" - "Variable `ALIAS' is not settable\n" - nil t))) + (let ((text-quoting-style 'grave)) + (with-temp-eshell + (push `("ALIAS" ,(lambda () "value") nil t) eshell-variable-aliases-list) + (eshell-match-command-output "echo $ALIAS" "value\n") + (eshell-match-command-output "set ALIAS hello" + "Variable `ALIAS' is not settable\n" + nil t)))) (ert-deftest esh-var-test/alias/function-pair () "Test using a variable alias defined as a pair of getter/setter functions." @@ -558,12 +559,13 @@ This should get/set the value bound to the symbol." This should get the value bound to the symbol, but fail to set it, since the setter is nil." (with-temp-eshell - (let ((eshell-test-value "value")) + (let ((eshell-test-value "value") + (text-quoting-style 'grave)) (push '("ALIAS" (eshell-test-value . nil)) eshell-variable-aliases-list) (eshell-match-command-output "echo $ALIAS" "value\n") (eshell-match-command-output "set ALIAS hello" - "Variable `ALIAS' is not settable\n" - nil t)))) + "Variable `ALIAS' is not settable\n" + nil t)))) (ert-deftest esh-var-test/alias/export () "Test that `export' properly sets variable aliases." commit 5233186611e9997387ade5265d4f1b1ea54395a8 Author: Eli Zaretskii Date: Sun Nov 6 16:31:25 2022 +0200 Revert "Pacify -Wnull-dereference" This reverts commit dad452552bebf832e737ebb946b5eea6cd57f63f. Please don't assume I write such code by omission. diff --git a/src/xdisp.c b/src/xdisp.c index ea193601b5..054adb9d9d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -23154,14 +23154,14 @@ extend_face_to_end_of_line (struct it *it) point temporarily moved to window-point. */ specbind (Qinhibit_quit, Qt); /* The default face, possibly remapped. */ - struct face *default_face - = FACE_FROM_ID (f, lookup_basic_face (it->w, f, DEFAULT_FACE_ID)); - const int extend_face_id - = ((it->face_id == default_face->id || it->s != NULL) - ? it->face_id - : (it->glyph_row->ends_at_zv_p - ? default_face->id - : face_at_pos (it, LFACE_EXTEND_INDEX))); + struct face *default_face = + FACE_FROM_ID_OR_NULL (f, lookup_basic_face (it->w, f, DEFAULT_FACE_ID)); + const int extend_face_id = + (it->face_id == default_face->id || it->s != NULL) + ? it->face_id + : (it->glyph_row->ends_at_zv_p + ? default_face->id + : face_at_pos (it, LFACE_EXTEND_INDEX)); unbind_to (count, Qnil); /* Face extension extends the background and box of IT->extend_face_id commit 44138d5ecce275caef9efe0ae4f4a89e4a33b588 Author: Po Lu Date: Sun Nov 6 20:11:56 2022 +0800 ; * src/image.c (syms_of_image): Add missed part of change. Author: diff --git a/src/image.c b/src/image.c index 15eaf89d7f..600c32571e 100644 --- a/src/image.c +++ b/src/image.c @@ -12217,7 +12217,10 @@ non-numeric, there is no explicit limit on the size of images. */); && ((defined HAVE_NS && defined NS_IMPL_COCOA) \ || defined HAVE_HAIKU) DEFSYM (Qsvg, "svg"); - add_image_type (Qsvg); + + /* On Haiku, the SVG translator may not be installed. */ + if (image_can_use_native_api (Qsvg)) + add_image_type (Qsvg); #endif #ifdef HAVE_NS commit 5f8c655a44a0e7ad1fe6f8b23acb4e6c93dc72a6 Author: Po Lu Date: Sun Nov 6 20:07:49 2022 +0800 Fix splash screen display on NS and Haiku with native image APIs * src/image.c (syms_of_image): Add Qsvg image type if SVG is also supported by native image APIs. diff --git a/src/image.c b/src/image.c index 80b814cb1c..15eaf89d7f 100644 --- a/src/image.c +++ b/src/image.c @@ -12213,7 +12213,12 @@ non-numeric, there is no explicit limit on the size of images. */); # endif DEFSYM (Qgobject, "gobject"); #endif /* HAVE_NTGUI */ -#endif /* HAVE_RSVG */ +#elif defined HAVE_NATIVE_IMAGE_API \ + && ((defined HAVE_NS && defined NS_IMPL_COCOA) \ + || defined HAVE_HAIKU) + DEFSYM (Qsvg, "svg"); + add_image_type (Qsvg); +#endif #ifdef HAVE_NS DEFSYM (Qheic, "heic"); commit dad452552bebf832e737ebb946b5eea6cd57f63f Author: Po Lu Date: Sun Nov 6 19:42:36 2022 +0800 Pacify -Wnull-dereference * src/xdisp.c (extend_face_to_end_of_line): Use FACE_FROM_ID, not FACE_FROM_ID_OR_NULL, when the next line proceeds to immediately dereference the face. diff --git a/src/xdisp.c b/src/xdisp.c index 054adb9d9d..ea193601b5 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -23154,14 +23154,14 @@ extend_face_to_end_of_line (struct it *it) point temporarily moved to window-point. */ specbind (Qinhibit_quit, Qt); /* The default face, possibly remapped. */ - struct face *default_face = - FACE_FROM_ID_OR_NULL (f, lookup_basic_face (it->w, f, DEFAULT_FACE_ID)); - const int extend_face_id = - (it->face_id == default_face->id || it->s != NULL) - ? it->face_id - : (it->glyph_row->ends_at_zv_p - ? default_face->id - : face_at_pos (it, LFACE_EXTEND_INDEX)); + struct face *default_face + = FACE_FROM_ID (f, lookup_basic_face (it->w, f, DEFAULT_FACE_ID)); + const int extend_face_id + = ((it->face_id == default_face->id || it->s != NULL) + ? it->face_id + : (it->glyph_row->ends_at_zv_p + ? default_face->id + : face_at_pos (it, LFACE_EXTEND_INDEX))); unbind_to (count, Qnil); /* Face extension extends the background and box of IT->extend_face_id commit f305d1ab3a913ce30cfb28fdce48d99d65caf256 Author: Po Lu Date: Sun Nov 6 19:37:02 2022 +0800 Write more commentary on XI2 device management * src/xterm.c (xi_populate_device_from_info): Take dpyinfo. Describe what master and slave devices are, how they represent seats, and how they are used to multiplex user input. Also simplify ifdefs and avoid looping over scroll classes on XI 2.0. (x_cache_xi_devices, handle_one_xevent): Adjust accordingly. (x_term_init): Set dpyinfo->xi2_version before calling x_cache_xi_devices. diff --git a/src/xterm.c b/src/xterm.c index 545a95f7b2..abe9c7304e 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -5317,7 +5317,8 @@ struct xi_known_valuator #endif static void -xi_populate_device_from_info (struct xi_device_t *xi_device, +xi_populate_device_from_info (struct x_display_info *dpyinfo, + struct xi_device_t *xi_device, XIDeviceInfo *device) { #ifdef HAVE_XINPUT2_1 @@ -5335,26 +5336,85 @@ xi_populate_device_from_info (struct xi_device_t *xi_device, USE_SAFE_ALLOCA; #endif + /* Initialize generic information about the device: its ID, which + buttons are currently pressed and thus presumably actively + grabbing the device, what kind of device it is (master pointer, + master keyboard, slave pointer, slave keyboard, or floating + slave), and its attachment. + + Here is a brief description of what device uses and attachments + are. Under XInput 2, user input from individual input devices is + multiplexed into specific seats before being delivered, with each + seat corresponding to a single on-screen mouse pointer and having + its own keyboard focus. Each seat consists of two virtual + devices: the master keyboard and the master pointer, the first of + which is used to report all keyboard input, with the other used + to report all other input. + + Input from each physical device (mouse, trackpad or keyboard) is + then associated with that slave device's paired master device. + For example, moving the device "Logitech USB Optical Mouse", + enslaved by the master pointer device "Virtual core pointer", + will result in movement of the mouse pointer associated with that + master device's seat. If the pointer moves over an Emacs frame, + then the frame will receive XI_Enter and XI_Motion events from + that master pointer. + + Likewise, keyboard input from the device "AT Translated Set 2 + keyboard", enslaved by the master keyboard device "Virtual core + keyboard", will be reported to its seat's input focus window. + + The device use describes what the device is. The meanings of + MasterPointer, MasterKeyboard, SlavePointer and SlaveKeyboard + should be obvious. FloatingSlave means the device is a slave + device that is not associated with any seat, and thus generates + no input. + + The device attachment is a device ID whose meaning varies + depending on the device use. If the device is a master device, + then the attachment is the device ID of the other device in its + seat (the master keyboard for master pointer devices, and vice + versa). Otherwise, it is the ID of the master device the slave + device is attached to. For slave devices not attached to any + seat, its value is undefined. */ + xi_device->device_id = device->deviceid; xi_device->grab = 0; - -#ifdef HAVE_XINPUT2_1 - actual_valuator_count = 0; - xi_device->valuators = xnmalloc (device->num_classes, - sizeof *xi_device->valuators); - values = NULL; -#endif - xi_device->use = device->use; xi_device->name = build_string (device->name); xi_device->attachment = device->attachment; + /* Clear the list of active touch points on the device, which are + individual touches tracked by a touchscreen. */ + #ifdef HAVE_XINPUT2_2 xi_device->touchpoints = NULL; xi_device->direct_p = false; #endif #ifdef HAVE_XINPUT2_1 + if (!dpyinfo->xi2_version) + { + /* Skip everything below as there are no classes of interest on + XI 2.0 servers. */ + xi_device->valuators = NULL; + xi_device->scroll_valuator_count = 0; + + return; + } + + actual_valuator_count = 0; + xi_device->valuators = xnmalloc (device->num_classes, + sizeof *xi_device->valuators); + values = NULL; + + /* Initialize device info based on a list of "device classes". + Device classes are little pieces of information associated with a + device. Emacs is interested in scroll valuator information and + touch handling information, which respectively describe the axes + (if any) along which the device's scroll wheel rotates, and how + the device reports touch input. */ + for (c = 0; c < device->num_classes; ++c) { switch (device->classes[c]->type) @@ -5474,7 +5534,8 @@ x_cache_xi_devices (struct x_display_info *dpyinfo) for (i = 0; i < ndevices; ++i) { if (infos[i].enabled) - xi_populate_device_from_info (&dpyinfo->devices[actual_devices++], + xi_populate_device_from_info (dpyinfo, + &dpyinfo->devices[actual_devices++], &infos[i]); } @@ -23607,7 +23668,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, memset (dpyinfo->devices + dpyinfo->num_devices - 1, 0, sizeof *dpyinfo->devices); device = &dpyinfo->devices[dpyinfo->num_devices - 1]; - xi_populate_device_from_info (device, info); + xi_populate_device_from_info (dpyinfo, device, info); } if (info) @@ -29608,11 +29669,10 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) xi_select_hierarchy_events (dpyinfo); #endif + dpyinfo->xi2_version = minor; x_cache_xi_devices (dpyinfo); } } - - dpyinfo->xi2_version = minor; skip_xi_setup: ; #endif commit cd296e19a2b1f77268a142977424c54cb94e633f Author: Eli Zaretskii Date: Sun Nov 6 12:22:11 2022 +0200 ; * src/itree.h (forget_itree): Make the prototype conditional. diff --git a/src/itree.h b/src/itree.h index 436fcfc7a0..10ee0897c3 100644 --- a/src/itree.h +++ b/src/itree.h @@ -107,7 +107,9 @@ enum itree_order }; extern void init_itree (void); +#ifdef HAVE_UNEXEC extern void forget_itree (void); +#endif extern void itree_node_init (struct itree_node *, bool, bool, Lisp_Object); extern ptrdiff_t itree_node_begin (struct itree_tree *, struct itree_node *); extern ptrdiff_t itree_node_end (struct itree_tree *, struct itree_node *); commit 24e5abdc069874732bcd6771bf2298eddf553d7c Author: Eli Zaretskii Date: Sun Nov 6 11:33:38 2022 +0200 Fix face extension when Org narrows the buffer * src/xdisp.c (extend_face_to_end_of_line): Make sure glyph rows at ZV use the default face for extension. (Bug#59065) diff --git a/src/xdisp.c b/src/xdisp.c index dd243eca98..054adb9d9d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -23153,10 +23153,15 @@ extend_face_to_end_of_line (struct it *it) this is called when redisplaying a non-selected window, with point temporarily moved to window-point. */ specbind (Qinhibit_quit, Qt); - const int extend_face_id = (it->face_id == DEFAULT_FACE_ID - || it->s != NULL) - ? DEFAULT_FACE_ID - : face_at_pos (it, LFACE_EXTEND_INDEX); + /* The default face, possibly remapped. */ + struct face *default_face = + FACE_FROM_ID_OR_NULL (f, lookup_basic_face (it->w, f, DEFAULT_FACE_ID)); + const int extend_face_id = + (it->face_id == default_face->id || it->s != NULL) + ? it->face_id + : (it->glyph_row->ends_at_zv_p + ? default_face->id + : face_at_pos (it, LFACE_EXTEND_INDEX)); unbind_to (count, Qnil); /* Face extension extends the background and box of IT->extend_face_id @@ -23193,14 +23198,8 @@ extend_face_to_end_of_line (struct it *it) if (!ASCII_CHAR_P (it->c)) it->face_id = FACE_FOR_CHAR (f, face, 0, -1, Qnil); - /* The default face, possibly remapped. */ - struct face *default_face = - FACE_FROM_ID (f, lookup_basic_face (it->w, f, DEFAULT_FACE_ID)); #ifdef HAVE_WINDOW_SYSTEM - if (default_face == NULL) - error ("extend_face_to_end_of_line: default_face is not set!"); - if (FRAME_WINDOW_P (f)) { /* If the row is empty, add a space with the current face of IT, commit 6a132f9b52fd5e53298264ec89652be1a130a472 Author: Davide Masserut Date: Thu Nov 3 15:16:21 2022 +0100 Bind "DEL" in dictionary-mode * lisp/net/dictionary.el (dictionary-mode-map): Bind DEL to 'scroll-down-command'. (Bug#58986) diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el index d381750eb0..315f7e5f52 100644 --- a/lisp/net/dictionary.el +++ b/lisp/net/dictionary.el @@ -341,7 +341,8 @@ is utf-8" "p" #'backward-button "SPC" #'scroll-up-command "S-SPC" #'scroll-down-command - "M-SPC" #'scroll-down-command) + "M-SPC" #'scroll-down-command + "DEL" #'scroll-down-command) (defvar dictionary-connection nil commit 45e318a1846091c42921555e656154f368b75cbf Author: Eli Zaretskii Date: Sun Nov 6 10:08:58 2022 +0200 Improve documentation of Edebug overwriting buffer point * doc/lispref/edebug.texi (Edebug Display Update) (Edebug Options): More details about Edebug changing buffer point position. Reported by Alan Mackenzie . diff --git a/doc/lispref/edebug.texi b/doc/lispref/edebug.texi index 6a51489d8a..1562a37842 100644 --- a/doc/lispref/edebug.texi +++ b/doc/lispref/edebug.texi @@ -1076,16 +1076,25 @@ current buffer, are saved and restored. @cindex window configuration (Edebug) The outside window configuration is saved and restored if @code{edebug-save-windows} is non-@code{nil} (@pxref{Edebug Options}). +If the value of @code{edebug-save-windows} is a list, only the listed +windows are saved and restored. The window configuration is not restored on error or quit, but the outside selected window @emph{is} reselected even on error or quit in -case a @code{save-excursion} is active. If the value of -@code{edebug-save-windows} is a list, only the listed windows are saved -and restored. +case a @code{save-excursion} is active. The window start and horizontal scrolling of the source code buffer are not restored, however, so that the display remains coherent within Edebug. +@cindex buffer point changed by Edebug +@cindex edebug overwrites buffer point position +Saving and restoring the outside window configuration can sometimes +change the positions of point in the buffers on which the Lisp program +you are debugging operates, especially if your program moves point. +If this happens and interferes with your debugging, we recommend to +set @code{edebug-save-windows} to @code{nil} +(@pxref{Edebug Options}). + @item The value of point in each displayed buffer is saved and restored if @code{edebug-save-displayed-buffer-points} is non-@code{nil}. @@ -1655,10 +1664,16 @@ specify an Edebug form specification. If this is non-@code{nil}, Edebug saves and restores the window configuration. That takes some time, so if your program does not care what happens to the window configurations, it is better to set this -variable to @code{nil}. - -If the value is a list, only the listed windows are saved and -restored. +variable to @code{nil}. We also recommend to set this to @code{nil} +if the default value causes Edebug to overwrite the positions of point +in buffers that are involved in the program you are debugging, as +result of saving and restoring the window configuration; this could +happen if your program moves point in one or more of those buffers. +Another option to try to customize in this case is +@code{edebug-save-displayed-buffer-points}, described below. + +If the value of @code{edebug-save-windows} is a list, only the listed +windows are saved and restored. You can use the @kbd{W} command in Edebug to change this variable interactively. @xref{Edebug Display Update}. commit d59c32201edd262dc97cad8c590ef5ae9bafaf74 Author: Eli Zaretskii Date: Sun Nov 6 09:43:32 2022 +0200 ; Minor copyedits in Eglot manual * doc/misc/eglot.texi (Customizing Eglot): More accurate wording of how 'eglot-workspace-configuration' are sent to LSP servers. (Bug#58986) diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi index 30bdaeb780..8d184976cd 100644 --- a/doc/misc/eglot.texi +++ b/doc/misc/eglot.texi @@ -945,9 +945,9 @@ provide per-project settings, as described below in more detail. Some language servers need to know project-specific settings, which the LSP calls @dfn{workspace configuration}. Eglot allows such fine tuning of per-project settings via the variable -@code{eglot-workspace-configuration}. Eglot sends the portion of the -settings contained in this variable to each server for which such -settings were defined in the variable. These settings are +@code{eglot-workspace-configuration}. Eglot sends the settings in +this variable to each server, and each server applies the portion of the +settings relevant to it and ignores the rest. These settings are communicated to the server initially (upon establishing the connection) or when the settings are changed, or in response to a configuration request from the server. @@ -1022,8 +1022,8 @@ Alternatively, the same configuration could be defined as follows: @end lisp This is an equivalent setup which sets the value for all the -major-modes inside the project; Eglot will use for each server only -the section of the parameters intended for that server. +major-modes inside the project; each server will use only the section +of the parameters intended for that server, and ignore the rest. As yet another alternative, you can set the value of @code{eglot-workspace-configuration} programmatically, via the commit 69a55568bfeaeb1cb9ad683453bfbc9397cef40b Author: Juri Linkov Date: Sun Nov 6 09:37:12 2022 +0200 * lisp/tab-bar.el (tab-bar-fixed-width-max): Change :type from cons to list. This will allow possible future extensions to customize Double (HiDPI). (tab-bar-fixed-width-min): Change :type from cons to list. (tab-bar-fixed-width): Use the list instead of cons. diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 2150fa1506..16763132fe 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -985,21 +985,25 @@ The maximum tab width is defined by the variable `tab-bar-fixed-width-max'." :group 'tab-bar :version "29.1") -(defcustom tab-bar-fixed-width-max '(220 . 20) +(defcustom tab-bar-fixed-width-max '(220 20) "Maximum number of pixels or characters allowed for the tab name width. -The car of the cons cell is the maximum number of pixels when used on -a GUI session. The cdr of the cons cell defines the maximum number of -characters when used on a tty. When set to nil, there is no limit +The first element of the list is the maximum number of pixels when used on +a GUI session. The second element of the list defines the maximum number +of characters when used on a tty. When set to nil, there is no limit on maximum width, and tabs are resized evenly to the whole width of the tab bar when `tab-bar-fixed-width' is non-nil." :type '(choice (const :tag "No limit" nil) - (cons (integer :tag "Max width (pixels)" :value 220) + (list (integer :tag "Max width (pixels)" :value 220) (integer :tag "Max width (chars)" :value 20))) + :initialize 'custom-initialize-default + :set (lambda (sym val) + (set-default sym val) + (setq tab-bar--fixed-width-hash nil)) :group 'tab-bar :version "29.1") -(defvar tab-bar-fixed-width-min '(20 . 2) +(defvar tab-bar-fixed-width-min '(20 2) "Minimum number of pixels or characters allowed for the tab name width. It's not recommended to change this value since with a bigger value, the tab bar might wrap to the second line.") @@ -1038,12 +1042,12 @@ tab bar might wrap to the second line.") (length tabs))) (when tab-bar-fixed-width-min (setq width (max width (if window-system - (car tab-bar-fixed-width-min) - (cdr tab-bar-fixed-width-min))))) + (nth 0 tab-bar-fixed-width-min) + (nth 1 tab-bar-fixed-width-min))))) (when tab-bar-fixed-width-max (setq width (min width (if window-system - (car tab-bar-fixed-width-max) - (cdr tab-bar-fixed-width-max))))) + (nth 0 tab-bar-fixed-width-max) + (nth 1 tab-bar-fixed-width-max))))) (dolist (item tabs) (setf (nth 2 item) (with-memoization (gethash (cons width (nth 2 item)) commit 70fb03a49af07bd644e831c7d2e8d219aa910535 (refs/remotes/origin/emacs-28) Author: Eli Zaretskii Date: Fri Nov 4 17:21:58 2022 +0200 ; * doc/emacs/search.texi (Lax Search): Improve suggestion. (Bug#58992) diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index c58cc363ad..7722680885 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -1343,7 +1343,7 @@ Hence, @w{@samp{foo bar}} matches @w{@samp{foo bar}}, @w{@samp{foo@ @ bar}}, @w{@samp{foo@ @ @ bar}}, and so on (but not @samp{foobar}). If you want to make spaces match sequences of newlines as well as spaces and tabs, customize the option to make its value be the regular -expression @samp{[[:space:]\n]+}. (The default behavior of the +expression @samp{[ \t\n]+}. (The default behavior of the incremental regexp search is different; see @ref{Regexp Search}.) If you want whitespace characters to match exactly, you can turn lax commit 5779df0c5bb7b1805196c09948be24bd5531a4b4 Author: Eli Zaretskii Date: Fri Nov 4 16:02:48 2022 +0200 ; * doc/lispref/searching.texi: Remove reference to Posix. (Bug#58992) diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 3365c0c904..087505ad24 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -395,13 +395,12 @@ range should not be the starting point of another one; for example, @samp{[a-m-z]} should be avoided. A character alternative can also specify named character classes -(@pxref{Char Classes}). This is a POSIX feature. For example, -@samp{[[:ascii:]]} matches any @acronym{ASCII} character. -Using a character class is equivalent to mentioning each of the -characters in that class; but the latter is not feasible in practice, -since some classes include thousands of different characters. -A character class should not appear as the lower or upper bound -of a range. +(@pxref{Char Classes}). For example, @samp{[[:ascii:]]} matches any +@acronym{ASCII} character. Using a character class is equivalent to +mentioning each of the characters in that class; but the latter is not +feasible in practice, since some classes include thousands of +different characters. A character class should not appear as the +lower or upper bound of a range. The usual regexp special characters are not special inside a character alternative. A completely different set of characters is commit 46929f6b7308b9aab011b3d4ea4adaa4242076cd Author: Eli Zaretskii Date: Fri Nov 4 15:12:29 2022 +0200 ; Improve documentation of character classes in regexps * doc/lispref/searching.texi (Char Classes): Add notes about the dependence of character classes on case and syntax tables specific to buffers and modes. (Bug#58992) diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index fe4de0abbb..3365c0c904 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -617,7 +617,7 @@ This matches any character whose code is in the range 0--31. This matches @samp{0} through @samp{9}. Thus, @samp{[-+[:digit:]]} matches any digit, as well as @samp{+} and @samp{-}. @item [:graph:] -This matches graphic characters---everything except whitespace, +This matches graphic characters---everything except spaces, @acronym{ASCII} and non-@acronym{ASCII} control characters, surrogates, and codepoints unassigned by Unicode, as indicated by the Unicode @samp{general-category} property (@pxref{Character @@ -625,29 +625,39 @@ Properties}). @item [:lower:] This matches any lower-case letter, as determined by the current case table (@pxref{Case Tables}). If @code{case-fold-search} is -non-@code{nil}, this also matches any upper-case letter. +non-@code{nil}, this also matches any upper-case letter. Note that a +buffer can have its own local case table different from the default +one. @item [:multibyte:] This matches any multibyte character (@pxref{Text Representations}). @item [:nonascii:] This matches any non-@acronym{ASCII} character. @item [:print:] -This matches any printing character---either whitespace, or a graphic -character matched by @samp{[:graph:]}. +This matches any printing character---either spaces or graphic +characters matched by @samp{[:graph:]}. @item [:punct:] This matches any punctuation character. (At present, for multibyte -characters, it matches anything that has non-word syntax.) +characters, it matches anything that has non-word syntax, and thus its +exact definition can vary from one major mode to another, since the +syntax of a character depends on the major mode.) @item [:space:] This matches any character that has whitespace syntax -(@pxref{Syntax Class Table}). +(@pxref{Syntax Class Table}). Note that the syntax of a character, +and thus which characters are considered ``whitespace'', +depends on the major mode. @item [:unibyte:] This matches any unibyte character (@pxref{Text Representations}). @item [:upper:] This matches any upper-case letter, as determined by the current case table (@pxref{Case Tables}). If @code{case-fold-search} is -non-@code{nil}, this also matches any lower-case letter. +non-@code{nil}, this also matches any lower-case letter. Note that a +buffer can have its own local case table different from the default +one. @item [:word:] This matches any character that has word syntax (@pxref{Syntax Class -Table}). +Table}). Note that the syntax of a character, and thus which +characters are considered ``word-constituent'', depends on the major +mode. @item [:xdigit:] This matches the hexadecimal digits: @samp{0} through @samp{9}, @samp{a} through @samp{f} and @samp{A} through @samp{F}.