Questions tagged [occur]

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

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

50 questions
8
votes
1 answer

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 read the text around the found line). Is this…
Aaron Lee
  • 377
  • 2
  • 8
6
votes
2 answers

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 occur command?
a_subscriber
  • 4,062
  • 1
  • 18
  • 56
5
votes
2 answers

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 lines that start with both function and Function.…
Ben
  • 607
  • 5
  • 11
4
votes
2 answers

Remove occurrences in occur mode?

Is there a way to remove occurrences in Occur mode? In particular, this piece of functionality would allow you to remove occurrences in case you are interested in editing only some out of all occurrences in Occur mode. Example: say I have this piece…
2
votes
1 answer

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 bottom. If I click a line in the *Occur* buffer…
Håkon Hægland
  • 3,648
  • 1
  • 22
  • 51
2
votes
1 answer

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?
a_subscriber
  • 4,062
  • 1
  • 18
  • 56
1
vote
0 answers

Multiline edit using occur

Is it possible to use occur or something else to edit multiple lines of code within a certain tag. For example: #* some code some more code #* I've tried using occur, but it edits only the first line -- the line that gets a line number. In…
Arktik
  • 972
  • 4
  • 17
1
vote
1 answer

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
a_subscriber
  • 4,062
  • 1
  • 18
  • 56
0
votes
1 answer

Moving many lines in a single buffer using Emacs `occur`

Let's say I want to move all the lines in a buffer that contain the string 'global' to the end of that buffer. If I use Emacs occur it produces an occur buffer with the lines I need, but also includes line numbers at the beginning of each line. If I…
Edman
  • 1,207
  • 8
  • 13
0
votes
1 answer

Occur: optional arg REGION usage

I have 2 markers (created with copy-marker): b and e and I want to run occur for the string "foo" on the region between b and e. What's the correct syntax? I tried: (occur "foo" 1 '((b . e))) because the help says: Optional arg REGION, if non-nil,…
Gabriele
  • 1,554
  • 9
  • 21
0
votes
1 answer

How to find all lines in a buffer that match string 1 but do not match string 2?

I have a build log file that includes information on issues reported by clang-tidy. Each of the lines in the log file that reference an issue identified by clang-tidy contain the string "warning G". The problem is that the vast majority of the…
Benilda Key
  • 159
  • 8
0
votes
1 answer

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? E.g.: aaa bb cccc test this text_to_find hello how I…
a_subscriber
  • 4,062
  • 1
  • 18
  • 56