From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: francois.fleuret@noos.fr (=?iso-8859-1?q?Fran=E7ois?= Fleuret) Newsgroups: gmane.emacs.help Subject: Re: Style in elisp: how to show a flag value in the modeline? Date: 20 Feb 2003 13:45:46 +0100 Organization: Noos Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <878ywbi0hx.fsf@noos.fr> References: <87of579t70.fsf@noos.fr> <84fzqjgoob.fsf@lucy.is.informatik.uni-duisburg.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1045747165 29635 80.91.224.249 (20 Feb 2003 13:19:25 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 20 Feb 2003 13:19:25 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18lqbj-0007hj-00 for ; Thu, 20 Feb 2003 14:19:23 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18lqYO-0000jV-01 for gnu-help-gnu-emacs@m.gmane.org; Thu, 20 Feb 2003 08:15:56 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!syros.belnet.be!news.belnet.be!news.tele.dk!news.tele.dk!small.news.tele.dk!proxad.net!proxad.net!noos.fr!not-for-mail Original-Newsgroups: gnu.emacs.help X-Attribution: FF User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-Lines: 32 Original-NNTP-Posting-Date: 20 Feb 2003 13:14:42 GMT Original-NNTP-Posting-Host: 81.67.17.162 Original-X-Trace: 1045746882 news.noos.fr 24769 81.67.17.162 Original-X-Complaints-To: abuse@noos.fr Original-Xref: shelby.stanford.edu gnu.emacs.help:110429 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:6931 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:6931 Hi, Kai Großjohann wrote on 20 Feb 2003 12:46:28 MET: > Maybe minor-mode-alist is the right pointer? I added (setq minor-mode-alist (assq-delete-all 'mp3play-auto-mode minor-mode-alist)) in a function called by kill-buffer-hook, and (setq minor-mode-alist (cons '(mp3play-auto-mode " auto-play") minor-mode-alist)) in the initialization. Also, (force-mode-line-update) when the flag is flipped. Is that the right way to go ? Using minor-mode-alist wihout having defined a minor-mode ? I still wonder a bit on two points. First, this variable is not buffer-local, thus the flag appears in all buffers (on the other hand I want the other monior mode to appear in my mp3play buffer.) Also to avoid to add twice the same assoc in the list, should I ensure that myself, or can it be handled in a smart way by the alist artillerie ? Sorry for those questions, but I really have a hard time getting a feeling on how things "should be" written in elisp. Regards, FF