help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: font-lock as a single command


From: Christopher Dimech
Subject: Re: font-lock as a single command
Date: Sat, 13 Feb 2021 04:00:29 +0100

I have done.  One difficulty is that supinf-enable is executed
as soon as I read the file.  Do not know how it is being enabled
automatically after I commented out the line that said
"(add-hook 'crucible-mode-hook #'supinf-enable)".

(defun supinf-enable ()
  "Enables a typeface for displaying tex commands."
  (interactive)
  (setq supinf-signal t)
  ;; Syntax for font-lock-add-keywords is
  ;;   (font-lock-add-keywords MODE KEYWORDS &optional HOW)
  (font-lock-add-keywords nil
     '(  (supinf-match (1 (supinf-raise-cruc (match-beginning 0)))) )
     t))

(global-set-key (kbd "H-s") #'supinf-enable)

> Sent: Saturday, February 13, 2021 at 2:46 PM
> From: "Emanuel Berg via Users list for the GNU Emacs text editor" 
> <help-gnu-emacs@gnu.org>
> To: help-gnu-emacs@gnu.org
> Subject: Re: font-lock as a single command
>
> Christopher Dimech wrote:
>
> > I made a minor-mode and added a hook to enable. But would
> > also like to enable it using a key-sequence, a task that
> > I have been unable to get working.
> >
> > (add-hook 'crucible-mode-hook #'supinf-enable)
>
> Well, bind `supinf-enable' to a key!
>
> Is it `interactive'?
>
> --
> underground experts united
> http://user.it.uu.se/~embe8573
> https://dataswamp.org/~incal
>
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]