emacs-diffs
[Top][All Lists]
Advanced

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

feature/native-comp 6664f98 1/7: Merge remote-tracking branch 'savannah/


From: Andrea Corallo
Subject: feature/native-comp 6664f98 1/7: Merge remote-tracking branch 'savannah/master' into HEAD
Date: Sun, 1 Mar 2020 14:41:55 -0500 (EST)

branch: feature/native-comp
commit 6664f98821d46347a328337c7bcccac3f75c05e3
Merge: 86cc937 13a69c8
Author: Andrea Corallo <address@hidden>
Commit: Andrea Corallo <address@hidden>

    Merge remote-tracking branch 'savannah/master' into HEAD
---
 doc/emacs/building.texi      |  7 -------
 etc/NEWS                     |  5 +++++
 lisp/emacs-lisp/eldoc.el     | 19 +++++++----------
 lisp/emulation/viper-mous.el | 50 +++++++-------------------------------------
 lisp/emulation/viper-util.el |  1 +
 lisp/gnus/nnbabyl.el         |  2 +-
 lisp/gnus/nndiary.el         |  2 +-
 lisp/gnus/nnfolder.el        |  2 +-
 lisp/gnus/nnmail.el          |  8 ++++---
 lisp/gnus/nnmbox.el          |  2 +-
 lisp/gnus/nnml.el            |  2 +-
 lisp/ldefs-boot.el           | 34 +++++++++++++++++-------------
 lisp/net/tramp-adb.el        | 13 ++++++------
 lisp/net/tramp-sh.el         | 30 +++++++++++++-------------
 lisp/net/tramp-smb.el        | 16 +++++++-------
 lisp/net/tramp-sudoedit.el   | 16 +++++++-------
 lisp/progmodes/cperl-mode.el |  2 +-
 lisp/progmodes/pascal.el     |  2 +-
 lisp/subr.el                 |  3 +++
 src/gtkutil.c                |  7 -------
 src/lread.c                  | 23 +++++---------------
 src/nsterm.m                 |  5 -----
 src/pdumper.c                |  2 +-
 test/lisp/net/tramp-tests.el | 28 ++++++++++++++++---------
 test/src/timefns-tests.el    | 46 ++++++++++++++++++++--------------------
 25 files changed, 140 insertions(+), 187 deletions(-)

diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi
index 02f1886..272b08d 100644
--- a/doc/emacs/building.texi
+++ b/doc/emacs/building.texi
@@ -1528,13 +1528,6 @@ Automatic loading also occurs when completing names for
 prefix being completed.  To disable this feature, change the variable
 @code{help-enable-completion-autoload} to @code{nil}.
 
-@vindex load-dangerous-libraries
-@cindex Lisp files byte-compiled by XEmacs
-  By default, Emacs refuses to load compiled Lisp files which were
-compiled with XEmacs, a modified version of Emacs---they can cause
-Emacs to crash.  Set the variable @code{load-dangerous-libraries} to
-@code{t} if you want to try loading them.
-
 @node Lisp Eval
 @section Evaluating Emacs Lisp Expressions
 @cindex Emacs Lisp mode
diff --git a/etc/NEWS b/etc/NEWS
index ee3a3c1..7f70d14 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -202,6 +202,11 @@ Emacs now supports bignums so this old glitch is no longer 
needed.
 'previous-system-time-locale' have been removed, as they were created
 by mistake and were not useful to Lisp code.
 
+** The 'load-dangerous-libraries' variable is now obsolete.
+It was used to allow loading Lisp libraries compiled by XEmacs, a
+modified version of Emacs which is no longer actively maintained.
+This is no longer supported, and setting this variable has no effect.
+
 
 * Lisp Changes in Emacs 28.1
 
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 456a650..6e35018 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -233,14 +233,6 @@ See `eldoc-documentation-function' for more detail."
   (when (eldoc--supported-p)
     (eldoc-mode 1)))
 
-(defun eldoc--supported-p ()
-  "Non-nil if an ElDoc function is set for this buffer."
-  (let ((hook 'eldoc-documentation-functions))
-    (and (not (memq eldoc-documentation-function '(nil ignore)))
-         (or (and (local-variable-p hook)
-                  (buffer-local-value hook (current-buffer)))
-             (default-value hook)))))
-
 
 (defun eldoc-schedule-timer ()
   "Ensure `eldoc-timer' is running.
@@ -405,11 +397,15 @@ effect."
   :link '(info-link "(emacs) Lisp Doc")
   :type '(radio (function-item eldoc-documentation-default)
                 (function-item eldoc-documentation-compose)
-                (function :tag "Other function")
-                (const :tag "None" nil))
+                (function :tag "Other function"))
   :version "28.1"
   :group 'eldoc)
 
