From: Kim F. Storm Date: Fri, 30 Apr 2004 21:43:36 +0000 (+0000) Subject: (cua--convert-rectangle-as): New defmacro. X-Git-Tag: ttn-vms-21-2-B4~6494 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3b365de3add87176be77ba6d498a7c13376bd22a;p=emacs.git (cua--convert-rectangle-as): New defmacro. (cua-upcase-rectangle, cua-downcase-rectangle): Use it. (cua-upcase-initials-rectangle, cua-capitalize-rectangle): New commands (suggested by Jordan Breeding).. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b98e9b0532f..d688cf09a6e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2004-04-30 Kim F. Storm + * menu-bar.el (menu-bar-options-menu): Change menu text for CUA. + * mouse.el (mouse-drag-copy-region): New defcustom. (mouse-set-region, mouse-drag-region-1): Use it. diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el index fefd7001029..965fe63bced 100644 --- a/lisp/emulation/cua-rect.el +++ b/lisp/emulation/cua-rect.el @@ -1,6 +1,6 @@ ;;; cua-rect.el --- CUA unified rectangle support -;; Copyright (C) 1997-2002 Free Software Foundation, Inc. +;; Copyright (C) 1997-2002, 2004 Free Software Foundation, Inc. ;; Author: Kim F. Storm ;; Keywords: keyboard emulations convenience CUA @@ -1057,19 +1057,30 @@ The numbers are formatted according to the FORMAT string." (insert (format fmt first)) (setq first (+ first incr))))) +(defmacro cua--convert-rectangle-as (command) + `(cua--rectangle-operation 'clear nil nil nil + '(lambda (s e l r) + (,command s e)))) + (defun cua-upcase-rectangle () "Convert the rectangle to upper case." (interactive) - (cua--rectangle-operation 'clear nil nil nil - '(lambda (s e l r) - (upcase-region s e)))) + (cua--convert-rectangle-as upcase-region)) (defun cua-downcase-rectangle () "Convert the rectangle to lower case." (interactive) - (cua--rectangle-operation 'clear nil nil nil - '(lambda (s e l r) - (downcase-region s e)))) + (cua--convert-rectangle-as downcase-region)) + +(defun cua-upcase-initials-rectangle () + "Convert the rectangle initials to upper case." + (interactive) + (cua--convert-rectangle-as upcase-initials-region)) + +(defun cua-capitalize-rectangle () + "Convert the rectangle to proper case." + (interactive) + (cua--convert-rectangle-as capitalize-region)) ;;; Replace/rearrange text in current rectangle