diff options
author | Dieter Komendera <dieter@komendera.com> | 2018-10-28 21:57:05 +0100 |
---|---|---|
committer | Bozhidar Batsov <bozhidar.batsov@gmail.com> | 2018-11-18 18:36:50 +0100 |
commit | 6679d5d8d86c0ed789124556989bdedeb9a38ccc (patch) | |
tree | 21eaea4cb5cbb4180af7d2ab055483ca164074c5 /cider-mode.el | |
parent | a94006196db0244abf2db424ef2e8b7b614ad4c0 (diff) |
Use symbols for repl types instead of strings and efficient comparisons
Make public functions backwards compatible by converting type string to symbol
Diffstat (limited to 'cider-mode.el')
-rw-r--r-- | cider-mode.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cider-mode.el b/cider-mode.el index f9b2189e..1d17065c 100644 --- a/cider-mode.el +++ b/cider-mode.el @@ -54,7 +54,7 @@ Info contains the connection type, project name and host:port endpoint." (if-let* ((current-connection (ignore-errors (cider-current-repl)))) (with-current-buffer current-connection (concat - cider-repl-type + (symbol-name cider-repl-type) (when cider-mode-line-show-connection (format ":%s@%s:%s" (or (cider--project-name nrepl-project-dir) "<no project>") @@ -133,8 +133,8 @@ Clojure buffer and the REPL buffer." (when-let* ((type (cider-repl-type-for-buffer b))) (unless a-buf (setq a-buf b)) - (or (equal type "multi") - (equal type repl-type))))) + (or (eq type 'multi) + (eq type repl-type))))) (buffer-list))))) (if-let* ((buf (or the-buf a-buf))) (if cider-repl-display-in-current-window @@ -674,7 +674,10 @@ the LIMIT in `cider--anchored-search-suppressed-forms`" An unused reader conditional expression is an expression for a platform that does not match the CIDER connection for the buffer. Search is done with the given LIMIT." - (let ((repl-types (seq-uniq (seq-map #'cider-repl-type (cider-repls)))) + (let ((repl-types (seq-uniq (seq-map + (lambda (repl) + (symbol-name (cider-repl-type repl))) + (cider-repls)))) (result 'retry)) (while (and (eq result 'retry) (<= (point) limit)) (condition-case condition |