From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Amos Bird Newsgroups: gmane.emacs.help Subject: Re: How can I force updating mini window's header line when mode line is updated? Date: Thu, 26 Apr 2018 01:16:57 +0800 Message-ID: <87fu3jqk8m.fsf@gmail.com> References: <87in8fqx0a.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: blaine.gmane.org 1524676534 16209 195.159.176.226 (25 Apr 2018 17:15:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 25 Apr 2018 17:15:34 +0000 (UTC) User-Agent: mu4e 1.0-alpha3; emacs 27.0.50 Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 25 19:15:30 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fBO0v-000457-Uw for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Apr 2018 19:15:30 +0200 Original-Received: from localhost ([::1]:38252 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBO32-0004Zn-Nz for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Apr 2018 13:17:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBO2W-0004Xi-3m for help-gnu-emacs@gnu.org; Wed, 25 Apr 2018 13:17:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBO2R-0006Dy-T2 for help-gnu-emacs@gnu.org; Wed, 25 Apr 2018 13:17:08 -0400 Original-Received: from mail-pg0-x22a.google.com ([2607:f8b0:400e:c05::22a]:34582) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fBO2R-0006DP-Le for help-gnu-emacs@gnu.org; Wed, 25 Apr 2018 13:17:03 -0400 Original-Received: by mail-pg0-x22a.google.com with SMTP id p10so13788183pgn.1 for ; Wed, 25 Apr 2018 10:17:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=kBJHit4LOfCk9P74aX8jW+N/EBfLBnAfvpjXkz+4PmA=; b=e70SXPiOVhEkwJs951Su+82txw4mnjQ89Z2w7AviAfQB40aMlqkVC6WyPqmhc363bJ H+JQxQrVR9BbAMuN17XzsMF71A41hb/1tLl0EVVAlVw6t4pnzYogYmc5PPY3E0dpqkUA Wt7JZgMdTMt5cIwwL0FegK8kAZ7GWt5HzCqGES3NbLwaKgF0F4l1eAQrsK+PQUwRe3B3 t9f6soZAwtjN3NHC9U20RJ79IgMMBJqC4Jhl2W+/OjUQN4wMtPtoYjlU5/qQ9/1cqle/ O7QzcuF9DxHZbY0N9GEU5HvYWX0gTQ+gTC5+adAGkZp1d3mXsNWWtlRTXoA7ca8l6TmN ++wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=kBJHit4LOfCk9P74aX8jW+N/EBfLBnAfvpjXkz+4PmA=; b=ePrZISOfayUckYvAhyDOqzF5+snDiiX1XJrX39VMHWT1J/pCL9uTU5porFoo74CPvj uQ27HEa4D6wwzubIMgRRhaR5QjRjlVidUBgHTCI0ZH9IDWtrF8UEQyOuII9ro/6oOMfP 7jZCNmYSTsrmJZII0s5xXs1poFmNahRRQHH0SmkdQ/tStNBSVnhz1qfi3cGCNCjyTsob FjcC72FdeEnfTyS2lZkX1UvLfZ3MiED64s/funLJp+LtnFTbjbhJNWXQJWx8Ad1Ea4UX JT4vpcUBopjj/spazZOUJnsg9VjCq4cxzw+K4f1k7plW1TjS0diMlU9DrOZhJCiHJ/3C KPjQ== X-Gm-Message-State: ALQs6tA6XK36V+76RsLI8KwPAu+BBFURbxIpMVhO/rE6xwHRBICRoqj3 If9nVD3fxYYPvI3+uy67Szc= X-Google-Smtp-Source: AIpwx4+4bMldrB6zrEv5H2jjPWS6F04Utt57ms77AxLb4/d4ig4cA+6YfH76dmZxMkriveGc11NGCw== X-Received: by 2002:a17:902:2826:: with SMTP id e35-v6mr30011143plb.348.1524676622728; Wed, 25 Apr 2018 10:17:02 -0700 (PDT) Original-Received: from localhost ([168.235.105.19]) by smtp.gmail.com with ESMTPSA id x81sm37911109pgx.68.2018.04.25.10.17.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Apr 2018 10:17:02 -0700 (PDT) In-reply-to: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::22a X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:116599 Archived-At: Thanks! Um I'm afraid post-command-hook might not help here. Emacs code has deep assumption of mini window having only one line. After I turn on the header line, things become messy. I'll try collecting all the hard-coded logic and see if this route indeed works. Here is what I've achieved so far https://la.wentropy.com/WYjq.webm regards, Stefan Monnier writes: >> 3. (setq-default header-line-format mode-line-format) > > Hmm... this would put a header-line on all windows, whereas IIUC > you > want a header-line only for the mini-window, right? > >> However the header line doesn't get updated at all. > > A window's header-line (and mode-line) will normally only be > updated if something happens in this window that would require > updating it. Part of this detection of when update is needed is > automatic, tho not all of it (so Elisp code sometimes has to > call > force-mode-line-update). > > In your case, the header-line belongs to the mini-window, so > this > detection (and most of existing Elisp code calling > force-mode-line-update) won't help because it will only detect a > need > for update when the *mini-window* is affected, whereas you most > likely > want to update it in many other cases. > > So you'll probably want to add some `post-command-hook` (and/or > other > related hooks) to try and detect when an update is needed, at > which > point you'll need to do > > (with-current-buffer > (force-mode-line-update)) > >> It seems xdisp.c only >> provides ways to update mode line, and I've reached the limit >> of my >> emacs-fu. How can I achieve this without hacking tons of the >> display logic? > > AFAIK the redisplay doesn't really distinguish the mode-line > from the > header-line in this respect (e.g. force-mode-line-update will > cause both > the mode-line and the header-line to be refreshed). > > > Stefan -- Amos Bird amosbird@gmail.com