Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
0b2bb4d0
Commit
0b2bb4d0
authored
Sep 04, 1998
by
Karl Heuer
Browse files
(dired-mark-files-containing-regexp):
Don't use find-file; instead, insert the file in a temp buffer.
parent
3827b1b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
lisp/dired.el
lisp/dired.el
+12
-9
No files found.
lisp/dired.el
View file @
0b2bb4d0
...
...
@@ -2165,17 +2165,20 @@ A prefix argument means to unmark them instead.
(
and
(
not
(
looking-at
dired-re-dot
))
(
not
(
eolp
))
; empty line
(
let
((
fn
(
dired-get-filename
nil
t
)))
(and fn (save-excursion
(
and
fn
(
let
((
prebuf
(
get-file-buffer
fn
)))
(
message
"Checking %s"
fn
)
;; For now we do it inside emacs
;; Grep might be better if there are a lot of files
(message "Checking %s" fn)
(let* ((prebuf (get-file-buffer fn)))
(find-file fn)
(goto-char (point-min))
(prog1
(re-search-forward regexp nil t)
(if (not prebuf) (kill-buffer nil))))
))))
(
if
prebuf
(
with-current-buffer
prebuf
(
save-excursion
(
goto-char
(
point-min
))
(
re-search-forward
regexp
nil
t
)))
(
with-temp-buffer
(
insert-buffer-contents
fn
)
(
goto-char
(
point-min
))
(
re-search-forward
regexp
nil
t
))))
)))
"matching file"
)))
(
defun
dired-flag-files-regexp
(
regexp
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment