From: "Shuguang Sun" <shuguang79@qq.com>
To: 36428@debbugs.gnu.org
Subject: bug#36428: Non-necessary progn afer with-eval-after-load in tramp in recent change
Date: Sat, 29 Jun 2019 11:49:56 +0800 [thread overview]
Message-ID: <tencent_7DC3AFE37076654503279A76D15DF0379D0A@qq.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 227 bytes --]
Hi,
In some recent changes to tramp, the 'eval-after-load' was replaced by 'with-eval-after-load',
however, the unnecessary 'progn' function for the 'eval-after-load' is no removed.
Best Regards,
Shuguang Sun
[-- Attachment #1.2: Type: text/html, Size: 313 bytes --]
[-- Attachment #2: tramp_progn_after_with-eval-after-load.diff --]
[-- Type: application/octet-stream, Size: 5068 bytes --]
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index c8b9e7ae09..186b67c6e9 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -1299,15 +1299,14 @@ tramp-adb-connection-local-default-profile
;; `connection-local-set-profile-variables' and
;; `connection-local-set-profiles' exists since Emacs 26.1.
(with-eval-after-load 'shell
- (progn
- (tramp-compat-funcall
- 'connection-local-set-profile-variables
- 'tramp-adb-connection-local-default-profile
- tramp-adb-connection-local-default-profile)
- (tramp-compat-funcall
- 'connection-local-set-profiles
- `(:application tramp :protocol ,tramp-adb-method)
- 'tramp-adb-connection-local-default-profile)))
+ (tramp-compat-funcall
+ 'connection-local-set-profile-variables
+ 'tramp-adb-connection-local-default-profile
+ tramp-adb-connection-local-default-profile)
+ (tramp-compat-funcall
+ 'connection-local-set-profiles
+ `(:application tramp :protocol ,tramp-adb-method)
+ 'tramp-adb-connection-local-default-profile))
(add-hook 'tramp-unload-hook
(lambda ()
diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el
index b329d4a1b1..82fd327770 100644
--- a/lisp/net/tramp-archive.el
+++ b/lisp/net/tramp-archive.el
@@ -373,13 +373,12 @@ tramp-archive-file-name-handler
(when url-handler-mode (tramp-register-file-name-handlers))
(with-eval-after-load 'url-handler
- (progn
- (add-hook 'url-handler-mode-hook #'tramp-register-file-name-handlers)
- (add-hook
- 'tramp-archive-unload-hook
- (lambda ()
- (remove-hook
- 'url-handler-mode-hook #'tramp-register-file-name-handlers)))))
+ (add-hook 'url-handler-mode-hook #'tramp-register-file-name-handlers)
+ (add-hook
+ 'tramp-archive-unload-hook
+ (lambda ()
+ (remove-hook
+ 'url-handler-mode-hook #'tramp-register-file-name-handlers))))
\f
;; File name conversions.
diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el
index 5960871ca7..0c706da1ca 100644
--- a/lisp/net/tramp-integration.el
+++ b/lisp/net/tramp-integration.el
@@ -124,17 +124,16 @@ tramp-eshell-directory-change
#'identity (butlast (tramp-compat-exec-path)) path-separator)))
(with-eval-after-load 'esh-util
- (progn
- (add-hook 'eshell-mode-hook
- #'tramp-eshell-directory-change)
- (add-hook 'eshell-directory-change-hook
- #'tramp-eshell-directory-change)
- (add-hook 'tramp-integration-unload-hook
- (lambda ()
- (remove-hook 'eshell-mode-hook
- #'tramp-eshell-directory-change)
- (remove-hook 'eshell-directory-change-hook
- #'tramp-eshell-directory-change)))))
+ (add-hook 'eshell-mode-hook
+ #'tramp-eshell-directory-change)
+ (add-hook 'eshell-directory-change-hook
+ #'tramp-eshell-directory-change)
+ (add-hook 'tramp-integration-unload-hook
+ (lambda ()
+ (remove-hook 'eshell-mode-hook
+ #'tramp-eshell-directory-change)
+ (remove-hook 'eshell-directory-change-hook
+ #'tramp-eshell-directory-change))))
;;; Integration of recentf.el:
@@ -159,17 +158,16 @@ tramp-recentf-cleanup-all
(recentf-cleanup))))
(with-eval-after-load 'recentf
- (progn
- (add-hook 'tramp-cleanup-connection-hook
- #'tramp-recentf-cleanup)
- (add-hook 'tramp-cleanup-all-connections-hook
- #'tramp-recentf-cleanup-all)
- (add-hook 'tramp-integration-unload-hook
- (lambda ()
- (remove-hook 'tramp-cleanup-connection-hook
- #'tramp-recentf-cleanup)
- (remove-hook 'tramp-cleanup-all-connections-hook
- #'tramp-recentf-cleanup-all)))))
+ (add-hook 'tramp-cleanup-connection-hook
+ #'tramp-recentf-cleanup)
+ (add-hook 'tramp-cleanup-all-connections-hook
+ #'tramp-recentf-cleanup-all)
+ (add-hook 'tramp-integration-unload-hook
+ (lambda ()
+ (remove-hook 'tramp-cleanup-connection-hook
+ #'tramp-recentf-cleanup)
+ (remove-hook 'tramp-cleanup-all-connections-hook
+ #'tramp-recentf-cleanup-all))))
;;; Default connection-local variables for Tramp:
@@ -181,15 +179,14 @@ tramp-connection-local-default-profile
;; `connection-local-set-profile-variables' and
;; `connection-local-set-profiles' exists since Emacs 26.1.
(with-eval-after-load 'shell
- (progn
- (tramp-compat-funcall
- 'connection-local-set-profile-variables
- 'tramp-connection-local-default-profile
- tramp-connection-local-default-profile)
- (tramp-compat-funcall
- 'connection-local-set-profiles
- `(:application tramp)
- 'tramp-connection-local-default-profile)))
+ (tramp-compat-funcall
+ 'connection-local-set-profile-variables
+ 'tramp-connection-local-default-profile
+ tramp-connection-local-default-profile)
+ (tramp-compat-funcall
+ 'connection-local-set-profiles
+ `(:application tramp)
+ 'tramp-connection-local-default-profile))
(add-hook 'tramp-unload-hook
(lambda () (unload-feature 'tramp-integration 'force)))
next reply other threads:[~2019-06-29 3:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-29 3:49 Shuguang Sun [this message]
2019-06-29 8:36 ` bug#36428: Non-necessary progn afer with-eval-after-load in tramp in recent change Michael Albinus
2019-06-29 9:55 ` Eli Zaretskii
2019-06-29 10:23 ` Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tencent_7DC3AFE37076654503279A76D15DF0379D0A@qq.com \
--to=shuguang79@qq.com \
--cc=36428@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.