Coder Social home page Coder Social logo

emacs-for-clojure's Introduction

this is a Clojure-friendly emacs config

If you're new to emacs, check out this introductory tutorial!

Installing

  1. Close Emacs.
  2. Delete ~/.emacs or ~/.emacs.d if they exist. (Windows users, your emacs files will probably live in C:\Users\your_user_name\AppData\Roaming\. So, for example, you would delete C:\Users\jason\AppData\Roaming\.emacs.d.) This is where Emacs looks for configuration files, and deleting these files and directories will ensure that you start with a clean slate.
  3. Download the Emacs configuration zip file and unzip it. Its contents should be a folder, emacs-for-clojure-book1. Run mv path/to/emacs-for-clojure-book1 ~/.emacs.d.

Then open Emacs. The first time you start, it will take a few minutes, because it needs to download and install around fifty packages. You will see some warnings pop up, but they are only style suggestions for the packages being loaded.

Prerequisites

Since you're working in Clojure, we assume you have it and its prerequisites installed (see this guide for those instructions). Additionally, you're likely to want to have Leiningen installed, since many many projects use it for running builds, tests, and tasks.

To support specific features of this emacs configuration, there are three more prerequisites:

  1. git is the dominant system for source code version control. There's a good chance it came installed with your operating system of choice, but in case it didn't, you'll want it!
  2. clojure-lsp enables Find References, live linting, and many more features.
  3. To get nice icons in your modeline, you need the fonts installed. After startup the first time, run M-x all-the-icons-install-fonts. You will only need to do this once.

A Word About Project-Wide Search

One of the capabilities that comes in very handy is searching for some text across all the files within your project. You can use git for that with the following command: M-x counsel-git-grep. This works just fine, with the caveat that it must be in a directory version-controlled with git. There are quite a few alternative search utilities, but you'll have to install them separately. In practice, you'll probably settle on one you like and use it exclusively. Here are the links, along with the emacs command to invoke each:

Features

This will allow you to edit Clojure files with syntax-aware highlighting and structural editing via paredit, which means it will keep all your delimiters for nested forms balanced (think parens, square brackets, and curly braces). Check out this animated guide to paredit. It's one of those things that seems strange at first, but once you get used to it, you won't want to edit Clojure without it!

Other excellent capabilities you'll want to know about include:

  • CIDER, a fully interactive Clojure environent
  • clojure-lsp, provides static analysis features for Clojure, such as live style and syntax warnings
  • Projectile, navigate and manage project files
  • Magit, a complete interface to git
  • Treemacs, a tree layout file explorer

Upgrading

Each package we use gets updated by its authors, at whatever cadence works for them. It's a good idea to stay up-to-date, to get improvements and bug fixes. It's analogous to keeping the software up-to-date in your operating system.

When you run M-x list-packages it refreshes the cache of all the package repositories, and then tells you in the status line whether there are any updates to install. Press U to mark all upgradeable packages for installation, and then press x to execute the installation. You will be prompted to confirm, and when you press y the package updates will be installed. Press q to exit the package list when it's finished.

If you ever get curious to look, you can find all the installed packages in ~/.emacs.d/elpa.

Organization

I've tried to separate everything logically and document the purpose of every line. init.el acts as a kind of table of contents. It's a good idea to eventually go through init.el and the files under the customizations directory so that you know exactly what's going on.

Supporting CSS, HTML, JS, etc.

Emacs has decent support for CSS, HTML, JS, and many other file types out of the box, but if you want better support, then have a look at my personal emacs config's init.el. It's meant to read as a table of contents. The emacs.d as a whole adds the following:

  • Customizes js-mode and html editing
    • Sets indentation level to 2 spaces for JS
    • enables subword-mode so that M-f and M-b break on capitalization changes
    • Uses tagedit to give you paredit-like functionality when editing html
    • adds support for coffee mode
  • Uses enh-ruby-mode for ruby editing. enh-ruby-mode is a little nicer than the built-in ruby-mode, in my opinion.
    • Associates many filenames and extensions with enh-ruby-mode (.rb, .rake, Rakefile, etc)
    • Adds keybindings for running specs
  • Adds support for YAML and SCSS using the yaml-mode and scss-mode packages

In general, if you want to add support for a language then you should be able to find good instructions for it through Google. Most of the time, you'll just need to install the "x-lang-mode" package for it.

emacs-for-clojure's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emacs-for-clojure's Issues

cider-repl.el isn't loaded

When I hit C-c M-n to switch to the buffer's namespace, I got the error Symbol's function definition is void: cider-repl-set-ns. I was able to fix this by manually loading elpa/cider-0.3.1/cider-repl.el. Apparently it doesn't get loaded automatically.

Emacs 24.5.1 unable to install cider from init.el in archive/book1.zip

