[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/simple.el,v

From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/simple.el,v
Date: Sun, 23 Dec 2007 21:45:36 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Richard M. Stallman <rms>       07/12/23 21:45:36

Index: simple.el
RCS file: /cvsroot/emacs/emacs/lisp/simple.el,v
retrieving revision 1.890
retrieving revision 1.891
diff -u -b -r1.890 -r1.891
--- simple.el   6 Dec 2007 00:17:56 -0000       1.890
+++ simple.el   23 Dec 2007 21:45:35 -0000      1.891
@@ -3329,6 +3329,28 @@
     (run-hooks 'deactivate-mark-hook)
     (set-marker (mark-marker) nil)))
+(defcustom use-empty-active-region nil
+  "If non-nil, an active region takes control even if empty.
+This applies to certain commands which, in Transient Mark mode,
+apply to the active region if there is one.  If the setting is t,
+these commands apply to an empty active region if there is one.
+If the setting is nil, these commands treat an empty active
+region as if it were not active."
+  :type 'boolean
+  :version "23.1"
+  :group 'editing-basics)
+(defun region-active-p ()
+  "Return t if certain commands should apply to the region.
+Certain commands normally apply to text near point,
+but in Transient Mark mode when the mark is active they apply
+to the region instead.  Such commands should use this subroutine to
+test whether to do that.
+This function also obeys `use-empty-active-region'."
+  (and transient-mark-mode mark-active
+       (or use-empty-active-region (> (region-end) (region-beginning)))))
 (defvar mark-ring nil
   "The list of former marks of the current buffer, most recent first.")
 (make-variable-buffer-local 'mark-ring)

reply via email to

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