emacs-diffs
[Top][All Lists]
Advanced

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

master a463dccdd0: Merge from origin/emacs-28


From: Stefan Kangas
Subject: master a463dccdd0: Merge from origin/emacs-28
Date: Sun, 24 Jul 2022 04:11:20 -0400 (EDT)

branch: master
commit a463dccdd0b33fd329419601eecddb109057233e
Merge: 279eb4e6ab b4067394dc
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    Merge from origin/emacs-28
    
    b4067394dc Set `default-directory' of Tramp archive connection buffer
    2529e82002 ; * doc/lispref/functions.texi (Declare Form): Fix typo.
    54c4ceb009 Update the documentation of 'declare' forms
    7263631dca Fix bookmark support for Help functions in native-compilat...
    
    # Conflicts:
    #       lisp/help.el
---
 doc/lispref/compile.texi   |  4 +++-
 doc/lispref/functions.texi | 24 ++++++++++++++++++++++++
 lisp/help-fns.el           | 10 +++-------
 lisp/help.el               | 17 +++++++++++++----
 lisp/net/tramp-archive.el  |  7 +++++++
 5 files changed, 50 insertions(+), 12 deletions(-)

diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi
index 9bb7b590a2..60fc11a22e 100644
--- a/doc/lispref/compile.texi
+++ b/doc/lispref/compile.texi
@@ -981,7 +981,9 @@ corresponding compiler @option{-O0}, @option{-O1}, etc.@: 
command-line
 options of the compiler.  The value @minus{}1 means disable
 native-compilation: functions and files will be only byte-compiled;
 however, the @file{*.eln} files will still be produced, they will just
-contain the compiled code in bytecode form.
+contain the compiled code in bytecode form.  (This can be achieved at
+function granularity by using the @w{@code{(declare (speed -1))}}
+form, @pxref{Declare Form}.)
 The default value is 2.
 @end defopt
 
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index e3de6009e9..8e8cc5fd9c 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -2497,6 +2497,30 @@ the current buffer.
 @item (modes @var{modes})
 Specify that this command is meant to be applicable for @var{modes}
 only.
+
+@item (pure @var{val})
+If @var{val} is non-@code{nil}, this function is @dfn{pure}
+(@pxref{What Is a Function}).  This is the same as the @code{pure}
+property of the function's symbol (@pxref{Standard Properties}).
+
+@item (side-effect-free @var{val})
+If @var{val} is non-@code{nil}, this function is free of side effects,
+so the byte compiler can ignore calls whose value is ignored.  This is
+the same as the @code{side-effect-free} property of the function's
+symbol, @pxref{Standard Properties}.
+
+@item (speed @var{n})
+Specify the value of @code{native-comp-speed} in effect for native
+compilation of this function (@pxref{Native-Compilation Variables}).
+This allows function-level control of the optimization level used for
+native code emitted for the function.  In particular, if @var{n} is
+@minus{}1, native compilation of the function will emit bytecode
+instead of native code for the function.
+
+@item no-font-lock-keyword
+This is valid for macros only.  Macros with this declaration are
+highlighted by font-lock (@pxref{Font Lock Mode}) as normal functions,
+not specially as macros.
 @end table
 
 @end defmac
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index efee44f7b3..768023b54c 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -266,13 +266,9 @@ handling of autoloaded functions."
              (current-buffer)))
         (help-buffer-under-preparation t))
 
-    (help-setup-xref
-     (list (lambda (function buffer)
-             (let ((describe-function-orig-buffer
-                    (if (buffer-live-p buffer) buffer)))
-               (describe-function function)))
-           function describe-function-orig-buffer)
-     (called-interactively-p 'interactive))
+    (help-setup-xref (list #'describe-function--helper
+                           function describe-function-orig-buffer)
+                     (called-interactively-p 'interactive))
 
     (save-excursion
       (with-help-window (help-buffer)
diff --git a/lisp/help.el b/lisp/help.el
index d9e553e4e1..65c537d119 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -906,6 +906,18 @@ Describe the following key, mouse click, or menu item: "
 ;; Defined in help-fns.el.
 (defvar describe-function-orig-buffer)
 
+;; These two are named functions because lambda-functions cannot be
+;; serialized in a native-compilation build, which breaks bookmark
+;; support in help-mode.el.
+(defun describe-key--helper (key-list buf)
+  (describe-key key-list
+                (if (buffer-live-p buf) buf)))
+
+(defun describe-function--helper (func buf)
+  (let ((describe-function-orig-buffer
+         (if (buffer-live-p buf) buf)))
+    (describe-function func)))
+
 (defun describe-key (&optional key-list buffer up-event)
   "Display documentation of the function invoked by KEY-LIST.
 KEY-LIST can be any kind of a key sequence; it can include keyboard events,
@@ -959,10 +971,7 @@ current buffer."
                          `(,seq ,brief-desc ,defn ,locus)))
                      key-list))
            2)))
-    (help-setup-xref (list (lambda (key-list buf)
-                             (describe-key key-list
-                                           (if (buffer-live-p buf) buf)))
-                           key-list buf)
+    (help-setup-xref (list #'describe-key--helper key-list buf)
                     (called-interactively-p 'interactive))
     (if (and (<= (length info-list) 1)
              (help--binding-undefined-p (nth 2 (car info-list))))
diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el
index 119ac54dd2..47f14861e3 100644
--- a/lisp/net/tramp-archive.el
+++ b/lisp/net/tramp-archive.el
@@ -348,6 +348,13 @@ arguments to pass to the OPERATION."
                (tramp-archive-run-real-handler
                  #'file-directory-p (list archive)))
             (tramp-archive-run-real-handler operation args)
+         ;; The default directory of the Tramp connection buffer
+         ;; cannot be accessed.  (Bug#56628)
+         ;; FIXME: It is superfluous to set it every single loop.
+         ;; But there is no place to set it when creating the buffer.
+         (with-current-buffer
+             (tramp-get-buffer (tramp-archive-dissect-file-name filename))
+           (setq default-directory (file-name-as-directory archive)))
           ;; Now run the handler.
           (let ((tramp-methods (cons `(,tramp-archive-method) tramp-methods))
                (tramp-gvfs-methods tramp-archive-all-gvfs-methods)



reply via email to

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