[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/jarchive 5b91602a94 1/2: Remove unnecessary messages, a
From: |
ELPA Syncer |
Subject: |
[elpa] externals/jarchive 5b91602a94 1/2: Remove unnecessary messages, address code feedback from mailing list |
Date: |
Sun, 13 Nov 2022 08:57:51 -0500 (EST) |
branch: externals/jarchive
commit 5b91602a941d9f0d7b60724dd28f0d64e761a984
Author: dannyfreeman <danny@dfreeman.email>
Commit: dannyfreeman <danny@dfreeman.email>
Remove unnecessary messages, address code feedback from mailing list
Turns out advice can be applied before a function is defined.
Co-authored-by: Stefan Monnier <monnier@iro.umontreal.ca>
---
jarchive.el | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/jarchive.el b/jarchive.el
index 8e1813bc51..34915e32d1 100644
--- a/jarchive.el
+++ b/jarchive.el
@@ -130,7 +130,6 @@ primitive. See `(elisp)Magic File Names'."
(list uri (string-width (buffer-string)))))
(t (apply op args)))))
(jarchive--inhibit op 'jarchive--file-name-handler
- (message "jarchive--inhibit %s for %s" op args)
(apply op args))))
(defun jarchive--find-file-not-found ()
@@ -146,7 +145,7 @@ If path is a jar URI, don't parse. If it is not a jar call
ORIGINAL-FN."
(let ((path (file-truename (car args))))
(if (equal "jar" (url-type (url-generic-parse-url path)))
path
- (apply 'funcall original-fn args))))
+ (apply original-fn args))))
(defun jarchive--wrap-legacy-eglot--uri-to-path (original-fn &rest args)
"Hack until eglot is updated.
@@ -155,7 +154,7 @@ If URI is a jar URI, don't parse and let the
`jarchive--file-name-handler'
handle it. If it is not a jar call ORIGINAL-FN."
(let ((uri (car args)))
(if (string= "file" (url-type (url-generic-parse-url uri)))
- (apply 'funcall original-fn args)
+ (apply original-fn args)
uri)))
;;;###autoload
@@ -163,11 +162,8 @@ handle it. If it is not a jar call ORIGINAL-FN."
"Patch old versions of Eglot to work with Jarchive."
(interactive) ;; TODO, remove when eglot is updated in melpa
(cond
- ((version<= "29" emacs-version)
+ ((<= 29 emacs-major-version)
(message "[jarchive] Eglot does not need to be patched. Skipping."))
- ((or (not (fboundp 'eglot--path-to-uri))
- (not (fboundp 'eglot--uri-to-path)))
- (message "[jarchive] Eglot is not loaded, try calling
`jarchive-patch-eglot' after loading eglot."))
(t (advice-add 'eglot--path-to-uri :around
#'jarchive--wrap-legacy-eglot--path-to-uri)
(advice-add 'eglot--uri-to-path :around
#'jarchive--wrap-legacy-eglot--uri-to-path)
(message "[jarchive] Eglot successfully patched."))))