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

help-circle
  • orzechod@alien.topBtoEmacsEat Background Color
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    it is possible! add a lambda to eat-mode-hook which calls face-remap-add-relative for default and, optionally, fringe faces. here’s an example taken from my own dotfiles:

    (add-hook
      'eat-mode-hook
      (lambda ()
        (face-remap-add-relative
         'default
         :foreground "#ffffff"
         :background "#000000")
        (face-remap-add-relative
          'fringe
         :foreground "#ffffff"
         :background "#000000")))
    

    and here’s what it looks like in practice: https://imgur.com/a/9gPCio5


  • orzechod@alien.topBtoEmacsIs there break undo in Emacs?
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    the paragraph here gives some useful details: https://www.gnu.org/software/emacs/manual/html_node/elisp/Undo.html#index-undo_002dauto_002damalgamate

    The editor command loop automatically calls undo-boundary just before executing each key sequence, so that each undo normally undoes the effects of one command. A few exceptional commands are amalgamating: these commands generally cause small changes to buffers, so with these a boundary is inserted only every 20th command, allowing the changes to be undone as a group. By default, the commands self-insert-command, which produces self-inserting input characters (see User-Level Insertion Commands), and delete-char, which deletes characters (see Deleting Text), are amalgamating.

    this means emacs will group together a certain number of inserted characters into an atomic unit; it’s that unit which is undone by the undo command. if you want character-by-character undo then you will need to tell emacs to not perform this grouping. one thing to try would be to add advice to the insert-char function to set that undo boundary for you upon each keystroke; I’m sure there are other ways to do this as well.