Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've just installed Aquamacs on my Mac.

I have a .emacs file in my home, which contains all my customizations. Among these, I have:

(custom-set-faces
 '(default ((t (:stipple nil :background "black" :foreground "grey70" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 140 :width normal :foundry "apple" :family "Monaco"))))
 '(font-lock-builtin-face ((t (:foreground "grey50"))))
 '(font-lock-comment-face ((t (:foreground "darkgreen"))))
 '(font-lock-constant-face ((t (:foreground "grey50"))))
 '(font-lock-doc-face ((t (:foreground "grey50"))))
 '(font-lock-doc-string-face ((t (:foreground "yellow2"))))
 '(font-lock-function-name-face ((t (:foreground "SteelBlue"))))
 '(font-lock-keyword-face ((t (:foreground "red"))))
 '(font-lock-preprocessor-face ((t (:foreground "SteelBlue"))))
 '(font-lock-reference-face ((t (:foreground "LightSkyBlue"))))
 '(font-lock-string-face ((t (:foreground "yellow2"))))
 '(font-lock-type-face ((t (:foreground "violet"))))
 '(font-lock-variable-name-face ((t (:foreground "orange"))))
 '(font-lock-warning-face ((t (:foreground "grey50"))))
 '(isearch ((t (:background "yellow4" :foreground "black"))))
 '(mode-line ((t (:background "grey90" :foreground "black"))))
 '(text-mode-default ((t nil)))
 '(zmacs-region ((t (:background "grey70" :foreground "black")))))

This block seems not to be applied automatically.

If I select the lines from the .emacs and manually evaluate them, everything works fine. My guess is that these options are overridden in some other place.

How can I debug this? Where should I set my custom faces?

UPDATE:

According to this, preferences should be loaded in the following order:

 ~/.emacs  (deprecated -- meaning 'should not be used
 for new installations, but will continue to be supported' -- in Aquamacs on OS X)
 customizations saved by request or automatically by Aquamacs in customizations.el
 /Library/Preferences/Emacs/Preferences.el
 /Library/Preferences/Aquamacs Emacs/Preferences.el
 ~/Library/Preferences/Emacs/Preferences.el
 ~/Library/Preferences/Aquamacs Emacs/Preferences.el

My ~/Library/Preferences/Aquamacs Emacs/Preferences.el looks like (by default):

 (load "~/.emacs")

So this doesn't really make sense to me...

share|improve this question

I had the same problem setting the color of the point. Then I found the file customizations.el, changed the line setting the colour of the point there, and everything worked fine. I don't know whether your file will be on the same place, but mine was found here:

/Users/viviannevilar/Library/Preferences/Aquamacs Emacs/customizations.el

share|improve this answer
    
I tried that already, but it didn't help... :( – Roberto Aloi Jun 22 '10 at 9:10
    
Have you tried asking this question at stackoverflow.com ?? Emacs users tend to "hang out" there more often, and I am sure someone would be able to help you.... – Vivi Jun 23 '10 at 8:18

All right. This is what I did in the end. Mainly I "imported" the faces into the Aquamacs customizations by doing:

  • Started Aquamacs as usual
  • Even if the face is defined in the .emacs, it is ignored by Aquamacs
  • Opened the .emacs buffered
  • Manually selected the face section and evaluated
  • Options -> Appearance -> Auto Faces -> Auto Faces (ENABLED)
  • Options -> Appearance -> Auto Faces -> Apply Face of some mode -> Text
  • Options -> Appearance -> Auto Faces -> Adopt Face and Frame Parameters as Face Default
  • Options -> Save Options
  • Remove the faces from .emacs

Everything works fine after Aquamacs restart. Groan.

Thanks to anyone here.

share|improve this answer

In nick hates software: Aquamacs "Emacs", Nick found that custom-set-faces worked in Emacs but not in Aquamacs.

As Nick did, you might also try your custom-set-faces code in the Lisp interaction window, being careful as regarding his ^J problem (which is beyond my level of expertise in Lisp).

If you are using a font-name, you can check that Aquamacs understands it by using emacs -fn fontname. In case of an error, custom-set-faces just fails and Emacs then goes on using the font it would have used otherwise.

share|improve this answer

For info about the .emacs file and troubleshooting, see this emacswiki.org article.

See also this article, The Init File, ~/.emacs, for possible conflicts.

From Why doesn't this [terminal or window-system setup] code work in my `.emacs' file, but it works just fine after Emacs starts up :

During startup, Emacs initializes itself according to a given code/file order. If some of the code executed in your `.emacs' file needs to be postponed until the initial terminal or window-system setup code has been executed but is not, then you will experience this problem (this code/file execution order is not enforced after startup).

To postpone the execution of Emacs Lisp code until after terminal or window-system setup, treat the code as a lambda list and set the value of either the term-setup-hook or window-setup-hook variable to this lambda function. For example,

(add-hook 'term-setup-hook
          (lambda ()
           (when (string-match "\\`vt220" (or (getenv "TERM") ""))
             ;; Make vt220's "Do" key behave like M-x:
             (global-set-key [do] 'execute-extended-command))))
share|improve this answer
    
Thanks for this. I updated the question with some comments. Also, I tried to (add-hook 'term-setup-hook (lambda () MY_OLD_CODE )) but it didn't help (assuming this was the way it was supposed to be used - I suck at Lisp). – Roberto Aloi Sep 8 '10 at 16:27
    
I'm not much better at Lisp, but somehow I feel that timing is the explanation : the custom-set-faces options are not read at the right time. – harrymc Sep 8 '10 at 16:58

The full Emacs startup sequence is documented in the Startup summary section of the Emacs Lisp manual. This manual doesn't document Aquamacs-specific extensions.

In a comment, you mention that doing your customizations from term-setup-hook' still doesn't work. So what overrides them is either inwindow-setup-hook' or in an Aquamacs-specific step.

Aquamacs has some specific customization for faces which may be overriding your customizations done through the standard Emacs mechanism. They can be turned off by including (aquamacs-autoface-mode 0) in your .emacs or through the menu “Options / Appearance / Auto Faces / Auto Faces”.

The Emacs wiki has some information on making Aquamacs behave like other Emacsen.

share|improve this answer
    
I checked and the autofaces are disabled already. :( – Roberto Aloi Sep 13 '10 at 9:41
    
Also, I added the whole set-faces block. Maybe that can help. – Roberto Aloi Sep 13 '10 at 9:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .