Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [isearch]

is the incremental search facility that highlights matching text as characters are typed. isearch-forward and isearch-backward support searching characters, strings, and regexp.

Filter by
Sorted by
Tagged with
0 votes
1 answer
53 views

How do I apply a command or macro to text that matches a specific pattern?

I use Vim a lot, but now I've decided to switch to emacs. Here is one of my questions: How do I apply a command or macro to text that matches a specific pattern? Or did I use emacs correctly below? ...
Stephen's user avatar
  • 25
0 votes
0 answers
30 views

Why don't `occur`, `search-forward*` and `string-match*` respect `isearch-filter-predicate`?

If I consult the definition of isearch-filter-predicate, I find: Predicate to filter hits of Isearch and replace commands. Isearch hits that don’t satisfy the predicate will be skipped. Over the ...
Gabriele's user avatar
  • 1,618
1 vote
1 answer
37 views

Return a list of functions with a given property or creating a group of functions

I am a copy editor and I make an intensive use of custom "predicates" when I perform replacements in LaTeX code. I use, among others, this technique: ;; predicate (defun omit-comments (beg ...
Gabriele's user avatar
  • 1,618
0 votes
1 answer
36 views

Cannot get rid of isearch overlays

The following code (defun nordlow/isearch-previous-symbol-at-point () (interactive) (cond ((eq last-command 'nordlow/isearch-previous-symbol-at-point) (isearch-repeat-backward)) ;avoid ...
Nordlöw's user avatar
  • 507
1 vote
4 answers
73 views

search or occur for text with a certain face, or character properties?

I'm interested in finding zero-width spaces and similar "glyphless" characters in my buffer -- and more generally, text that's highlighted or has a certain face. I can show zero-width spaces ...
Dan Drake's user avatar
  • 625
0 votes
0 answers
58 views

Rebinding navigation keys when using isearch

I've rebound most of my navigation keys using bind-keys* and am trying to create a uniform layout. But I have the problem that when I trigger isearch, point is not actually placed in the minibuffer ...
Alexander Praehauser's user avatar
0 votes
0 answers
29 views

Is it possible to make isearch to recognize space as other completion engines do?

For instance, in helm, word1 word4. It would match a line with word1 word2 word3 word4. Would it be possible to emulate that behavior with isearch? Isearch doesn't match the line because it tries to ...
eugene's user avatar
  • 489
2 votes
1 answer
54 views

How to check from elisp if isearch is in progress?

I have a background process which when finishes switches to a specific buffer. I don't want this process to interrupt my current isearch if I'm doing one, so I'd like to test if an isearch is in ...
Tom's user avatar
  • 1,260
0 votes
1 answer
44 views

isearch-forward-regex does not find a regex found by re-builder

I wanted to create a regex to find these dates: 1966/08/20 2023/02/12 In re-builder I was able to build this: "\([0-9]\{4\}\)/\([0-9]\{2\}\)/\([0-9]\{2\}\)" In the buffer the dates are ...
Edman's user avatar
  • 1,229
1 vote
2 answers
43 views

can't use `isearch-yank-word-or-char` in minibuffer-local-map?

I'd like to have occur's prompt in the minibuffer do the same that isearch does: C-w inserts the word at point in the main buffer into the minibuffer prompt. That keybinding, when doing isearch, calls ...
Dan Drake's user avatar
  • 625
0 votes
1 answer
29 views

searching for <beginningOfLine><Comma>

how can I (interactive) search for <beginningOfLine>, I tried ^ which means beginning of line in perl Also \A which does signified the same in ruby. C-s ^, C-s \A, I also tried search-forward-...
american-ninja-warrior's user avatar
3 votes
1 answer
23 views

save symbol under point to kill ring upon pressing isearch-forward-symbol-at-point

I want isearch-forward-symbol-at-point to also save to the kill-ring. How can I accomplish that please?
CD86's user avatar
  • 573
3 votes
3 answers
62 views

Can I bind a key as buffer local but not in the active keymap?

So I'm writing some custom functions to help me editing some guitar chords using LaTeX's songs package. I find convenient to rebind isearch-exit, so that when I press RET, the cursor is left at the ...
Alessandro Bertulli's user avatar
4 votes
1 answer
89 views

Isearch + Dired fast navigation

After seeing this post and one of its comments, I am trying to implement the following convenient search pattern in dired: Press C-s to start isearch Type the substring I am looking for Possibly jump ...
unvarnished's user avatar
0 votes
0 answers
45 views

Incremental Search by Yanking Thing at Point

I used to have the below function from https://www.emacswiki.org/emacs/SearchAtPoint#h5o-6 that allows to search for symbol under the cursor by typing C-s C-w, and by typing C-w, I would append the ...
klebsiella's user avatar
3 votes
1 answer
114 views

How to implement character folding (stripping Arabic text from diacritics or tashkeel aka text normalization or cleansing) when doing search in Emacs?

This is a follow-up question on a previous one here looking for a solution to this very common task of searching for a string in a text irrespective of the vowel diacritics associated with. Arabic ...
doctorate's user avatar
  • 1,829
0 votes
0 answers
46 views

Info mode isearch across nodes

https://www.gnu.org/software/emacs/manual/html_node/info/Search-Text.html Instead of using s in Emacs Info and in the stand-alone Info, you can use an incremental search started with C-s or C-r. It ...
xeruf's user avatar
  • 354
0 votes
1 answer
182 views

How to leave cursor at beginning of searched text in isearch?

Say I have this text: |Lorem ipsum dolor sit amet, consectetur adipiscing elit. Where the | is the cursor, at the beginning of the line. I want to jump to the next occurrence of the sequence "...
Alessandro Bertulli's user avatar
3 votes
2 answers
75 views

Repeat last isearch with all parameters

Everyone knows you can repeat the last I-search with C-s C-s, but that doesn't preserve all the parameters from the last search. As a concrete example, I often use symbol I-search (M-s _), and typing ...
Dolda2000's user avatar
  • 133
1 vote
2 answers
38 views

Org-cycle with TAB from isearch without RET

When I've isearched for something in a headline in org-mode, and my cursor is sitting on the headline I want: how do I org-cycle that headline with TAB? Currently I have to first press RET then TAB. ...
ComfyPotato3's user avatar
1 vote
1 answer
46 views

regexp-isearch with fixed prefix

I'd like to search a buffer for headlines only. A headline is anything starting with the "*" character. Ideally, I'd invoke an interactive function which would take user input at the ...
ychaouche's user avatar
  • 207
0 votes
1 answer
83 views

Search forward using word at point

I would like to search the current buffer for particular words. To make a function that takes the word at point and searches for that word in the current buffer. Hopefully with match word ...
Dilna's user avatar
  • 1
1 vote
1 answer
93 views

Incremental search line highlight

When running incremental search by pressing C-s repeatedly (isearch-repeat-forward) is there a way to highlight, in addition to the matching string, the line where that string is found? I would like ...
unvarnished's user avatar
2 votes
1 answer
50 views

How can I make isearch match phrases across line breaks?

Suppose I have a text document (e.g. org-mode, Markdown, etc.) in which I would like to search for the phrase "hello world". Unfortunately, if paragraphs in this document are filled (e.g. ...
Ryan C. Thompson's user avatar
1 vote
1 answer
193 views

How can I replace all in symbol manner?

I am using following solution (How do I add a keybinding to use during an interactive isearch, `C-s ...`) to move over symbols in the buffer, which iterates over the matching symbols: (define-key ...
alper's user avatar
  • 1,390
0 votes
0 answers
20 views

allign string to the right of the screen in isearch echo area

Since emacs 27.1 isearch can show how many matches there are in the buffer. I enabled it like this: (setq isearch-lazy-highlight t isearch-lazy-count t lazy-count-prefix-format ""...
Kaligule's user avatar
  • 339
0 votes
2 answers
1k views

consult command for isearch?

I was using ivy+swiper for a while, and it has swiper-from-isearch which gives a nice occur-like UI for finding isearch matches. I switched to vertico + consult recently. I see that consult has ...
GaryO's user avatar
  • 496
1 vote
1 answer
122 views

searching for explicit spaces, without reinterpretation

Often I'll search (an ordinary i-search) for a sequence of two spaces, or three, or four. But on one machine I'm using, emacs by default appears to be in some mode where searches for spaces are ...
Steve Summit's user avatar
1 vote
1 answer
249 views

How to remove characters causing encoding error

When I visit any file under a certain file tree, emacs spits out this error: These default coding systems were tried to encode text in the buffer ‘ *temp file*’: (utf-8 (7862 . 4194279) (14646 . ...
Luctins's user avatar
  • 120
2 votes
1 answer
133 views

Is there a way to add display annotation to the buffer text so that it's searchable?

Suppose I have a text data file with various data values which the computer can parse easily, but it's not easy to read for a human. In order to make the file easier to read I'd add display only ...
Tom's user avatar
  • 1,260
0 votes
0 answers
43 views

Make undo during I-search revert last call to ding

Entering a failing search string during I-search triggers a call to ding(). If this happens during a macro recording that ding when the macro is being played will abort the macro which in turns ...
Nordlöw's user avatar
  • 507
2 votes
1 answer
95 views

How to use "arrow-up" button to scroll in searched words history immediately after using isearch-forward

Is there any way to use "arrow-up" button to scroll in latest searched words immediately after using isearch-forward? For now, in order to use the "arrow-up" key for this purpose, ...
Omer Zimerman's user avatar
1 vote
1 answer
123 views

Emacs 27: How to jump to backward found word when switched into reverse incremental search?

I am trying to apply following solution(How to jump to backward found word when switched into reverse incremental search?) into Emacs >27.1, (which works in emacs 26.3): (define-advice isearch-...
alper's user avatar
  • 1,390
0 votes
1 answer
40 views

Isearch-forward org-timestamp in german time format

In org mode I use a german time format for timestamps (setq org-time-stamp-custom-formats '("<%a. %d.%m.%Y>" . "<%a. %d.%m.%Y %H:%M>")) For example <Fr. 25.06.2021&...
student's user avatar
  • 1,109
1 vote
0 answers
21 views

Mac OS and possibly other GUIs: Why is default "s-g" behaving differently from "C-s" in isearch-mode

I don't really want s-g to exit the Isearch minor mode but it does. The reason this is happening to me is unclear, because investigation of the binding of s-g reveals it is supposed to be a standard ...
nate's user avatar
  • 63
0 votes
1 answer
162 views

isearch buffer greyed out/blurred after update to macOS 11.3

I'm running Mac Port version of emacs 27.2 on macOS big sur. I recently updated to macos 11.3, and I'm having some strange behavior when I do a C-s search. In around 75% of instances, the entire ...
Dan Herbst's user avatar
2 votes
1 answer
50 views

key binding isearch-forward with Greek keyboard

I use Emacs with various languages and have had trouble invoking isearch-forward from a keystroke when my keyboard layout (OS-level) is set to Greek. If I try the usual C-s, it says there is no ...
user1951615's user avatar
0 votes
0 answers
40 views

How to discard line-number highlight during i-search?

During the i-search if I use dracula theme it highlights the line-number if the searched word is the first in the line. Example view: If I uncomment (load-theme 'dracula t) the example view would be ...
alper's user avatar
  • 1,390
1 vote
1 answer
197 views

How to make Isearch highlight more matches when I scroll?

upon having used Isearch or C-u C-s to highlight a word, when I use then C-v or M-v for scrolling the highlights remain due to setting (setq-default isearch-allow-scroll t lazy-highlight-...
CD86's user avatar
  • 573
2 votes
1 answer
48 views

Yanking into a regexp isearch escapes the metacharacters

I noticed today that when I yank a string containing regexp metacharacters into an active regexp isearch, the metacharacters all get escaped. For example, if I've killed the text foo* and yank that ...
Sean's user avatar
  • 941
0 votes
0 answers
294 views

How to delete the search term in Emacs?

I have a question regarding the search term and how it's saved in Emacs, actually I want to know how to clear it. You know how you can clear the search results highlighting with (evil-search-clear-...
Paxsali's user avatar
  • 181
1 vote
1 answer
218 views

Searching in a subtree in orgmode without narrowing

Is there a way to search in org mode in emacs in a certain subtree without narrowing or "narrowing" and "widening" the way to go?
David's user avatar
  • 299
1 vote
1 answer
97 views

How can I get the search string from incremental regexp search to use with replace regexp

If I want to do a replace-regexp I usually start with a isearch-forward-regexp so I can get immediate visual feedback on the search string. From there I'd like to grab the search string for using in ...
Michael Terry's user avatar
1 vote
1 answer
591 views

Is it possible to prevent screen flashing on combination of `isearch` and `recenter`?

I have followed answer for Emacs: Combine iseach-forward and recenter-top-bottom, replacing (recenter-top-bottom) to (recenter). My goal is to re-center after each isearch-forward or isearch-backward. ...
alper's user avatar
  • 1,390
1 vote
1 answer
53 views

How to enable linum-mode only during I-search?

linum-line it not enabled when emacs is started. I just want to enable linum-mode (see the line numbers) during I-search and disable it when I-search: is ended. Is it possible?
alper's user avatar
  • 1,390
1 vote
0 answers
225 views

Swiper go to next matching line instead of next match?

When I use swiper to search and I press the down arrow key, it always goes to the next match even if that match is on the same line. Is there an easy way to go to the next line that has a match ...
Joseph Garvin's user avatar
1 vote
1 answer
113 views

How to jump to backward found word when switched into reverse incremental search?

When I do I-search: or I-search-backward , it starts right away from the first word it find. Original behavior: word1 |[cursor]word1 ; cursor moves here ...
alper's user avatar
  • 1,390
2 votes
1 answer
359 views

How to bind C-h to delete-backward-char when doing isearch?

I use C-h as an alias for delete-backward-char everywhere. But when I do isearch it exits the search instead of deleting the character before the cursor. I tried binding C-h in isearch maps, but ...
Rogach's user avatar
  • 267
3 votes
2 answers
135 views

How to perform incremental search inside math environments in tex/latex documents

Is there a way to perform incremental search that filters out all non-math environments (i.e., only searches within $...$, $$...$$, and if possible other relevant \begin{..}..\end{..} environments)? ...
Zuza's user avatar
  • 215
2 votes
1 answer
240 views

How to get emacs to keep cursor in the middle of buffer during search?

(I am using Aquamacs 3.5 which is based on GNU Emacs 25.3.50.1, in case this matters.) While searching (isearch-forward) in a buffer it often happens that I need to see some lines before/after the ...
José Figueroa-O'Farrill's user avatar