Questions tagged [search]
Questions about search mechanics inside of Emacs.
312 questions
0
votes
1
answer
28
views
Regexp: Regexp that matches ")" but NOT "()"
I am writing a function that needs to move the character back to the first ")" character. However, in the middle there might be a "()" characters, I do NOT want the cursor to go ...
-1
votes
1
answer
29
views
Searching for the nearest space or bracket - can it be more general?
I grep Common Lisp code base and extract usage of the symbol I am interested in analysing. Then I copy it to scratchpad to clean up the grep. I know of sorting lines and removing duplicates, but ...
0
votes
1
answer
58
views
date range search with org-mode
Problem: lets say I want to search for all meetings I attended last March.
I can search for date ranges in my archive file using a sparse-tree search (M-x org-sparse-tree D) but I can't figure out how ...
0
votes
2
answers
84
views
Using a grep like function in lisp
I have a file, and I want to search if a given file has a string.
I want to call that function from an elisp function.
AFAIK, all the grep family of functions open a new buffer.
I only need to know if ...
0
votes
1
answer
40
views
Binary search in elisp, do away with the return variable
As part of my efforts to spruce up my elisp fundas, I am trying to implement the basic algorithms in elisp. I have done for binary search program as follows,
(defun bnry-srch (vctr itm strt end)
&...
0
votes
2
answers
109
views
Emacs org-mode: how to create link to a certain search agenda?
In 'Emacs org-mode' i can create links to headings and other things where I want to jump quickly.
How can I create a link in 'Emacs org-mode' which opens a certain search agenda?
At the moment I have ...
0
votes
1
answer
67
views
How to search regex in a url-retrieve buffer?
I'm trying to implement a login system with emacs lisp, the login system has a hidden input field that's initially empty and is filled by a piece of javascript code when submitting.
I'm currently ...
0
votes
0
answers
45
views
Regexp searches that repeatedly cover expressions
I'm just going through an old Latex-text I've written and wanted to use regexp-replace to make any pair of brackets containing at least one other pair of brackets into a \left(.*\right)-expression. ...
1
vote
0
answers
178
views
Programmatically use org-tags-view to search in current subtree
I am looking for a way to programmatically search for headings in the current subtree. More specifically, I have a vocabulary file, in which I store words I need to learn. Each word is a subtree in ...
1
vote
2
answers
99
views
How can I make occur display only first line of match?
The context for this is that I was trying to write a function to help me write LaTeX, specifically I'd like to list all the future references, i.e. when you use a \ref{<something>} before \label{...
0
votes
0
answers
492
views
error in process sentinel: Wrong type argument: integer-or-marker-p, nil
I get this error when I search dired with M-x find-name-dired:
error in process sentinel: Wrong type argument: integer-or-marker-p, nil
The search finds the files then ends with this error. I'm not ...
1
vote
0
answers
53
views
How can I search for CamelCase words in a buffer using Elisp?
How can I find CamelCase words in the buffer using Elisp?
Have started with the following but the pattern does not cover all situations of CamelCase.
(defun detect-camel-case-words (string)
"...
2
votes
1
answer
899
views
What am I supposed to do about the error “Invalid search bound (wrong side of point)” in my code calling re-search-forward?
I have several interactive functions that pretty straightforwardly do re-search-forward and replace-match in a loop. Once in a while, if I have a region selected and do the replacement in it, re-...
1
vote
2
answers
83
views
How can I discover new commands using M-x (or similar command) semantically?
Currently, I'm in Doom and I'm pressing M-x which does a nice fuzzy search for commands.
The problem with this is it has no synonym detection. So if I'm trying to collapse something and type M-x ...
1
vote
2
answers
138
views
Elisp programming: Jump to heading with a specific `Custom_ID` property value
Within the same org buffer, how to jump to heading with a specific Custom_ID property value?
Edit:
I need an Elisp function that takes a string argument and jumps to the heading with a Custom_Id ...
0
votes
1
answer
85
views
Full-text search in notmuch (like multi-occur)?
Has anyone tried to search through emails' contents in notmuch in a "multi-occur like fashion", that is in a buffer that lists occurrences of a searched keyword and let's you visit their ...
1
vote
1
answer
134
views
How can I search / replace in visible org mode lines only?
I have an org file where the majority of the text in the buffer at any one time is folded. I would like to be able to perform a search and replace on only the unfolded lines. For example, I have a ...
2
votes
1
answer
171
views
Org-roam case-insensitive search
Org-roam's org-roam-node-find and org-roam-node-insert functions both match node titles case-sensitively. To find a node called "JavaScript" I can't just type lowercase j TAB, I have to type ...
1
vote
1
answer
51
views
Search and replace to merge or eliminate text lines
A WinRAR command (rar vt -pmypassword -v myarc.part01.rar >source.txt) produces detailed information on files contained in .rar files or segments (e.g., filename.part01.rar). Here's an example for ...
1
vote
3
answers
153
views
Using Emacs to find and copy relevant database records
I have reduced a large text file to a 1.9GB size that Microsoft Access can handle, but only as a linked file. To permit full Access operations - to import the relevant data into Access - I need to ...
2
votes
1
answer
149
views
Search whole ebook in nov
nov.el does not provide an easy function to search the whole of the ebook content. Every search performed on buffer only applies to the "document" or chapter of the book on display at that ...
1
vote
0
answers
74
views
Disable search-as-you-type in Doom Emacs
Is there a way to disable "search as you type" functionality in Doom Emacs? Either with the Vim equivalent of / or through I-search C-s. With large documents, that functionality causes Emacs ...
1
vote
0
answers
37
views
helm-do-ag not working as expected to search with command-option
I want a function to search in filenames and retrieve those filenames containing the string I search for.
For some reason, this piece of code is not working for this purpose:
(defun helm-do-ag-...
1
vote
2
answers
467
views
Search in all Org mode headings within a folder
Is there in Emacs such a function to search within all headings of all Org mode files within a folder or group of folders?
0
votes
0
answers
51
views
Info mode isearch across nodes
https://www.gnu.org/software/emacs/manual/html_node/info/Search-Text.html
Instead of using s in Emacs Info and in the stand-alone Info, you can use an incremental search started with C-s or C-r. It ...
0
votes
1
answer
38
views
Weird behavior of `search-forward-regexp` influenced by buffer mode change
Action 1: evaluate the lisp expression: (search-forward-regexp "\\s'")
in a buffer in lisp-interaction-mode containing the text:
The pandemic market was cooling, but homes in north Seattle ...
0
votes
1
answer
37
views
helm-projectile-find-file-in-known-projects, but with grep
Using helm-projectile-find-file-in-known-projects is great if you know the filename. It searches all known projects for a filename.
, but what if you want to search for a string one of the files ...
0
votes
1
answer
256
views
How to leave cursor at beginning of searched text in isearch?
Say I have this text:
|Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Where the | is the cursor, at the beginning of the line. I want to jump to the next occurrence of the sequence "...
-2
votes
6
answers
148
views
How do I break a large piece of text in to a list of 5-word phrases, and identify the oft-repeated phrases [closed]
I would like a function that finds repeating sequences of text sections. Would start with defining a number N. Let I have (setq N 5) say. I would take the first five text sections, then look for ...
1
vote
1
answer
47
views
Setting Helm custom source from the result of a search
I want to be able to use the results of a regexp search as an helm source. The goal here is to find all the labels of a latex document, this in part because I find this useful but also to learn Helm ...
0
votes
0
answers
58
views
helm-grep-do-git-grep: possible to show results in minibuffer?
When I use helm-grep-do-git-grep results are shown in the current window or a different one, but it takes the whole window. It there an option to show results in the minibuffer, below the current ...
0
votes
0
answers
42
views
counsel-git-grep: why does it ignore .gitignore paths?
Currently there is an issue (or else I can't figure it out) with counsel-git-grep-function: why does this function not ignore the files in .gitignore when searching? It would be a useful function if ...
2
votes
1
answer
36
views
How can I ignore non-existing files in a fixed custom tags-search?
I want to search through a fixed set of files and I use the tags-search command for it:
(defvar my-files-form
'(list "/path/to/one/file"
"/path/to/another/file"))
(...
0
votes
1
answer
407
views
Text search in directory with live preview
How can I text-search the current directory (or any directory) with a live preview? That would be something like ranger or peep-mode but for text-search results. I use counsel-rg mostly, but I have to ...
0
votes
1
answer
49
views
How can I use 'transients' in 'magit' to enable case-insensitive search? [closed]
I got it working a year ago, then my machine died. I've been unable to figure out the interface to transient.
When I view the levels (green and red, with numbers in them), I hit '-i' but see an error '...
1
vote
1
answer
65
views
Create a function to run a search with mini-buffer partially completed
I would like to write a function that starts a search (evil-search-forward specifically), with some arbitrary text already in the minibuffer.
Following directions in this link I came up with the ...
0
votes
1
answer
184
views
org-mode: Search for properties does not work
I have a file "restaurants.org" containing:
#+title: Restaurants
#+author: xyz
#+COLUMNS: %Where %Name
* Ristorante Y
:PROPERTIES:
:Where: Canal Street 10
:Name: Ristorante Y
I wanted to ...
2
votes
0
answers
53
views
Find notes with accented characters when searching for the base character (like isearch with character folding)
Emacs isearch has a "character folding" functionality which can be toggled with M-s ' during isearch. When this is activated, the search can find something like "maçã" (apple in ...
0
votes
1
answer
157
views
Imap search in gnus incorrectly returing empty group
I currently have three email accounts I use and access with gnus. After
a recent upgrade to emacs 28.1 I lost the ability to search
the mail for one of these addresses. They are all initiated ...
0
votes
1
answer
57
views
limit-of-search to apply search-forward to just current paragraph
The search-forward function takes four arguments:
(search-forward "target-string"
limit-of-search
what-to-do-if-search-fails
repeat-count)
...
0
votes
2
answers
102
views
Elisp function to search for end of sentence (full stop + space)
I am devising a part of a function that searches for the next full stop (dot) and space as representing the end of a written sentence and inserts a new line.
So far I have come up with this:
(while (...
-1
votes
1
answer
225
views
"non-existent agenda file ~/file.org. [R]emove from list or [A]bort?" when using file-expand-wildcards
As per this example below, I try to customize queries that require searching in different folders that are not agenda files. According to this part of the manual, it should be possible. However, ...
2
votes
1
answer
183
views
searching for explicit spaces, without reinterpretation
Often I'll search (an ordinary i-search) for a sequence of two spaces, or three, or four.
But on one machine I'm using, emacs by default appears to be in some mode where searches for spaces are ...
0
votes
1
answer
320
views
How to re-search-forward OR
How can I match the values for the keys (org mode attributes) #+label OR #+name?
Example: Using get-labels () I got fig:foo. Nice.
How can I get fig:bar as well?
#+label: fig:foo
#+name: fig:bar
...
1
vote
1
answer
278
views
How to implement google/other search engine search of visually selected text in evil mode (counsel-search of selected text)
How can I define a command that searches the web for the evil visually selected text using google or some other search engine? counsel-search already does this if you insert a string, but how can I ...
0
votes
1
answer
92
views
How to show timestamped entries without TODO status
I understand from the manual that the command for doing a search of agenda entries which have a timestamp before today is as follows:
TIMESTAMP<"<today>"
If I additionally want to ...
0
votes
1
answer
90
views
Retrieve/list all entries with active timestamps before today
Is there a way to list all agenda entries which have active timestamps state (no DEADLINE or SCHEDULED)? I ask because these get lost in the agenda unlike Deadlines and Scheduled tasks, which keep ...
0
votes
1
answer
283
views
How to preserve helm project search results to iterate through them
I am using spacemacs with vim bindings and doing a search project-wide for something like while \( with SPC s p. I get the results in a helm buffer and can enter transient state to navigate them, but ...
2
votes
1
answer
97
views
How can I search and replace in one go and for the full or selected text without visiting each search hit? [duplicate]
Any advanced editor has it: Search and Replace to replace a chosen word with another, with search criteria "Match case" and "Match whole word only" in addition like in notepad++.
I ...
1
vote
1
answer
61
views
Point to bound variables in scope
So, Dr. Racket has a very interesting feature where you can see all occurrences of a bound variable if you hover it:
Is there a way to do something similar in Emacs? I'm currently editing C++ code. ...