• 2 Posts
  • 1 Comment
Joined 2 years ago
cake
Cake day: July 3rd, 2023

help-circle
  • Cool that you’re trying something new out! I also often find prefix arguments a bit unintuitive in my flow.

    First of all, you’re right that you could do (eat nil 4) to simulate the prefix argument. I do this in a number of my helpers.

    For my advice on your code, I think it would be easier to understand if you used a let* block to assign meaningful variable names. I’m writing this from my phone, so it’s hard to give a detailed example, but:

    (let* ((eat-buffers (match-buffers "\*eat\*"))
           (last-buffer (last (sort eat-buffers))))
     ;; Body
    )
    

    And so on. This would let you reuse some values, and would also reduce the amount of nesting in your code.

    Edit: Missed a few parentheses, fixing syntax highlighting