Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [occur]

M-x occur provides a buffer containing a list of the matches of a string in the current buffer.

0
votes
1answer
37 views

How search text which is on two lines?

Emacs 26.1, Windows 10 If I want to show all lines content text in one line I use command occur M-x occur text_to_find Nice. It's work fine. But how I can use occurif text to find is on 2 lines? ...
0
votes
1answer
29 views

Why after save *Occur* buffer I can't edit editable file? [duplicate]

Emacs 26.1, Windows 10 (64 bit) I open file trace.log. User occur to find text. Save occur buffer to file NXS_ETH.txt. Do some manipulations. See screenshots. But I can't edit EDITABLE file. Here ...
4
votes
2answers
125 views

Occur with many conditions?

If I want to show only lines that content "Buy" I use command occur: Like this: Nice. But I need to show lines that content "Buy" and 0.00000057 So the result must like this How I can do this by ...
1
vote
0answers
16 views

Why I can't delete first line after save *occur* buffer to separate file? [duplicate]

Windows 10, Emacs 26.1 I have file - file_first.txt: I want to find all line content word hello. So I use occur for this Nice. Now I want to save result to SEPARATE file: file_second.txt To do ...
0
votes
1answer
66 views

why can't edit in buffer after save in file?

In file I disable Read-only mode (by C-x C-q): But if I want to edit buffer I get message: Text is read- only
2
votes
1answer
69 views

How save content of *occur* buffer?

windows 10, emacs 26.1 M-x occur Some text to find Result show in Occur buffer. Nice. How I can save content of this buffer in the file?
2
votes
0answers
41 views

Force new window to open to the left or right

I have two frames open with the following window splits: Frame 1 Frame 2 |---+---+ |------| |a |b | |d | | | | | | |---+---+ | | |c | | | |---+---+ |------| Say that ...
1
vote
0answers
28 views

How to change which window a click in *Occur* buffer affects?

My use case: I am looking at one place in the code in one window (call it window A), have a second window with the SAME code open (window B) in the same frame, together with an Occur buffer, that I ...
1
vote
3answers
53 views

Function that does `M-x replace-regexp` or `M-x occur` with a fixed pattern and replacement strings

I often use M-x replace-regexp and M-x occur with some fixed regexp pattern and replacement string on many files. Doing it manually by opening each file in an Emacs buffer and hitting the keys is ...
4
votes
2answers
88 views

Does “Occur-at-point” already exist?

I wrote an elisp function for myself at the weekend: (defun rr-occur () ...
1
vote
1answer
35 views

Predefined searches with helm-occur

Is there a way to have predefined helm-occur searches so that I can then bind them to a key? I have some frequently and hard-to-type searches that would benefit from this. (I used to do this easily ...
3
votes
0answers
24 views

Keyboard macro with occur

In a keyboard macro, there is an occur command. While recording the macro, I switched to the occur window, did some editing, closed occur buffer reverted back to original buffer to continue editing. ...
0
votes
1answer
83 views

Helm Occur - jump to next (or previous) occurence

my emacs settings ➜ settings git:(develop) ag 'occur' helm-settings.el 38:(global-set-key (kbd "C-s") 'helm-occur) How to jump between different search results while you're in ...
4
votes
1answer
253 views

How can I make occur's regexp matching case-sensitive?

By default, occur uses the passed regexp to match lines in a case-insensitive way. Is there a way to make this matching case-sensitive? For example, if I run M-x occur ^function RET, occur will match ...
1
vote
1answer
33 views

Using a backslash with occur

How can I use occur (M-s o) to search for a string that contains a backslash, e.g. \def?
1
vote
1answer
53 views

Searching for multiple items with occur

I am new to Emacs and I am trying to search for all words entered one by one using 'occur'. I am trying following code: (defun occurlist (ss) (interactive "s\Enter list of search items: ") (...
0
votes
2answers
173 views

browsing/navigating reStructuredText

What Emacs utilities can provide better browsing and navigation of reST documents? Alternatively, how to configure existing utilities to work with reST? What I mean, why I ask: Of the lightweight ...
3
votes
1answer
36 views

Previous/next occur result, independently from compilation errors

After running M-x occur, the commands next-error and previous-error let me navigate between hits. I would like to be able to M-x compile my program and then keep browsing through the same *Occur* ...
7
votes
1answer
50 views

Can occur display just the matched part?

Or is there an alternative tool (perhaps some option to isearch?) that would show just the matches in a separate buffer linked to the original buffer? Use-case I have a log file with very long lines....
5
votes
1answer
218 views

Can occur match phrases that stretch across multiple lines?

Q: (how) can I use occur to match a phrase that stretches over multiple lines? Consider the following buffer: Here's a line of text with the phrase "kittens and puppies". Here's an awkward ...
1
vote
1answer
826 views

helm-multi-occur, navigate through the search occurrences

I use helm-multi-occur to search for a pattern in all open buffers. Search results are displayed line by line in the buffer *helm multi occur*. When i press enter after selecting an item, it enters ...
4
votes
1answer
371 views

How to make occur mode select the window of buffer `*Occur*`?

Is it possible to make the occur mode grab the cursor (point)?, right now when I do M-x occur and search anything in a buffer, it will open the new buffer with the findings but the cursor stays in the ...
3
votes
4answers
374 views

How to display at the same time occurrences of two different words?

Thanks to helm-swoop, I know how to display occurrences of a single word. Now, I'd like to display at the same time occurrences of many different words (of a given, single buffer). Let me be specific:...
2
votes
1answer
77 views

Include original position from searched buffer in occur buffer

As an example, let's say I want to search for the word test. When I type M-x occur RET test RET, the current frame is split into two windows, with the current buffer on top and the *Occur* buffer on ...
7
votes
1answer
122 views

Can Occur center the found text in the buffer?

When selecting an item from the occur buffer, the highlighted line is at the very bottom of the visible screen. This is less useful than having it 25-50% of the way down the screen(so it's easy to ...
31
votes
5answers
3k views

Is there a way to use query-replace from grep/ack/ag output modes?

I'm aware of find-grep-dired, marking the corresponding files and then pressing Q to run dired-do-query-replace-regexp on the marked files. Unfortunately that requires restarting the grep and no ...