(file-regular-p . tramp-handle-file-regular-p)
;; `file-remote-p' performed by default handler.
(file-selinux-context . tramp-handle-file-selinux-context)
- (file-symlink-p . tramp-handle-file-symlink-p)
+ (file-symlink-p . tramp-archive-handle-file-symlink-p)
(file-system-info . tramp-archive-handle-file-system-info)
(file-truename . tramp-archive-handle-file-truename)
(file-user-uid . tramp-archive-handle-file-user-uid)
"Like `file-readable-p' for file archives."
(file-readable-p (tramp-archive-gvfs-file-name filename)))
+(defun tramp-archive-handle-file-symlink-p (filename)
+ "Like `file-symlink-p' for file archives."
+ (file-symlink-p (tramp-archive-gvfs-file-name filename)))
+
(defun tramp-archive-handle-file-system-info (filename)
"Like `file-system-info' for file archives."
(with-parsed-tramp-archive-file-name filename nil
;;; Code:
(require 'tramp-compat)
-(require 'tramp-loaddefs)
(require 'time-stamp)
;;; -- Cache --
If it doesn't exist yet, it is created and initialized with
matching entries of `tramp-connection-properties'.
If KEY is `tramp-cache-undefined', don't create anything, and return nil."
+ (declare (tramp-suppress-trace t))
(unless (eq key tramp-cache-undefined)
(or (gethash key tramp-cache-data)
(let ((hash
;;;###tramp-autoload
(defun tramp-cache-print (table)
"Print hash table TABLE."
+ ;; (declare (tramp-suppress-trace t))
(when (hash-table-p table)
(let (result)
(maphash
table)
result)))
+;; We cannot use the `declare' form for `tramp-suppress-trace' in
+;; autoloaded functions, because the tramp-loaddefs.el generation
+;; would fail.
+(function-put #'tramp-cache-print 'tramp-suppress-trace t)
+
;;;###tramp-autoload
(defun tramp-list-connections ()
"Return all active `tramp-file-name' structs according to `tramp-cache-data'."
(defun tramp-dump-connection-properties ()
"Write persistent connection properties into file \
`tramp-persistency-file-name'."
+ (declare (tramp-suppress-trace t))
;; We shouldn't fail, otherwise Emacs might not be able to be closed.
(ignore-errors
(when (and (hash-table-p tramp-cache-data)
(defun tramp-cleanup-dired-buffer-p ()
"Return t if current buffer runs `dired-mode'."
+ (declare (tramp-suppress-trace t))
(derived-mode-p 'dired-mode))
(add-hook 'tramp-cleanup-some-buffers-hook
(defun tramp-delete-tainted-remote-process-buffer-function ()
"Delete current buffer from `tramp-tainted-remote-process-buffers'."
+ (declare (tramp-suppress-trace t))
(setq tramp-tainted-remote-process-buffers
(delete (current-buffer) tramp-tainted-remote-process-buffers)))
;;;###tramp-autoload
(defun tramp-taint-remote-process-buffer (buffer)
"Mark buffer as related to remote processes."
+ ;; (declare (tramp-suppress-trace t))
(add-to-list 'tramp-tainted-remote-process-buffers buffer))
+;; We cannot use the `declare' form for `tramp-suppress-trace' in
+;; autoloaded functions, because the tramp-loaddefs.el generation
+;; would fail.
+(function-put #'tramp-taint-remote-process-buffer 'tramp-suppress-trace t)
+
(add-hook 'kill-buffer-hook
#'tramp-delete-tainted-remote-process-buffer-function)
(add-hook 'tramp-unload-hook
;;; Code:
+(require 'tramp-loaddefs)
(require 'ansi-color)
(require 'auth-source)
(require 'format-spec)
(require 'shell)
(require 'xdg)
-(declare-function tramp-error "tramp")
+(declare-function tramp-error "tramp-message")
(declare-function tramp-tramp-file-p "tramp")
(defvar tramp-temp-name-prefix)
(assoc operation tramp-crypt-file-name-handler-alist))))
(prog1 (save-match-data (apply (cdr fn) args))
(setq tramp-debug-message-fnh-function (cdr fn)))
- (prog1 (tramp-run-real-handler operation args)
+ (prog1 (tramp-crypt-run-real-handler operation args)
(setq tramp-debug-message-fnh-function operation))))
;;;###tramp-autoload
"Set up a minibuffer for `file-name-shadow-mode'.
Adds another overlay hiding filename parts according to Tramp's
special handling of `substitute-in-file-name'."
+ (declare (tramp-suppress-trace t))
(when minibuffer-completing-file-name
(setq tramp-rfn-eshadow-overlay
(make-overlay (minibuffer-prompt-end) (minibuffer-prompt-end)))
(defun tramp-rfn-eshadow-update-overlay-regexp ()
"An overlay covering the shadowed part of the filename."
+ (declare (tramp-suppress-trace t))
(rx-to-string
`(: (* (not (any ,tramp-postfix-host-format "/~"))) (| "/" "~"))))
This is intended to be used as a minibuffer `post-command-hook' for
`file-name-shadow-mode'; the minibuffer should have already
been set up by `rfn-eshadow-setup-minibuffer'."
+ (declare (tramp-suppress-trace t))
;; In remote files name, there is a shadowing just for the local part.
(ignore-errors
(let ((end (or (overlay-end rfn-eshadow-overlay)
;;; Code:
-(require 'tramp-loaddefs)
+(require 'tramp-compat)
(require 'help-mode)
-(declare-function tramp-compat-string-replace "tramp-compat")
(declare-function tramp-file-name-equal-p "tramp")
(declare-function tramp-file-name-host-port "tramp")
(declare-function tramp-file-name-user-domain "tramp")
(declare-function tramp-get-default-directory "tramp")
-(defvar tramp-compat-temporary-file-directory)
-
-(eval-and-compile
- (defalias 'tramp-byte-run--set-suppress-trace
- #'(lambda (f _args val)
- (list 'function-put (list 'quote f)
- ''tramp-suppress-trace val)))
-
- (add-to-list
- 'defun-declarations-alist
- (list 'tramp-suppress-trace #'tramp-byte-run--set-suppress-trace)))
;;;###tramp-autoload
(defcustom tramp-verbose 3
Point must be at the beginning of a header line.
The outline level is equal to the verbosity of the Tramp message."
+ (declare (tramp-suppress-trace t))
(1+ (string-to-number (match-string 3))))
;; This function takes action since Emacs 28.1, when
(defun tramp-debug-buffer-command-completion-p (_symbol buffer)
"A predicate for Tramp interactive commands.
They are completed by \"M-x TAB\" only in Tramp debug buffers."
+ (declare (tramp-suppress-trace t))
(with-current-buffer buffer
(string-equal
(buffer-substring (point-min) (min (+ (point-min) 10) (point-max)))
Calls functions `message' and `tramp-debug-message' with FMT-STRING as
control string and the remaining ARGUMENTS to actually emit the message (if
applicable)."
+ ;; (declare (tramp-suppress-trace t))
(ignore-errors
(when (<= level tramp-verbose)
;; Display only when there is a minimum level, and the progress
(concat (format "(%d) # " level) fmt-string)
arguments))))))
-;; We cannot declare our private symbols in loaddefs.
-(function-put 'tramp-message 'tramp-suppress-trace t)
+;; We cannot use the `declare' form for `tramp-suppress-trace' in
+;; autoloaded functions, because the tramp-loaddefs.el generation
+;; would fail.
+(function-put #'tramp-message 'tramp-suppress-trace t)
(defsubst tramp-backtrace (&optional vec-or-proc force)
"Dump a backtrace into the debug buffer.
(defun tramp-debug-button-action (button)
"Goto the linked message in debug buffer at place."
+ (declare (tramp-suppress-trace t))
(when (mouse-event-p last-input-event) (mouse-set-point last-input-event))
(when-let ((point (button-get button 'position)))
(goto-char point)))
(defun tramp-debug-link-messages (pos1 pos2)
"Set links for two messages in current buffer.
The link buttons are in the verbositiy level substrings."
+ (declare (tramp-suppress-trace t))
(save-excursion
(let (beg1 end1 beg2 end2)
(goto-char pos1)
(defun tramp-debug-message-buttonize (position)
"Buttonize function in current buffer, at next line starting after POSTION."
+ (declare (tramp-suppress-trace t))
(save-excursion
(goto-char position)
(while (not (search-forward-regexp
;;;###autoload (when (featurep 'tramp-compat)
;;;###autoload (load "tramp-compat" 'noerror 'nomessage))
-;;; User Customizable Internal Variables:
-
-(defgroup tramp nil
- "Edit remote files with a combination of ssh, scp, etc."
- :group 'files
- :group 'comm
- :version "22.1"
- :link '(custom-manual "(tramp)Top"))
-
;;;###tramp-autoload
(progn
(defvar tramp--startup-hook nil
(defmacro tramp--with-startup (&rest body)
"Schedule BODY to be executed at the end of tramp.el."
- `(add-hook 'tramp--startup-hook (lambda () ,@body))))
+ `(add-hook 'tramp--startup-hook (lambda () ,@body)))
-(require 'tramp-loaddefs)
+ (eval-and-compile
+ (defalias 'tramp-byte-run--set-suppress-trace
+ #'(lambda (f _args val)
+ (list 'function-put (list 'quote f)
+ ''tramp-suppress-trace val)))
+
+ (add-to-list
+ 'defun-declarations-alist
+ (list 'tramp-suppress-trace #'tramp-byte-run--set-suppress-trace))))
+
+;;; User Customizable Internal Variables:
+
+(defgroup tramp nil
+ "Edit remote files with a combination of ssh, scp, etc."
+ :group 'files
+ :group 'comm
+ :version "22.1"
+ :link '(custom-manual "(tramp)Top"))
;; Maybe we need once a real Tramp mode, with key bindings etc.
;;;###autoload
LOCALNAME is a relative file name, return `tramp-cache-undefined'.
Objects returned by this function compare `equal' if they refer to the
same connection. Make a copy in order to avoid side effects."
+ ;; (declare (tramp-suppress-trace t))
(if (and (stringp localname)
(not (file-name-absolute-p localname)))
(setq vec tramp-cache-undefined)
(tramp-file-name-hop vec) nil))
vec))
-;; We cannot declare our private symbols in loaddefs.
-(function-put 'tramp-file-name-unify 'tramp-suppress-trace t)
+;; We cannot use the `declare' form for `tramp-suppress-trace' in
+;; autoloaded functions, because the tramp-loaddefs.el generation
+;; would fail.
+(function-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'.
LOCALNAME and HOP do not count."
+ (declare (tramp-suppress-trace t))
(and (tramp-file-name-p vec1) (tramp-file-name-p vec2)
(equal (tramp-file-name-unify vec1)
(tramp-file-name-unify vec2))))
;;;###tramp-autoload
(defun tramp-tramp-file-p (name)
"Return t if NAME is a string with Tramp file name syntax."
+ ;; (declare (tramp-suppress-trace t))
(and tramp-mode (stringp name)
;; No "/:" and "/c:". This is not covered by `tramp-file-name-regexp'.
(not (string-match-p (rx bos "/" (? alpha) ":") name))
(string-match-p tramp-file-name-regexp name)
t))
+;; We cannot use the `declare' form for `tramp-suppress-trace' in
+;; autoloaded functions, because the tramp-loaddefs.el generation
+;; would fail.
+(function-put #'tramp-tramp-file-p 'tramp-suppress-trace t)
+
;; This function bypasses the file name handler approach. It is NOT
;; recommended to use it in any package if not absolutely necessary.
;; However, it is more performant than `file-local-name', and might be
"Return the right method string to use depending on USER and HOST.
This is METHOD, if non-nil. Otherwise, do a lookup in
`tramp-default-method-alist' and `tramp-default-method'."
+ (declare (tramp-suppress-trace t))
(when (and method
(or (string-empty-p method)
(string-equal method tramp-default-method-marker)))
"Return the right user string to use depending on METHOD and HOST.
This is USER, if non-nil. Otherwise, do a lookup in
`tramp-default-user-alist' and `tramp-default-user'."
+ (declare (tramp-suppress-trace t))
(let ((result
(or user
(let ((choices tramp-default-user-alist)
"Return the right host string to use depending on METHOD and USER.
This is HOST, if non-nil. Otherwise, do a lookup in
`tramp-default-host-alist' and `tramp-default-host'."
+ (declare (tramp-suppress-trace t))
(let ((result
(or (and (tramp-compat-length> host 0) host)
(let ((choices tramp-default-host-alist)
Unless NODEFAULT is non-nil, method, user and host are expanded
to their default values. For the other file name parts, no
default values are used."
+ ;; (declare (tramp-suppress-trace t))
(save-match-data
(unless (tramp-tramp-file-p name)
(tramp-user-error nil "Not a Tramp file name: \"%s\"" name))
(tramp-user-error
v "Method `%s' is not supported for multi-hops" method)))))))
-;; We cannot declare our private symbols in loaddefs.
-(function-put 'tramp-dissect-file-name 'tramp-suppress-trace t)
+;; We cannot use the `declare' form for `tramp-suppress-trace' in
+;; autoloaded functions, because the tramp-loaddefs.el generation
+;; would fail.
+(function-put #'tramp-dissect-file-name 'tramp-suppress-trace t)
;;;###tramp-autoload
(defun tramp-ensure-dissected-file-name (vec-or-filename)
VEC-OR-FILENAME may be either a string or a `tramp-file-name'.
If it's not a Tramp filename, return nil."
+ ;; (declare (tramp-suppress-trace t))
(cond
((tramp-file-name-p vec-or-filename) vec-or-filename)
((tramp-tramp-file-p vec-or-filename)
(tramp-dissect-file-name vec-or-filename))))
-;; We cannot declare our private symbols in loaddefs.
-(function-put 'tramp-ensure-dissected-file-name 'tramp-suppress-trace t)
+;; We cannot use the `declare' form for `tramp-suppress-trace' in
+;; autoloaded functions, because the tramp-loaddefs.el generation
+;; would fail.
+(function-put #'tramp-ensure-dissected-file-name 'tramp-suppress-trace t)
(defun tramp-dissect-hop-name (name &optional nodefault)
"Return a `tramp-file-name' structure of `hop' part of NAME.
(defun tramp-buffer-name (vec)
"A name for the connection buffer VEC."
+ (declare (tramp-suppress-trace t))
(let ((method (tramp-file-name-method vec))
(user-domain (tramp-file-name-user-domain vec))
(host-port (tramp-file-name-host-port vec)))
(defun tramp-delete-temp-file-function ()
"Remove temporary files related to current buffer."
+ (declare (tramp-suppress-trace t))
(when (stringp tramp-temp-buffer-file-name)
(ignore-errors (delete-file tramp-temp-buffer-file-name))))
(defun tramp-time-diff (t1 t2)
"Return the difference between the two times, in seconds.
T1 and T2 are time values (as returned by `current-time' for example)."
+ (declare (tramp-suppress-trace t))
(float-time (time-subtract t1 t2)))
(defun tramp-unquote-shell-quote-argument (s)