From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Eric M. Ludlam" Newsgroups: gmane.emacs.devel Subject: Re[1]: checkdoc and compile Date: Fri, 23 Apr 2004 18:14:18 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200404232214.i3NMEI94022874@projectile.siege-engine.com> References: NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1082758641 6279 80.91.224.253 (23 Apr 2004 22:17:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 23 Apr 2004 22:17:21 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sat Apr 24 00:17:11 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BH8yt-0002aQ-00 for ; Sat, 24 Apr 2004 00:17:11 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BH8ys-0006Vw-00 for ; Sat, 24 Apr 2004 00:17:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BH8x4-0001aw-Cv for emacs-devel@quimby.gnus.org; Fri, 23 Apr 2004 18:15:18 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BH8ws-0001U7-E6 for emacs-devel@gnu.org; Fri, 23 Apr 2004 18:15:06 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BH8wD-0000g2-FN for emacs-devel@gnu.org; Fri, 23 Apr 2004 18:14:58 -0400 Original-Received: from [68.162.221.229] (helo=projectile.siege-engine.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.30) id 1BH8wC-0000cS-DX for emacs-devel@gnu.org; Fri, 23 Apr 2004 18:14:24 -0400 Original-Received: from projectile.siege-engine.com (localhost.localdomain [127.0.0.1]) by projectile.siege-engine.com (8.12.8/8.12.8) with ESMTP id i3NMEIAA022878; Fri, 23 Apr 2004 18:14:19 -0400 Original-Received: (from zappo@localhost) by projectile.siege-engine.com (8.12.8/8.12.8/Submit) id i3NMEI94022874; Fri, 23 Apr 2004 18:14:18 -0400 X-Authentication-Warning: projectile.siege-engine.com: zappo set sender to eric@siege-engine.com using -f Original-To: Stefan Monnier In-reply-to: (message from Stefan Monnier on 23 Apr 2004 14:22:33 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:22085 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:22085 A clever enhancement. That looks great. Thanks for asking. Eric >>> Stefan Monnier seems to think that: > >Any objection to my installing the following patch into Emacs's >CVS repository? > > > Stefan > > >--- orig/lisp/emacs-lisp/checkdoc.el >+++ mod/lisp/emacs-lisp/checkdoc.el >@@ -2583,52 +2583,23 @@ > ;;; Warning management > ;; > (defvar checkdoc-output-font-lock-keywords >- '(("\\(\\w+\\.el\\): \\(\\w+\\)" >+ '(("^\\*\\*\\* \\(.+\\.el\\): \\([^ \n]+\\)" > (1 font-lock-function-name-face) >- (2 font-lock-comment-face)) >- ("^\\(\\w+\\.el\\):" 1 font-lock-function-name-face) >- (":\\([0-9]+\\):" 1 font-lock-constant-face)) >+ (2 font-lock-comment-face))) > "Keywords used to highlight a checkdoc diagnostic buffer.") > >-(defvar checkdoc-output-mode-map nil >- "Keymap used in `checkdoc-output-mode'.") >+(defvar checkdoc-output-error-regex-alist >+ '(("^\\(.+\\.el\\):\\([0-9]+\\): " 1 2))) > > (defvar checkdoc-pending-errors nil > "Non-nil when there are errors that have not been displayed yet.") > >-(if checkdoc-output-mode-map >- nil >- (setq checkdoc-output-mode-map (make-sparse-keymap)) >- (if (not (string-match "XEmacs" emacs-version)) >- (define-key checkdoc-output-mode-map [mouse-2] >- 'checkdoc-find-error)) >- (define-key checkdoc-output-mode-map "\C-c\C-c" 'checkdoc-find-error) >- (define-key checkdoc-output-mode-map "\C-m" 'checkdoc-find-error)) >- >-(defun checkdoc-output-mode () >- "Create and setup the buffer used to maintain checkdoc warnings. >-\\\\[checkdoc-find-error] - Go to this error location." >- (kill-all-local-variables) >- (setq mode-name "Checkdoc" >- major-mode 'checkdoc-output-mode) >- (set (make-local-variable 'font-lock-defaults) >- '((checkdoc-output-font-lock-keywords) t t ((?- . "w") (?_ . "w")))) >- (use-local-map checkdoc-output-mode-map) >- (run-mode-hooks 'checkdoc-output-mode-hook)) >- >-(defalias 'checkdoc-find-error-mouse 'checkdoc-find-error) >-(defun checkdoc-find-error (&optional event) >- "In a checkdoc diagnostic buffer, find the error under point." >- (interactive (list last-input-event)) >- (if event (posn-set-point (event-end e))) >- (beginning-of-line) >- (if (looking-at "\\(\\(\\w+\\|\\s_\\)+\\.el\\):\\([0-9]+\\):") >- (let ((l (string-to-int (match-string 3))) >- (f (match-string 1))) >- (if (not (get-file-buffer f)) >- (error "Can't find buffer %s" f)) >- (switch-to-buffer-other-window (get-file-buffer f)) >- (goto-line l)))) >+(define-derived-mode checkdoc-output-mode compilation-mode "Checkdoc" >+ "Set up the major mode for the buffer containing the list of errors." >+ (set (make-local-variable 'compilation-error-regexp-alist) >+ checkdoc-output-error-regex-alist) >+ (set (make-local-variable 'compilation-mode-font-lock-keywords) >+ checkdoc-output-font-lock-keywords)) > > (defun checkdoc-buffer-label () > "The name to use for a checkdoc buffer in the error list." >