Fork me on GitHub
#cider
<
2017-08-17
>
benny01:08:52

what's the best way to remove an entry from a map?

benny01:08:21

like if i start with

{:foo "data"
 :bar "more"}

benny01:08:58

and i want to remove :foo so it looks like this instead

{:bar "more"}

benny01:08:26

what's the best way to remove the first pair and bring the line up like that?

hkjels08:08:02

(dissoc m :foo)

deg08:08:02

@benny There are probably better ways of doing it, but I do it with C-M-k C-M-k s-SPC, where I have a custom binding of s-SPC to 'kill-whitespace, and Super ("s-") is attached to the "Windows" key on my keyboard.

pwrflx17:08:24

hi! Is there a fuzzy search possibility for function names? eg I'd like to search for "blank?" and this should show me that there is such a function available in clojure.string/blank? and offer the possibility to jump there with enter

mgrbyte19:08:10

@pwrflx You can do cider-apropos (`C-c C-d C-a`); click/ENT on the link to follow to definition

pwrflx19:08:55

@mgrbyte thanks! is there maybe a way that works via company mode? having the two extra buffers in between slows down in my flow..

pwrflx19:08:29

@mgrbyte eg I'd like to just have a fuzzy matched company mode window and when I select something it goes to definition, that's all

mgrbyte10:08:22

@pwrflx So I've started using company-mode with cider, and have what you wanted working. Pressing C-w opens a buffer with the source of the completion.

pwrflx10:08:47

You mean you have developed/configured something custom or you're saying it works out of the box?

mgrbyte10:08:32

works out of the box

mgrbyte10:08:39

with some custom config

mgrbyte19:08:10

@pwrflx no idea sorry, I don't use company-mode

waffletower20:08:26

Overall I like CIDER a lot but am trying to wrangle its cider-error popup buffer behavior. Due to my eyes I am less tolerant than others and find the default cider-error behavior really annoying and jarring. Worse, the buffers usually appear in a window that I am not currently editing in, and I have to navigate back to the window, and its frames, that I was actually editing. Are there alternatives to the popup exception behavior? Are there ways to control which frame their buffers appear in?

waffletower21:08:12

(setq cider-show-error-buffer nil) feels so much nicer, but is there a way to navigate to the trace when I choose not to display them automatically?

waffletower21:08:56

Sorry I am being lazy, I guess I could write a little bit of elisp to show the current cider-error buffer and initiate it from the window of my choosing

waffletower21:08:31

Bound to keys, these will work much nicer than default behavior for my eyes, I think

(defun cider-switch-to-error ()
  (interactive)
  (switch-to-buffer "*cider-error*"))

(defun cider-pop-to-error ()
  (interactive)
  (pop-to-buffer "*cider-error*"))

waffletower21:08:52

It seems that cider-error display uses switch-to-other-buffer rather than pop-to-buffer by default. Would this be configurable or would I need to change the source?

andrea.crotti21:08:26

if I am in a cljc file and I have both the clojure and the clojurescript repl active

andrea.crotti21:08:37

how do I choose which one to evaluate expressions with?

dpsutton23:08:03

not positive but i think it goes to the last repl. evaluate (+ 1 1) in whichever repl you prefer

dpsutton23:08:30

possible it also still respects clojurescript-mode vs clojure-mode @andrea.crotti

featheredtoast23:08:05

switching to clojurescript mode seems to work, but ideally we should be able to pick a repl in cljc mode. this seems related - https://github.com/clojure-emacs/cider/issues/1913