Mercurial > emacs
comparison lisp/progmodes/compile.el @ 2760:1c7595e3089b
(Setting minor-mode-map-alist):
Put the map directly in the alist, not a variable name.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 13 May 1993 03:14:07 +0000 |
parents | f80a342fd945 |
children | 539e7c93f8fa |
comparison
equal
deleted
inserted
replaced
2759:1c7b7ed1a12a | 2760:1c7595e3089b |
---|---|
29 | 29 |
30 ;;; Code: | 30 ;;; Code: |
31 | 31 |
32 ;;;###autoload | 32 ;;;###autoload |
33 (defvar compilation-mode-hook nil | 33 (defvar compilation-mode-hook nil |
34 "*List of hook functions run by compilation-mode (see `run-hooks').") | 34 "*List of hook functions run by `compilation-mode' (see `run-hooks').") |
35 | 35 |
36 ;;;###autoload | 36 ;;;###autoload |
37 (defconst compilation-window-height nil | 37 (defconst compilation-window-height nil |
38 "*Number of lines in a compilation window. If nil, use Emacs default.") | 38 "*Number of lines in a compilation window. If nil, use Emacs default.") |
39 | 39 |
334 (define-key map "\M-n" 'compilation-next-error) | 334 (define-key map "\M-n" 'compilation-next-error) |
335 (define-key map "\M-p" 'compilation-previous-error) | 335 (define-key map "\M-p" 'compilation-previous-error) |
336 (define-key map "\M-{" 'compilation-previous-file) | 336 (define-key map "\M-{" 'compilation-previous-file) |
337 (define-key map "\M-}" 'compilation-next-file) | 337 (define-key map "\M-}" 'compilation-next-file) |
338 map) | 338 map) |
339 "Keymap for compilation-minor-mode.") | 339 "Keymap for `compilation-minor-mode'.") |
340 | 340 |
341 (defvar compilation-mode-map | 341 (defvar compilation-mode-map |
342 (let ((map (cons 'keymap compilation-minor-mode-map))) | 342 (let ((map (cons 'keymap compilation-minor-mode-map))) |
343 (define-key map " " 'scroll-up) | 343 (define-key map " " 'scroll-up) |
344 (define-key map "\^?" 'scroll-down) | 344 (define-key map "\^?" 'scroll-down) |
345 map) | 345 map) |
346 "Keymap for compilation log buffers. | 346 "Keymap for compilation log buffers. |
347 compilation-minor-mode-map is a cdr of this.") | 347 `compilation-minor-mode-map' is a cdr of this.") |
348 | 348 |
349 (defun compilation-mode () | 349 (defun compilation-mode () |
350 "Major mode for compilation log buffers. | 350 "Major mode for compilation log buffers. |
351 \\<compilation-mode-map>To visit the source for a line-numbered error, | 351 \\<compilation-mode-map>To visit the source for a line-numbered error, |
352 move point to the error message line and type \\[compile-goto-error]. | 352 move point to the error message line and type \\[compile-goto-error]. |
378 | 378 |
379 (or (assq 'compilation-minor-mode minor-mode-alist) | 379 (or (assq 'compilation-minor-mode minor-mode-alist) |
380 (setq minor-mode-alist (cons '(compilation-minor-mode " Compilation") | 380 (setq minor-mode-alist (cons '(compilation-minor-mode " Compilation") |
381 minor-mode-alist))) | 381 minor-mode-alist))) |
382 (or (assq 'compilation-minor-mode minor-mode-map-alist) | 382 (or (assq 'compilation-minor-mode minor-mode-map-alist) |
383 (setq minor-mode-map-alist (cons '(compilation-minor-mode | 383 (setq minor-mode-map-alist (cons (cons 'compilation-minor-mode |
384 . compilation-minor-mode-map) | 384 compilation-minor-mode-map) |
385 minor-mode-map-alist))) | 385 minor-mode-map-alist))) |
386 | 386 |
387 (defun compilation-minor-mode (&optional arg) | 387 (defun compilation-minor-mode (&optional arg) |
388 "Toggle compilation minor mode. | 388 "Toggle compilation minor mode. |
389 With arg, turn compilation mode on if and only if arg is positive. | 389 With arg, turn compilation mode on if and only if arg is positive. |
439 (setq compilation-in-progress (delq proc compilation-in-progress)) | 439 (setq compilation-in-progress (delq proc compilation-in-progress)) |
440 )))) | 440 )))) |
441 | 441 |
442 (defun compilation-filter (proc string) | 442 (defun compilation-filter (proc string) |
443 "Process filter for compilation buffers. | 443 "Process filter for compilation buffers. |
444 Just inserts the text, but uses insert-before-markers." | 444 Just inserts the text, but uses `insert-before-markers'." |
445 (save-excursion | 445 (save-excursion |
446 (set-buffer (process-buffer proc)) | 446 (set-buffer (process-buffer proc)) |
447 (let ((buffer-read-only nil)) | 447 (let ((buffer-read-only nil)) |
448 (save-excursion | 448 (save-excursion |
449 (goto-char (process-mark proc)) | 449 (goto-char (process-mark proc)) |