From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: ytrewq1 Newsgroups: gmane.emacs.help Subject: (apparently lost, so rewritten and reposted) Re: header-line-format hacking Date: Mon, 31 Jan 2005 02:36:31 +0000 (UTC) Message-ID: References: <87is5ln5pd.fsf@robotron.ath.cx> <35nimiF4q87bsU1@individual.net> <7emzuw4fka.fsf@ada2.unipv.it> <7eis5k46ut.fsf@ada2.unipv.it> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1107139743 3995 80.91.229.6 (31 Jan 2005 02:49:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 31 Jan 2005 02:49:03 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jan 31 03:48:56 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CvRcV-0004Gp-00 for ; Mon, 31 Jan 2005 03:48:56 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CvRp8-0001Up-Ij for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Jan 2005 22:01:58 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1CvRoj-0001Rg-4l for help-gnu-emacs@gnu.org; Sun, 30 Jan 2005 22:01:33 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1CvRoY-0001M4-Je for help-gnu-emacs@gnu.org; Sun, 30 Jan 2005 22:01:24 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CvRoY-0001KZ-7r for help-gnu-emacs@gnu.org; Sun, 30 Jan 2005 22:01:22 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CvRQm-00037O-5N for help-gnu-emacs@gnu.org; Sun, 30 Jan 2005 21:36:48 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1CvRQc-0004Pv-1T for help-gnu-emacs@gnu.org; Mon, 31 Jan 2005 03:36:38 +0100 Original-Received: from p2113-ipbf613marunouchi.tokyo.ocn.ne.jp ([222.149.225.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 31 Jan 2005 03:36:38 +0100 Original-Received: from ytrewq1 by p2113-ipbf613marunouchi.tokyo.ocn.ne.jp with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 31 Jan 2005 03:36:38 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 25 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 222.149.225.113 (Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0) X-Gmane-MailScanner: Found to be clean X-Gmane-MailScanner: Found to be clean X-MailScanner-From: geh-help-gnu-emacs@m.gmane.org 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: main.gmane.org gmane.emacs.help:23767 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:23767 Thien-Thi Nguyen writes: > the minor mode code presuambly comprises a bunch of defuns > plus some "load-time actions". the load-time actions is > where the variable is inserted into `header-line-format' > (be sure to check that it's not already there). > > the idea is to modify `header-line-format' at most one time, > and use indirection (through the variable) to effect state > toggling and notification. Thanks for the explanation. I think I understand how this approach could work for mode-line-format as it's default value is non-nil. However, on my system, header-line-format has a default value of nil. As far as I can tell, if a buffer's header-line-format value is modified to be non-nil a header is displayed -- so if a buffer starts out w/ a header-line-format value of nil and minor mode code modifies it to be non-nil, deactivation of the minor mode will cause the buffer to have an empty header line ("baggage"). Is there a way to avoid this "baggage" using the idiomatic approach?