unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: Proposal for DEL to delete the active region
Date: Sun, 02 May 2010 08:04:20 +0200	[thread overview]
Message-ID: <87mxwialgb.fsf@tux.homenetwork> (raw)
In-Reply-To: jwvhbmruine.fsf-monnier+emacs@gnu.org

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Here is a proposal for DEL to delete the region when transient-mark-mode
>> is enabled.  DEL already does this in delete-selection-mode; the idea
>> here is to move this behavior into transient-mark-mode proper.
>
> The proposal has the property of being straightforward.  I like that.
>
>> + (defcustom delete-backward-char-delete-region t
>
> But this doesn't seem right: we're not going to have one such variable
> for delete-backward-char, delete-char, delete-backward-char-untabify,
> and the handful of other commands that
>
>    grep "'delete-selection 'supersede" lisp/**/*.el
>
> indicate will want a similar treatment.
>
>> + (defun delete-backward-char (n killflag)
> [...]
>> +   (interactive "p\nP")
>> +   (unless (integerp n)
>> +     (signal 'wrong-type-argument (list 'integerp n)))
>> +   (cond ((and (use-region-p)
>> + 	      delete-backward-char-delete-region
>> + 	      (= n 1))
>
> the other problem here is that this change also affects calls from Lisp
> rather than only interactive calls.
>
>
>         Stefan
>
>
> PS: We will want to remove mouse-region-delete-keys and related code
> ASAP since it is at the root of various known bugs (mostly due to the
> fact that it delays the end of the mouse-selection commands to the
> beginning of the next command, so post-command-hooks don't get run at
> the expected time).

Why instead not using C-d to delete region with simple thing like that:

(defun tv-delete-char (arg beg end)
  (interactive "p\nr")
  (if (region-active-p)
      (delete-region beg end)
      (delete-char arg)))

-- 
Thierry Volpiatto
Gpg key: http://pgp.mit.edu/





  reply	other threads:[~2010-05-02  6:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-01  3:23 Proposal for DEL to delete the active region Chong Yidong
2010-05-02  2:54 ` Stefan Monnier
2010-05-02  6:04   ` Thierry Volpiatto [this message]
2010-05-02 14:34   ` Chong Yidong
2010-05-03  6:00     ` Richard Stallman
2010-05-03 17:12     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mxwialgb.fsf@tux.homenetwork \
    --to=thierry.volpiatto@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).