[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 048cc03: Ensure `<menu-bar> <edit> <clear>' handles rectangular r
From: |
Stefan Monnier |
Subject: |
master 048cc03: Ensure `<menu-bar> <edit> <clear>' handles rectangular regions |
Date: |
Fri, 7 May 2021 21:49:20 -0400 (EDT) |
branch: master
commit 048cc03290abc786f439ee9838c15a81541af2aa
Author: Jim Porter <jporterbugs@gmail.com>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
Ensure `<menu-bar> <edit> <clear>' handles rectangular regions
* lisp/delsel.el (delete-active-region): Autoload it and make it
interactive.
* lisp/menu-bar.el (menu-bar-edit-menu): Bind "Clear" to
`delete-active-region'.
---
etc/NEWS | 3 +++
lisp/delsel.el | 2 ++
lisp/menu-bar.el | 2 +-
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/etc/NEWS b/etc/NEWS
index d5519de..9f4ded3 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -299,6 +299,9 @@ prompt, and how you can tweak the file size threshold.
** A prefix arg now causes 'delete-other-frames' to only iconify frames
+++
+** The "Edit => Clear" menu item now obeys a rectangular region
+
++++
** New command 'execute-extended-command-for-buffer'.
This new command, bound to 'M-S-x', works like
'execute-extended-command', but limits the set of commands to the
diff --git a/lisp/delsel.el b/lisp/delsel.el
index 9823203..96a9dcc 100644
--- a/lisp/delsel.el
+++ b/lisp/delsel.el
@@ -84,9 +84,11 @@ information on adapting behavior of commands in Delete
Selection mode."
(defvar delsel--replace-text-or-position nil)
+;;;###autoload
(defun delete-active-region (&optional killp)
"Delete the active region.
If KILLP in not-nil, the active region is killed instead of deleted."
+ (interactive "P")
(cond
(killp
;; Don't allow `kill-region' to change the value of `this-command'.
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index d8cdeb1..ef7235c 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -492,7 +492,7 @@
'(menu-item "Select All" mark-whole-buffer
:help "Mark the whole buffer for a subsequent cut/copy"))
(bindings--define-key menu [clear]
- '(menu-item "Clear" delete-region
+ '(menu-item "Clear" delete-active-region
:enable (and mark-active
(not buffer-read-only))
:help
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 048cc03: Ensure `<menu-bar> <edit> <clear>' handles rectangular regions,
Stefan Monnier <=