[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
move point to first error, without opening target buffer
From: |
Sam Halliday |
Subject: |
move point to first error, without opening target buffer |
Date: |
Thu, 24 Dec 2015 15:15:30 -0800 (PST) |
User-agent: |
G2/1.0 |
Dear Emacs users,
I am using a package called `ag' as a faster replacement for grep
(silversearcher), installing the emacs package like so:
(use-package ag
:commands ag
:config
(add-hook 'ag-search-finished-hook 'next-error-no-select))
for all intents and purposes, this could be any subprocess that uses the
`compile' support and search results are shown as "errors".
Ag has a hook (see above) which runs when the search is complete. What I'm
trying to do is to make the point jump to the first search result, so that I
don't have to manually `C-x o' and then `C-s' to the hits (sometimes the
preamble can be quite long).
What I have above is nearly there, but it opens the first search result in a
buffer and I don't want that. I just want the point to move to the first hit so
I can manually select which ones I care about. Reading through `simple.el' I'm
pretty confused about how I can achieve that, could somebody please help?
In addition, it would be far better if the hook was run when the first search
result (or "error") was detected. There doesn't appear to be a hook point for
this, but maybe I'm wrong.
Best regards,
Sam
- move point to first error, without opening target buffer,
Sam Halliday <=