Mercurial > emacs
comparison lisp/emacs-lisp/checkdoc.el @ 64379:12443a1e01ee
(checkdoc-make-overlay, checkdoc-overlay-put, checkdoc-delete-overlay)
(checkdoc-overlay-start, checkdoc-overlay-end)
(checkdoc-mode-line-update, checkdoc-char=):
Define such that compiler knows they are defined.
(checkdoc-call-eval-buffer): Deleted. Use eval-buffer directly.
(checkdoc-read-event): Deleted. Use read-event directly.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 16 Jul 2005 17:16:57 +0000 |
parents | 176ffa79bdd8 |
children | 5b1a238fcbb4 187d6a1f84f7 |
comparison
equal
deleted
inserted
replaced
64378:89982901a9ad | 64379:12443a1e01ee |
---|---|
428 ) | 428 ) |
429 | 429 |
430 | 430 |
431 ;;; Compatibility | 431 ;;; Compatibility |
432 ;; | 432 ;; |
433 (if (string-match "X[Ee]macs" emacs-version) | 433 (defalias 'checkdoc-make-overlay |
434 (progn | 434 (if (featurep 'xemacs) 'make-extent 'make-overlay)) |
435 (defalias 'checkdoc-make-overlay 'make-extent) | 435 (defalias 'checkdoc-overlay-put |
436 (defalias 'checkdoc-overlay-put 'set-extent-property) | 436 (if (featurep 'xemacs) 'set-extent-property 'overlay-put)) |
437 (defalias 'checkdoc-delete-overlay 'delete-extent) | 437 (defalias 'checkdoc-delete-overlay |
438 (defalias 'checkdoc-overlay-start 'extent-start) | 438 (if (featurep 'xemacs) 'delete-extent 'delete-overlay)) |
439 (defalias 'checkdoc-overlay-end 'extent-end) | 439 (defalias 'checkdoc-overlay-start |
440 (defalias 'checkdoc-mode-line-update 'redraw-modeline) | 440 (if (featurep 'xemacs) 'extent-start 'overlay-start)) |
441 (defalias 'checkdoc-call-eval-buffer 'eval-buffer) | 441 (defalias 'checkdoc-overlay-end |
442 ) | 442 (if (featurep 'xemacs) 'extent-end 'overlay-end)) |
443 (defalias 'checkdoc-make-overlay 'make-overlay) | 443 (defalias 'checkdoc-mode-line-update |
444 (defalias 'checkdoc-overlay-put 'overlay-put) | 444 (if (featurep 'xemacs) 'redraw-modeline 'force-mode-line-update)) |
445 (defalias 'checkdoc-delete-overlay 'delete-overlay) | 445 (defalias 'checkdoc-char= |
446 (defalias 'checkdoc-overlay-start 'overlay-start) | 446 (if (featurep 'xemacs) 'char= '=)) |
447 (defalias 'checkdoc-overlay-end 'overlay-end) | |
448 (defalias 'checkdoc-mode-line-update 'force-mode-line-update) | |
449 (defalias 'checkdoc-call-eval-buffer 'eval-current-buffer) | |
450 ) | |
451 | |
452 ;; Emacs 20s have MULE characters which don't equate to numbers. | |
453 (if (fboundp 'char=) | |
454 (defalias 'checkdoc-char= 'char=) | |
455 (defalias 'checkdoc-char= '=)) | |
456 | |
457 ;; Read events, not characters | |
458 (defalias 'checkdoc-read-event 'read-event) | |
459 | 447 |
460 ;;; User level commands | 448 ;;; User level commands |
461 ;; | 449 ;; |
462 ;;;###autoload | 450 ;;;###autoload |
463 (defun checkdoc () | 451 (defun checkdoc () |
626 "" "f,")) | 614 "" "f,")) |
627 (save-excursion | 615 (save-excursion |
628 (goto-char (checkdoc-error-start (car (car err-list)))) | 616 (goto-char (checkdoc-error-start (car (car err-list)))) |
629 (if (not (pos-visible-in-window-p)) | 617 (if (not (pos-visible-in-window-p)) |
630 (recenter (- (window-height) 2))) | 618 (recenter (- (window-height) 2))) |
631 (setq c (checkdoc-read-event))) | 619 (setq c (read-event))) |
632 (if (not (integerp c)) (setq c ??)) | 620 (if (not (integerp c)) (setq c ??)) |
633 (cond | 621 (cond |
634 ;; Exit condition | 622 ;; Exit condition |
635 ((checkdoc-char= c ?\C-g) (signal 'quit nil)) | 623 ((checkdoc-char= c ?\C-g) (signal 'quit nil)) |
636 ;; Request an auto-fix | 624 ;; Request an auto-fix |
842 "Evaluate and check documentation for the current buffer. | 830 "Evaluate and check documentation for the current buffer. |
843 Evaluation is done first because good documentation for something that | 831 Evaluation is done first because good documentation for something that |
844 doesn't work is just not useful. Comments, doc strings, and rogue | 832 doesn't work is just not useful. Comments, doc strings, and rogue |
845 spacing are all verified." | 833 spacing are all verified." |
846 (interactive) | 834 (interactive) |
847 (checkdoc-call-eval-buffer nil) | 835 (eval-buffer nil) |
848 (checkdoc-current-buffer t)) | 836 (checkdoc-current-buffer t)) |
849 | 837 |
850 ;;;###autoload | 838 ;;;###autoload |
851 (defun checkdoc-current-buffer (&optional take-notes) | 839 (defun checkdoc-current-buffer (&optional take-notes) |
852 "Check current buffer for document, comment, error style, and rogue spaces. | 840 "Check current buffer for document, comment, error style, and rogue spaces. |