• 0 Posts
  • 46 Comments
Joined 1 year ago
cake
Cake day: October 8th, 2023

help-circle






  • I don’t use use-package, but I’ve seen a lot of questions from users who do use it but don’t understand how to use it, or what it’s going to expand to, or what the things that it expands to actually do. My conclusion has been that for some users it introduces as many problems as it solves. I think those users would be better off if they learned how to manage their config without it first, and only considered use-package after understanding the more fundamental building blocks upon which it is built.

    It’s certainly not something you need to use, in any case. It’s clearly an invaluable system to many users, but if you don’t get along with it, don’t use it.




  • Looks like a bug (whether documentation or code) as read-kbd-macro still claims to return a string if possible, but nowadays it forcibly returns a vector. Please M-x report-emacs-bug to get that clarified.

    You could extract a string of characters from the vector:

    (mapconcat (lambda (event)
                 (and (characterp event)
                      (char-to-string event)))
               (read-kbd-macro "C-c"))
    

    But if you look at the code for read-kbd-macro you’ll see that it calls this:

    (defun edmacro-parse-keys (string &optional _need-vector)
      (let ((result (kbd string)))
        (if (stringp result)
            (seq-into result 'vector)
          result)))
    

    Hence the string value you wanted is coming from kbd:

    (kbd "C-c") => "^C"
    

    There are of course arguments you can pass to kbd which won’t return a string, but that would always have been the case for your code, and presumably you’re not attempting to use any of those.



  • A couple of simple config suggestions:

    (winner-mode 1) ;; Get familiar with `winner-undo'.
    (global-set-key (kbd "C-x !") 'delete-other-windows-vertically)
    

    I get a lot of mileage out of those two.

    Also consider adding bindings for these, to tell the following command where to display its buffer:

    • windmove-display-left
    • windmove-display-right
    • windmove-display-up
    • windmove-display-down
    • windmove-display-same-window

    And the regular windmove commands are very convenient for moving between buffers.

    The transpose-frame package available in MELPA is useful. Note that with only two windows, rotate-frame is “exchange the positions of the windows”, and transpose-frame is “switch between vertical and horizontal split”. I have those bound to C-c | and C-c \ respectively, and use them regularly.





  • I don’t know, but the initial denote release for Emacs was barely 16 months ago, so it would be fairly surprising if anyone had written support for another editor so quickly.

    Maybe if you define a minimum set of features which would be adequate for collaboration purposes, you could ask in vim forums how you might go about implementing those.