Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 15606

query-replace is a built-in Emacs command for interactively replacing one string with another in a buffer. query-replace-regexp does the same thing, but with support for matching regular expressions. Use this tag for both commands.

0 votes
1 answer
40 views

Using query-replace to add text properties to replacement strings in Emacs

I'm trying to use query-replace in Emacs to replace a string with another string that has specific text properties. Specifically, in this example, I want to replace occurrences of "foo" with "bar" and …
Gabriele's user avatar
  • 1,680
0 votes
Accepted

query-replace* (perform-replace): highlighting issue with "act-and-show"

It seems to be a bug in Emacs 29. It was fixed in Emacs 30: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71430
Gabriele's user avatar
  • 1,680
1 vote
1 answer
45 views

query-replace* (perform-replace): highlighting issue with "act-and-show"

When I use the query-replace* (perform-replace) functions, I can type "," "to replace but not move point immediately." During the replacement, the function highlights the match, but if I type ",", the …
Gabriele's user avatar
  • 1,680
0 votes

How to perform query-replace inside mathematical expressions in latex

Here: https://emacs.stackexchange.com/a/80544/15606, I have proposed a solution that should also adapt to this case. This should address some of the issues highlighted in the comments to JeanPierre's …
Gabriele's user avatar
  • 1,680
1 vote
Accepted

How to perform query-replace excluding LaTeX math?

If you don't need to discriminate between in-line mathematics and mathematical environments, you can simply use texmathp. You don't need to install AUCTeX, but you can retrieve the texmathp.el file fr …
Gabriele's user avatar
  • 1,680
0 votes
0 answers
29 views

set-keymap-parent function and let binding of involved keymaps

I have this content in the buffer: \begin{environment} foo Some other text here \end{environment} \begin{environment} foo Some other text here \end{environment} \begin{environment} foo Some other …
Gabriele's user avatar
  • 1,680
0 votes
Accepted

Build a "with-query-replace-description" macro

I've been successfully using this solution for quite some time now: (defmacro with-interactive-tasks-explanation (MESSAGE &rest body) "It allows displaying, in a dedicated buffer resized to the nece …
Gabriele's user avatar
  • 1,680
0 votes
1 answer
82 views

query-replace: ignore events not binded in query-replace-map

I have this function: (defun my-replacements () (interactive) (query-replace "foo" "bar" nil (point-min) (point-max)) (query-replace "baz" "quz" nil (point-min) (point-max)) (query-replace "fr …
Gabriele's user avatar
  • 1,680
0 votes
Accepted

Temporary Inhibition of Mouse Events in Windows During Menu Opening

The workaround I found is to intercept and "unread" the mouse-1 event using this macro: (defmacro with-ignore-mouse-events (&rest body) "Macro to ignore mouse events before evaluating BODY." `(pro …
Gabriele's user avatar
  • 1,680
1 vote
2 answers
40 views

Temporary Inhibition of Mouse Events in Windows During Menu Opening

I'm facing an issue (Unwanted Focus Shift when Clicking Menu Functions in Emacs Mode Line) regarding mouse event handling in buffer windows during menus opening. To address this, I'm attempting to tem …
Gabriele's user avatar
  • 1,680
0 votes
Accepted

query-replace bug?

It was indeed a bug. I believe it will be fixed in Emacs version 29.2.
Gabriele's user avatar
  • 1,680
0 votes
Accepted

query-replace, add a "skip to next" in lambda function

The solution is built-in in query-replace-regexp: (defun fix-mult-punct-before-footnote () "Scope: FOOTNOTE Description: Fixes repeated/multiple punctuation before the \\footnote macro." (interact …
Gabriele's user avatar
  • 1,680
0 votes
1 answer
27 views

query-replace, add a "skip to next" in lambda function

I have this function: (defun fix-mult-punct-before-footnote () "Scope: FOOTNOTE Description: Fixes repeated/multiple punctuation before the \\footnote macro." (interactive) ;; "..\footnote{" --> …
Gabriele's user avatar
  • 1,680
0 votes
1 answer
66 views

query-replace bug?

When I run query-replace* commands if I type ? I get this explanation of the function's options: Type Space or ‘y’ to replace one match, Delete or ‘n’ to skip to next, RET or ‘q’ to exit, Period to re …
Gabriele's user avatar
  • 1,680
0 votes
2 answers
65 views

Build a "with-query-replace-description" macro

In the company where I work we use Emacs as the default editor for the LaTeX copy-editing tasks and we share some Emacs scripts to automate/guide some operations. Actually I need to perform some query …
Gabriele's user avatar
  • 1,680

15 30 50 per page