From de5334b43f0d963cc13495a07c2ebcb1e1b94806 Mon Sep 17 00:00:00 2001 From: "Saulo S. de Toledo" Date: Mon, 6 Jul 2026 00:40:13 +0200 Subject: [PATCH] docs: add MELPA installation instructions --- README.org | 50 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/README.org b/README.org index 8000a51..f54ad51 100644 --- a/README.org +++ b/README.org @@ -74,25 +74,44 @@ of your configuration (for example in a =use-package :config= block) with buffer-local hook such as =java-mode-hook=. Use =-1= to disable. #+end_quote -*** Using ~use-package~ with a local clone +*** Installing via MELPA -Clone the repository to a local directory and point ~use-package~ at it: +This is the recommended method for installing this package. + +First, ensure you have the [[https://melpa.org/#/getting-started][MELPA repository]] configured in your Emacs. +If you haven't already, add this to your init file: + +#+begin_src elisp +(require 'package) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) +(package-initialize) +#+end_src + +Then install the package: + +#+begin_src elisp +M-x package-install RET jal RET +#+end_src + +JAL must be enabled to work. Here is a configuration example using +`use-package`: #+begin_src elisp (use-package jal - :load-path "/path/to/java-agent-loader" + :ensure t :custom (jal-auto-setup t) :config (jal-lsp-java-mode 1)) ; or (jal-eglot-java-mode 1) #+end_src -*** Using ~use-package~ with ~package-vc~ (Emacs 29+) +*** Using package-vc-install (Emacs 29+) -No clone needed: Emacs fetches the package directly from GitHub: +Emacs 29 and later can install packages directly from Git repositories. #+begin_src elisp (use-package jal + :ensure t :vc (:url "https://github.com/saulotoledo/java-agent-loader" :rev :newest) :custom (jal-auto-setup t) @@ -100,11 +119,32 @@ No clone needed: Emacs fetches the package directly from GitHub: (jal-lsp-java-mode 1)) ; or (jal-eglot-java-mode 1) #+end_src +You can later update all VC-installed packages with: + +#+begin_src elisp +(package-vc-update-all) +#+end_src + +*** Using ~use-package~ with a local clone + +Clone the repository to a local directory and point ~use-package~ at it: + +#+begin_src elisp +(use-package jal + :ensure t + :load-path "/path/to/java-agent-loader" + :custom + (jal-auto-setup t) + :config + (jal-lsp-java-mode 1)) ; or (jal-eglot-java-mode 1) +#+end_src + *** Using straight.el #+begin_src elisp (straight-use-package '(jal :type git :host github :repo "saulotoledo/java-agent-loader")) +(setq jal-auto-setup t) (jal-lsp-java-mode 1) ; or (jal-eglot-java-mode 1) #+end_src