What's wrong with this .emacs?

What's wrong with this .emacs?

Post by David J. Kant » Tue, 26 Oct 1999 04:00:00



This snippet of my .emacs file doesn't really work; could someone let me
know what might be wrong with it? I have to M-x font-lock-mode RET for it to
work, even though (require 'font-lock) is in .emacs file. But once that's
done, all the colors I've set in the .emacs file seem to work OK.

Thanks for any help.

;;; Colors
;; Font color stuff. If you want the default colors, you could
;; do this:
       ;; (setq font-lock-use-default-fonts nil)
       ;; (setq font-lock-use-default-colors t)
       ;; but I want to specify my own colors, so I turn off all
       ;; default values.
       (setq font-lock-use-default-fonts nil)
       (setq font-lock-use-default-colors nil)

       (require 'font-lock)

       ;; Mess around with the faces a bit.  Note that you have
       ;; to change the font-lock-use-default-* variables *before*
       ;; loading font-lock, and wait till *after* loading font-lock
       ;; to customize the faces.

       ;; string face is green
       (set-face-foreground 'font-lock-string-face "forest green")

       ;; comments are italic and red; doc strings are italic
       ;;
       ;; (I use copy-face instead of make-face-italic/make-face-bold
       ;; because the startup code does intelligent things to the
       ;; 'italic and 'bold faces to ensure that they are different
       ;; from the default face.  For example, if the default face
       ;; is bold, then the 'bold face will be unbold.)
       (copy-face 'italic 'font-lock-comment-face)
       ;; Underlining comments looks terrible on tty's
       ;; (set-face-underline-p 'font-lock-comment-face nil 'global 'tty)
       ;; (set-face-highlight-p 'font-lock-comment-face t 'global 'tty)
       (copy-face 'font-lock-comment-face 'font-lock-doc-string-face)
       (set-face-foreground 'font-lock-comment-face "red")

       ;; function names are bold and blue
       (copy-face 'bold 'font-lock-function-name-face)
       (set-face-foreground 'font-lock-function-name-face "blue")

       ;; misc. faces
       (and (find-face 'font-lock-preprocessor-face) ; 19.13 and above
            (copy-face 'bold 'font-lock-preprocessor-face))
       (copy-face 'italic 'font-lock-type-face)
       (copy-face 'bold 'font-lock-keyword-face)

--
David J. Kanter

Debian 2.1

 
 
 

What's wrong with this .emacs?

Post by Kai Gro?joha » Tue, 26 Oct 1999 04:00:00



Quote:> This snippet of my .emacs file doesn't really work; could someone
> let me know what might be wrong with it? I have to M-x
> font-lock-mode RET for it to work, even though (require 'font-lock)
> is in .emacs file. But once that's done, all the colors I've set in
> the .emacs file seem to work OK.

(require 'font-lock) does not do anything other than defining the
appropriate functions.  Actually _executing_ the functions is a
different matter entirely.

I suggest that you put the following line in your .emacs file:
    (global-font-lock-mode 1 t)
This requires a recentish Emacs and won't work for XEmacs, but since
you didn't say which version of Emacs you are using...

kai
--
Life is hard and then you die.

 
 
 

1. Get error: 'Wrong type argument: characterp, 38'

Hello,

I got a Problem with xemacs-20.2:
Whenever I try starting gnus (M-x gnus) xemacs displays the error
message above. They also occures if I try to eval (require 'tm-vm) or
(require 'mime-setup). However, if I set 'load-ignore-elc-files' on t,
the Problems disappear. Do you have any idea where this comes from?

Thomas

2. Looking for SCSI/VLB controller recommendation

3. 'Wrong type argument: internal-facep, []' in 19.30?

4. HPVue cant "find itself" after powerfail

5. what's wrong with my Emacs?

6. mailbox program (a FAQ??)

7. Elisp engine or what's wrong with Emacs

8. Ghostscript and Windows Printing System

9. What's wrong with this define-key statement?

10. ERROR: `Wrong type argument: overlayp, nil'

11. What's wrong with my java mode?

12. DON'T READ FEATURES.NEW (I posted wrong group...sorry!)

13. What's wrong with flow control?