From 775c33bff4f420d22813b9fd0de9a9a19677375a Mon Sep 17 00:00:00 2001 From: Markus Rost Date: Tue, 10 Sep 2002 01:32:59 +0000 Subject: [PATCH] (transient-mark-mode, line-number-mode, column-number-mode): Undo the recent change in 2002-09-09T22:09:14Z!monnier@iro.umontreal.ca. The use of define-minor-mode in simple.el creates bootstrap problems. --- lisp/ChangeLog | 7 +++++++ lisp/simple.el | 38 ++++++++++++++++++++++++++++++++------ 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ddfc6be823a..686c77ed1f4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2002-09-09 Markus Rost + + * simple.el (transient-mark-mode, line-number-mode, + column-number-mode): Undo the recent change in 2002-09-09T22:09:14Z!monnier@iro.umontreal.ca. + The use of define-minor-mode in simple.el creates bootstrap + problems. + 2002-09-10 Miles Bader * simple.el (do-auto-fill): `fill-indent-according-to-mode' is a diff --git a/lisp/simple.el b/lisp/simple.el index 99cf8d8af63..01a2bb5f594 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2484,7 +2484,7 @@ With prefix arg, `transient-mark-mode' is enabled temporarily." (goto-char omark) nil))) -(define-minor-mode transient-mark-mode +(defun transient-mark-mode (arg) "Toggle Transient Mark mode. With arg, turn Transient Mark mode on if arg is positive, off otherwise. @@ -2505,7 +2505,15 @@ default part of the buffer's text. Examples of such commands include \\[apropos-documentation] and type \"transient\" or \"mark.*active\" at the prompt, to see the documentation of commands which are sensitive to the Transient Mark mode." - :global t :group 'editing-basics) + (interactive "P") + (setq transient-mark-mode + (if (null arg) + (not transient-mark-mode) + (> (prefix-numeric-value arg) 0))) + (if (interactive-p) + (if transient-mark-mode + (message "Transient Mark mode enabled") + (message "Transient Mark mode disabled")))) (defun pop-global-mark () "Pop off global mark ring and jump to the top location." @@ -3276,7 +3284,12 @@ specialization of overwrite-mode, entered by setting the 'overwrite-mode-binary)) (force-mode-line-update)) -(define-minor-mode line-number-mode +(defcustom line-number-mode t + "*Non-nil means display line number in mode line." + :type 'boolean + :group 'editing-basics) + +(defun line-number-mode (arg) "Toggle Line Number mode. With arg, turn Line Number mode on iff arg is positive. When Line Number mode is enabled, the line number appears @@ -3285,14 +3298,27 @@ in the mode line. Line numbers do not appear for very large buffers and buffers with very long lines; see variables `line-number-display-limit' and `line-number-display-limit-width'." - :init-value t :global t :group 'editing-basics) + (interactive "P") + (setq line-number-mode + (if (null arg) (not line-number-mode) + (> (prefix-numeric-value arg) 0))) + (force-mode-line-update)) + +(defcustom column-number-mode nil + "*Non-nil means display column number in mode line." + :type 'boolean + :group 'editing-basics) -(define-minor-mode column-number-mode +(defun column-number-mode (arg) "Toggle Column Number mode. With arg, turn Column Number mode on iff arg is positive. When Column Number mode is enabled, the column number appears in the mode line." - :global t :group 'editing-basics) + (interactive "P") + (setq column-number-mode + (if (null arg) (not column-number-mode) + (> (prefix-numeric-value arg) 0))) + (force-mode-line-update)) (defgroup paren-blinking nil "Blinking matching of parens and expressions." -- 2.39.5