[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Two improvements
From: |
Chitale, Sandip V |
Subject: |
Two improvements |
Date: |
Wed, 15 Jan 2003 15:24:38 -0800 |
1. A function to dump the data matched by isearch-* family of functions.
This may be added to lisp/isearch.el.
(defun dump-match-data ()
"Dump match data"
(interactive)
(with-output-to-temp-buffer "*match-data*"
(dotimes (index (/ (length (match-data)) 2))
(princ (format "[%d] = %s\n" index (match-string index)))
)
)
)
2. A variant of the above to complement the re-builder functionality.
This may be added to lisp/emacs-lisp/re-builder.el.
(define-key reb-mode-map "\C-cm" 'reb-dump-match-data)
(defun reb-dump-match-data ()
"Dump match data in buffer *match-data*"
(interactive)
(with-output-to-temp-buffer "*match-data*"
(dotimes (index (/ (length (match-data)) 2))
(princ (format
"[%d]\t%s\n"
index
(match-string index
;; prepend with a space to get around a bug
(concat " "
(with-current-buffer
reb-target-buffer (buffer-string))))))
)
)
)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Two improvements,
Chitale, Sandip V <=