|
7 | 7 | ;; Lars Andersen <[email protected]>
|
8 | 8 | ;; Benedek Fazekas <[email protected]>
|
9 | 9 | ;; Bozhidar Batsov <[email protected]>
|
10 |
| -;; Version: 3.9.4 |
| 10 | +;; Version: 3.10.0 |
11 | 11 | ;; Keywords: convenience, clojure, cider
|
12 | 12 |
|
13 |
| -;; Package-Requires: ((emacs "26.1") (seq "2.19") (yasnippet "0.6.1") (paredit "24") (multiple-cursors "1.2.2") (clojure-mode "5.16.1") (cider "1.7.0") (parseedn "1.1.0") (inflections "2.6") (hydra "0.13.2")) |
| 13 | +;; Package-Requires: ((emacs "26.1") (seq "2.19") (yasnippet "0.6.1") (paredit "24") (multiple-cursors "1.2.2") (clojure-mode "5.17.0") (cider "1.7.0") (parseedn "1.1.0") (inflections "2.6") (hydra "0.13.2")) |
14 | 14 |
|
15 | 15 | ;; This program is free software; you can redistribute it and/or
|
16 | 16 | ;; modify it under the terms of the GNU General Public License
|
@@ -746,26 +746,43 @@ if the point is currently placed at the opening parentheses of an anonymous func
|
746 | 746 | ;; evenp lives in cl.el...
|
747 | 747 | (zerop (mod n 2)))
|
748 | 748 |
|
| 749 | +(defun cljr--remove-tramp-prefix-from-msg (entry) |
| 750 | + (let* ((k (car entry)) |
| 751 | + (v (cadr entry))) |
| 752 | + (list k |
| 753 | + (if (and (member k '("file" "dir" "path" "old-path" "new-path")) |
| 754 | + (stringp v)) |
| 755 | + (if-let* ((p (cider-tramp-prefix))) |
| 756 | + (string-remove-prefix p v) |
| 757 | + v) |
| 758 | + v)))) |
| 759 | + |
749 | 760 | (defun cljr--create-msg (op &rest kvs)
|
750 | 761 | "Create a msg for the middleware for OP and optionally include the kv pairs KVS.
|
751 | 762 |
|
752 | 763 | All config settings are included in the created msg."
|
753 | 764 | (cl-assert (cljr--evenp (length kvs)) nil "Can't create msg to send to the middleware.\
|
754 | 765 | Received an uneven number of kv pairs: %s " kvs)
|
755 |
| - (apply #'list "op" op |
| 766 | + (apply #'list |
| 767 | + "op" op |
| 768 | + |
756 | 769 | "prefix-rewriting"
|
757 | 770 | (if cljr-favor-prefix-notation
|
758 | 771 | "true"
|
759 | 772 | "false")
|
| 773 | + |
760 | 774 | "insert-newline-after-require"
|
761 | 775 | (if cljr-insert-newline-after-require
|
762 | 776 | "true"
|
763 | 777 | "false")
|
| 778 | + |
764 | 779 | "debug"
|
765 | 780 | (if cljr--debug-mode
|
766 | 781 | "true"
|
767 | 782 | "false")
|
768 |
| - kvs)) |
| 783 | + |
| 784 | + (seq-mapcat #'cljr--remove-tramp-prefix-from-msg |
| 785 | + (seq-partition kvs 2)))) |
769 | 786 |
|
770 | 787 | (defun cljr--post-command-message (format-string &rest args)
|
771 | 788 | "Display msg in a post command hook, to ensure it doesn't drown in emacs' general chatter."
|
@@ -2709,8 +2726,14 @@ See: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-promote-function
|
2709 | 2726 | (string-remove-prefix (cljr--project-dir) path))
|
2710 | 2727 |
|
2711 | 2728 | (defun cljr--get-valid-filename (hash)
|
2712 |
| - "Get :file value from the hash table and convert path if necessary." |
2713 |
| - (funcall cider-from-nrepl-filename-function (gethash :file hash))) |
| 2729 | + "Get :file value from the hash table and convert path if necessary. |
| 2730 | +
|
| 2731 | +Translate it back to TRAMP notation if needed." |
| 2732 | + (let ((file (funcall cider-from-nrepl-filename-function (gethash :file hash))) |
| 2733 | + (current (funcall cider-from-nrepl-filename-function (buffer-file-name)))) |
| 2734 | + (if (tramp-tramp-file-p current) |
| 2735 | + (concat (cider-tramp-prefix) file) |
| 2736 | + file))) |
2714 | 2737 |
|
2715 | 2738 | (defun cljr--format-symbol-occurrence (occurrence)
|
2716 | 2739 | (let ((file (cljr--get-valid-filename occurrence))
|
@@ -3429,7 +3452,7 @@ See: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-inline-symbol"
|
3429 | 3452 | (cljr--post-command-message "No occurrences of '%s' found. Deleted the definition." symbol)))))
|
3430 | 3453 | (cljr--indent-defun)))
|
3431 | 3454 |
|
3432 |
| -(defconst cljr-version "3.9.4" |
| 3455 | +(defconst cljr-version "3.10.0" |
3433 | 3456 | "The current version of clj-refactor.")
|
3434 | 3457 |
|
3435 | 3458 | (defun cljr--pkg-version ()
|
|
0 commit comments