From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier " Newsgroups: gmane.emacs.help Subject: Re: Style in elisp: how to show a flag value in the modeline? Date: 20 Feb 2003 15:45:54 -0500 Organization: Yale University Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <5lbs16smt9.fsf@rum.cs.yale.edu> References: <87of579t70.fsf@noos.fr> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1045774707 13608 80.91.224.249 (20 Feb 2003 20:58:27 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 20 Feb 2003 20:58:27 +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 18lxlv-0003X3-00 for ; Thu, 20 Feb 2003 21:58: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 18lxjR-0002Jq-0B for gnu-help-gnu-emacs@m.gmane.org; Thu, 20 Feb 2003 15:55:49 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!news.ycc.yale.edu!rum.cs.yale.edu!rum.cs.yale.edu Original-Newsgroups: gnu.emacs.help Original-Lines: 20 Original-NNTP-Posting-Host: rum.cs.yale.edu User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-Original-NNTP-Posting-Host: rum.cs.yale.edu X-Original-Trace: 20 Feb 2003 15:45:54 -0500, rum.cs.yale.edu Original-Xref: shelby.stanford.edu gnu.emacs.help:110444 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:6946 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:6946 >>>>> "FF" == François Fleuret writes: > What is the good way to show in the modeline the value of a boolean of > a flag associated to a major-mode ? The current solution I came with > is to change the value of `mode-name'. But I have the feeling that > should be done another way. Any advice ? I think a standard way to do it is (set (make-local-variable 'mode-line-process) '("" (var-1 " var-1 is ON" " var-1 is OFF") var-2)) this would display the boolean status of var-1 and the current value of var-2 right after the major-mode and before the minor modes. At least that's what I use in PCL-CVS and it works well. The value of mode-line-process (and of var-2 as well) is interpreted in the same way as mode-line-format (except maybe that % escape thingies don't work, IIRC). Stefan