Skip to main content

Theresa O’Connor / Treasa Ní Chonchúir

auto-fill issues

Hi there.

A while ago, I defined a custom menu using the (really fantastically
cool) easy-menu package. This menu, named "Modes", contains items for
minor modes that I often toggle. Here's an example of a menu item
definition:

["Temp Buffer Resizing" temp-buffer-resize-mode :style toggle
:selected temp-buffer-resize-mode :key-sequence nil]

Basically, for (almost every) menu item, I have the item call a
function which toggles the appropriate mode, and the [X] or [ ] is
displayed based on a variable that reflects the current status of the
mode. This variable is almost always the same symbol as the function,
because virtually every Emacs minor mode uses the variable and
function bindings of the symbol in precisely this way.

One of my menu items is for auto-fill mode. I use the function
auto-fill-mode as the function that is called from this menu item. The
catch is, I have no idea what kind of expression to use to test
whether or not auto-fill is currently on, as auto-fill-mode evidently
lacks the variable binding that most every other mode has, so this
menu item lacks the [X] / [ ] that all of the others have.

Granted, I can look in the modeline to tell if auto-fill is on or off.
It's only that I'm annoyed at the inconsistent look of the menu (and
by the inconsistency of auto-fill-mode relative to other minor modes).
Does anyone know of an expression I could use for the :selected value
in this menu item definition?

I'm using 20.(6|7) on various Unix platforms as well as Win32.

Thank you very much!

--
Theresa O’Connor
tess@oconnor.cx

It is easy to be blinded to the essential uselessness of computers by
the sense of accomplishment you get from getting them to work at all.

-- Douglas Adams