14

A new derived mode is cheap: lisp-interaction-mode inherits from emacs-lisp-mode, its implementation is just a dozen lines of code or so. It differs from emacs-lisp-mode in just the following ways: it has a different name; it has a different keymap; it has a different syntax table; it has an additional hook. On the other hand, it shares its abbrev table ...


13

Unless you hate the C-j behaviour (and I'm sure most elisp authors find it handy), just keep things the way they are. Define your keys for lisp-mode-shared-map instead of duplicating them for the mode-specific keymaps. All of lisp-mode-map, emacs-lisp-mode-map, and lisp-interaction-mode-map have lisp-mode-shared-map as their parent keymap.


8

There are two ways Redefine lisp--match-hidden-arg: (defun lisp--match-hidden-arg (limit) nil) Remove lisp--match-hidden-arg from lisp-cl-font-lock-keywords-2 and lisp-el-font-lock-keywords-2 (setq lisp-el-font-lock-keywords-2 (cl-delete 'lisp--match-hidden-arg lisp-el-font-lock-keywords-2 :key #'car)) Please Do NOT Do That! The ...


4

FWIW, I use emacs-lisp-mode in the *scratch* buffer myself. If I wish to evaluate something, I just do C-x C-e, with a C-u prefix when needed. I see no downside to this practice. As to why the mode is there, it is just a few lines of lisp code in elisp-mode.el, and it's been there like forever, so removing it seems pointless.


3

In emacs-lisp-mode the fill-paragraph-function is set to lisp-fill-paragraph. There is a separate fill column used specifically for docstrings, seeemacs-lisp-docstring-fill-column. From the variable documentation, you can set emacs-lisp-docstring-fill-column to any non-integer value to make it use the current fill-column instead.


3

Here's how to do it with vanilla Emacs commands: C-SPC C-M-n M-w mark the list with a region and copy it to the kill ring. C-x o C-y switch to other window and paste. C-x o switch back to the original window. Here's how to evaluate an expression before point with geiser: C-x C-e calls geiser-eval-last-sexp. There's no need to use the REPL window at all ...


2

If you really do want to change it, it's Emacs, of course you can. Brutality In the extreme, one can always use M-x fundamental-mode to “turn off” all of the mode-specific goodies, but that's probably overkill here. Conformity The only thing in your code that seems to be particularly injured by indentation was the use of (if … (progn)) forms. (if … (...


2

The binding C-j runs the command eval-print-last-sexp. Use C-h k C-j to describe the key binding and see the documentation for the corresponding command. In that doc you'll see some relevant information: Normally, this function truncates long output according to the value of the variables ‘eval-expression-print-length’ and ‘eval-expression-print-level’...


2

TLDR (setq open-paren-in-column-0-is-defun-start nil) The docstring for indent-for-tab-command tells us it calls the function in variable indent-line-function. In emacs-lisp mode this is lisp-indent-line, defined in lisp-mode.el. We can see in the source code that it calls calculate-lisp-indent. M-x traceing these two functions, both with and without the ...


1

Why is Emacs so weird? Emacs indents lisp code as if it were Emacs Lisp, where if accepts unlimited else forms; unlike in Common Lisp, where if accepts at most 3 arguments. What to do? Tell Emacs to indent Lisp as if it were Common Lisp: (custom-set-variables '(lisp-indent-function 'common-lisp-indent-function)) (autoload 'common-lisp-indent-function "...


1

C-h f mark-whole-buffer tells us that the function is defined in simple.el. If you click on the link in the help buffer to simple.el, it takes you right to the definition of the function.


1

There are two other methods of interacting with Common Lisp, besides SLIME. Although they both use SLIME as a back end. Org mode To make org-babel understand CL, you need to add this to your config (after you've configured SLIME): (require 'ob-lisp) (org-babel-do-load-languages 'org-babel-load-languages '((lisp . t))) Here's an example Org content: * ...


Only top voted, non community-wiki answers of a minimum length are eligible