1

When I write a backquotedlist that starts with ,( emacs aligns the remaining items to the parenthesis and not to the comma; e.g.:

(defun kb-test1 ()
  `(,(hello)
     fdefef
     ,(fefesd)))

(defparameter *kb-test2*
  `(,@(hello)
      ,@(gkere)
      ,@(lkdsf)))

I would expected it to be aligned as:

(defparameter *kb-test2*
  `(,@(hello)
    ,@(gkere)
    ,@(lkdsf)))

When the first term does not start with ,@( or ,(; e.g.:

(defparameter *kb-test2*
  `((hello)
    ,@(gkere)
    ,@(lkdsf)))

The indentation is as I expect.

I experimented with enabling and disable various modes, I removed my .emacs and .emacs.d and customized my emacs step by step. Using the following steps I could reproduce the indent behaviour:

  • Remove .emacs and .emacs.d
  • Plain emacs v.26.1
    Indents as expected
  • Add https://melpa.org/packages to package-archives
    Indents as expected
  • Install the package slime (version slime-20181106.1113)
  • Quit emacs
  • Start emacs
  • Visit a fresh file ~/tmp/test.lisp
    This shows lisp-mode and slime-mode are active (e.g. my status line is U:--- test.lisp All L1 (Lisp Slime))
  • type: (defun f()enter `(,@(hello) enter (In reality I did not type a space after the backquote).
  • Now point is at (3,6) (as shown by column-number-mode) aligned with the second parenthesis instead of at (3,4) aligned with ,.

Is this how lisp code ought to be aligned? Is this a bug in Lisp-mode or one of the other minor modes? Or is it a matter of personal taste?

Is this caused by slime-mode or does it have some other cause?

How can I correct it? Should I send a bug report?

  • 3
    Have you tried disabling each of these minor modes to tell which one is the culprit? –  Oct 25 '18 at 16:28
  • 2
    It works as expected for me in Emacs 27.0.50, in Lisp-mode without any other minor modes enabled. Try starting emacs as `emacs -Q` and then opening your example file. If the problem persists in that case, something in your personal configuration is causing the problem (maybe one or the minor modes you're using). – Tyler Oct 25 '18 at 19:51
  • I get the behavior you expect in Emacs 24.5 as well, with Lisp mode and no other minor modes (I've never heard of Lispy or Lispyville). – Gilles 'SO- stop being evil' Oct 25 '18 at 22:58
  • With `emacs -Q` the indendation is as I expect. So it must be in personal settings or in some minor mode. I will search for the config that causes it and edit my question. – Kasper van den Berg Oct 27 '18 at 13:52

1 Answers1

0

Control the indentation of backquoted lists via lisp-backquote-indentation