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
25 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
  • 497
1 vote
4 answers
44 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
  • 573
0 votes
0 answers
50 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
28 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
1 vote
1 answer
41 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,190
0 votes
1 answer
35 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,167
1 vote
2 answers
39 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
  • 573
0 votes
1 answer
25 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
  • 543
2 votes
2 answers
42 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
69 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
41 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
101 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,799
0 votes
0 answers
40 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
  • 334
0 votes
1 answer
133 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
1 answer
59 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
  • 131
1 vote
2 answers
32 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
40 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
61 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
87 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
43 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
182 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,300
0 votes
0 answers
17 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
955 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
  • 486
1 vote
1 answer
78 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
225 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
112 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,190
0 votes
0 answers
42 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
  • 497
2 votes
1 answer
93 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
117 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,300
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,007
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
146 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
47 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
38 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,300
1 vote
1 answer
174 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
  • 543
2 votes
1 answer
46 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
  • 929
0 votes
0 answers
268 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
201 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
  • 291
1 vote
1 answer
94 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
573 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,300
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,300
1 vote
0 answers
208 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
105 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,300
2 votes
1 answer
320 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
1 answer
108 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
226 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
0 votes
1 answer
153 views

Using `C-n` and `C-p` to iterate as cycle in `find-file` instead of up/down arrow keys

Following answer related to “Open Recent” in Emacs indicates that After you press C-x C-f, press up and down to navigate the history of opened files. I have added following lines but they do not ...
alper's user avatar
  • 1,300
0 votes
1 answer
83 views

Is it possible to do word completion on `isearch` shell?

I want to apply word completion on isearch shell. When I press tab ^I shows up on the shell instead of completing the word and show up a window for suggestions. => Is it possible to complete a word ...
alper's user avatar
  • 1,300
1 vote
1 answer
1k views

How do I change the highlight color for selected texts on isearch?

When I search a text on isearch due highlighed color it is not readable. Following line does not have any affect on the main selected word on the isearch: (set-face-attribute 'lazy-highlight nil :...
alper's user avatar
  • 1,300