all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to enable the syntax highlighting for comments within files  having a specific extension?
@ 2009-07-15 11:37 gento
  2009-07-15 23:51 ` Xah Lee
  2009-08-27 20:57 ` pjb
  0 siblings, 2 replies; 6+ messages in thread
From: gento @ 2009-07-15 11:37 UTC (permalink / raw)
  To: help-gnu-emacs

Hi All,

I'm using emacs to edit journal text files *.jou, for which the
commented lines
starts with the character "/".

I got two working solutions to have emacs recognize the "*.jou" files
and
apply the corresponding comment syntax automatically.

Namely I add to the .emacs file either

(require 'cl)
(push '("\\.jou$" . (lambda () (text-mode) (setf comment-start "/")))
auto-mode-alist)

or

(add-hook 'find-file-hooks
 (lambda ()
  (when (string-match "\\.jou$" (buffer-file-name))
   (setq comment-start "/")
  )
 )
)

For the moment I'm using the latter macro.


Now I would also like to enable the syntax highlighting for comments.

Does anybody know how I can modify one of the previous code snippets
in order to turn the text of the commented lines into red ?

I appreciate any help.


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

end of thread, other threads:[~2009-08-27 22:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-15 11:37 How to enable the syntax highlighting for comments within files having a specific extension? gento
2009-07-15 23:51 ` Xah Lee
2009-07-16 13:13   ` bj
2009-07-17  1:14     ` Xah Lee
2009-08-27 22:22     ` A.Politz
2009-08-27 20:57 ` pjb

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.