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

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

Re: disable region after running a command on it


From: Gregory Heytings
Subject: Re: disable region after running a command on it
Date: Tue, 13 Dec 2022 13:26:25 +0000



is there a way to disable a region every time a command has been run on it? For example, I mark a region, M-x eval-region and I would like that the region selection disappear.


(defun maybe-deactivate-mark ()
  (if (memq this-command
            '(eval-region
              ;; other commands after which you want to deactivate mark
              ))
      (deactivate-mark)))

(add-hook 'post-command-hook #'maybe-deactivate-mark)




reply via email to

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