all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* how to make next-error work on non-grep non-compilation
@ 2011-05-20 11:41 jimka
  2011-05-20 11:47 ` Jim Newton
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: jimka @ 2011-05-20 11:41 UTC (permalink / raw)
  To: help-gnu-emacs

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))))


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-05-20 16:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-20 11:41 how to make next-error work on non-grep non-compilation jimka
2011-05-20 11:47 ` Jim Newton
2011-05-20 12:53 ` Stefan Monnier
2011-05-20 13:48   ` Jim Newton
2011-05-20 14:11     ` Stefan Monnier
2011-05-20 14:18       ` Jim Newton
2011-05-20 14:06   ` Jim Newton
2011-05-20 14:54     ` Jim Newton
2011-05-20 16:20       ` Stefan Monnier
2011-05-20 15:39 ` Ted Zlatanov

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.