emacs-diffs
[Top][All Lists]
Advanced

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

master c108132d3bb: Merge from origin/emacs-29


From: João Távora
Subject: master c108132d3bb: Merge from origin/emacs-29
Date: Sun, 2 Apr 2023 19:38:00 -0400 (EDT)

branch: master
commit c108132d3bb69d0cc8d2e0222a781dff9abca087
Merge: f886ae5cf07 3bdbb66efb9
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Merge from origin/emacs-29
    
    3bdbb66efb9 ; CONTRIBUTE: Minor stylistic changes.
    d0eb12e8d3c Fix typo in section 14.1 of Emacs Manual
    b2fbec37f39 ; * etc/EGLOT-NEWS: Clarify scope of topmost section
    131ec049db0 Eglot: unbreak eglot-extend-to-xref on w32
    0622e1f29f6 Eglot: ensure server shutdown turns off eglot-inlay-hints...
    59f66ea3027 ; * lisp/emacs-lisp/package-vc.el: Remove completed item ...
    d23dc3dd7e3 ; * lisp/emacs-lisp/package-vc.el (package-vc): Fix manua...
    4508a024e81 ; Clarify documentation of 'cursor' text property
    d2e82817a3f Add two typescript-ts-mode faces (bug#62429)
    10918fc9d24 Fix scrolling window when point moves up
    9b32bc134c4 Improve documentation of 'defcustom's :set keyword
    ab4273056e0 Comp fix calls to redefined primtives with op-bytecode (b...
    c98929c7e18 ; Fix last change
    a14c3f62a67 ; Fix last change
    09fece5722f Fix duplicate defcustom in eww.el
    e45bd10a3d9 Fix indentation regression in 'C-h l'
    46fd10a7600 * doc/misc/tramp.texi (Remote shell setup): Clarify use o...
---
 CONTRIBUTE                           | 10 ++++-----
 doc/emacs/display.texi               |  2 +-
 doc/lispref/customize.texi           |  9 +++++++-
 doc/lispref/text.texi                | 25 +++++++++++-----------
 doc/misc/tramp.texi                  |  9 ++++----
 lisp/custom.el                       |  4 +++-
 lisp/emacs-lisp/comp.el              | 41 ++++++++++++++++++++----------------
 lisp/emacs-lisp/package-vc.el        |  5 +----
 lisp/help.el                         |  4 ++++
 lisp/loadup.el                       |  6 ++++++
 lisp/net/eww.el                      | 13 ++++++------
 lisp/progmodes/eglot.el              |  4 ++--
 lisp/progmodes/typescript-ts-mode.el | 25 +++++++++++++++++-----
 src/comp.c                           |  8 +++++++
 src/xdisp.c                          |  5 +++--
 test/src/comp-tests.el               | 18 +++++++++++++++-
 16 files changed, 126 insertions(+), 62 deletions(-)

diff --git a/CONTRIBUTE b/CONTRIBUTE
index dcf34f48fe5..f56ba1df630 100644
--- a/CONTRIBUTE
+++ b/CONTRIBUTE
@@ -110,7 +110,7 @@ admin/notes/bug-triage.
 
 Any change that matters to end-users should have an entry in etc/NEWS.
 Try to start each NEWS entry with a sentence that summarizes the entry
-and takes just one line -- this will allow to read NEWS in Outline
+and takes just one line -- this will allow reading NEWS in Outline
 mode after hiding the body of each entry.
 
 Doc-strings should be updated together with the code.
@@ -123,7 +123,7 @@ Think about whether your change requires updating the 
manuals.  If you
 know it does not, mark the NEWS entry with "---".  If you know
 that *all* the necessary documentation updates have been made as part
 of your changes or those by others, mark the entry with "+++".
-Otherwise do not mark it.
+Otherwise, do not mark it.
 
 If your change requires updating the manuals to document new
 functions/commands/variables/faces, then use the proper Texinfo
@@ -400,7 +400,7 @@ the commit to master, by starting the commit message with 
"Backport:".
 The gitmerge function excludes these commits from the merge to the master.
 
 Some changes should not be merged to master at all, for whatever
-reasons.  These should be marked by including something like "Do not
+reason.  These should be marked by including something like "Do not
 merge to master" or anything that matches gitmerge-skip-regexp (see
 admin/gitmerge.el) in the commit message.
 
@@ -449,8 +449,8 @@ files intended for use only with Emacs version 24.5 and 
later.
 
 *** Useful files in the admin/ directory
 
-See all the files in admin/notes/* .  In particular, see
-admin/notes/newfile, see admin/notes/repo.
+See all the files in 'admin/notes/*'.  In particular, see
+'admin/notes/newfile' and 'admin/notes/repo'.
 
 The file admin/MAINTAINERS records the areas of interest of frequent
 Emacs contributors.  If you are making changes in one of the files
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index 7ec843180b8..6b2eb014c82 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -154,7 +154,7 @@ the buffer will be momentarily unfontified.
 @vindex redisplay-skip-fontification-on-input
 Finally, a third alternative to these variables is
 @code{redisplay-skip-fontification-on-input}.  If this variable is
-non-@code{nil}, skip some fontifications is there's input pending.
+non-@code{nil}, skip some fontifications if there's input pending.
 This usually does not affect the display because redisplay is
 completely skipped anyway if input was pending, but it can make
 scrolling smoother by avoiding unnecessary fontification.
diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi
index 308145def55..6015c134d21 100644
--- a/doc/lispref/customize.texi
+++ b/doc/lispref/customize.texi
@@ -378,8 +378,15 @@ the option as a Lisp variable); preferably, though, it 
should not
 modify its value argument destructively.  The default for
 @var{setfunction} is @code{set-default-toplevel-value}.
 
+If defined, @var{setfunction} will also be called when evaluating a
+@code{defcustom} form with @kbd{C-M-x} in Emacs Lisp mode and when the
+@var{option}'s value is changed via the @code{setopt} macro
+(@pxref{Setting Variables, setopt}).
+
 If you specify this keyword, the variable's documentation string
-should describe how to do the same job in hand-written Lisp code.
+should describe how to do the same job in hand-written Lisp code,
+either by invoking @var{setfunction} directly or by using
+@code{setopt}.
 
 @item :get @var{getfunction}
 @kindex get@r{, @code{defcustom} keyword}
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 0a48beab8b8..4c13185b0dd 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -3765,18 +3765,19 @@ Consecutive characters with the same @code{field} 
property constitute a
 @item cursor
 @kindex cursor @r{(text property)}
 Normally, the cursor is displayed at the beginning or the end of any
-overlay and text property strings present at the current buffer
-position.  You can instead tell Emacs to place the cursor on any
-desired character of these strings by giving that character a
-non-@code{nil} @code{cursor} text property.  In addition, if the value
-of the @code{cursor} property is an integer, it specifies the number
-of buffer's character positions, starting with the position where the
-overlay or the @code{display} property begins, for which the cursor
-should be displayed on that character.  Specifically, if the value of
-the @code{cursor} property of a character is the number @var{n}, the
-cursor will be displayed on this character for any buffer position in
-the range @code{[@var{ovpos}..@var{ovpos}+@var{n})}, where @var{ovpos}
-is the overlay's starting position given by @code{overlay-start}
+overlay and text property strings that ``hide'' (i.e., are displayed
+instead of) the current buffer position.  You can instead tell Emacs
+to place the cursor on any desired character of these strings by
+giving that character a non-@code{nil} @code{cursor} text property.
+In addition, if the value of the @code{cursor} property is an integer,
+it specifies the number of buffer's character positions, starting with
+the position where the overlay or the @code{display} property begins,
+for which the cursor should be displayed on that character.
+Specifically, if the value of the @code{cursor} property of a
+character is the number @var{n}, the cursor will be displayed on this
+character for any buffer position in the range
+@code{[@var{ovpos}..@var{ovpos}+@var{n})}, where @var{ovpos} is the
+overlay's starting position given by @code{overlay-start}
 (@pxref{Managing Overlays}), or the position where the @code{display}
 text property begins in the buffer.
 
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 46ef5146136..65892f8621e 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -2383,10 +2383,11 @@ This uses also the settings in 
@code{tramp-sh-extra-args}.
 @vindex RemoteCommand@r{, ssh option}
 @strong{Note}: If you use an @option{ssh}-based method for connection,
 do @emph{not} set the @option{RemoteCommand} option in your
-@command{ssh} configuration, for example to @command{screen}.  On the
-other hand, some @option{ssh}-based methods, like @option{sshx} or
-@option{scpx}, silently overwrite a @option{RemoteCommand} option of
-the configuration file.
+@command{ssh} configuration to something like @command{screen}.  If
+used, @option{RemoteCommand} must open an interactive shell on the
+remote host.  On the other hand, some @option{ssh}-based methods, like
+@option{sshx} or @option{scpx}, silently overwrite a
+@option{RemoteCommand} option of the configuration file.
 
 
 @subsection Other remote shell setup hints
diff --git a/lisp/custom.el b/lisp/custom.el
index fa77e5c2c56..083349e3591 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -280,7 +280,9 @@ The following keywords are meaningful:
        when using the Customize user interface.  It takes two arguments,
        the symbol to set and the value to give it.  The function should
        not modify its value argument destructively.  The default choice
-       of function is `set-default-toplevel-value'.
+       of function is `set-default-toplevel-value'.  If this keyword is
+       defined, modifying the value of SYMBOL via `setopt' will call the
+       function specified by VALUE to install the new value.
 :get   VALUE should be a function to extract the value of symbol.
        The function takes one argument, a symbol, and should return
        the current value for that symbol.  The default choice of function
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index a5ed5df117d..841b0ebf29d 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -1764,27 +1764,32 @@ Return value is the fall-through block name."
     (_ (signal 'native-ice
                '("missing previous setimm while creating a switch")))))
 
+(defun comp--func-arity (subr-name)
+  "Like `func-arity' but invariant against primitive redefinitions.
+SUBR-NAME is the name of function."
+  (or (gethash subr-name comp-subr-arities-h)
+      (func-arity subr-name)))
+
 (defun comp-emit-set-call-subr (subr-name sp-delta)
     "Emit a call for SUBR-NAME.
 SP-DELTA is the stack adjustment."
-    (let ((subr (symbol-function subr-name))
-          (nargs (1+ (- sp-delta))))
-      (let* ((arity (func-arity subr))
-             (minarg (car arity))
-             (maxarg (cdr arity)))
-        (when (eq maxarg 'unevalled)
-          (signal 'native-ice (list "subr contains unevalled args" subr-name)))
-        (if (eq maxarg 'many)
-            ;; callref case.
-            (comp-emit-set-call (comp-callref subr-name nargs (comp-sp)))
-          ;; Normal call.
-          (unless (and (>= maxarg nargs) (<= minarg nargs))
-            (signal 'native-ice
-                    (list "incoherent stack adjustment" nargs maxarg minarg)))
-          (let* ((subr-name subr-name)
-                 (slots (cl-loop for i from 0 below maxarg
-                                 collect (comp-slot-n (+ i (comp-sp))))))
-            (comp-emit-set-call (apply #'comp-call (cons subr-name 
slots))))))))
+    (let* ((nargs (1+ (- sp-delta)))
+           (arity (comp--func-arity subr-name))
+           (minarg (car arity))
+           (maxarg (cdr arity)))
+      (when (eq maxarg 'unevalled)
+        (signal 'native-ice (list "subr contains unevalled args" subr-name)))
+      (if (eq maxarg 'many)
+          ;; callref case.
+          (comp-emit-set-call (comp-callref subr-name nargs (comp-sp)))
+        ;; Normal call.
+        (unless (and (>= maxarg nargs) (<= minarg nargs))
+          (signal 'native-ice
+                  (list "incoherent stack adjustment" nargs maxarg minarg)))
+        (let* ((subr-name subr-name)
+               (slots (cl-loop for i from 0 below maxarg
+                               collect (comp-slot-n (+ i (comp-sp))))))
+          (comp-emit-set-call (apply #'comp-call (cons subr-name slots)))))))
 
 (eval-when-compile
   (defun comp-op-to-fun (x)
diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index ba3a75851ca..ddc7ec4679b 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -41,9 +41,6 @@
 
 ;; - Allow maintaining patches that are ported back onto regular
 ;;   packages and maintained between versions.
-;;
-;; - Add a heuristic for guessing a `:lisp-dir' when cloning directly
-;;  from a URL.
 
 ;;; Code:
 
@@ -58,7 +55,7 @@
 (defgroup package-vc nil
   "Manage packages from VC checkouts."
   :group 'package
-  :link '(custom-manual "(emacs) Package from Source")
+  :link '(custom-manual "(emacs) Fetching Package Sources")
   :prefix "package-vc-"
   :version "29.1")
 
diff --git a/lisp/help.el b/lisp/help.el
index 3e94b5046e5..6eac037df2c 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -689,6 +689,10 @@ To record all your input, use `open-dribble-file'."
       (with-current-buffer standard-output
        (goto-char (point-min))
        (let ((comment-start ";; ")
+              ;; Prevent 'comment-indent' from handling a single
+              ;; semicolon as the beginning of a comment.
+              (comment-start-skip ";; ")
+              (comment-use-syntax nil)
               (comment-column 24))
           (while (not (eobp))
             (comment-indent)
diff --git a/lisp/loadup.el b/lisp/loadup.el
index 46b26750cd5..1cc70348267 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -476,7 +476,13 @@ lost after dumping")))
 ;; At this point, we're ready to resume undo recording for scratch.
 (buffer-enable-undo "*scratch*")
 
+(defvar comp-subr-arities-h)
 (when (featurep 'native-compile)
+  ;; Save the arity for all primitives so the compiler can always
+  ;; retrive it even in case of redefinition.
+  (mapatoms (lambda (f)
+              (when (subr-primitive-p (symbol-function f))
+                (puthash f (func-arity f) comp-subr-arities-h))))
   ;; Fix the compilation unit filename to have it working when
   ;; installed or if the source directory got moved.  This is set to be
   ;; a pair in the form of:
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 1b42ef4e919..808f2295e52 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -64,22 +64,23 @@ The action to be taken can be further customized via
   :version "28.1"
   :type 'regexp)
 
-(defcustom eww-download-directory "~/Downloads/"
-  "Default directory where `eww' saves downloaded files."
+(defcustom eww-default-download-directory "~/Downloads/"
+  "Default directory where `eww' saves downloaded files.
+Used by `eww--download-directory', which see."
   :version "29.1"
   :group 'eww
   :type 'directory)
 
 (defun eww--download-directory ()
   "Return the name of the EWW download directory.
-The default is specified by `eww-download-directory'; however,
+The default is specified by `eww-default-download-directory'; however,
 if that directory doesn't exist and the DOWNLOAD XDG user directory
 is defined, use the latter instead."
-  (or (and (file-exists-p eww-download-directory)
-           eww-download-directory)
+  (or (and (file-exists-p eww-default-download-directory)
+           eww-default-download-directory)
       (when-let ((dir (xdg-user-dir "DOWNLOAD")))
         (file-name-as-directory dir))
-      eww-download-directory))
+      eww-default-download-directory))
 
 (defcustom eww-download-directory 'eww--download-directory
   "Directory where files will downloaded.
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 0112af52c01..93af5f2123b 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -1641,10 +1641,9 @@ If optional MARKER, return a marker instead"
                (normalized (if (and (not remote-prefix)
                                     (eq system-type 'windows-nt)
                                     (cl-plusp (length retval)))
-                               (substring retval 1)
+                               (w32-long-file-name (substring retval 1))
                              retval)))
           (concat remote-prefix normalized))
-
       uri)))
 
 (defun eglot--snippet-expansion-fn ()
@@ -1916,6 +1915,7 @@ Use `eglot-managed-p' to determine if current buffer is 
managed.")
 (defun eglot--managed-mode-off ()
   "Turn off `eglot--managed-mode' unconditionally."
   (remove-overlays nil nil 'eglot--overlay t)
+  (eglot-inlay-hints-mode -1)
   (eglot--managed-mode -1))
 
 (defun eglot-current-server ()
diff --git a/lisp/progmodes/typescript-ts-mode.el 
b/lisp/progmodes/typescript-ts-mode.el
index b21b1fd2cef..ef87bb29d52 100644
--- a/lisp/progmodes/typescript-ts-mode.el
+++ b/lisp/progmodes/typescript-ts-mode.el
@@ -41,6 +41,16 @@
   :safe 'integerp
   :group 'typescript)
 
+(defface typescript-ts-jsx-tag-face
+  '((t . (:inherit font-lock-function-call-face)))
+  "Face for HTML tags like <div> and <p> in JSX."
+  :group 'typescript)
+
+(defface typescript-ts-jsx-attribute-face
+  '((t . (:inherit font-lock-constant-face)))
+  "Face for HTML attributes like name and id in JSX."
+  :group 'typescript)
+
 (defvar typescript-ts-mode--syntax-table
   (let ((table (make-syntax-table)))
     ;; Taken from the cc-langs version
@@ -284,17 +294,17 @@ Argument LANGUAGE is either `typescript' or `tsx'."
    :feature 'jsx
    `((jsx_opening_element
       [(nested_identifier (identifier)) (identifier)]
-      @font-lock-function-call-face)
+      @typescript-ts-jsx-tag-face)
 
      (jsx_closing_element
       [(nested_identifier (identifier)) (identifier)]
-      @font-lock-function-call-face)
+      @typescript-ts-jsx-tag-face)
 
      (jsx_self_closing_element
       [(nested_identifier (identifier)) (identifier)]
-      @font-lock-function-call-face)
+      @typescript-ts-jsx-tag-face)
 
-     (jsx_attribute (property_identifier) @font-lock-constant-face))
+     (jsx_attribute (property_identifier) @typescript-ts-jsx-attribute-face))
 
    :language language
    :feature 'number
@@ -438,7 +448,12 @@ See `treesit-sexp-type-regexp' for more information.")
 
 ;;;###autoload
 (define-derived-mode tsx-ts-mode typescript-ts-base-mode "TypeScript[TSX]"
-  "Major mode for editing TypeScript."
+  "Major mode for editing TSX and JSX documents.
+
+This major mode defines two additional JSX-specific faces:
+`typescript-ts-jsx-attribute-face' and
+`typescript-ts-jsx-attribute-face' that are used for HTML tags
+and attributes, respectively."
   :group 'typescript
   :syntax-table typescript-ts-mode--syntax-table
 
diff --git a/src/comp.c b/src/comp.c
index 5cbe441dd7f..9ff3efedbdd 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -5910,6 +5910,14 @@ For internal use.  */);
   Vcomp_loaded_comp_units_h =
     CALLN (Fmake_hash_table, QCweakness, Qvalue, QCtest, Qequal);
 
