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

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

Re: Extra info in modeline (tip and questions)


From: Nikolaj Schumacher
Subject: Re: Extra info in modeline (tip and questions)
Date: Tue, 14 Apr 2009 17:54:22 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (darwin)

Decebal <CLDWesterhof@gmail.com> wrote:

> At the end of the post is the code.
> I have a few questions:
> - Can the code be written better? (I am relative new to elisp.)

It can be "written" "better" by not giving closing parentheses their own
line.  It's a fairly accepted convention, so I'd suggest to warm up to
it. ;)

Also there are alternatives to updating the mode-line from a timer.
The mode-line supports a special :eval form with functions that are
called automatically, or you might update the values in
`after-change-functions'.

> - I tried to generalize. For example there is a function buffer-count-
> words, which I would like to use also on a region of the buffer. But
> when I call it interactively, it does not return anything. What do I
> need to change?

You never call anything interactively for its return value.  You should
pass the region points (region-beginning) and (region-end) as
parameters when (region-active-p), if that's what you want to do...


regards,
Nikolaj Schumacher




reply via email to

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