diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2018-12-06 16:00:05 +0100 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2018-12-06 16:00:05 +0100 |
commit | 66b49fc1d522b8d2cce7e957a5c6e7a4f6c90e0f (patch) | |
tree | 7c00141c6ca665d20979c3dc5aa2136dbf2b731f /lisp/net/tramp-cache.el | |
parent | 8f3fde3884d818eb2eef39f8295c5884bc371cc4 (diff) | |
download | emacs-66b49fc1d522b8d2cce7e957a5c6e7a4f6c90e0f.tar.gz |
Rework Tramp wrt string-match-p, looking-at-p, save-match-data
* lisp/net/tramp.el (tramp-find-method, tramp-find-user)
(tramp-find-host, tramp-dissect-file-name, tramp-make-tramp-file-name)
(tramp-completion-make-tramp-file-name, tramp-debug-message)
(tramp-message, tramp-progress-reporter-update)
(tramp-set-completion-function)
(tramp-rfn-eshadow-update-overlay)
(tramp-find-file-name-coding-system-alist)
(tramp-file-name-for-operation)
(tramp-use-absolute-autoload-file-names)
(tramp-get-completion-methods, tramp-get-completion-user-host)
(tramp-handle-directory-files)
(tramp-handle-file-name-case-insensitive-p)
(tramp-handle-file-name-completion, tramp-handle-file-truename)
(tramp-handle-insert-directory, tramp-handle-load)
(tramp-handle-shell-command, tramp-action-yesno)
(tramp-action-yn, tramp-process-actions)
(tramp-mode-string-to-int, tramp-get-local-locale)
(tramp-local-host-p):
* lisp/net/tramp-adb.el (tramp-adb-handle-file-system-info)
(tramp-adb-handle-directory-files-and-attributes)
(tramp-adb--gnu-switches-to-ash, tramp-adb-sh-fix-ls-output)
(tramp-adb-handle-file-name-all-completions)
(tramp-adb-handle-shell-command)
(tramp-adb-handle-start-file-process):
* lisp/net/tramp-archive.el (tramp-archive-dissect-file-name):
* lisp/net/tramp-cache.el (tramp-get-hash-table)
(tramp-flush-directory-properties, tramp-flush-file-function):
* lisp/net/tramp-cmds.el (tramp-reporter-dump-variable)
(tramp-append-tramp-buffers):
* lisp/net/tramp-compat.el (tramp-compat-process-running-p):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name)
(tramp-gvfs-get-file-attributes)
(tramp-gvfs-handle-file-attributes)
(tramp-gvfs-monitor-process-filter)
(tramp-gvfs-handler-mounted-unmounted)
(tramp-gvfs-connection-mounted-p, tramp-gvfs-mount-spec-entry)
(tramp-gvfs-mount-spec, tramp-gvfs-maybe-open-connection):
* lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls)
(tramp-do-file-attributes-with-stat)
(tramp-sh-handle-file-selinux-context)
(tramp-sh-handle-directory-files-and-attributes)
(tramp-do-directory-files-and-attributes-with-stat)
(tramp-sh-handle-file-name-all-completions)
(tramp-sh-handle-dired-compress-file)
(tramp-sh-handle-insert-directory)
(tramp-sh-handle-expand-file-name)
(tramp-sh-handle-start-file-process)
(tramp-sh-handle-process-file, tramp-sh-handle-write-region)
(tramp-sh-handle-file-notify-add-watch)
(tramp-sh-gio-monitor-process-filter)
(tramp-sh-gvfs-monitor-dir-process-filter)
(tramp-sh-inotifywait-process-filter)
(tramp-sh-handle-file-system-info, tramp-maybe-send-script)
(tramp-find-executable, tramp-open-shell, tramp-find-shell)
(tramp-open-connection-setup-interactive-shell)
(tramp-find-inline-encoding, tramp-call-local-coding-command)
(tramp-compute-multi-hops, tramp-maybe-open-connection)
(tramp-convert-file-attributes)
(tramp-make-copy-program-file-name, tramp-get-remote-locale)
(tramp-get-test-nt-command, tramp-get-remote-stat)
(tramp-get-inline-coding):
* lisp/net/tramp-smb.el (tramp-smb-handle-directory-files)
(tramp-smb-action-get-acl, tramp-smb-handle-file-attributes)
(tramp-smb-handle-file-name-all-completions)
(tramp-smb-handle-file-system-info)
(tramp-smb-handle-file-writable-p)
(tramp-smb-handle-insert-directory)
(tramp-smb-handle-make-directory)
(tramp-smb-handle-make-directory-internal)
(tramp-smb-handle-start-file-process, tramp-smb-get-localname)
(tramp-smb-read-file-entry): Use `string-match-p' and
`looking-at-p'. Remove superfluous `save-match-data'. Apply
`eval-when-compile' on constant concat data.
* lisp/net/tramp-compat.el (tramp-compat-file-name-quoted-p-p):
Use `string-prefix-p'.
(tramp-compat-file-name-unquote): Do not use match data.
Diffstat (limited to 'lisp/net/tramp-cache.el')
-rw-r--r-- | lisp/net/tramp-cache.el | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 51a8f13c4a4..0a799d721d6 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -104,7 +104,7 @@ matching entries of `tramp-connection-properties'." (puthash key (make-hash-table :test 'equal) tramp-cache-data))) (when (tramp-file-name-p key) (dolist (elt tramp-connection-properties) - (when (string-match + (when (string-match-p (or (nth 0 elt) "") (tramp-make-tramp-file-name key 'noloc 'nohop)) (tramp-set-connection-property key (nth 1 elt) (nth 2 elt))))) @@ -217,8 +217,8 @@ Remove also properties of all files in subdirectories." (lambda (key _value) (when (and (tramp-file-name-p key) (stringp (tramp-file-name-localname key)) - (string-match (regexp-quote directory) - (tramp-file-name-localname key))) + (string-match-p (regexp-quote directory) + (tramp-file-name-localname key))) (remhash key tramp-cache-data))) tramp-cache-data) ;; Remove file properties of symlinks. @@ -236,7 +236,7 @@ Remove also properties of all files in subdirectories." This is suppressed for temporary buffers." (save-match-data (unless (or (null (buffer-name)) - (string-match "^\\( \\|\\*\\)" (buffer-name))) + (string-match-p "^\\( \\|\\*\\)" (buffer-name))) (let ((bfn (if (stringp (buffer-file-name)) (buffer-file-name) default-directory)) |