I built a 25MB version of emacs 24.5.1 from source on crouton (ubuntu xenial hosted on a Chromebook) using the following configuration

./configure --with-xml2 --with-zlib --without-x --without-sound --without-xpm \
  --without-jpeg --without-tiff --without-gif --without-png --without-rsvg \
  --without-imagemagick --without-xft --without-libotf --without-m17n-flt \
  --without-xaw3d --without-toolkit-scroll-bars --without-gpm --without-dbus \
  --without-gconf --without-gsettings --without-makeinfo \
  --without-compress-install

When I downloaded https://github.com/flyingmachine/emacs-for-clojure/archive/book1.zip and unzipped it and moved it to ~/.emacs.d and restared emacs, I got

Warning (emacs): Unable to activate package `ghub'.
Required package `let-alist-1.0.5' is unavailable
Warning (emacs): Unable to activate package `magit'.
Required package `let-alist-1.0.5' is unavailable
Warning (emacs): Unable to activate package `ghub'.
Required package `let-alist-1.0.5' is unavailable
Warning (emacs): Unable to activate package `cider'.
Required package `seq-2.16' is unavailable
Warning (emacs): Unable to activate package `ghub'.
Required package `let-alist-1.0.5' is unavailable
Warning (emacs): Unable to activate package `magit'.
Required package `let-alist-1.0.5' is unavailable
Warning (emacs): Unable to activate package `ghub'.
Required package `let-alist-1.0.5' is unavailable
Warning (emacs): Unable to activate package `cider'.
Required package `seq-2.16' is unavailable

So I use M-x package-install-file RET both the packages let-alist-1.05 and seq-2.16 by downloading from GNU ELPA and get this

