From 4fb45c100ac01258efb492d3c252f95e43e6cd9e Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Tue, 22 Jan 2019 16:17:02 +0100 Subject: [PATCH] Update cider. Signed-off-by: Andreas Gerler --- .../cider-apropos.el | 2 +- .../cider-autoloads.el | 0 .../cider-browse-ns.el | 2 +- .../cider-browse-spec.el | 0 .../cider-cheatsheet.el | 2 +- .../cider-classpath.el | 2 +- .../cider-client.el | 87 +++++++++++---- .../cider-common.el | 2 +- .../cider-compat.el | 2 +- .../cider-completion.el | 2 +- .../cider-connection.el | 103 ++++++++++-------- .../cider-debug.el | 28 ++--- .../cider-doc.el | 2 +- .../cider-eldoc.el | 2 +- .../cider-eval.el | 55 +++++----- .../cider-find.el | 2 +- .../cider-format.el | 2 +- .../cider-grimoire.el | 2 +- .../cider-inspector.el | 8 +- .../cider-macroexpansion.el | 2 +- .../cider-mode.el | 13 ++- .../cider-ns.el | 8 +- .../cider-overlays.el | 2 +- .../cider-pkg.el | 2 +- .../cider-popup.el | 2 +- .../cider-profile.el | 2 +- .../cider-repl-history.el | 0 .../cider-repl.el | 85 +++++++++------ .../cider-resolve.el | 4 +- .../cider-scratch.el | 5 +- .../cider-selector.el | 2 +- .../cider-stacktrace.el | 29 ++--- .../cider-test.el | 8 +- .../cider-tracing.el | 2 +- .../cider-util.el | 4 +- .../cider.el | 76 +++++++------ .../nrepl-client.el | 18 +-- .../nrepl-dict.el | 2 +- 38 files changed, 313 insertions(+), 258 deletions(-) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-apropos.el (99%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-autoloads.el (100%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-browse-ns.el (99%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-browse-spec.el (100%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-cheatsheet.el (99%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-classpath.el (98%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-client.el (87%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-common.el (99%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-compat.el (96%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-completion.el (99%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-connection.el (93%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-debug.el (97%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-doc.el (99%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-eldoc.el (99%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-eval.el (96%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-find.el (99%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-format.el (98%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-grimoire.el (98%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-inspector.el (98%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-macroexpansion.el (99%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-mode.el (99%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-ns.el (98%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-overlays.el (99%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-pkg.el (91%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-popup.el (98%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-profile.el (99%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-repl-history.el (100%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-repl.el (96%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-resolve.el (97%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-scratch.el (94%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-selector.el (98%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-stacktrace.el (98%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-test.el (99%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-tracing.el (98%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider-util.el (99%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/cider.el (97%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/nrepl-client.el (98%) rename elpa/{cider-20181110.1413 => cider-20190121.1852}/nrepl-dict.el (99%) diff --git a/elpa/cider-20181110.1413/cider-apropos.el b/elpa/cider-20190121.1852/cider-apropos.el similarity index 99% rename from elpa/cider-20181110.1413/cider-apropos.el rename to elpa/cider-20190121.1852/cider-apropos.el index 97be9aa6..6c0ca5d6 100644 --- a/elpa/cider-20181110.1413/cider-apropos.el +++ b/elpa/cider-20190121.1852/cider-apropos.el @@ -1,6 +1,6 @@ ;;; cider-apropos.el --- Apropos functionality for Clojure -*- lexical-binding: t -*- -;; Copyright © 2014-2018 Jeff Valk, Bozhidar Batsov and CIDER contributors +;; Copyright © 2014-2019 Jeff Valk, Bozhidar Batsov and CIDER contributors ;; ;; Author: Jeff Valk diff --git a/elpa/cider-20181110.1413/cider-autoloads.el b/elpa/cider-20190121.1852/cider-autoloads.el similarity index 100% rename from elpa/cider-20181110.1413/cider-autoloads.el rename to elpa/cider-20190121.1852/cider-autoloads.el diff --git a/elpa/cider-20181110.1413/cider-browse-ns.el b/elpa/cider-20190121.1852/cider-browse-ns.el similarity index 99% rename from elpa/cider-20181110.1413/cider-browse-ns.el rename to elpa/cider-20190121.1852/cider-browse-ns.el index 6f735353..8b983abd 100644 --- a/elpa/cider-20181110.1413/cider-browse-ns.el +++ b/elpa/cider-20190121.1852/cider-browse-ns.el @@ -1,6 +1,6 @@ ;;; cider-browse-ns.el --- CIDER namespace browser -;; Copyright © 2014-2018 John Andrews, Bozhidar Batsov and CIDER contributors +;; Copyright © 2014-2019 John Andrews, Bozhidar Batsov and CIDER contributors ;; Author: John Andrews diff --git a/elpa/cider-20181110.1413/cider-browse-spec.el b/elpa/cider-20190121.1852/cider-browse-spec.el similarity index 100% rename from elpa/cider-20181110.1413/cider-browse-spec.el rename to elpa/cider-20190121.1852/cider-browse-spec.el diff --git a/elpa/cider-20181110.1413/cider-cheatsheet.el b/elpa/cider-20190121.1852/cider-cheatsheet.el similarity index 99% rename from elpa/cider-20181110.1413/cider-cheatsheet.el rename to elpa/cider-20190121.1852/cider-cheatsheet.el index d870c5a5..20c61e71 100644 --- a/elpa/cider-20181110.1413/cider-cheatsheet.el +++ b/elpa/cider-20190121.1852/cider-cheatsheet.el @@ -1,6 +1,6 @@ ;;; cider-cheatsheet.el --- Quick reference for Clojure -*- lexical-binding: t -*- -;; Copyright © 2018 Kris Jenkins, Bozhidar Batsov and CIDER contributors +;; Copyright © 2019 Kris Jenkins, Bozhidar Batsov and CIDER contributors ;; ;; Author: Kris Jenkins diff --git a/elpa/cider-20181110.1413/cider-classpath.el b/elpa/cider-20190121.1852/cider-classpath.el similarity index 98% rename from elpa/cider-20181110.1413/cider-classpath.el rename to elpa/cider-20190121.1852/cider-classpath.el index 10141370..b40a3cee 100644 --- a/elpa/cider-20181110.1413/cider-classpath.el +++ b/elpa/cider-20190121.1852/cider-classpath.el @@ -1,6 +1,6 @@ ;;; cider-classpath.el --- Basic Java classpath browser -;; Copyright © 2014-2018 Bozhidar Batsov and CIDER contributors +;; Copyright © 2014-2019 Bozhidar Batsov and CIDER contributors ;; This program is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by diff --git a/elpa/cider-20181110.1413/cider-client.el b/elpa/cider-20190121.1852/cider-client.el similarity index 87% rename from elpa/cider-20181110.1413/cider-client.el rename to elpa/cider-20190121.1852/cider-client.el index 2c092fbe..8a155568 100644 --- a/elpa/cider-20181110.1413/cider-client.el +++ b/elpa/cider-20190121.1852/cider-client.el @@ -1,6 +1,6 @@ ;;; cider-client.el --- A layer of abstraction above low-level nREPL client code. -*- lexical-binding: t -*- -;; Copyright © 2013-2018 Bozhidar Batsov +;; Copyright © 2013-2019 Bozhidar Batsov ;; ;; Author: Bozhidar Batsov @@ -153,7 +153,7 @@ REQUEST is a pair list of the form (\"op\" \"operation\" \"par1-name\" \"par1\" ... ). If CONNECTION is provided dispatch to that connection instead of the current connection. Return the id of the sent message." - (nrepl-send-request request callback (or connection (cider-current-repl "any")))) + (nrepl-send-request request callback (or connection (cider-current-repl 'any)))) (defun cider-nrepl-send-sync-request (request &optional connection abort-on-input) "Send REQUEST to the nREPL server synchronously using CONNECTION. @@ -163,13 +163,13 @@ If ABORT-ON-INPUT is non-nil, the function will return nil at the first sign of user input, so as not to hang the interface." (nrepl-send-sync-request request - (or connection (cider-current-repl "any")) + (or connection (cider-current-repl 'any)) abort-on-input)) (defun cider-nrepl-send-unhandled-request (request &optional connection) "Send REQUEST to the nREPL CONNECTION and ignore any responses. Immediately mark the REQUEST as done. Return the id of the sent message." - (let* ((conn (or connection (cider-current-repl "any"))) + (let* ((conn (or connection (cider-current-repl 'any))) (id (nrepl-send-request request #'ignore conn))) (with-current-buffer conn (nrepl--mark-id-completed id)) @@ -208,36 +208,81 @@ faster than \\=`clojure.core/pprint\\=` (this is the default) `puget' - to use Puget, which provides canonical serialization of data on top of fipp, but at a slight performance cost -Alternatively, can be the namespace-qualified name of a Clojure function of -one argument. If the function cannot be resolved, an exception will be -thrown. +`zprint' - to use zprint, a fast and flexible alternative to the libraries +mentioned above. -The function is assumed to respect the contract of \\=`clojure.pprint/pprint\\=` -with respect to the bound values of \\=`*print-length*\\=`, \\=`*print-level*\\=`, -\\=`*print-meta*\\=`, and \\=`clojure.pprint/*print-right-margin*\\=`." +Alternatively, can be the namespace-qualified name of a Clojure function of +two arguments - an object to print and an options map. The options map will +have string keys. If the function +cannot be resolved, an exception will be thrown. + +The function should ideally have a two-arity variant that accepts the +object to print and a map of configuration options for the printer. See +`cider-pprint-options' for details. + +The function is also assumed to respect the contract of +\\=`clojure.pprint/pprint\\=` with respect to the bound values of +\\=`*print-length*\\=`, \\=`*print-level*\\=`, \\=`*print-meta*\\=`, and +\\=`clojure.pprint/*print-right-margin*\\=`. Those would normally serve as +fallback values when a map of print options is not supplied explicitly." :type '(choice (const pprint) (const fipp) (const puget) + (const zprint) string) :group 'cider :package-version '(cider . "0.11.0")) +(defcustom cider-pprint-options nil + "A list of options for the pretty-printer that will be converted to a map. +Note that map can only have string keys, so the printer functions should be +able to handle those. Here's an example for `pprint': + + '(dict \"length\" 50 \"right-margin\" 70)" + :type 'list + :group 'cider + :package-version '(cider . "0.20.0")) + (defun cider--pprint-fn () "Return the value to send in the pprint-fn slot of messages." (pcase cider-pprint-fn - (`pprint "clojure.pprint/pprint") - (`fipp "cider.nrepl.middleware.pprint/fipp-pprint") - (`puget "cider.nrepl.middleware.pprint/puget-pprint") + (`pprint "cider.nrepl.pprint/pprint") + (`fipp "cider.nrepl.pprint/fipp-pprint") + (`puget "cider.nrepl.pprint/puget-pprint") + (`zprint "zprint.core/zprint-str") (_ cider-pprint-fn))) +(defvar cider--pprint-options-mapping + '((right-margin + ((fipp . width) (puget . width) (zprint . width))) + (length + ((fipp . print-length) (puget . print-length) (zprint . max-length))) + (level + ((fipp . print-level) (puget . print-level) (zprint . max-depth)))) + "A mapping of print option for the various supported print engines.") + +(defun cider--pprint-option (name printer) + "Covert the generic NAME to its PRINTER specific variant. +E.g. pprint's right-margin would become width for fipp. +The function is useful when you want to generate dynamically +print options. + +NAME can be a string or a symbol. PRINTER has to be a symbol. +The result will be a string." + (let* ((name (cider-maybe-intern name)) + (result (cdr (assoc printer (cadr (assoc name cider--pprint-options-mapping)))))) + (symbol-name (or result name)))) + (defun cider--nrepl-pprint-request-plist (right-margin &optional pprint-fn) "Plist to be appended to an eval request to make it use pprint. PPRINT-FN is the name of the Clojure function to use. RIGHT-MARGIN specifies the maximum column-width of the pretty-printed result, and is included in the request if non-nil." - (nconc `("pprint" "true" - "pprint-fn" ,(or pprint-fn (cider--pprint-fn))) - (and right-margin `("print-right-margin" ,right-margin)))) + (let* ((print-options (or cider-pprint-options (nrepl-dict)))) + (when right-margin + (setq print-options (nrepl-dict-put print-options (cider--pprint-option "right-margin" cider-pprint-fn) right-margin))) + (nconc `("printer" ,(or pprint-fn (cider--pprint-fn))) + (and (not (nrepl-dict-empty-p print-options)) `("print-options" ,print-options))))) (defun cider--nrepl-content-type-plist () "Plist to be appended to an eval request to make it use content-types." @@ -368,7 +413,7 @@ is nil, use `cider-load-file-handler'." ;;; Sync Requests (defcustom cider-filtered-namespaces-regexps - '("^cider.nrepl" "^refactor-nrepl" "^clojure.tools.nrepl" "^nrepl") + '("^cider.nrepl" "^refactor-nrepl" "^nrepl") "List of regexps used to filter out some vars/symbols/namespaces. When nil, nothing is filtered out. Otherwise, all namespaces matching any regexp from this list are dropped out of the \"ns-list\" op. Also, @@ -413,7 +458,8 @@ CONTEXT represents a completion context for compliment." "ns" ,(cider-current-ns) "symbol" ,str "context" ,context) - (cider-nrepl-send-sync-request nil 'abort-on-input)))) + (cider-nrepl-send-sync-request (cider-current-repl) + 'abort-on-input)))) (nrepl-dict-get dict "completions"))) (defun cider-sync-request:complete-flush-caches () @@ -429,7 +475,7 @@ CONTEXT represents a completion context for compliment." ,@(when symbol `("symbol" ,symbol)) ,@(when class `("class" ,class)) ,@(when member `("member" ,member))) - (cider-nrepl-send-sync-request)))) + (cider-nrepl-send-sync-request (cider-current-repl))))) (if (member "no-info" (nrepl-dict-get var-info "status")) nil var-info))) @@ -441,7 +487,8 @@ CONTEXT represents a completion context for compliment." ,@(when symbol `("symbol" ,symbol)) ,@(when class `("class" ,class)) ,@(when member `("member" ,member))) - (cider-nrepl-send-sync-request nil 'abort-on-input)))) + (cider-nrepl-send-sync-request (cider-current-repl) + 'abort-on-input)))) (if (member "no-eldoc" (nrepl-dict-get eldoc "status")) nil eldoc))) diff --git a/elpa/cider-20181110.1413/cider-common.el b/elpa/cider-20190121.1852/cider-common.el similarity index 99% rename from elpa/cider-20181110.1413/cider-common.el rename to elpa/cider-20190121.1852/cider-common.el index 48a27446..e17ac7a8 100644 --- a/elpa/cider-20181110.1413/cider-common.el +++ b/elpa/cider-20190121.1852/cider-common.el @@ -1,6 +1,6 @@ ;;; cider-common.el --- Common use functions -*- lexical-binding: t; -*- -;; Copyright © 2015-2018 Artur Malabarba +;; Copyright © 2015-2019 Artur Malabarba ;; Author: Artur Malabarba diff --git a/elpa/cider-20181110.1413/cider-compat.el b/elpa/cider-20190121.1852/cider-compat.el similarity index 96% rename from elpa/cider-20181110.1413/cider-compat.el rename to elpa/cider-20190121.1852/cider-compat.el index e6b64b28..dfd25615 100644 --- a/elpa/cider-20181110.1413/cider-compat.el +++ b/elpa/cider-20190121.1852/cider-compat.el @@ -1,7 +1,7 @@ ;;; cider-compat.el --- Functions from newer Emacs versions for compatibility -*- lexical-binding: t -*- ;; Copyright © 2012-2013 Tim King, Phil Hagelberg, Bozhidar Batsov -;; Copyright © 2013-2018 Bozhidar Batsov, Artur Malabarba and CIDER contributors +;; Copyright © 2013-2019 Bozhidar Batsov, Artur Malabarba and CIDER contributors ;; ;; This program is free software: you can redistribute it and/or modify diff --git a/elpa/cider-20181110.1413/cider-completion.el b/elpa/cider-20190121.1852/cider-completion.el similarity index 99% rename from elpa/cider-20181110.1413/cider-completion.el rename to elpa/cider-20190121.1852/cider-completion.el index c52769ee..d4be0a73 100644 --- a/elpa/cider-20181110.1413/cider-completion.el +++ b/elpa/cider-20190121.1852/cider-completion.el @@ -1,6 +1,6 @@ ;;; cider-completion.el --- Smart REPL-powered code completion -*- lexical-binding: t -*- -;; Copyright © 2013-2018 Bozhidar Batsov, Artur Malabarba and CIDER contributors +;; Copyright © 2013-2019 Bozhidar Batsov, Artur Malabarba and CIDER contributors ;; ;; Author: Bozhidar Batsov ;; Artur Malabarba diff --git a/elpa/cider-20181110.1413/cider-connection.el b/elpa/cider-20190121.1852/cider-connection.el similarity index 93% rename from elpa/cider-20181110.1413/cider-connection.el rename to elpa/cider-20190121.1852/cider-connection.el index bfaa8f76..a73ccc93 100644 --- a/elpa/cider-20181110.1413/cider-connection.el +++ b/elpa/cider-20190121.1852/cider-connection.el @@ -1,6 +1,6 @@ ;;; cider-connection.el --- Connection and session life-cycle management for CIDER -*- lexical-binding: t -*- ;; -;; Copyright © 2018 Artur Malabarba, Bozhidar Batsov, Vitalie Spinu and CIDER contributors +;; Copyright © 2019 Artur Malabarba, Bozhidar Batsov, Vitalie Spinu and CIDER contributors ;; ;; Author: Artur Malabarba ;; Bozhidar Batsov @@ -66,7 +66,7 @@ available) and the matching REPL buffer." :safe #'booleanp :package-version '(cider . "0.9.0")) -(defconst cider-required-nrepl-version "0.2.12" +(defconst cider-required-nrepl-version "0.4.4" "The minimum nREPL version that's known to work properly with CIDER.") @@ -324,7 +324,7 @@ Clojure version. When GENERICP is non-nil, don't provide specific info about this buffer (like variable `cider-repl-type')." (with-current-buffer connection-buffer (format "%s%s@%s:%s (Java %s, Clojure %s, nREPL %s)" - (if genericp "" (upcase (concat cider-repl-type " "))) + (if genericp "" (upcase (concat (symbol-name cider-repl-type) " "))) (or (cider--project-name nrepl-project-dir) "") (plist-get nrepl-endpoint :host) (plist-get nrepl-endpoint :port) @@ -554,7 +554,7 @@ removed." "" host)) (repl-type (or (plist-get params :repl-type) "unknown")) - (cljs-repl-type (or (and (equal repl-type "cljs") + (cljs-repl-type (or (and (eq repl-type 'cljs) (plist-get params :cljs-repl-type)) "")) (specs `((?h . ,host) @@ -592,7 +592,7 @@ Session name can be customized with `cider-session-name-template'." "The type of the ClojureScript runtime (Nashorn, Node etc.)") (defvar-local cider-repl-type nil - "The type of this REPL buffer, usually either \"clj\" or \"cljs\".") + "The type of this REPL buffer, usually either clj or cljs.") (defun cider-repl-type (repl-buffer) "Get REPL-BUFFER's type." @@ -601,23 +601,23 @@ Session name can be customized with `cider-session-name-template'." (defun cider-repl-type-for-buffer (&optional buffer) "Return the matching connection type (clj or cljs) for BUFFER. BUFFER defaults to the `current-buffer'. In cljc buffers return -\"multi\". This function infers connection type based on the major mode. +multi. This function infers connection type based on the major mode. For the REPL type use the function `cider-repl-type'." (with-current-buffer (or buffer (current-buffer)) (cond - ((derived-mode-p 'clojurescript-mode) "cljs") - ((derived-mode-p 'clojurec-mode) "multi") - ((derived-mode-p 'clojure-mode) "clj") + ((derived-mode-p 'clojurescript-mode) 'cljs) + ((derived-mode-p 'clojurec-mode) 'multi) + ((derived-mode-p 'clojure-mode) 'clj) (cider-repl-type)))) (defun cider-set-repl-type (&optional type) - "Set REPL TYPE to \"clj\" or \"cljs\". + "Set REPL TYPE to clj or cljs. Assume that the current buffer is a REPL." (interactive) - (let ((type (or type (completing-read - (format "Set REPL type (currently `%s') to: " - cider-repl-type) - '("clj" "cljs"))))) + (let ((type (cider-maybe-intern (or type (completing-read + (format "Set REPL type (currently `%s') to: " + cider-repl-type) + '(clj cljs)))))) (when (or (not (equal cider-repl-type type)) (null mode-name)) (setq cider-repl-type type) @@ -644,12 +644,13 @@ PARAMS is a plist as received by `cider-repl-create'." (let* ((proj-dir (plist-get params :project-dir)) (host (plist-get params :host)) (port (plist-get params :port)) - (cljsp (string-match-p "cljs" (plist-get params :repl-type))) + (cljsp (member (plist-get params :repl-type) '(cljs pending-cljs))) (scored-repls (delq nil (mapcar (lambda (b) (let ((bparams (cider--gather-connect-params nil b))) - (when (eq cljsp (string-match-p "cljs" (plist-get bparams :repl-type))) + (when (eq cljsp (member (plist-get bparams :repl-type) + '(cljs pending-cljs))) (cons (buffer-name b) (+ (if (equal proj-dir (plist-get bparams :project-dir)) 8 0) @@ -712,7 +713,7 @@ function with the repl buffer set as current." (defun cider--no-repls-user-error (type) "Throw \"No REPL\" user error customized for TYPE." (let ((type (cond - ((equal type "multi") + ((or (eq type 'multi) (eq type 'any)) "clj or cljs") ((listp type) (mapconcat #'identity type " or ")) @@ -722,42 +723,47 @@ function with the repl buffer set as current." (defun cider-current-repl (&optional type ensure) "Get the most recent REPL of TYPE from the current session. -TYPE is either \"clj\", \"cljs\", \"multi\" or \"any\". -When nil, infer the type from the current buffer. \"multi\" or \"any\" -are synonyms. If ENSURE is non-nil, throw an error if either there is +TYPE is either clj, cljs, multi or any. +When nil, infer the type from the current buffer. +If ENSURE is non-nil, throw an error if either there is no linked session or there is no REPL of TYPE within the current session." - (if (and (derived-mode-p 'cider-repl-mode) - (or (null type) - (string= cider-repl-type type))) - ;; shortcut when in REPL buffer - (current-buffer) - (let* ((type (if (equal type "any") "multi" type)) - (type (or type (cider-repl-type-for-buffer))) - (repls (cider-repls type ensure)) - (repl (if (<= (length repls) 1) - (car repls) - ;; pick the most recent one - (seq-find (lambda (b) - (member b repls)) - (buffer-list))))) - (if (and ensure (null repl)) - (cider--no-repls-user-error type) - repl)))) + (let ((type (cider-maybe-intern type))) + (if (and (derived-mode-p 'cider-repl-mode) + (or (null type) + (eq 'any type) + (eq cider-repl-type type))) + ;; shortcut when in REPL buffer + (current-buffer) + (let* ((type (or type (cider-repl-type-for-buffer))) + (repls (cider-repls type ensure)) + (repl (if (<= (length repls) 1) + (car repls) + ;; pick the most recent one + (seq-find (lambda (b) + (member b repls)) + (buffer-list))))) + (if (and ensure (null repl)) + (cider--no-repls-user-error type) + repl))))) (defun cider--match-repl-type (type buffer) "Return non-nil if TYPE matches BUFFER's REPL type." (let ((buffer-repl-type (cider-repl-type buffer))) (cond ((null buffer-repl-type) nil) - ((or (null type) (equal type "multi")) t) + ((or (null type) (eq type 'multi) (eq type 'any)) t) ((listp type) (member buffer-repl-type type)) (t (string= type buffer-repl-type))))) (defun cider-repls (&optional type ensure) "Return cider REPLs of TYPE from the current session. -If TYPE is nil or \"multi\", return all repls. If TYPE is a list of types, +If TYPE is nil or multi, return all repls. If TYPE is a list of types, return only REPLs of type contained in the list. If ENSURE is non-nil, throw an error if no linked session exists." - (let ((repls (cdr (if ensure + (let ((type (cond + ((listp type) + (mapcar #'cider-maybe-intern type)) + ((cider-maybe-intern type)))) + (repls (cdr (if ensure (sesman-ensure-session 'CIDER) (sesman-current-session 'CIDER))))) (or (seq-filter (lambda (b) @@ -782,17 +788,20 @@ session." (declare (indent 1)) (let ((cur-type (cider-repl-type-for-buffer))) (cl-case which - (:clj-strict (when (equal cur-type "cljs") + (:clj-strict (when (eq cur-type 'cljs) (user-error "Clojure-only operation requested in a ClojureScript buffer"))) - (:cljs-strict (when (equal cur-type "clj") + (:cljs-strict (when (eq cur-type 'clj) (user-error "ClojureScript-only operation requested in a Clojure buffer")))) (let* ((type (cl-case which - ((:clj :clj-strict) "clj") - ((:cljs :cljs-strict) "cljs") - (:auto (if (equal cur-type "multi") - '("clj" "cljs") + ((:clj :clj-strict) 'clj) + ((:cljs :cljs-strict) 'cljs) + (:auto (if (eq cur-type 'multi) + '(clj cljs) cur-type)))) - (repls (cider-repls type 'ensure))) + (ensure (cl-case which + (:auto nil) + (t 'ensure))) + (repls (cider-repls type ensure))) (mapcar function repls)))) ;; REPLs double as connections in CIDER, so it's useful to be able to refer to diff --git a/elpa/cider-20181110.1413/cider-debug.el b/elpa/cider-20190121.1852/cider-debug.el similarity index 97% rename from elpa/cider-20181110.1413/cider-debug.el rename to elpa/cider-20190121.1852/cider-debug.el index b8cc2f48..ba517482 100644 --- a/elpa/cider-20181110.1413/cider-debug.el +++ b/elpa/cider-20190121.1852/cider-debug.el @@ -1,6 +1,6 @@ ;;; cider-debug.el --- CIDER interaction with the cider.debug nREPL middleware -*- lexical-binding: t; -*- -;; Copyright © 2015-2018 Bozhidar Batsov, Artur Malabarba and CIDER contributors +;; Copyright © 2015-2019 Bozhidar Batsov, Artur Malabarba and CIDER contributors ;; Author: Artur Malabarba @@ -101,21 +101,15 @@ configure `cider-debug-prompt' instead." :group 'cider-debug :package-version '(cider . "0.9.1")) -(defcustom cider-debug-print-level 10 - "The print level for values displayed by the debugger. -This variable must be set before starting the repl connection." - :type '(choice (const :tag "No limit" nil) - (integer :tag "Max depth" 10)) - :group 'cider-debug - :package-version '(cider . "0.10.0")) +(make-obsolete 'cider-debug-print-length 'cider-debug-print-options "0.20") +(make-obsolete 'cider-debug-print-level 'cider-debug-print-options "0.20") -(defcustom cider-debug-print-length 10 - "The print length for values displayed by the debugger. +(defcustom cider-debug-print-options '(dict "length" 10 "level" 10) + "The print options for values displayed by the debugger. This variable must be set before starting the repl connection." - :type '(choice (const :tag "No limit" nil) - (integer :tag "Max depth" 10)) - :group 'cider-debug - :package-version '(cider . "0.10.0")) + :type 'listp + :group 'cider-stacktrace + :package-version '(cider . "0.20.0")) ;;; Implementation @@ -163,10 +157,8 @@ This variable must be set before starting the repl connection." "Initialize a connection with the cider.debug middleware." (cider-nrepl-send-request (nconc '("op" "init-debugger") - (when cider-debug-print-level - `("print-level" ,cider-debug-print-level)) - (when cider-debug-print-length - `("print-length" ,cider-debug-print-length))) + (when cider-debug-print-options + `("print-options" ,cider-debug-print-options))) #'cider--debug-response-handler)) diff --git a/elpa/cider-20181110.1413/cider-doc.el b/elpa/cider-20190121.1852/cider-doc.el similarity index 99% rename from elpa/cider-20181110.1413/cider-doc.el rename to elpa/cider-20190121.1852/cider-doc.el index 5cca0505..df3e97d1 100644 --- a/elpa/cider-20181110.1413/cider-doc.el +++ b/elpa/cider-20190121.1852/cider-doc.el @@ -1,6 +1,6 @@ ;;; cider-doc.el --- CIDER documentation functionality -*- lexical-binding: t -*- -;; Copyright © 2014-2018 Bozhidar Batsov, Jeff Valk and CIDER contributors +;; Copyright © 2014-2019 Bozhidar Batsov, Jeff Valk and CIDER contributors ;; Author: Jeff Valk diff --git a/elpa/cider-20181110.1413/cider-eldoc.el b/elpa/cider-20190121.1852/cider-eldoc.el similarity index 99% rename from elpa/cider-20181110.1413/cider-eldoc.el rename to elpa/cider-20190121.1852/cider-eldoc.el index b055824d..c8c0e969 100644 --- a/elpa/cider-20181110.1413/cider-eldoc.el +++ b/elpa/cider-20190121.1852/cider-eldoc.el @@ -1,7 +1,7 @@ ;;; cider-eldoc.el --- eldoc support for Clojure -*- lexical-binding: t -*- ;; Copyright © 2012-2013 Tim King, Phil Hagelberg, Bozhidar Batsov -;; Copyright © 2013-2018 Bozhidar Batsov, Artur Malabarba and CIDER contributors +;; Copyright © 2013-2019 Bozhidar Batsov, Artur Malabarba and CIDER contributors ;; ;; Author: Tim King ;; Phil Hagelberg diff --git a/elpa/cider-20181110.1413/cider-eval.el b/elpa/cider-20190121.1852/cider-eval.el similarity index 96% rename from elpa/cider-20181110.1413/cider-eval.el rename to elpa/cider-20190121.1852/cider-eval.el index 643fc93a..58b2a572 100644 --- a/elpa/cider-20181110.1413/cider-eval.el +++ b/elpa/cider-20190121.1852/cider-eval.el @@ -1,7 +1,7 @@ ;;; cider-eval.el --- Interactive evaluation (compilation) functionality -*- lexical-binding: t -*- ;; Copyright © 2012-2013 Tim King, Phil Hagelberg, Bozhidar Batsov -;; Copyright © 2013-2018 Bozhidar Batsov, Artur Malabarba and CIDER contributors +;; Copyright © 2013-2019 Bozhidar Batsov, Artur Malabarba and CIDER contributors ;; ;; Author: Tim King ;; Phil Hagelberg @@ -168,7 +168,8 @@ When invoked with a prefix ARG the command doesn't prompt for confirmation." (defun cider--quit-error-window () "Buries the `cider-error-buffer' and quits its containing window." (when-let* ((error-win (get-buffer-window cider-error-buffer))) - (quit-window nil error-win))) + (save-excursion + (quit-window nil error-win)))) ;;; Dealing with compilation (evaluation) errors and warnings @@ -278,10 +279,8 @@ into a new error buffer." (nconc '("op" "stacktrace") (when (cider--pprint-fn) `("pprint-fn" ,(cider--pprint-fn))) - (when cider-stacktrace-print-length - `("print-length" ,cider-stacktrace-print-length)) - (when cider-stacktrace-print-level - `("print-level" ,cider-stacktrace-print-level))) + (when cider-stacktrace-print-options + `("print-options" ,cider-stacktrace-print-options))) (lambda (response) ;; While the return value of `cider--handle-stacktrace-response' is not ;; meaningful for the last message, we do not need the value of `causes' @@ -559,21 +558,20 @@ COMMENT-POSTFIX is the text to output after the last line." #'multiline-comment-handler '()))) -(defun cider-popup-eval-out-handler (&optional buffer) - "Make a handler for evaluating and printing stdout/stderr in popup BUFFER. -This is used by pretty-printing commands and intentionally discards their results." - (cl-flet ((popup-output-handler (buffer str) - (cider-emit-into-popup-buffer buffer - (ansi-color-apply str) - nil - t))) - (nrepl-make-response-handler (or buffer (current-buffer)) - '() - ;; stdout handler - #'popup-output-handler - ;; stderr handler - #'popup-output-handler - '()))) +(defun cider-popup-eval-handler (&optional buffer) + "Make a handler for printing evaluation results in popup BUFFER. +This is used by pretty-printing commands." + (nrepl-make-response-handler (or buffer (current-buffer)) + (lambda (buffer value) + (cider-emit-into-popup-buffer buffer + (ansi-color-apply value) + nil + t)) + (lambda (_buffer out) + (cider-emit-interactive-eval-output out)) + (lambda (_buffer err) + (cider-emit-interactive-eval-err-output err)) + '())) ;;; Interactive valuation commands @@ -808,18 +806,21 @@ If invoked with a PREFIX argument, switch to the REPL buffer." (when prefix (cider-switch-to-repl-buffer))) -(defun cider-eval-print-last-sexp () +(defun cider-eval-print-last-sexp (&optional pretty-print) "Evaluate the expression preceding point. -Print its value into the current buffer." - (interactive) +Print its value into the current buffer. +With an optional PRETTY-PRINT prefix it pretty-prints the result." + (interactive "P") (cider-interactive-eval nil (cider-eval-print-handler) - (cider-last-sexp 'bounds))) + (cider-last-sexp 'bounds) + (when pretty-print + (cider--nrepl-pprint-request-plist (cider--pretty-print-width))))) (defun cider--pprint-eval-form (form) "Pretty print FORM in popup buffer." (let* ((result-buffer (cider-popup-buffer cider-result-buffer nil 'clojure-mode 'ancillary)) - (handler (cider-popup-eval-out-handler result-buffer))) + (handler (cider-popup-eval-handler result-buffer))) (cider-interactive-eval (when (stringp form) form) handler (when (consp form) form) @@ -1090,7 +1091,7 @@ is done by `cider-load-buffer'." Useful when the running nREPL on remote host." (interactive "DLoad files beneath directory: ") (mapcar #'cider-load-file - (directory-files-recursively directory ".clj$"))) + (directory-files-recursively directory "\\.clj[cs]?$"))) (defalias 'cider-eval-file 'cider-load-file "A convenience alias as some people are confused by the load-* names.") diff --git a/elpa/cider-20181110.1413/cider-find.el b/elpa/cider-20190121.1852/cider-find.el similarity index 99% rename from elpa/cider-20181110.1413/cider-find.el rename to elpa/cider-20190121.1852/cider-find.el index dc49ddac..e1a90cdd 100644 --- a/elpa/cider-20181110.1413/cider-find.el +++ b/elpa/cider-20190121.1852/cider-find.el @@ -1,6 +1,6 @@ ;;; cider-find.el --- Functionality for finding things -*- lexical-binding: t -*- -;; Copyright © 2013-2018 Bozhidar Batsov, Artur Malabarba and CIDER contributors +;; Copyright © 2013-2019 Bozhidar Batsov, Artur Malabarba and CIDER contributors ;; ;; Author: Bozhidar Batsov ;; Artur Malabarba diff --git a/elpa/cider-20181110.1413/cider-format.el b/elpa/cider-20190121.1852/cider-format.el similarity index 98% rename from elpa/cider-20181110.1413/cider-format.el rename to elpa/cider-20190121.1852/cider-format.el index 8256ea8a..2cf9d09d 100644 --- a/elpa/cider-20181110.1413/cider-format.el +++ b/elpa/cider-20190121.1852/cider-format.el @@ -1,6 +1,6 @@ ;;; cider-format.el --- Code and EDN formatting functionality -*- lexical-binding: t -*- -;; Copyright © 2013-2018 Bozhidar Batsov, Artur Malabarba and CIDER contributors +;; Copyright © 2013-2019 Bozhidar Batsov, Artur Malabarba and CIDER contributors ;; ;; Author: Bozhidar Batsov ;; Artur Malabarba diff --git a/elpa/cider-20181110.1413/cider-grimoire.el b/elpa/cider-20190121.1852/cider-grimoire.el similarity index 98% rename from elpa/cider-20181110.1413/cider-grimoire.el rename to elpa/cider-20190121.1852/cider-grimoire.el index c07614ba..93424883 100644 --- a/elpa/cider-20181110.1413/cider-grimoire.el +++ b/elpa/cider-20190121.1852/cider-grimoire.el @@ -1,6 +1,6 @@ ;;; cider-grimoire.el --- Grimoire integration -*- lexical-binding: t -*- -;; Copyright © 2014-2018 Bozhidar Batsov and CIDER contributors +;; Copyright © 2014-2019 Bozhidar Batsov and CIDER contributors ;; ;; Author: Bozhidar Batsov diff --git a/elpa/cider-20181110.1413/cider-inspector.el b/elpa/cider-20190121.1852/cider-inspector.el similarity index 98% rename from elpa/cider-20181110.1413/cider-inspector.el rename to elpa/cider-20190121.1852/cider-inspector.el index 9823530d..c8c71f10 100644 --- a/elpa/cider-20181110.1413/cider-inspector.el +++ b/elpa/cider-20190121.1852/cider-inspector.el @@ -1,7 +1,7 @@ ;;; cider-inspector.el --- Object inspector -*- lexical-binding: t -*- -;; Copyright © 2013-2018 Vital Reactor, LLC -;; Copyright © 2014-2018 Bozhidar Batsov and CIDER contributors +;; Copyright © 2013-2019 Vital Reactor, LLC +;; Copyright © 2014-2019 Bozhidar Batsov and CIDER contributors ;; Author: Ian Eslick ;; Bozhidar Batsov @@ -39,7 +39,7 @@ ;;; Customization (defgroup cider-inspector nil - "Presentation and behaviour of the cider value inspector." + "Presentation and behaviour of the CIDER value inspector." :prefix "cider-inspector-" :group 'cider :package-version '(cider . "0.10.0")) @@ -52,7 +52,7 @@ The page size can be also changed interactively within the inspector." :package-version '(cider . "0.10.0")) (defcustom cider-inspector-fill-frame nil - "Controls whether the cider inspector window fills its frame." + "Controls whether the CIDER inspector window fills its frame." :type 'boolean :group 'cider-inspector :package-version '(cider . "0.15.0")) diff --git a/elpa/cider-20181110.1413/cider-macroexpansion.el b/elpa/cider-20190121.1852/cider-macroexpansion.el similarity index 99% rename from elpa/cider-20181110.1413/cider-macroexpansion.el rename to elpa/cider-20190121.1852/cider-macroexpansion.el index 8123932a..7efe1c08 100644 --- a/elpa/cider-20181110.1413/cider-macroexpansion.el +++ b/elpa/cider-20190121.1852/cider-macroexpansion.el @@ -1,7 +1,7 @@ ;;; cider-macroexpansion.el --- Macro expansion support -*- lexical-binding: t -*- ;; Copyright © 2012-2013 Tim King, Phil Hagelberg, Bozhidar Batsov -;; Copyright © 2013-2018 Bozhidar Batsov, Artur Malabarba and CIDER contributors +;; Copyright © 2013-2019 Bozhidar Batsov, Artur Malabarba and CIDER contributors ;; ;; Author: Tim King ;; Phil Hagelberg diff --git a/elpa/cider-20181110.1413/cider-mode.el b/elpa/cider-20190121.1852/cider-mode.el similarity index 99% rename from elpa/cider-20181110.1413/cider-mode.el rename to elpa/cider-20190121.1852/cider-mode.el index f9b2189e..8c5c4dd9 100644 --- a/elpa/cider-20181110.1413/cider-mode.el +++ b/elpa/cider-20190121.1852/cider-mode.el @@ -1,7 +1,7 @@ ;;; cider-mode.el --- Minor mode for REPL interactions -*- lexical-binding: t -*- ;; Copyright © 2012-2013 Tim King, Phil Hagelberg, Bozhidar Batsov -;; Copyright © 2013-2018 Bozhidar Batsov, Artur Malabarba and CIDER contributors +;; Copyright © 2013-2019 Bozhidar Batsov, Artur Malabarba and CIDER contributors ;; ;; Author: Tim King ;; Phil Hagelberg @@ -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) "") @@ -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 diff --git a/elpa/cider-20181110.1413/cider-ns.el b/elpa/cider-20190121.1852/cider-ns.el similarity index 98% rename from elpa/cider-20181110.1413/cider-ns.el rename to elpa/cider-20190121.1852/cider-ns.el index bcb843ee..227e803c 100644 --- a/elpa/cider-20181110.1413/cider-ns.el +++ b/elpa/cider-20190121.1852/cider-ns.el @@ -1,6 +1,6 @@ ;;; cider-ns.el --- Namespace manipulation functionality -*- lexical-binding: t -*- -;; Copyright © 2013-2018 Bozhidar Batsov, Artur Malabarba and CIDER contributors +;; Copyright © 2013-2019 Bozhidar Batsov, Artur Malabarba and CIDER contributors ;; ;; Author: Bozhidar Batsov ;; Artur Malabarba @@ -245,11 +245,11 @@ refresh functions (defined in `cider-ns-refresh-before-fn' and (when clear? (cider-nrepl-send-sync-request '("op" "refresh-clear") conn)) (cider-nrepl-send-request - (nconc `("op" ,(if refresh-all? "refresh-all" "refresh") - "print-length" ,cider-stacktrace-print-length - "print-level" ,cider-stacktrace-print-level) + (nconc `("op" ,(if refresh-all? "refresh-all" "refresh")) (when (cider--pprint-fn) `("pprint-fn" ,(cider--pprint-fn))) + (when cider-stacktrace-print-options + `("print-options" ,cider-stacktrace-print-options)) (when (and (not inhibit-refresh-fns) cider-ns-refresh-before-fn) `("before" ,cider-ns-refresh-before-fn)) (when (and (not inhibit-refresh-fns) cider-ns-refresh-after-fn) diff --git a/elpa/cider-20181110.1413/cider-overlays.el b/elpa/cider-20190121.1852/cider-overlays.el similarity index 99% rename from elpa/cider-20181110.1413/cider-overlays.el rename to elpa/cider-20190121.1852/cider-overlays.el index 1a92b35f..5be7f00f 100644 --- a/elpa/cider-20181110.1413/cider-overlays.el +++ b/elpa/cider-20190121.1852/cider-overlays.el @@ -1,6 +1,6 @@ ;;; cider-overlays.el --- Managing CIDER overlays -*- lexical-binding: t; -*- -;; Copyright © 2015-2018 Bozhidar Batsov, Artur Malabarba and CIDER contributors +;; Copyright © 2015-2019 Bozhidar Batsov, Artur Malabarba and CIDER contributors ;; Author: Artur Malabarba diff --git a/elpa/cider-20181110.1413/cider-pkg.el b/elpa/cider-20190121.1852/cider-pkg.el similarity index 91% rename from elpa/cider-20181110.1413/cider-pkg.el rename to elpa/cider-20190121.1852/cider-pkg.el index 0e91f236..c4558ff3 100644 --- a/elpa/cider-20181110.1413/cider-pkg.el +++ b/elpa/cider-20190121.1852/cider-pkg.el @@ -1,4 +1,4 @@ -(define-package "cider" "20181110.1413" "Clojure Interactive Development Environment that Rocks" +(define-package "cider" "20190121.1852" "Clojure Interactive Development Environment that Rocks" '((emacs "25") (clojure-mode "5.9") (pkg-info "0.4") diff --git a/elpa/cider-20181110.1413/cider-popup.el b/elpa/cider-20190121.1852/cider-popup.el similarity index 98% rename from elpa/cider-20181110.1413/cider-popup.el rename to elpa/cider-20190121.1852/cider-popup.el index 274a0666..4f8fae4d 100644 --- a/elpa/cider-20181110.1413/cider-popup.el +++ b/elpa/cider-20190121.1852/cider-popup.el @@ -1,6 +1,6 @@ ;;; cider-popup.el --- Creating and quitting popup buffers -*- lexical-binding: t; -*- -;; Copyright © 2015-2018 Bozhidar Batsov, Artur Malabarba and CIDER contributors +;; Copyright © 2015-2019 Bozhidar Batsov, Artur Malabarba and CIDER contributors ;; Author: Artur Malabarba diff --git a/elpa/cider-20181110.1413/cider-profile.el b/elpa/cider-20190121.1852/cider-profile.el similarity index 99% rename from elpa/cider-20181110.1413/cider-profile.el rename to elpa/cider-20190121.1852/cider-profile.el index 79577910..d4e9b408 100644 --- a/elpa/cider-20181110.1413/cider-profile.el +++ b/elpa/cider-20190121.1852/cider-profile.el @@ -1,6 +1,6 @@ ;;; cider-profile.el --- CIDER support for profiling -*- lexical-binding: t; -*- -;; Copyright © 2014-2018 Edwin Watkeys and CIDER contributors +;; Copyright © 2014-2019 Edwin Watkeys and CIDER contributors ;; Author: Edwin Watkeys ;; Juan E. Maya diff --git a/elpa/cider-20181110.1413/cider-repl-history.el b/elpa/cider-20190121.1852/cider-repl-history.el similarity index 100% rename from elpa/cider-20181110.1413/cider-repl-history.el rename to elpa/cider-20190121.1852/cider-repl-history.el diff --git a/elpa/cider-20181110.1413/cider-repl.el b/elpa/cider-20190121.1852/cider-repl.el similarity index 96% rename from elpa/cider-20181110.1413/cider-repl.el rename to elpa/cider-20190121.1852/cider-repl.el index 261b5bbb..2d75d211 100644 --- a/elpa/cider-20181110.1413/cider-repl.el +++ b/elpa/cider-20190121.1852/cider-repl.el @@ -1,7 +1,7 @@ ;;; cider-repl.el --- CIDER REPL mode interactions -*- lexical-binding: t -*- ;; Copyright © 2012-2013 Tim King, Phil Hagelberg, Bozhidar Batsov -;; Copyright © 2013-2018 Bozhidar Batsov, Artur Malabarba and CIDER contributors +;; Copyright © 2013-2019 Bozhidar Batsov, Artur Malabarba and CIDER contributors ;; ;; Author: Tim King ;; Phil Hagelberg @@ -114,8 +114,9 @@ If this is set to nil, no re-centering takes place." :group 'cider-repl :package-version '(cider . "0.11.0")) -(defcustom cider-repl-use-pretty-printing nil +(defcustom cider-repl-use-pretty-printing t "Control whether results in the REPL are pretty-printed or not. +The REPL will use the printer specified in `cider-pprint-fn'. The `cider-toggle-pretty-printing' command can be used to interactively change the setting's value." :type 'boolean @@ -315,7 +316,15 @@ client process connection. Unless NO-BANNER is non-nil, insert a banner." (when cider-repl-display-in-current-window (add-to-list 'same-window-buffer-names (buffer-name buffer))) (pcase cider-repl-pop-to-buffer-on-connect - (`display-only (display-buffer buffer)) + (`display-only + (let ((orig-buffer (current-buffer))) + (display-buffer buffer) + ;; User popup-rules (specifically `:select nil') can cause the call to + ;; `display-buffer' to reset the current Emacs buffer to the clj/cljs + ;; buffer that the user ran `jack-in' from - we need the current-buffer + ;; to be the repl to initialize, so reset it back here to be resilient + ;; against user config + (set-buffer orig-buffer))) ((pred identity) (pop-to-buffer buffer))) (cider-repl-set-initial-ns buffer) (cider-repl-require-repl-utils) @@ -677,8 +686,7 @@ If BOL is non-nil insert at the beginning of line. Run (defun cider-repl--emit-interactive-output (string face) "Emit STRING as interactive output using FACE." (with-current-buffer (cider-current-repl) - (let ((pos (cider-repl--end-of-line-before-input-start)) - (string (replace-regexp-in-string "\n\\'" "" string))) + (let ((pos (cider-repl--end-of-output))) (cider-repl--emit-output-at-pos (current-buffer) string face pos t)))) (defun cider-repl-emit-interactive-stdout (string) @@ -879,9 +887,6 @@ nREPL ops, it may be convenient to prevent inserting a prompt.") (set-window-point win cider-repl-input-start-mark)) (cider-repl--show-maximum-output))))) nrepl-err-handler - (lambda (buffer pprint-out) - (cider-repl-emit-result buffer pprint-out (not after-first-result-chunk)) - (setq after-first-result-chunk t)) (lambda (buffer value content-type) (if-let* ((content-attrs (cadr content-type)) (content-type* (car content-type)) @@ -1055,10 +1060,15 @@ See also the related commands `cider-repl-clear-output' and (recenter t)) (run-hooks 'cider-repl-clear-buffer-hook)) -(defun cider-repl--end-of-line-before-input-start () - "Return the position of the end of the line preceding the beginning of input." - (1- (previous-single-property-change cider-repl-input-start-mark 'field nil - (1+ (point-min))))) +(defun cider-repl--end-of-output () + "Return the position at the end of the previous REPL output." + (if (eq (get-text-property (1- cider-repl-input-start-mark) 'field) + 'cider-repl-prompt) + ;; if after prompt, return eol before prompt + (previous-single-property-change cider-repl-input-start-mark + 'field nil (point-min)) + ;; else, input mark because there is no prompt (yet) + cider-repl-input-start-mark)) (defun cider-repl-clear-output (&optional clear-repl) "Delete the output inserted since the last input. @@ -1071,7 +1081,7 @@ With a prefix argument CLEAR-REPL it will clear the entire REPL buffer instead." (ignore-errors (forward-sexp)) (forward-line) (point))) - (end (cider-repl--end-of-line-before-input-start))) + (end (cider-repl--end-of-output))) (when (< start end) (let ((inhibit-read-only t)) (cider-repl--clear-region start end) @@ -1154,7 +1164,8 @@ command will prompt for the name of the namespace to switch to." (print-stacktrace "\\[\\([^][$ \t]+\\).* +\\([^ \t]+\\) +\\([0-9]+\\)\\]" 0 1 2 3) (timbre-log "\\(TRACE\\|INFO\\|DEBUG\\|WARN\\|ERROR\\) +\\(\\[\\([^:]+\\):\\([0-9]+\\)\\]\\)" 2 3 nil 4) (cljs-message "at line \\([0-9]+\\) +\\(.*\\)$" 0 nil 2 1) - (reflection "Reflection warning, +\\(\\([^\n:]+\\):\\([0-9]+\\):[0-9]+\\)" 1 nil 2 3)) + (warning "warning,? +\\(\\([^\n:]+\\):\\([0-9]+\\):[0-9]+\\)" 1 nil 2 3) + (compilation ".*compiling:(\\([^\n:)]+\\):\\([0-9]+\\):[0-9]+)" 0 nil 1 2)) "Alist holding regular expressions for inline location references. Each element in the alist has the form (NAME REGEXP HIGHLIGHT VAR FILE LINE), where NAME is the identifier of the regexp, REGEXP - regexp matching @@ -1166,27 +1177,24 @@ case." :group 'cider-repl :package-version '(cider. "0.16.0")) -(defun cider--locref-at-point-1 (reg-list &optional pos) - "Workhorse for getting locref at POS. +(defun cider--locref-at-point-1 (reg-list) + "Workhorse for getting locref at point. REG-LIST is an entry in `cider-locref-regexp-alist'." - (save-excursion - (let ((pos (or pos (point)))) - (goto-char pos) - (beginning-of-line) - (when (re-search-forward (nth 1 reg-list) (point-at-eol) t) - (let ((ix-highlight (or (nth 2 reg-list) 0)) - (ix-var (nth 3 reg-list)) - (ix-file (nth 4 reg-list)) - (ix-line (nth 5 reg-list))) - (list - :type (car reg-list) - :highlight (cons (match-beginning ix-highlight) (match-end ix-highlight)) - :var (and ix-var - (replace-regexp-in-string "_" "-" - (match-string-no-properties ix-var) - nil t)) - :file (and ix-file (match-string-no-properties ix-file)) - :line (and ix-line (string-to-number (match-string-no-properties ix-line))))))))) + (beginning-of-line) + (when (re-search-forward (nth 1 reg-list) (point-at-eol) t) + (let ((ix-highlight (or (nth 2 reg-list) 0)) + (ix-var (nth 3 reg-list)) + (ix-file (nth 4 reg-list)) + (ix-line (nth 5 reg-list))) + (list + :type (car reg-list) + :highlight (cons (match-beginning ix-highlight) (match-end ix-highlight)) + :var (and ix-var + (replace-regexp-in-string "_" "-" + (match-string-no-properties ix-var) + nil t)) + :file (and ix-file (match-string-no-properties ix-file)) + :line (and ix-line (string-to-number (match-string-no-properties ix-line))))))) (defun cider-locref-at-point (&optional pos) "Return a plist of components of the location reference at POS. @@ -1195,8 +1203,13 @@ found. Returned keys are :type, :highlight, :var, :file, :line, where :highlight is a cons of positions, :var and :file are strings or nil, :line is a number. See `cider-locref-regexp-alist' for how to specify regexes for locref look up." - (seq-some (lambda (rl) (cider--locref-at-point-1 rl pos)) - cider-locref-regexp-alist)) + (save-excursion + (goto-char (or pos (point))) + ;; Regexp lookup on long lines can result in significant hangs #2532. We + ;; assume that lines longer than 300 don't contain source references. + (when (< (- (point-at-eol) (point-at-bol)) 300) + (seq-some (lambda (rl) (cider--locref-at-point-1 rl)) + cider-locref-regexp-alist)))) (defun cider-jump-to-locref-at-point (&optional pos) "Identify location reference at POS and navigate to it. diff --git a/elpa/cider-20181110.1413/cider-resolve.el b/elpa/cider-20190121.1852/cider-resolve.el similarity index 97% rename from elpa/cider-20181110.1413/cider-resolve.el rename to elpa/cider-20190121.1852/cider-resolve.el index 3c2dc6fd..7963c897 100644 --- a/elpa/cider-20181110.1413/cider-resolve.el +++ b/elpa/cider-20190121.1852/cider-resolve.el @@ -1,6 +1,6 @@ ;;; cider-resolve.el --- Resolve clojure symbols according to current nREPL connection -;; Copyright © 2015-2018 Bozhidar Batsov, Artur Malabarba and CIDER contributors +;; Copyright © 2015-2019 Bozhidar Batsov, Artur Malabarba and CIDER contributors ;; Author: Artur Malabarba @@ -107,7 +107,7 @@ This will be clojure.core or cljs.core depending on the return value of the function `cider-repl-type'." (when-let* ((repl (cider-current-repl))) (with-current-buffer repl - (cider-resolve--get-in (if (equal cider-repl-type "cljs") + (cider-resolve--get-in (if (eq cider-repl-type 'cljs) "cljs.core" "clojure.core"))))) diff --git a/elpa/cider-20181110.1413/cider-scratch.el b/elpa/cider-20190121.1852/cider-scratch.el similarity index 94% rename from elpa/cider-20181110.1413/cider-scratch.el rename to elpa/cider-20190121.1852/cider-scratch.el index f1c3e93d..5cfa1856 100644 --- a/elpa/cider-20181110.1413/cider-scratch.el +++ b/elpa/cider-20190121.1852/cider-scratch.el @@ -1,6 +1,6 @@ ;;; cider-scratch.el --- *scratch* buffer for Clojure -*- lexical-binding: t -*- -;; Copyright © 2014-2018 Bozhidar Batsov and CIDER contributors +;; Copyright © 2014-2019 Bozhidar Batsov and CIDER contributors ;; ;; Author: Tim King ;; Phil Hagelberg @@ -36,7 +36,8 @@ (defcustom cider-scratch-initial-message ";; This buffer is for Clojure experiments and evaluation.\n -;; Press C-j to evaluate the last expression.\n\n" +;; Press C-j to evaluate the last expression.\n +;; You can also press C-u C-j to evaluate the expression and pretty-print its result.\n\n" "The initial message displayed in new scratch buffers." :type 'string :group 'cider diff --git a/elpa/cider-20181110.1413/cider-selector.el b/elpa/cider-20190121.1852/cider-selector.el similarity index 98% rename from elpa/cider-20181110.1413/cider-selector.el rename to elpa/cider-20190121.1852/cider-selector.el index a21032db..61d7aed7 100644 --- a/elpa/cider-20181110.1413/cider-selector.el +++ b/elpa/cider-20190121.1852/cider-selector.el @@ -1,7 +1,7 @@ ;;; cider-selector.el --- Buffer selection command inspired by SLIME's selector -*- lexical-binding: t -*- ;; Copyright © 2012-2013 Tim King, Phil Hagelberg, Bozhidar Batsov -;; Copyright © 2013-2018 Bozhidar Batsov, Artur Malabarba and CIDER contributors +;; Copyright © 2013-2019 Bozhidar Batsov, Artur Malabarba and CIDER contributors ;; ;; Author: Tim King ;; Phil Hagelberg diff --git a/elpa/cider-20181110.1413/cider-stacktrace.el b/elpa/cider-20190121.1852/cider-stacktrace.el similarity index 98% rename from elpa/cider-20181110.1413/cider-stacktrace.el rename to elpa/cider-20190121.1852/cider-stacktrace.el index 321d4bbd..66a2820f 100644 --- a/elpa/cider-20181110.1413/cider-stacktrace.el +++ b/elpa/cider-20190121.1852/cider-stacktrace.el @@ -1,6 +1,6 @@ ;;; cider-stacktrace.el --- Stacktrace navigator -*- lexical-binding: t -*- -;; Copyright © 2014-2018 Jeff Valk, Bozhidar Batsov and CIDER contributors +;; Copyright © 2014-2019 Jeff Valk, Bozhidar Batsov and CIDER contributors ;; Author: Jeff Valk @@ -58,31 +58,22 @@ If nil, messages will not be wrapped. If truthy but non-numeric, :group 'cider-stacktrace :package-version '(cider . "0.6.0")) -(defcustom cider-stacktrace-print-length 50 +(make-obsolete 'cider-stacktrace-print-length 'cider-stacktrace-print-options "0.20") +(make-obsolete 'cider-stacktrace-print-level 'cider-stacktrace-print-options "0.20") + +(defcustom cider-stacktrace-print-options '(dict "length" 50 "level" 50) "Set the maximum length of sequences in displayed cause data. This sets the value of Clojure's `*print-length*` when pretty printing the `ex-data` map for exception causes in the stacktrace that are instances of `IExceptionInfo`. -Be advised that setting this to `nil` will cause the attempted printing of -infinite data structures." - :type '(choice integer (const nil)) - :group 'cider-stacktrace - :package-version '(cider . "0.9.0")) - -(defcustom cider-stacktrace-print-level 50 - "Set the maximum level of nesting in displayed cause data. - -This sets the value of Clojure's `*print-level*` when pretty printing the -`ex-data` map for exception causes in the stacktrace that are instances of -`IExceptionInfo`. - -Be advised that setting this to `nil` will cause the attempted printing of -cyclical data structures." - :type '(choice integer (const nil)) +Be advised that setting \"print-length\" to `nil` will cause the attempted +printing of infinite data structures and that setting \"print-level\" to +nil cause the attempted printing of cyclical data structures." + :type 'listp :group 'cider-stacktrace - :package-version '(cider . "0.8.0")) + :package-version '(cider . "0.20.0")) (defvar cider-stacktrace-detail-max 2 "The maximum detail level for causes.") diff --git a/elpa/cider-20181110.1413/cider-test.el b/elpa/cider-20190121.1852/cider-test.el similarity index 99% rename from elpa/cider-20181110.1413/cider-test.el rename to elpa/cider-20190121.1852/cider-test.el index a7b3e984..8549ac3a 100644 --- a/elpa/cider-20181110.1413/cider-test.el +++ b/elpa/cider-20190121.1852/cider-test.el @@ -1,6 +1,6 @@ ;;; cider-test.el --- Test result viewer -*- lexical-binding: t -*- -;; Copyright © 2014-2018 Jeff Valk, Bozhidar Batsov and CIDER contributors +;; Copyright © 2014-2019 Jeff Valk, Bozhidar Batsov and CIDER contributors ;; Author: Jeff Valk @@ -284,10 +284,8 @@ prompt and whether to use a new window. Similar to `cider-find-var'." "index" ,index) (when (cider--pprint-fn) `("pprint-fn" ,(cider--pprint-fn))) - (when cider-stacktrace-print-length - `("print-length" ,cider-stacktrace-print-length)) - (when cider-stacktrace-print-level - `("print-level" ,cider-stacktrace-print-level))) + (when cider-stacktrace-print-options + `("print-options" ,cider-stacktrace-print-options))) (lambda (response) (nrepl-dbind-response response (class status) (cond (class (setq causes (cons response causes))) diff --git a/elpa/cider-20181110.1413/cider-tracing.el b/elpa/cider-20190121.1852/cider-tracing.el similarity index 98% rename from elpa/cider-20181110.1413/cider-tracing.el rename to elpa/cider-20190121.1852/cider-tracing.el index c00e7b7f..c9821a26 100644 --- a/elpa/cider-20181110.1413/cider-tracing.el +++ b/elpa/cider-20190121.1852/cider-tracing.el @@ -1,6 +1,6 @@ ;;; cider-tracing.el --- Executing tracing functionality -*- lexical-binding: t -*- -;; Copyright © 2013-2018 Bozhidar Batsov, Artur Malabarba and CIDER contributors +;; Copyright © 2013-2019 Bozhidar Batsov, Artur Malabarba and CIDER contributors ;; ;; Author: Bozhidar Batsov ;; Artur Malabarba diff --git a/elpa/cider-20181110.1413/cider-util.el b/elpa/cider-20190121.1852/cider-util.el similarity index 99% rename from elpa/cider-20181110.1413/cider-util.el rename to elpa/cider-20190121.1852/cider-util.el index f09d580f..c5a09634 100644 --- a/elpa/cider-20181110.1413/cider-util.el +++ b/elpa/cider-20190121.1852/cider-util.el @@ -1,7 +1,7 @@ ;; cider-util.el --- Common utility functions that don't belong anywhere else -*- lexical-binding: t -*- ;; Copyright © 2012-2013 Tim King, Phil Hagelberg, Bozhidar Batsov -;; Copyright © 2013-2018 Bozhidar Batsov, Artur Malabarba and CIDER contributors +;; Copyright © 2013-2019 Bozhidar Batsov, Artur Malabarba and CIDER contributors ;; ;; Author: Tim King ;; Phil Hagelberg @@ -655,6 +655,8 @@ through a stack of help buffers. Variables `help-back-label' and "The only thing worse than a rebel without a cause is a REPL without a clause." "In the absence of parentheses, chaos prevails." "One REPL to rule them all, One REPL to find them, One REPL to bring them all, and in parentheses bind them!" + "A blank REPL promotes creativity." + "A blank REPL is infinitely better than a blank cheque." ,(format "%s, I've a feeling we're not in Kansas anymore." (cider-user-first-name)) ,(format "%s, this could be the start of a beautiful program." diff --git a/elpa/cider-20181110.1413/cider.el b/elpa/cider-20190121.1852/cider.el similarity index 97% rename from elpa/cider-20181110.1413/cider.el rename to elpa/cider-20190121.1852/cider.el index 0f920e7a..3727b395 100644 --- a/elpa/cider-20181110.1413/cider.el +++ b/elpa/cider-20190121.1852/cider.el @@ -1,7 +1,7 @@ ;;; cider.el --- Clojure Interactive Development Environment that Rocks -*- lexical-binding: t -*- ;; Copyright © 2012-2013 Tim King, Phil Hagelberg, Bozhidar Batsov -;; Copyright © 2013-2018 Bozhidar Batsov, Artur Malabarba and CIDER contributors +;; Copyright © 2013-2019 Bozhidar Batsov, Artur Malabarba and CIDER contributors ;; ;; Author: Tim King ;; Phil Hagelberg @@ -11,7 +11,7 @@ ;; Steve Purcell ;; Maintainer: Bozhidar Batsov ;; URL: http://www.github.com/clojure-emacs/cider -;; Version: 0.19.0-snapshot +;; Version: 0.21.0-snapshot ;; Package-Requires: ((emacs "25") (clojure-mode "5.9") (pkg-info "0.4") (queue "0.2") (spinner "1.7") (seq "2.16") (sesman "0.3.2")) ;; Keywords: languages, clojure, cider @@ -86,12 +86,12 @@ (require 'seq) (require 'sesman) -(defconst cider-version "0.19.0-snapshot" +(defconst cider-version "0.21.0-snapshot" "Fallback version used when it cannot be extracted automatically. Normally it won't be used, unless `pkg-info' fails to extract the version from the CIDER package or library.") -(defconst cider-codename "Saigon" +(defconst cider-codename "New York" "Codename used to denote stable releases.") (defcustom cider-lein-command @@ -224,11 +224,11 @@ project.clj for leiningen or build.boot for boot, could be found. As the Clojure CLI is bundled with Clojure itself, it's the default. In the absence of the Clojure CLI (e.g. on Windows), we fallback to Leiningen." - :type '(choice (const 'lein) - (const 'boot) - (const 'clojure-cli) - (const 'shadow-cljs) - (const 'gradle)) + :type '(choice (const lein) + (const boot) + (const clojure-cli) + (const shadow-cljs) + (const gradle)) :group 'cider :safe #'symbolp :package-version '(cider . "0.9.0")) @@ -242,11 +242,11 @@ variable will suppress this behavior and will select whatever build system is indicated by the variable if present. Note, this is only when CIDER cannot decide which of many build systems to use and will never override a command when there is no ambiguity." - :type '(choice (const 'lein) - (const 'boot) - (const 'clojure-cli) - (const 'shadow-cljs) - (const 'gradle) + :type '(choice (const lein) + (const boot) + (const clojure-cli) + (const shadow-cljs) + (const gradle) (const :tag "Always ask" nil)) :group 'cider :safe #'symbolp @@ -258,10 +258,10 @@ When set to 'warn you'd prompted to confirm the command. When set to t `cider-jack-in' will quietly continue. When set to nil `cider-jack-in' will fail." :type '(choice (const :tag "always" t) - (const 'warn) + (const warn) (const :tag "never" nil)) :group 'cider - :safe #'stringp + :safe #'symbolp :package-version '(cider . "0.15.0")) (defcustom cider-known-endpoints nil @@ -377,7 +377,7 @@ Throws an error if PROJECT-TYPE is unknown." ;; We inject the newest known version of nREPL just in case ;; your version of Boot or Leiningen is bundling an older one. (cider-add-to-alist 'cider-jack-in-dependencies - "nrepl" "0.4.5") + "nrepl" "0.5.3") (defvar cider-jack-in-cljs-dependencies nil "List of dependencies where elements are lists of artifact name and version. @@ -389,8 +389,6 @@ Added to `cider-jack-in-dependencies' when doing `cider-jack-in-cljs'.") "List of exclusions for jack in dependencies. Elements of the list are artifact name and list of exclusions to apply for the artifact.") (put 'cider-jack-in-dependencies-exclusions 'risky-local-variable t) -(cider-add-to-alist 'cider-jack-in-dependencies-exclusions - "org.clojure/tools.nrepl" '("org.clojure/clojure")) (defconst cider-clojure-artifact-id "org.clojure/clojure" "Artifact identifier for Clojure.") @@ -401,10 +399,10 @@ Elements of the list are artifact name and list of exclusions to apply for the a (defconst cider-latest-clojure-version "1.10.0" "Latest supported version of Clojure.") -(defconst cider-required-middleware-version "0.18.0" +(defconst cider-required-middleware-version "0.20.0" "The minimum CIDER nREPL version that's known to work properly with CIDER.") -(defconst cider-latest-middleware-version "0.19.0-SNAPSHOT" +(defconst cider-latest-middleware-version "0.20.0" "The latest CIDER nREPL version that's known to work properly with CIDER.") (defcustom cider-jack-in-auto-inject-clojure nil @@ -606,7 +604,7 @@ See also `cider-jack-in-auto-inject-clojure'." These are set in `cider-jack-in-dependencies', `cider-jack-in-lein-plugins' and `cider-jack-in-nrepl-middlewares' are injected from the CLI according to the used PROJECT-TYPE. Eliminates the need for hacking profiles.clj or the -boot script for supporting cider with its nREPL middleware and +boot script for supporting CIDER with its nREPL middleware and dependencies." (pcase project-type ('lein (cider-lein-jack-in-dependencies @@ -1008,7 +1006,7 @@ server is created." (cider--update-do-prompt) (append other-params) (plist-put :repl-init-function nil) - (plist-put :repl-type "clj") + (plist-put :repl-type 'clj) (plist-put :session-name ses-name))))) ;;;###autoload @@ -1030,7 +1028,7 @@ server buffer, in which case a new session for that server is created." (cider--update-cljs-type) (cider--update-cljs-init-function) (plist-put :session-name ses-name) - (plist-put :repl-type "pending-cljs"))))) + (plist-put :repl-type 'pending-cljs))))) ;;;###autoload (defun cider-connect-clj (&optional params) @@ -1045,7 +1043,7 @@ prefix argument, prompt for all the parameters." (cider--check-existing-session) (plist-put :repl-init-function nil) (plist-put :session-name nil) - (plist-put :repl-type "clj")))) + (plist-put :repl-type 'clj)))) ;;;###autoload (defun cider-connect-cljs (&optional params) @@ -1062,7 +1060,7 @@ parameters regardless of their supplied or default values." (cider--update-cljs-type) (cider--update-cljs-init-function) (plist-put :session-name nil) - (plist-put :repl-type "pending-cljs")))) + (plist-put :repl-type 'pending-cljs)))) ;;;###autoload (defun cider-connect-clj&cljs (params &optional soft-cljs-start) @@ -1327,6 +1325,12 @@ Tramp version starting 26.1 is using a `cl-defstruct' rather than vanilla VEC." (make-tramp-file-name :method (elt vec 0) :host (elt vec 2))))) +(defcustom cider-infer-remote-nrepl-ports nil + "When true, cider will use ssh to try to infer nREPL ports on remote hosts." + :type 'boolean + :safe #'booleanp + :package-version '(cider . "0.19.0")) + (defun cider--infer-ports (host ssh-hosts) "Infer nREPL ports on HOST. Return a list of elements of the form (directory port). SSH-HOSTS is a list @@ -1338,14 +1342,15 @@ of remote SSH hosts." (let* ((change-dir-p (file-remote-p default-directory)) (default-directory (if change-dir-p "~/" default-directory))) (cider-locate-running-nrepl-ports (unless change-dir-p default-directory))) - (let ((vec (vector "sshx" nil host "" nil)) - ;; change dir: user might want to connect to a different remote - (dir (when (file-remote-p default-directory) - (with-parsed-tramp-file-name default-directory cur - (when (string= cur-host host) default-directory))))) - (tramp-maybe-open-connection (cider--tramp-file-name vec)) - (with-current-buffer (tramp-get-connection-buffer (cider--tramp-file-name vec)) - (cider-locate-running-nrepl-ports dir)))))) + (when cider-infer-remote-nrepl-ports + (let ((vec (vector "sshx" nil host "" nil)) + ;; change dir: user might want to connect to a different remote + (dir (when (file-remote-p default-directory) + (with-parsed-tramp-file-name default-directory cur + (when (string= cur-host host) default-directory))))) + (tramp-maybe-open-connection (cider--tramp-file-name vec)) + (with-current-buffer (tramp-get-connection-buffer (cider--tramp-file-name vec)) + (cider-locate-running-nrepl-ports dir))))))) (defun cider--completing-read-port (host ports) "Interactively select port for HOST from PORTS." @@ -1387,7 +1392,8 @@ PROJECT-DIR defaults to current project." (boot . "build.boot") (clojure-cli . "deps.edn") (shadow-cljs . "shadow-cljs.edn") - (gradle . "build.gradle")))) + (gradle . "build.gradle") + (gradle . "build.gradle.kts")))) (delq nil (mapcar (lambda (candidate) (when (file-exists-p (cdr candidate)) diff --git a/elpa/cider-20181110.1413/nrepl-client.el b/elpa/cider-20190121.1852/nrepl-client.el similarity index 98% rename from elpa/cider-20181110.1413/nrepl-client.el rename to elpa/cider-20190121.1852/nrepl-client.el index b250f74a..85b78c61 100644 --- a/elpa/cider-20181110.1413/nrepl-client.el +++ b/elpa/cider-20190121.1852/nrepl-client.el @@ -1,7 +1,7 @@ ;;; nrepl-client.el --- Client for Clojure nREPL -*- lexical-binding: t -*- ;; Copyright © 2012-2013 Tim King, Phil Hagelberg, Bozhidar Batsov -;; Copyright © 2013-2018 Bozhidar Batsov, Artur Malabarba and CIDER contributors +;; Copyright © 2013-2019 Bozhidar Batsov, Artur Malabarba and CIDER contributors ;; ;; Author: Tim King ;; Phil Hagelberg @@ -741,13 +741,12 @@ to the REPL." (defun nrepl-make-response-handler (buffer value-handler stdout-handler stderr-handler done-handler &optional eval-error-handler - pprint-out-handler content-type-handler) "Make a response handler for connection BUFFER. A handler is a function that takes one argument - response received from the server process. The response is an alist that contains at least 'id' and 'session' keys. Other standard response keys are 'value', 'out', 'err', -'pprint-out' and 'status'. +and 'status'. The presence of a particular key determines the type of the response. For example, if 'value' key is present, the response is of type 'value', if @@ -755,7 +754,7 @@ example, if 'value' key is present, the response is of type 'value', if Depending on the type, the handler dispatches the appropriate value to one of the supplied handlers: VALUE-HANDLER, STDOUT-HANDLER, STDERR-HANDLER, -DONE-HANDLER, EVAL-ERROR-HANDLER, PPRINT-OUT-HANDLER and +DONE-HANDLER, EVAL-ERROR-HANDLER and CONTENT-TYPE-HANDLER. Handlers are functions of the buffer and the value they handle, except for @@ -767,8 +766,7 @@ is used. If any of the other supplied handlers are nil nothing happens for the corresponding type of response." (lambda (response) (nrepl-dbind-response response (content-type content-transfer-encoding body - value ns out err status id - pprint-out) + value ns out err status id) (when (buffer-live-p buffer) (with-current-buffer buffer (when (and ns (not (derived-mode-p 'clojure-mode))) @@ -785,9 +783,6 @@ the corresponding type of response." (out (when stdout-handler (funcall stdout-handler buffer out))) - (pprint-out - (cond (pprint-out-handler (funcall pprint-out-handler buffer pprint-out)) - (stdout-handler (funcall stdout-handler buffer pprint-out)))) (err (when stderr-handler (funcall stderr-handler buffer err))) @@ -800,10 +795,7 @@ the corresponding type of response." (when (member "eval-error" status) (funcall (or eval-error-handler nrepl-err-handler))) (when (member "namespace-not-found" status) - ;; nREPL 0.4.3 started echoing back the name of the missing ns - (if ns - (message "Namespace `%s' not found." ns) - (message "Namespace not found."))) + (message "Namespace `%s' not found." ns)) (when (member "need-input" status) (cider-need-input buffer)) (when (member "done" status) diff --git a/elpa/cider-20181110.1413/nrepl-dict.el b/elpa/cider-20190121.1852/nrepl-dict.el similarity index 99% rename from elpa/cider-20181110.1413/nrepl-dict.el rename to elpa/cider-20190121.1852/nrepl-dict.el index be143860..d77aa608 100644 --- a/elpa/cider-20181110.1413/nrepl-dict.el +++ b/elpa/cider-20190121.1852/nrepl-dict.el @@ -1,7 +1,7 @@ ;;; nrepl-dict.el --- Dictionary functions for Clojure nREPL -*- lexical-binding: t -*- ;; Copyright © 2012-2013 Tim King, Phil Hagelberg, Bozhidar Batsov -;; Copyright © 2013-2018 Bozhidar Batsov, Artur Malabarba and CIDER contributors +;; Copyright © 2013-2019 Bozhidar Batsov, Artur Malabarba and CIDER contributors ;; ;; Author: Tim King ;; Phil Hagelberg -- 2.47.3