Fork me on GitHub
#emacs
<
2018-04-13
>
bozhidar05:04:08

@nha Just out of curiosity - why exactly do you need to do this?

nha09:04:18

Thanks, I tweaked it to do what I wanted:

(defun ask-for-variable-names (names)
    (interactive "sEnter the variable names: ")
    (let ((bindings (mapcar (lambda (name)
                              (format "(def %s %s)" name name))
                            (s-split " " names))))
      (insert-before-markers (string-join bindings "\n"))))
Works perfectly! 😄

nha10:04:51

So I use this when I basically want to capture one or several values in a running program. Usually these are either: - too big to build by hand 😄 - in a running prod system 🤫

bozhidar10:04:50

Isn’t it better to add some conditional logging for those?

nha11:04:21

Well they are also too big for logging 😅 as in, it freezes my emacs completely. So I personally prefer to use a def and navigate inside it from there. I know someone in our team did pretty print these to a file instead, and opened with a separate editor/diff software.

bozhidar13:04:46

I didn’t expect this. 😄

😄 4