home.social

#elisp — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #elisp, aggregated by home.social.

  1. Chat client for Meshtastic LoRa mesh networks in Emacs. Connects directly to a device over USB serial, no server required.

    https://git.andros.dev/andros/meshtastic.el

    #emacs #elisp #meshtastic #lora

  2. Today's #emacs lesson: my locally installed #orgmode broke completely. After some light debugging I gave up, deleted the org directory, and reinstalled from melpa.

    And - still broken. With warnings that Emacs couldn't find the org file in the directory I'd deleted. And completely scrubbed from my init. But Emacs continued to look for it in the old location.

    Until - I deleted the .elc files in my user-lisp directory. And then, at last, it works.

    From which I tentatively conclude that when you compile an #elisp file that calls another file, it somehow hard-codes the location of the file it loads. Such that changing the load path or otherwise telling Emacs to load a different file doesn't get accounted for.

    Which, if accurate, would mean you need to recompile your .elc files not just when the corresponding .el file changes, but when any of the files it calls changes?

    Is that right? That sounds ugly

  3. Today's #emacs lesson: my locally installed #orgmode broke completely. After some light debugging I gave up, deleted the org directory, and reinstalled from melpa.

    And - still broken. With warnings that Emacs couldn't find the org file in the directory I'd deleted. And completely scrubbed from my init. But Emacs continued to look for it in the old location.

    Until - I deleted the .elc files in my user-lisp directory. And then, at last, it works.

    From which I tentatively conclude that when you compile an #elisp file that calls another file, it somehow hard-codes the location of the file it loads. Such that changing the load path or otherwise telling Emacs to load a different file doesn't get accounted for.

    Which, if accurate, would mean you need to recompile your .elc files not just when the corresponding .el file changes, but when any of the files it calls changes?

    Is that right? That sounds ugly

  4. Today's #emacs lesson: my locally installed #orgmode broke completely. After some light debugging I gave up, deleted the org directory, and reinstalled from melpa.

    And - still broken. With warnings that Emacs couldn't find the org file in the directory I'd deleted. And completely scrubbed from my init. But Emacs continued to look for it in the old location.

    Until - I deleted the .elc files in my user-lisp directory. And then, at last, it works.

    From which I tentatively conclude that when you compile an #elisp file that calls another file, it somehow hard-codes the location of the file it loads. Such that changing the load path or otherwise telling Emacs to load a different file doesn't get accounted for.

    Which, if accurate, would mean you need to recompile your .elc files not just when the corresponding .el file changes, but when any of the files it calls changes?

    Is that right? That sounds ugly

  5. Today's #emacs lesson: my locally installed #orgmode broke completely. After some light debugging I gave up, deleted the org directory, and reinstalled from melpa.

    And - still broken. With warnings that Emacs couldn't find the org file in the directory I'd deleted. And completely scrubbed from my init. But Emacs continued to look for it in the old location.

    Until - I deleted the .elc files in my user-lisp directory. And then, at last, it works.

    From which I tentatively conclude that when you compile an #elisp file that calls another file, it somehow hard-codes the location of the file it loads. Such that changing the load path or otherwise telling Emacs to load a different file doesn't get accounted for.

    Which, if accurate, would mean you need to recompile your .elc files not just when the corresponding .el file changes, but when any of the files it calls changes?

    Is that right? That sounds ugly

  6. Today's #emacs lesson: my locally installed #orgmode broke completely. After some light debugging I gave up, deleted the org directory, and reinstalled from melpa.

    And - still broken. With warnings that Emacs couldn't find the org file in the directory I'd deleted. And completely scrubbed from my init. But Emacs continued to look for it in the old location.

    Until - I deleted the .elc files in my user-lisp directory. And then, at last, it works.

    From which I tentatively conclude that when you compile an #elisp file that calls another file, it somehow hard-codes the location of the file it loads. Such that changing the load path or otherwise telling Emacs to load a different file doesn't get accounted for.

    Which, if accurate, would mean you need to recompile your .elc files not just when the corresponding .el file changes, but when any of the files it calls changes?

    Is that right? That sounds ugly

  7. I was reading #prot emacs element #ebook on #elisp. I like this quote.

    ```
    The fun part is how you go about writing the code. There are no duties you have to conform with. None! You program for the sake of programming. It is a recreational activity that expands your horizons.
    ```

    protesilaos.com/emacs/emacs-lisp-elements#h:getting-started-with-emacs-lisp

  8. I've updated blogmore.el to add a command for quickly setting an image as the cover for a post: blog.davep.org/2026/05/08/blog

  9. ...and updated all my packages to use Compat 31. Unfortunately I found a bug in the new with-work-buffer macro, such that the packages cannot yet take advantage of it:

    debbugs.gnu.org/cgi/bugreport.

    But this is what the stabilization phase before the actual Emacs release is for!

    #emacs #elisp

  10. I have just released Compat 31.0.0.0. The emacs-31 branch cut is imminent and the stabilization for the release will start now. If you start to rely on Compat 31 in your packages, please be aware that functions can still change until the actual release of Emacs 31.1. Please report any problems you encounter.

    github.com/emacs-compat/compat

    #emacs #elisp

  11. @chiply

    ;; Best of both worlds: Only delete old duplicates, such that rare candidates
    ;; are not lost. At the same time ensure that ranking by frecency works. (bug#80070)
    (defun +history-delete-old-duplicates (var elt &rest _)
    (when-let* ((hist (symbol-value var))
    ((and (listp hist) (integerp history-length)))
    (old (nthcdr 100 hist)))
    (setcdr old (delete elt (cdr old)))))
    (advice-add #'add-to-history :before #'+history-delete-old-duplicates)

    #emacs #elisp

  12. I've updated blogmore.el with a couple of commands for working with the comment invite facility: blog.davep.org/2026/04/28/blog

  13. After over a decade of use, I made a wee update to a personal package I use for dropping into the scratch buffer: blog.davep.org/2026/04/24/itch

  14. I keep forgetting some abbevs I have for common URLs, so I quickly wrote a little tool to help me pick them from a list: blog.davep.org/2026/04/23/unab

  15. So kept quitting windows on occasion, while writing code, but not always. And now expando.el v1.6 has been released.

    blog.davep.org/2026/04/22/expa

  16. blogmore.el v4.2 is now available, with tweaked slugging and a changed image extension changer: blog.davep.org/2026/04/21/blog

  17. Why do i love (doom) #emacs so much ?

    I'm not a programmer and i'm a total noob in #elisp and other languages.

    Often, i'm testing random things that i've found on the web. I've tried and failed so many times... Sometimes i don't even know what am i trying to do in my config file.

    But i love it ...

  18. You can now find `comet-trail` on MELPA!

    https://git.andros.dev/andros/comet-trail.el

    The cursor animates like a comet sliding along its path with an ease-out brightness gradient.

    #emacs #elisp

  19. Title: P4: pinyin search, Mastadon sedning [2024-01-06 Sat]
    I am not going to publish script for security considerations.
    But I will think about it.
    😶 #mastadon #emacs #chinese #pinyin #elisp #lisp

  20. Title: P3: pinyin search, Mastadon sedning [2024-01-06 Sat]
    1) You need to register a client in web site with permissions: write, push, delete.
    2) All you need is 'Your access token' ◕‿◕
    3) curl -H 'Authorization: Bearer Saccess_token' ...
    to emacs.ch/api/v1/media to upload pictures
    to emacs.ch/api/v1/statuses to push status
    to emacs.ch/api/v1/statuses/Smess to delete status #mastadon #emacs #chinese #pinyin #elisp #lisp

  21. Title: P2: pinyin search, Mastadon sedning [2024-01-06 Sat]
    I am very fashinated by Chinese 气功 Qigong. ☯
    The basic is very simple: make movies to liven the body and mind's aspects. ☥

    I updated my bash scripts with cURL 🦾 to quickly send
    'status' reports to Mastadon 💅:
    I used this Python wrapper scripts as guidlines:
    - github.com/halcy/Mastodon.py/b
    - Mastodon.py/mastodon/internals.py #mastadon #emacs #chinese #pinyin #elisp #lisp

  22. Title: P2: P1: pinyin search, Mastadon sedning [2024-01-06 Sat]
    (funcall f x)
    )) l))
    Add one list to another or Concatenate two lists:
    (seq-concatenate 'list c1 c2)
    or
    (defun add_one_to_another(c1 c2)
    (apply 'append (list c1 c2))) #mastadon #emacs #chinese #pinyin #elisp #lisp

  23. Title: P1: P1: pinyin search, Mastadon sedning [2024-01-06 Sat]
    : (defun anynil (l) (cl-some #'null l))
    Apply map to every leaf of a tree like list
    (defun maptree (f l)
    (mapcar (lambda (x) (if (listp x)
    (maptree f x) #mastadon #emacs #chinese #pinyin #elisp #lisp

  24. Title: P2: P0: pinyin search, Mastadon sedning [2024-01-06 Sat]
    all or every
    : (defun all (l) (cl-every #'identity l))
    all or every nil
    : (defun allnil (l) (cl-every #'null l))
    any t
    : (defun any (l) (cl-some #'identity l))
    any nil #mastadon #emacs #chinese #pinyin #elisp #lisp

  25. Title: P1: P0: pinyin search, Mastadon sedning [2024-01-06 Sat]
    I am working on major update to my Emacs package for quick pinyin search.
    I am going to add search of Chinese hieroglyphs by pinyin. ☯

    During my work I collected often used functions: ❤️🧡💛💚💙💜
    flatten list by one level
    : (apply 'append v) #mastadon #emacs #chinese #pinyin #elisp #lisp

  26. Trying to continue with my learning #Emacs #Lisp, and it is going more slowly than I would like - primarily because of lack of free time (damn adult life).

    However, I just successfully completed "5.5 optional Argument Exercise." I'm proud to have worked it out, but I really need to focus on learning where and when to use parentheses. E.g., (56) is not a valid expression for an else clause, whereas 56 is.

    Frustrating! But I AM enjoying this process!

    #Elisp

  27. I've bumped blogmore.el to v4.1, adding a command to let me quickly swap a single image link from png to webp on my blog: blog.davep.org/2026/04/17/blog

  28. More tweaking of older packages, this time slstats.sl: a package for looking up information about the grid.

    blog.davep.org/2026/04/15/slst

  29. Cleaned up wordcloud.el, a little package that turns a buffer into a word cloud, of sorts: blog.davep.org/2026/04/14/word

  30. CW: elisp help

    Okay, so I wrote this hacky nonsense in my ~/.emacs.d/init.el, but it doesn't seem to be having any effect. The function in question seems completely unaffected.

    Perhaps this code is being evaluated before the original function is defined?

    ;; Mail hack
    (defvar jrl-mail-hack nil
      "Flag to prevent from overloading the function a second time")
    (let ((oldfunc (symbol-function 'message-unique-id)))
      (unless jrl-mail-hack
        (defun message-unique-id ()
          (secure-hash 'sha256 (funcall oldfunc)))
        (setq jrl-mail-hack t)))

    The idea is to hash the Message-ID header in outgoing mail because Gmail seems to have decided the original format looks like spam.
    #emacs #elisp #AskFedi
  31. CW: elisp help

    Okay, I need to do a hacky #elisp thing. Yes, I know it's terrible.

    Basically, I have an existing defun. Let's call it foo. I need to replace it with a new function that calls the old one and transforms its output before returning it.

    I naïvely assumed I could do it like this:

    (let ((oldfunc (function foo)))
      (defun foo ()
        (my-transform (funcall oldfunc))))

    ...but this doesn't actually copy the old function, just a reference to the symbol, so it ends up locking itself in a recursive loop.

    I'm sure there's a way to do this.
    #AskFedi

    Edit: Got it. It's:

    (let ((oldfunc (symbol-function 'foo)))
      (defun foo ()
        (my-transform (funcall oldfunc))))

    Edit 2: It turns out there's a cleaner way still.
    See: aus.social/@carlozancanaro/116…

    Also, there's still something Gmail isn't liking. Looking at the differences in the headers between emacs and my other clients (whose mail does get through), the next most obvious difference is that the Content-Type header doesn't specify an encoding. Whether this is the actual problem or not, I should probably fix that. I'm just working on how.
    RE: aus.social/users/carlozancanar…

  32. blogmore.el v4.0 is available, with a tag removing command and a handful of utility functions made "public": blog.davep.org/2026/04/06/blog

  33. Bumped blogmore.el to v2.5, in which I tidy a toggle, learn to use ERT for testing, and find a bug with older Emacsen. blog.davep.org/2026/04/02/blog