Debugger entered--Lisp error: (file-error "Cannot open load file" "No such file or directory" "cl-generic")
  require(cl-generic)
  eval-buffer(#<buffer  *load*-355370> nil "/home/chronos/.emacs.d/elpa/sesman-20180903.1826/sesman.el" nil t)  ; Reading at buffer position 1534
  load-with-code-conversion("/home/chronos/.emacs.d/elpa/sesman-20180903.1826/sesman.el" "/home/chronos/.emacs.d/elpa/sesman-20180903.1826/sesman.el" nil t)
  require(sesman)
  (lambda nil (define-key clojure-mode-map (kbd "C-c M-x") (function cider)) (define-key clojure-mode-map (kbd "C-c M-j") (function cider-jack-in-clj)) (define-key clojure-mode-map (kbd "C-c M-J") (function cider-jack-in-cljs)) (define-key clojure-mode-map (kbd "C-c M-c") (function cider-connect-clj)) (define-key clojure-mode-map (kbd "C-c M-C") (function cider-connect-cljs)) (define-key clojure-mode-map (kbd "C-c C-x") (quote cider-start-map)) (define-key clojure-mode-map (kbd "C-c C-s") (quote sesman-map)) (require (quote sesman)) (sesman-install-menu clojure-mode-map) (add-hook (quote clojure-mode-hook) (function (lambda nil (set (make-local-variable (quote sesman-system)) (quote CIDER))))))()
  eval-after-load-helper("/home/chronos/.emacs.d/elpa/clojure-mode-20180827.1827/clojure-mode.el")
  run-hook-with-args(eval-after-load-helper "/home/chronos/.emacs.d/elpa/clojure-mode-20180827.1827/clojure-mode.el")
  do-after-load-evaluation("/home/chronos/.emacs.d/elpa/clojure-mode-20180827.1827/clojure-mode.el")
  load-with-code-conversion("/home/chronos/.emacs.d/elpa/clojure-mode-20180827.1827/clojure-mode.el" "/home/chronos/.emacs.d/elpa/clojure-mode-20180827.1827/clojure-mode.el" nil t)
  require(clojure-mode)
  eval-buffer(#<buffer  *load*-532285> nil "/home/chronos/.emacs.d/elpa/clojure-mode-extra-font-locking-20180114.1711/clojure-mode-extra-font-locking.el" nil t)  ; Reading at buffer position 1255
  load-with-code-conversion("/home/chronos/.emacs.d/elpa/clojure-mode-extra-font-locking-20180114.1711/clojure-mode-extra-font-locking.el" "/home/chronos/.emacs.d/elpa/clojure-mode-extra-font-locking-20180114.1711/clojure-mode-extra-font-locking.el" nil t)
  require(clojure-mode-extra-font-locking)
  eval-buffer(#<buffer  *load*-486538> nil "/home/chronos/.emacs.d/customizations/setup-clojure.el" nil t)  ; Reading at buffer position 334
  load-with-code-conversion("/home/chronos/.emacs.d/customizations/setup-clojure.el" "/home/chronos/.emacs.d/customizations/setup-clojure.el" nil nil)
  load("setup-clojure.el")
  eval-buffer(#<buffer  *load*> nil "/home/chronos/.emacs.d/init.el" nil t)  ; Reading at buffer position 4188
  load-with-code-conversion("/home/chronos/.emacs.d/init.el" "/home/chronos/.emacs.d/init.el" t t)
  load("/home/chronos/.emacs.d/init" t t)
  #[0 "�\205\262	\306=\203�\307�\310Q\202;	\311=\204�\307�\312Q\202;\313\307\314\315#\203*\316\202;\313\307\314\317#\203:\320\nB�\321\202;\316\322�\323�\322\211#\210�\322=\203a\324\325\326\307�\327Q!\"\323�\322\211#\210�\322=\203`��\210�\203\243\330�!\331\232\203\243\332�!\211\333P\334�!\203}\211\202\210\334�!\203\207�\202\210\314\262��\203\241\335��\"\203\237\336\337��#\210\340\341!\210��\266�\f?\205\260\314�\323\342\322\211#)\262�\207" [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos "~" "/_emacs" windows-nt "/.emacs" directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "^_emacs\\(\\.elc?\\)?$" (initialization "`_emacs' init file is deprecated, please use `.emacs'") "~/_emacs" t load expand-file-name "init" file-name-as-directory "/.emacs.d" file-name-extension "elc" file-name-sans-extension ".el" file-exists-p file-newer-than-file-p message "Warning: %s is newer than %s" sit-for 1 "default"] 7 "\n\n(fn)"]()
  command-line()
  normal-top-level()

So I manually downloaded cl-generic from GNU ELPA and installed it, then I got this

Debugger entered--Lisp error: (file-error "Cannot open load file" "No such file or directory" "seq-24")
  require(seq-24)
  byte-code("\301�\302\"\203�\303\304!\210\202�\303\305!\210\306\307!\207" [emacs-version version< "25" require seq-24 seq-25 provide seq] 3)
  require(seq)
  eval-buffer(#<buffer  *load*-924396> nil "/home/chronos/.emacs.d/elpa/sesman-20180903.1826/sesman.el" nil t)  ; Reading at buffer position 1549
  load-with-code-conversion("/home/chronos/.emacs.d/elpa/sesman-20180903.1826/sesman.el" "/home/chronos/.emacs.d/elpa/sesman-20180903.1826/sesman.el" nil t)
  require(sesman)
  (lambda nil (define-key clojure-mode-map (kbd "C-c M-x") (function cider)) (define-key clojure-mode-map (kbd "C-c M-j") (function cider-jack-in-clj)) (define-key clojure-mode-map (kbd "C-c M-J") (function cider-jack-in-cljs)) (define-key clojure-mode-map (kbd "C-c M-c") (function cider-connect-clj)) (define-key clojure-mode-map (kbd "C-c M-C") (function cider-connect-cljs)) (define-key clojure-mode-map (kbd "C-c C-x") (quote cider-start-map)) (define-key clojure-mode-map (kbd "C-c C-s") (quote sesman-map)) (require (quote sesman)) (sesman-install-menu clojure-mode-map) (add-hook (quote clojure-mode-hook) (function (lambda nil (set (make-local-variable (quote sesman-system)) (quote CIDER))))))()
  eval-after-load-helper("/home/chronos/.emacs.d/elpa/clojure-mode-20180827.1827/clojure-mode.el")
  run-hook-with-args(eval-after-load-helper "/home/chronos/.emacs.d/elpa/clojure-mode-20180827.1827/clojure-mode.el")
  do-after-load-evaluation("/home/chronos/.emacs.d/elpa/clojure-mode-20180827.1827/clojure-mode.el")
  load-with-code-conversion("/home/chronos/.emacs.d/elpa/clojure-mode-20180827.1827/clojure-mode.el" "/home/chronos/.emacs.d/elpa/clojure-mode-20180827.1827/clojure-mode.el" nil t)
  require(clojure-mode)
  eval-buffer(#<buffer  *load*-650305> nil "/home/chronos/.emacs.d/elpa/clojure-mode-extra-font-locking-20180114.1711/clojure-mode-extra-font-locking.el" nil t)  ; Reading at buffer position 1255
  load-with-code-conversion("/home/chronos/.emacs.d/elpa/clojure-mode-extra-font-locking-20180114.1711/clojure-mode-extra-font-locking.el" "/home/chronos/.emacs.d/elpa/clojure-mode-extra-font-locking-20180114.1711/clojure-mode-extra-font-locking.el" nil t)
  require(clojure-mode-extra-font-locking)
  eval-buffer(#<buffer  *load*-925506> nil "/home/chronos/.emacs.d/customizations/setup-clojure.el" nil t)  ; Reading at buffer position 334
  load-with-code-conversion("/home/chronos/.emacs.d/customizations/setup-clojure.el" "/home/chronos/.emacs.d/customizations/setup-clojure.el" nil nil)
  load("setup-clojure.el")
  eval-buffer(#<buffer  *load*> nil "/home/chronos/.emacs.d/init.el" nil t)  ; Reading at buffer position 4188
  load-with-code-conversion("/home/chronos/.emacs.d/init.el" "/home/chronos/.emacs.d/init.el" t t)
  load("/home/chronos/.emacs.d/init" t t)
  #[0 "�\205\262	\306=\203�\307�\310Q\202;	\311=\204�\307�\312Q\202;\313\307\314\315#\203*\316\202;\313\307\314\317#\203:\320\nB�\321\202;\316\322�\323�\322\211#\210�\322=\203a\324\325\326\307�\327Q!\"\323�\322\211#\210�\322=\203`��\210�\203\243\330�!\331\232\203\243\332�!\211\333P\334�!\203}\211\202\210\334�!\203\207�\202\210\314\262��\203\241\335��\"\203\237\336\337��#\210\340\341!\210��\266�\f?\205\260\314�\323\342\322\211#)\262�\207" [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos "~" "/_emacs" windows-nt "/.emacs" directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "^_emacs\\(\\.elc?\\)?$" (initialization "`_emacs' init file is deprecated, please use `.emacs'") "~/_emacs" t load expand-file-name "init" file-name-as-directory "/.emacs.d" file-name-extension "elc" file-name-sans-extension ".el" file-exists-p file-newer-than-file-p message "Warning: %s is newer than %s" sit-for 1 "default"] 7 "\n\n(fn)"]()
  command-line()
  normal-top-level()

Next I tried to manually install seq-24, but it gave an error saying 'Package or Package Version header not found, so I copied the seq-24.el into the ~/.emacs.d/elpa/seq-2.16 and got this

Debugger entered--Lisp error: (wrong-number-of-arguments #[(method args &optional doc-string) "\302\303�D\304\303�D	EE\207" [method doc-string eieio--defalias quote eieio--defgeneric-init-form] 5 ("/usr/local/share/emacs/24.5/lisp/emacs-lisp/eieio.elc" . 4373)] 4)
  #[(method args &optional doc-string) "\302\303�D\304\303�D	EE\207" [method doc-string eieio--defalias quote eieio--defgeneric-init-form] 5 ("/usr/local/share/emacs/24.5/lisp/emacs-lisp/eieio.elc" . 4373)](sesman-restart-session (system session) "Restart SYSTEM SESSION.\nBy default, calls `sesman-quit-session' and then\n`sesman-start-session'." (let ((old-name (car session))) (sesman-quit-session system session) (let ((new-session (sesman-start-session system))) (setcar new-session old-name))))
  (cl-defgeneric sesman-restart-session (system session) "Restart SYSTEM SESSION.\nBy default, calls `sesman-quit-session' and then\n`sesman-start-session'." (let ((old-name (car session))) (sesman-quit-session system session) (let ((new-session (sesman-start-session system))) (setcar new-session old-name))))
  eval-buffer(#<buffer  *load*-445805> nil "/home/chronos/.emacs.d/elpa/sesman-20180903.1826/sesman.el" nil t)  ; Reading at buffer position 19369
  load-with-code-conversion("/home/chronos/.emacs.d/elpa/sesman-20180903.1826/sesman.el" "/home/chronos/.emacs.d/elpa/sesman-20180903.1826/sesman.el" nil t)
  require(sesman)
  (lambda nil (define-key clojure-mode-map (kbd "C-c M-x") (function cider)) (define-key clojure-mode-map (kbd "C-c M-j") (function cider-jack-in-clj)) (define-key clojure-mode-map (kbd "C-c M-J") (function cider-jack-in-cljs)) (define-key clojure-mode-map (kbd "C-c M-c") (function cider-connect-clj)) (define-key clojure-mode-map (kbd "C-c M-C") (function cider-connect-cljs)) (define-key clojure-mode-map (kbd "C-c C-x") (quote cider-start-map)) (define-key clojure-mode-map (kbd "C-c C-s") (quote sesman-map)) (require (quote sesman)) (sesman-install-menu clojure-mode-map) (add-hook (quote clojure-mode-hook) (function (lambda nil (set (make-local-variable (quote sesman-system)) (quote CIDER))))))()
  eval-after-load-helper("/home/chronos/.emacs.d/elpa/clojure-mode-20180827.1827/clojure-mode.el")
  run-hook-with-args(eval-after-load-helper "/home/chronos/.emacs.d/elpa/clojure-mode-20180827.1827/clojure-mode.el")
  do-after-load-evaluation("/home/chronos/.emacs.d/elpa/clojure-mode-20180827.1827/clojure-mode.el")
  load-with-code-conversion("/home/chronos/.emacs.d/elpa/clojure-mode-20180827.1827/clojure-mode.el" "/home/chronos/.emacs.d/elpa/clojure-mode-20180827.1827/clojure-mode.el" nil t)
  require(clojure-mode)
  eval-buffer(#<buffer  *load*-797756> nil "/home/chronos/.emacs.d/elpa/clojure-mode-extra-font-locking-20180114.1711/clojure-mode-extra-font-locking.el" nil t)  ; Reading at buffer position 1255
  load-with-code-conversion("/home/chronos/.emacs.d/elpa/clojure-mode-extra-font-locking-20180114.1711/clojure-mode-extra-font-locking.el" "/home/chronos/.emacs.d/elpa/clojure-mode-extra-font-locking-20180114.1711/clojure-mode-extra-font-locking.el" nil t)
  require(clojure-mode-extra-font-locking)
  eval-buffer(#<buffer  *load*-951326> nil "/home/chronos/.emacs.d/customizations/setup-clojure.el" nil t)  ; Reading at buffer position 334
  load-with-code-conversion("/home/chronos/.emacs.d/customizations/setup-clojure.el" "/home/chronos/.emacs.d/customizations/setup-clojure.el" nil nil)
  load("setup-clojure.el")
  eval-buffer(#<buffer  *load*> nil "/home/chronos/.emacs.d/init.el" nil t)  ; Reading at buffer position 4188
  load-with-code-conversion("/home/chronos/.emacs.d/init.el" "/home/chronos/.emacs.d/init.el" t t)
  load("/home/chronos/.emacs.d/init" t t)
  #[0 "�\205\262	\306=\203�\307�\310Q\202;	\311=\204�\307�\312Q\202;\313\307\314\315#\203*\316\202;\313\307\314\317#\203:\320\nB�\321\202;\316\322�\323�\322\211#\210�\322=\203a\324\325\326\307�\327Q!\"\323�\322\211#\210�\322=\203`��\210�\203\243\330�!\331\232\203\243\332�!\211\333P\334�!\203}\211\202\210\334�!\203\207�\202\210\314\262��\203\241\335��\"\203\237\336\337��#\210\340\341!\210��\266�\f?\205\260\314�\323\342\322\211#)\262�\207" [init-file-user system-type delayed-warnings-list user-init-file inhibit-default-init inhibit-startup-screen ms-dos "~" "/_emacs" windows-nt "/.emacs" directory-files nil "^\\.emacs\\(\\.elc?\\)?$" "~/.emacs" "^_emacs\\(\\.elc?\\)?$" (initialization "`_emacs' init file is deprecated, please use `.emacs'") "~/_emacs" t load expand-file-name "init" file-name-as-directory "/.emacs.d" file-name-extension "elc" file-name-sans-extension ".el" file-exists-p file-newer-than-file-p message "Warning: %s is newer than %s" sit-for 1 "default"] 7 "\n\n(fn)"]()
  command-line()
  normal-top-level()

At this point, in spite of my determination to make it work, my knowledge in trying to rectify this situation is limited (even though I have done it with Python, C++ or Java). Would love some help.

Is there maybe an older version of book1.zip that works with Emacs 24.5.1 ? - seems like the book mentions that version in https://www.braveclojure.com/basic-emacs/ , so you must have tested it on Emacs 24.x

http://melpa.milkbox.net/packages/ is no longer available

Hi there. Thank you very much for providing this configuration, it was a great way to get me started!

It seems that the URL for the MELPA packages changed, http://melpa.milkbox.net/packages/ is no longer working.
The official MELPA guide suggests using https://melpa.org/packages/ instead.

M-x package-install RET geiser RET

Hi, I was trying to use this emacs setting also to learn scheme with guile, I know it's probably out of scope here, but as to install geiser as repl it's advised just get it from ELPA I just noted that your init.el has the following lines commented so I was wondering if is there any expected issue I should get into consideration when I did it.

14 ;; (setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
15 ;; ("marmalade" . "http://marmalade-repo.org/packages/")
16 ;; ("melpa" . "http://melpa-stable.milkbox.net/packag

I'd appreciate your help on this.
Txe

~/.emacs.d/elpa outdated as of 2023 Sept 10

I downloaded the setup recommended here for ~/.emacs.d, however I could not get a CIDER nREPL up and running with Emacs 29.1 -- kept getting an error that said Package cl is deprecated.

I opened this issue clojure-emacs/cider#3459 and it turns out the problem is the ~/.emacs.d/elpa directory. It seems this directory is out of date. After deleting this directory and restarting Emacs, the CIDER nREPL worked.

First time launch error on Fedora 20 (x86_64; with latest updates)

On a Fedora 20 host, I installed emacs like this:

$ yum -y install "emacs*"

Then I cloned this repo (emacs-for-clojure) into ~/.emacs.d per instructions on the blog:
http://www.braveclojure.com/basic-emacs/

I saw the following error in a Compile-log window below the main window, though emacs launched fine:

/usr/share/emacs/site-lisp/site-start.d/slime.el:Error: Don't know how to compile nil
.emacs.d/elpa/ido-ubiquitous-0.7/ido-ubiquitous.elc:Warning: reference to free
    variable `ido-cur-item'
.emacs.d/elpa/ido-ubiquitous-0.7/ido-ubiquitous.elc:Warning: reference to free
    variable `ido-require-match'

I will try to attach the screenshot if possible.

"Symbol’s function definition is void: sesman-current-sessions"

Howdy! The current version of Cider seems to depend on the patch to sesman that was pushed six months ago, which introduced something called sesman-current-sessions. I was able to get around this by editing my copy of init.el to include

(add-to-list 'package-pinned-packages '(sesman . "melpa-stable") t)

(Also: would you consider adding a license to this repo? That would have let me send this as a PR 😁)

Getting these error messages whenever I start up emacs:

Warning (bytecomp) : reference to free variable 'predicate'
Warning (bytecomp) : reference to free variable 'inherit-input-method'
Warning (bytecomp) : reference to free variable 'ido-cur-item'
Warning (bytecomp) : reference to free variable 'ido-default-item'
Warning (bytecomp) : reference to free variable 'ido-cur-list'

I don't know why this is coming up, but I've traced it to this file:
C:\Users\User\AppData\Roaming.emacs.d\elpa\ido-ubiquitous-20140526.1306/ido-ubiquitous.elc

Make sure custom-set-variables and custom-set-faces are before Customizations

I very new to emacs but I just had a lot of trouble because custom-set-variables and custom-set-faces were run after the scripts in customizations.

For example, I tried to install emacs-color-theme-solarized and I put all commands listed under their install section into themes.el and simply could no make it work.

I also found this emacs config and they made customise put all it's directives into a extra file which seems to be a good idea.

Please excuse me if the stuff I'm telling is pure garbage ;) just wanted to share my problems and see if it helps.

Startup error on 24.4.1/Windows

I tried both the 24.4.1 chocolatey install emacs and the 24.4.1 binary distribution from the download page http://ftp.gnu.org/gnu/emacs/windows/.

Both start up well for the first time. When i then delete ~/.emacs.d and clone this repo to ~/.emacs.d, on start i get an error message. Running runemacs --init-debug yields:

image

So the problem seems to originate from the handling of the PATH-variable?

emacs version GNU Emacs 24.4.1 (i686-pc-mingw32) of 2014-10-24 on Win7.

Any ideas?

what about visiting `clojurescritpt` files...

Hi, I'm trying to gain literacy also with clojurescript & following this otherwise so wonderful emacs-for-clojure settings (and some other tutoriales) but whenever I visit a *.cljs file with Emacs I got the following warning:

[WARNING] Something in your configuration activated ‘clojure-mode’ instead of ‘clojurescript-mode’ in this buffer.
This could cause problems.
(See ‘clojure-verify-major-mode’ to disable this message.)

I'm not sure so just asking whether this has to do with the following below line and script & If so, does anyone know to tell how-to correct it? (it could seem some obvious but what I wanted to check is whether or not there is something else I had to do, namely install new Emacs packages or making additional corrections. I'd appreciate any help.

(add-to-list 'auto-mode-alist '("\\.cljs.*$" . clojure-mode))

hardcoded paths

I like to use chemacs2 to allow me to try out new emacs configs. However this config is incompatible due to hardcoded paths to ~/.emacs.d in these files:

  • init.el
  • customizations/ui.el
  • customizations/setup-clojure.el

Should be better to set it like this:
(expand-file-name "path" user-emacs-directory)

I notice that in editing.el you already do it like this which also works:
(concat user-emacs-directory "path")

Many thanks.

Error in init.el

I am running on windows 10.

I get this error when I launch emacs after copying the config files

Debugger entered--Lisp error: (file-error "Cannot open load file" "package")
  require(package)
  eval-buffer(#<buffer  *load*> nil "c:/Users/stefan/AppData/Roaming/.emacs.d/init.el" nil t)  ; Reading at buffer position 73
  load-with-code-conversion("c:/Users/stefan/AppData/Roaming/.emacs.d/init.el" "c:/Users/stefan/AppData/Roaming/.emacs.d/init.el" t t)
  load("c:/Users/stefan/AppData/Roaming/.emacs.d/init" t t)
  #[nil

Screenshot shows full error

image

Cannot load file "package"

I'm getting this error after installing moving the folder to ~/.emacs.d

Debugger entered--Lisp error: (file-error "Cannot open load file" "package")
require(package)
eval-buffer(#<buffer load> nil "/Users/xxx/.emacs.d/init.el" nil t) ; Reading at buffer position 73
load-with-code-conversion("/Users/xxx/.emacs.d/init.el" "/Users/xxx/.emacs.d/init.el" t t)
load("/Users/xxx/.emacs.d/init" t t)
#[nil "^blah...^$
command-line()
normal-top-level()

ido-ubiquitous-default-command-overrides

When starting Emacs 24.3.1 (i386-mingw-nt6.1.7601) of 2013-03-17 on MARVIN on Windows (Windows 7) I receive:

Warning (initialization): An error occurred while loading `c:/Users/BohmOn/.emacs.d/init.el':

Symbol's value as variable is void: ido-ubiquitous-default-command-overrides

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace.

Starting with the --debug-init option produces:

Debugger entered--Lisp error: (void-variable ido-ubiquitous-default-command-overrides)
  (defvar ido-ubiquitous-command-overrides ido-ubiquitous-default-command-overrides "List of command override specifications for ido-ubiquitous\n\nEach override specification describes how ido-ubiquitous should\nbehave one or many commands. A specification has the\nform `(BEHAVIOR MATCH-TYPE MATCH-TEXT)'. BEHAVIOR is one of the\nfollowing:\n\n  * `disable': ido-ubiquitous should not be used at all for the\n    specified commands;\n  * `enable': ido-ubiquitous may be used with the specified\n    commands, without emulating the old-style default selection\n    of `completing-read';\n  * `enable-old': ido-ubiquitous may be used with the specified\n    commands, and should emulate the old-style default selection\n    of `completing-read'.\n\nMATCH-TYPE affects how MATCH-TEXT is interpreted, as follows:\n\n  * `exact': the specification only affects the one command\n    whose name is MATCH-TEXT;\n  * `prefix': the specification affects any command whose name\n    starts with MATCH-TEXT (This is useful for specifying a\n    certain behavior for an entire package);\n  * `regexp': the specification affects any command whose name\n    matches MATCH-TEXT (with MATCH-TEXT being interpreted as a\n    regular expression)\n\nMATCH-TEXT should be a string.\n\nSince this variable's has a somewhat complex structure, it is\nrecommended that you set this variable through Customize.\n\nNote that this variable only affects *commands*, which are\nfunctions marked as interactive. See\n`ido-ubiquitous-function-overrides' for how to modify the\nbehavior of ido-ubiquitous for arbitrary functions.\n\nIf you need to add a new specification to this list, please also\nfile a bug report at https://github.com/DarwinAwardWinner/ido-ubiquitous/issues")
  eval-buffer(#<buffer  *load*-311224> nil "c:/Users/BohmOn/.emacs.d/elpa/ido-ubiquitous-2.0/ido-ubiquitous-autoloads.el" nil t)  ; Reading at buffer position 5285
  load-with-code-conversion("c:/Users/BohmOn/.emacs.d/elpa/ido-ubiquitous-2.0/ido-ubiquitous-autoloads.el" "c:/Users/BohmOn/.emacs.d/elpa/ido-ubiquitous-2.0/ido-ubiquitous-autoloads.el" nil t)
  load("c:/Users/BohmOn/.emacs.d/elpa/ido-ubiquitous-2.0/ido-ubiquitous-autoloads" nil t)
  package-activate-1(ido-ubiquitous [(2 0) nil "Use ido (nearly) everywhere."])
  package-activate(ido-ubiquitous (2 0))
  package-initialize()
  eval-buffer(#<buffer  *load*> nil "c:/Users/BohmOn/.emacs.d/init.el" nil t)  ; Reading at buffer position 229
  load-with-code-conversion("c:/Users/BohmOn/.emacs.d/init.el" "c:/Users/BohmOn/.emacs.d/init.el" t t)
  load("c:/Users/BohmOn/.emacs.d/init" t t)
  #[0 "�\205\262

It seems to be starter-kit's fault, because when I comment that out in the init.el the error disappears, though I didn't find any issue mentioning the ido-ubiquitous-default-command-overrides in starter-kit's repo.

My emacs version is 24.3.1 (i386-mingw-nt6.1.7601) of 2013-03-17 on MARVIN, system is Windows 7 (Professional, 64-bit).

{:user {:plugins [[cider/cider-nrepl "0.8.1"]]}}

Hi! Just wondering whether I got it right or not. There on your (very instructive) site it's advised to create a profile *.clj file before starting the flyingmachine emacs which should reads the following line; {:user {:plugins [[cider/cider-nrepl "0.8.1"]]}} but the current version of the cider-mode package file at melpa is 0.8.2. On other side, the version of the cider-mode package you ship hereby reads to be 0.7.0. Should I skip this?, maybe the script itself takes care of installing the currently available one package? (well, I'm probably a little puzzled with so wide band an range of info.. )
I'd appreciate any clue on this.
Txe.

Warning (initialization): An error occurred while loading ‘/Users/nsadeh/.emacs.d/init.el’:

I followed the instructions on the README and got the following error:

⛔ Warning (initialization): An error occurred while loading ‘/Users/nsadeh/.emacs.d/init.el’:

Symbol's function definition is void: global-linum-mode

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace.

information:
System: MBP 14" November 2023
OS: macOS Sonoma 14.1.2
Emacs 29.1
Date: December 6, 2023

Cannot run REPL via cider-jack-in after package upgrade

I downloaded the configuration zip file and did as instructed in the installation manual.
As I started Emacs, I ran the M-x package-list-packages and upgraded packages to the newer versions.
After the Emacs is restarted, REPL cannot be started anymore.
During Emacs startup there is a message saying Symbol's function definition is void: global-rainbow-delimiters-mode.
PR #17 seems to make this message go away, but the REPL still cannot be started.

The message which is reported, when I try to run M-x cider-jack-in is Symbol's function definition is void: nil.

The same issue occurs if I clone the repo and upgrade packages in Emacs.

Cider is out of data/requires cl

I installed Emacs 29.1 and ran this package as per the instructions. When I ran cider-jack-in I got the following error:

package cl is deprecated

I am aware this is just a warning, not an error, but the rest of the jack-in process was not able to complete.

I was able to resolve by deleting cider and re-installing it, so I am quite sure that upgrading the cider version in this emacs configuration will fix the issue for future users.

Note that I am an Emacs newb. I am being led to this repo through https://www.braveclojure.com/basic-emacs/, so I imagine many other newbs also come this way.

Error with Cider-Jack-In (clojure-project-dir)

I've been trying to get this running for days:

error: Symbol's function definition is void: clojure-project-dir

Running M-x cider-version gives "CIDER 0.15.1 (London)"

Running M-x clojure-mode-version gives "clojure-mode (version 3.1.0-snapshot)

Running java -version in terminal gives "java version "9.0.1""

Running lein -v in terminal gives "2.8.1 on Java 9.0.1 Java Hotspot(TM) 64-Bit Server VM"

Running emacs -version in terminal gives "GNU Emacs 25.2.1"

profiles.clj: "{:user {:plugins []}}"

"(add-to-list 'package-archives
'("melpa-stable" . "http://stable.melpa.org/packages/") t)

(add-to-list 'package-pinned-packages '(cider . "melpa-stable") t)" added after line 12.

Not sure what else to do here.

Repo clone discrepancy

EDIT: Immediately after I posted this issue I noticed that you had pushed another commit to the /elpa to fix the ido issue about 7 hours ago, explaining the error last night and why it worked when I tried cloning again today to reproduce the error.

I really should check the latest commits and closed issues before submitting new issues. I'm still getting the hang of github, I didn't notice the earlier, closed issue.

Thanks for making this repo extension, sorry to waste anybody's time. I suppose I'll leave this for posterity.


Hi there,

I had a bit of an issue with setting this up last night but I tried again today and it worked fine, without doing anything different.

Specifically: last night after I cloned the repo and fired up emacs again, the process made it about halfway through installing the extra packages before it stopped and threw an error along the lines of:

"Symbol's value as variable is void: ido-ubiquitous-default-command-overrides"

;;Sorry, I forgot to save the actual error or the debug backtrace I ran.

I checked the init.el and user.el and it didn't seem like you had made any obvious changes to the original files you forked that would cause this error, so I was really confused.

I tried cloning the repo again today to reproduce the error so I could contact you but it ended up working just fine.

I noticed that for some reason, last night's clone only received 43 objects vs. today's successful clone of 53 objects.

remote: Counting objects: 43, done.
remote: Compressing objects: 100% (28/28), done.
remote: Total 43 (delta 13), reused 41 (delta 11)
Unpacking objects: 100% (43/43), done.

versus:

remote: Counting objects: 53, done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 53 (delta 17), reused 50 (delta 14)
Unpacking objects: 100% (53/53), done.

So I'm guessing this might be better posed as a git issue than an issue specific to your repository.

I went and checked my .emacs.d/elpa and noticed that today I'm fairly certain that I received a different ido package (ido-ubiquitous-0.7).

I'm kind of new to emacs and git. I'm honestly really confused as to what happened. I realize this issue might be better suited for SO but I was hoping you could shed some light on it. If this is an inappropriate place to post this please let me know.

Thanks for your time,

Martin H

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.