This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-16
Channels
- # aleph (1)
- # announcements (16)
- # babashka (36)
- # beginners (62)
- # calva (15)
- # cider (21)
- # cljsrn (5)
- # clojure (84)
- # clojure-dev (3)
- # clojure-europe (22)
- # clojure-italy (2)
- # clojure-nl (2)
- # clojure-uk (3)
- # clojurescript (36)
- # core-async (2)
- # cursive (4)
- # datomic (8)
- # emacs (14)
- # events (1)
- # fulcro (4)
- # hyperfiddle (6)
- # introduce-yourself (3)
- # jobs (1)
- # leiningen (4)
- # lsp (100)
- # nrepl (3)
- # off-topic (36)
- # pathom (17)
- # podcasts (1)
- # polylith (4)
- # portal (14)
- # react (1)
- # reagent (3)
- # reitit (8)
- # releases (3)
- # remote-jobs (1)
- # reveal (7)
- # shadow-cljs (19)
- # sql (16)
- # web-security (3)
I went through a recent guide on setting up emacs to display emojis on my mac. In a clojure file I’m working on, I can paste in an emoji w/o issues. However, there are other characters (`\uD83D` , etc) that should be emojis but are rending as raw codes. Is there a simple fix? I tried changing buffer file encoding to UTF-16 but that doesn’t seem to help.
So, this morning, I’ve been trying and failing to understand why I can’t perform http requests from org-mode on Clojure apps that are being debugged with Cider. If the apps are simply run from a Cider repl, these kind of http requests work okay:
#+begin_src shell :results raw
curl -X GET -k --header 'Accept: application/json' --header "authorization: Bearer ${token}" ''
#+end_src
But if I cider-debug-defun-at-point
on the endpoint handler and execute the above org mode src block, it hangs withI'm guessing that Emacs freezes while waiting for the curl to return, preventing the debugger from kicking in.
that sounds like a good theory. un-instrument the function, add a (Thread/sleep 15000)
and see if you can interact with emacs while the request takes 15 seconds.
Trying, cheers guys!
Yeah, Emacs freezes for 15 seconds..
I wonder if I can make the org mode block async…
:results raw
means it will put the result of the computation into the block right? If you drop that does it still freeze emacs? Maybe if it doesn’t have to wait on results it is a bit more free?
Emacs was single threaded for 30 years, so that's still the default pretty much everywhere. There might be some hoops you can jump through to mend that.
I’m currently trying https://github.com/astahlman/ob-async but will try removing the :results
header afterwards!
Neither that package with :async
or removing the :results
header improved matters.
Saying that, that package’s readme shows specifically sh
babel scripts showing the benefits. Maybe my install didn’t work correctly.
RTFM @U064B4L0K!!!! I’d installed but forgotten to require
it. Works a treat with
#+begin_src shell :results raw :async
both with 15 second sleep and debugging! Cheers!If I execute pkill -SIGUSR2 Emacs
, Emacs comes back to life with
Debugger entered--entering a function:
* symbol-overlay-refresh(1 5 0)
call-process("/bin/zsh" "/var/folders/6t/jjj6xvtx39v9m8fvvcqsgj940000gn/T/b..." (t "/var/folders/6t/jjj6xvtx39v9m8fvvcqsgj940000gn/T/e...") nil "-c" "/bin/zsh")
apply(call-process "/bin/zsh" "/var/folders/6t/jjj6xvtx39v9m8fvvcqsgj940000gn/T/b..." (t "/var/folders/6t/jjj6xvtx39v9m8fvvcqsgj940000gn/T/e...") nil ("-c" "/bin/zsh"))
process-file("/bin/zsh" "/var/folders/6t/jjj6xvtx39v9m8fvvcqsgj940000gn/T/b..." (t "/var/folders/6t/jjj6xvtx39v9m8fvvcqsgj940000gn/T/b...") nil "-c" "/bin/zsh")
org-babel--shell-command-on-region("/bin/zsh" #<buffer *Org-Babel Error*>)
org-babel-eval("/bin/zsh" "token=$(curl -X GET -k --header 'Accept: applicati...")
org-babel-sh-evaluate(nil "token=$(curl -X GET -k --header 'Accept: applicati..." ((:colname-names) (:rowname-names) (:result-params "replace" "raw") (:result-type . value) (:results . "replace raw") (:exports . "code") (:session . "none") (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no")) nil nil)
org-babel-execute:shell("token=$(curl -X GET -k --header 'Accept: applicati..." ((:colname-names) (:rowname-names) (:result-params "replace" "raw") (:result-type . value) (:results . "replace raw") (:exports . "code") (:session . "none") (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no")))
org-babel-execute-src-block(nil ("shell" "token=$(curl -X GET -k --header 'Accept: applicati..." ((:colname-names) (:rowname-names) (:result-params "raw" "replace") (:result-type . value) (:results . "raw replace") (:exports . "code") (:tangle . "no") (:hlines . "no") (:noweb . "no") (:cache . "no") (:session . "none")) "" nil 357 "(ref:%s)"))
org-ctrl-c-ctrl-c(nil)
funcall-interactively(org-ctrl-c-ctrl-c nil)
call-interactively(org-ctrl-c-ctrl-c nil nil)
command-execute(org-ctrl-c-ctrl-c)