Fork me on GitHub
#emacs
<
2017-03-30
>
chrisblom11:03:21

what the best way to insert output from some slow shell command into a buffer?

chrisblom11:03:23

i want to run a process, and insert its output at some specific point in a buffer when the process is done

chrisblom11:03:38

i know flycheck does something like this (adding underlines when a linter completes), but i don't understand its code

cmack13:03:38

if you have a more recent version of emacs, that might be a use case for the new async-* functions

qqq16:03:43

@chrisblom: from my limited experience elisping, probably easierst to (1) redirect output from cmd to some buffer, (2) on some trigger, (3) insert the contents of the buffer

bballantine18:03:15

Hi, I recently made the switch from Vim to Emacs + evil-mode for all of my clojuring. In customizing settings (specifically evil-leader key mappings for cider commands), I am having to repeat stuff in my init.el for each of the clojure modes: clojure-mode, clojurescript-mode, and clojurec-mode (for .cljc files) In this particular case, I’m pretty sure I can do something like

(setq cider-key-mappings '(”ci” cider-jack-in …))
(apply evil-leader/set-key-for-mode ‘clojure-mode cider-key-mappings)`
(apply evil-leader/set-key-for-mode ‘clojurescript-mode cider-key-mappings)
…
But generally, I was wondering if there was some way to refer to all three modes with the same name, something like (evil-leader/set-key-for-mode ‘any-clojure-mode …), or if there’s some other technique for applying customization to all clojurey modes that experienced emacs users use.

dpsutton18:03:46

this is what i do

tanzoniteblack18:03:32

very similar version to what I do:

(defun enable-lisp-hooks (mode-name)
  "Enable lisp-y goodness for MODE-NAME."
  (let ((mode-hook (intern (concat (symbol-name mode-name) "-hook"))))
	(add-hook mode-hook 'smartparens-strict-mode)
	(add-hook mode-hook 'rainbow-delimiters-mode)))

(-each sp--lisp-modes 'enable-lisp-hooks)

qqq18:03:32

@bballantine : similar to @dpsutton and @tanzoniteblack , I have one function called "do-lisp-stuff", then for elisp, clj, cljs, hy, I have it all call do-lisp-stuff

bballantine18:03:22

Thanks @dpsutton @tanzoniteblack and @qqq that’s really helpful. I’ll use the same technique.

tanzoniteblack18:03:12

-each is from the fantastic https://github.com/magnars/dash.el library, btw, which includes the majority of the clojure seq operating functions that you're used to

bballantine18:03:58

thanks… i was just about to look that up.

qqq18:03:53

wait a second, dash.el, https://github.com/magnars/parens-of-the-dead and emacs rocks are created by the same person?

tanzoniteblack19:03:09

@magnars best possible person to respond to that 😄 . Also, thank you for dash, it makes writing elisp enjoyable

qqq19:03:52

@magnas: you owe me 3 months of salary; after watching your parens of the dead series, I swithced from vim to emacs, and have spent the past 3 months configuring elisp, emacs, cider, helm, projectile, ivy, avy, counsel, inferior-lisp

qqq19:03:11

@magnas -> @magnars 🙂

magnars19:03:31

Haha, sorry about that. 😄

magnars19:03:14

@tanzoniteblack after using Emacs for a while without, it had to be done. I made it in a fit of rage after trying to use the built in functions. 🙃

tanzoniteblack19:03:36

is that why it's original name was bang?

qqq19:03:58

@magnars : will it eventually have all of clojure's persistent data structures?

tanzoniteblack19:03:10

joking aside; has anyone ported clojure's immutable data structures to elisp?

tanzoniteblack19:03:31

or is there a good equivalent anyways, if not a port

magnars19:03:36

No, that was just a bad name. And no, that would be clunky to work with.