445 |
|
|
446 |
(put 'occur-mode 'mode-class 'special) |
(put 'occur-mode 'mode-class 'special) |
447 |
|
|
448 |
(define-derived-mode occur-mode nil "Occur" |
(defun occur-mode () |
449 |
"Major mode for output from \\[occur]. |
"Major mode for output from \\[occur]. |
450 |
\\<occur-mode-map>Move point to one of the items in this buffer, then use |
\\<occur-mode-map>Move point to one of the items in this buffer, then use |
451 |
\\[occur-mode-goto-occurrence] to go to the occurrence that the item refers to. |
\\[occur-mode-goto-occurrence] to go to the occurrence that the item refers to. |
452 |
Alternatively, click \\[occur-mode-mouse-goto] on an item to go to it. |
Alternatively, click \\[occur-mode-mouse-goto] on an item to go to it. |
453 |
|
|
454 |
\\{occur-mode-map}" |
\\{occur-mode-map}" |
455 |
|
(kill-all-local-variables) |
456 |
|
(use-local-map occur-mode-map) |
457 |
|
(setq major-mode 'occur-mode) |
458 |
|
(setq mode-name "Occur") |
459 |
|
(make-local-variable 'revert-buffer-function) |
460 |
|
(setq revert-buffer-function 'occur-revert-function) |
461 |
(set (make-local-variable 'revert-buffer-function) 'occur-revert-function) |
(set (make-local-variable 'revert-buffer-function) 'occur-revert-function) |
462 |
(make-local-variable 'occur-buffer) |
(make-local-variable 'occur-buffer) |
463 |
(make-local-variable 'occur-nlines) |
(make-local-variable 'occur-nlines) |
464 |
(make-local-variable 'occur-command-arguments)) |
(make-local-variable 'occur-command-arguments) |
465 |
|
(run-hooks 'occur-mode-hook)) |
466 |
|
|
467 |
(defun occur-revert-function (ignore1 ignore2) |
(defun occur-revert-function (ignore1 ignore2) |
468 |
"Handle `revert-buffer' for *Occur* buffers." |
"Handle `revert-buffer' for *Occur* buffers." |