diff options
| author | Stefan Monnier | 2002-09-11 20:46:33 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2002-09-11 20:46:33 +0000 |
| commit | 6710df484af69864c0d50a0b4976b0ffb1293f34 (patch) | |
| tree | 490d8f9a19126bb9a12bef311281e217ed04fbea | |
| parent | 3bce024300531c76f289ded383393921af47bd41 (diff) | |
| download | emacs-6710df484af69864c0d50a0b4976b0ffb1293f34.tar.gz emacs-6710df484af69864c0d50a0b4976b0ffb1293f34.zip | |
(transient-mark-mode, line-number-mode, column-number-mode):
Use define-minor-mode.
(define-mail-user-agent): Delete. Moved to subr.el.
| -rw-r--r-- | lisp/simple.el | 73 |
1 files changed, 6 insertions, 67 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 01a2bb5f594..4f70325f504 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -2484,7 +2484,7 @@ With prefix arg, `transient-mark-mode' is enabled temporarily." | |||
| 2484 | (goto-char omark) | 2484 | (goto-char omark) |
| 2485 | nil))) | 2485 | nil))) |
| 2486 | 2486 | ||
| 2487 | (defun transient-mark-mode (arg) | 2487 | (define-minor-mode transient-mark-mode |
| 2488 | "Toggle Transient Mark mode. | 2488 | "Toggle Transient Mark mode. |
| 2489 | With arg, turn Transient Mark mode on if arg is positive, off otherwise. | 2489 | With arg, turn Transient Mark mode on if arg is positive, off otherwise. |
| 2490 | 2490 | ||
| @@ -2505,15 +2505,7 @@ default part of the buffer's text. Examples of such commands include | |||
| 2505 | \\[apropos-documentation] and type \"transient\" or \"mark.*active\" at | 2505 | \\[apropos-documentation] and type \"transient\" or \"mark.*active\" at |
| 2506 | the prompt, to see the documentation of commands which are sensitive to | 2506 | the prompt, to see the documentation of commands which are sensitive to |
| 2507 | the Transient Mark mode." | 2507 | the Transient Mark mode." |
| 2508 | (interactive "P") | 2508 | :global t :group 'editing-basics) |
| 2509 | (setq transient-mark-mode | ||
| 2510 | (if (null arg) | ||
| 2511 | (not transient-mark-mode) | ||
| 2512 | (> (prefix-numeric-value arg) 0))) | ||
| 2513 | (if (interactive-p) | ||
| 2514 | (if transient-mark-mode | ||
| 2515 | (message "Transient Mark mode enabled") | ||
| 2516 | (message "Transient Mark mode disabled")))) | ||
| 2517 | 2509 | ||
| 2518 | (defun pop-global-mark () | 2510 | (defun pop-global-mark () |
| 2519 | "Pop off global mark ring and jump to the top location." | 2511 | "Pop off global mark ring and jump to the top location." |
| @@ -3284,12 +3276,7 @@ specialization of overwrite-mode, entered by setting the | |||
| 3284 | 'overwrite-mode-binary)) | 3276 | 'overwrite-mode-binary)) |
| 3285 | (force-mode-line-update)) | 3277 | (force-mode-line-update)) |
| 3286 | 3278 | ||
| 3287 | (defcustom line-number-mode t | 3279 | (define-minor-mode line-number-mode |
| 3288 | "*Non-nil means display line number in mode line." | ||
| 3289 | :type 'boolean | ||
| 3290 | :group 'editing-basics) | ||
| 3291 | |||
| 3292 | (defun line-number-mode (arg) | ||
| 3293 | "Toggle Line Number mode. | 3280 | "Toggle Line Number mode. |
| 3294 | With arg, turn Line Number mode on iff arg is positive. | 3281 | With arg, turn Line Number mode on iff arg is positive. |
| 3295 | When Line Number mode is enabled, the line number appears | 3282 | When Line Number mode is enabled, the line number appears |
| @@ -3298,27 +3285,14 @@ in the mode line. | |||
| 3298 | Line numbers do not appear for very large buffers and buffers | 3285 | Line numbers do not appear for very large buffers and buffers |
| 3299 | with very long lines; see variables `line-number-display-limit' | 3286 | with very long lines; see variables `line-number-display-limit' |
| 3300 | and `line-number-display-limit-width'." | 3287 | and `line-number-display-limit-width'." |
| 3301 | (interactive "P") | 3288 | :init-value t :global t :group 'editing-basics) |
| 3302 | (setq line-number-mode | ||
| 3303 | (if (null arg) (not line-number-mode) | ||
| 3304 | (> (prefix-numeric-value arg) 0))) | ||
| 3305 | (force-mode-line-update)) | ||
| 3306 | |||
| 3307 | (defcustom column-number-mode nil | ||
| 3308 | "*Non-nil means display column number in mode line." | ||
| 3309 | :type 'boolean | ||
| 3310 | :group 'editing-basics) | ||
| 3311 | 3289 | ||
| 3312 | (defun column-number-mode (arg) | 3290 | (define-minor-mode column-number-mode |
| 3313 | "Toggle Column Number mode. | 3291 | "Toggle Column Number mode. |
| 3314 | With arg, turn Column Number mode on iff arg is positive. | 3292 | With arg, turn Column Number mode on iff arg is positive. |
| 3315 | When Column Number mode is enabled, the column number appears | 3293 | When Column Number mode is enabled, the column number appears |
| 3316 | in the mode line." | 3294 | in the mode line." |
| 3317 | (interactive "P") | 3295 | :global t :group 'editing-basics) |
| 3318 | (setq column-number-mode | ||
| 3319 | (if (null arg) (not column-number-mode) | ||
| 3320 | (> (prefix-numeric-value arg) 0))) | ||
| 3321 | (force-mode-line-update)) | ||
| 3322 | 3296 | ||
| 3323 | (defgroup paren-blinking nil | 3297 | (defgroup paren-blinking nil |
| 3324 | "Blinking matching of parens and expressions." | 3298 | "Blinking matching of parens and expressions." |
| @@ -3543,41 +3517,6 @@ See also `read-mail-command' concerning reading mail." | |||
| 3543 | (function :tag "Other")) | 3517 | (function :tag "Other")) |
| 3544 | :group 'mail) | 3518 | :group 'mail) |
| 3545 | 3519 | ||
| 3546 | (defun define-mail-user-agent (symbol composefunc sendfunc | ||
| 3547 | &optional abortfunc hookvar) | ||
| 3548 | "Define a symbol to identify a mail-sending package for `mail-user-agent'. | ||
| 3549 | |||
| 3550 | SYMBOL can be any Lisp symbol. Its function definition and/or | ||
| 3551 | value as a variable do not matter for this usage; we use only certain | ||
| 3552 | properties on its property list, to encode the rest of the arguments. | ||
| 3553 | |||
| 3554 | COMPOSEFUNC is program callable function that composes an outgoing | ||
| 3555 | mail message buffer. This function should set up the basics of the | ||
| 3556 | buffer without requiring user interaction. It should populate the | ||
| 3557 | standard mail headers, leaving the `to:' and `subject:' headers blank | ||
| 3558 | by default. | ||
| 3559 | |||
| 3560 | COMPOSEFUNC should accept several optional arguments--the same | ||
| 3561 | arguments that `compose-mail' takes. See that function's documentation. | ||
| 3562 | |||
| 3563 | SENDFUNC is the command a user would run to send the message. | ||
| 3564 | |||
| 3565 | Optional ABORTFUNC is the command a user would run to abort the | ||
| 3566 | message. For mail packages that don't have a separate abort function, | ||
| 3567 | this can be `kill-buffer' (the equivalent of omitting this argument). | ||
| 3568 | |||
| 3569 | Optional HOOKVAR is a hook variable that gets run before the message | ||
| 3570 | is actually sent. Callers that use the `mail-user-agent' may | ||
| 3571 | install a hook function temporarily on this hook variable. | ||
| 3572 | If HOOKVAR is nil, `mail-send-hook' is used. | ||
| 3573 | |||
| 3574 | The properties used on SYMBOL are `composefunc', `sendfunc', | ||
| 3575 | `abortfunc', and `hookvar'." | ||
| 3576 | (put symbol 'composefunc composefunc) | ||
| 3577 | (put symbol 'sendfunc sendfunc) | ||
| 3578 | (put symbol 'abortfunc (or abortfunc 'kill-buffer)) | ||
| 3579 | (put symbol 'hookvar (or hookvar 'mail-send-hook))) | ||
| 3580 | |||
| 3581 | (define-mail-user-agent 'sendmail-user-agent | 3520 | (define-mail-user-agent 'sendmail-user-agent |
| 3582 | 'sendmail-user-agent-compose | 3521 | 'sendmail-user-agent-compose |
| 3583 | 'mail-send-and-exit) | 3522 | 'mail-send-and-exit) |