+(defun eldoc--supported-p ()
+  "Non-nil if an ElDoc function is set for this buffer."
+  (and (not (memq eldoc-documentation-function '(nil ignore)))
+       eldoc-documentation-functions))
+
 (defun eldoc-print-current-symbol-info ()
   "Print the text produced by `eldoc-documentation-function'."
   ;; This is run from post-command-hook or some idle timer thing,
@@ -423,8 +419,7 @@ effect."
         ;; Only keep looking for the info as long as the user hasn't
         ;; requested our attention.  This also locally disables inhibit-quit.
         (while-no-input
-          (let ((fun eldoc-documentation-function))
-            (when fun (eldoc-message (funcall fun)))))))))
+          (eldoc-message (funcall eldoc-documentation-function)))))))
 
 ;; If the entire line cannot fit in the echo area, the symbol name may be
 ;; truncated or eliminated entirely from the output to make room for the
diff --git a/lisp/emulation/viper-mous.el b/lisp/emulation/viper-mous.el
index 294705f..6ecfec5 100644
--- a/lisp/emulation/viper-mous.el
+++ b/lisp/emulation/viper-mous.el
@@ -66,20 +66,13 @@ or a triple-click."
 ;; time interval in millisecond within which successive clicks are
 ;; considered related
 (defcustom viper-multiclick-timeout (if (viper-window-display-p)
-                                     (if (featurep 'xemacs)
-                                         mouse-track-multi-click-time
-                                       double-click-time)
+                                        double-click-time
                                    500)
   "Time interval in millisecond within which successive mouse clicks are
 considered related."
   :type 'integer
   :group 'viper-mouse)
 
-;; current event click count; XEmacs only
-(defvar viper-current-click-count 0)
-;; time stamp of the last click event; XEmacs only
-(defvar viper-last-click-event-timestamp 0)
-
 ;; Local variable used to toggle wraparound search on click.
 (viper-deflocalvar  viper-mouse-click-search-noerror t)
 
@@ -279,11 +272,9 @@ See `viper-surrounding-word' for the definition of a word 
in this case."
               (setq interrupting-event (read-event))
               (viper-mouse-event-p last-input-event)))
            (progn ; interrupted wait
-             (setq viper-global-prefix-argument arg)
-             ;; count this click for XEmacs
-             (viper-event-click-count click))
+              (setq viper-global-prefix-argument arg))
          ;; uninterrupted wait or the interrupting event wasn't a mouse event
-         (setq click-count (viper-event-click-count click))
+          (setq click-count (event-click-count click))
          (if (> click-count 1)
              (setq arg viper-global-prefix-argument
                    viper-global-prefix-argument nil))
@@ -300,33 +291,8 @@ See `viper-surrounding-word' for the definition of a word 
in this case."
       (string-match "\\(mouse-\\|frame\\|screen\\|track\\)"
                    (prin1-to-string (viper-event-key event)))))
 
-;; XEmacs has no double-click events.  So, we must simulate.
-;; So, we have to simulate event-click-count.
-(defun viper-event-click-count (click)
-  (if (featurep 'xemacs) (viper-event-click-count-xemacs click)
-    (event-click-count click)))
-
-(when (featurep 'xemacs)
-
-  ;; kind of semaphore for updating viper-current-click-count
-  (defvar viper-counting-clicks-p nil)
-
-  (defun viper-event-click-count-xemacs (click)
-    (let ((time-delta (- (event-timestamp click)
-                        viper-last-click-event-timestamp))
-         inhibit-quit)
-      (while viper-counting-clicks-p
-       (ignore))
-      (setq viper-counting-clicks-p t)
-      (if (> time-delta viper-multiclick-timeout)
-         (setq viper-current-click-count 0))
-      (discard-input)
-      (setq viper-current-click-count (1+ viper-current-click-count)
-           viper-last-click-event-timestamp (event-timestamp click))
-      (setq viper-counting-clicks-p nil)
-      (if (viper-sit-for-short viper-multiclick-timeout t)
-         viper-current-click-count
-       0))))
+(define-obsolete-function-alias 'viper-event-click-count
+  'event-click-count "28.1")
 
 (declare-function viper-forward-word "viper-cmd" (arg))
 (declare-function viper-adjust-window "viper-cmd" ())
@@ -364,11 +330,9 @@ this command.
            (setq viper-global-prefix-argument (or viper-global-prefix-argument
                                                   arg)
                  ;; remember command that was before the multiclick
-                 this-command last-command)
-           ;; make sure we counted this event---needed for XEmacs only
-           (viper-event-click-count click))
+                  this-command last-command))
        ;; uninterrupted wait
