Questions tagged [search]

Questions about search mechanics inside of Emacs.

Filter by
Sorted by
Tagged with
1
vote
0answers
50 views

How to replace a block of text with a “query-like” approach all at once?

I want to search and replace a block of text with a "query-like" approach all at once. For example, if I have \emph{``Foo $\bar$ baz''} to be replaced by \emph{Foo $\bar$ baz} using a &...
0
votes
0answers
37 views

Remember previous text searches history with positions after further text search

Using Spacemacs’ spacemacs/helm-project-smart-do-search (SPC / pattern RET, which I think is using helm-ag under the hood), I search for a text pattern in my project and go to the first match, and ...
1
vote
1answer
35 views

Searching in a subtree in orgmode without narrowing

Is there a way to search in org mode in emacs in a certain subtree without narrowing or "narrowing" and "widening" the way to go?
1
vote
1answer
35 views

How can I get the search string from incremental regexp search to use with replace regexp

If I want to do a replace-regexp I usually start with a isearch-forward-regexp so I can get immediate visual feedback on the search string. From there I'd like to grab the search string for using in ...
0
votes
2answers
48 views

How do I search/replace with case sensitive search?

In emacs I'm using M-% to replace occurrences of b_abcd (of which there are only a few) with B_abcd (of which there are very many). Currently Emacs asks if it's OK to replace at each B_abcd, which ...
1
vote
1answer
24 views

tools for camelcase and other means of word separation

