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-cmds.el | |
parent | 8f3fde3884d818eb2eef39f8295c5884bc371cc4 (diff) | |
download | emacs-66b49fc1d522b8d2cce7e957a5c6e7a4f6c90e0f.tar.gz emacs-66b49fc1d522b8d2cce7e957a5c6e7a4f6c90e0f.tar.bz2 emacs-66b49fc1d522b8d2cce7e957a5c6e7a4f6c90e0f.zip |
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-cmds.el')
-rw-r--r-- | lisp/net/tramp-cmds.el | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index 3c8f182ae97..b886223c95c 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -261,7 +261,7 @@ buffer in your bug report. (set varsym (read (format "(%s)" (tramp-cache-print val)))) ;; There are non-7bit characters to be masked. (when (and (stringp val) - (string-match + (string-match-p (concat "[^" (bound-and-true-p mm-7bit-chars) "]") val)) (with-current-buffer reporter-eval-buffer (set @@ -277,10 +277,11 @@ buffer in your bug report. ;; Remove string quotation. (forward-line -1) (when (looking-at - (concat "\\(^.*\\)" "\"" ;; \1 " - "\\((base64-decode-string \\)" "\\\\" ;; \2 \ - "\\(\".*\\)" "\\\\" ;; \3 \ - "\\(\")\\)" "\"$")) ;; \4 " + (eval-when-compile + (concat "\\(^.*\\)" "\"" ;; \1 " + "\\((base64-decode-string \\)" "\\\\" ;; \2 \ + "\\(\".*\\)" "\\\\" ;; \3 \ + "\\(\")\\)" "\"$"))) ;; \4 " (replace-match "\\1\\2\\3\\4") (beginning-of-line) (insert " ;; Variable encoded due to non-printable characters.\n")) @@ -305,7 +306,7 @@ buffer in your bug report. (delq nil (mapcar (lambda (b) - (when (string-match "\\*tramp/" (buffer-name b)) b)) + (when (string-match-p "\\*tramp/" (buffer-name b)) b)) (buffer-list)))) (let ((reporter-eval-buffer buffer) (elbuf (get-buffer-create " *tmp-reporter-buffer*"))) @@ -333,7 +334,7 @@ buffer in your bug report. (insert "\nload-path shadows:\n==================\n") (ignore-errors (mapc - (lambda (x) (when (string-match "tramp" x) (insert x "\n"))) + (lambda (x) (when (string-match-p "tramp" x) (insert x "\n"))) (split-string (list-load-path-shadows t) "\n"))) ;; Append buffers only when we are in message mode. |