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

help-circle

  • 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.









  • M-a undefined
    M-ā is undefined

    which is it?

    If it’s the latter, it sounds like your Ctrl key is acting like a Compose key of some kind, such that C-a produces ā. That sounds super-weird to me (I wouldn’t expect any OS to take over the Ctrl modifier in this way), but it would be happening outside of Emacs and anything is possible.

    If it’s the former then it seems that the Ctrl key hasn’t registered, which would also be a problem which is external to Emacs.