| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
| |
Make public functions backwards compatible by converting type string to symbol
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
`with-eval-after-load` was introduced in Emacs 24.4 and its
usage results in a cleaner code.
`eval-after-load` is considered ill-behaved because it is a function,
not a macro, and thus requires the code inside it to be quoted, which
means that it cannot be byte-compiled. It also accepts only one form,
so if you have more than one, you need to use `progn`.
More details - https://stackoverflow.com/questions/21880139/what-is-with-eval-after-load-in-emacs-lisp
|
|
|
|
|
|
|
| |
Seems more people were relying on those than I originally
expected. :-)
Vox populi, vox dei!
|
|
|
|
| |
menu
|
|
|
|
| |
.. because it accepts an explicit REPL argument now.
|
|
|
|
|
| |
The C-c M-n l has been assigned to cider-ns-reload while C-c M-n M-l has been
assigned to cider-ns-reload-all.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
That's another take at
https://github.com/clojure-emacs/clojure-mode/issues/478. The original
solution enabled ns caching globally in `clojure-mode`, but this
created problems for people who'd change a namespace without
noticing they have to invalidate the cached value.
As that's the only real hotspot for `clojure-find-ns` (used internally
in `cider-current-ns`) we can simply let-bind the caching in this
scope and leave evaluations out of this.
|
|
|
|
|
|
| |
This also fixes
https://github.com/bbatsov/projectile/issues/1256. (Projectile uses
`C-c C-p` as well)
|
| |
|
| |
|
| |
|
|
|
|
| |
I didn't noticed this when reviewing my previous changes.
|
|
|
|
|
|
| |
See https://github.com/clojure-emacs/cider/pull/2314 for the rationale
behind this change. Basically we plan to put several ns manipulation
commands together in the same module.
|
|
|
|
|
|
|
|
| |
- cider-switch-to-repl-buffer uses cider-current-repl instead of implementing
its own lookup
- cider-repl-switch-to-other throws a "no other REPL" error if no other REPL
exists instead of switching to an arbitrary buffer
|
| |
|
|
|
|
|
|
|
|
|
|
| |
All of the non-eval functionality was removed, which
marks the end of the process of breaking up the old file.
Down the road we may opt to break down cider-eval into some core
functionality and extra functionality, as many of the eval
commands there are kind of "exotic", but that's not that important
at this point.
|
|
|
|
|
|
|
|
| |
I can't think of a simple way to deal with menus coming from other
files that are added to cider-mode's menu.
Those are the only reason why we require cider-test, cider-doc and
cider-profile.
|
| |
|
|
|
|
|
| |
It's better to just load cider-profile.el on demand, relying on
the fact that all interactive commands there are auto-loaded.
|
|
|
|
|
|
|
|
| |
This also allows to simply auto-load the find commands when they
are used for the first time.
cider-jump-to is moved to cider-common.el, as it has other uses,
apart from the ones in the various find commands.
|
| |
|
| |
|
|
|
|
|
| |
This also allows to simply auto-load the cider-refresh command when it
is used for the first time.
|
|
|
|
|
| |
This also allows to simply auto-load the tracing commands when they
are used for the first time.
|
|
|
|
|
|
| |
cider-interaction.el
It's pretty self-contained and it's used only in cider-mode.el.
|
|
|
|
|
| |
The new names are the a bit more descriptive
`cider-eval-defun-up-to-point` and `cider-eval-sexp-up-to-point`.
|
|
|
|
| |
A small attempt to group related functionality better together.
|
|
|
| |
It's similar in nature to cider-eval-defun-to-point, but operates on the current sexp.
|
|
|
|
|
|
|
|
| |
The command acts as a simple wrapper around all commands for
starting/connecting to REPLs.
It spares you having to remember a ton of keybindings and pays special
homage to the one true `M-x`.
|
|
|
|
|
|
|
| |
This reverts commit b28fbac964907172fdedc3bea56eab905d5fbdbf.
This can't be fully removed due to the difference in the signature
of `if-let*` and `when-let*` in Emacs 25 and 26.
|
|
|
|
| |
It's no longer needed now that we target Emacs 25.
|
|
|
|
| |
Situation that should occur with broken links during development only.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Second attempt on #2069. A brief description of the new functionality follows.
1) __Jack-in/connect__
- User level commands:
Create new sessions:
C-c M-j: cider-jack-in-clj
C-c M-J: cider-jack-in-cljs
C-c M-c: cider-connect-clj
C-c M-C: cider-connect-cljs
Add new REPLs to the current session:
C-c M-s: cider-connect-sibling-clj
C-c M-S: cider-connect-sibling-cljs
- `cider-jack-in-clojurescript` no longer creates two repls, only the cljs repl
- clj repl has no longer a special status of the "main" repl. All repls within a session share same server and are siblings of each other. You can create as many clj and cljs siblings as you want from any repl.
- Creation of the client is no longer tightly bounded with the nrepl-server startup. The dynamic communication mechanism between jack-in and nrepl-server filter has been replace by a simple `on-port-callback`.
2) __New Connection and Session Management API__
- Connections (aka REPLs) are grouped in [sesman](https://github.com/vspinu/sesman) sessions. Sibling repls are added to the current session.
- Cider connection commands (`cider-quit`, `cider-restart`, `cider-display-connection-info`) have been refactored to operate exclusively on the connection level.
- Sesman commands operate on the whole session:
![sesman-map](https://user-images.githubusercontent.com/1363467/41355277-6864ffb8-6f21-11e8-9387-3de586477d68.png)
- Associations (links) between current context (buffer, directory, project) are governed by sesman and could be formed only on the session level.
In a nutshell, session can be linked to projects, directories and buffers. Buffer link have precedence over directory links, and directory have precedence over project links.
When a sesman session is registered it's automatically linked with the lowest priority context (project, or directory if no project found). By default (configured with `sesman-1-to-1-links`) multiple sessions can be linked with a project or a directory, but only one session can be linked with a buffer.
Cider functionality (eval, completion, repl-switching etc) operate on linked sessions. When there are multiple linked sessions ambiguity is automatically resolved by the recency of the REPL buffers (configured with `sesman-disambiguate-by-relevance`).
- Show info on current links with `C-c C-s l`. Show info on current, linked or all sessions with `C-c C-s i`.
- Micro-management of the server is not allowed (it's not useful and would complicate UI). All repls within a session share a server. Server can be either remote (`cider-connect`) or local (bootstraped within the emacs during `cider-jack-in-xyz`).
In case of the local server, when the last connection is killed the server is automatically killed. `cider-restart` restarts the connection but not the server. `sesman-restart` restarts the server and all the connections.
At least two issues I still plan to tackle here:
- Restart of SSH tunneled connection has not been tested and probably doesn't work
- REPL buffer naming system is no longer adequate. It should be possible to include session name as part of the buffer name and add more flexibility into the customization of buffer name templates.
-----
A tot of no longer necessary or questionable functionality has been removed. The goal is to start from scratch and add only what is really necessary. I am listing all the removed functions for the ease of lookup through the github interface.
Removed:
cider--connection-host,
cider--connection-port,
cider--connection-project-dir,
cider--connection-properties,
cider--connection-type,
cider--guess-cljs-connection,
cider--has-warned-about-bad-repl-type,
cider--in-connection-buffer-p,
cider--quit-connection,
cider--restart-connection,
cider-assoc-buffer-with-connection,
cider-assoc-project-with-connection,
cider-change-buffers-designation,
cider-clear-buffer-local-connection,
cider-close-nrepl-session,
cider-connections (variable),
cider-current-connection (variable),
cider-current-messages-buffer,
cider-current-repl-buffer,
cider-default-connection,
cider-extract-designation-from-current-repl-buffer,
cider-find-connection-buffer-for-project-directory,
cider-find-reusable-repl-buffer,
cider-make-connection-default,
cider-map-connections,
cider-other-connection,
cider-project-connections,
cider-project-connections-types,
cider-prompt-for-project-on-connect,
cider-read-connection,
cider-repl-buffers,
cider-replicate-connection,
cider-request-dispatch,
cider-rotate-default-connection,
cider-toggle-buffer-connection,
cider-toggle-request-dispatch,
nrepl-connection-buffer-name-template,
nrepl-create-client-buffer-function,
nrepl-post-client-callback
nrepl-prompt-to-kill-server-buffer-on-quit,
nrepl-use-this-as-repl-buffer,
Connection Browser Functionality:
cider--connection-browser-buffer-name,
cider--connection-ewoc,
cider--connection-pp,
cider--connections-close-connection,
cider--connections-goto-connection,
cider--connections-make-default,
cider--connections-refresh,
cider--connections-refresh-buffer,
cider--ewoc-apply-at-point,
cider--setup-connection-browser,
cider--update-connections-display,
cider-client-name-repl-type,
cider-connection-browser,
cider-connections-buffer-mode,
cider-connections-buffer-mode-map
cider-connections-close-connection,
cider-connections-goto-connection,
cider-connections-make-default,
cider-display-connected-message,
cider-project-name,
Renamed:
cider-current-session -> cider-nrepl-eval-session
cider-current-tooling-session -> cider-nrepl-tooling-session
cider-display-connection-info -> cider-describe-current-connection
cider-create-sibling-cljs-repl -> cider-connect-sibling-cljs
nrepl-connection-buffer-name -> nrepl-repl-buffer-name
cider--close-connection-buffer -> cider--close-connection
## repl <> connection overlap cleanup
cider-connections -> cider-repls
cider-current-connection -> cider-current-repl
cider-map-connections -> cider-map-repls
cider-connection-type-for-buffer -> cider-repl-type-for-buffer
cider-repl-set-type -> cider-set-repl-type
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
flexible (#2319)
I noticed the insert-into-repl commands didn't have an easy map to use those commands so I added them under a map. Allows some defcustoms to tweak the behavior:
- `cider-invert-insert-eval-p`: Previously, the prefix arg was required to have the inserted form evaluated and the default behavior was to just plop the form in the repl. This inverts that so that by default the forms are inserted and then evaluated. The benefit is that now the repl has a sequence of values and the forms that give those values context.
- `cider-switch-to-repl-after-insert-p`: Previously when using an insert command point was moved into the repl buffer unconditionally. Now it is conditional. This is desirable since now that it is easy to have inserted forms evaluated by default the repl often doesn't need focus after each insertion.
The motivation behind these changes is when working with `comment` forms.
Imagine some comment forms that are useful for inspecting your namespace. This makes it easy to eval a sequence of them and put their forms and results in the repl so there is a sense of context. It is also easy to put a prefix arg on them to prevent evaluation and then modify them if you need.
This does some work towards @halgari 's issue in https://github.com/clojure-emacs/cider/issues/2255 in putting a similar behavior to Cursive into CIDER. Notice how the evaluations from the comment form are plopped into the repl to give a sense of context to the state of the repl. That workflow now will work with the caveat that you have to be at the end of the form rather than any point inside of it (but that is next on the roadmap). This felt like a way to get 70% of the functionality there quickly.
To emulate the behavior of that gif, do
```elisp
(setq cider-invert-insert-eval-p t) ;; eval after inserting by default
(setq cider-switch-to-repl-after-insert-p nil) ;; don't switch to the repl buffer
```
Then the insert map is now at `C-c C-j`. There you will find
- `e`: insert last sexp
- `d` insert top level defun (not modified yet to work with `comment` forms intelligently yet
- `r` insert region
- `n` insert ns form
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Otherwise people are going to have a very hard time finding out about
them. Likely we should also put all of those under a unified keymap.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Now the user will simply be prompted for the REPL they want to start. Later we
should make this smarter - compute a good default based on the project deps,
don't show unsupported options, etc.
|
|
|
|
| |
The submenu can be found under the CIDER Interactions menu.
|