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

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

Re: .emacs - minor mode behavior


From: Kevin Rodgers
Subject: Re: .emacs - minor mode behavior
Date: Tue, 13 Feb 2007 20:24:58 -0700
User-agent: Thunderbird 1.5.0.9 (Macintosh/20061207)

J K wrote:
I'm just learning Emacs and have recently started working on a .emacs
file for myself.  I was hoping someone could answer what I think is
probably a simple question:

During customization of the mode line, I was able to turn on column-
number-mode with the following line in .emacs:

(setq column-number-mode t)

I understand that this line is setting 'column-number-mode to t
(true).  I also understand that this variable is created along with
the column-number-mode function by the define-minor-mode macro in
simple.el.

I then proceeded to attempt to add the time to the mode line with the
line:

(setq display-time-mode t)

This doesn't work.  I have seen that you can instead call the function
with a positive argument like so:

(display-time-mode 1)

But I don't understand why the first method doesn't work.  I think the
problem is that I don't know how emacs goes from variables being set
to t/nil to actually drawing the screen, but I was hoping to avoid
digging that deep as I still am learning.  Could someone please help
me to understand?

Some minor modes are simple enough that all you need to do is set a
variable to turn them on.  But some are not, in which case the variable
is merely an indicator of whether the mode is on or not.
display-time-mode is one of the latter; see the third sentence of its
doc string:

,----[ C-h v display-time-mode RET ]
| display-time-mode is a variable defined in `time.el'.
| Its value is nil
|
|
| Documentation:
| Non-nil if Display-Time mode is enabled.
| See the command `display-time-mode' for a description of this minor-mode.
| Setting this variable directly does not take effect;
| either customize it (see the info node `Easy Customization')
| or call the function `display-time-mode'.
|
| You can customize this variable.
|
| [back]
`----

Also - I've read quite a few posts in this group, and it seems like
most folks lean toward using customize as opposed to hand
editing .emacs.  Am I making things harder on myself?

Perhaps.  But since I had used Emacs for about 15 years before custom
came along, I prefer to stick with .emacs.


--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

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