From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: Variable pitch mode line Date: Thu, 23 Dec 2021 13:41:38 -0800 Message-ID: References: <87zgosdbo1.fsf@gnus.org> <86mtkszhnq.fsf@mail.linkov.net> <87o858e5r2.fsf@gnu.org> <86fsqjcqd8.fsf@mail.linkov.net> <87zgorawar.fsf@logand.com> <8B7890FE-9DFB-4282-8391-955032220234@gmail.com> <87wnjvavm2.fsf@logand.com> <87r1a3aubt.fsf@logand.com> Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.40.0.1.81\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_2C25D225-8AF5-4373-AB6F-D4B07C6DDD9F" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19041"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Tassilo Horn , Lars Ingebrigtsen , Emacs developers , Juri Linkov To: Tomas Hlavaty Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 23 22:43:36 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n0Vs8-0004mw-3Q for ged-emacs-devel@m.gmane-mx.org; Thu, 23 Dec 2021 22:43:36 +0100 Original-Received: from localhost ([::1]:52564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n0Vs7-00034m-11 for ged-emacs-devel@m.gmane-mx.org; Thu, 23 Dec 2021 16:43:35 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n0VqN-0001ru-60 for emacs-devel@gnu.org; Thu, 23 Dec 2021 16:41:47 -0500 Original-Received: from [2607:f8b0:4864:20::1033] (port=36416 helo=mail-pj1-x1033.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n0VqI-0004PN-0t; Thu, 23 Dec 2021 16:41:46 -0500 Original-Received: by mail-pj1-x1033.google.com with SMTP id n15-20020a17090a160f00b001a75089daa3so9845663pja.1; Thu, 23 Dec 2021 13:41:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=BKwQIliHR5e7b5vhSCmEhVNPsJ1apEbf4WWXp7uBcXQ=; b=HpeQguVkMNvCD/M88KyqM3+NgYXgwfP/MZ5/H5SDAQFEb42QGFEgrxYlSPiZvKh1EI sK5ztnb7QtCNyj2oi0pq2aQk3V3f9NvhW42WoGsZnnZ63t/PMGpzUnhvjAd7zxqdtm5Y 6ZF2aNzJ4A6ffLFJVJLRFB6RVy/jl6MFqNoDFYde6LX2xie7mQSG15sCi0V8u0Cj5eET Ae3cR9tGypNO/5l0yrVFN8QFDAnTr5ys3I1Ew10nE3wlhACTqb1CZDuufw4u6XaA8x5w 5/OSd10ior1Lev2ZFbzJWrzD6voz0vS329/52nqlthCr69VCNO9Y2mSBgWJxmurxHsE9 epkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=BKwQIliHR5e7b5vhSCmEhVNPsJ1apEbf4WWXp7uBcXQ=; b=ANcehu1pltkWaL2f6xnoWrPIbv/r9l6zqmDuFYY8sa/KVSn+KZQQPRd9eEMTo4zDIV yIrtSJ7lDFKLXlJgbQyA8SMMfP6I6vFdkfZ+b4+3SEAYdh4EzLWRDqFlr4egPLNqPVaf bnmIhyf9QZpRHfIuDN/9KxXXs96fBV/dx0IJ4MQ5DHTaIKFz5nSYC9jV8wGq+88cykIA MeX6s4u2b3bfypexey7Uz79UWfabXbxPfHxzSbWPlGJk8PMclOT/GIuLIce5HduYHrSL TkoCrl10p39Z94L4oM7YW+5dyBatusnHvbrt88uCeSCG8H2o3q3eO5MPw2gLlUl1LTJ6 WKaQ== X-Gm-Message-State: AOAM532WkMg1fvpt+RXTavuR1ValE/HH2Gf48G+kQlvfMoU/36qKDjlT xHsHQ9JulCbEZm0/pDNIdqc= X-Google-Smtp-Source: ABdhPJz78xvmx16B85RuRnG28VPatXUaSyxixFzqhR6V+ArB3G6lr6q1O0vemjUjoQpQje3RC1VW5w== X-Received: by 2002:a17:90b:1c87:: with SMTP id oo7mr4771094pjb.159.1640295700379; Thu, 23 Dec 2021 13:41:40 -0800 (PST) Original-Received: from smtpclient.apple ([2600:1700:2ec7:8c90:d149:cff8:e7a4:12f0]) by smtp.gmail.com with ESMTPSA id 22sm7056709pfv.173.2021.12.23.13.41.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Dec 2021 13:41:39 -0800 (PST) In-Reply-To: <87r1a3aubt.fsf@logand.com> X-Mailer: Apple Mail (2.3693.40.0.1.81) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1033 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=casouri@gmail.com; helo=mail-pj1-x1033.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:283047 Archived-At: --Apple-Mail=_2C25D225-8AF5-4373-AB6F-D4B07C6DDD9F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Dec 23, 2021, at 1:24 PM, Tomas Hlavaty wrote: >=20 > On Thu 23 Dec 2021 at 13:00, Yuan Fu wrote: >>> On Dec 23, 2021, at 12:56 PM, Tomas Hlavaty wrote: >>> On Thu 23 Dec 2021 at 12:51, Yuan Fu wrote: >>>> I=E2=80=99ve tried that. Info files are not complex, but they = can=E2=80=99t be >>>> reliably parsed 100% of the time. My code works for like 95% of the >>>> nodes, but there are always some corner cases where it breaks. >>>=20 >>> Why doesn't texinfo html output suffer from this problem? >>=20 >> HTML are structured, where as Info is more like plain text. Just to >> give an example, in an info file, four spaces indent text could be a >> code block, or just an indented paragraph, there is no way telling >> them apart. In HTML, code is wrapped in (or maybe
),
>> paragraphs are wrapped in 

. >=20 > Sorry for not being clearer. > The question is not about the difference between info and html. >=20 > The question is: why does your info to html conversion attempt work in > 95% cases but textinfos info to html conversion work in 100% cases? So I guess your question is about the difference between info and = texinfo? Texinfo is also structured, makeinfo can parse a texinfo file = (you probably already know that). Info files are, as I said, not = structured and can=E2=80=99t be reliably parsed to code blocks, = paragraphs, function definitions, etc. Hence my code only works 95% of = the time. Also I=E2=80=99m not converting info files to html files, = I=E2=80=99m just parsing info files and trying to fontify it. Here is = the code, maybe that can explain better than my words. (I know it=E2=80=99= s name conflicts with another well-know package, it=E2=80=99s only used = by myself and not published.) --Apple-Mail=_2C25D225-8AF5-4373-AB6F-D4B07C6DDD9F Content-Disposition: attachment; filename=info+.el Content-Type: application/octet-stream; x-unix-mode=0644; name="info+.el" Content-Transfer-Encoding: quoted-printable ;;;=20info+.el=20---=20Prettier=20Info=20=20=20=20=20=20-*-=20= lexical-binding:=20t;=20-*-=0A=0A;;=20Author:=20Yuan=20Fu=20= =0A=0A;;;=20This=20file=20is=20NOT=20part=20of=20GNU=20= Emacs=0A=0A;;;=20Commentary:=0A;;=0A;;=20Enable=20by=20M-x=20= Info-pretty-mode.=20This=20mode=20prettifies=20Info=20buffers=0A;;=20by=20= using=20word=20wrap=20and=20variable=20pitch=20font,=20among=20other=20= things.=0A;;=20Since=20we=20use=20a=20very=20ad-hoc=20=E2=80=9Cparser=E2=80= =9D=20to=20parse=20the=20buffer=20content.=0A;;=20There=20are=20= breakages=20where=20some=20part=20of=20the=20text=20are=20rendered=0A;;=20= incorrectly.=20You=20have=20to=20live=20with=20it.=0A=0A;;;=20Scratch=0A= ;;=0A=0A(when=20nil=0A=20=20(let=20((reg=20(Info--next-block)))=0A=20=20=20= =20(Info--block-type=20(car=20reg)=20(cdr=20reg)))=0A=0A=20=20(defun=20= highlight-region=20(reg)=0A=20=20=20=20(set-mark=20(car=20reg))=0A=20=20=20= =20(goto-char=20(cdr=20reg))=0A=20=20=20=20(transient-mark-mode))=0A=0A=20= =20(highlight-region=20(Info--next-block))=0A=20=20)=0A;;;=20Code:=0A;;=0A= =0A(require=20'cl-lib)=0A(require=20'pcase)=0A=0A;;=20Block=20types:=0A= ;;=20|=20Body=20indent1=20indent2=0A;;=20|=20BulletBody=20indent1=20= indent2=0A;;=20|=20DetailList=20indent1=20indent2=0A;;=20|=20MenuHeader=0A= ;;=20|=20MenuEntry=20align=0A;;=20|=20Definition=20indent=0A;;=20|=20= Code=0A=0A(defface=20info-body=20`((t=20.=20(:inherit=20(variable-pitch=20= default)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:height=201.2)))=0A=20=20= "Face=20for=20body=20text=20in=20Info=20buffer."=0A=20=20:group=20'info)=0A= =0A(defface=20info-inline-code=20`((t=20.=20(:inherit=20widget-field)))=0A= =20=20"Face=20for=20inline=20code=20in=20Info=20buffer."=0A=20=20:group=20= 'info)=0A=0A(defun=20Info--next-block=20()=0A=20=20"Return=20(BEG=20.=20= END)=20of=20next=20text=20block=20after=20point.=0AMove=20point=20to=20= BEG.=0AIf=20search=20failed,=20return=20nil."=0A=20=20(condition-case=20= nil=0A=20=20=20=20=20=20(let=20(beg=20end)=0A=20=20=20=20=20=20=20=20;;=20= Non-empty=20line=0A=20=20=20=20=20=20=20=20(re-search-forward=20= "^[^\n]+$")=0A=20=20=20=20=20=20=20=20(setq=20beg=20(match-beginning=20= 0))=0A=20=20=20=20=20=20=20=20(if=20(re-search-forward=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20(rx=20(or=20"\n\n"=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(seq=20"\n"=20(*=20"=20")=20digit=20"."=20= (+=20"=20"))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(seq=20"\n*=20")=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(seq=20"\n"=20(*=20"=20")=20"=E2=80=A2")))=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20nil=20t)=0A=20=20=20=20=20=20=20=20=20=20=20=20= (setq=20end=20(match-beginning=200))=0A=20=20=20=20=20=20=20=20=20=20= (setq=20end=20(point-max)))=0A=20=20=20=20=20=20=20=20(cons=20beg=20= end))=0A=20=20=20=20(search-failed=20nil)))=0A=0A(defsubst=20= Info--menu-entry-detail-beg=20(limit)=0A=20=20"Go=20to=20the=20beginning=20= of=20the=20entry=20detail=20before=20LIMIT.=0AAssumes=20the=20point=20is=20= at=20BOL.=0AReturn=20nil=20if=20not=20found"=0A=20=20(re-search-forward=0A= =20=20=20(rx=20(seq=20"*"=20"=20"=20(+=20(not=20(any=20"\n")))=20(group=20= (>=3D=202=20"=20"))))=0A=20=20=20limit=20t))=0A=0A(defun=20= Info--block-type=20(beg=20end)=0A=20=20"Return=20the=20type=20of=20the=20= block=20between=20BEG=20and=20END.=0AMoves=20point."=0A=20=20;;=20=20=20=20= =20=20=20Code=20block=0A=20=20(cl-labels=20((indent=20()=20(-=20(point)=20= (line-beginning-position)))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (visual-indent=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20()=20(car=20= (window-text-pixel-size=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20nil=20(line-beginning-position)=20(point)))))=0A=20= =20=20=20(cond=20((progn=20(goto-char=20beg)=0A=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(looking-at=20"*=20Menu:"))=0A=20=20=20=20=20=20= =20=20=20=20=20'(MenuHeader))=0A=20=20=20=20=20=20=20=20=20=20;;=20Menu=20= (header=20or=20entry)=0A=20=20=20=20=20=20=20=20=20=20((progn=20= (goto-char=20beg)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (looking-at=20"\\*"))=0A=20=20=20=20=20=20=20=20=20=20=20(if=20= (Info--menu-entry-detail-beg=20(line-end-position))=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20`(MenuEntry=20,(visual-indent))=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20'(MenuEntry=200)))=0A=20=20=20=20=20=20=20=20=20=20= ;;=20Definition=0A=20=20=20=20=20=20=20=20=20=20((progn=20(goto-char=20= beg)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(looking-at=20= (rx=20(seq=20"=20--=20"=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(or=20= "Function"=20"Variable"=20"Macro"=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20"Special=20Form"=20"Command"=0A=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20"User=20Option")=0A=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20":=20"))))=0A=20=20=20=20=20=20=20=20=20=20=20= (re-search-forward=20"\n=20+")=0A=20=20=20=20=20=20=20=20=20=20=20= `(Definition=20,(indent)))=0A=20=20=20=20=20=20=20=20=20=20;;=20Body=0A=20= =20=20=20=20=20=20=20=20=20((let=20((case-fold-search=20nil))=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20(goto-char=20beg)=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20(skip-chars-forward=20"=20")=0A=20=20=20=20=20=20=20=20=20= =20=20=20=20(and=20(or=20(looking-at=20"[0-9]\\.")=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(looking-at=20"=E2=80=A2")=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (looking-at=20"[[:upper:]]")=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(looking-at=20(rx=20(or=20?=E2=80=98=20?=E2=80=9C=20= (seq=20?\(=20upper))))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(looking-at=20(rx=20(seq=20"("=20(or=20digit=20letter)=20= ")"))))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20No=20= weird=20spaces.=20=20Rules=20out=20table=20headers.=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(not=20(re-search-forward=20(rx=20(>=3D=20= 3=20"=20"))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (line-end-position)=20t))))=0A=20=20=20=20=20=20=20=20=20=20=20= (goto-char=20beg)=0A=20=20=20=20=20=20=20=20=20=20=20(let=20(indent1=20= indent2)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20(skip-chars-forward=20= "=20")=0A=20=20=20=20=20=20=20=20=20=20=20=20=20(setq=20indent1=20= (indent))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20(when=20= (re-search-forward=20"\n"=20end=20t)=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20(skip-chars-forward=20"=20")=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(setq=20indent2=20(indent)))=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20(cond=20((and=20indent2=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(progn=20(goto-char=20beg)=0A=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(looking-at=20"=20+=E2=80=A2")))=0A=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20`(BulletBody=20,indent1=20,(+=202=20= indent1)))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20= List=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20((let=20= ((case-fold-search=20nil))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(goto-char=20beg)=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(looking-at=20(rx=20(seq=20(*=20"=20")=0A= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(or=20digit=20= upper)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20".=20= "))))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= `(BulletBody=20,indent1=20,(+=203=20indent1)))=0A=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20;;=20Detail=20list=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20((and=20indent2=20(<=20indent1=20= indent2))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= `(DetailList=20,indent1=20,indent2))=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20;;=20Body=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(t=20(if=20indent2=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20`(Body=20,indent1=20,(indent))=0A=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= `(Body=20,indent1=200))))))=0A=20=20=20=20=20=20=20=20=20=20(t=20= (goto-char=20beg)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= (skip-chars-forward=20"=20")=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= `(Code)))))=0A=0A(defun=20Info--remove-indent=20()=0A=20=20"Remove=20the=20= spaces=20at=20the=20beginning=20of=20this=20line."=0A=20=20(goto-char=20= (line-beginning-position))=0A=20=20(skip-chars-forward=20"=20")=0A=20=20= ;;=20(delete-region=20(line-beginning-position)=20(point))=0A=20=20= (put-text-property=20(line-beginning-position)=20(point)=20'display=20= ""))=0A=0A(defun=20Info--remove-line-breaks=20(beg=20end)=0A=20=20= "Remove=20hard=20line=20breaks=20between=20BEG=20and=20END.=0AMoves=20= point."=0A=20=20(goto-char=20end)=0A=20=20(let=20((end-mark=20= (point-marker)))=0A=20=20=20=20(goto-char=20beg)=0A=20=20=20=20= (skip-chars-forward=20"=20")=0A=20=20=20=20;;=20(delete-region=20beg=20= (point))=0A=20=20=20=20(put-text-property=20beg=20(point)=20'display=20= "")=0A=20=20=20=20(while=20(and=20(<=20(point)=20end-mark)=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20(search-forward=20"\n"=20end-mark=20= t))=0A=20=20=20=20=20=20(let=20((p=20(match-beginning=200)))=0A=20=20=20=20= =20=20=20=20(skip-chars-forward=20"=20")=0A=20=20=20=20=20=20=20=20;;=20= (delete-region=20p=20(point))=0A=20=20=20=20=20=20=20=20;;=20(insert=20"=20= ")=0A=20=20=20=20=20=20=20=20(when=20(<=20(point)=20end-mark)=0A=20=20=20= =20=20=20=20=20=20=20(put-text-property=20p=20(point)=20'display=20"=20= "))))))=0A=0A(defun=20Info--unfontify-quote=20(beg=20end)=0A=20=20= "Remove=20info-body=20face=20from=20quoted=20text=20between=20BEG=20and=20= END."=0A=20=20(goto-char=20beg)=0A=20=20(while=20(re-search-forward=0A=20= =20=20=20=20=20=20=20=20=20(rx=20(or=20(seq=20"`"=20(+?=20anychar)=20= "'")=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(seq=20= "=E2=80=98"=20(+?=20anychar)=20"=E2=80=99")=0A=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(seq=20(not=20(any=20"doesn"=20"don"=20"didn"=20= "can"))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(group=20"'"=20(+?=20(not=20(any=20"\n")))=20"'"))))=0A=20=20=20=20= =20=20=20=20=20=20end=20t)=0A=20=20=20=20;;=20Only=20unfontify=20inline=20= quote.=0A=20=20=20=20(when=20(plist-get=20(text-properties-at=20= (match-beginning=200))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20'font-lock-face)=0A=20=20=20=20=20=20(put-text-property=20= (or=20(match-beginning=201)=20(match-beginning=200))=0A=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(or=20= (match-end=201)=20(match-end=200))=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20'font-lock-face=20= 'info-inline-code))))=0A=0A(defun=20Info--fontify-block=20(beg=20end=20= type)=0A=20=20"Fontify=20block=20between=20BEG=20and=20END=20of=20TYPE.=0A= Moves=20point."=0A=20=20(goto-char=20beg)=0A=20=20(pcase=20type=0A=20=20=20= =20(`(Body=20,indent1=20,indent2)=0A=20=20=20=20=20(put-text-property=20= beg=20end=20'font-lock-face=20'info-body)=0A=20=20=20=20=20(when=20(not=20= (eq=20indent1=200))=0A=20=20=20=20=20=20=20(put-text-property=20beg=20= end=20'line-prefix=20`(space=20:width=20,indent1)))=0A=20=20=20=20=20;;=20= We=20make=20the=20whole=20block=20indent=20the=20same,=20ignoring=20= indent2.=0A=20=20=20=20=20(ignore=20indent2)=0A=20=20=20=20=20= (put-text-property=20beg=20end=20'wrap-prefix=20`(space=20:width=20= ,indent1))=0A=20=20=20=20=20;;=20We=20want=20to=20include=20the=20final=20= new=20line=20for=20line-height=20to=20take=0A=20=20=20=20=20;;=20effect.=0A= =20=20=20=20=20(put-text-property=20beg=20(1+=20end)=20'line-spacing=20= 0.3)=0A=20=20=20=20=20;;=20This=20function=20messes=20positions=20up,=20= has=20to=20run=20at=20the=20end.=0A=20=20=20=20=20= (Info--remove-line-breaks=20beg=20end))=0A=0A=20=20=20=20(`(BulletBody=20= ,indent1=20,indent2)=0A=20=20=20=20=20(let=20((case-fold-search=20nil))=0A= =20=20=20=20=20=20=20(re-search-forward=20(rx=20(seq=20(*=20"=20")=0A=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(or=20"=E2=80=A2"=0A=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20(seq=20digit=20".=20")=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(seq=20upper=20".=20"))))))=0A=20=20=20=20=20;;=20We=20want=20to=20= keep=20the=20bullet=20in=20default=20font.=0A=20=20=20=20=20= (put-text-property=20(point)=20end=20'font-lock-face=20'info-body)=0A=20=20= =20=20=20(when=20(not=20(eq=20indent1=200))=0A=20=20=20=20=20=20=20= (put-text-property=20beg=20end=20'line-prefix=20`(space=20:width=20= ,indent1)))=0A=20=20=20=20=20;;=20We=20add=202=20to=20indent1=20to=20= align=20rest=20body=20with=20the=20bullet.=0A=20=20=20=20=20= (put-text-property=20beg=20end=20'wrap-prefix=20`(space=20:width=20= ,indent2))=0A=20=20=20=20=20(put-text-property=20beg=20(1+=20end)=20= 'line-spacing=200.3)=0A=20=20=20=20=20(Info--remove-line-breaks=20beg=20= end))=0A=0A=20=20=20=20(`(MenuHeader))=0A=0A=20=20=20=20(`(MenuEntry=20= ,align)=0A=20=20=20=20=20;;=20First,=20align=20first=20line=E2=80=99s=20= detail.=0A=20=20=20=20=20(when=20(Info--menu-entry-detail-beg=20end)=0A=20= =20=20=20=20=20=20;;=20matched=20range=20is=20the=20white=20space=20= between=20subject=20and=20detail.=0A=20=20=20=20=20=20=20;;=20= (put-text-property=0A=20=20=20=20=20=20=20;;=20=20(match-beginning=201)=20= (match-end=201)=0A=20=20=20=20=20=20=20;;=20=20'display=20`(space=20= :align-to=20(,(*=20align=20(window-font-width)))))=0A=20=20=20=20=20=20=20= ;;=20We=20skip=20over=20the=20stars.=20Because=20info-menu-star=20is=20= monospaced=0A=20=20=20=20=20=20=20;;=20and=20we=20want=20to=20keep=20the=20= stars=20consistent.=0A=20=20=20=20=20=20=20(put-text-property=0A=20=20=20= =20=20=20=20=20(match-end=201)=20end=20'font-lock-face=20'info-body)=0A=20= =20=20=20=20=20=20;;=20Add=201=20to=20end=20so=20the=20newline=20can=20= get=20the=20property.=0A=20=20=20=20=20=20=20(put-text-property=20beg=20= (min=20(1+=20end)=20(point-max))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20'line-spacing=200.3)=0A=20=20=20=20= =20=20=20(put-text-property=0A=20=20=20=20=20=20=20=20(match-end=201)=20= (min=20(1+=20end)=20(point-max))=0A=20=20=20=20=20=20=20=20'wrap-prefix=20= `(space=20:align-to=20(,align)))=0A=20=20=20=20=20=20=20= (Info--remove-line-breaks=20(match-end=201)=20end)))=0A=0A=20=20=20=20= (`(DetailList=20,indent1=20,indent2)=0A=20=20=20=20=20= (Info--remove-indent)=0A=20=20=20=20=20(goto-char=20beg)=0A=20=20=20=20=20= (search-forward=20"\n")=0A=20=20=20=20=20(let=20((p=20(point)))=0A=20=20=20= =20=20=20=20(put-text-property=20beg=20(1+=20end)=20'line-spacing=200.3)=0A= =20=20=20=20=20=20=20(put-text-property=20p=20end=20'font-lock-face=20= 'info-body)=0A=20=20=20=20=20=20=20(put-text-property=20p=20end=20= 'line-prefix=20`(space=20:width=20,indent2))=0A=20=20=20=20=20=20=20= (put-text-property=20p=20end=20'wrap-prefix=20`(space=20:width=20= ,indent2))=0A=20=20=20=20=20=20=20(put-text-property=20beg=20(1-=20p)=20= 'line-prefix=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20`(space=20:width=20,indent1))=0A=20=20=20=20=20=20=20= (Info--remove-line-breaks=20p=20end)))=0A=0A=20=20=20=20(`(Definition=20= ,indent)=0A=20=20=20=20=20(re-search-forward=20"\n=20+")=0A=20=20=20=20=20= (let=20((p=20(point)))=0A=20=20=20=20=20=20=20(put-text-property=20beg=20= (1+=20end)=20'line-spacing=200.3)=0A=20=20=20=20=20=20=20= (put-text-property=20p=20end=20'font-lock-face=20'info-body)=0A=20=20=20=20= =20=20=20(put-text-property=20p=20end=20'line-prefix=20`(space=20:width=20= ,indent))=0A=20=20=20=20=20=20=20(put-text-property=20p=20end=20= 'wrap-prefix=20`(space=20:width=20,indent))=0A=20=20=20=20=20=20=20= (Info--remove-line-breaks=20p=20end)))=0A=20=20=20=20(`(Code=20,indent)=20= (ignore=20indent))))=0A=0A(defun=20Info--prettify-buffer=20()=0A=20=20= "Prettify=20Info=20buffer."=0A=20=20(interactive)=0A=20=20= (save-excursion=0A=20=20=20=20(let=20((buffer-read-only=20nil))=0A=20=20=20= =20=20=20(goto-char=20(point-min))=0A=20=20=20=20=20=20= (re-search-forward=20"[=3D-\\*]$")=0A=20=20=20=20=20=20(let=20(region)=0A= =20=20=20=20=20=20=20=20(while=20(setq=20region=20(Info--next-block))=0A=20= =20=20=20=20=20=20=20=20=20(let=20((beg=20(car=20region))=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(end=20(cdr=20region))=0A=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20end-mark)=0A=20=20=20=20=20=20=20=20=20=20= =20=20(setq=20end-mark=20(make-marker))=0A=20=20=20=20=20=20=20=20=20=20=20= =20(set-marker=20end-mark=20end)=0A=20=20=20=20=20=20=20=20=20=20=20=20= (condition-case=20nil=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (progn=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (Info--fontify-block=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20beg=20end=20(Info--block-type=20beg=20end))=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(Info--unfontify-quote=20beg=20= end-mark))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20((debug=20= search-failed)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(message=20= "Failed=20to=20fontify=20block=20%d=20%d"=20beg=20end)))=0A=20=20=20=20=20= =20=20=20=20=20=20=20(goto-char=20end-mark))))=0A=20=20=20=20=20=20= (Info-fontify-node)=0A=20=20=20=20=20=20(visual-line-mode)=0A=20=20=20=20= =20=20(face-remap-add-relative=20'link=20'(:inherit=20info-body)))))=0A=0A= (define-minor-mode=20info-pretty-mode=0A=20=20"Prettified=20Info."=0A=20=20= :global=20t=0A=20=20:lighter=20""=0A=20=20(if=20info-pretty-mode=0A=20=20= =20=20=20=20(add-hook=20'Info-selection-hook=20#'Info--prettify-buffer)=0A= =20=20=20=20(remove-hook=20'Info-selection-hook=20= #'Info--prettify-buffer))=0A=20=20(when=20(derived-mode-p=20'Info-mode)=0A= =20=20=20=20(revert-buffer=20nil=20t)))=0A=0A=0A=0A(provide=20'info+)=0A=0A= ;;;=20info+.el=20ends=20here=0A= --Apple-Mail=_2C25D225-8AF5-4373-AB6F-D4B07C6DDD9F Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Yuan --Apple-Mail=_2C25D225-8AF5-4373-AB6F-D4B07C6DDD9F--