1

Aquamacs 2.4 for OSX has been designed to use Preferences.el and customizations.el instead of ~/.emacs


Preferences.el

(require 'whitespace)

;; This is for files previously created and then opened with Aquamacs.
(global-whitespace-mode t)

;; This is needed for new files and/or the scratch buffer.
;; Add additional hooks for each mode desired.
(add-hook 'text-mode-hook 
  (function (lambda ()
              (whitespace-mode t))))

;; These are keyboard shortcuts -- \C is ctrl; a hyphen is a pause.
(global-set-key "\C-cw" 'global-whitespace-mode)
(global-set-key "\C-c\C-w" 'whitespace-mode)
(global-set-key "\C-c=t" 'global-whitespace-toggle-options)
(global-set-key "\C-c_t" 'whitespace-toggle-options)
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
lawlist
  • 13,099
  • 3
  • 49
  • 158
  • You should not modify the Question in this fashion. You can post an Answer of your own explaining your solution. The original problem must remain so the Answer bellow makes sense. – brasofilo Apr 14 '13 at 20:02
  • Thank you for the suggestion for future reference. I was concerned about stealing the thunder from `ataylor` because I was so appreciative of his help. I wanted the ability to include some code of the solution (which doesn't work for comments), but I didn't want it to appear as if I one-upped him with my own answer (which would have belittled the help that he graciously provided). I'll try to strike a balance in the future to preserve the question and also not try to one-up anyone who has dedicated time to helping me arrive at the solution. – lawlist Apr 14 '13 at 20:31
  • 1
    There's no problem that you write your own to extend someone else's Answer. Just credit the source and it's all k. As a matter of fact, your own explanation may help other person, just like @ataylor's helped you :) - I'd strongly suggest that you restore the Question to the original problem and publish an Answer. – brasofilo Apr 14 '13 at 20:34
  • Glad you solved your problem; however, please do not add 'solved' to your question title, or turn your question into a conversation; just leave it as a question. Future visitors then can compare your problem with their own situation to see if the accepted answer below helps them too. – Martijn Pieters Apr 17 '13 at 13:15

1 Answers1

1

M-x customize-group whitespace, and enable Global Whitespace Mode. If you don't like the default way whitespace is displayed, customize Whitespace Display Mappings.

ataylor
  • 64,891
  • 24
  • 161
  • 189
  • Thank you so very much -- your answer, plus this keyboard shortcut explanation helped me to understand what was going on: http://oracc.museum.upenn.edu/doc/builder/emacs/aquamacs/ – lawlist Apr 11 '13 at 20:22
  • This webpage is also a must read for beginners: http://emacswiki.org/emacs/WhiteSpace – lawlist Apr 11 '13 at 20:36
  • @lawlist Follow advices from the EmacsWiki with great care only. Much of what you read there is outdated, hacky, or downright wrong. –  Apr 11 '13 at 21:11
  • Is it possible to automatically enable `global-whitespace-mode` on startup of the app? I was able to set up keyboard shortcuts, but I haven't yet found a way to default always to show whitespace. I'm not too sure what this is for `(autoload 'whitespace-toggle-options "whitespace" "Toggle local ` `whitespace-mode' options." t)`, but I don't think it controls automatic loading of options at startup. – lawlist Apr 11 '13 at 22:11
  • Choose the Save option after customizing: "Apply and Save", "Save for Future Sessions" or similar, depending on the version of emacs. This will write out some lines at the end of your `.emacs` file. – ataylor Apr 11 '13 at 22:28
  • Issue resolved -- thank you so very much. I'll edit my question to reflect the steps taken to finally arrive at a working solution based on your answer and also based on this thread: http://stackoverflow.com/questions/8036576/how-to-get-whitespace-mode-enabled-only-for-certain-modes – lawlist Apr 12 '13 at 01:23