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

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

Need Help on Whitespace-mode in Emacs 24.1.1


From: Fan
Subject: Need Help on Whitespace-mode in Emacs 24.1.1
Date: Sat, 25 Aug 2012 20:15:48 -0700 (PDT)
User-agent: G2/1.0

Hi

I had the following lines in my ~/.emacs and the whitespace mode worked fine in 
Emacs 23.1.1 previously.

  (message "Enabling whitespace mode ...")
  (require 'whitespace)
  (set-face-background 'whitespace-tab "lime green")
  (setq-default whitespace-style '(tabs trailing))
  (global-whitespace-mode t)
  (message "Enabled whitespace mode.")

However, when I switched to Emacs 24.1.1, the whitespace mode no longer worked. 
 It won't highlight, even if I tried exec whitespace-mode to toggle it on and 
off again.

>From reading help on whitespace-style variable, it appears both 'tabs & 
>'trailing now also require 'face, i.e.

  (setq-default whitespace-style '(face tabs trailing))

When I tested by eval it and followed by exec whitespace-mode interactively, it 
worked.

BTW, somehow, the mode line now shows my buffer has both WS major mode & ws 
minor mode after exec whitespace-mode.  Why are there 2 whitespace modes?  
Previously, whitespace works with just only WS major mode in Emacs 23.1.1.

I then replaced the old whitespace-style line with the above line in my 
~/.emacs.

Unfortunately, when I tried to start a new Emacs session, it failed to open 
properly.  Here are the contents displayed in *Warnings* and *Messages* buffers.

In *Warnings* buffer:

  Warning (initialization): An error occurred while loading `/home/.emacs':
  
  Symbol's value as variable is void: font-lock-defaults-alist
  
  To ensure normal operation, you should investigate and remove the
  cause of the error in your initialization file.  Start Emacs with
  the `--debug-init' option to view a complete error backtrace.

In *Messages* buffer:

  Enabling whitespace mode ...
  let: Symbol's value as variable is void: font-lock-defaults-alist
  Error in post-command-hook (global-font-lock-mode-check-buffers): 
(void-variable font-lock-defaults-alist)

I'm clueless to what went wrong, and how to debug.  Please help.

If setting whitespace-style variable interactively worked, why would it fail 
when set in ~/.emacs?  Is there something else I need to set to get whitespace 
mode working in Emacs 24.1.1?

Thanks for your help in advance.

Fan


reply via email to

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