mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 18:40:39 -08:00
Merge from origin/emacs-28
3b8dda6c90Add safety check in x_menu_showe1fb731393Tweak x_connection_closed when I/O error595e506c82* lisp/erc/erc.el (erc-user-mode): Set "+i" by default.d00f3d4c05Port unused decls to C2x317eb2d5b5Improve structure of TODOc0793cd9deDon't use some obsolete names in documentation87153cc915Tweak x_hide_tip for consistency7e871dcd27Remove encode_terminal_code UNINITs2a00634880Port pdumper.c maybe_unused to C2x6d9b3c0eaaPort systhreads.h to C2xfd274d7d24Pacify -Wanalyzer-null-argument in lisp_malloccc3fc94f09Pacify gcc 11.2.1 -Wanalyzer-null-argumentd3a832a61aSimplify hack-read-symbol-shorthands again (bug#50946)4831426158Fix recipe for 'native-lisp' directory0bb42ef803; * lisp/time-stamp.el (time-stamp-format): Doc string.732c70a0d9Simplify socket symlink-attack checkingfc32a3bd95; * doc/lispref/files.texi (Reading from Files): Fix wording.3cc77aa976Clarify (elisp) insert-file-contents with BEG or END not o...5deeb0947d* src/Makefile.in: Simplify conditionals.121a5abeaeMove context-menu selection items Defun/List/Symbol to pro...0c341e6e84* lisp/tab-bar.el (tab-bar-detach-tab): Handle frame selec...931a7276c0* lisp/tab-line.el (tab-line-format): Add face-modified to...3863919a00Fix unmounting in Tramp7a6d34cd1f* etc/themes/light-blue-theme.el: Add "Maintainer: emacs-d...c1b1e1f545Define HAVE_NATIVE_COMP in src/Makefile.in137fa2d716Rename elisp-shorthands to read-symbol-shorthandse6fbc45b7bFont-lock shorthands in elisp-mode for quick visual recogn...17e6f3bee5; Fix last change in tramp-sshfs.el3dae1e33d1Suppress superfluous error messages in Trampb228ec9fabFix reading the tail of a file in shorthands.el7fb2789509Fix substitution of pretty quotes in code in easy-mmodeb47d7ce1b8Fix agent directory deletionb1a8a66fb0; * etc/TODO: Fix previous commit; delete the right thing.6c01a21365Clarify the purpose of internal--format-docstring-line55dadbc57e* lisp/net/dictionary.el (context-menu-dictionary): Move m...bb209cd5abUpdate to Org 9.5-30-g10dc9d4341e79a5fRemove bogus ":safe t" custom propertiesb6f6b593c6Fix 'apropos-compact-layout'62d6cecfcdRemove bogus ":safe nil" custom propertiesf9111d8784The safe-local-variable property is a function (bug#50944)3dc094abee; Some minor tweaks to TODOa5b4356d37Revert "; * etc/TODO: Move elpa.gnu.org items to the end."7bc0cee115Revert "* etc/TODO: Rearrange to start with "Simple tasks"."3489471417Fix selection of fonts for Arabic on Posix platforms13e5943386; Fix a typo in a doc stringbd60fca2faFix ox-koma-letter compilation warnings340e527bedPreload paren.ela9052248daImprove documentation of 'shift-select-mode'd505971894; Standardize some license headers9307889d68Simplify shorthand injection (bug#50946)5c77cc9584; * admin/release-branch.txt: Tweak previous. # Conflicts: # etc/NEWS # test/lisp/subr-tests.el
This commit is contained in:
commit
e0fdb68f8c
85 changed files with 1669 additions and 472 deletions
|
|
@ -1382,10 +1382,12 @@ When you add this function to `context-menu-functions',
|
|||
the context menu will contain an item that searches
|
||||
the word at mouse click."
|
||||
(when (thing-at-mouse click 'word)
|
||||
(define-key menu [dictionary-separator] menu-bar-separator)
|
||||
(define-key menu [dictionary-search-word-at-mouse]
|
||||
(define-key-after menu [dictionary-separator] menu-bar-separator
|
||||
'middle-separator)
|
||||
(define-key-after menu [dictionary-search-word-at-mouse]
|
||||
'(menu-item "Dictionary Search" dictionary-search-word-at-mouse
|
||||
:help "Search the word at mouse click in dictionary")))
|
||||
:help "Search the word at mouse click in dictionary")
|
||||
'dictionary-separator))
|
||||
menu)
|
||||
|
||||
(provide 'dictionary)
|
||||
|
|
|
|||
|
|
@ -319,12 +319,7 @@ KEY identifies the connection, it is either a process or a
|
|||
used to cache connection properties of the local machine.
|
||||
If KEY is `tramp-cache-undefined', or if the value is not set for
|
||||
the connection, return DEFAULT."
|
||||
;; Unify key by removing localname and hop from `tramp-file-name'
|
||||
;; structure. Work with a copy in order to avoid side effects.
|
||||
(when (tramp-file-name-p key)
|
||||
(setq key (copy-tramp-file-name key))
|
||||
(setf (tramp-file-name-localname key) nil
|
||||
(tramp-file-name-hop key) nil))
|
||||
(setq key (tramp-file-name-unify key))
|
||||
(let* ((hash (tramp-get-hash-table key))
|
||||
(cached (if (hash-table-p hash)
|
||||
(gethash property hash tramp-cache-undefined)
|
||||
|
|
@ -350,12 +345,7 @@ used to cache connection properties of the local machine. If KEY
|
|||
is `tramp-cache-undefined', nothing is set.
|
||||
PROPERTY is set persistent when KEY is a `tramp-file-name' structure.
|
||||
Return VALUE."
|
||||
;; Unify key by removing localname and hop from `tramp-file-name'
|
||||
;; structure. Work with a copy in order to avoid side effects.
|
||||
(when (tramp-file-name-p key)
|
||||
(setq key (copy-tramp-file-name key))
|
||||
(setf (tramp-file-name-localname key) nil
|
||||
(tramp-file-name-hop key) nil))
|
||||
(setq key (tramp-file-name-unify key))
|
||||
(when-let ((hash (tramp-get-hash-table key)))
|
||||
(puthash property value hash))
|
||||
(setq tramp-cache-data-changed
|
||||
|
|
@ -379,12 +369,7 @@ KEY identifies the connection, it is either a process or a
|
|||
`tramp-file-name' structure. A special case is nil, which is
|
||||
used to cache connection properties of the local machine.
|
||||
PROPERTY is set persistent when KEY is a `tramp-file-name' structure."
|
||||
;; Unify key by removing localname and hop from `tramp-file-name'
|
||||
;; structure. Work with a copy in order to avoid side effects.
|
||||
(when (tramp-file-name-p key)
|
||||
(setq key (copy-tramp-file-name key))
|
||||
(setf (tramp-file-name-localname key) nil
|
||||
(tramp-file-name-hop key) nil))
|
||||
(setq key (tramp-file-name-unify key))
|
||||
(when-let ((hash (tramp-get-hash-table key)))
|
||||
(remhash property hash))
|
||||
(setq tramp-cache-data-changed
|
||||
|
|
@ -397,12 +382,7 @@ PROPERTY is set persistent when KEY is a `tramp-file-name' structure."
|
|||
KEY identifies the connection, it is either a process or a
|
||||
`tramp-file-name' structure. A special case is nil, which is
|
||||
used to cache connection properties of the local machine."
|
||||
;; Unify key by removing localname and hop from `tramp-file-name'
|
||||
;; structure. Work with a copy in order to avoid side effects.
|
||||
(when (tramp-file-name-p key)
|
||||
(setq key (copy-tramp-file-name key))
|
||||
(setf (tramp-file-name-localname key) nil
|
||||
(tramp-file-name-hop key) nil))
|
||||
(setq key (tramp-file-name-unify key))
|
||||
(tramp-message
|
||||
key 7 "%s %s" key
|
||||
(when-let ((hash (gethash key tramp-cache-data)))
|
||||
|
|
|
|||
|
|
@ -175,15 +175,30 @@
|
|||
mount)
|
||||
(match-string 1 mount)))))))
|
||||
|
||||
(defun tramp-fuse-get-fusermount ()
|
||||
"Determine the local `fusermount' command."
|
||||
;; We use key nil for local connection properties.
|
||||
(with-tramp-connection-property nil "fusermount"
|
||||
(or (executable-find "fusermount3")
|
||||
(executable-find "fusermount"))))
|
||||
|
||||
(defvar tramp-fuse-mount-points nil
|
||||
"List of fuse volume determined by a VEC.")
|
||||
|
||||
(defun tramp-fuse-unmount (vec)
|
||||
"Unmount fuse volume determined by VEC."
|
||||
(let ((default-directory tramp-compat-temporary-file-directory)
|
||||
(command (format "fusermount3 -u %s" (tramp-fuse-mount-point vec))))
|
||||
(let* ((default-directory tramp-compat-temporary-file-directory)
|
||||
(mount-point (tramp-fuse-mount-point vec))
|
||||
(command (format "%s -u %s" (tramp-fuse-get-fusermount) mount-point)))
|
||||
(tramp-message vec 6 "%s\n%s" command (shell-command-to-string command))
|
||||
(tramp-flush-connection-property
|
||||
(tramp-get-connection-process vec) "mounted")
|
||||
(setq tramp-fuse-mount-points
|
||||
(delete (tramp-file-name-unify vec) tramp-fuse-mount-points))
|
||||
;; Give the caches a chance to expire.
|
||||
(sleep-for 1)))
|
||||
(sleep-for 1)
|
||||
(when (tramp-compat-directory-empty-p mount-point)
|
||||
(delete-directory mount-point))))
|
||||
|
||||
(defun tramp-fuse-local-file-name (filename)
|
||||
"Return local mount name of FILENAME."
|
||||
|
|
@ -205,6 +220,36 @@
|
|||
(substring localname 1) localname)
|
||||
(tramp-fuse-mount-point v)))))))
|
||||
|
||||
(defcustom tramp-fuse-unmount-on-cleanup nil
|
||||
"Whether fuse volumes shall be unmounted on cleanup."
|
||||
:group 'tramp
|
||||
:version "28.1"
|
||||
:type 'boolean)
|
||||
|
||||
(defun tramp-fuse-cleanup (vec)
|
||||
"Cleanup fuse volume determined by VEC."
|
||||
(and tramp-fuse-unmount-on-cleanup
|
||||
(member (tramp-file-name-unify vec) tramp-fuse-mount-points)
|
||||
(tramp-fuse-unmount vec)))
|
||||
|
||||
(defun tramp-fuse-cleanup-all ()
|
||||
"Unmount all fuse volumes used by Tramp."
|
||||
(and tramp-fuse-unmount-on-cleanup
|
||||
(mapc #'tramp-fuse-unmount tramp-fuse-mount-points)))
|
||||
|
||||
;; Add cleanup hooks.
|
||||
(add-hook 'tramp-cleanup-connection-hook #'tramp-fuse-cleanup)
|
||||
(add-hook 'tramp-cleanup-all-connections-hook #'tramp-fuse-cleanup-all)
|
||||
(add-hook 'kill-emacs-hook #'tramp-fuse-cleanup-all)
|
||||
(add-hook 'tramp-fuse-unload-hook
|
||||
(lambda ()
|
||||
(remove-hook 'tramp-cleanup-connection-hook
|
||||
#'tramp-fuse-cleanup)
|
||||
(remove-hook 'tramp-cleanup-all-connections-hook
|
||||
#'tramp-fuse-cleanup-all)
|
||||
(remove-hook 'kill-emacs-hook
|
||||
#'tramp-fuse-cleanup-all)))
|
||||
|
||||
(add-hook 'tramp-unload-hook
|
||||
(lambda ()
|
||||
(unload-feature 'tramp-fuse 'force)))
|
||||
|
|
|
|||
|
|
@ -386,6 +386,7 @@ connection if a previous connection has died for some reason."
|
|||
(tramp-cleanup-connection vec 'keep-debug 'keep-password))
|
||||
|
||||
;; Mark it as connected.
|
||||
(add-to-list 'tramp-fuse-mount-points (tramp-file-name-unify vec))
|
||||
(tramp-set-connection-property
|
||||
(tramp-get-connection-process vec) "connected" t))))
|
||||
|
||||
|
|
|
|||
|
|
@ -222,11 +222,14 @@ arguments to pass to the OPERATION."
|
|||
(defun tramp-sshfs-handle-insert-file-contents
|
||||
(filename &optional visit beg end replace)
|
||||
"Like `insert-file-contents' for Tramp files."
|
||||
(let ((result
|
||||
(insert-file-contents
|
||||
(tramp-fuse-local-file-name filename) visit beg end replace)))
|
||||
(when visit (setq buffer-file-name filename))
|
||||
(cons (expand-file-name filename) (cdr result))))
|
||||
(setq filename (expand-file-name filename))
|
||||
(let (signal-hook-function result)
|
||||
(unwind-protect
|
||||
(setq result
|
||||
(insert-file-contents
|
||||
(tramp-fuse-local-file-name filename) visit beg end replace))
|
||||
(when visit (setq buffer-file-name filename))
|
||||
(cons filename (cdr result)))))
|
||||
|
||||
(defun tramp-sshfs-handle-process-file
|
||||
(program &optional infile destination display &rest args)
|
||||
|
|
@ -368,6 +371,7 @@ connection if a previous connection has died for some reason."
|
|||
vec 'file-error "Error mounting %s" (tramp-fuse-mount-spec vec))))
|
||||
|
||||
;; Mark it as connected.
|
||||
(add-to-list 'tramp-fuse-mount-points (tramp-file-name-unify vec))
|
||||
(tramp-set-connection-property
|
||||
(tramp-get-connection-process vec) "connected" t)))
|
||||
|
||||
|
|
|
|||
|
|
@ -1450,16 +1450,24 @@ If nil, return `tramp-default-port'."
|
|||
|
||||
(put #'tramp-file-name-port-or-default 'tramp-suppress-trace t)
|
||||
|
||||
(defun tramp-file-name-unify (vec)
|
||||
"Unify VEC by removing localname and hop from `tramp-file-name' structure.
|
||||
Objects returned by this function compare `equal' if they refer to the
|
||||
same connection. Make a copy in order to avoid side effects."
|
||||
(when (tramp-file-name-p vec)
|
||||
(setq vec (copy-tramp-file-name vec))
|
||||
(setf (tramp-file-name-localname vec) nil
|
||||
(tramp-file-name-hop vec) nil))
|
||||
vec)
|
||||
|
||||
(put #'tramp-file-name-unify 'tramp-suppress-trace t)
|
||||
|
||||
;; Comparison of file names is performed by `tramp-equal-remote'.
|
||||
(defun tramp-file-name-equal-p (vec1 vec2)
|
||||
"Check, whether VEC1 and VEC2 denote the same `tramp-file-name'."
|
||||
(and (tramp-file-name-p vec1) (tramp-file-name-p vec2)
|
||||
(string-equal (tramp-file-name-method vec1)
|
||||
(tramp-file-name-method vec2))
|
||||
(string-equal (tramp-file-name-user-domain vec1)
|
||||
(tramp-file-name-user-domain vec2))
|
||||
(string-equal (tramp-file-name-host-port vec1)
|
||||
(tramp-file-name-host-port vec2))))
|
||||
(equal (tramp-file-name-unify vec1)
|
||||
(tramp-file-name-unify vec2))))
|
||||
|
||||
(defun tramp-get-method-parameter (vec param)
|
||||
"Return the method parameter PARAM.
|
||||
|
|
@ -3743,7 +3751,8 @@ User is always nil."
|
|||
(with-parsed-tramp-file-name filename nil
|
||||
(unwind-protect
|
||||
(if (not (file-exists-p filename))
|
||||
(tramp-compat-file-missing v filename)
|
||||
(let ((tramp-verbose (if visit 0 tramp-verbose)))
|
||||
(tramp-compat-file-missing v filename))
|
||||
|
||||
(with-tramp-progress-reporter
|
||||
v 3 (format-message "Inserting `%s'" filename)
|
||||
|
|
@ -3845,7 +3854,7 @@ User is always nil."
|
|||
(delete-file (tramp-make-tramp-file-name v remote-copy 'nohop))))
|
||||
|
||||
;; Result.
|
||||
(cons (expand-file-name filename) (cdr result)))))
|
||||
(cons filename (cdr result)))))
|
||||
|
||||
(defun tramp-get-lock-file (file)
|
||||
"Read lockfile info of FILE.
|
||||
|
|
@ -3920,7 +3929,8 @@ Return nil when there is no lockfile."
|
|||
(tramp-error v 'file-error "Unsafe lock file name")))
|
||||
|
||||
;; Do the lock.
|
||||
(let (create-lockfiles signal-hook-function)
|
||||
(let ((tramp-verbose 0)
|
||||
create-lockfiles signal-hook-function)
|
||||
(condition-case nil
|
||||
(make-symbolic-link info lockname 'ok-if-already-exists)
|
||||
(error
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue