diff options
author | Richard M. Stallman <rms@gnu.org> | 1997-05-24 08:14:51 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1997-05-24 08:14:51 +0000 |
commit | 63f125ee33b7f62a929416263d408a49a79f63c6 (patch) | |
tree | ff667a6b3f89190f2f5d83ef6a0ad88c48bfd51c /lisp/libc.el | |
parent | 2c989468dacb5f1c63727c86d6de77b67a381454 (diff) | |
download | emacs-63f125ee33b7f62a929416263d408a49a79f63c6.tar.gz |
(libc-highlight-overlay): New variable.
(libc-search-index): Use an overlay for highlighting.
Diffstat (limited to 'lisp/libc.el')
-rw-r--r-- | lisp/libc.el | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/libc.el b/lisp/libc.el index bbf5115d915..ed1fa394b9f 100644 --- a/lisp/libc.el +++ b/lisp/libc.el @@ -44,9 +44,12 @@ "Basename of the Info file of the GNU C Library Reference Manual.") (defvar libc-highlight-face 'highlight - "*Face for highlighting looked up symbol names in the Info buffer; + "*Face for highlighting looked up symbol names in the Info buffer. `nil' disables highlighting.") +(defvar libc-highlight-overlay nil + "Overlay object used for highlighting.") + (defconst libc-symbol-completions nil "Alist of documented C symbols.") @@ -232,9 +235,15 @@ not `nil'." ;; occurence of ITEM will be highlighted. (save-excursion (re-search-forward (regexp-quote item)) - (put-text-property - (match-beginning 0) (match-end 0) - 'face libc-highlight-face))) + (let ((start (match-beginning 0)) + (end (match-end 0))) + (if (overlayp libc-highlight-overlay) + (move-overlay libc-highlight-overlay + start end (current-buffer)) + (setq libc-highlight-overlay + (make-overlay start end)))) + (overlay-put libc-highlight-overlay + 'face libc-highlight-face))) (beginning-of-line))) item) (error nil))) |