emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [External] : Re: Indentation conventions for Info manuals; recognizi


From: scame
Subject: RE: [External] : Re: Indentation conventions for Info manuals; recognizing code
Date: Fri, 26 Mar 2021 05:12:18 +0000

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 via email to

[Prev in Thread] Current Thread [Next in Thread]