Fork me on GitHub
#emacs
<
2018-05-13
>
hlolli11:05:25

Is there any built-in emacs frunction to get the boundries of a whole s-expression the cursor is in. Trying to trace down the keybinding "<C-M x>" in cider and emacs-mode, can't seem to find which function is responsible for selecting the sexp for evaluation.

hlolli11:05:47

right in front of my eyes

(save-excursion
  (end-of-defun)
  (beginning-of-defun)
  (setq beg (point))
  (setq form (read (current-buffer)))
  (setq end (point)))
beg and end mark the boundries.

bozhidar19:05:14

There are no built-in functions. You can take a look at cider-sexp-at-point and cider-last-sexp.

bozhidar19:05:39

Those should eventually end up in clojure-mode, but as it stands - they live only in CIDER>

vemv21:05:05

Hi there! CIDER q. I'd like to (prn *e) whenever I hit an error in the repl. I am aware that cider-show-error-buffer exists, but for now I have it set to nil (it still can be handy to visit *cider-error* which fortunately is always created. But I don't like popups) How can one establish such behavior? This was my attempt, did nothing: (Thread/setDefaultUncaughtExceptionHandler (reify Thread$UncaughtExceptionHandler (uncaughtException [_ thread e] (prn e))))