-       (setq click-count (viper-event-click-count click))
+        (setq click-count (event-click-count click))
        (setq click-word (viper-mouse-click-get-word click nil click-count))
 
        (if (> click-count 1)
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index ebad850..1561204 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -205,6 +205,7 @@ Otherwise return the normal value."
 ;; incorrect.  However, this gives correct result in our cases, since we are
 ;; testing for sufficiently high Emacs versions.
 (defun viper-check-version (op major minor &optional type-of-emacs)
+  (declare (obsolete nil "28.1"))
   (if (and (boundp 'emacs-major-version) (boundp 'emacs-minor-version))
       (and (cond ((eq type-of-emacs 'xemacs) (featurep 'xemacs))
                 ((eq type-of-emacs 'emacs) (featurep 'emacs))
diff --git a/lisp/gnus/nnbabyl.el b/lisp/gnus/nnbabyl.el
index cb22933..480d794 100644
--- a/lisp/gnus/nnbabyl.el
+++ b/lisp/gnus/nnbabyl.el
@@ -544,7 +544,7 @@
       (setq buffer-file-name nnbabyl-mbox-file)
       (insert "BABYL OPTIONS:\n\n\^_")
       (nnmail-write-region
-       (point-min) (point-max) nnbabyl-mbox-file t 'nomesg))))
+       (point-min) (point-max) nnbabyl-mbox-file t 'nomesg nil 'excl))))
 
 (defun nnbabyl-read-mbox ()
   (nnmail-activate 'nnbabyl)
diff --git a/lisp/gnus/nndiary.el b/lisp/gnus/nndiary.el
index ac394ae..945ef03 100644
--- a/lisp/gnus/nndiary.el
+++ b/lisp/gnus/nndiary.el
@@ -1115,7 +1115,7 @@ all.  This may very well take some time.")
          (widen))
        (setq files (cdr files)))
       (with-current-buffer nov-buffer
-       (nnmail-write-region 1 (point-max) nov nil 'nomesg)
+       (nnmail-write-region 1 (point-max) nov nil 'nomesg nil 'excl)
        (kill-buffer (current-buffer))))))
 
 (defun nndiary-nov-delete-article (group article)
diff --git a/lisp/gnus/nnfolder.el b/lisp/gnus/nnfolder.el
index d1eeb04..c27af17 100644
--- a/lisp/gnus/nnfolder.el
+++ b/lisp/gnus/nnfolder.el
@@ -735,7 +735,7 @@ deleted.  Point is left where the deleted region was."
                       (or nnfolder-file-coding-system-for-write
                           nnfolder-file-coding-system-for-write)))
                  (nnmail-write-region (point-min) (point-min)
-                                      file t 'nomesg)))
+                                      file t 'nomesg nil 'excl)))
              (when (setq nnfolder-current-buffer (nnfolder-read-folder group))
                (set-buffer nnfolder-current-buffer)
                (push (list group nnfolder-current-buffer)
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el
index 93e4b0e..3be843c 100644
--- a/lisp/gnus/nnmail.el
+++ b/lisp/gnus/nnmail.el
@@ -1953,12 +1953,14 @@ If TIME is nil, then return the cutoff time for oldness 
instead."
       (unless (re-search-forward "^Message-ID[ \t]*:" nil t)
        (insert "Message-ID: " (nnmail-message-id) "\n")))))
 
