GNU bug report logs -
#32668
26.1; Give find-dired prefix argument behaviour equivalent to that of rgrep
Previous Next
To reply to this bug, email your comments to 32668 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#32668
; Package
emacs
.
(Sun, 09 Sep 2018 09:35:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Phil Sainty <psainty <at> orcon.net.nz>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 09 Sep 2018 09:35:04 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
In bug#27456 "Not possible to use -prune with find-dired", workarounds
were provided for the issue that, due to the way that `find-dired'
constructs its find command, some common usage patterns for the `find'
command can't be used with `find-dired'.
I think it would be useful and consistent for `find-dired' to acquire
the prefix argument behaviour of `rgrep', which does the following:
> With C-u prefix, you can edit the constructed shell command line
> before it is executed.
> With two C-u prefixes, directly edit and run [the find command].
Giving the user access to edit the final command before it is executed
would allow users to massage otherwise-unusable syntax into a working
command.
This would give users an alternative solution to the kind of problem
presented in the aforementioned bug report, and would be especially
useful for those who are unfamiliar with the particular find options
needed to work around the problem at present.
In GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll
bars)
of 2018-06-19 built on shodan
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Ubuntu 18.04.1 LTS
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
funcall-interactively: End of buffer
Configured using:
'configure --prefix=/home/phil/emacs/26.1/usr/local
--with-x-toolkit=lucid --without-sound'
Configured features:
XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK DBUS GSETTINGS NOTIFY
GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11 THREADS
LCMS2
Important settings:
value of $LANG: en_NZ.UTF-8
locale-coding-system: utf-8
Major mode: Dired by name
Minor modes in effect:
show-paren-mode: t
minibuffer-depth-indicate-mode: t
winner-mode: t
global-hl-line-mode: t
tooltip-mode: t
global-eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
buffer-read-only: t
line-number-mode: t
transient-mark-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv
bytecomp byte-compile cconv cl-loaddefs cl-lib format-spec rfc822 mml
mml-sec password-cache epa derived epg epg-config gnus-util rmail
rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils dired-x easymenu paren mb-depth winner
ring hl-line dired dired-loaddefs advice elec-pair time-date mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting x-toolkit x multi-tty make-network-process emacs)
Memory information:
((conses 16 101384 15323)
(symbols 48 20776 1)
(miscs 40 108 168)
(strings 32 30269 886)
(string-bytes 1 789963)
(vectors 16 15400)
(vector-slots 8 503524 6466)
(floats 8 58 59)
(intervals 56 268 0)
(buffers 992 13))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#32668
; Package
emacs
.
(Sun, 09 Sep 2018 14:05:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 32668 <at> debbugs.gnu.org (full text, mbox):
> For now I have raised this as bug#32668: 26.1; Give find-dired prefix
> argument behaviour equivalent to that of rgrep
FWIW, in my library `find-dired+.el', which adds to `find-dired.el',
`find-dired' acts as follows (`C-h f find-dired'):
------8<---------------
find-dired is an interactive Lisp function in ‘find-dired+.el’.
(find-dired DIR ARGS &optional DEPTH-LIMITS EXCLUDED-PATHS)
Run ‘find’ and put its output in a buffer in Dired Mode.
Then run ‘find-dired-hook’ and ‘dired-after-readin-hook’.
The ‘find’ command run (after changing into DIR) is essentially this,
where LS-SWITCHES is ‘(car find-ls-option)’:
find . \( ARGS \) LS-SWITCHES
Optional args:
* DEPTH-LIMITS: Minimum and maximum depths: (MIN-DEPTH MAX-DEPTH).
* EXCLUDED-PATHS: Strings matching paths to be excluded.
Uses ‘find’ switch ‘-path’.
When both optional args are non-nil, the ‘find’ command run is this:
find . -mindepth MIN-DEPTH -maxdepth MAX-DEPTH
\( -path EXCLUDE1 -o -path EXCLUDE2 ... \)
-prune -o \( ARGS \) LS-SWITCHES
where EXCLUDE1, EXCLUDE2... are the EXCLUDED-PATHS, but shell-quoted.
------8<---------------
The same is true for `find-name-dired' and `find-grep-dired' - they make the same use of `-prune', as does the new command `find-time-dired' (`C-h f'):
------8<---------------
find-time-dired is an interactive Lisp function in ‘find-dired+.el’.
(find-time-dired DIR MIN-TIME MAX-TIME &optional DEPTH-LIMITS
EXCLUDED-PATHS)
Find files in directory DIR newer or older than a timestamp.
The output is shown in a Dired buffer.
MIN-TIME is a format-time string parsable by ‘parse-time-string’, such
as "2014-12-25 23:59:00". Only files newer than this are shown.
If MIN-TIME is nil or a string matching regexp "^\s-*$", there is
no lower time limit.
MAX-TIME is also a format-time string parsable by ‘parse-time-string’.
Only files older than this time are shown.
If MAX-TIME is nil or a string matching regexp "^\s-*$", the upper
time limit is the current system time.
Optional arg DEPTH-LIMITS is a list (MIN-DEPTH MAX-DEPTH) of the
minimum and maximum depths. If nil, search directory tree under DIR.
Optional arg EXCLUDED-PATHS is a list of strings that match paths to
exclude from the search. If nil, search all directories.
If args DEPTH-LIMITS and EXCLUDED-PATHS are both non-nil then the
command run is essentially the following:
find . -mindepth MIN-DEPTH -maxdepth MAX-DEPTH
\( -path EXCLUDE1 -o -path EXCLUDE2 ... \)
-prune -o \( -TIME-SWITCH -SINCE-MIN -TIME-SWITCH +SINCE-MAX \)
LS-SWITCHES
where:
* EXCLUDE1, EXCLUDE2... are the EXCLUDED-PATHS, but shell-quoted.
* TIME-SWITCH is ‘find-diredp-time-prefix’ concatenated with "min".
* SINCE-MIN is the elapsed time since MIN-TIME in minutes.
* SINCE-MAX is the elapsed time since MAX-TIME in minutes.
* LS-SWITCHES is ‘(car find-ls-option)’.
------8<---------------
This code was improved by Tino Calancha. Without having studied
the bug threads of #27456 or #32668, this sounds relevant. If it
helps I can offer this code, as a patch or as is. The code is here:
https://www.emacswiki.org/emacs/download/find-dired%2b.el
This bug report was last modified 6 years and 279 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.