]> git.eshelyaron.com Git - emacs.git/commitdiff
Ensure `<menu-bar> <edit> <clear>' handles rectangular regions
authorJim Porter <jporterbugs@gmail.com>
Mon, 3 May 2021 15:24:01 +0000 (08:24 -0700)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 8 May 2021 01:49:04 +0000 (21:49 -0400)
* 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
lisp/delsel.el
lisp/menu-bar.el

index d5519de421e685b3bd2cdb1ae42d381308f92040..9f4ded3aabad1fef3f6d2bc06f1ca657cdad806e 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -298,6 +298,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
index 982320340d853b55e9daf3fc2f3fdc20ae2c15ea..96a9dcc0c79706399ee19ce0bade0f70673491ab 100644 (file)
@@ -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'.
index d8cdeb101ada6e97e840f5564ac3189d32c2096d..ef7235cffa09691bce23987536a6f289712003ca 100644 (file)
       '(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