Skip to main content

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
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 ...
0 votes
1 answer
57 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? ...
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 ...
3 votes
1 answer
153 views

Can't switch input sources in the minibuffer during Isearch

Incremental search doesn't allow me to switch between different input sources, e.g. US English to French, when I'm typing my search string into the minibuffer. Is there a way to fix this? It happens ...
3 votes
3 answers
65 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 ...
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 ...
0 votes
1 answer
41 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&...
3 votes
2 answers
76 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 ...
1 vote
1 answer
204 views

isearch-forward, call-interactively, and isearch-filter-predicate

Here are two use cases where I call isearch-forward with some filter predicate. (let ((isearch-filter-predicate (lambda (a b) nil))) (funcall 'isearch-forward)) (let ((isearch-filter-predicate (...
0 votes
1 answer
71 views

texmathp in isearch-filter-predicate breaks query-replace's match highlighting

I tried to use texmathp with iserch-filter-predicate to let query-replace function skipping maths in my LaTeX code. I wrote this code: (defun skip-math (beg end) "Return nil if some text BEG to ...
3 votes
2 answers
143 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)? ...
2 votes
1 answer
168 views

Add multiple predicates to isearch-filter-predicate

I wrote a set of predicates to filter matches in my ìsearch-* and query-replace* routines. I also wrote a macro to bind the isearch-filter-predicate variable to multiple predicates: (defmacro with-...
0 votes
0 answers
35 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 ...
6 votes
4 answers
2k views

Ringing Bell in Macro with Search

It throws the error After 0 kbd macro iterations: isearch-search: Keyboard macro terminated by a command ringing the bell and I have no idea why, nor can I find anything about it by searching. Any ...
1 vote
1 answer
39 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 ...
1 vote
4 answers
77 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 ...
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 ...
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 ...
2 votes
1 answer
56 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 ...
0 votes
1 answer
49 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 ...
1 vote
2 answers
44 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 ...
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-...
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?
3 votes
1 answer
120 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 ...
4 votes
1 answer
95 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 ...
0 votes
0 answers
46 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 ...
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 ...
0 votes
1 answer
190 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 "...
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. ...
1 vote
1 answer
47 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 ...
0 votes
1 answer
88 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 ...
1 vote
1 answer
95 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 ...
1 vote
1 answer
195 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 ...
2 votes
3 answers
193 views

Make isearch commands search only at the beginning of words

How to make C-s (isearch-forward) and C-r (isearch-backward) search only for words that start with the argument passed to them, instead of searching for the argument even if it's in the middle of a ...
2 votes
1 answer
51 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. ...
0 votes
0 answers
22 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 ""...
1 vote
1 answer
137 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 ...
13 votes
1 answer
821 views

Search for string ignoring new lines

I am used to writing files where paragraphs are split into several lines, e.g. with fill-column. When I search for a string (C-s) such as this is a long text, the search results would not return the ...
1 vote
1 answer
257 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 . ...
2 votes
1 answer
134 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 ...
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 ...
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, ...
1 vote
1 answer
80 views

bind german mutated vowel keys to functions

I have a German keyboard and would like to bind Isearch to C-ö. How can I do this?
1 vote
1 answer
115 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 ...
1 vote
1 answer
124 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-...
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 ...
0 votes
2 answers
136 views

lose reftex-isearch-minor-mode after refresh

I want to activate reftex-isearch-minor-mode and tried the solution in this post offered by giordano, (add-hook 'TeX-mode-hook (lambda () (reftex-isearch-minor-mode))) ; for AUCTeX it works when I ...
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 ...
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 ...
1 vote
1 answer
201 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-...