unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: "Rüdiger Sonderfeld" <ruediger@c-plusplus.de>, emacs-devel@gnu.org
Subject: About `<prefix>--' (was Re: filenotify.el)
Date: Wed, 26 Jun 2013 09:50:08 +0200	[thread overview]
Message-ID: <878v1x71lb.fsf_-_@rosalinde.fritz.box> (raw)
In-Reply-To: <8761x12x4k.fsf@gmx.de> (Michael Albinus's message of "Wed, 26 Jun 2013 08:40:11 +0200")

On Wed, 26 Jun 2013 08:40:11 +0200 Michael Albinus <michael.albinus@gmx.de> wrote:

> Rüdiger Sonderfeld <ruediger@c-plusplus.de> writes:
>
>> One minor nitpick I forgot:  You should use two hyphens for functions which 
>> are not meant to be used by the user.
>
> Ahh. This is a rather new coding style in Emacs; it didn't even find
> its way into the Lisp Refefence Manual yet :-)

Actually, it did, but just barely, in (elisp)Coding Conventions:

     Separate the prefix from the rest of the name with a hyphen, `-'.
     Use two hyphens if the symbol is not meant to be used by other
     packages.  This practice helps avoid name conflicts, since all
     global variables in Emacs Lisp share the same name space, and all
     functions share another name space

I have two problems with this.  First, the "Use two hyphens" sentence
shouldn't come between the other two, since "This practice" in the
following sentence only refers to using the prefix, not two hyphens.
Second, "not meant to be used by other packages" is too vague for me to
feel confident about how to apply it.  For example, in the new version
of todo-mode.el I recently committed to the trunk, there aren't really
any symbols, including those naming commands and user options, meant to
be used by other packages, since it's not a general purpose library.  On
the other hand, it does contain some internal functions and variables of
a rather general character, needed to implement parts of the UI, which I
included because Emacs doesn't have them (e.g. a powerset function), and
these certainly could be used by other packages, but more likely they
would be reimplemented using the package prefix.  So it's not clear to
me where the dividing line is.  It could be taken to be everything
except commands and user options, as Rüdiger seems to imply (unless he
meant "the user" is a package, not a human).  But it's clearly not been
used so restrictively in Emacs to date (indeed, mpc.el even contains a
command `mpc--faster').  So I would find it helpful if there were more
specific guidelines about how to apply this convention.

Steve Berman



  reply	other threads:[~2013-06-26  7:50 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-25 12:02 filenotify.el Michael Albinus
2013-06-25 16:25 ` filenotify.el Rüdiger Sonderfeld
2013-06-25 19:00   ` filenotify.el Michael Albinus
2013-06-25 19:20     ` filenotify.el Eli Zaretskii
2013-06-25 19:27       ` filenotify.el Michael Albinus
2013-06-25 20:14         ` filenotify.el Eli Zaretskii
2013-06-26  6:06           ` filenotify.el Michael Albinus
2013-06-26  0:11     ` filenotify.el Stefan Monnier
2013-06-26  6:21       ` filenotify.el Michael Albinus
2013-06-26 13:04         ` filenotify.el Stefan Monnier
2013-06-26 14:15           ` filenotify.el Michael Albinus
2013-06-26 14:28             ` filenotify.el Stefan Monnier
2013-06-26 14:37               ` filenotify.el Michael Albinus
2013-06-26 15:57               ` filenotify.el Eli Zaretskii
2013-06-26 19:59                 ` filenotify.el Stefan Monnier
2013-06-26 20:28                   ` filenotify.el Michael Albinus
2013-06-26  0:45     ` filenotify.el Rüdiger Sonderfeld
2013-06-26  6:40       ` filenotify.el Michael Albinus
2013-06-26  7:50         ` Stephen Berman [this message]
2013-06-26 13:06           ` About `<prefix>--' (was Re: filenotify.el) Stefan Monnier
2013-06-26 22:36             ` Stephen Berman
2013-06-27  1:39               ` Stefan Monnier
2013-06-27 23:19           ` Josh
2013-06-28  3:00             ` Xue Fuqiao
2013-06-28 22:54               ` Stefan Monnier
2013-06-28 23:50                 ` Xue Fuqiao
2013-06-29  2:06                   ` Stefan Monnier
2013-06-28 21:59             ` Richard Stallman
2013-06-30 18:50               ` Josh
2013-06-27 12:18 ` filenotify.el (2) Michael Albinus
2013-07-04  9:54   ` Michael Albinus
2013-07-17 13:52 ` filenotify.el Rüdiger Sonderfeld
2013-07-17 14:54   ` filenotify.el Michael Albinus
2013-07-17 16:21     ` filenotify.el Rüdiger Sonderfeld
2013-07-18 10:10       ` filenotify.el Michael Albinus
2013-07-22 18:17     ` filenotify.el Davis Herring
2013-07-22 18:28       ` filenotify.el Michael Albinus
2013-07-22 19:00         ` filenotify.el Stefan Monnier
2013-07-23  6:57           ` filenotify.el Michael Albinus
2013-07-23 13:08             ` filenotify.el Stefan Monnier
2013-07-23 13:34               ` filenotify.el Michael Albinus
2013-07-23 13:57                 ` filenotify.el Stefan Monnier
2013-07-23 14:13                   ` filenotify.el Michael Albinus
2013-07-23 14:23                     ` filenotify.el Stefan Monnier
2013-07-23 15:31                       ` filenotify.el Davis Herring
2013-07-24  9:14                         ` filenotify.el Michael Albinus
2013-08-02  7:10                         ` filenotify.el Michael Albinus
2013-07-24 14:01                       ` filenotify.el Michael Albinus
2013-07-23 16:10                 ` filenotify.el Glenn Morris
2013-07-23 16:58                   ` filenotify.el Michael Albinus

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=878v1x71lb.fsf_-_@rosalinde.fritz.box \
    --to=stephen.berman@gmx.net \
    --cc=emacs-devel@gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=ruediger@c-plusplus.de \
    /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).