all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Introducing  face in comments for various modes
@ 2022-12-11 15:35 Heime
  2022-12-11 17:40 ` Stefan Monnier via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 38+ messages in thread
From: Heime @ 2022-12-11 15:35 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor

The following uses `hi-lock` to change the foreground of comments matching
a regexp.  This is implemented for emacs-lisp files where comments start 
with ";;".  

I would like to extend this for other programming languages besides emacs-lisp
files, using the relevant comment character automatically for that language.

(defface elfa-face
  '((t :foreground "magenta"))
  "Face for comment headings.")

(defun elfa-regexp (&optional actm)
  "Identify comment category ';; [Category]'."
   (highlight-regexp
      "^;;\s+\\[.+\\].*$" 'elfa-face))

(defun elfa-category ()
  "TODO."
  (interactive)
  (add-to-list 'auto-mode-alist '("\\.el\\'" . hi-lock-mode))
  (add-hook 'emacs-lisp-mode-hook 'hi-lock-mode t)
  (add-hook 'hi-lock-mode-hook 'elfa-regexp))






^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2022-12-13 19:19 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-11 15:35 Introducing face in comments for various modes Heime
2022-12-11 17:40 ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-12-12  2:24   ` Heime
2022-12-12  3:00     ` Heime
2022-12-12  8:49       ` Thibaut Verron
2022-12-12  9:21         ` Heime via Users list for the GNU Emacs text editor
2022-12-12  9:58           ` Thibaut Verron
2022-12-12 10:20             ` Heime
2022-12-12 10:50               ` Thibaut Verron
2022-12-12 11:55                 ` Heime
2022-12-12 12:17                   ` Thibaut Verron
2022-12-12 14:46                     ` Heime
2022-12-12 15:22                 ` Yuri Khan
2022-12-12 15:38                   ` Thibaut Verron
2022-12-12 15:55                   ` Christopher Dimech
2022-12-12 16:07                   ` Christopher Dimech
2022-12-12 17:44                   ` Stefan Monnier
2022-12-13  5:20                     ` Christopher Dimech
2022-12-12 15:22           ` Stefan Monnier
2022-12-13  7:52           ` Jean Louis
2022-12-13  8:04             ` Heime
2022-12-13  8:30               ` Heime
2022-12-13  9:35                 ` Thibaut Verron
2022-12-13  9:46                   ` Heime
2022-12-13 10:05                     ` Thibaut Verron
2022-12-13 10:24                       ` Christopher Dimech
2022-12-13 10:40                       ` Heime
2022-12-13 10:45                         ` Thibaut Verron
2022-12-13 10:49                           ` Heime
2022-12-13 15:00                           ` Heime
2022-12-13 12:37                     ` Jean Louis
2022-12-13 14:00                       ` Heime
2022-12-13 12:36                 ` Jean Louis
2022-12-13 13:46                   ` Heime
2022-12-13 12:35               ` Jean Louis
2022-12-13  8:17             ` Christopher Dimech
2022-12-13 19:19               ` Jean Louis
2022-12-12 15:20         ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.