unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jonas Bernoulli <jonas@bernoul.li>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: Regarding outline headings in emacs-lisp libraries
Date: Sun, 26 Jul 2020 17:32:14 +0200	[thread overview]
Message-ID: <87ft9el2bl.fsf@bernoul.li> (raw)
In-Reply-To: <jwvlfj6l4up.fsf-monnier+emacs@gnu.org>

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Personally I would also recommend that people use a "back matter"
>> section similar to the "front matter" section that is ";;; Code:", but
>> I fear my preferred heading for that, ";;; _", might not find too many
>> fans.  But then again, I might be wrong, what do you think about ending
>> with this instead:
>
> Indeed, I don't much like `;;; _` simply because it is non-descriptive.
>
> Could we try and find a good name for those sections?
> What do you put in those things (other than file-local vars)?

There's actually two sections that we might want to find better names
for.  Let's use "front matter" and "back matter" as working titles at
least.

- Currently we use "Code:" as the name of that "front matter" section.

  It usually contains a bunch of `require' forms and maybe some function
  and variable declaration when we want to avoid loading the respective
  libraries up front.

  We could therefore name it "Dependencies".  But that does not always
  match the content perfectly.  This section may also contain other
  things that "have to happen early on" and/or "don't fit anywhere
  else".  For example the definition of `PACKAGE-version' or internal
  variables and macros that are used early on.

  Sticking to "Code:" has the advantage that we can justify that by
  "that's what it used to be called and since we cannot think of
  anything better we might as well stick to it.  Of course if we
  actually could think of something better...

- We currently don't put the `provide' form, the local variable
  definitions and other "stuff that goes at the end" into a dedicated
  "back matter" section.  Instead we put these things at the end
  whatever other completely unrelated section happens to come last in
  the file.

  In my own libraries I name that section "_" and (beside the things
  just mentioned that have to go there because they have to be placed
  near the end of the file) I also use it for "administrative things",
  like adding functions to third-party hooks, test definitions,
  font-lock keyword definitions for forms defined across the file.

  Some of these things may define separate sections or in same cases
  they should be placed elsewhere further up in the file along-side
  related stuff.  But sometimes/often that doesn't work / is overkill
  and it is nice to have a "All the crap that remains" section, that
  has a non-descriptive name such as "_".

  I tend to think of the non-descriptiveness as a feature.

The best I can come up right now is "Front matter" and "Back matter".
Or else "Code:" and "_" as suggested before.  But hopefully someone else
can think of something better.

     Jonas



  reply	other threads:[~2020-07-26 15:32 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17 21:48 Regarding outline headings in emacs-lisp libraries Jonas Bernoulli
2020-07-17 22:27 ` Stefan Monnier
2020-07-18  1:41 ` T.V Raman
2020-07-18  3:22   ` Stefan Monnier
2020-07-18 14:16     ` T.V Raman
2020-07-18 16:12       ` Stefan Monnier
2020-07-18 16:49         ` T.V Raman
2020-07-18 22:54           ` Jonas Bernoulli
2020-07-18  3:29 ` Stefan Monnier
2020-07-18 16:15   ` Drew Adams
2020-07-18 22:46     ` Jonas Bernoulli
2020-07-18 23:56       ` Drew Adams
2020-07-19  9:03         ` Jonas Bernoulli
2020-07-19 15:36           ` Drew Adams
2020-07-18 23:26   ` Jonas Bernoulli
2020-07-19  3:36     ` Stefan Monnier
2020-07-19 14:54     ` Eli Zaretskii
2020-07-26 13:49     ` Jonas Bernoulli
2020-07-26 14:11       ` Eli Zaretskii
2020-07-26 15:43         ` Jonas Bernoulli
2020-07-26 16:23           ` Eli Zaretskii
2020-07-26 18:25             ` Jonas Bernoulli
2020-07-26 14:40       ` Stefan Monnier
2020-07-26 15:32         ` Jonas Bernoulli [this message]
2020-07-26 17:00           ` Yuan Fu
2020-07-26 18:23           ` Stefan Monnier
2020-07-26 18:59             ` Eli Zaretskii
2020-07-26 19:45               ` Stefan Monnier
2020-07-28 13:41                 ` Jonas Bernoulli
2020-07-28 14:30                   ` Eli Zaretskii
2020-07-28 14:42                     ` Jonas Bernoulli
2020-07-28 15:52                       ` Eli Zaretskii
2020-07-28 14:48                   ` Stefan Monnier
2020-07-26 21:11             ` Jonas Bernoulli
2020-07-26 18:34           ` Jonas Bernoulli
2020-07-26 18:55       ` [SPAM UNSURE] " Stephen Leake
2020-07-18  6:40 ` Eli Zaretskii
2020-07-28 19:18 ` Jonas Bernoulli
2020-07-29 14:34   ` Eli Zaretskii
2020-07-29 18:34     ` Jonas Bernoulli
2020-07-29 18:56       ` Eli Zaretskii
2020-08-01  2:53   ` Richard Stallman
2020-08-01  5:48     ` Eli Zaretskii
2020-08-01 21:13       ` Jonas Bernoulli
2020-08-01 23:10         ` T.V Raman
2020-08-02  1:01           ` Drew Adams
2020-08-02 16:15         ` Eli Zaretskii
2020-08-03  3:22           ` Stefan Monnier
2020-08-03 14:24             ` Eli Zaretskii
2020-08-03 14:36               ` Stefan Monnier
2020-08-08 18:13               ` Jonas Bernoulli
2020-08-08 21:59                 ` Stefan Monnier
2020-08-09  8:37                   ` Jonas Bernoulli
2020-08-03  3:16         ` Richard Stallman
2020-08-02  2:26       ` Richard Stallman
2020-08-08 12:02         ` Jonas Bernoulli
2020-08-08 18:37   ` Jonas Bernoulli
2020-08-08 18:58     ` Eli Zaretskii
2020-08-09  8:35       ` Jonas Bernoulli
2020-08-12 16:53   ` Thorsten Jolitz

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=87ft9el2bl.fsf@bernoul.li \
    --to=jonas@bernoul.li \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).