Skip to content

Commit 59905c3

Browse files
authored
Merge branch 'master' into switch
2 parents dd0ecbc + 8cd7648 commit 59905c3

28 files changed

+370
-269
lines changed

.travis.yml

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,54 @@
11
sudo: false
22
language: emacs-lisp
3+
4+
addons:
5+
apt:
6+
packages:
7+
- autogen
8+
- ca-certificates
9+
- curl
10+
- gcc
11+
- libgmp-dev
12+
- m4
13+
- make
14+
- pkg-config
15+
- xz-utils
16+
17+
cache:
18+
directories:
19+
- $HOME/local
20+
321
env:
4-
- EMACS_BINARY=emacs-24.4-travis MAKE_TEST=test
5-
- EMACS_BINARY=emacs-24.4-travis MAKE_TEST=test-bytecomp
6-
- EMACS_BINARY=emacs-24.5-travis MAKE_TEST=test
7-
- EMACS_BINARY=emacs-24.5-travis MAKE_TEST=test-bytecomp
8-
- EMACS_BINARY=emacs-25.1-travis MAKE_TEST=test
9-
- EMACS_BINARY=emacs-25.1-travis MAKE_TEST=test-bytecomp
10-
- EMACS_BINARY=emacs-25.2-travis MAKE_TEST=test
11-
- EMACS_BINARY=emacs-25.2-travis MAKE_TEST=test-bytecomp
12-
- EMACS_BINARY=emacs-25.2-travis MAKE_TEST=test-checks
13-
- EMACS_BINARY=emacs-git-snapshot-travis MAKE_TEST=test
14-
- EMACS_BINARY=emacs-git-snapshot-travis MAKE_TEST=test-bytecomp
15-
- EMACS_BINARY=emacs-git-snapshot-travis MAKE_TEST=test-checks
22+
global:
23+
- PATH=$HOME/local/bin:$PATH
24+
matrix:
25+
- EMACS_BINARY=emacs-24.4-travis MAKE_TEST=test
26+
- EMACS_BINARY=emacs-24.4-travis MAKE_TEST=test-bytecomp
27+
- EMACS_BINARY=emacs-24.5-travis MAKE_TEST=test
28+
- EMACS_BINARY=emacs-24.5-travis MAKE_TEST=test-bytecomp
29+
- EMACS_BINARY=emacs-25.1-travis MAKE_TEST=test
30+
- EMACS_BINARY=emacs-25.1-travis MAKE_TEST=test-bytecomp
31+
- EMACS_BINARY=emacs-25.2-travis MAKE_TEST=test
32+
- EMACS_BINARY=emacs-25.2-travis MAKE_TEST=test-bytecomp
33+
- EMACS_BINARY=emacs-25.3-travis MAKE_TEST=test
34+
- EMACS_BINARY=emacs-25.3-travis MAKE_TEST=test-bytecomp
35+
- EMACS_BINARY=emacs-25.3-travis MAKE_TEST=test-checks
36+
- EMACS_BINARY=emacs-26-pretest-travis MAKE_TEST=test
37+
- EMACS_BINARY=emacs-26-pretest-travis MAKE_TEST=test-bytecomp
38+
- EMACS_BINARY=emacs-26-pretest-travis MAKE_TEST=test-checks
39+
- EMACS_BINARY=emacs-git-snapshot-travis MAKE_TEST=test
40+
- EMACS_BINARY=emacs-git-snapshot-travis MAKE_TEST=test-bytecomp
41+
- EMACS_BINARY=emacs-git-snapshot-travis MAKE_TEST=test-checks
1642

1743
before_script:
44+
- sudo sh travis-ci/travis-gnutls.sh
45+
- gnutls-cli -v
1846
- curl -fsSkL https://gist.github.com/rejeep/ebcd57c3af83b049833b/raw > x.sh && source ./x.sh
1947
- evm install $EMACS_BINARY --use --skip
2048
- make elpa
2149
script:
2250
- emacs --version
2351
- make $MAKE_TEST
24-
matrix:
25-
- env: EMACS_BINARY=emacs-git-snapshot-travis
2652

