Ticket #850 (new enhancement )

Opened 4 years ago

Last modified 4 years ago

default search string for twisted-dev-grep (twisted-dev.el)?

Reported by: ytrewq1 Assigned to: glyph
Type: enhancement Priority: low
Milestone: Component:
Keywords: Cc: glyph, ytrewq1
Branch: Author:
Launchpad Bug:

Attachments

Change History

  2005-01-03 10:15:26+00:00 changed by ytrewq1

I think it'd be nice for twisted-dev-grep to guess a default search string --
specifically, using something surrounding 'point'.
I modified my local copy to use the thing-at-point function to obtain a search
string and the second argument of read-from-minibuffer to specify this as a
default.  Sample source below [1]:
(defun twisted-dev-grep ()
  (interactive)
  (let ((default-string (thing-at-point 'symbol)))
    (grep (format
           "sh -c 'find %s -name \"*.py\" -or -name \"*.html\"; find %s/bin
-maxdepth 1 -type f ' | xargs egrep -n \"%s\""
           twisted-dev-directory
           twisted-dev-directory
           (read-from-minibuffer "find in Twisted source: " default-string)))))
I'm using a version of FSF Emacs 21.3.x -- I don't know whether the
modifications will work on XEmacs or other versions of Emacs.
[1] I'm using an older twisted-dev-grep because the latest in CVS doesn't work
on my platform (bug filed separately).
Note: See TracTickets for help on using tickets.