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: Re: bug#14957: 24.3.50; Flyspell language visible in mode line Date: Thu, 14 Nov 2013 11:41:42 +0100 Organization: Sebastien Vauban Message-ID: <86bo1np8nt.fsf@somewhere.org> References: <86y58teatq.fsf@missioncriticalit.com> <87wqmfz96x.fsf@web.de> <86a9hevcyl.fsf@somewhere.org> <86bo1ppx2i.fsf@somewhere.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1384439761 26550 80.91.229.3 (14 Nov 2013 14:36:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Nov 2013 14:36:01 +0000 (UTC) To: bug-gnu-emacs-mXXj517/zsQ@public.gmane.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Thu Nov 14 15:36:07 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 1Vgy1L-0004Ik-A9 for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Nov 2013 15:35:47 +0100 Original-Received: from localhost ([::1]:55741 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vgy1K-0008EY-AO for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Nov 2013 09:35:46 -0500 X-Received: by 10.180.211.114 with SMTP id nb18mr766947wic.3.1384425718810; Thu, 14 Nov 2013 02:41:58 -0800 (PST) Original-Path: usenet.stanford.edu!h9no3797701wic.1!news-out.google.com!hj15ni1722wib.0!nntp.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!ecngs!feeder2.ecngs.de!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.bug Original-Lines: 54 Injection-Info: mx05.eternal-september.org; posting-host="402b34550bd938aa98825778083dce0e"; logging-data="16420"; mail-complaints-to="abuse-VVbKFVtnif8H+i2N2EyTrmui9UKz+5OX@public.gmane.org"; posting-account="U2FsdGVkX19jln+mC4C8Cn0mWZGKrrBi" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt) X-Archive: encrypt Cancel-Lock: sha1:e566l9KSwTfXDeQyOTMhaXM8sxk= sha1:3oh2JZvD9ANywhwpLNW4+/lp7rg= X-Url: Under construction... Original-Xref: usenet.stanford.edu gnu.emacs.bug:106592 X-Mailman-Approved-At: Thu, 14 Nov 2013 09:35:05 -0500 X-BeenThere: bug-gnu-emacs-mXXj517/zsQ@public.gmane.org X-Mailman-Version: 2.1.14 Precedence: list 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:80426 Archived-At: Michael Heerdegen wrote: > "Sebastien Vauban" writes: > >> 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. > > Yes, that sounds reasonable. Current version: --8<---------------cut here---------------start------------->8--- (setq-default mode-line-format (cons '(:eval (let ((dict (and (featurep 'ispell) (not buffer-read-only) (or ispell-local-dictionary ispell-dictionary)))) (and dict (propertize (concat " [" (substring dict 0 2) "]") 'face 'mode-line-highlight)))) (default-value 'mode-line-format))) --8<---------------cut here---------------end--------------->8--- > @Everybody: would it make sense to add a new variable > `mode-line-dictionary' that shows the abbreviated name of the current > dictionary when appropriate? Spell checking is essential when editing > any buffer, so showing the dictionary is not less useful than showing > the input method. People that don't want to see it anyway could just > customize the variable to nil. +1 > We could also make it display something only when the dictionary is not the > default one. I'd prefer to always (when it makes sense) see the current dict, with the same argument as the one you just used: like the input method, we want to always see the current one in the mode line. Best regards, Seb -- Sebastien Vauban