From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jimka Newsgroups: gmane.emacs.help Subject: how to make next-error work on non-grep non-compilation Date: Fri, 20 May 2011 04:41:54 -0700 (PDT) Organization: http://groups.google.com Message-ID: <488618d5-7787-4c18-876d-622852f33350@k3g2000prl.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1306269427 23572 80.91.229.12 (24 May 2011 20:37:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 24 May 2011 20:37:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 24 22:37:04 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QOyLc-0007og-J3 for geh-help-gnu-emacs@m.gmane.org; Tue, 24 May 2011 22:37:00 +0200 Original-Received: from localhost ([::1]:48520 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QOyLc-0003fU-5t for geh-help-gnu-emacs@m.gmane.org; Tue, 24 May 2011 16:37:00 -0400 Original-Path: usenet.stanford.edu!postnews.google.com!k3g2000prl.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 41 Original-NNTP-Posting-Host: 213.131.238.28 Original-X-Trace: posting.google.com 1305891714 2266 127.0.0.1 (20 May 2011 11:41:54 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 20 May 2011 11:41:54 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k3g2000prl.googlegroups.com; posting-host=213.131.238.28; posting-account=hcE4OwoAAADycW4UgYxbAF_GOWiPYhXJ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.18) Gecko/2010020406 Red Hat/3.0.18-1.el5_4 Firefox/3.0.18,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:186867 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:81208 Archived-At: Hi elisp experts, I have a file which contains grep/compilation style output. I'd like to insert that into an emacs buffer and provide the next- error capability to the user. I can't seem to make it work, but I feel like I'm almost there. Any suggestions? I cannot use the normal compile nor grep interface, because the information in the mini-buffer is precious and cannot be changed. the compile-interface prints something like "compilation finished" in the mini-buffer. Here is what I have so far, which displays the file in the perspecitve buffer, and colorizes it but next-error doesn't do anything useful. (defun skill-vlint-present (file-name) (let ((interesting-output nil) (buf (get-buffer-create " vlint"))) (with-current-buffer buf (let ((inhibit-read-only t)) (erase-buffer) (compilation-shell-minor-mode t) (setq compilation-auto-jump-to-first-error t) (setq next-error-function `(lambda (n &optional reset) (set-buffer ,buf) (setq next-error-last- buffer ,buf) (compilation-next-error n reset))) (insert "-*- mode: " "grep-mode" "; default-directory: " (prin1-to-string default- directory) " -*-\n\n") (let ((pos (point-max))) (insert-file-contents-literally file-name) (setq interesting-output (not (equal pos (point-max))))) (font-lock-fontify-buffer) (goto-char 0) (compilation-compat-parse-errors (point-max)))) (when interesting-output (display-buffer buf))))