Fork me on GitHub
#emacs
<
2017-05-08
>
oskarkv03:05:44

Anyone using Evil mode? I'm looking for a package/mode that defines text objects for lisp forms.

pesterhazy07:05:24

What I end up using mostly is expand-region, which works well for this purpose

oskarkv10:05:55

@pesterhazy Do you use any paredit-like mode? I can't decide on which one seems best.

pesterhazy10:05:43

yeah there's almost too many

pesterhazy10:05:05

paredit, smartparens, lispy

pesterhazy10:05:18

Spacemacs comes with smartparens so I use that mostly

pesterhazy10:05:01

I most use slurp, barf, (un)wrap, splice-killing-backwards

pesterhazy10:05:51

i did a presentation on this, a recording of which was uploaded to youtube: https://www.youtube.com/watch?v=ubcERtDyLDw

oskarkv10:05:16

Can one wrap sexps too? I mean not just words.

pesterhazy10:05:47

the video is not focussed specifically on evil mode but touches on vim keybindings occasionally

oskarkv10:05:07

I am new to emacs, lost count of how many days I have already spent trying to learn and configure emacs.

oskarkv10:05:13

It's like 10. 😛

pesterhazy10:05:32

haha. Well it's the beginning of the rest of your life, so time well spent

oskarkv10:05:15

Something like paredit is like the last thing I need. But I fear I will have to do a lot of configuration to make it work nicely in evil.

oskarkv10:05:34

I mean, the last thing before I'm done.

oskarkv10:05:59

Not the last thing as in I don't need it. 😛

pesterhazy10:05:01

yeah, using evil+structural editing is a real gap currently

pesterhazy10:05:39

I'd encourage you to just use one or two commands (perhaps even with M-x so you don't have to remember the keybindings)

oskarkv10:05:12

That doesn't sound like me. 😛

pesterhazy10:05:12

