help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Naming conventions for defining macros


From: Philipp Stephani
Subject: Re: Naming conventions for defining macros
Date: Sun, 21 Jun 2015 19:47:19 +0000

Barry Margolin <barmar@alum.mit.edu> schrieb am Di., 24. Feb. 2015 um
16:45 Uhr:

> In article <mailman.727.1424760332.31049.help-gnu-emacs@gnu.org>,
>  Philipp Stephani <p.stephani2@gmail.com> wrote:
>
> > Hi,
> >
> > the manual page about coding conventions says: "Constructs that define a
> > function or variable should be macros, not functions, and their names
> > should start with `define-'." This recommendation is at odds with the
> usual
> > recommendation to prefix all non-local names with the package name and
> > doesn't seem to be widely followed by either Emacs (e.g. ert-deftest,
> > cl-defstruct) or popular third-party packages (e.g.
> magit-define-command).
> > Should we get rid of this recommendation? It amounts to special-casing a
> > certain class of names without much benefit.
>
> I think you're expected to combine the conventions, hence
> magit-define-command. It obeys the recommendation to use the package
> name prefix, then the define- prefix.
>
>
Instead of trying to formalize this convention, would it do much harm to
get rid of the 'define-' convention altogether? AFAIK there's no other kind
of function with a conventional midfix; the other conventions are either
suffixes (e.g. '-hook') or prefixes (the package name).


reply via email to

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