2753
notifications:
2854
webhooks:

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@
1414
* [cider-nrepl#438](https://github.com/clojure-emacs/cider-nrepl/pull/438): Improve startup time by deferring loading CIDER's middleware until the first usage.
1515
* [#2078](https://github.com/clojure-emacs/cider/pull/2078): Improve startup time by bundling together sync requests during startup.
1616
* `cider-rotate-default-connection` will warn if you use it with only a single active connection.
17+
* `cider-format-buffer` tries to preserve the point position.
1718

1819
### Bugs Fixed
1920

2021
* [#2084](https://github.com/clojure-emacs/cider/issues/2084): Select correct REPL type (clj or cljs) in cider-switch-to-repl-buffer conditional on the current buffer.
2122
* [#2088](https://github.com/clojure-emacs/cider/issues/2088): Fix functions defined with `def` being font-locked as vars instead of functions.
2223
* [#1651](https://github.com/clojure-emacs/cider/issues/1651), [cider-nrepl#445](https://github.com/clojure-emacs/cider-nrepl/pull/455): Fix `cider-expected-ns` returns `nil` on boot projects.
24+
* [#2120](https://github.com/clojure-emacs/cider/issues/2120): Fix Travis CI build errors for emacs versions >25.2.
2325

2426
## 0.15.1 (2017-09-13)
2527

cider-apropos.el

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ optionally search doc strings (based on DOCS-P), include private vars
144144
(y-or-n-p "Case-sensitive? ")))))
145145
(cider-ensure-connected)
146146
(cider-ensure-op-supported "apropos")
147-
(if-let ((summary (cider-apropos-summary
148-
query ns docs-p privates-p case-sensitive-p))
149-
(results (cider-sync-request:apropos query ns docs-p privates-p case-sensitive-p)))
147+
(if-let* ((summary (cider-apropos-summary
148+
query ns docs-p privates-p case-sensitive-p))
149+
(results (cider-sync-request:apropos query ns docs-p privates-p case-sensitive-p)))
150150
(cider-show-apropos summary results query docs-p)
151151
(message "No apropos matches for %S" query)))
152152

@@ -191,10 +191,10 @@ optionally search doc strings (based on DOCS-P), include private vars
191191
(y-or-n-p "Case-sensitive? ")))))
192192
(cider-ensure-connected)
193193
(cider-ensure-op-supported "apropos")
194-
(if-let ((summary (cider-apropos-summary
195-
query ns docs-p privates-p case-sensitive-p))
196-
(results (mapcar (lambda (r) (nrepl-dict-get r "name"))
197-
(cider-sync-request:apropos query ns docs-p privates-p case-sensitive-p))))
194+
(if-let* ((summary (cider-apropos-summary
195+
query ns docs-p privates-p case-sensitive-p))
196+
(results (mapcar (lambda (r) (nrepl-dict-get r "name"))
197+
(cider-sync-request:apropos query ns docs-p privates-p case-sensitive-p))))
198198
(cider-apropos-act-on-symbol (completing-read (concat summary ": ") results))
199199
(message "No apropos matches for %S" query)))
200200

