unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: phillip.lord@newcastle.ac.uk (Phillip Lord)
To: <esr@thyrsus.com>
Cc: emacs-devel@gnu.org
Subject: Re: Comment conventions, adding an explicit Header.
Date: Thu, 30 Oct 2014 12:24:33 +0000	[thread overview]
Message-ID: <87mw8dd9tq.fsf@newcastle.ac.uk> (raw)
In-Reply-To: <20141030115949.GB7645@thyrsus.com> (Eric S. Raymond's message of "Thu, 30 Oct 2014 07:59:51 -0400")

"Eric S. Raymond" <esr@thyrsus.com> writes:

> Phillip Lord <phillip.lord@newcastle.ac.uk>:
>> I have written a mode which transforms an Emacs-Lisp file into an
>> org-mode file. So you can view (and edit) your comments in org-mode,
>> while maintaining a normal elisp file (i.e. it doesn't require tangling
>> as an org-mode babel file would). In this process ";;; Commentary:"
>> lines get transformed into Org mode section one headers. This works
>> nicely, but the lack of a ";;; Header:" line, means that the metadata
>> and copyright is outside of the org-mode structure. Adding a ";;;
>> Header:" is a simple way of circumventing this.
>
> I believe I was the person who made the ";;; Commentary" header
> general across the Lisp library, back around '92 or '93. (Possibly I
> generalized it from previous sporadic examples rather than inventing it;
> I don't remember.)
>
> When I did so, I was thinking explicitly of enabling text analysis by
> introducing a structural semantic clue.  I did not anticipate org
> mode, but you are extending the concept in the direction I intended.
>
> +1

Thanks. Org-mode seems like an obvious choice as a literate format; in
fact people are already using it for precisely this purpose. org-show is
a nice example, which uses org mode to do a slide show.

The source code is both an example slide show with org-show.el embedded.

https://raw.githubusercontent.com/jkitchin/jmax/master/org/org-show.org

But I dislike relegating the .el file to being generated, hence my
approach. I think it's working quite well. The transformation between
org and emacs-lisp is straight-forward.

On the emacs-lisp side, adding a "Header:" tag is all I need. On the
org-mode side, I need support for emacs-lisp `function-markup-syntax'
which is currently only highlighted in emacs-lisp-mode. So, in
emacs-lisp we have this...

https://github.com/phillord/linked-buffer/blob/master/linked-buffer-org.el

With the org-mode transformation looking like this:

http://homepages.cs.ncl.ac.uk/phillip.lord/scratch/linked-buffer-org.org

And exported to HTML by org-mode, like this:

http://homepages.cs.ncl.ac.uk/phillip.lord/scratch/linked-buffer-org.html

Still a work in progress, of course, but I am happy so far.

Phil



  reply	other threads:[~2014-10-30 12:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30 10:22 Comment conventions, adding an explicit Header Phillip Lord
2014-10-30 11:59 ` Eric S. Raymond
2014-10-30 12:24   ` Phillip Lord [this message]
2014-10-30 12:33 ` Thorsten Jolitz
2014-10-30 13:43 ` Stefan Monnier
2014-10-30 13:58   ` Phillip Lord
2014-10-30 15:36     ` Stefan Monnier
2014-10-30 16:38       ` Phillip Lord
2014-10-30 17:13         ` Stefan Monnier
2014-10-31 10:02           ` Phillip Lord
2014-10-31 14:07             ` Stefan Monnier
2014-10-31 16:10               ` Phillip Lord
2014-11-01  1:01     ` Stephen J. Turnbull
2014-11-03 10:04       ` Phillip Lord
2014-11-03 11:00         ` Stephen J. Turnbull
2014-11-03 15:22           ` Phillip Lord
2014-10-31 11:50 ` Gregor Zattler
2014-10-31 16:42   ` Phillip Lord

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=87mw8dd9tq.fsf@newcastle.ac.uk \
    --to=phillip.lord@newcastle.ac.uk \
    --cc=emacs-devel@gnu.org \
    --cc=esr@thyrsus.com \
    /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).