emacs-devel
[Top][All Lists]
Advanced

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

Re: exchange-point-and-mark behavior


From: Sean Whitton
Subject: Re: exchange-point-and-mark behavior
Date: Sun, 09 Mar 2025 15:07:23 +0800
User-agent: Gnus/5.13 (Gnus v5.13)

Hello,

I think that a good way to frame this is: a new defcustom to invert the
behaviour of the prefix argument to exchange-point-and-mark.

That way people not using transient-mark-mode could also make use of it,
if they wanted.

This is what I use for this (obviously it's not how we'd want to do this
in emacs.git):

--8<---------------cut here---------------start------------->8---
;; Swap C-x C-x and C-u C-x C-x in Transient Mark mode.
(defun spw/exchange-point-and-mark (args)
  (list (if (and transient-mark-mode (not mark-active))
            (not (car args))
          (car args))))
(advice-add 'exchange-point-and-mark
            :filter-args #'spw/exchange-point-and-mark)
--8<---------------cut here---------------end--------------->8---

-- 
Sean Whitton



reply via email to

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