From: Richard M. Stallman Date: Tue, 25 Dec 2007 23:00:07 +0000 (+0000) Subject: (allout-region-active-p): Renamed from my-region-active-p. Use `use-region-p'. X-Git-Tag: emacs-pretest-23.0.90~8832 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c60d543d8bb6468ba0b652d9923acd17d2087233;p=emacs.git (allout-region-active-p): Renamed from my-region-active-p. Use `use-region-p'. (allout-write-file-hook-handler): Simplify code. --- diff --git a/etc/NEWS b/etc/NEWS index 56ddf7531ce..c71fb2ae349 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -450,9 +450,14 @@ variable as having been made within Custom. ** `frame-inherited-parameters' lets new frames inherit parameters from the selected frame. -** Commands should use `region-active-p' to test whether there is +** Commands should use `use-region-p' to test whether there is an active region that they should operate on. +** `region-active-p' returns non-nil when Transient Mark mode +is enabled and there is an active region. This is NOT the best function +to use to test whether a command should operate on the region instead +of the usual behavior -- for that, use `use-region-p'. + ** New keymap `input-decode-map' overrides like key-translation-map, but applies before function-key-map. Also it is terminal-local contrary to key-translation-map. Terminal-specific key-sequences are generally added to diff --git a/lisp/ChangeLog b/lisp/ChangeLog index af3dc434448..f4533083e2c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -11,11 +11,39 @@ 2007-12-25 Richard Stallman + * allout.el (allout-region-active-p): Renamed from my-region-active-p. + Use `use-region-p'. + (allout-write-file-hook-handler): Simplify code. + + * ps-print.el (ps-mark-active-p): Function deleted. + (ps-print-preprint-region): Use (mark) for the error check. + + * tooltip.el (tooltip-region-active-p): Use `use-region-p'. + + * winner.el (winner-active-region): Use `mark-active' if it's defined. + + * progmodes/ada-mode.el (ada-region-selected): Use `use-region-p'. + + * textmodes/org.el (org-region-active-p): Use `use-region-p'. + + * progmodes/idlwave.el (idlwave-region-active-p): Use `use-region-p'. + + * textmodes/reftex.el (reftex-region-active-p): Use `use-region-p'. + + * progmodes/cc-defs.el (c-region-is-active-p): + Use `mark-active' if it's defined. + + * progmodes/cc-cmds.el (c-indent-line-or-region): + Pass prefix arg to `c-indent-command'. Use `use-region-p'. + * simple.el (select-active-regions): New option. (set-mark): Obey it. (yank-pop-change-selection): New option. (current-kill): Obey it. + * simple.el (use-region-p): Renamed from `region-active-p'. + (region-active-p): New function. + 2007-12-25 David Golden (tiny change) * term/x-win.el (x-select-enable-primary): New option. diff --git a/lisp/allout.el b/lisp/allout.el index 8878c56735f..12c1b3941c3 100644 --- a/lisp/allout.el +++ b/lisp/allout.el @@ -1501,11 +1501,11 @@ See `allout-encryption-ciphertext-rejection-regexps' for rejection reasons.") (condition-case failure (setq allout-after-save-decrypt (allout-encrypt-decrypted except-mark)) - (error (progn - (message - "allout-write-file-hook-handler suppressing error %s" - failure) - (sit-for 2)))))) + (message "allout-write-file-hook-handler suppressing error %s" + failure) + (sit-for 2) + (error "allout-write-file-hook-handler suppressing error %s" + failure)))) )) nil) ;;;_ > allout-auto-save-hook-handler () @@ -5457,11 +5457,11 @@ header and body. The elements of that list are: (cdr format))))))) ;; Put the list with first at front, to last at back: (nreverse result)))) -;;;_ > my-region-active-p () -(defmacro my-region-active-p () - (if (fboundp 'region-active-p) - '(region-active-p) - 'mark-active)) +;;;_ > allout-region-active-p () +(defmacro allout-region-active-p () + (if (fboundp 'use-region-p) + '(use-region-p) + '(region-active-p))) ;;;_ > allout-process-exposed (&optional func from to frombuf ;;; tobuf format) (defun allout-process-exposed (&optional func from to frombuf tobuf @@ -5494,7 +5494,7 @@ Defaults: ; defaulting if necessary: (if (not func) (setq func 'allout-insert-listified)) (if (not (and from to)) - (if (my-region-active-p) + (if (allout-region-active-p) (setq from (region-beginning) to (region-end)) (setq from (point-min) to (point-max)))) (if frombuf