then when you get comfortable set your own keybindings (if you're not using spacemacs)

oskarkv10:05:10

Thanks! I'm gonna watch the video, then dive right in I think.

pesterhazy10:05:18

here's what I use for navigation

(evil-global-set-key 'normal ";" 'mark-sexp)
  (evil-global-set-key 'visual ";" 'mark-sexp)
  (evil-global-set-key 'normal "U" 'backward-up-list)
  (evil-global-set-key 'visual "U" 'backward-up-list)
  (evil-global-set-key 'normal "R" 'down-list)
  (evil-global-set-key 'visual "R" 'down-list)
  (evil-global-set-key 'normal "L" 'sp-forward-sexp)
  (evil-global-set-key 'visual "L" 'sp-forward-sexp)
  (evil-global-set-key 'normal "H" 'sp-backward-sexp)
  (evil-global-set-key 'visual "H" 'sp-backward-sexp)

pesterhazy10:05:51

actually I'm using a wild mix of different paredit-like modes 🙂

pesterhazy10:05:57

lispy-clone is really useful IMO

oskarkv10:05:52

What is that? It copies lines?

oskarkv10:05:35

I plan on rebinding like ( ), which are for moving sentence-wise normally.

pesterhazy10:05:01

clone creates a duplicate of the current form

oskarkv10:05:06

But overwriting evil is a little bit involved.

pesterhazy10:05:20

I use it all the time to work on a new defn

oskarkv10:05:01

Hm. I guess yap p does that too? 😛

oskarkv10:05:02

I use yap/dap all the time 😛

pesterhazy10:05:24

yeah that's pretty similar

oskarkv10:05:42

But it doesn't work if there are blank lines. But I just created a text object in evil for "forms", any sexp delimited by () [] {}

oskarkv10:05:52

So then it would be yaf 😛

oskarkv10:05:57

By the way, I looked at all the smartparens functions in emacs. And there doesn't seem to be anything for "wrap word" or "wrap sexp".

oskarkv10:05:40

@pesterhazy What functions do you use to wrap lists and words?

pesterhazy11:05:13

I use something called evil-lisp-state-wrap

pesterhazy11:05:34

which ships with spacemacs but may be a separate package

pesterhazy11:05:10

smartparens docs are not very user-friendly unfortunately

oskarkv11:05:40

I wish they would list all editing commands somewhere... But I haven't found such a list

pesterhazy11:05:49

I don't know why they make things so complicated

pesterhazy11:05:29

there's also a couple of attempts to make things better for evil users (evil-cleverparens, lispyville)

pesterhazy11:05:53

I use lispyville just for rebinding dd etc to be parenthesis-safe, a very important feature

oskarkv11:05:21

I haven't read that page about wrapping yet (watching vid), but I tried to look for commands starting with "sp-" and that have "wrap", and I couldn't figure out how to wrap words and lists 😛

pesterhazy11:05:03

right, same here

pesterhazy17:05:52

I have /Users/me/.emacs.d/elpa/dumb-jump-20161218.110 but want to try a version of dumb-jump from git. What's the normal way to do that?

pesterhazy17:05:13

in Spacemacs, if that matters

dotemacs17:05:07

@pesterhazy do you mind restarting emacs or not ?

dotemacs17:05:41

if you don’t mind: uninstall dumb-jump. Use quelpa to install the latest version from git master: https://github.com/quelpa/quelpa

dotemacs17:05:09

The reason I say ‘restart emacs’ is because most of the functionality is already loaded into Emacs and by doing it the way I described above, you avoid any potential clashes with the already loaded functions and the new ones

pesterhazy18:05:11

I'm ok with restarting :)

richiardiandrea19:05:17

oh didn't know about quelpa, cool stuff!

cmack19:05:44

I use standard melpa and it appears to have the latest git version

uvtc20:05:34

Not sure if this is the place to post this, but just installed inf-clojure, and got these warnings: https://gist.github.com/uvtc/e39b3190870ad415cb4e97d41d7e78f5

richiardiandrea20:05:04

@uvtc I think they are worth an issue

richiardiandrea20:05:23

just make sure you have clojure-mode installed

uvtc20:05:51

Thanks. Yes, I (must) have clojure-mode installed...

richiardiandrea20:05:27

the first warning is innocuous I guess, but the second is weird and needs fixing probably

uvtc20:05:38

How can I see which version of clojure-mode I've got installed?

uvtc20:05:56

Hm. Looking in ~/.emacs.d/elpa, the directory is named clojure-mode-20141101.1. But... 2014? Hm...

uvtc20:05:56

Ah. M-x clojure-mode-display-version.

richiardiandrea21:05:26

@uvtc I'll have a look at that issue, thanks for reporting

adamfrey21:05:29

does anyone know which Emacs command/function adds the prompt “Lisp expression: ” to the mini-buffer? Something in my set up seems to be triggering this prompt frequently (once a minute or so) and I haven’t been able to track it down yet.

dpsutton21:05:14

is eval-expression

dpsutton21:05:35

there was a bug in CIDER recently on jack-in (?) maybe that triggered this

dpsutton21:05:02

ah but the function getting called is read somewhere

adamfrey21:05:03

I’ve seen that, but the prompt that eval-expression shows is Eval:

adamfrey21:05:15

instead of Lisp expression:

dpsutton21:05:31

eval (read) in a scratch buffer

adamfrey21:05:04

yes thank you.

adamfrey21:05:34

So, I’m not using Cider, I switched to inf-clojure, and that was close to when I started seeing this happen

dpsutton21:05:25

i don't see any usages of read in inf-clojure though

dpsutton21:05:04

well then, i will never use github's search again

dpsutton21:05:16

yeah i would dig around in those and see which one could be nil

dpsutton21:05:25

(read nil) asks for the input from the minibuffer

adamfrey21:05:56

ahh that’s it. There’s only three or so, I’ll check them out

adamfrey21:05:00

thanks so much!

adamfrey21:05:45

for posterity and anyone who reads this later, I ran a toggle-debug-on-quit and got this stacktrace:

read-minibuffer("Lisp expression: ")
  read(nil)
  inf-clojure-arglists("update")
  inf-clojure-eldoc-arglists(#("update" 0 6 (fontified t)))
  inf-clojure-eldoc()
  eldoc-print-current-symbol-info()
  ...
  timer-event-handler...

so it looks related to eldoc

adamfrey22:05:49

when I try running inf-clojure-eldoc I get eldoc error: (end-of-file)

adamfrey22:05:01

I’m going to try a simpler project, instead of this work app

richiardiandrea22:05:30

@adamfrey are you on the last inf-clojure?

dpsutton22:05:37

which clojure are you using? jvm, lumo, etc

richiardiandrea22:05:40

because I thought I fixed exectly that

dpsutton22:05:57

in the recent 2.0?

adamfrey22:05:01

20170507.233

adamfrey22:05:14

I’m in a jvm repl

richiardiandrea22:05:37

it might be a bug...lemme check

dpsutton22:05:44

let* ((arglists-snippet (format (inf-clojure-arglists-form) fn))
         (arglists-result (inf-clojure-results-from-process (inf-clojure-proc) arglists-snippet))
         (arglists-data (read arglists-result)))

dpsutton22:05:56

looks like an unchecked inf-clojure-results-from-process

dpsutton22:05:08

if that comes back nil then you have the blocking read in the minibuffer

richiardiandrea22:05:38

mini Andrea bug 😄

richiardiandrea22:05:56

sorry about that, I am fixing

richiardiandrea22:05:44

this should do: (arglists-data (when arglists-result (read arglists-result)))

richiardiandrea22:05:09

thanks @adamfrey for reporting!

adamfrey22:05:32

no problem. Are you cutting a new version?

richiardiandrea22:05:47

that's up to @bozhidar, but the patch is there

richiardiandrea22:05:04

pretty sure we'd need a 2.0.1

qqq23:05:10

is there an easy way to intent all of the bindings of a let ?

qqq23:05:27

i.e. for all binding-expr pairs, I want the start of all exprs within the let to line ujp