reddit / emacs

org-excalidraw: manage excalidraw drawings from org-mode

anewfoundmollusk · 2022-08-14 13:59
DefiantAverage1 · 2022-08-14 22:27
Awesome!
github-alphapapa · 2022-08-15 20:06
Oh no! Another David Wilson in Emacsland! Just kidding. :) Nice work! A couple of small suggestions: 1. You've defined a lot of small functions that are only used once, like `org-excalidraw-check-dir`. Instead, their code could be inlined where used. That would make the library much simpler and easier to follow. If you really want to organize your code in a more functional way, functions like this, that are only used in one place, can be defined in the function where they're used with `cl-labels`, which reduces the number of symbols defined by your library. 2. You only use the `f` library for `f-dir?` and `f-join`. You could just as easily use `file-directory-p` and `expand-file-name`, which are built-in to Emacs, and then you could remove the dependency on `f` (which is a fine library, but not necessary for these simple uses).
kzy192 · 2022-08-16 13:19
Question: if I were to start developing in Elisp, how would I know about the existence of these functions `file-directory-p` or `expand-file-name`? I would imagine something like https://devdocs.io/ is useful but what would I search to begin with? This is in the realm of "I don't know what I don't know". Somehow I need to translate this into "I don't know what I know".
github-alphapapa · 2022-08-16 13:32
Emacs isn't called "the self-documenting editor" for nothing. Start with the Elisp introduction and the Elisp manual. Then you can use tools like `M-x apropos` to discover functions, variables, etc. that are relevant (it's easier when you also use something like Vertico or Helm). For example, run `M-x apropos-function RET file RET` and see what comes up.
kzy192 · 2022-08-16 15:05
Awesome! Will look into this. Thank you very much.
anewfoundmollusk · 2022-08-16 23:11
Thank you for the constructive feedback! ' Always happy to remove dependencies, no more `f`. And I was unaware of `cl-labels`, good to know. It would be overkill for this package in its current state, but your comment did inspire me to inline some of the obviously unnecessary functions to tighten it up. Should be a bit easier to read now with a slightly smaller symbol footprint. *Side-note:* I found that the interactivity of developing in Elisp led me to this particular style of code. It's easy to write tiny functions and immediately use them in emacs to test. Anyway, thanks for taking the time to check it out!
github-alphapapa · 2022-08-19 17:46
Cool! > Side-note: I found that the interactivity of developing in Elisp led me to this particular style of code. It's easy to write tiny functions and immediately use them in emacs to test. Yes, Lisps tend to do that. Of course, in the same vein, you can also evaluate individual expressions along the way. :)
unhammer · 2022-08-20 07:46
Neat! Is there some Chrome-specific functionality required, or would it be possible to do Firefox if someone were to try?