Fork me on GitHub
#emacs
<
2018-05-31
>
bozhidar02:05:54

Hmm, I think I finally remembering. πŸ˜„ Originally we had some setting to indent everything the same way, and I guess we renamed this at some point.

bozhidar02:05:13

`:always-align' - Follow the same rules as `lisp-mode'.  All
    args are vertically aligned with the first arg in case (A),
    and vertically aligned with the function name in case (B).
    For instance:
        (reduce merge
                some-coll)
        (reduce
         merge
         some-coll)

    `:always-indent' - All args are indented like a macro body.
        (reduce merge
          some-coll)
        (reduce
          merge
          some-coll)

    `:align-arguments' - Case (A) is indented like `lisp', and
    case (B) is indented like a macro body.
        (reduce merge
                some-coll)
        (reduce
          merge
          some-coll)"

bozhidar02:05:51

I now remember discussing this with @malabarba and our slight oversight of using keywords instead of symbols for the config values.

bozhidar02:05:48

The original config value was clojure-defun-style-default-indent - it made clojure-mode indent everything like defuns (`:always-ident`).

😎 1
j0ni13:05:27

I seem to recall this kicking off the "debate" πŸ˜› https://github.com/clojure-emacs/clojure-mode/issues/235

eggsyntax13:05:27

Unrelated: for quite a while, I've ben using @timothypratley’s method ( https://timothypratley.blogspot.com/2014/08/clojure-friendly-word-definitions-in.html ) for having emacs treat hyphenated words as single words (for purposes of eg forward-word). At some point in the past year, that stopped working reliably for me -- typically navigation by word will treat the first hyphen in a word as equivalent to a space, and the rest as part of the word. Has anyone else run across this issue? If so, have you been able to figure it out? I've made a number of attempts to track it down, so far without any success. describe-syntax does show hyphen as a word char, as it should.

jeff.terrell13:05:43

Weird. I haven't tried that method and haven't seen any behavior that sounds similar. I have been using SPC t c to toggle camel case motion quite a bit, though, and it's pretty convenient for camel cased names. (I've been doing Javascript instead of Clojure lately. 😱)

eggsyntax13:05:51

I'm sorry πŸ˜‰

eggsyntax13:05:22

Aside from the fact that it isn't working for me at the moment, it's a really nice improvement to have emacs treat hyphenated words as a single word; I recommend it. Note that if you decide to try it, you actually want to apply it to clojure-mode-syntax-table as described in the 1st comment on that blog post.

jeff.terrell13:05:26

When I'm doing clojure, I sometimes like the separate-words functionality. I can still jump over the whole word with e.g. W and B (i.e. whitespace-delimited word motions). I guess * could be an argument for considering the whole thing as a single word, but IIRC clojure-mode was smart enough to deal with * with whole-word semantics even if w and b used separate-word semantics.

eggsyntax13:05:22

Yeah, I keep a couple of other bindings for navigation by subwords, but I like the default to be treating "words" by Clojure's standards.

jeff.terrell13:05:13

(I just realized this was #emacs not #spacemacs. My comments assumed spacemacs, for anybody who might have been confused. simple_smile)

eggsyntax13:05:37

I could always rebind w to forward-WORD (ie W), but then that behaves incorrectly (relative to my preferences) with something like foo-bar]) baz

borkdude15:05:08

Is it possible to go back to your previous window layout, once you do C-x 1?

richiardiandrea15:05:46

@borkdude I use winner-undo for that exact purpose

richiardiandrea15:05:58

You can do-undo window layouts

eggsyntax16:05:53

@borkdude also you can just do toggle-maximize-buffer (at least in spacemacs), & then doing it again flips you back to the layout you had before.

borkdude16:05:11

cool, I use Prelude so winner was already installed

dpsutton16:05:14

I wrote a window manager that allows you to push and pop onto a stack of window configurations. Called resize-window

munen18:05:29

@borkdude Winner actually is bundled in Emacs, already^^

borkdude18:05:46

do you use β€œC-x 5 o” a lot? I use Cmd-` to switch windows in a lot of apps, maybe I should configure emacs like that

borkdude18:05:43

I think this should work:

(define-key global-map (kbd β€œs-`β€œ) ’other-frame)

borkdude18:05:46

but it doesn't

munen19:05:03

Personally, I never use C-x 5 o, because I run a tiling window manager, so jumping between frames it not something that I do within Emacs. I do use multiple open buffers within one frame a lot, though. And winner-mode within that. Btw, there's a shortcut for winner-undo. Here's my config for it: https://github.com/munen/emacs.d/#winner-mode

munen19:05:33

Regarding your shortcut: I'm not aware that just a character as a prefix is a viable shortcut.

munen15:06:05

That sounds about right. I was wrong about my assumption, then. Thanks for that info, @U0BANPG68!

munen15:06:42

It's an oversight on my part since I only have keybindings on Alt and Ctrl for Emacs. Super is for the WM. But it makes sense to have it available for Emacs combos, of course!

munen15:06:47

Thanks for clarifying^^

kliph15:06:32

No problem, happy to clear that up for you πŸ˜„

munen19:05:31

"Sequences consisting of C-c and a letter (either upper or lower case) are reserved for users"