From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Sebastien Vauban" Newsgroups: gmane.emacs.bugs Subject: bug#14957: 24.3.50; Flyspell language visible in mode line Date: Tue, 12 Nov 2013 14:29:57 +0100 Organization: Sebastien Vauban Message-ID: <86bo1ppx2i.fsf@somewhere.org> References: <86y58teatq.fsf@missioncriticalit.com> <87wqmfz96x.fsf@web.de> <86a9hevcyl.fsf@somewhere.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1384263076 24921 80.91.229.3 (12 Nov 2013 13:31:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 Nov 2013 13:31:16 +0000 (UTC) Cc: 14957-ubl+/3LiMTaZdePnXv/OxA@public.gmane.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Tue Nov 12 14:31:19 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VgE3q-0001OB-Dw for geb-bug-gnu-emacs@m.gmane.org; Tue, 12 Nov 2013 14:31:18 +0100 Original-Received: from localhost ([::1]:42829 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgE3p-0006TU-W9 for geb-bug-gnu-emacs@m.gmane.org; Tue, 12 Nov 2013 08:31:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36206) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgE3h-0006SE-Cr for bug-gnu-emacs-mXXj517/zsQ@public.gmane.org; Tue, 12 Nov 2013 08:31:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VgE3b-0000xN-7K for bug-gnu-emacs-mXXj517/zsQ@public.gmane.org; Tue, 12 Nov 2013 08:31:09 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34329) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgE3b-0000xC-4n for bug-gnu-emacs-mXXj517/zsQ@public.gmane.org; Tue, 12 Nov 2013 08:31:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VgE3a-0000MT-HW for bug-gnu-emacs-mXXj517/zsQ@public.gmane.org; Tue, 12 Nov 2013 08:31:02 -0500 X-Loop: help-debbugs-mXXj517/zsQ@public.gmane.org Resent-From: "Sebastien Vauban" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs-mXXj517/zsQ@public.gmane.org Resent-Date: Tue, 12 Nov 2013 13:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs-mXXj517/zsQ@public.gmane.org X-GNU-PR-Message: followup 14957 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14957-submit-ubl+/3LiMTaZdePnXv/OxA@public.gmane.org id=B14957.13842630241203 (code B ref 14957); Tue, 12 Nov 2013 13:31:02 +0000 Original-Received: (at 14957) by debbugs.gnu.org; 12 Nov 2013 13:30:24 +0000 Original-Received: from localhost ([127.0.0.1]:48348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VgE2w-0000JA-PP for submit-ubl+/3LiMTaZdePnXv/OxA@public.gmane.org; Tue, 12 Nov 2013 08:30:23 -0500 Original-Received: from dd5e0353a.access.telenet.be ([213.224.53.58]:35957 helo=mail.missioncriticalit.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VgE2s-0000IO-K6 for 14957-ubl+/3LiMTaZdePnXv/OxA@public.gmane.org; Tue, 12 Nov 2013 08:30:20 -0500 Original-Received: from MUNDANEUM.i-did-not-set--mail-host-address--so-tickle-me (unknown [10.10.10.51]) by mail.missioncriticalit.com (Postfix) with ESMTPS id 20E2D500D74; Tue, 12 Nov 2013 14:32:48 +0100 (CET) X-Url: Under construction... X-Archive: encrypt In-Reply-To: (Michael Heerdegen's message of "Fri, 08 Nov 2013 22:30:31 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt) X-BeenThere: debbugs-submit-ubl+/3LiMTaZdePnXv/OxA@public.gmane.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs-mXXj517/zsQ@public.gmane.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Xref: news.gmane.org gmane.emacs.bugs:80318 Archived-At: Hello Michael, Michael Heerdegen wrote: >> (add-to-list 'mode-line-format >> '(:eval >> (let ((dict (and (featurep 'ispell) >> (or ispell-local-dictionary >> ispell-dictionary)))) >> (and dict >> (concat " [" >> (propertize (substring dict 0 2) >> 'face 'mode-line-highlight) >> "]")))) > > That's not good. `mode-line-format' "automatically becomes buffer-local > when set" (see C-h v). Your `add-to-list' only manipulates the > `mode-line-format' of the current buffer when your code is evaluated > (*scratch*, probably). > > You have to modify the default value, like this: > > (setq-default mode-line-format > (cons > '(:eval > (let ((dict (and (featurep 'ispell) > (or ispell-local-dictionary > ispell-dictionary)))) > (and dict > (concat " [" > (propertize (substring dict 0 2) > 'face 'mode-line-highlight) > "]")))) > (default-value 'mode-line-format))) > > Does that help? Yes, it does. However, I still wonder how to put the language indicator at the *end* of the modeline -- I tried this at first, but I'm now sure it's not a good idea. We can't do that by inverting the two components in the above cons expression. And it seems I'm not yet bilingual enough in Lisp... FYI, there is one minor annoyance; I'd like to see the language indicator only where it makes sense, that is NOT in (almost) every buffer. For example, I do see "fr" (my default dictionary) in the Emacs manuals, which is twice wrong: - they're in English, and - they're read-only... I guess the read-only feature is the way to specify (in an automatic way) the visibility (by default) of that feature. WDYT? In such a case, we simply have to add a condition in the above "and" expression. Best regards, Seb -- Sebastien Vauban