[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/jarchive 214a7db52f 22/33: Update readme with better ex
From: |
ELPA Syncer |
Subject: |
[elpa] externals/jarchive 214a7db52f 22/33: Update readme with better examples and explanations |
Date: |
Sat, 12 Nov 2022 17:57:57 -0500 (EST) |
branch: externals/jarchive
commit 214a7db52fa47f360cdcc7c61958f978839196e8
Author: dannyfreeman <danny@dfreeman.email>
Commit: dannyfreeman <danny@dfreeman.email>
Update readme with better examples and explanations
---
README.md | 73 +++++++++++++++++++++++++++++++++++++++++++--------------------
1 file changed, 50 insertions(+), 23 deletions(-)
diff --git a/README.md b/README.md
index c5adaaf4d4..b5cf885849 100644
--- a/README.md
+++ b/README.md
@@ -1,50 +1,41 @@
-Jarchive teaches emacs how to navigate to files inside jars.
-
-With it enabled things like this will open up `page.clj` in a read-only buffer.
-
-``` emacs-lisp
-(find-file
"~/.m2/repository/hiccup/hiccup/1.0.5/hiccup-1.0.5.jar::/hiccup/page.clj")
-```
-
-When using eglot, invoking `xref-find-definitions` on symbols defined in JAR
files should correctly open the files inside the jars.
-
-This package is intended to be used with eglot and lsp-servers like
clojure-lsp that provide URIs to files contained in jars through methods like
`textDocument/definition`.
+Jarchive teaches emacs how to open project dependencies that reside inside jar
files.
# Package status
This package is still under active development and is not yet ready for
widespread use. Proceed with caution!
+It current works well with eglot on the Emacs master branch.
+If you are using eglot from melpa or the eglot github, this won't work.
+I will update the README when this changes.
+
# Installing
-Add this repository to your emacs load-path
+This package is not available on any package repositories yet.
+
+Write now I recommend cloning this repository and adding it to your emacs
load-path:
``` emacs-lisp
(add-to-list 'load-path "path/to/jarchive")
```
-Then load and initialize the repository
+There is also an example of a [guix
recipe](https://git.sr.ht/~abcdw/rde/tree/90af100a4d70d7016261d39b91b6748768ac374b/rde/packages/emacs-xyz.scm#L330).
+
+Load and initialize the repository
``` emacs-lisp
(require 'jarchive)
-(jarchive-setup)
+(with-eval-after-load "init"
+ (jarchive-setup))
```
It can also be done in a hook (recommended)
``` emacs-lisp
-(add-hook 'clojure-mode-hook #'jarchive-setup)
+(add-hook 'eglot-managed-mode-hook #'jarchive-setup)
```
or interactively, via `M-x jarchive-setup`.
-# Usage
-
-With eglot, `xref-find-definitions` should correctly open up source files
found in jar dependencies.
-
-Once a file is opened, typing `M-x jarchive-move-to-visiting-project` will
move the file and it's buffer
-to the project that was used to visit it.
-This will allow you to edit the file and let eglot manage it as part of the
real project.
-
## Note about when to call `jarchive-setup`
Some Emacs "distributions" like doom set the `file-name-handler-alist` var to
nil on startup, then restore it's value when startup is complete.
@@ -52,6 +43,42 @@ Some Emacs "distributions" like doom set the
`file-name-handler-alist` var to ni
If this is the case for you, `jarchive-setup` should be called AFTER
everything is initialized.
This package modifies `file-name-handler-alist`, so it relies on it not being
reset after `jarchive-setup` is invoked.
+# Usage
+
+With it enabled, things like this will open up `page.clj` in a read-only
buffer.
+
+``` emacs-lisp
+(find-file
"jar:file:///.m2/repository/hiccup/hiccup/1.0.5/hiccup-1.0.5.jar!/hiccup/page.clj")
+```
+
+When using eglot connected to a JVM language server, invoking
`xref-find-definitions` should correctly open any dependencies that reside in
JAR files.
+
+## Other usage considerations
+
+If you want eglot to manage the opened jar'd file in your project's current
lsp session, set
+``` emacs-lisp
+(setq eglot-extend-to-xref t)
+```
+This will allow xref to work across your project and the opened file.
+
+If you do not want that, the eglot will probably start a new server to manage
the newly opened file.
+There are legitimate reasons to do this, because including it in the current
LSP session will mean it is included when looking up references.
+Large files, like the clojure core library, could create a lot of noise in
xref lookups.
+Another recommendation if you don't want them managed by eglot is to set
+``` emacs-lisp
+(setq eglot-autoshutdown t)
+```
+so that the transient lsp server that is started when opening the file is
closed along with it.
+
+## Language server compatibility
+
+I personally only test this with [clojure-lsp](https://clojure-lsp.io/).
+I have heard from other users that it also works with some unspecified java
language server.
+Any language server that provides jar: scheme URIs should be picked up by this
package.
+If it doesn't, please let me know and I'd be happy to take a look.
+
## Questions
Questions and patches can be submitted to the [mailing
list](https://lists.sr.ht/~dannyfreeman/jarchive-dev).
+Any bugs found should include steps to reproduce.
+If possible, and example repository containing a project and instructions (or
a nix shell) for installing the language servers would be appreciated.
- [elpa] branch externals/jarchive created (now bfcc201cca), ELPA Syncer, 2022/11/12
- [elpa] externals/jarchive 3cbfeea812 01/33: Add readme and license, ELPA Syncer, 2022/11/12
- [elpa] externals/jarchive f2875659a8 02/33: Initial code, copied from my personal emacs config, ELPA Syncer, 2022/11/12
- [elpa] externals/jarchive 642573149f 03/33: Try not to manage a collection of open buffers., ELPA Syncer, 2022/11/12
- [elpa] externals/jarchive f4a7953b4f 04/33: reorganize testing code, ELPA Syncer, 2022/11/12
- [elpa] externals/jarchive bb2467f8f9 10/33: Add warning to readme, ELPA Syncer, 2022/11/12
- [elpa] externals/jarchive 3a2b3096cd 11/33: Add autoload directive to jarchive-setup function, ELPA Syncer, 2022/11/12
- [elpa] externals/jarchive 059efdf37c 16/33: Make eglot-extend-to-xref work, breaking support for `zipfile:` uris, ELPA Syncer, 2022/11/12
- [elpa] externals/jarchive 9148ed7ada 18/33: WIP eglot setting to control jar URI parsing, ELPA Syncer, 2022/11/12
- [elpa] externals/jarchive 81c4b345bf 20/33: Set dependency-scheme to "jar" on clojure-lsp initialization, ELPA Syncer, 2022/11/12
- [elpa] externals/jarchive 214a7db52f 22/33: Update readme with better examples and explanations,
ELPA Syncer <=
- [elpa] externals/jarchive 305dbc947a 23/33: Don't for jar dependency scheme, just use whatever works., ELPA Syncer, 2022/11/12
- [elpa] externals/jarchive 8b738ec31b 26/33: Add changelog, ELPA Syncer, 2022/11/12
- [elpa] externals/jarchive abea8e79ec 28/33: Typo, ELPA Syncer, 2022/11/12
- [elpa] externals/jarchive 0361896bdc 29/33: Address package-lint feedback, ELPA Syncer, 2022/11/12
- [elpa] externals/jarchive 149f37507e 31/33: Separate Eglot patching process to be invoked manually by the user, ELPA Syncer, 2022/11/12
- [elpa] externals/jarchive d209394a47 08/33: Set a different buffer name that doesn't match the jarchive-regex, ELPA Syncer, 2022/11/12
- [elpa] externals/jarchive b226bfd66c 09/33: Helper functions for matching parts of the jar/file path, ELPA Syncer, 2022/11/12
- [elpa] externals/jarchive ec1da7f538 14/33: Allow user to relocate extracted files to the previous project., ELPA Syncer, 2022/11/12
- [elpa] externals/jarchive d8fa586e1c 21/33: Also work with "zipfile" scheme URIs from clojure-lsp, ELPA Syncer, 2022/11/12
- [elpa] externals/jarchive 72465b705a 30/33: Address checkdoc feedback, ELPA Syncer, 2022/11/12