comparison lisp/replace.el @ 47111:356bbdda5f67

(occur-mode-hook): New hook. (occur-mode): Use it. (occur-hook): Set default to nil.
author Juanma Barranquero <lekktu@gmail.com>
date Thu, 29 Aug 2002 21:35:44 +0000
parents 756de7be303c
children 454f46344502
comparison
equal deleted inserted replaced
47110:ce17d4a1d32e 47111:356bbdda5f67
462 462
463 (defvar occur-revert-arguments nil 463 (defvar occur-revert-arguments nil
464 "Arguments to pass to `occur-1' to revert an Occur mode buffer. 464 "Arguments to pass to `occur-1' to revert an Occur mode buffer.
465 See `occur-revert-function'.") 465 See `occur-revert-function'.")
466 466
467 (defcustom occur-hook '(turn-on-font-lock) 467 (defcustom occur-mode-hook '(turn-on-font-lock)
468 "Hooks run when `occur' is called." 468 "Hook run when entering Occur mode."
469 :type 'hook
470 :group 'matching)
471
472 (defcustom occur-hook nil
473 "Hook run when `occur' is called."
469 :type 'hook 474 :type 'hook
470 :group 'matching) 475 :group 'matching)
471 476
472 (put 'occur-mode 'mode-class 'special) 477 (put 'occur-mode 'mode-class 'special)
473 (defun occur-mode () 478 (defun occur-mode ()
480 (kill-all-local-variables) 485 (kill-all-local-variables)
481 (use-local-map occur-mode-map) 486 (use-local-map occur-mode-map)
482 (setq major-mode 'occur-mode) 487 (setq major-mode 'occur-mode)
483 (setq mode-name "Occur") 488 (setq mode-name "Occur")
484 (set (make-local-variable 'revert-buffer-function) 'occur-revert-function) 489 (set (make-local-variable 'revert-buffer-function) 'occur-revert-function)
485 (make-local-variable 'occur-revert-arguments)) 490 (make-local-variable 'occur-revert-arguments)
491 (run-hooks 'occur-mode-hook))
486 492
487 (defun occur-revert-function (ignore1 ignore2) 493 (defun occur-revert-function (ignore1 ignore2)
488 "Handle `revert-buffer' for Occur mode buffers." 494 "Handle `revert-buffer' for Occur mode buffers."
489 (apply 'occur-1 (append occur-revert-arguments (list (buffer-name))))) 495 (apply 'occur-1 (append occur-revert-arguments (list (buffer-name)))))
490 496