+2010-11-11 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * smime.el (smime-mode-map): Move initialization into declaration.
+ (gnus-run-mode-hooks): Don't autoload.
+ (smime-mode): Use define-derived-mode.
+
2010-11-11 Glenn Morris <rgm@gnu.org>
* smime.el (from): Restrict declaration to XEmacs.
(defvar smime-buffer "*SMIME*")
-(defvar smime-mode-map nil)
-(put 'smime-mode 'mode-class 'special)
-
-(unless smime-mode-map
- (setq smime-mode-map (make-sparse-keymap))
- (suppress-keymap smime-mode-map)
-
- (define-key smime-mode-map "q" 'smime-exit)
- (define-key smime-mode-map "f" 'smime-certificate-info))
+(defvar smime-mode-map
+ (let ((map (make-sparse-keymap)))
+ (suppress-keymap map)
+ (define-key map "q" 'smime-exit)
+ (define-key map "f" 'smime-certificate-info)
+ map))
-(autoload 'gnus-run-mode-hooks "gnus-util")
(autoload 'gnus-completing-read "gnus-util")
-(defun smime-mode ()
+(put 'smime-mode 'mode-class 'special)
+(define-derived-mode smime-mode fundamental-mode ;special-mode
+ "SMIME"
"Major mode for browsing, viewing and fetching certificates.
All normal editing commands are switched off.
The following commands are available:
\\{smime-mode-map}"
- (interactive)
- (kill-all-local-variables)
- (setq major-mode 'smime-mode)
- (setq mode-name "SMIME")
(setq mode-line-process nil)
- (use-local-map smime-mode-map)
(buffer-disable-undo)
(setq truncate-lines t)
- (setq buffer-read-only t)
- (gnus-run-mode-hooks 'smime-mode-hook))
+ (setq buffer-read-only t))
(defun smime-certificate-info (certfile)
(interactive "fCertificate file: ")