Thread View: gnu.epoch.misc
1 messages
1 total messages
Started by David.BRistor
Sat, 24 Oct 1992 00:39
isearching with color
Author: David.BRistor
Date: Sat, 24 Oct 1992 00:39
Date: Sat, 24 Oct 1992 00:39
59 lines
3021 bytes
3021 bytes
We've been using the attached code in epoch 3.2 with a non-local minibuffer.
Basically, the minibuffer turns red during isearch, and reverts to normal
colors when the search terminates, regardless of how it's terminated.
But with 4.2, it does not work properly. The minibuffer does change to red
during isearch, but exiting the search via ESC causes the entire buffer to be
displayed in red. Reverting the minibuffer to it's original colors is
always possible, the method required depending on circumstances of the search:
If we searched for a pattern not found in the buffer, we can reset the
colors by C-gC-l (keyboard quit followed by recenter).
If we searched for a patter that *is* in the buffer, we can reset the
colors by any command that moves point vertically in the buffer, or by C-l
(recenter).
In either case, inserting a character will also reset the colors. In fact,
epoch thinks the colors have been reset. Uncomment the code below;
Any clues, folks? The color resetting is in an unwind-protect, so I'd of
thought it'd be OK...
,-------.
/ | \
Dave Bristor / | \
bristor@sun.com | | |
#include <disclaimer.h> \ /|\ /
\ / | \ /
`-------'
--------------- cut here ---------------
(when (and (boundp 'epoch::version)
(not (featurep 'color-isearch)))
(setq isearch-background "red")
(setq isearch-foreground "black")
(fset 'orig-isearch (symbol-function 'isearch))
(defun isearch (forward &optional regexp)
(let ((bg (epoch::background nil (epoch::minibuf-screen)))
(fg (epoch::foreground nil (epoch::minibuf-screen))))
(epoch::background isearch-background (epoch::minibuf-screen))
(epoch::foreground isearch-foreground (epoch::minibuf-screen))
(unwind-protect
(orig-isearch forward regexp)
(epoch::background bg (minibuf-screen))
(epoch::foreground fg (minibuf-screen))
;; (save-excursion
;; (set-buffer (get-buffer-create "color"))
;; (goto-char (point-max))
;; (insert (format "old: %s %s new: %s %s\n"
;; bg fg
;; (epoch::background nil (minibuf-screen))
;; (epoch::foreground nil (minibuf-screen)))))
)))
(provide 'color-isearch)
)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads