Fork me on GitHub
#emacs
<
2019-07-04
>
Eccentric J04: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?

Eccentric J13: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.

Eccentric J16: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.

Eccentric J16: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?

Eccentric J16:07:45

I may have been on an older emacs-mac install

Eccentric J16:07:36

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

Eccentric J16: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

Eccentric J17:07:41

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

Eccentric J16:07:45

I may have been on an older emacs-mac install

Eccentric J20: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.

Cora (she/her)20:07:17

have you tried doom emacs? a lot more stable than spacemacs in my experience, and the maintainer is usually on discord to take complaints and fix things really quickly

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.

Eccentric J21: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.

Eccentric J21: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'.

Eccentric J21:07:32

@corasaurus-hex 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

Cora (she/her)21:07:24

but master is so far behind develop, I found tons of packages broke

Eccentric J21: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.

Eccentric J21:07:12

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

[*]
indent_size=2