+  DEFVAR_LISP ("comp-subr-arities-h", Vcomp_subr_arities_h,
+    doc: /* Hash table recording the arity of Lisp primitives.
+This is in case they are redefined so the compiler still knows how to
+compile calls to them.
+subr-name -> arity
+For internal use.  */);
+  Vcomp_subr_arities_h = CALLN (Fmake_hash_table, QCtest, Qequal);
+
   Fprovide (intern_c_string ("native-compile"), Qnil);
 #endif /* #ifdef HAVE_NATIVE_COMP */
 
diff --git a/src/xdisp.c b/src/xdisp.c
index 754a7c16c76..76d6592bf00 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -18546,8 +18546,9 @@ try_scrolling (Lisp_Object window, bool just_this_one_p,
          start_display (&it, w, startp);
 
          if (arg_scroll_conservatively)
-           amount_to_scroll = max (dy, frame_line_height
-                                   * max (scroll_step, temp_scroll_step));
+           amount_to_scroll
+             = min (max (dy, frame_line_height),
+                    frame_line_height * arg_scroll_conservatively);
          else if (scroll_step || temp_scroll_step)
            amount_to_scroll = scroll_max;
          else
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index 926ba27e563..c5e5b346adb 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -446,7 +446,7 @@ 
https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html.";
           (should (equal comp-test-primitive-advice '(3 4))))
       (advice-remove #'+ f))))
 
-(defvar comp-test-primitive-redefine-args)
+(defvar comp-test-primitive-redefine-args nil)
 (comp-deftest primitive-redefine ()
   "Test effectiveness of primitive redefinition."
   (cl-letf ((comp-test-primitive-redefine-args nil)
@@ -532,6 +532,22 @@ 
https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html.";
   (should (subr-native-elisp-p
            (symbol-function 'comp-test-48029-nonascii-žžž-f))))
 
+(comp-deftest 61917-1 ()
+  "Verify we can compile calls to redefined primitives with
+dedicated byte-op code."
+  (let (x
+        (f (lambda (fn &rest args)
+             (setq comp-test-primitive-redefine-args args))))
+    (advice-add #'delete-region :around f)
+    (unwind-protect
+        (setf x (native-compile
+                 '(lambda ()
+                    (delete-region 1 2))))
+      (should (subr-native-elisp-p x))
+      (funcall x)
+      (advice-remove #'delete-region f)
+      (should (equal comp-test-primitive-redefine-args '(1 2))))))
+
 
 ;;;;;;;;;;;;;;;;;;;;;
 ;; Tromey's tests. ;;



reply via email to

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