Skip to content

Commit dd76488

Browse files
author
Torstein Krause Johansen
authored
Quick start conf work on clean Emacs (#255)
- the quick start is now self sufficient. A user can try out lsp-java just by copying and pasting the conf snippet and it will work without any other Emacs conf. - fixes error: if: Symbol’s value as variable is void: package-archives - fixes warnings about packages not being installed (in my case, this was which-key and helm-lsp), the 'use-package-always-ensure' removes the need for installing the packages prior to evaluating the quick start snippet. - tested on Emacs 28.0.50
1 parent 74418b8 commit dd76488

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,16 @@ Then add the following lines to your `.emacs` and open a file from the any of th
5353
### Quick start
5454
Minimal configuration with [company-capf](https://github.com/company-mode/company-mode) and [lsp-ui](https://github.com/emacs-lsp/lsp-ui) and [dap-mode](https://github.com/yyoncho/dap-mode/). Now you can explore the methods under `lsp-java-*`, `dap-java-*`, `dap-*`, and `lsp-*`
5555
```elisp
56-
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
57-
58-
(when (not (package-installed-p 'use-package))
59-
(package-refresh-contents)
60-
(package-install 'use-package))
56+
(condition-case nil
57+
(require 'use-package)
58+
(file-error
59+
(require 'package)
60+
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
61+
(package-initialize)
62+
(package-refresh-contents)
63+
(package-install 'use-package)
64+
(setq use-package-always-ensure t)
65+
(require 'use-package)))
6166
6267
(use-package projectile)
6368
(use-package flycheck)

0 commit comments

Comments
 (0)