(require 'cl)
(require 'htmlize)
-(defun egrep-regexps-1 (result-buffer regexp predicate args)
+(defun egrep-1 (result-buffer regexp predicate args)
(let ((file-name (buffer-file-name)))
(save-excursion
(goto-char (point-min))
(defun egrep-finalize-result-buffer (result-buffer)
(goto-char (point-min)))
-(defun egrep-regexps (regexp &optional predicate &rest args)
+(defun egrep (regexp &optional predicate &rest args)
(interactive "sRegexp: ")
(let ((result-buffer (egrep-prepare-result-buffer)))
- (egrep-regexps-1 result-buffer regexp predicate args)
+ (egrep-1 result-buffer regexp predicate args)
(egrep-finalize-result-buffer result-buffer)))
(defun egrep-font-face-predicate (face-symbol)
if (not (eq (get-text-property point 'face) face-symbol)) return nil
finally return t))
-(defun egrep-regexps-with-face (regexp face-symbol)
+(defun egrep-with-face (regexp face-symbol)
(interactive (list (read-string "Regexp: ")
(intern (completing-read "Face symbol: "
(mapcar (lambda (face) (symbol-name face)) (face-list))
nil t))))
- (egrep-regexps regexp 'egrep-font-face-predicate face-symbol))
+ (egrep regexp 'egrep-font-face-predicate face-symbol))
-(defun egrep-regexps-dired-marked-files (regexp &optional prepare predicate &rest args)
+(defun egrep-dired-marked-files (regexp &optional prepare predicate &rest args)
(interactive "sRegexp: ")
(let ((result-buffer (egrep-prepare-result-buffer)))
(loop for file-name in (dired-get-marked-files nil current-prefix-arg)
(message (format "Searching %s ..." (file-name-nondirectory file-name)))
(sit-for .1)
(if prepare (funcall prepare))
- (egrep-regexps-1 result-buffer regexp predicate args))))
+ (egrep-1 result-buffer regexp predicate args))))
(egrep-finalize-result-buffer result-buffer)
(message "Search complete.")))
(mapcar (lambda (face) (symbol-name face)) (face-list)))
predicate t (or initial "font-lock-") hist default inherit-input-method)))
-(defun egrep-regexps-with-face-dired-marked-files (regexp face-symbol)
+(defun egrep-with-face-dired-marked-files (regexp face-symbol)
(interactive (list (read-string "Regexp: ")
(egrep-read-font-lock-face "Font symbol: ")))
- (egrep-regexps-dired-marked-files regexp
- (lambda ()
- (font-lock-fontify-buffer)
- (htmlize-ensure-fontified))
- 'egrep-font-face-predicate
- face-symbol))
+ (egrep-dired-marked-files regexp
+ (lambda ()
+ (font-lock-fontify-buffer)
+ (htmlize-ensure-fontified))
+ 'egrep-font-face-predicate
+ face-symbol))
(provide 'egrep)