cider-browse-spec.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ may also be a button, so this function can be used a the button's `action'
282282
property."
283283
(interactive)
284284
(let ((pos (or pos (point))))
285-
(when-let ((spec (button-get pos 'spec-name)))
285+
(when-let* ((spec (button-get pos 'spec-name)))
286286
(cider-browse-spec--browse spec))))
287287

288288
;; Interactive Functions
@@ -292,8 +292,8 @@ property."
292292
(interactive)
293293
(cider-ensure-connected)
294294
(cider-ensure-op-supported "spec-example")
295-
(if-let ((spec cider-browse-spec--current-spec))
296-
(if-let ((example (cider-sync-request:spec-example spec)))
295+
(if-let* ((spec cider-browse-spec--current-spec))
296+
(if-let* ((example (cider-sync-request:spec-example spec)))
297297
(with-current-buffer (cider-popup-buffer cider-browse-spec-example-buffer t)
298298
(cider-browse-spec-example-mode)
299299
(setq-local cider-browse-spec--current-spec spec)

cider-classpath.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
(interactive)
105105
(cider-ensure-connected)
106106
(cider-ensure-op-supported "classpath")
107-
(when-let ((entry (completing-read "Classpath entries: " (cider-sync-request:classpath))))
107+
(when-let* ((entry (completing-read "Classpath entries: " (cider-sync-request:classpath))))
108108
(find-file-other-window entry)))
109109

110110
(provide 'cider-classpath)

cider-client.el

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ precedence over other connections associated with the same project.
161161
162162
If ALL-CONNECTIONS is non-nil, the return value is a list and all matching
163163
connections are returned, instead of just the most recent."
164-
(when-let ((project-directory (or project-directory
164+
(when-let* ((project-directory (or project-directory
165165
(clojure-project-dir (cider-current-dir))))
166166
(fn (if all-connections #'seq-filter #'seq-find)))
167167
(or (funcall fn (lambda (conn)
168-
(when-let ((conn-proj-dir (with-current-buffer conn
168+
(when-let* ((conn-proj-dir (with-current-buffer conn
169169
nrepl-project-dir)))
170170
(equal (file-truename project-directory)
171171
(file-truename conn-proj-dir))))
@@ -306,7 +306,7 @@ at all."
306306
"Return the first connection of another type than CONNECTION.
307307
Only return connections in the same project or nil.
308308
CONNECTION defaults to `cider-current-connection'."
309-
(when-let ((connection (or connection (cider-current-connection)))
309+
(when-let* ((connection (or connection (cider-current-connection)))
310310
(connection-type (cider--connection-type connection)))
311311
(cider-current-connection (pcase connection-type
312312
(`"clj" "cljs")
@@ -319,7 +319,7 @@ CONNECTION defaults to `cider-current-connection'."
319319
DO NOT USE THIS FUNCTION.
320320
It was written only to be used in `cider-map-connections', as a workaround
321321
to a still-undetermined bug in the state-stracker backend."
322-
(when-let ((project-connections (cider-find-connection-buffer-for-project-directory
322+
(when-let* ((project-connections (cider-find-connection-buffer-for-project-directory
323323
nil :all-connections))
324324
(cljs-conn
325325
;; So we have multiple connections. Look for the connection type we
@@ -389,7 +389,7 @@ connection but can be invoked from any buffer (like `cider-refresh')."
389389
((err "needs a ClojureScript REPL")))))))
390390
(funcall function curr)
391391
(when (eq which :both)
392-
(when-let ((other-connection (cider-other-connection curr)))
392+
(when-let* ((other-connection (cider-other-connection curr)))
393393
(funcall function other-connection))))))
394394

395395

@@ -419,7 +419,7 @@ connection but can be invoked from any buffer (like `cider-refresh')."
419419
(defun cider-connection-browser ()
420420
"Open a browser buffer for nREPL connections."
421421
(interactive)
422-
(if-let ((buffer (get-buffer cider--connection-browser-buffer-name)))
422+
(if-let* ((buffer (get-buffer cider--connection-browser-buffer-name)))
423423
(progn
424424
(cider--connections-refresh-buffer buffer)
425425
(unless (get-buffer-window buffer)
@@ -430,7 +430,7 @@ connection but can be invoked from any buffer (like `cider-refresh')."
430430
"Refresh the connections buffer, if the buffer exists.
431431
The connections buffer is determined by
432432
`cider--connection-browser-buffer-name'"
433-
(when-let ((buffer (get-buffer cider--connection-browser-buffer-name)))
433+
(when-let* ((buffer (get-buffer cider--connection-browser-buffer-name)))
434434
(cider--connections-refresh-buffer buffer)))
435435

436436
(add-hook 'nrepl-disconnected-hook #'cider--connections-refresh)
@@ -622,7 +622,7 @@ REPL's ns, otherwise fall back to \"user\".
622622
When NO-DEFAULT is non-nil, it will return nil instead of \"user\"."
623623
(or cider-buffer-ns
624624
(clojure-find-ns)
625-
(when-let ((repl-buf (cider-current-connection)))
625+
(when-let* ((repl-buf (cider-current-connection)))
626626
(buffer-local-value 'cider-buffer-ns repl-buf))
627627
(if no-default nil "user")))
628628

@@ -835,15 +835,15 @@ unless ALL is truthy."
835835
"Find the definition of VAR, optionally at a specific LINE.
836836
837837
Display the results in a different window."
838-
(if-let ((info (cider-var-info var)))
838+
(if-let* ((info (cider-var-info var)))
839839
(progn
840840
(if line (setq info (nrepl-dict-put info "line" line)))
841841
(cider--jump-to-loc-from-info info t))
842842
(user-error "Symbol `%s' not resolved" var)))
843843

844844
(defun cider--find-var (var &optional line)
845845
"Find the definition of VAR, optionally at a specific LINE."
846-
(if-let ((info (cider-var-info var)))
846+
(if-let* ((info (cider-var-info var)))
847847
(progn
848848
(if line (setq info (nrepl-dict-put info "line" line)))
849849
(cider--jump-to-loc-from-info info))
@@ -931,11 +931,11 @@ Optional arguments include SEARCH-NS, DOCS-P, PRIVATES-P, CASE-SENSITIVE-P."
931931
(defun cider-sync-request:complete (str context)
932932
"Return a list of completions for STR using nREPL's \"complete\" op.
933933
CONTEXT represents a completion context for compliment."
934-
(when-let ((dict (thread-first `("op" "complete"
935-
"ns" ,(cider-current-ns)
936-
"symbol" ,str
937-
"context" ,context)
938-
(cider-nrepl-send-sync-request nil 'abort-on-input))))
934+
(when-let* ((dict (thread-first `("op" "complete"
935+
"ns" ,(cider-current-ns)
936+
"symbol" ,str
937+
"context" ,context)
938+
(cider-nrepl-send-sync-request nil 'abort-on-input))))
939939
(nrepl-dict-get dict "completions")))
940940

941941
(defun cider-sync-request:complete-flush-caches ()
@@ -958,22 +958,22 @@ CONTEXT represents a completion context for compliment."
958958

959959
(defun cider-sync-request:eldoc (symbol &optional class member)
960960
"Send \"eldoc\" op with parameters SYMBOL or CLASS and MEMBER."
961-
(when-let ((eldoc (thread-first `("op" "eldoc"
962-
"ns" ,(cider-current-ns)
963-
,@(when symbol `("symbol" ,symbol))
964-
,@(when class `("class" ,class))
965-
,@(when member `("member" ,member)))
966-
(cider-nrepl-send-sync-request nil 'abort-on-input))))
961+
(when-let* ((eldoc (thread-first `("op" "eldoc"
962+
"ns" ,(cider-current-ns)
963+
,@(when symbol `("symbol" ,symbol))
964+
,@(when class `("class" ,class))
965+
,@(when member `("member" ,member)))
966+
(cider-nrepl-send-sync-request nil 'abort-on-input))))
967967
(if (member "no-eldoc" (nrepl-dict-get eldoc "status"))
968968
nil
969969
eldoc)))
970970

971971
(defun cider-sync-request:eldoc-datomic-query (symbol)
972972
"Send \"eldoc-datomic-query\" op with parameter SYMBOL."
973-
(when-let ((eldoc (thread-first `("op" "eldoc-datomic-query"
974-
"ns" ,(cider-current-ns)
975-
,@(when symbol `("symbol" ,symbol)))
976-
(cider-nrepl-send-sync-request nil 'abort-on-input))))
973+
(when-let* ((eldoc (thread-first `("op" "eldoc-datomic-query"
974+
"ns" ,(cider-current-ns)
975+
,@(when symbol `("symbol" ,symbol)))
976+
(cider-nrepl-send-sync-request nil 'abort-on-input))))
977977
(if (member "no-eldoc" (nrepl-dict-get eldoc "status"))
978978
nil
979979
eldoc)))

cider-common.el

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,14 @@ relative, it is expanded within each of the open Clojure buffers till an
192192
existing file ending with URL has been found."
193193
(require 'arc-mode)
194194
(cond ((string-match "^file:\\(.+\\)" url)
195-
(when-let ((file (cider--url-to-file (match-string 1 url)))
196-
(path (cider--file-path file)))
195+
(when-let* ((file (cider--url-to-file (match-string 1 url)))
196+
(path (cider--file-path file)))
197197
(find-file-noselect path)))
198198
((string-match "^\\(jar\\|zip\\):\\(file:.+\\)!/\\(.+\\)" url)
199-
(when-let ((entry (match-string 3 url))
200-
(file (cider--url-to-file (match-string 2 url)))
201-
(path (cider--file-path file))
202-
(name (format "%s:%s" path entry)))
199+
(when-let* ((entry (match-string 3 url))
200+
(file (cider--url-to-file (match-string 2 url)))
201+
(path (cider--file-path file))
202+
(name (format "%s:%s" path entry)))
203203
(or (find-buffer-visiting name)
204204
(if (tramp-tramp-file-p path)
205205
(progn
@@ -223,7 +223,7 @@ existing file ending with URL has been found."
223223
(set-buffer-modified-p nil)
224224
(set-auto-mode)
225225
(current-buffer))))))
226-
(t (if-let ((path (cider--file-path url)))
226+
(t (if-let* ((path (cider--file-path url)))
227227
(find-file-noselect path)
228228
(unless (file-name-absolute-p url)
229229
(let ((cider-buffers (cider-util--clojure-buffers))

cider-compat.el

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -125,33 +125,27 @@ threading."
125125

126126
(eval-and-compile
127127

128-
(unless (fboundp 'if-let)
129-
(defmacro if-let (bindings then &rest else)
128+
(unless (fboundp 'if-let*)
129+
(defmacro if-let* (bindings then &rest else)
130130
"Process BINDINGS and if all values are non-nil eval THEN, else ELSE.
131131
Argument BINDINGS is a list of tuples whose car is a symbol to be
132132
bound and (optionally) used in THEN, and its cadr is a sexp to be
133-
evalled to set symbol's value. In the special case you only want
134-
to bind a single value, BINDINGS can just be a plain tuple."
133+
evalled to set symbol's value."
135134
(declare (indent 2)
136135
(debug ([&or (&rest (symbolp form)) (symbolp form)] form body)))
137-
(when (and (<= (length bindings) 2)
138-
(not (listp (car bindings))))
139-
;; Adjust the single binding case
140-
(setq bindings (list bindings)))
141136
`(let* ,(internal--build-bindings bindings)
142137
(if ,(car (internal--listify (car (last bindings))))
143138
,then
144139
,@else))))
145140

146-
(unless (fboundp 'when-let)
147-
(defmacro when-let (bindings &rest body)
141+
(unless (fboundp 'when-let*)
142+
(defmacro when-let* (bindings &rest body)
148143
"Process BINDINGS and if all values are non-nil eval BODY.
149144
Argument BINDINGS is a list of tuples whose car is a symbol to be
150145
bound and (optionally) used in BODY, and its cadr is a sexp to be
151-
evalled to set symbol's value. In the special case you only want
152-
to bind a single value, BINDINGS can just be a plain tuple."
153-
(declare (indent 1) (debug if-let))
154-
`(if-let ,bindings ,(macroexp-progn body)))))
146+
evalled to set symbol's value."
147+
(declare (indent 1) (debug if-let*))
148+
`(if-let* ,bindings ,(macroexp-progn body)))))
155149

156150
(eval-and-compile
157151

0 commit comments

Comments
 (0)