commit 1054525ae3795b71fe09dafcbb86d3cdb1d7f875 (HEAD, refs/remotes/origin/master) Author: Dmitry Gutov Date: Thu Apr 29 04:59:28 2021 +0300 * lisp/progmodes/project.el: Also bump version. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 914d7ce9e4..d47d9d77e6 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1,7 +1,7 @@ ;;; project.el --- Operations on the current project -*- lexical-binding: t; -*- ;; Copyright (C) 2015-2021 Free Software Foundation, Inc. -;; Version: 0.5.4 +;; Version: 0.6.0 ;; Package-Requires: ((emacs "26.1") (xref "1.0.2")) ;; This is a GNU ELPA :core package. Avoid using functionality that commit a3c77dda952a79c3c9b5918ab65d19e53c67da44 Author: Dmitry Gutov Date: Thu Apr 29 04:53:37 2021 +0300 * lisp/progmodes/xref.el: Bump version. diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index e80603f23e..7fc7181acc 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1,7 +1,7 @@ ;;; xref.el --- Cross-referencing commands -*-lexical-binding:t-*- ;; Copyright (C) 2014-2021 Free Software Foundation, Inc. -;; Version: 1.0.4 +;; Version: 1.1.0 ;; Package-Requires: ((emacs "26.1")) ;; This is a GNU ELPA :core package. Avoid functionality that is not commit 0e8c8628854d786e2f99dd2ac35ace88a5ee7924 Author: Juri Linkov Date: Wed Apr 28 23:25:08 2021 +0300 * lisp/window.el (window--state-put-2): Set next/prev-buffers even to nil. When next-buffers or prev-buffers are nil, still use set-window-next-buffers or set-window-prev-buffers to set next/prev-buffers to nil. (Bug#46904) diff --git a/lisp/window.el b/lisp/window.el index 036eb271ee..cf5752113d 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -6133,29 +6133,27 @@ value can be also stored on disk and read back in a new session." ;; Select window if it's the selected one. (when (cdr (assq 'selected state)) (select-window window)) - (when next-buffers - (set-window-next-buffers - window - (delq nil (mapcar (lambda (buffer) - (setq buffer (get-buffer buffer)) - (when (buffer-live-p buffer) buffer)) - next-buffers)))) - (when prev-buffers - (set-window-prev-buffers - window - (delq nil (mapcar (lambda (entry) - (let ((buffer (get-buffer (nth 0 entry))) - (m1 (nth 1 entry)) - (m2 (nth 2 entry))) - (when (buffer-live-p buffer) - (list buffer - (if (markerp m1) m1 - (set-marker (make-marker) m1 - buffer)) - (if (markerp m2) m2 - (set-marker (make-marker) m2 - buffer)))))) - prev-buffers))))) + (set-window-next-buffers + window + (delq nil (mapcar (lambda (buffer) + (setq buffer (get-buffer buffer)) + (when (buffer-live-p buffer) buffer)) + next-buffers))) + (set-window-prev-buffers + window + (delq nil (mapcar (lambda (entry) + (let ((buffer (get-buffer (nth 0 entry))) + (m1 (nth 1 entry)) + (m2 (nth 2 entry))) + (when (buffer-live-p buffer) + (list buffer + (if (markerp m1) m1 + (set-marker (make-marker) m1 + buffer)) + (if (markerp m2) m2 + (set-marker (make-marker) m2 + buffer)))))) + prev-buffers)))) ;; We don't want to raise an error in case the buffer does ;; not exist anymore, so we switch to a previous one and ;; save the window with the intention of deleting it later commit f32ff8102076fabe513b3135de0adb0ff58cb815 Author: Andrea Corallo Date: Wed Apr 28 22:00:12 2021 +0200 * Add a note related to native compilation and Dynamic Binding * doc/lispref/variables.texi (Dynamic Binding): Add a note related to native compilation. diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 0ddf3e465d..b25eea12a5 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -1010,6 +1010,9 @@ a dynamic local binding, Emacs records the contents of the value cell value cell. When the binding construct finishes executing, Emacs pops the old value off the stack, and puts it in the value cell. + Note that when code using Dynamic Binding is native compiled the +native compiler will not perform any Lisp specific optimization. + @node Dynamic Binding Tips @subsection Proper Use of Dynamic Binding commit cccdea7e23730d860d51758548e0b0a76341d26a Author: Michael Albinus Date: Wed Apr 28 22:00:55 2021 +0200 Tramp code cleanup * lisp/net/tramp-archive.el (tramp-archive-handle-insert-file-contents): Code cleanup. * lisp/net/tramp.el: Reload `tramp-compat' when we reload `tramp-autoloads'. (with-tramp-file-property, with-tramp-connection-property): Use `tramp-cache-undefined'. (tramp-autoload-file-name-handler): Do not load tramp-compat.el. (tramp-handle-insert-file-contents): Code cleanup. diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el index 0bbd9271b1..61c40ffdea 100644 --- a/lisp/net/tramp-archive.el +++ b/lisp/net/tramp-archive.el @@ -628,10 +628,8 @@ offered." (let ((result (insert-file-contents (tramp-archive-gvfs-file-name filename) visit beg end replace))) - (prog1 - (list (expand-file-name filename) - (cadr result)) - (when visit (setq buffer-file-name filename))))) + (when visit (setq buffer-file-name filename)) + (cons (expand-file-name filename) (cdr result)))) (defun tramp-archive-handle-load (file &optional noerror nomessage nosuffix must-suffix) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 88af9afd98..015f458a63 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -64,6 +64,10 @@ (declare-function netrc-parse "netrc") (defvar auto-save-file-name-transforms) +;; Reload `tramp-compat' when we reload `tramp-autoloads' of the GNU ELPA package. +;;;###autoload (when (featurep 'tramp-compat) +;;;###autoload (load "tramp-compat" 'noerror 'nomessage)) + ;;; User Customizable Internal Variables: (defgroup tramp nil @@ -2188,14 +2192,15 @@ without a visible progress reporter." FILE must be a local file name on a connection identified via VEC." (declare (indent 3) (debug t)) `(if (file-name-absolute-p ,file) - (let ((value (tramp-get-file-property ,vec ,file ,property 'undef))) - (when (eq value 'undef) - ;; We cannot pass @body as parameter to - ;; `tramp-set-file-property' because it mangles our - ;; debug messages. - (setq value (progn ,@body)) - (tramp-set-file-property ,vec ,file ,property value)) - value) + (let ((value (tramp-get-file-property + ,vec ,file ,property tramp-cache-undefined))) + (when (eq value tramp-cache-undefined) + ;; We cannot pass @body as parameter to + ;; `tramp-set-file-property' because it mangles our debug + ;; messages. + (setq value (progn ,@body)) + (tramp-set-file-property ,vec ,file ,property value)) + value) ,@body)) (font-lock-add-keywords 'emacs-lisp-mode '("\\")) @@ -2203,14 +2208,15 @@ FILE must be a local file name on a connection identified via VEC." (defmacro with-tramp-connection-property (key property &rest body) "Check in Tramp for property PROPERTY, otherwise execute BODY and set." (declare (indent 2) (debug t)) - `(let ((value (tramp-get-connection-property ,key ,property 'undef))) - (when (eq value 'undef) - ;; We cannot pass ,@body as parameter to - ;; `tramp-set-connection-property' because it mangles our debug - ;; messages. - (setq value (progn ,@body)) - (tramp-set-connection-property ,key ,property value)) - value)) + `(let ((value (tramp-get-connection-property + ,key ,property tramp-cache-undefined))) + (when (eq value tramp-cache-undefined) + ;; We cannot pass ,@body as parameter to + ;; `tramp-set-connection-property' because it mangles our debug + ;; messages. + (setq value (progn ,@body)) + (tramp-set-connection-property ,key ,property value)) + value)) (font-lock-add-keywords 'emacs-lisp-mode '("\\")) @@ -2568,7 +2574,6 @@ Falls back to normal file name handler if no Tramp file name handler exists." ;; might be an older, incompatible version active. We try to ;; overload this. (let ((default-directory temporary-file-directory)) - (load "tramp-compat" 'noerror 'nomessage) (load "tramp" 'noerror 'nomessage))) (apply operation args))) @@ -3716,21 +3721,19 @@ User is always nil." (signal (car err) (cdr err)))))) ;; Save exit. - (progn - (when visit - (setq buffer-file-name filename - buffer-read-only (not (file-writable-p filename))) - (set-visited-file-modtime) - (set-buffer-modified-p nil)) - (when (and (stringp local-copy) - (or remote-copy (null tramp-temp-buffer-file-name))) - (delete-file local-copy)) - (when (stringp remote-copy) - (delete-file (tramp-make-tramp-file-name v remote-copy 'nohop))))) + (when visit + (setq buffer-file-name filename + buffer-read-only (not (file-writable-p filename))) + (set-visited-file-modtime) + (set-buffer-modified-p nil)) + (when (and (stringp local-copy) + (or remote-copy (null tramp-temp-buffer-file-name))) + (delete-file local-copy)) + (when (stringp remote-copy) + (delete-file (tramp-make-tramp-file-name v remote-copy 'nohop)))) ;; Result. - (list (expand-file-name filename) - (cadr result))))) + (cons (expand-file-name filename) (cdr result))))) (defun tramp-handle-load (file &optional noerror nomessage nosuffix must-suffix) "Like `load' for Tramp files." commit 0c7f1e2e42d6bf9f95e88c02d4e1ed9cb40693d8 Author: Michael Albinus Date: Wed Apr 28 19:29:36 2021 +0200 Fix gio warning in Tramp * lisp/net/tramp-sh.el (tramp-sh-gio-monitor-process-filter): Improve handling of gio warning. (Bug#48067) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index dde92d87a0..4a3072ee34 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3730,31 +3730,29 @@ Fall back to normal file name handler if no Tramp handler exists." ;; Determine monitor name. (unless (tramp-connection-property-p proc "gio-file-monitor") - (cond - ;; We have seen this on cygwin gio and on emba. Let's make some assumptions. - ((string-match - "Can't find module 'help' specified in GIO_USE_FILE_MONITOR" string) - (cond - ((getenv "EMACS_EMBA_CI") - (tramp-set-connection-property - proc "gio-file-monitor" 'GInotifyFileMonitor)) - ((eq system-type 'cygwin) - (tramp-set-connection-property - proc "gio-file-monitor" 'GPollFileMonitor)) - (t (tramp-error proc 'file-error "Cannot determine gio monitor")))) - ;; TODO: What happens, if several monitor names are reported? - ((string-match "\ + (tramp-set-connection-property + proc "gio-file-monitor" + (cond + ;; We have seen this on cygwin gio and on emba. Let's make + ;; some assumptions. + ((string-match + "Can't find module 'help' specified in GIO_USE_FILE_MONITOR" string) + (cond + ((getenv "EMACS_EMBA_CI") 'GInotifyFileMonitor) + ((eq system-type 'cygwin) 'GPollFileMonitor) + (t tramp-cache-undefined))) + ;; TODO: What happens, if several monitor names are reported? + ((string-match "\ Supported arguments for GIO_USE_FILE_MONITOR environment variable: \\s-*\\([[:alpha:]]+\\) - 20" string) - (tramp-set-connection-property - proc "gio-file-monitor" (intern - (format "G%sFileMonitor" (capitalize (match-string 1 string)))))) - (t (throw 'doesnt-work nil))) - (setq string (replace-match "" nil nil string))) + (format "G%sFileMonitor" (capitalize (match-string 1 string))))) + (t (throw 'doesnt-work nil)))) + (setq string (substring string (match-end 0)))) ;; Delete empty lines. - (setq string (tramp-compat-string-replace "\n\n" "\n" string)) + (setq string (tramp-compat-string-replace "\n\n" "\n" string) + string (replace-regexp-in-string "^\n" "" string)) (while (string-match (eval-when-compile commit 2feeebe40a198ae1876f86574df9a27ea82ecdd8 Author: Eli Zaretskii Date: Wed Apr 28 19:36:42 2021 +0300 Doc fixes in avl-tree.el * lisp/emacs-lisp/avl-tree.el (avl-tree--root) (avl-tree--dir-to-sign, avl-tree--sign-to-dir) (avl-tree--del-balance, avl-tree--enter-balance) (avl-tree--do-copy, avl-tree--stack-repopulate, avl-tree-empty) (avl-tree-delete, avl-tree-member, avl-tree-member-p) (avl-tree-map, avl-tree-mapc, avl-tree-mapf, avl-tree-mapcar) (avl-tree-copy, avl-tree-clear, avl-tree-stack) (avl-tree-stack-first): Fix doc strings to be less verbose and to have the first line a complete sentence. diff --git a/lisp/emacs-lisp/avl-tree.el b/lisp/emacs-lisp/avl-tree.el index c8c96fa822..4382985eb8 100644 --- a/lisp/emacs-lisp/avl-tree.el +++ b/lisp/emacs-lisp/avl-tree.el @@ -74,7 +74,7 @@ cmpfun) (defmacro avl-tree--root (tree) - "Return the root node for an AVL tree. INTERNAL USE ONLY." + "Return the root node for an AVL TREE. INTERNAL USE ONLY." `(avl-tree--node-left (avl-tree--dummyroot ,tree))) ;; ---------------------------------------------------------------- @@ -117,11 +117,11 @@ NODE is the node, and BRANCH is the branch. `(- 1 ,dir)) (defmacro avl-tree--dir-to-sign (dir) - "Convert direction (0,1) to sign factor (-1,+1)." + "Convert direction DIR (0,1) to sign factor (-1,+1)." `(1- (* 2 ,dir))) (defmacro avl-tree--sign-to-dir (dir) - "Convert sign factor (-x,+x) to direction (0,1)." + "Convert sign factor in DIR (-x,+x) to direction (0,1)." `(if (< ,dir 0) 0 1)) @@ -129,7 +129,7 @@ NODE is the node, and BRANCH is the branch. ;; Deleting data (defun avl-tree--del-balance (node branch dir) - "Rebalance a tree after deleting a node. + "Rebalance a tree after deleting a NODE. The deletion was done from the left (DIR=0) or right (DIR=1) sub-tree of the left (BRANCH=0) or right (BRANCH=1) child of NODE. Return t if the height of the tree has shrunk." @@ -247,9 +247,9 @@ the related data." ;; Entering data (defun avl-tree--enter-balance (node branch dir) - "Rebalance tree after an insertion -into the left (DIR=0) or right (DIR=1) sub-tree of the -left (BRANCH=0) or right (BRANCH=1) child of NODE. + "Rebalance tree after insertion of NODE. +NODE was inserted into the left (DIR=0) or right (DIR=1) sub-tree +of the left (BRANCH=0) or right (BRANCH=1) child of NODE. Return t if the height of the tree has grown." (let ((br (avl-tree--node-branch node branch)) ;; opposite direction: 0,1 -> 1,0 @@ -379,7 +379,8 @@ itself." ;;; INTERNAL USE ONLY (defun avl-tree--do-copy (root) - "Copy the AVL tree with ROOT as root. Highly recursive." + "Copy the AVL tree wiath ROOT as root. +This function is highly recursive." (if (null root) nil (avl-tree--node-create @@ -405,8 +406,9 @@ itself." \n(fn OBJ)") (defun avl-tree--stack-repopulate (stack) - "Recursively push children of the node at the head of STACK onto the -front of the STACK, until a leaf is reached." + "Recursively push children of STACK onto the front. +This pushes the children of the node at the head of STACK onto +the front of STACK, until a leaf node is reached." (let ((node (car (avl-tree--stack-store stack))) (dir (if (avl-tree--stack-reverse stack) 1 0))) (when node ; check for empty stack @@ -429,7 +431,7 @@ and returns non-nil if A is less than B, and nil otherwise. \n(fn TREE)") (defun avl-tree-empty (tree) - "Return t if AVL tree TREE is empty, otherwise return nil." + "Return t if AVL TREE is empty, otherwise return nil." (null (avl-tree--root tree))) (defun avl-tree-enter (tree data &optional updatefun) @@ -451,7 +453,7 @@ Returns the new data." 0 data updatefun))) (defun avl-tree-delete (tree data &optional test nilflag) - "Delete the element matching DATA from the AVL tree TREE. + "Delete the element matching DATA from the AVL TREE. Matching uses the comparison function previously specified in `avl-tree-create' when TREE was created. @@ -473,7 +475,7 @@ value is non-nil." (defun avl-tree-member (tree data &optional nilflag) - "Return the element in the AVL tree TREE which matches DATA. + "Return the element in the AVL TREE which matches DATA. Matching uses the comparison function previously specified in `avl-tree-create' when TREE was created. @@ -496,7 +498,7 @@ for you.)" (defun avl-tree-member-p (tree data) - "Return t if an element matching DATA exists in the AVL tree TREE. + "Return t if an element matching DATA exists in the AVL TREE. Otherwise return nil. Matching uses the comparison function previously specified in `avl-tree-create' when TREE was created." (let ((flag '(nil))) @@ -504,7 +506,7 @@ previously specified in `avl-tree-create' when TREE was created." (defun avl-tree-map (fun tree &optional reverse) - "Modify all elements in the AVL tree TREE by applying function FUN. + "Modify all elements in the AVL TREE by applying function FUN. Each element is replaced by the return value of FUN applied to that element. @@ -520,8 +522,7 @@ order if REVERSE is non-nil." (defun avl-tree-mapc (fun tree &optional reverse) - "Apply function FUN to all elements in AVL tree TREE, -for side-effect only. + "Apply function FUN to all elements in AVL TREE, for side-effect only. FUNCTION is applied to the elements in ascending order, or descending order if REVERSE is non-nil." @@ -534,8 +535,7 @@ descending order if REVERSE is non-nil." (defun avl-tree-mapf (fun combinator tree &optional reverse) - "Apply function FUN to all elements in AVL tree TREE, -and combine the results using COMBINATOR. + "Apply FUN to all elements in AVL TREE, combine results using COMBINATOR. The FUNCTION is applied and the results are combined in ascending order, or descending order if REVERSE is non-nil." @@ -553,8 +553,7 @@ order, or descending order if REVERSE is non-nil." (defun avl-tree-mapcar (fun tree &optional reverse) - "Apply function FUN to all elements in AVL tree TREE, -and make a list of the results. + "Apply FUN to all elements in AVL TREE, and make a list of the results. The function is applied and the list constructed in ascending order, or descending order if REVERSE is non-nil. @@ -586,7 +585,7 @@ is more efficient." (avl-tree--node-data node)))) (defun avl-tree-copy (tree) - "Return a copy of the AVL tree TREE." + "Return a copy of the AVL TREE." (let ((new-tree (avl-tree-create (avl-tree--cmpfun tree)))) (setf (avl-tree--root new-tree) (avl-tree--do-copy (avl-tree--root tree))) new-tree)) @@ -608,13 +607,12 @@ is more efficient." treesize)) (defun avl-tree-clear (tree) - "Clear the AVL tree TREE." + "Clear the AVL TREE." (setf (avl-tree--root tree) nil)) (defun avl-tree-stack (tree &optional reverse) - "Return an object that behaves like a sorted stack -of all elements of TREE. + "Return an object that behaves like a sorted stack of all elements of TREE. If REVERSE is non-nil, the stack is sorted in reverse order. \(See also `avl-tree-stack-pop'). @@ -655,8 +653,7 @@ a null element stored in the AVL tree.)" (defun avl-tree-stack-first (avl-tree-stack &optional nilflag) - "Return the first element of AVL-TREE-STACK, without removing it -from the stack. + "Return the first element of AVL-TREE-STACK, without removing it from stack. Returns nil if the stack is empty, or NILFLAG if specified. \(The latter allows an empty stack to be distinguished from commit 4fc6afb913ad24ab4796daf6a9409f497a804e85 Author: Stefan Kangas Date: Wed Apr 28 16:02:42 2021 +0200 * lisp/emacs-lisp/avl-tree.el: Minor doc fixes. diff --git a/lisp/emacs-lisp/avl-tree.el b/lisp/emacs-lisp/avl-tree.el index 75c732269e..c8c96fa822 100644 --- a/lisp/emacs-lisp/avl-tree.el +++ b/lisp/emacs-lisp/avl-tree.el @@ -74,7 +74,7 @@ cmpfun) (defmacro avl-tree--root (tree) - ;; Return the root node for an AVL tree. INTERNAL USE ONLY. + "Return the root node for an AVL tree. INTERNAL USE ONLY." `(avl-tree--node-left (avl-tree--dummyroot ,tree))) ;; ---------------------------------------------------------------- @@ -337,7 +337,7 @@ inserted data." )))) (defun avl-tree--check (tree) - "Check the tree's balance." + "Check the balance of TREE." (avl-tree--check-node (avl-tree--root tree))) (defun avl-tree--check-node (node) (if (null node) 0 @@ -405,8 +405,8 @@ itself." \n(fn OBJ)") (defun avl-tree--stack-repopulate (stack) - ;; Recursively push children of the node at the head of STACK onto the - ;; front of the STACK, until a leaf is reached. + "Recursively push children of the node at the head of STACK onto the +front of the STACK, until a leaf is reached." (let ((node (car (avl-tree--stack-store stack))) (dir (if (avl-tree--stack-reverse stack) 1 0))) (when node ; check for empty stack @@ -504,13 +504,13 @@ previously specified in `avl-tree-create' when TREE was created." (defun avl-tree-map (fun tree &optional reverse) - "Modify all elements in the AVL tree TREE by applying FUNCTION. + "Modify all elements in the AVL tree TREE by applying function FUN. -Each element is replaced by the return value of FUNCTION applied -to that element. +Each element is replaced by the return value of FUN applied to +that element. -FUNCTION is applied to the elements in ascending order, or -descending order if REVERSE is non-nil." +FUN is applied to the elements in ascending order, or descending +order if REVERSE is non-nil." (avl-tree--mapc (lambda (node) (setf (avl-tree--node-data node) @@ -520,7 +520,7 @@ descending order if REVERSE is non-nil." (defun avl-tree-mapc (fun tree &optional reverse) - "Apply FUNCTION to all elements in AVL tree TREE, + "Apply function FUN to all elements in AVL tree TREE, for side-effect only. FUNCTION is applied to the elements in ascending order, or @@ -534,7 +534,7 @@ descending order if REVERSE is non-nil." (defun avl-tree-mapf (fun combinator tree &optional reverse) - "Apply FUNCTION to all elements in AVL tree TREE, + "Apply function FUN to all elements in AVL tree TREE, and combine the results using COMBINATOR. The FUNCTION is applied and the results are combined in ascending