Article View: gnu.epoch.misc
Article #2031Re: updated sather mode
From: Heinz Schmidt
Date: Tue, 07 May 1991 17:48
Date: Tue, 07 May 1991 17:48
65 lines
3046 bytes
3046 bytes
HI. Here is a small contribution that shows how to use multi-fonts under
Epoch.
> Date: Tue, 7 May 91 10:49:39 -0400
> From: rsw@cs.brown.edu (Bob Weiner)
>
> > * Presentation of online documentation is improved in many details.
> > Under Epoch for instance, multiple fonts are used to highlight
> > feature names and kinds.
>
> I would like to see how you do this.
The sample command allows to use regular expression to highlight text
selectively. It uses only one additional font. But from here it is
perhaps not difficult to find your way through 'styles'. There
is also a file in the contrib directory called 'common-styles' that
may be of interest in this context.
-- hws
--------------------------------------------------------------------------
Heinz W. Schmidt hws@icsi.berkeley.edu
International Computer Science Institute, Berkeley (415) 642-4274 x175
;;; -*- Mode: Emacs-Lisp; -*-
;;; File: touchup.el
;;; Author: Heinz Schmidt (hws@ICSI.Berkeley.EDU)
;;; Copyright (C) International Computer Science Institute, 1991
;;;*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;;;* FUNCTION: Highlight regular expression matches under Epoch
;;;*
;;;* HISTORY:
;;;* Last edited: May 2 23:28 1991 (hws)
;;;* Created: Thu May 2 23:16:35 1991 (hws)
;;;*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(defun make-font-style-attribute (font)
(let ((style (make-style))
(attr (reserve-attribute)))
(set-style-foreground style (foreground))
(set-style-background style (background))
(set-style-font style font)
(set-attribute-style attr style)
attr))
;; User variable, else hyper-man boldface, else our own...
(defvar Touchup-attribute
(or (and (boundp 'Info-active-attribute)
Info-active-attribute)
(make-font-style-attribute "6x13bold")))
(defun re-touchup (regexp &optional ARG)
"Highlight all matches for regular expression. With prefix arg
keep previous highlighting. By default turn previous highlighting off."
(interactive "sRegular exp: \nP")
(cond ((null ARG)
(dolist (marker (epoch::button-list (current-buffer)))
(epoch::delete-button marker))))
(while (re-search-forward regexp (point-max) t)
(add-button (match-beginning 0) (point) Touchup-attribute)))
Technical Details
Message-ID:
<9105071748.AA23392@icsib1.Berkeley.EDU>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!unreplyable!garbageReferences:
<9105071449.AA02777@tahiti.cs.brown.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fc7ee,aabf4a3922715d15,start X-Google-Attributes: gidfc7ee,public X-Google-ArrivalTime: 1991-05-08 02:58:00 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!unreplyable!garbage From: hws@ICSI.BERKELEY.EDU (Heinz Schmidt) Newsgroups: gnu.epoch.misc Subject: Re: updated sather mode Message-ID: <9105071748.AA23392@icsib1.Berkeley.EDU> Date: 7 May 91 17:48:51 GMT References: <9105071449.AA02777@tahiti.cs.brown.edu> Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 65