Fork me on GitHub
#emacs
<
2022-09-30
>
Cora (she/her)01:09:51

oooh I didn't know about that, thanks @tomd

Drew Verlee17:09:37

when i try to find the source code for nconc in

(defun nrepl--eval-request (input &optional ns line column)
  "Prepare :eval request message for INPUT.
NS provides context for the request.
If LINE and COLUMN are non-nil and current buffer is a file buffer, \"line\",
\"column\" and \"file\" are added to the message."
  (nconc (and ns `("ns" ,ns))
         `("op" "eval"
           "code" ,(substring-no-properties input))
         (when cider-enlighten-mode
           '("enlighten" "true"))
         (let ((file (or (buffer-file-name) (buffer-name))))
           (when (and line column file)
             `("file" ,file
               "line" ,line
               "column" ,column)))))
via find-function emacs tells me that helm-M-x-execute-command: The C source file fns.c is not available how do i make it avialable, i want to try and debug an issue with cider enlighten-mode where the overlays (the evaled part thats showing) wont go away and blocks my cursor from moving up and down the file. Also if anyone has an alternative to using this mode, which i find really helpful, i would be open to hearning it.

iarenaza14:10:12

You need to install the Emacs sources that were used to compile your Emacs version. Or at least the sources for the same Emacs major version (e.g., Emacs 27.x, 28.x, etc). In that case, there might be minor differences, but I wouldn't expect changes in something as fundamental as nconc. In any case, I traced the execution for (find-function 'nconc) and this is the call chain:

find-function -> find-function-do-it -> find-definition-noselect -> find-function-noselect -> 
find-function-search-for-symbol -> find-function-C-source
because nconc is a built-in function that is implemented in C (you can get that tidbit from its docstring). If you have a look at find-function-C-source you will see that it uses find-function-C-source-directory var to try and find the Emacs sources for its C files. find-function-C-source-directory will be nil if the original directory used to build that version of Emacs (whose value is in source-directory var) no longer exists. Which I suspect is your case. If find-function-C-source-directory is nil, Emacs will ask you for a directory where it can find the C source files. If you don't provide a valid one, it will tell you that it can't find the required C file (`fns.c` in your case). If you don't want to install the sources for Emacs, you can browse them either in the original GNU Savannah server, where Emacs is developed, or in the Github emacs-mirror repository. Here's a link to the nconc function definition using the Github mirror, for the Emacs 28 branch: https://github.com/emacs-mirror/emacs/blob/emacs-28/src/fns.c#L2767-L2798

iarenaza15:10:04

Also, I've never used enlighten-mode myself, https://docs.cider.mx/cider/debugging/enlighten.html: > To stop displaying the locals you’ll have to disable cider-enlighten-mode and reevaluate the definitions you had instrumented previously. So it seems like they don't go away when you start interacting with the buffer again, and you need to manually remove them by disabling enlighten-mode.

Drew Verlee16:10:34

@U8T05KBEW Thanks, yeah i'll have to look into installing the sources. Though at the point at which i'm reading C i'm probably going to forget what i was looking at in the first place 🙂 . For me, on doom (no personal customization to the init file) and spacemacs, with emacs 28.1 installed via a snap on ubuntu, enlighten mode doesn't always removing highlighting. So i'm trying to figure out why by debugging it. Hopefully i'll make some progress today.

Karol Wójcik20:09:20

Does anyone know how to complete npm commands like on regular terminal with zsh, but in eshell or in shell?

Drew Verlee22:09:14

if i run "shell" in emacs, my "shell" does to autocomplete. But i'm using spacemacs so it's possible they set something by default there.

Drew Verlee22:09:37

oh npm commands...

Drew Verlee22:09:26

yea npm instal* where * is the cursor also doesn't offer "install" as an option. I feel like it's probably best to use a shell for anything really shelly.

elken07:10:56

https://github.com/JonWaltman/pcmpl-args.el may help there but some configuration might be needed.

Karol Wójcik09:10:58

Thanks, I found a way to make it work. Switched from shell/eshell to vterm