Fork me on GitHub
#emacs
<
2019-07-04
>
jaide04:07:14

Hi there, for some reason the alignment in lisp languages feels off. Multiline expressions are indented by 1 character. For example:

(local initial-state
  {:state :idle
    :menu nil
    :page active
    :really-long-key 'hello-there})
Is that normal\expeced?

jaide13:07:47

Oh that style guide is great. Thanks! After playing around it seems specific to fennel-mode which is another lisp language. My solution is to use clojure mode instead.

jaide16:07:27

Actually I see that behavior on elisp mode too:

(add '(1
        2
        3
        4)

dpsutton16:07:00

it works correctly for me

(add '(1
       2
       3
       4))

dpsutton16:07:18

which is frustrating to hear but i think it means you've got some setting somewhere.

jaide16:07:29

Oof ok, I had nuked my .spacemacs file earlier but it didn’t fix the issue. I’ll try nuking all of it and doing a fresh install.

dpsutton16:07:43

try running emacs -Q just to make sure its not your version of emacs

dpsutton16:07:53

then grep for indent in your .spacemacs for possible candidates?

jaide16:07:45

I may have been on an older emacs-mac install

jaide16:07:36

Once I removed it and replaced it with the universal Emacs distro it was indenting correctly.

jaide16:07:39

The interesting thing is that clojure-mode indented correctly

dpsutton17:07:21

clojure mode sets up its own indentation rules that you can modify. Not sure what controls other lisp indentations

jaide17:07:41

Good to know. Thanks for the help, it was driving me insane!

jaide16:07:45

I may have been on an older emacs-mac install

jaide20:07:53

Argh! I was wrong again, it wasn’t due to emacs-mac. However I did try emacs -Q and found that it was indenting correctly. Removing and reinstalling spacemacs.

andy.fingerhut21:07:02

I don't know what other folks do, but for decades I have ingrained emacs C-x C-b, then find the buffer I want, and select it, and do this way more than is healthy for my left hand. Finally, finally, I have seen the light and started binding a single unmodified key to ace-jump-buffer from the ace-jump-mode package. Oh my, how I wish I had done this a long time ago.

jaide21:07:32

What does that binding give you?

andy.fingerhut21:07:07

I switch between buffers very frequently, and often not because of jumping to the definition of a function where the cursor is. ace-jump-buffer pops up a list of buffer names, each with a key before their name that, if typed, switches to that buffer (long lists of buffers have some with two-key sequences, but they prefer home row keys, and never have modifiers, and I believe most recently used buffers are always near the beginning of the list).

andy.fingerhut21:07:24

Binding ace-jump-buffer to an unmodified single key gives me much less pressing of the control key.

jaide21:07:52

Oh awesome! Thanks for breaking it down.

felipebarros06:07:16

What key have you chosen to bind ace-jump-buffer to @U0CMVHBL2?

felipebarros06:07:05

Just found this reading the avy-jump-buffer README and 🤯 https://github.com/waymondo/frog-jump-buffer

andy.fingerhut16:07:49

I would have normally bound it to an easily reachable function key like F1, but since I use Viper mode inside of Emacs, and the 's' key was already used to switch between buffers, I used 's'.

jaide21:07:32

@deleted-user I have not tried it, just stumbled upon it about an hour ago though. I’ll give it a shot 🙂 That said I just found the cause! It’s the spacemacs develop branch that is causing this issue for me. The indentation is correct on master. Anyway after a git bisect journey, this is the commit that introduced the issue: https://github.com/syl20bnr/spacemacs/commit/488fc0977f0e88aefab28cfe6ba30966fc4fcdbe

jaide21:07:14

That may be true, but I used git bisect to do a binary search through all the commits between develop and master. The behavior is correct in the commits before it and broken from that commit until the latest develop. However, it may just be my .editorconfig.

jaide21:07:12

Aha! It was caused by my .editorconfig because of:

[*]
indent_size=2