comparison lisp/epa.el @ 96760:b056a93eb26f

(epa-key-list-mode): Use run-mode-hooks. (epa-key-mode): Ditto. (epa-info-mode): Ditto.
author Daiki Ueno <ueno@unixuser.org>
date Thu, 17 Jul 2008 06:21:14 +0000
parents ee5932bf781d
children 73388588c9b4
comparison
equal deleted inserted replaced
96759:1e2f7aab70ba 96760:b056a93eb26f
325 ;; if buffer-file-name is not set. 325 ;; if buffer-file-name is not set.
326 (font-lock-set-defaults) 326 (font-lock-set-defaults)
327 (make-local-variable 'epa-exit-buffer-function) 327 (make-local-variable 'epa-exit-buffer-function)
328 (make-local-variable 'revert-buffer-function) 328 (make-local-variable 'revert-buffer-function)
329 (setq revert-buffer-function 'epa--key-list-revert-buffer) 329 (setq revert-buffer-function 'epa--key-list-revert-buffer)
330 (run-hooks 'epa-key-list-mode-hook)) 330 (run-mode-hooks 'epa-key-list-mode-hook))
331 331
332 (defun epa-key-mode () 332 (defun epa-key-mode ()
333 "Major mode for a key description." 333 "Major mode for a key description."
334 (kill-all-local-variables) 334 (kill-all-local-variables)
335 (buffer-disable-undo) 335 (buffer-disable-undo)
342 (setq font-lock-defaults '(epa-font-lock-keywords t)) 342 (setq font-lock-defaults '(epa-font-lock-keywords t))
343 ;; In XEmacs, auto-initialization of font-lock is not effective 343 ;; In XEmacs, auto-initialization of font-lock is not effective
344 ;; if buffer-file-name is not set. 344 ;; if buffer-file-name is not set.
345 (font-lock-set-defaults) 345 (font-lock-set-defaults)
346 (make-local-variable 'epa-exit-buffer-function) 346 (make-local-variable 'epa-exit-buffer-function)
347 (run-hooks 'epa-key-mode-hook)) 347 (run-mode-hooks 'epa-key-mode-hook))
348 348
349 (defun epa-info-mode () 349 (defun epa-info-mode ()
350 "Major mode for `epa-info-buffer'." 350 "Major mode for `epa-info-buffer'."
351 (kill-all-local-variables) 351 (kill-all-local-variables)
352 (buffer-disable-undo) 352 (buffer-disable-undo)
353 (setq major-mode 'epa-info-mode 353 (setq major-mode 'epa-info-mode
354 mode-name "Info" 354 mode-name "Info"
355 truncate-lines t 355 truncate-lines t
356 buffer-read-only t) 356 buffer-read-only t)
357 (use-local-map epa-info-mode-map) 357 (use-local-map epa-info-mode-map)
358 (run-hooks 'epa-info-mode-hook)) 358 (run-mode-hooks 'epa-info-mode-hook))
359 359
360 (defun epa-mark-key (&optional arg) 360 (defun epa-mark-key (&optional arg)
361 "Mark a key on the current line. 361 "Mark a key on the current line.
362 If ARG is non-nil, unmark the key." 362 If ARG is non-nil, unmark the key."
363 (interactive "P") 363 (interactive "P")