help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Another Emacs incompatibilty


From: Emanuel Berg
Subject: Re: Another Emacs incompatibilty
Date: Tue, 25 Aug 2020 07:04:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

> One-liners are enough (preferable, even) if they show
> how to do it.

Here is a 19-liner how to do it:

(delete-selection-mode)

(defun delete-selection-pre-hook ()
  (when (and delete-selection-mode
             (use-region-p)
             (not buffer-read-only) )
    (if (member this-command '(self-insert-command insert-char insert) )
        (delete-selection-helper 'kill)
      (delete-selection-helper
       (and (symbolp this-command)
            (get this-command 'delete-selection) )))))

Now type:

  You better belive Manny is the best hacker around

mark it, type something, and yank it.

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]