diff options
| author | Stefan Monnier | 2010-11-11 17:24:03 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2010-11-11 17:24:03 -0500 |
| commit | ec54e7a421075e0b973d72dbf0ab099a328dbe8a (patch) | |
| tree | e7c6873d0fc29f99be693d529e7d3697497b31e2 | |
| parent | 1a4236eaba106cda719f9de42cb7f72ad20f5d45 (diff) | |
| download | emacs-ec54e7a421075e0b973d72dbf0ab099a328dbe8a.tar.gz emacs-ec54e7a421075e0b973d72dbf0ab099a328dbe8a.zip | |
* lisp/gnus/smime.el (smime-mode): Use define-derived-mode.
(smime-mode-map): Move initialization into declaration.
(gnus-run-mode-hooks): Don't autoload.
| -rw-r--r-- | lisp/gnus/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/gnus/smime.el | 28 |
2 files changed, 16 insertions, 18 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 2121671c01f..0365b34e8ee 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2010-11-11 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * smime.el (smime-mode-map): Move initialization into declaration. | ||
| 4 | (gnus-run-mode-hooks): Don't autoload. | ||
| 5 | (smime-mode): Use define-derived-mode. | ||
| 6 | |||
| 1 | 2010-11-11 Glenn Morris <rgm@gnu.org> | 7 | 2010-11-11 Glenn Morris <rgm@gnu.org> |
| 2 | 8 | ||
| 3 | * smime.el (from): Restrict declaration to XEmacs. | 9 | * smime.el (from): Restrict declaration to XEmacs. |
diff --git a/lisp/gnus/smime.el b/lisp/gnus/smime.el index b8ee4c19924..5363a40c727 100644 --- a/lisp/gnus/smime.el +++ b/lisp/gnus/smime.el | |||
| @@ -649,20 +649,18 @@ A string or a list of strings is returned." | |||
| 649 | 649 | ||
| 650 | (defvar smime-buffer "*SMIME*") | 650 | (defvar smime-buffer "*SMIME*") |
| 651 | 651 | ||
| 652 | (defvar smime-mode-map nil) | 652 | (defvar smime-mode-map |
| 653 | (put 'smime-mode 'mode-class 'special) | 653 | (let ((map (make-sparse-keymap))) |
| 654 | 654 | (suppress-keymap map) | |
| 655 | (unless smime-mode-map | 655 | (define-key map "q" 'smime-exit) |
| 656 | (setq smime-mode-map (make-sparse-keymap)) | 656 | (define-key map "f" 'smime-certificate-info) |
| 657 | (suppress-keymap smime-mode-map) | 657 | map)) |
| 658 | |||
| 659 | (define-key smime-mode-map "q" 'smime-exit) | ||
| 660 | (define-key smime-mode-map "f" 'smime-certificate-info)) | ||
| 661 | 658 | ||
| 662 | (autoload 'gnus-run-mode-hooks "gnus-util") | ||
| 663 | (autoload 'gnus-completing-read "gnus-util") | 659 | (autoload 'gnus-completing-read "gnus-util") |
| 664 | 660 | ||
| 665 | (defun smime-mode () | 661 | (put 'smime-mode 'mode-class 'special) |
| 662 | (define-derived-mode smime-mode fundamental-mode ;special-mode | ||
| 663 | "SMIME" | ||
| 666 | "Major mode for browsing, viewing and fetching certificates. | 664 | "Major mode for browsing, viewing and fetching certificates. |
| 667 | 665 | ||
| 668 | All normal editing commands are switched off. | 666 | All normal editing commands are switched off. |
| @@ -671,16 +669,10 @@ All normal editing commands are switched off. | |||
| 671 | The following commands are available: | 669 | The following commands are available: |
| 672 | 670 | ||
| 673 | \\{smime-mode-map}" | 671 | \\{smime-mode-map}" |
| 674 | (interactive) | ||
| 675 | (kill-all-local-variables) | ||
| 676 | (setq major-mode 'smime-mode) | ||
| 677 | (setq mode-name "SMIME") | ||
| 678 | (setq mode-line-process nil) | 672 | (setq mode-line-process nil) |
| 679 | (use-local-map smime-mode-map) | ||
| 680 | (buffer-disable-undo) | 673 | (buffer-disable-undo) |
| 681 | (setq truncate-lines t) | 674 | (setq truncate-lines t) |
| 682 | (setq buffer-read-only t) | 675 | (setq buffer-read-only t)) |
| 683 | (gnus-run-mode-hooks 'smime-mode-hook)) | ||
| 684 | 676 | ||
| 685 | (defun smime-certificate-info (certfile) | 677 | (defun smime-certificate-info (certfile) |
| 686 | (interactive "fCertificate file: ") | 678 | (interactive "fCertificate file: ") |