Often I am involved with transforming text with one system of word separation (e.g., camelcase) into another system (e.g., hyphen separation, space separation, underscore separation. For example, if I ...
0
votes
1answer
24 views

Search for file content with swiper-all or similar interface

I've been using swiper-all to search for content in buffers. This works really great as I easily can navigate between the files and select the ones I want to work with. Is there some way I can use a ...
1
vote
1answer
60 views

org-mode: specifying a hyperlink target as regex and jumping directly to match?

The documentation of a Fortran code, being done in org-mode, is intended to be done in such a way that changing the Fortran source code to be documented should be kept at a minimum. There is the ...
0
votes
1answer
48 views

How can I get swiper to remember the last search I ran?

Sometimes I do a search with swiper and navigate to a location in the code that seems like what I was searching for, only to find it wasn't. This is more common with a symbol name that is a little too ...
0
votes
1answer
17 views

Only edit visible lines in sparse tree view

Consider the following org-mode document * Foo ** bar1 :g1: ** bar2 :g2: ** bar3 :g1: ** bar4 ...
0
votes
0answers
35 views

Search file within neotree in an unexpanded directory

Is it possible to search a file in neotree which is deep inside some directory? The normal search only searches in the visible parts i.e., within directories that have been expanded. I am looking for ...
1
vote
1answer
21 views

icicles search and replace; need help to do a successfull replace

I try to use Icicles to search and replace. I understand to search with it (some details, that I need), but I'm unable to do a replace. The link below shows a recipe, that I try to follow, but it ...
0
votes
0answers
34 views

Restarting search in a quick way

In Firefox I can hit Ctrl-f to start a search and Ctrl-g to search the next occurence of the string searched. If I would like to search for a different term, I simply hit Ctrl-f again and type in the ...
0
votes
1answer
72 views

How to search with a regexp before point?

I would like to know a function that searches a pattern located before point. re-search-backward is mentioned in the Elisp manual but I do not understand its purpose. Indeed, I do not understand the ...
3
votes
1answer
75 views

How to search and replace in *open buffers*

I want to interactively search and replace in all (or, preferably, a regexp subset of) my buffers (not files). Scenario Being a pack-rat sort of guy, I never delete my buffers until I'm sure I don't ...
3
votes
1answer
44 views

How to access Query-replace history in replace format (for eg: “ABC → XYZ”)

I have enabled query replace save history as below. When I am in query-replace mode, I see previous search-replace patterns of the current session in the form "ABC -> XYZ". But the search-replace ...
0
votes
2answers
40 views

rgrep doesn't search in specified directory

According to the documentation : (rgrep REGEXP &optional FILES DIR CONFIRM) Recursively grep for REGEXP in FILES in directory tree rooted at DIR. [...] But when I call it in some ...
1
vote
1answer
52 views

search-forward-regexp with back reference

I have the following text \begin{comment} TEXT \end{comment} \begin{verbatim} TEXT \end{verbatim} and the regular expression "\\begin{\([^}]*\)} to match the \begin statements and capture the ...
2
votes
0answers
34 views

Find and display duplicated regions of (org-mode) text across multiple files

What I'm trying to do I'm trying to condense a set of research notes consisting of over 250,000 words across 50+ files. I've converted these from previous file formats (mostly mind maps and OPML ...
1
vote
1answer
104 views

How to search for headings all the way to the root heading (and preferably file name)

I am new to emacs, and org-mode pulled me away from vim. I am getting a hang of it. One thing I am missing a lot is a hierarchical search in emacs. I wrote a python script for that in vim, and I am ...
0
votes
1answer
32 views

Expiring search highlights in Evil

I'm using the evil-search module ((evil-select-search-module 'evil-search-module 'evil-search)). When I perform a search, the results remain highlighted until I call evil-ex-nohighlight. I'd prefer ...
0
votes
1answer
46 views

How to set a variable that matches different type of strings?

I have these strings: First Type: arXiv:1234.56789 arXiv:1234.56789v1 Second type: hep-th/123456789 hep-th.AB/12345689 hep-th/123456789v1 hep-th.AB/12345689 Belong to the second type even strings ...
1
vote
2answers
73 views

How to match first character in line after asteriks and space using regex?

For example i have lines: * test1 ** another tests * some other line I would like to match t in first line, a in second, s in third.
1
vote
1answer
241 views

How to regexp-search for a word surrounded by spaces

I'm looking at this One use of regexp-quote is to combine an exact string match with context described as a regular expression. For example, this searches for the string that is the value of ...
2
votes
1answer
55 views

Query replace regexp with a distant match?

I have a single transcript file for a set of course lectures I am watching. After doing some formatting on the file. I have it broken up into sets of lessons where the main heading is the lesson title ...
2
votes
1answer
38 views

Make forward-list search for specific symbol only

Is there a way to make forward-list and backward-listsearch for specific symbols (such as 「」『』) only? I have code that make use of these functions to iterate through 「」『』 pairs in plain text. But ...
-1
votes
1answer
111 views

Counting number of matches in number of lines for regex search

I have functions that run re-search-forward and gather its output into a buffer. (defun my-search (pattern) "Uses `re-search-forward` to return matching lines." (let ((src) (rslt)) (...
0
votes
1answer
53 views

Issues With org-ql and Searching Based On Property Inheritence

I would like to be able to search for all TODO's with a property of FEATURE_NUM, and that property is inherited in my TODO's. Here's what I have in my init.el to make that property inheritable: (...
2
votes
0answers
27 views

Helm Grep within a first results set / multi line search

I would like to use helm to search for two terms which may well be on different lines. Is there a way to grep for the first term then further grep within the resulting fileset the second term? eg ...
1
vote
1answer
135 views

How to search certain subdirectories of directories that are ignored by Git

I'm working in a Scala project that has target/ directories entered as ignored in the .gitignore. However, there is also Scala code being generated during the build which is being nested under a ...
0
votes
1answer
86 views

need help with very complex find and replace

I have a very complex (at least to my mind) text replacement task. ideally this would be a function or macro I could run over every org header in a buffer. I want to 1. move over any TODO state to a ...
0
votes
1answer
92 views

Can you generate a tags table for CMD scripting?

I am working on an elaborate script for Windows using CMD.EXE scripting. It walks a tree of files and folders and uses our specialized file transfer program to send the tree to a remote location. ...
1
vote
1answer
327 views

Search/replace and replace within a block of selected text of buffer in spacemacs

As stated in the title, I want to search and edit (including replace) certain strings in a selected part of a buffer, not the entire buffer!!!, how can I do it? Are there any built-in keystrokes?
0
votes
0answers
17 views

Rules for searching with punctuation and quotes in mu4e

I use mu4e for email and am having trouble with punctuation, which is not in the manual. I have a thread titled forum software?. A search for forum software returns that thread and one other message, ...
0
votes
0answers
74 views

Regex search and edit text simultaneously with multiple cursors

I'd like to search for a pattern with regex and simultaneously cut or edit all instances of that pattern. Is there a ready-made function for this? Atom, for example, has one such package - by ...
1
vote
1answer
302 views

How to search by tags in org-mode

Here is a simple file: #+TAGS: math(m) music(u) * Gödel :math: * Bach :music: * Gauss :math: * Beethoven :music: * Mozart :music: Then I tried M-x org-tags-view Match: +math I expected that Gödel ...
0
votes
1answer
25 views

How to include lines in a regular expression search which might not be present?

I'm using a regular expression search which is working as expected. This searches for unified diff file entries and works as expected. (re-search-forward (concat ;; Prefix '+++ '. "^" "...
1
vote
1answer
62 views

Org-mode: Using sparse tree to search through timestamps (non-scheduled, non-deadlines)

I am aware that I able to use sparse tree to search "[b]efore-date" with C-c/b or search "[a]fter-date" with C-c/a. However, I recognise that seems to only be with dates that are schedules or ...
2
votes
1answer
60 views

Workaround for “Invalid search bound (wrong side of point)” in CC Mode

Emacs 24.x and 25.x have a bug in CC Mode which can result in some operations failing with the error Invalid search bound (wrong side of point) For example, I can reproduce it with the following ...
0
votes
3answers
101 views

Complex searching and replacing [duplicate]

Suppose I have following pattern: throw "some message"; which I'd like to replace with: throw new Error("some message"); So, "some message" part should not be changed (or copied as is), and ...
2
votes
3answers
224 views

Mark input in swiper-thing-at-point

Having some command automatically populate the input string is a great thing (particularly, I refer to the feature that swiper-thing-at-point provides). However, I would like to enhance this ...
1
vote
3answers
69 views

How to delete numerals of a certain size from text

I'm pretty new to emacs, so I'm still learning all the functions. I'm trying to remove certain metadata from each line of several large .txt files (Bible translations) and was wondering if if there ...
1
vote
1answer
41 views

Searching text between markers as in Nota Bene

The Word Processor Nota Bene has a feature which I would like if possible to emulate within Emacs. One can insert into a document non-printing markers which are then used to delineate areas of text or ...
1
vote
2answers
290 views

Selecting next occurrence of word incrementally

I want to make changes inside a paragraph of a large text file. If I have the cursor at the word "foo", what key combination would get the cursor at the next occurrences of this word? The cursor ...
0
votes
0answers
68 views

Skim: search backward generates shell buffer in Emacs

I have configured forward and backward search between Emacs and Skim (MacOS) for my LaTeX work. While the search works fine, every time I do an backward search from Skim, an additional shell buffer ...
0
votes
1answer
94 views

mu4e or mu cannot find a search term with a period

I use mu4e and sometimes I cannot find a message with a search term including a period. For example, if I search for Google.org, I see: No matching messages found but if I search for "impact ...
1
vote
1answer
76 views

Search within column or rectangle

Is there a simple way to search within the current column or within a rectangle? I am navigating a CSV file and would like to find the value "10" in a particular column. Searching the entire file is ...
1
vote
0answers
12 views

How do you fix a large list of unknown files in Ebrowse?

I'm trying to use the emacs Ebrowse tool. The issue I'm having is a great majority of the C++ files, from my BROWSE file, are showing up as (unknown) file type, resulting in me being unable to open ...
3
votes
2answers
82 views

Retracing steps with emacs (When programming /exploring)

Often when fixing a bug or implementing a new feature in a code repository, I start off with an investigatory step. For example, I would have a lead, a word such as "Article" and I would start by ...
2
votes
1answer
114 views

mu4e query search for emails larger than certain size

I've looked in all the examples given in queries of mu4e email but couldn't find an option that returns all emails larger than a certain size (for example 10MB). I think this is relevant if one is ...

1
2 3 4 5