-(defun nnmail-write-region (start end filename &optional append visit lockname)
+(defun nnmail-write-region (start end filename
+                                 &optional append visit lockname mustbenew)
   "Do a `write-region', and then set the file modes."
   (let ((coding-system-for-write nnmail-file-coding-system)
        (file-name-coding-system nnmail-pathname-coding-system))
-    (write-region start end filename append visit lockname)
-    (set-file-modes filename nnmail-default-file-modes 'nofollow)))
+    (write-region start end filename append visit lockname mustbenew)
+    (set-file-modes filename nnmail-default-file-modes
+                   (when (eq mustbenew 'excl) 'nofollow))))
 
 ;;;
 ;;; Status functions
diff --git a/lisp/gnus/nnmbox.el b/lisp/gnus/nnmbox.el
index a191f88..8b3d802 100644
--- a/lisp/gnus/nnmbox.el
+++ b/lisp/gnus/nnmbox.el
@@ -613,7 +613,7 @@
          (dir (file-name-directory nnmbox-mbox-file)))
       (and dir (gnus-make-directory dir))
       (nnmail-write-region (point-min) (point-min)
-                          nnmbox-mbox-file t 'nomesg))))
+                          nnmbox-mbox-file t 'nomesg nil 'excl))))
 
 (defun nnmbox-read-mbox ()
   (nnmail-activate 'nnmbox)
diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el
index 2c39ab8..baf5d54 100644
--- a/lisp/gnus/nnml.el
+++ b/lisp/gnus/nnml.el
@@ -901,7 +901,7 @@ Unless no-active is non-nil, update the active file too."
                (nnheader-insert-nov headers)))
            (widen))))
       (with-current-buffer nov-buffer
-       (nnmail-write-region (point-min) (point-max) nov nil 'nomesg)
+       (nnmail-write-region (point-min) (point-max) nov nil 'nomesg nil 'excl)
        (kill-buffer (current-buffer))))))
 
 (defun nnml-nov-delete-article (group article)
diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el
index 2246e5f..8776e9b 100644
--- a/lisp/ldefs-boot.el
+++ b/lisp/ldefs-boot.el
@@ -15720,6 +15720,13 @@ BUFFER should be a buffer or a buffer name.
 
 \(fn &optional BUFFER)" t nil)
 
+(autoload 'describe-keymap "help-fns" "\
+Describe key bindings in KEYMAP.
+When called interactively, prompt for a variable that has a
+keymap value.
+
+\(fn KEYMAP)" t nil)
+
 (autoload 'doc-file-to-man "help-fns" "\
 Produce an nroff buffer containing the doc-strings from the DOC file.
 
@@ -20409,7 +20416,7 @@ Default bookmark handler for Man buffers.
 
 ;;;### (autoloads nil "map" "emacs-lisp/map.el" (0 0 0 0))
 ;;; Generated autoloads from emacs-lisp/map.el
-(push (purecopy '(map 2 0)) package--builtin-versions)
+(push (purecopy '(map 2 1)) package--builtin-versions)
 
 (if (fboundp 'register-definition-prefixes) (register-definition-prefixes 
"map" '("map-")))
 
@@ -27422,11 +27429,8 @@ nil
     necessary to ensure that a postfix operator appended to it will
     apply to the whole expression.
 
-The optional argument KEEP-ORDER, if non-nil, forces the match to
-be performed in the order given, as if the strings were made into
-a regexp by joining them with the `\\|' operator.  If nil or
-omitted, the returned regexp is will always match the longest
-string possible.
+The returned regexp is ordered in such a way that it will always
+match the longest string possible.
 
 Up to reordering, the resulting regexp is equivalent to but
 usually more efficient than that of a simplified version:
@@ -27442,7 +27446,7 @@ usually more efficient than that of a simplified 
version:
              (mapconcat \\='regexp-quote strings \"\\\\|\")
              (cdr parens))))
 
-\(fn STRINGS &optional PAREN KEEP-ORDER)" nil nil)
+\(fn STRINGS &optional PAREN)" nil nil)
 
 (autoload 'regexp-opt-depth "regexp-opt" "\
 Return the depth of REGEXP.
@@ -30122,11 +30126,9 @@ following commands are available, based on the current 
shell's syntax:
 \\[sh-while]    while loop
 
 For sh and rc shells indentation commands are:
-\\[sh-show-indent]     Show the variable controlling this line's indentation.
-\\[sh-set-indent]      Set then variable controlling this line's indentation.
-\\[sh-learn-line-indent]       Change the indentation variable so this line
-would indent to the way it currently is.
-\\[sh-learn-buffer-indent]  Set the indentation variables so the
+\\[smie-config-show-indent]    Show the rules controlling this line's 
indentation.
+\\[smie-config-set-indent]     Change the rules controlling this line's 
indentation.
+\\[smie-config-guess]  Try to tweak the indentation rules so the
 buffer indents as it currently is indented.
 
 
@@ -31063,7 +31065,11 @@ Use \\[untabify] to convert tabs to spaces before 
sorting.
 
 (autoload 'reverse-region "sort" "\
 Reverse the order of lines in a region.
-From a program takes two point or marker arguments, BEG and END.
+When called from Lisp, takes two point or marker arguments, BEG and END.
+If BEG is not at the beginning of a line, the first line of those
+to be reversed is the line starting after BEG.
+If END is not at the end of a line, the last line to be reversed
+is the one that ends before END.
 
 \(fn BEG END)" t nil)
 
@@ -36547,7 +36553,7 @@ Key bindings:
 ;;;### (autoloads nil "verilog-mode" "progmodes/verilog-mode.el"
 ;;;;;;  (0 0 0 0))
 ;;; Generated autoloads from progmodes/verilog-mode.el
-(push (purecopy '(verilog-mode 2019 12 17 268053413)) 
package--builtin-versions)
+(push (purecopy '(verilog-mode 2020 2 23 232634261)) package--builtin-versions)
 
 (autoload 'verilog-mode "verilog-mode" "\
 Major mode for editing Verilog code.
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index a118e7d..2c9674f 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -591,9 +591,7 @@ Emacs dired can't find files."
          (ignore-errors (delete-file tmpfile))
          (tramp-error
           v 'file-error "Cannot make local copy of file `%s'" filename))
-       (set-file-modes
-        tmpfile
-        (logior (or (tramp-compat-file-modes filename 'nofollow) 0) #o0400)))
+       (set-file-modes tmpfile (logior (or (file-modes filename) 0) #o0400)))
       tmpfile)))
 
 (defun tramp-adb-handle-file-writable-p (filename)
@@ -670,10 +668,11 @@ But handle the case, if the \"test\" command is not 
available."
 (defun tramp-adb-handle-set-file-modes (filename mode &optional flag)
   "Like `set-file-modes' for Tramp files."
   (with-parsed-tramp-file-name filename nil
-    (when (and (eq flag 'nofollow) (file-symlink-p filename))
-      (tramp-error v 'file-error "Cannot chmod %s with %s flag" filename flag))
-    (tramp-flush-file-properties v localname)
-    (tramp-adb-send-command-and-check v (format "chmod %o %s" mode 
localname))))
+    ;; ADB shell does not support "chmod -h".
+    (unless (and (eq flag 'nofollow) (file-symlink-p filename))
+      (tramp-flush-file-properties v localname)
+      (tramp-adb-send-command-and-check
+       v (format "chmod %o %s" mode localname)))))
 
 (defun tramp-adb-handle-set-file-times (filename &optional time)
   "Like `set-file-times' for Tramp files."
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 761f594..84b8191 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1481,16 +1481,18 @@ of."
 (defun tramp-sh-handle-set-file-modes (filename mode &optional flag)
   "Like `set-file-modes' for Tramp files."
   (with-parsed-tramp-file-name filename nil
-    (let ((chmod "chmod"))
-      (when (and (eq flag 'nofollow) (file-symlink-p filename))
-       (or (setq chmod (tramp-get-remote-chmod-h v))
-           (tramp-error
-            v 'file-error "Cannot chmod %s with %s flag" filename flag)))
+    ;; We need "chmod -h" when the flag is set.
+    (when (or (not (eq flag 'nofollow))
+             (not (file-symlink-p filename))
+             (tramp-get-remote-chmod-h v))
       (tramp-flush-file-properties v localname)
       ;; FIXME: extract the proper text from chmod's stderr.
       (tramp-barf-unless-okay
        v
-       (format "%s %o %s" chmod mode (tramp-shell-quote-argument localname))
+       (format
+       "chmod %s %o %s"
+       (if (and (eq flag 'nofollow) (tramp-get-remote-chmod-h v)) "-h" "")
+       mode (tramp-shell-quote-argument localname))
        "Error while changing file's mode %s" filename))))
 
 (defun tramp-sh-handle-set-file-times (filename &optional time)
@@ -5902,20 +5904,20 @@ ID-FORMAT valid values are `string' and `integer'."
               command)))))
 
 (defun tramp-get-remote-chmod-h (vec)
-  "Determine remote `chmod' command which supports nofollow argument."
+  "Check whether remote `chmod' supports nofollow argument."
   (with-tramp-connection-property vec "chmod-h"
     (tramp-message vec 5 "Finding a suitable `chmod' command with nofollow")
     (let ((tmpfile
           (make-temp-name
            (expand-file-name
             tramp-temp-name-prefix (tramp-get-remote-tmpdir vec)))))
-      (when (tramp-send-command-and-check
-            vec
-            (format
-             "ln -s foo %s && chmod -h %s 0777"
-             (tramp-file-local-name tmpfile) (tramp-file-local-name tmpfile)))
-       (delete-file tmpfile)
-       "chmod -h"))))
+      (prog1
+         (tramp-send-command-and-check
+          vec
+          (format
+           "ln -s foo %s && chmod -h %s 0777"
+           (tramp-file-local-name tmpfile) (tramp-file-local-name tmpfile)))
+       (delete-file tmpfile)))))
 
 (defun tramp-get-env-with-u-option (vec)
   "Check, whether the remote `env' command supports the -u option."
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index abd369f..42954cb 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -1467,14 +1467,14 @@ component is used as the target of the symlink."
 (defun tramp-smb-handle-set-file-modes (filename mode &optional flag)
   "Like `set-file-modes' for Tramp files."
   (with-parsed-tramp-file-name filename nil
-    (when (and (eq flag 'nofollow) (file-symlink-p filename))
-      (tramp-error v 'file-error "Cannot chmod %s with %s flag" filename flag))
-    (when (tramp-smb-get-cifs-capabilities v)
-      (tramp-flush-file-properties v localname)
-      (unless (tramp-smb-send-command
-              v (format "chmod \"%s\" %o" (tramp-smb-get-localname v) mode))
-       (tramp-error
-        v 'file-error "Error while changing file's mode %s" filename)))))
+    ;; smbclient chmod does not support nofollow.
+    (unless (and (eq flag 'nofollow) (file-symlink-p filename))
+      (when (tramp-smb-get-cifs-capabilities v)
+       (tramp-flush-file-properties v localname)
+       (unless (tramp-smb-send-command
+                v (format "chmod \"%s\" %o" (tramp-smb-get-localname v) mode))
+         (tramp-error
+          v 'file-error "Error while changing file's mode %s" filename))))))
 
 ;; We use BUFFER also as connection buffer during setup. Because of
 ;; this, its original contents must be saved, and restored once
diff --git a/lisp/net/tramp-sudoedit.el b/lisp/net/tramp-sudoedit.el
index e70ee4e..7d8c8a9 100644
--- a/lisp/net/tramp-sudoedit.el
+++ b/lisp/net/tramp-sudoedit.el
@@ -466,14 +466,14 @@ the result will be a local, non-Tramp, file name."
 (defun tramp-sudoedit-handle-set-file-modes (filename mode &optional flag)
   "Like `set-file-modes' for Tramp files."
   (with-parsed-tramp-file-name filename nil
-    (when (and (eq flag 'nofollow) (file-symlink-p filename))
-      (tramp-error v 'file-error "Cannot chmod %s with %s flag" filename flag))
-    (tramp-flush-file-properties v localname)
-    (unless (tramp-sudoedit-send-command
-            v "chmod" (format "%o" mode)
-            (tramp-compat-file-name-unquote localname))
-      (tramp-error
-       v 'file-error "Error while changing file's mode %s" filename))))
+    ;; It is unlikely that "chmod -h" works.
+    (unless (and (eq flag 'nofollow) (file-symlink-p filename))
+      (tramp-flush-file-properties v localname)
+      (unless (tramp-sudoedit-send-command
+              v "chmod" (format "%o" mode)
+              (tramp-compat-file-name-unquote localname))
+       (tramp-error
+        v 'file-error "Error while changing file's mode %s" filename)))))
 
 (defun tramp-sudoedit-remote-selinux-p (vec)
   "Check, whether SELINUX is enabled on the remote host."
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 6f6da8e..cdbb59a 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -1406,7 +1406,7 @@ the last)."
 (defvar cperl-font-locking nil)
 
 ;; NB as it stands the code in cperl-mode assumes this only has one
-;; element. If XEmacs 19 support were dropped, this could all be simplified.
+;; element. Since XEmacs 19 support has been dropped, this could all be 
simplified.
 (defvar cperl-compilation-error-regexp-alist
   ;; This look like a paranoiac regexp: could anybody find a better one? 
(which WORKS).
   '(("^[^\n]* \\(file\\|at\\) \\([^ \t\n]+\\) [^\n]*line \\([0-9]+\\)[\\., \n]"
diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el
index 5036b79..536a16d 100644
--- a/lisp/progmodes/pascal.el
+++ b/lisp/progmodes/pascal.el
@@ -1392,7 +1392,7 @@ The default is a name found in the buffer around point."
 (defvar pascal-outline-map
   (let ((map (make-sparse-keymap)))
     (if (fboundp 'set-keymap-name)
-        (set-keymap-name pascal-outline-map 'pascal-outline-map))
+        (set-keymap-name map 'pascal-outline-map))
     (define-key map "\M-\C-a"  'pascal-outline-prev-defun)
     (define-key map "\M-\C-e"  'pascal-outline-next-defun)
     (define-key map "\C-c\C-d" 'pascal-outline-goto-defun)
diff --git a/lisp/subr.el b/lisp/subr.el
index b5ec0de..96b98c6 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1621,6 +1621,9 @@ be a list of the form returned by `event-start' and 
`event-end'."
 (defvaralias 'messages-buffer-max-lines 'message-log-max)
 (define-obsolete-variable-alias 'inhibit-null-byte-detection
   'inhibit-nul-byte-detection "27.1")
+(make-obsolete-variable 'load-dangerous-libraries
+                        "no longer used." "27.1")
+
 
 ;;;; Alternate names for functions - these are not being phased out.
 
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 5e7cf3d..338c603 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -4398,13 +4398,6 @@ xg_tool_bar_callback (GtkWidget *w, gpointer client_data)
   key = AREF (f->tool_bar_items, idx + TOOL_BAR_ITEM_KEY);
   XSETFRAME (frame, f);
 
-  /* We generate two events here.  The first one is to set the prefix
-     to `(tool_bar)', see keyboard.c.  */
-  event.kind = TOOL_BAR_EVENT;
-  event.frame_or_window = frame;
-  event.arg = frame;
-  kbd_buffer_store_event (&event);
-
   event.kind = TOOL_BAR_EVENT;
   event.frame_or_window = frame;
   event.arg = key;
diff --git a/src/lread.c b/src/lread.c
index fc56944..0055287 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -979,9 +979,7 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun)
 
 /* Value is a version number of byte compiled code if the file
    associated with file descriptor FD is a compiled Lisp file that's
-   safe to load.  Only files compiled with Emacs are safe to load.
-   Files compiled with XEmacs can lead to a crash in Fbyte_code
-   because of an incompatible change in the byte compiler.  */
+   safe to load.  Only files compiled with Emacs can be loaded.  */
 
 static int
 safe_to_load_version (int fd)
@@ -1135,7 +1133,6 @@ Return t if the file exists and loads successfully.  */)
   /* True means we are loading a compiled file.  */
   bool compiled = 0;
   Lisp_Object handler;
-  bool safe_p = 1;
   const char *fmode = "r" FOPEN_TEXT;
   int version;
 
@@ -1321,11 +1318,7 @@ Return t if the file exists and loads successfully.  */)
          if (version < 0
              && ! (version = safe_to_load_version (fd)))
            {
-             safe_p = 0;
-             if (!load_dangerous_libraries)
-               error ("File `%s' was not compiled in Emacs", SDATA (found));
-             else if (!NILP (nomessage) && !force_load_messages)
-               message_with_string ("File `%s' not compiled in Emacs", found, 
1);
+             error ("File `%s' was not compiled in Emacs", SDATA (found));
            }
 
          compiled = 1;
@@ -1432,10 +1425,7 @@ Return t if the file exists and loads successfully.  */)
 
   if (NILP (nomessage) || force_load_messages)
     {
-      if (!safe_p)
-       message_with_string ("Loading %s (compiled; note unsafe, not compiled 
in Emacs)...",
-                file, 1);
-      else if (is_module)
+      if (is_module)
         message_with_string ("Loading %s (module)...", file, 1);
       else if (is_native_elisp)
         message_with_string ("Loading %s (native compiled elisp)...", file, 1);
@@ -1510,10 +1500,7 @@ Return t if the file exists and loads successfully.  */)
 
   if (!noninteractive && (NILP (nomessage) || force_load_messages))
     {
-      if (!safe_p)
-       message_with_string ("Loading %s (compiled; note unsafe, not compiled 
in Emacs)...done",
-                file, 1);
-      else if (is_module)
+      if (is_module)
         message_with_string ("Loading %s (module)...done", file, 1);
       else if (is_native_elisp)
        message_with_string ("Loading %s (native compiled elisp)...done", file, 
1);
@@ -5000,7 +4987,7 @@ This overrides the value of the NOMESSAGE argument to 
`load'.  */);
 When Emacs loads a compiled Lisp file, it reads the first 512 bytes
 from the file, and matches them against this regular expression.
 When the regular expression matches, the file is considered to be safe
-to load.  See also `load-dangerous-libraries'.  */);
+to load.  */);
   Vbytecomp_version_regexp
     = build_pure_c_string ("^;;;.\\(in Emacs version\\|bytecomp version 
FSF\\)");
 
diff --git a/src/nsterm.m b/src/nsterm.m
index c053582..84acb61 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -8185,13 +8185,8 @@ not_in_argv (NSString *arg)
   if (!emacs_event)
     return self;
 
-  /* Send first event (for some reason two needed).  */
   theEvent = [[self window] currentEvent];
   emacs_event->kind = TOOL_BAR_EVENT;
-  XSETFRAME (emacs_event->arg, emacsframe);
-  EV_TRAILER (theEvent);
-
-  emacs_event->kind = TOOL_BAR_EVENT;
   /* XSETINT (emacs_event->code, 0); */
   emacs_event->arg = AREF (emacsframe->tool_bar_items,
                           idx + TOOL_BAR_ITEM_KEY);
diff --git a/src/pdumper.c b/src/pdumper.c
index 14f03f4..71551d7 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -3138,7 +3138,7 @@ dump_vectorlike (struct dump_context *ctx,
 static dump_off
 dump_object (struct dump_context *ctx, Lisp_Object object)
 {
-#if CHECK_STRUCTS && !defined (HASH_Lisp_Type_E2AD97D3F7)
+#if CHECK_STRUCTS && !defined (HASH_Lisp_Type_45F0582FD7)
 # error "Lisp_Type changed. See CHECK_STRUCTS comment in config.h."
 #endif
   eassert (!EQ (object, dead_object ()));
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 7b43d6f..be0f418 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -50,6 +50,7 @@
 (require 'vc-hg)
 
 (declare-function tramp-find-executable "tramp-sh")
+(declare-function tramp-get-remote-chmod-h "tramp-sh")
 (declare-function tramp-get-remote-gid "tramp-sh")
 (declare-function tramp-get-remote-path "tramp-sh")
 (declare-function tramp-get-remote-perl "tramp-sh")
@@ -3082,18 +3083,14 @@ This tests also `file-directory-p' and 
`file-accessible-directory-p'."
 ;; Method "smb" supports `make-symbolic-link' only if the remote host
 ;; has CIFS capabilities.  tramp-adb.el, tramp-gvfs.el and
 ;; tramp-rclone.el do not support symbolic links at all.
-;; We check also `set-file-modes' with nofollow flag.
 (defmacro tramp--test-ignore-make-symbolic-link-error (&rest body)
   "Run BODY, ignoring \"make-symbolic-link not supported\" file error."
   (declare (indent defun) (debug (body)))
   `(condition-case err
        (progn ,@body)
      (file-error
-      (unless (string-match-p
-              (concat
-               "^\\(make-symbolic-link not supported"
-               "\\|Cannot chmod .* with nofollow flag\\)$")
-              (error-message-string err))
+      (unless (string-equal (error-message-string err)
+                           "make-symbolic-link not supported")
        (signal (car err) (cdr err))))))
 
 (ert-deftest tramp-test18-file-attributes ()
@@ -3385,15 +3382,26 @@ This tests also `file-executable-p', `file-writable-p' 
and `set-file-modes'."
            ;; A file is always writable for user "root".
            (unless (zerop (tramp-compat-file-attribute-user-id
                            (file-attributes tmp-name1)))
-             (should-not (file-writable-p tmp-name1))))
+             (should-not (file-writable-p tmp-name1)))
+           ;; Check the NOFOLLOW arg.  It exists since Emacs 28.  For
+           ;; regular files, there shouldn't be a difference.
+           (when (tramp--test-emacs28-p)
+             (with-no-warnings
+               (set-file-modes tmp-name1 #o222 'nofollow)
+               (should (= (file-modes tmp-name1 'nofollow) #o222)))))
 
        ;; Cleanup.
        (ignore-errors (delete-file tmp-name1)))
 
-      ;; Check the NOFOLLOW arg.  It exists since Emacs 28.
-      (when (tramp--test-emacs28-p)
+      ;; Check the NOFOLLOW arg.  It exists since Emacs 28.  It is
+      ;; implemented for tramp-gvfs.el and tramp-sh.el.  However,
+      ;; tramp-gvfs,el does not support creating symbolic links.  And
+      ;; in tramp-sh.el, we must ensure that the remote chmod command
+      ;; supports the "-h" argument.
+      (when (and (tramp--test-emacs28-p) (tramp--test-sh-p)
+                (tramp-get-remote-chmod-h (tramp-dissect-file-name tmp-name1)))
        (unwind-protect
-           (tramp--test-ignore-make-symbolic-link-error
+           (with-no-warnings
              (write-region "foo" nil tmp-name1)
              (should (file-exists-p tmp-name1))
              (make-symbolic-link tmp-name1 tmp-name2)
diff --git a/test/src/timefns-tests.el b/test/src/timefns-tests.el
index 62d56ac..3967590 100644
--- a/test/src/timefns-tests.el
+++ b/test/src/timefns-tests.el
@@ -124,44 +124,44 @@
 ;;; Tests of format-time-string padding
 
 (ert-deftest format-time-string-padding-minimal-deletes-unneeded-zeros ()
-  (let ((ref-time (append (encode-time 0 0 0 15 2 2000) '(123450))))
+  (let ((ref-time (encode-time '((123450 . 1000000) 0 0 15 2 2000 - - t))))
     (should (equal (format-time-string "%-:::z" ref-time "FJT-12") "+12"))
-    (should (equal (format-time-string "%-N" ref-time) "12345"))
-    (should (equal (format-time-string "%-6N" ref-time) "12345"))
-    (should (equal (format-time-string "%-m" ref-time) "2")))) ;not "02"
+    (should (equal (format-time-string "%-N" ref-time t) "12345"))
+    (should (equal (format-time-string "%-6N" ref-time t) "12345"))
+    (should (equal (format-time-string "%-m" ref-time t) "2")))) ;not "02"
 
 (ert-deftest format-time-string-padding-minimal-retains-needed-zeros ()
-  (let ((ref-time (append (encode-time 0 0 0 20 10 2000) '(3450))))
+  (let ((ref-time (encode-time '((3450 . 1000000) 0 0 20 10 2000 - - t))))
     (should (equal (format-time-string "%-z" ref-time "IST-5:30") "+530"))
     (should (equal (format-time-string "%-4z" ref-time "IST-5:30") "+530"))
     (should (equal (format-time-string "%4z" ref-time "IST-5:30") "+530"))
-    (should (equal (format-time-string "%-N" ref-time) "00345"))
-    (should (equal (format-time-string "%-3N" ref-time) "003"))
-    (should (equal (format-time-string "%3N" ref-time) "003"))
-    (should (equal (format-time-string "%-m" ref-time) "10")) ;not "1"
-    (should (equal (format-time-string "%-1m" ref-time) "10")) ;not "1"
-    (should (equal (format-time-string "%1m" ref-time) "10")))) ;not "1"
+    (should (equal (format-time-string "%-N" ref-time t) "00345"))
+    (should (equal (format-time-string "%-3N" ref-time t) "003"))
+    (should (equal (format-time-string "%3N" ref-time t) "003"))
+    (should (equal (format-time-string "%-m" ref-time t) "10")) ;not "1"
+    (should (equal (format-time-string "%-1m" ref-time t) "10")) ;not "1"
+    (should (equal (format-time-string "%1m" ref-time t) "10")))) ;not "1"
 
 (ert-deftest format-time-string-padding-spaces ()
-  (let ((ref-time (append (encode-time 0 0 0 10 12 2000) '(123000))))
+  (let ((ref-time (encode-time '((123000 . 1000000) 0 0 10 12 2000 - - t))))
     (should (equal (format-time-string "%_7z" ref-time "CHA-12:45") "  +1245"))
-    (should (equal (format-time-string "%_6N" ref-time) "123   "))
-    (should (equal (format-time-string "%_9N" ref-time) "123      "))
-    (should (equal (format-time-string "%_12N" ref-time) "123         "))
-    (should (equal (format-time-string "%_m" ref-time) "12"))
-    (should (equal (format-time-string "%_2m" ref-time) "12"))
-    (should (equal (format-time-string "%_3m" ref-time) " 12"))))
+    (should (equal (format-time-string "%_6N" ref-time t) "123   "))
+    (should (equal (format-time-string "%_9N" ref-time t) "123      "))
+    (should (equal (format-time-string "%_12N" ref-time t) "123         "))
+    (should (equal (format-time-string "%_m" ref-time t) "12"))
+    (should (equal (format-time-string "%_2m" ref-time t) "12"))
+    (should (equal (format-time-string "%_3m" ref-time t) " 12"))))
 
 (ert-deftest format-time-string-padding-zeros-adds-on-insignificant-side ()
   "Fractional seconds have a fixed place on the left,
 and any padding must happen on the right.  All other numbers have
 a fixed place on the right and are padded on the left."
-  (let ((ref-time (append (encode-time 0 0 0 10 12 2000) '(123000))))
-    (should (equal (format-time-string "%3m" ref-time) "012"))
+  (let ((ref-time (encode-time '((123000 . 1000000) 0 0 10 12 2000 - - t))))
+    (should (equal (format-time-string "%3m" ref-time t) "012"))
     (should (equal (format-time-string "%7z" ref-time "CHA-12:45") "+001245"))
-    (should (equal (format-time-string "%12N" ref-time) "123000000000"))
-    (should (equal (format-time-string "%9N" ref-time) "123000000"))
-    (should (equal (format-time-string "%6N" ref-time) "123000"))))
+    (should (equal (format-time-string "%12N" ref-time t) "123000000000"))
+    (should (equal (format-time-string "%9N" ref-time t) "123000000"))
+    (should (equal (format-time-string "%6N" ref-time t) "123000"))))
 
 
 (ert-deftest time-equal-p-nil-nil ()



reply via email to

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