From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Decebal Newsgroups: gmane.emacs.help Subject: Re: Extra info in modeline (tip and questions) Date: Tue, 14 Apr 2009 22:53:57 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <533fdd2a-8d26-47ce-9413-1bd2300ee2d1@s20g2000yqh.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1239777660 8496 80.91.229.12 (15 Apr 2009 06:41:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 15 Apr 2009 06:41:00 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 15 08:42:19 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Ltyp8-0007RW-Bg for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Apr 2009 08:42:18 +0200 Original-Received: from localhost ([127.0.0.1]:35724 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ltynj-0002SP-Bf for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Apr 2009 02:40:51 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!r33g2000yqn.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 55 Original-NNTP-Posting-Host: 84.53.123.169 Original-X-Trace: posting.google.com 1239774837 28043 127.0.0.1 (15 Apr 2009 05:53:57 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 15 Apr 2009 05:53:57 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: r33g2000yqn.googlegroups.com; posting-host=84.53.123.169; posting-account=K-cdeAoAAAD_0d505kUtHXJaT5LFIu-3 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; nl; rv:1.9.0.8) Gecko/2009032608 Firefox/3.0.8,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:168471 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:63745 Archived-At: On Apr 14, 5:54=A0pm, Nikolaj Schumacher wrote: > Decebal 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. =A0It's a fairly accepted convention, so I'd suggest to warm up to > it. ;) I meant more codewise. I expect that I did not use the best code, not knowing the language very well. The reason I put the closing parentheses on its own line, is that I find that more readable. I would even prefer: (defun a-function() . . . ) above: (defun a-function() . . . ) But maybe I should conform to the standard. > 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'. Do you have any good pointers? > > - 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. =A0You should > pass the region points (region-beginning) and (region-end) as > parameters when (region-active-p), if that's what you want to do... What I would like is that when I call the function interactively, that instead of returning the value, the value is displayed in the minibuffer. For this I need to know if the function is called interactively. If that is the case, I should do: (message ) Is there a way to know if the function called interactively? I also have another function where I need to input a boolean value interactively. At the moment I am doing this with n and use 0 for false and every other value for true. Is there a better way?