From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: scame Newsgroups: gmane.emacs.devel Subject: RE: [External] : Re: Indentation conventions for Info manuals; recognizing code Date: Fri, 26 Mar 2021 05:12:18 +0000 Message-ID: References: Reply-To: scame Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25590"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "emacs-devel@gnu.org" To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 26 06:13:12 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 1lPemW-0006aU-M8 for ged-emacs-devel@m.gmane-mx.org; Fri, 26 Mar 2021 06:13:12 +0100 Original-Received: from localhost ([::1]:38922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lPemV-0005md-Km for ged-emacs-devel@m.gmane-mx.org; Fri, 26 Mar 2021 01:13:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPeln-0005Ku-0z for emacs-devel@gnu.org; Fri, 26 Mar 2021 01:12:27 -0400 Original-Received: from mail-40140.protonmail.ch ([185.70.40.140]:17824) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lPelk-0008WV-JK for emacs-devel@gnu.org; Fri, 26 Mar 2021 01:12:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1616735540; bh=AIOzyX7Ka9gj1+A08ozKMZNTjpzJmTqS6w9IkCs2YZE=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=w47zRHDsYswebpQn25CT39TIYCkxq3Og1enUohmMJJLMSaYuEvaVn7864Gys1gEr1 D4heW7v04RD9N/oNZI0Ranvchgg3sP1pnwoo71sGKDcAVSq+BcHMOLZ4FNx/odIGWd 56NlmdQXavjtXyhO7ZXEdhLgSx1A7SK+miwFXj64= In-Reply-To: Received-SPF: pass client-ip=185.70.40.140; envelope-from=laszlomail@protonmail.com; helo=mail-40140.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:267057 Archived-At: On Monday, March 8, 2021 4:33 PM, Drew Adams wrote: > > > So if some kind of "code" marker would be retained > > > in the Info output, it would need to be implemented in the 2 or 3 > > > other Info readers out there, not just in Emacs. > > > > makeinfo could have a new option to add separators for the generated > > code examples, something like: > > --- example begin > > .... > > --- example end > > This is just text, so others info readers could display it as is, > > while emacs could use the separators to recognize code sections. > > Yes, just the kind of thing I was suggesting > (hoping for). > It occurred to me makeinfo doesn't need a new option at all if a preprocessing step is added to info generation. For example this text from the current info: @smallexample ;; Avoid this pattern. (let ((beg ...) (end ...) (my-completions (my-make-completions))) (list beg end my-completions)) ;; Use this instead. (let ((beg ...) (end ...)) (list beg end (completion-table-dynamic (lambda (_) (my-make-completions))))) @end smallexample could be converted automatically by an emacs build script before info generation to: --- example begin ----------------------- @smallexample ;; Avoid this pattern. (let ((beg ...) (end ...) (my-completions (my-make-completions))) (list beg end my-completions)) ;; Use this instead. (let ((beg ...) (end ...)) (list beg end (completion-table-dynamic (lambda (_) (my-make-completions))))) @end smallexample --- example end ----------------------- so that makeinfo converts the example as usual and leave the added section markers in place for the final output, so that emacs can use it to detect example sections to font lock them and hide the markers. And other info readers can simply display the text as is, showing the added section separators around the example.