Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [search]

Questions about search mechanics inside of Emacs.

2
votes
1answer
39 views

Make region(s) invisible (not evaluated) to query-replacy and similar commands

Is there a way to make some regions of the buffer invisible (I mean not evaluated by) to query-replace and similar commands? Let me better explain with an example. Let's take a piece of LaTeX code .....
0
votes
1answer
37 views

Opening an Emacs file to a specific word in the file

In Vim it is trivial to open a file from the command line to a specific word in the document. For e.g. to open the file "Contacts.txt" to "Bob" one would type: vim Contacts.txt +/Bob In Emacs it ...
0
votes
1answer
24 views

Search for occurrence of character within a string without using the common lisp library?

I need to extract certain information from buffer names, and I'm doing so by extracting substrings based on the position of unique characters within a buffer name string. So, I currently am doing ...
-1
votes
0answers
38 views

Using PCRE regexes in evil mode search/replace

I have evil-mode installed and am trying to get PCRE regexes working everywhere. I currently have pcre2el installed (https://github.com/joddie/pcre2el) and evil mode installed as well. I also have ...
7
votes
2answers
93 views

How to search for a sequence of bytes in hexl-mode?

Is it possible to search for a byte sequence in hexl-mode and possibly highlight it? E.g. in the file below I want to search the byte sequence f9beb4d9. isearch does not work because it searches the ...
1
vote
1answer
26 views

How to search and replace, with search starting with the current selection

I would like the "search" from search and replace, to be the selected region. Is there a command doing that already ?
5
votes
1answer
48 views

edit search string and begin search from current location

I use C-s to start an incremental search. Sometimes I want to change the search string and either restart the search entirely from the beginning of the document or (other times) just change the search ...
0
votes
2answers
29 views

Searching for lines matching a criterion: where am i going wrong?

I am trying to record all the lines with the word bad in a Emacs-buffer with a simple elisp function (defun bad-line-numbers () (beginning-of-buffer) (setq sec-lines ()) (while (re-search-...
0
votes
0answers
10 views

Apply evil-mode Macro to helm-ag Results

I love using helm-ag-edit within projectile to make bulk edits to many files in my project in one fell swoop. However, sometimes I want to apply keyboard macros (using evil-mode) to these files. The ...
0
votes
0answers
16 views

Case sensitive regular expression search [duplicate]

I want to use the re-search-forward function in my Elisp code for searching text. However, it seems to ignore letter case! For instance, when I put the following in my *scratch* buffer: (re-search-...
0
votes
2answers
45 views

re-search-forward unexpected behavior: case insensitive

According to the documentation of this function, it should be case sensitive. But when I test it out, the result is case insensitive. My emacs version is 25.3.2.
0
votes
0answers
32 views

How to delete a long region by setting a mark and then searching for the location of the end of the region?

I have a long document. I placed two unique identifiers, in the form of short strings of printable English letter, in two positions in the document. The identifiers are far apart. My task is to delete ...
0
votes
0answers
17 views

ace-jump-mode - Symbol's value as variable is void: closed

Windows 10, Emacs 25.1, helm package, install ace-jump-mode. I install ace-jump-mode from Emacs package manager. here my init.el (add-to-list 'load-path "~/.emacs.d/elpa/ace-jump-mode") (autoload ...
0
votes
3answers
38 views

Change Case of last searched pattern

Is there a fast way of changing the case of the last searched pattern? Inside Evil mode, I press # key to quickly search for keywords at point. And I want to change the case of all occurences of ...
3
votes
1answer
75 views

Trying to make control-f search exactly like control-s does!

I am trying to configure Emacs to not only use CUA, but also for control-f to search exactly like control-s does in the standard configuration. What I have achieved is that I can key in control-f and ...
4
votes
2answers
84 views

Does “Occur-at-point” already exist?

I wrote an elisp function for myself at the weekend: (defun rr-occur () ...
0
votes
1answer
71 views

In elisp, search and replace only on lines containing a specific string

Running spacemacs 0.200.13 on emacs 25.2.2 on Kubuntu 18.04. I need to search and replace only on lines containing a specific string. Interactively, I use occur, move to the occur buffer, and do all ...
0
votes
1answer
34 views

Unicode character folding with Swiper/Ivy

Suppose I have bár written in a file, I would like to look for bar in swiper and find the occurrences of bár alongside the expected occurrences of bar, how I can do this? This would also apply to ...
0
votes
1answer
20 views

Replace a match only till some other match is found

Aiming to convert first row of a html table from to tags. So, I wrote the following code. (defun tdtoth () (if (search-forward "</tr>" nil t) (while (search-forward "td" nil t) ...
1
vote
1answer
52 views

Search forward for the FIRST space character and stop there

I recently upgraded from Windows Emacs 19.x to Windows 26.3.1 and have a problem. in the old version 19 if I did a search forward for a space, (C-s) it skipped forward to the FIRST space character ...
1
vote
1answer
73 views

Case-sensitive search and replace in elisp in spacemacs

Running Spacemacs v.0.200.13 on emacs 25.2.2 on Kubuntu 18.04. Consider the following code: (defun xx-ll () (interactive) (save-excursion (goto-char (point-min)) (xx-replace-...
0
votes
1answer
30 views

How to bypass lines matching some regexp, when searching forward

I've written the following function to go from an error line to the next one: (defconst mylog-mode-error-regexp "\\(\\[ERROR\\]\\|rule did fail\\)" "Regexp to recognize errors in my log file.") (...
0
votes
0answers
31 views

Search text and see file paths instead of just file names

When I search for files containing foobar pattern using SPC s p, I get just filename, not the file path, see below. Knowing the full path at a glance would be more useful when the matches are ...
2
votes
1answer
27 views

How to use helm-occur to search the whole word?

For example, I got the following lines: 1. abc 2. abc def 3. abc_def 4. _abc 5. abc_ and I want to search only the word abc, so only the 1 and 2 lines matches, I googled a while, it says \babc\b ...
0
votes
0answers
23 views

emacs language independent plugin for browsing source code and indentation

I am working with some language for which I dont have all the features that I reuire. I was wondering if there are any plugins where I can customize the variable declaration name(like instead of int ...
-1
votes
1answer
96 views

How to find all characters, newlines included?

I have this LaTeX code: %%% 10 \bibitem{bib2} W.~Kockelmann, G.~Burca, J.F.~Kelleher, S.~Kabra, S.-Y.~Zhang, N.J.~Rhodes et~al., \emph{Status of the neutron imaging and diffraction instrument IMAT},...
3
votes
3answers
77 views

Is it possible to limit the scope of function apropos-value?

I've recently started using function apropos-value and have found its output burdensome-ly long, mainly due to a limited number of huge variables that I knew in advance would contain the value I was ...
1
vote
1answer
89 views

Can gnus handle “maildir” format mail files with “.eml” extension?

I've been using "gnus" for reading/writing mail in MS Windows, but to make Windows recognize mail file, I want to add ".eml" extension to each numbered mail in "maildir" format. Is there any way to ...
0
votes
2answers
182 views

dumb-jump finds all references instead of definitions

Example code: typedef int my_type_t; my_type_t a; my_type_t my_function(my_type_t in) { return (my_type_t) 0; } int main(void) { my_type_t b; a = my_function(b); return 0; } When ...
1
vote
2answers
268 views

Swiper get last search term

How to get swiper to search for the last searched term , much like (default) isearch-forward does when pressing C-s twice?
1
vote
2answers
88 views

re-search-forward through visible text only

I have one big org file. Sometimes I only want to search for a regular expression through the visible text, not the text that is folded; otherwise my search will take much longer. How can I search ...
6
votes
1answer
144 views

Is there a more efficient alternative to search-forward when searching for a single character?

I need to split the contents of a buffer into a list of strings. The null character is used to separate the items. It the items were separated by newline characters, then I could use the same ...
1
vote
1answer
40 views

How to search among all the commands / functions?

I often forget the names of many commands and always have to look up the internet or the manual but it would be good if i could search within emacs among all the commands / functions For eg: I know ...
11
votes
1answer
635 views

Counsel M-x always shows “^”

I installed Counsel/Ivy/Swiper and so far everything works fine. But when I call counsel-M-x via key bind M-x an "^" char is always added. I have no clue why this is happening and how to get rid of it ...
1
vote
2answers
159 views

How to search for any unicode octal character in a buffer?

I'm looking for a way to locate all unicode octal characters in a buffer such as \344 and replace them with ä or \353 with ë, etc. At the least if I could just locate octal characters using ...
1
vote
1answer
54 views

how remove all but the first n chars

How can I remove all but the first n characters of a every line in the file buffer? What I tried Mark region C-x r k #but this is cumbersome when the length of lines are very varied, and there are ...
1
vote
3answers
132 views

Error with helm-swoop

helm-swoop no longer works for me. Whenever I try to use it, i get the message Symbol's value as variable is void: helm-swoop-pattern I am using the latest package from MELPA (20170923.2127) ...
3
votes
2answers
66 views

Confine avy search to a single line/paragraph

Is there a good way to do this? Much of the time I find myself using avy-mode I only want to jump somewhere within the current paragraph or line. With stock avy, this involves entering numerous keys ...
1
vote
1answer
73 views

Removing a latex command (by matching braces)

In LaTeX, I sometime define a command of the type \tmpcmd{TEXT\cmd{MORE TEXT}}. After I am done, I want to remove all instances of this command, so I usually do a replace-string of \tmpcmd with an ...
0
votes
1answer
40 views

Searching for space in LaTeX mode

In Emacs 25.3 (but not 22.3, for example), the search string " " (space) in LaTeX mode is matched by the carriage return character as well as the space character. I can understand why Emacs has been ...
1
vote
1answer
60 views

Replace certain multibyte characters

In my markdown file (coming from a Windows computer on which I have no control), I have several multi-byte characters. Some text xx Some text yy Some text In emacs, they are displayed as \221 and \...
4
votes
6answers
147 views

Search for “foo bar” ignoring comments and newlines

How do I search for "foo bar" ignoring comments and newlines in emacs? For example, given the tex file fragment blah blah foo % comment 1 % comment 2 bar blah blah I'd like to be able to type "foo ...
2
votes
2answers
169 views

Completion by fuzzy search in large dictionary file, displaying candidates inline

What would be the best (simplest, with minimal latency) way to load a large dictionary file (about 2M terms; plain text, one term per line), and then do (repeatedly, on a keystroke) a fuzzy search, ...
0
votes
2answers
88 views

Find and replace a text among the files of a project

How can I do a "find and replace a string" in the files of a project? Is there a standard, built-in way?
2
votes
1answer
209 views

Find/replace in differrent file extensions

Windows 10, Emacs 25.1, Dired+, xah-find I use package xah-find for find/replace text in many files. OK. It's work. If I want to find in all java files I use the next regexp: File path regex: \.java\...
2
votes
1answer
113 views

highlight different regexp groups with different colors

Is there a way, that each group in regexp can be highlighted with a different color. For example, if I am searching for \(text_part_1\)\|\(text_part_2\) Can the text_part_1 be highlighted in one ...
4
votes
2answers
103 views

elisp search functions

I'm trying to debug a piece of elisp that is in an orgmode template I'd like to use. (link here) The problem is occurring in the source block that is supposed define the cite links. (org-add-link-...
0
votes
1answer
121 views

Find files like in Nautilus' search

I occasionally find myself using Nautilus instead of dired to search for files and would like to change that. When looking for a file, I often don't know the capitalization of its name which is why I ...
2
votes
0answers
35 views

How to pre-select helm's pre-input?

In many other softwares (e.g., Chrome), when we initiate word search by Ctrl-F, the pre-input is pre-selected so that we can replace it by simply typing a new keyword, or append a new string to it by ...
2
votes
2answers
183 views

make * in Spacemacs work like it does in vim

In Spacemacs, is there an easy way to make * (which calls the function spacemacs/enter-ahs-forward) work like it does in Vim? That is, I want * to perform forward searching like in Vim, without ...