Skip to main content

Questions tagged [isearch-filter-predicate]

Predicate to filter hits of Isearch and replace commands. Isearch hits that don’t satisfy the predicate will be skipped.

Filter by
Sorted by
Tagged with
1 vote
2 answers
44 views

How to create an independent copy of a function's definition?

I want to create a modified copy of re-search-forward and advise this copy to be sensitive to isearch-filter-predicate. I tried: (defun make-search-sensitive-to-ifpmod-advice (orig-fun &rest args) ...
Gabriele's user avatar
  • 1,662
0 votes
1 answer
37 views

Implementing a version of "how-many" function, sensitive to isearch-filter-predicate

I want to build a version of the how-many function that is sensitive to isearch-filter-predicate. To achieve this, I had to first build a version of re-search-forward that obeys isearch-filter-...
Gabriele's user avatar
  • 1,662
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 ...
Gabriele's user avatar
  • 1,662
2 votes
1 answer
63 views

How to perform query-replace excluding LaTeX math?

I have this test code: foo \begin{equation} foo \end{equation} foo $foo$ foo I want to replace "foo" with "bar" everywhere but LaTeX math, so I have written these functions: ...
Onner Irotsab's user avatar
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)? ...
Zuza's user avatar
  • 215
1 vote
2 answers
182 views

How to perform query-replace inside mathematical expressions in latex

Inspired by this answer, I have written the following function to perform a query-replace inside a math environment, but it does not work. Edit. If you execute the function, the query-search tries to ...
Name's user avatar
  • 7,905
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-...
Gabriele's user avatar
  • 1,662
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 ...
Gabriele's user avatar
  • 1,662
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 (...
Michaël's user avatar
  • 334
2 votes
1 answer
172 views

Perform-replace only on text (no comments, no math) in latex-mode?

I need to write some Emacs-Lisp code that uses the perform-replace function, limiting its range of action only on text (ignoring comments, in-line math and math ambients) on LaTeX documents (in latex-...
Gabriele's user avatar
  • 1,662
4 votes
1 answer
424 views

How to perform a search for a string inside math environments in a tex/latex document

I have a long tex document and I would like to perform a search for finding some string inside math environments. Is there a search function already provided by auctex to do this? Other solutions are ...
Name's user avatar
  • 7,905
6 votes
3 answers
135 views

Query-replace with some context checking?

(query-replace "foo" "bar") shows you all occurrences of foo and offers to replace them by bar. I would love to have a version of query-replace that only picks the occurrences of foo that are "in ...
phs's user avatar
  • 1,239