Stack Exchange Network

Stack Exchange network consists of 175 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.

0
votes
0answers
10 views

Search region instead of search inside region [duplicate]

When a region is active, emacs searches (Ctrl+Sor Ctrl+R) within that region. I would like to change that so that it searches in the whole buffer with the region as pattern. Any toughs ?
0
votes
2answers
42 views

Using Occur to to recursively search in a directory [duplicate]

I use 'occur' to search for regexp in current buffer and edit the results in occur buffer . Now my requirement is to search all the files in a directory(including sub-directories ) and edit the ...
1
vote
1answer
35 views

Search across tags / titles in org mode

I keep some files in RST and rst-mode has C-c C-t C-t runs the command rst-toc which open all section titles in separate buffer. I can search ignoring actual document content which tends to have ...
0
votes
0answers
14 views

Exiting visual-regexp search with a cursor motion command doesn't execute that command

I recently set up the visual-regexp-steroids package to try it out. The one major sticking point so far has been that when I terminate the search by typing a cursor motion command (typically M-< ...
5
votes
2answers
66 views

Incremental Search after opening file

Being fairly new to GNU Emacs and intend to use it as a replacement to vi/vim where possible, I came across an obstacle, I seem not be able to overcome. In vim (similar to less) you can provide a ...
0
votes
0answers
5 views

Changing the input method during evil search

When, in evil normal state, I have pressed / to perform a search and the echo area shows /, can I change the input method; if so, how?
0
votes
1answer
30 views

Is there regex match at point?

I want to match a certain string (not even a regex!) at point. re-search-forward skips characters after the point. With char-after it is possible to build a framework for matching a string at point. ...
1
vote
0answers
21 views

How find org entries that are missing a certain property?

I have this long sub-tree, I want to find the entries that I haven't set a certain property on yet. * Big list ** foo :PROPERTIES: :QUUX: 1 :END: ** bar :PROPERTIES: :END: ** baz ...
0
votes
0answers
56 views

Search in recent files

I use helm-recentf to receive the list of recent files. I would like to have an opportunity to search over the list of recently viewed files. Can I do it with grep or helm-swoop? Is there any other ...
0
votes
1answer
31 views

Search and replace isn't working in my function

I created the following function to remove macrons from vowels (this is a reduced version that only searches for the vowel "ā"): (defun nv/eliminatemacron () "" (interactive) (save-excursion ...
1
vote
1answer
40 views

search and replace double space

I've only recently started using emacs, for professional reasons. I'm trying to replace all double spaces in a text file by single ones using regex. In C-M-s the expression \s-\{2\} matches two spaces ...
1
vote
3answers
57 views

How can I search a list of files for content that matches a regexp?

I am trying to write an interactive command that will search a set of files for a regexp. The files are selected programmatically, for example, as a list of files that match some date criteria, or ...
3
votes
2answers
80 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
29 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 ...
7
votes
2answers
157 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 ...
2
votes
1answer
33 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
63 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
30 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
13 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-...
1
vote
2answers
60 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.
1
vote
0answers
47 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
19 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
47 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
171 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
95 views

Does “Occur-at-point” already exist?

I wrote an elisp function for myself at the weekend: (defun rr-occur () ...
0
votes
1answer
80 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
54 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
23 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
72 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
111 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
32 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.") (...
2
votes
1answer
39 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 ...
-1
votes
1answer
120 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
102 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
103 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
281 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 ...
2
votes
2answers
426 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
99 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
148 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
44 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
843 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
269 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
67 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
150 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
72 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
88 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
46 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
87 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 \...