unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: scame <laszlomail@protonmail.com>
To: Drew Adams <drew.adams@oracle.com>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: RE: [External] : Re: Indentation conventions for Info manuals; recognizing code
Date: Fri, 26 Mar 2021 05:12:18 +0000	[thread overview]
Message-ID: <dS_H8gyt4kppHAvAfOKyL2GSLoQyVpbkusrNElEbNLBtIAZgK1FDEAZNJGHvKpMIxHvDfSNvasPqenvnEa556Rkr02U-CHZzc4fomjZ8CCk=@protonmail.com> (raw)
In-Reply-To: <SA2PR10MB44748F85C99174F36C426ACFF3939@SA2PR10MB4474.namprd10.prod.outlook.com>

On Monday, March 8, 2021 4:33 PM, Drew Adams <drew.adams@oracle.com> 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.



  reply	other threads:[~2021-03-26  5:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-08  9:51 Indentation conventions for Info manuals; recognizing code tydrdn
2021-03-08 15:33 ` [External] : " Drew Adams
2021-03-26  5:12   ` scame [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-03-07  1:58 Drew Adams
2021-03-07  6:33 ` Eli Zaretskii
2021-03-08  3:47   ` [External] : " Drew Adams
2021-03-08  5:49     ` Yuri Khan
2021-03-08 14:07       ` Eli Zaretskii
2021-03-08 15:33       ` Drew Adams
2021-03-08  5:37 ` Richard Stallman
2021-03-08 15:33   ` [External] : " Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='dS_H8gyt4kppHAvAfOKyL2GSLoQyVpbkusrNElEbNLBtIAZgK1FDEAZNJGHvKpMIxHvDfSNvasPqenvnEa556Rkr02U-CHZzc4fomjZ8CCk=@protonmail.com' \
    --to=laszlomail@protonmail.com \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).