forked from clojure-emacs/cider
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix clojure-emacs#589] Don't preference home directory resources to …
…tramp by default. Rename `cider-use-local-resources` to `cider-prefer-local-resources` and set default value to nil. Rename `cider-emacs-or-clojure-side-adjustment` to `cider-file-path` for clarity (and brevity!).
- Loading branch information
Showing
1 changed file
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,8 +50,8 @@ | |
(defconst cider-doc-buffer "*cider-doc*") | ||
(defconst cider-result-buffer "*cider-result*") | ||
|
||
(defcustom cider-use-local-resources t | ||
"Use local resources under HOME if possible." | ||
(defcustom cider-prefer-local-resources nil | ||
"Prefer local resources under HOME if available." | ||
:type 'boolean | ||
:group 'cider) | ||
|
||
|
@@ -504,13 +504,13 @@ Removes any leading slash if on Windows." | |
(t | ||
resource)))) | ||
|
||
(defun cider-emacs-or-clojure-side-adjustment (resource) | ||
"Fix the RESOURCE path depending on `cider-use-local-resources`." | ||
(defun cider-file-path (resource) | ||
"Return the client or server RESOURCE path using `cider-prefer-local-resources'." | ||
(let ((resource (cider-home-prefix-adjustment resource)) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
bbatsov
|
||
(clojure-side-res (concat (cider-tramp-prefix) resource)) | ||
(emacs-side-res resource)) | ||
(cond ((equal resource "") resource) | ||
((and cider-use-local-resources | ||
((and cider-prefer-local-resources | ||
(file-exists-p emacs-side-res)) | ||
emacs-side-res) | ||
((file-exists-p clojure-side-res) | ||
|
@@ -523,7 +523,7 @@ Removes any leading slash if on Windows." | |
Adjusts for HOME location using `cider-home-prefix-adjustment'. | ||
Uses `find-file'." | ||
(let ((large-file-warning-threshold nil)) | ||
(find-file (cider-emacs-or-clojure-side-adjustment filename)))) | ||
(find-file (cider-file-path filename)))) | ||
|
||
(defun cider-find-resource (resource) | ||
"Find and display RESOURCE." | ||
|
@@ -532,7 +532,7 @@ Uses `find-file'." | |
((string-match "^\\(jar\\|zip\\):file:\\(.+\\)!/\\(.+\\)" resource) | ||
(let* ((jar (match-string 2 resource)) | ||
(path (match-string 3 resource)) | ||
(file (cider-emacs-or-clojure-side-adjustment jar)) | ||
(file (cider-file-path jar)) | ||
(name (format "%s:%s" jar path))) | ||
(switch-to-buffer | ||
(or (get-file-buffer name) | ||
|
Also, either this
let
was intended to be alet*
, or this code style is pretty obtuse. Does anyone actually use this "home-prefix-adjustment"?