emacs-devel
[Top][All Lists]
Advanced

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

Re: delete-selection-mode as default


From: Phil Sainty
Subject: Re: delete-selection-mode as default
Date: Sat, 15 Sep 2018 02:29:05 +1200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 15/09/18 01:41, Yuri Khan wrote:
> I was one of two people here to suggest that it is a bad thing
> that the mark is used both as a navigation mechanism and as a
> region delimiter

I think it's impractical to suggest that all code which acts on
the region should be modified to only do so if the region is
active.

The only approach I can think of is to have the mark forcibly set
to nil whenever the region is inactive, so that commands which
want to use the region will fail.  I suspect that would mean
giving up all use of the mark ring too -- but you could implement
a custom equivalent for the purposes of navigation.


Maybe play with something like this:

(defun my-clear-inactive-mark ()
  (unless (region-active-p)
    (set-mark nil)))

(add-hook 'pre-command-hook 'my-clear-inactive-mark)


-Phil



reply via email to

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