From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: Fill column indicator functionality Date: Fri, 5 Apr 2019 23:15:43 +0200 Message-ID: <20190405211543.3n3vx2ce27nyu6zp@Ergus> References: <20190402212251.ee6jlzptyll24ebo@Ergus> <83sguzekc5.fsf@gnu.org> <20190403102234.gyk45tfk4uypilhn@Ergus> <83d0m3e43f.fsf@gnu.org> <20190405103614.oivi4mtlnklldli4@Ergus> <831s2gd2k6.fsf@gnu.org> <83pnq0bhef.fsf@gnu.org> <20190405181133.weuyq7yecuekolit@Ergus> <83imvsb7h0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="116576"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: NeoMutt/20180716 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 05 23:16:56 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hCWCl-000UDS-D6 for ged-emacs-devel@m.gmane.org; Fri, 05 Apr 2019 23:16:55 +0200 Original-Received: from localhost ([127.0.0.1]:47003 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hCWCk-0002pL-9E for ged-emacs-devel@m.gmane.org; Fri, 05 Apr 2019 17:16:54 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hCWBt-0002m4-2g for emacs-devel@gnu.org; Fri, 05 Apr 2019 17:16:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hCWBq-0005ov-Hb for emacs-devel@gnu.org; Fri, 05 Apr 2019 17:16:00 -0400 Original-Received: from sonic306-21.consmr.mail.ir2.yahoo.com ([77.238.176.207]:39370) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hCWBn-0005jT-Bz for emacs-devel@gnu.org; Fri, 05 Apr 2019 17:15:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1554498948; bh=RDoi91urKHa63xOCR/a0Vpo9mD0I7l5GtC0tcmrdjVg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=uYa13ADDz77C1SiTEgFN2fDzHustgkynMoiDK6ej3jtyfAnW148NUJMmK8lg7hTqMX85UmTrYwgIjFV5I1hGVleJyIwAjUynYJJZjqrhjIv/XQAxhjIaWzhGLgcro/uVHGu7Fh8431+y9ln7VgXk8qSpdy//s6zwQUsDToKPvd5laWCrkziEz+OrrhNNQBYe5NB3AtxkgRZh56s407NYoWXsnq09yGDxUEGUWKtBjp+9ip5MxVLZ8pdO6W28DwQfev+Q7SBXB9hefdazQBAsxl4bjNI9322B37S1BnpAncM7JmEFPUr2ioq3ayHE33wFzUuaM29chJeZjj4b2I/JKw== X-YMail-OSG: 7fcRXcYVM1kNv1X9aHrhCuubNTAc_QlWYbXaRIBaIqididwYGgV59XBISCOJH3I ZuM72byPFqW6DuwhgjamtonbtnQy5NsQP.trIKjo8.paEuoqZ65pMVTVKnQDGvp58EOx_7_4rfpt m8PVYaeH49Gfw5Hk_82ka5UznPnoKsV1goTzbj9l3ZrWPz2bZAzaTM4R8QeQ3.fqa49X42F4xE2Z lTAJqLOqqi14m48MdKyBpo7LWvFa6g_QWcmmxj2aqwXQBRUgRbH8.vcQDPluJTvWQq.1uxHJ.snj ClwbsSnFrZvygzUuZla3CR882pSmOBB2_RT4XpoIF9fCP2tqjcNgYB_wMko0ZEzUVqrdiPVaVFVn YorHM3CFiH5DCG8pjBuuP_.T3_SXTxkWwNONf2vvYhD_6NFrUL0HCnXWkiRixeWF_J.KX9AOv_bg 3mH_XEDDKJjpDpWOtr.TJvAveResqqJDwCYKQWq926fBbOH.WsO_HrjItUfTGW21jFGtpI07TMCx 6J_pb8BUg2M4RG7c04ANbHrawxxE5usPmqT9dMb_xmlj1WqjYv_0CwyYUztmCsnmU4E3EyhlqkuT srIMpofebvSC0FkwqWTUZRidNS_tCvHMFotkNKYTB00YKsp1yS1gSTietNUv_Oxe0KRo9UCSO_wF clG_FxnsirXtVKPAkcQjNf15H3rK4LVkRdfbwh9BwjkVq9Z5z9Evo.bqBnlrBelnBQWxL1aMl.H. pnjwMm2Q.sRKDKTPCWXguQqTuuSlEDUml1zTIqNq0pZAHerINEbOl9GIbVL_.cqpjcqQQGknB7kl 3Y56LRMOqYoeFMfBtFATN5OYpkXF6q9mByUhtrm.Re Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ir2.yahoo.com with HTTP; Fri, 5 Apr 2019 21:15:48 +0000 Original-Received: from 2.152.205.184.dyn.user.ono.com (EHLO Ergus) ([2.152.205.184]) by smtp410.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID f730f1d1ab678a7c481ad843576d0ca3; Fri, 05 Apr 2019 21:15:44 +0000 (UTC) Content-Disposition: inline In-Reply-To: <83imvsb7h0.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 77.238.176.207 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:235005 Archived-At: On Fri, Apr 05, 2019 at 10:03:07PM +0300, Eli Zaretskii wrote: >> Date: Fri, 5 Apr 2019 20:11:33 +0200 >> From: Ergus >> Cc: emacs-devel@gnu.org >> >> > (if (eq (aref (car (internal-char-font nil ?│)) 0) >> > w(face-font 'default)) >> > ;; can use the default font for U+2502 >> > >> >(But we should use the actual value of >> >display-fill-column-indicator-char instead of the literal character.) >> > >> >WDYT? >> >> Actually this is what we have now: >> >> (define-minor-mode display-fill-column-indicator-mode >> "Toggle display fill column indicator. >> This uses `display-fill-column-indicator' internally. >> >> To change the position of the column displayed by default, >> customize `display-fill-column-indicator-column' you can change the >> character for the indicator setting `display-fill-column-indicator-character'." >> :lighter nil >> (if display-fill-column-indicator-mode >> (progn >> (setq display-fill-column-indicator t) >> (unless display-fill-column-indicator-character >> (if (char-displayable-p ?\u2502) >> (setq display-fill-column-indicator-character ?\u2502) >> (setq display-fill-column-indicator-character ?|)))) >> (setq display-fill-column-indicator nil))) >> >> >> I think we only need to extend the inner if with your condition, but I >> got an error because (internal-char-font nil ?│) always return nil in a >> terminal and aref has issues with that. > >For terminal frames, char-displayable-p is okay and should be left >alone as the only test there. The test I proposed is only needed for >GUI frames. > >> In a gui I get this error: >> >> Debugger entered--Lisp error: (wrong-type-argument arrayp #) >> aref(# 0) >> eval((aref (car (internal-char-font nil 9474)) 0) nil) > >Oops, sorry, I copied the wrong expression. This is the correct one: > > (aref (query-font (car (internal-char-font nil ?│))) 0) > >Btw, there could be a problem when the mode is turned on on a GUI >frame, where '│' can be displayed OK, and then a TTY frame is created >in the same session, where that character cannot be displayed. I >wonder how to deal with this issue. There is also the problem that the user could activate display-fill-column-mode and then change the font.