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: Yuri Khan
Subject: Re: delete-selection-mode as default
Date: Fri, 14 Sep 2018 20:41:46 +0700

On Fri, Sep 14, 2018 at 5:52 PM Alan Mackenzie <address@hidden> wrote:

> Why are you using Emacs at all?  You seem to dislike its core concepts
> and methods fairly strongly.  There are other editors available, some of
> which will more closely approximate the way you want to handle
> selections.  Why are you sticking with Emacs?

*The* core concept of Emacs as I understand it is its infinite
customizability, and this is pretty much the main reason I stick with
it.

I dislike the default Emacs keybindings, but that’s not a problem
because I can easily redefine them.

I consider the default looks of the modeline too cryptic, but that’s
not a problem because I can reconfigure it.

In my editor, I want tabs, line numbers, visible whitespace, and shift
selection. In Emacs, they all are just a few configuration options
away. (Okay, no, tabs have to be customized heavily before they are
useful for me.)

One other thing that I want is that the region be highlighted if and
only if it is going to be the target of the next command I give,
because I like to look before I leap. It seems transient-mark-mode is
intended to give me this by adding the concept of active region and
highlighting the region when it is active. However, many commands act
on the region even if it is inactive. kill-region and
copy-region-as-kill are two such commands. I am sure there are many
more, because it is much easier to write:

(defun my-command (BEGIN END)
  (interactive "r")
  ;; do something between BEGIN and END
)

than:

(defun my-command (BEGIN END)
  (interactive (if (use-region-p)
                   (list (min (point) (mark)) (max (point) (mark)))
                 ;; figure out what to do when no region is active
                 ;; * act on the whole buffer
                 ;; * act on the current narrowing
                 ;; * signal an error
                 ;; * do something else sensible
                 (list ?? ??)))
  ;; do something between BEGIN and END
)

With transient-mark-mode being the Emacs default, I’m inclined to
consider it a bug that certain commands act on the inactive region
when t-m-m is enabled, and possibly a flaw that (interactive "r")
makes it so easy to define such commands.


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, but, in practice, it would not matter much if the above
issue was addressed.



reply via email to

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