unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* library/package filename prefixes
@ 2020-05-01 21:07 Drew Adams
  2020-05-02 18:35 ` Yuan Fu
  2020-05-03  3:39 ` Richard Stallman
  0 siblings, 2 replies; 11+ messages in thread
From: Drew Adams @ 2020-05-01 21:07 UTC (permalink / raw)
  To: Emacs developers

FWIW -

I think the "Emacs Lisp Coding Conventions" node
of the Elisp manual should be amended to say that
a library/package prefix should be at least 2
chars followed by a hyphen (`-').  And even add
that 3 or more is preferable.

https://www.gnu.org/software/emacs/manual/html_node/elisp/Coding-Conventions.html

(Should we also say that the first char should
not be a hyphen, or that not all prefix chars
should be hyphens, or ...?)

I think it's misguided, short-sighted, and even
perhaps a bit self-centered for people to have
named libraries `-.el', `s.el', etc. and used
function and variable names with prefix `-',
`s-', etc.

"Too clever by half" is an expression that comes
to mind.  Cute, but not great for playing in the
communal sandbox.

This opinion takes nothing away from the quality
or worth of such libraries.  It's only the naming
I take issue with.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: library/package filename prefixes
  2020-05-01 21:07 library/package filename prefixes Drew Adams
@ 2020-05-02 18:35 ` Yuan Fu
  2020-05-03  3:39 ` Richard Stallman
  1 sibling, 0 replies; 11+ messages in thread
From: Yuan Fu @ 2020-05-02 18:35 UTC (permalink / raw)
  To: Drew Adams; +Cc: Emacs developers



> On May 1, 2020, at 5:07 PM, Drew Adams <drew.adams@oracle.com> wrote:
> 
> FWIW -
> 
> I think the "Emacs Lisp Coding Conventions" node
> of the Elisp manual should be amended to say that
> a library/package prefix should be at least 2
> chars followed by a hyphen (`-').  And even add
> that 3 or more is preferable.
> 

I agree

> https://www.gnu.org/software/emacs/manual/html_node/elisp/Coding-Conventions.html
> 
> (Should we also say that the first char should
> not be a hyphen, or that not all prefix chars
> should be hyphens, or ...?)
> 
> I think it's misguided, short-sighted, and even
> perhaps a bit self-centered for people to have
> named libraries `-.el', `s.el', etc. and used
> function and variable names with prefix `-',
> `s-', etc.
> 

That might be too strong, but indeed that lacks some consideration.

Yuan




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: library/package filename prefixes
  2020-05-01 21:07 library/package filename prefixes Drew Adams
  2020-05-02 18:35 ` Yuan Fu
@ 2020-05-03  3:39 ` Richard Stallman
  2020-05-03  4:17   ` Stefan Monnier
  1 sibling, 1 reply; 11+ messages in thread
From: Richard Stallman @ 2020-05-03  3:39 UTC (permalink / raw)
  To: Drew Adams; +Cc: emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > I think the "Emacs Lisp Coding Conventions" node
  > of the Elisp manual should be amended to say that
  > a library/package prefix should be at least 2
  > chars followed by a hyphen (`-').  And even add
  > that 3 or more is preferable.

I agree.  Indeed, why not make 3 the minimum for users?
Are there any libraries in Emacs or GNU ELPA
which currently use a 2-letter prefix?

We could ask people to use at least 4 letters for prefixes invented
after today.

We could make special exceptions on rare occasions.

  > "Too clever by half" is an expression that comes
  > to mind.  Cute, but not great for playing in the
  > communal sandbox.

Well put!

-- 
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: library/package filename prefixes
  2020-05-03  3:39 ` Richard Stallman
@ 2020-05-03  4:17   ` Stefan Monnier
  2020-05-04  3:08     ` Richard Stallman
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2020-05-03  4:17 UTC (permalink / raw)
  To: Richard Stallman; +Cc: Drew Adams, emacs-devel

> Are there any libraries in Emacs or GNU ELPA
> which currently use a 2-letter prefix?

    % ls **/??.el ../elpa/**/??.el
    ../elpa/packages/auctex/style/bm.el            lisp/emacs-lisp/rx.el
    ../elpa/packages/auctex/style/dk.el            lisp/emacs-lisp/tq.el
    ../elpa/packages/hydra/lv.el                   lisp/leim/quail/PY.el
    ../elpa/packages/realgud/realgud/common/bp.el  lisp/leim/quail/QJ.el
    ../elpa/packages/realgud/realgud/lang/js.el    lisp/leim/quail/SW.el
    ../elpa/packages/w3/w3.el                      lisp/mail/qp.el
    ../elpa/packages/xr/xr.el                      lisp/obsolete/cl.el
    lisp/bs.el                                     lisp/obsolete/gs.el
    lisp/cedet/semantic/bovine/el.el               lisp/obsolete/vi.el
    lisp/cedet/semantic/db.el                      lisp/org/ob.el
    lisp/cedet/semantic/fw.el                      lisp/org/ol.el
    lisp/cedet/semantic/ia.el                      lisp/org/ox.el
    lisp/cedet/semantic/sb.el                      lisp/progmodes/js.el
    lisp/cedet/srecode/el.el                       lisp/textmodes/po.el
    lisp/emacs-lisp/gv.el                          lisp/vc/vc.el
    lisp/emacs-lisp/pp.el
    %


-- Stefan




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: library/package filename prefixes
  2020-05-03  4:17   ` Stefan Monnier
@ 2020-05-04  3:08     ` Richard Stallman
  2020-05-04 12:13       ` Eric Ludlam
                         ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Richard Stallman @ 2020-05-04  3:08 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: drew.adams, emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > > Are there any libraries in Emacs or GNU ELPA
  > > which currently use a 2-letter prefix?

In your list, some of the files do use a two-letter name prefix,
but others do not.

lisp/cedet/srecode/el.el does not.  Neither does
lisp/cedet/semantic/sb.el.

lisp/emacs-lisp/pp.el does use a two-letter prefix.
Perhaps we should change it.

lisp/emacs-lisp/gv.el uses a two-letter prefix.
I expect that the functions named starting 'gv-' are not used from a lot
of user code, so it should not be hard to rename them.

Does anyone oppose renaming them?

lisp/bs.el does use 'bs-' as a nane prefix.
I have a hunch the entry points are not called very often.
Should we rename that?

It would be easy to rename po.el and its one entry point,
which is called in just one place.

Eli, what do you think about renaming these files
if doing so is painless?

-- 
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: library/package filename prefixes
  2020-05-04  3:08     ` Richard Stallman
@ 2020-05-04 12:13       ` Eric Ludlam
  2020-05-04 14:30       ` Eli Zaretskii
  2020-05-04 16:19       ` Drew Adams
  2 siblings, 0 replies; 11+ messages in thread
From: Eric Ludlam @ 2020-05-04 12:13 UTC (permalink / raw)
  To: rms, Stefan Monnier; +Cc: drew.adams, emacs-devel

On 5/3/20 11:08 PM, Richard Stallman wrote:
> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> 
>    > > Are there any libraries in Emacs or GNU ELPA
>    > > which currently use a 2-letter prefix?
> 
> In your list, some of the files do use a two-letter name prefix,
> but others do not.
> 
> lisp/cedet/srecode/el.el does not.  Neither does
> lisp/cedet/semantic/sb.el.

Hi,

Regarding prefixes, the above 2 files are not on the path.  To require 
them, you would need:

(require 'srecode/el)
(require 'semantic/sb)

and internally, their prefixes are related to the parent package, ie: 
srecode- and semantic-

The files are organized this way because the old file names of some 
neighboring files where too long in the old scheme, such as 
"srecode-dictionary.el"

Eric



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: library/package filename prefixes
  2020-05-04  3:08     ` Richard Stallman
  2020-05-04 12:13       ` Eric Ludlam
@ 2020-05-04 14:30       ` Eli Zaretskii
  2020-05-04 15:49         ` Stefan Monnier
  2020-05-04 16:19       ` Drew Adams
  2 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2020-05-04 14:30 UTC (permalink / raw)
  To: rms; +Cc: monnier, drew.adams, emacs-devel

> From: Richard Stallman <rms@gnu.org>
> Date: Sun, 03 May 2020 23:08:47 -0400
> Cc: drew.adams@oracle.com, emacs-devel@gnu.org
> 
> In your list, some of the files do use a two-letter name prefix,
> but others do not.
> 
> lisp/cedet/srecode/el.el does not.  Neither does
> lisp/cedet/semantic/sb.el.
> 
> lisp/emacs-lisp/pp.el does use a two-letter prefix.
> Perhaps we should change it.
> 
> lisp/emacs-lisp/gv.el uses a two-letter prefix.
> I expect that the functions named starting 'gv-' are not used from a lot
> of user code, so it should not be hard to rename them.
> 
> Does anyone oppose renaming them?
> 
> lisp/bs.el does use 'bs-' as a nane prefix.
> I have a hunch the entry points are not called very often.
> Should we rename that?
> 
> It would be easy to rename po.el and its one entry point,
> which is called in just one place.
> 
> Eli, what do you think about renaming these files
> if doing so is painless?

I see no reason to rename the prefixes of pp, gv, and po.  They are
all accepted acronyms.  Also, the consensus seems to be that re- is a
good prefix, so why not those?

If we don't rename the prefixes, there's no need to rename the files.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: library/package filename prefixes
  2020-05-04 14:30       ` Eli Zaretskii
@ 2020-05-04 15:49         ` Stefan Monnier
  0 siblings, 0 replies; 11+ messages in thread
From: Stefan Monnier @ 2020-05-04 15:49 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: rms, drew.adams, emacs-devel

> I see no reason to rename the prefixes of pp, gv, and po.  They are
> all accepted acronyms.  Also, the consensus seems to be that re- is a
> good prefix, so why not those?
>
> If we don't rename the prefixes, there's no need to rename the files.

I'm biased since I'm responsible for the `gv` prefix, but just in case:
I fully agree.  Maybe we should discourage short prefixes, but I don't
think there's a need to go and rename existing ones.  Also the fact that
there are very few of them suggests that maybe it's not that important
to explicitly discourage them (other factors already seem to discourage it).


        Stefan




^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: library/package filename prefixes
  2020-05-04  3:08     ` Richard Stallman
  2020-05-04 12:13       ` Eric Ludlam
  2020-05-04 14:30       ` Eli Zaretskii
@ 2020-05-04 16:19       ` Drew Adams
  2020-05-05  2:51         ` Richard Stallman
  2 siblings, 1 reply; 11+ messages in thread
From: Drew Adams @ 2020-05-04 16:19 UTC (permalink / raw)
  To: rms, Stefan Monnier; +Cc: emacs-devel

>   > > Are there any libraries in Emacs or GNU ELPA
>   > > which currently use a 2-letter prefix?
> 
> lisp/emacs-lisp/pp.el does use a two-letter prefix.
> Perhaps we should change it.
> 
> lisp/emacs-lisp/gv.el uses a two-letter prefix.
> I expect that the functions named starting 'gv-' are
> not used from a lot of user code, so it should not be
> hard to rename them.
> 
> Does anyone oppose renaming them?
> 
> lisp/bs.el does use 'bs-' as a nane prefix...
> Should we rename that?
> 
> It would be easy to rename po.el and its one entry point,
> which is called in just one place.

FWIW, I proposed a minimum of 2 chars (plus hyphen).
I think that's good.  What's a good reason for going
to 3 instead of 2?

And yes, I expect that there's a fair amount of code
out there that uses prefixes `pp-' and `gv-'.  (But
that's not the reason I think a 2-char minimum is OK.)

If ever all possible 2-char prefixes get used, people
will of course be obliged to use at least 3 for new
libraries.  I don't see that as a problem.

0 or 1 char (plus hyphen) is problematic, I think.
But I don't see that problem for 2.
___


See also my somewhat related suggestion, about
distinguishing library prefixes from other prefixes:
https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg00261.html



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: library/package filename prefixes
  2020-05-04 16:19       ` Drew Adams
@ 2020-05-05  2:51         ` Richard Stallman
  2020-05-05  4:39           ` Drew Adams
  0 siblings, 1 reply; 11+ messages in thread
From: Richard Stallman @ 2020-05-05  2:51 UTC (permalink / raw)
  To: Drew Adams; +Cc: monnier, emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > FWIW, I proposed a minimum of 2 chars (plus hyphen).
  > I think that's good.  What's a good reason for going
  > to 3 instead of 2?

The namespace of 2-letter prefixes seems somewhat cramped to me.
Every package that uses such a prefix will have to be discussed
regarding whether it is entitled to one.

A rule saying "use at least three" would not cause any real trouble
and would mostly eliminate that problem.

-- 
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: library/package filename prefixes
  2020-05-05  2:51         ` Richard Stallman
@ 2020-05-05  4:39           ` Drew Adams
  0 siblings, 0 replies; 11+ messages in thread
From: Drew Adams @ 2020-05-05  4:39 UTC (permalink / raw)
  To: rms; +Cc: monnier, emacs-devel

>   > FWIW, I proposed a minimum of 2 chars (plus hyphen).
>   > I think that's good.  What's a good reason for going
>   > to 3 instead of 2?
> 
> The namespace of 2-letter prefixes seems somewhat cramped to me.
> Every package that uses such a prefix will have to be discussed
> regarding whether it is entitled to one.

I thought we were (I was, anyway, in my suggestion)
talking about the Elisp code conventions, which serve
as a guide to 3rd-party code, not just to code that's
to be included as an official part of Emacs.

In that 3rd-party-code case, there's no "have to be
discussed".  The idea, wrt 3rd-party code, was to
avoid having people create libraries with a prefix
like `s-' (not to mention just `-').

> A rule saying "use at least three" would not cause
> any real trouble and would mostly eliminate that problem.

(I still think 2 is OK.)

There are already libraries that have 2-char prefixes.
That existence is not a big consideration, but I don't
think 2-char prefixes cause any harm.

There's room for quite a few 2-char prefixes.  There
are, I guess, very few existing libraries with 1-char
prefixes.  And dash.el is the only library with a
0-char prefix (obviously - only one such library is
possible, hence the too-clever-by-half).

Anyway, not very important - just one (minor) opinion.



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-05-05  4:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-01 21:07 library/package filename prefixes Drew Adams
2020-05-02 18:35 ` Yuan Fu
2020-05-03  3:39 ` Richard Stallman
2020-05-03  4:17   ` Stefan Monnier
2020-05-04  3:08     ` Richard Stallman
2020-05-04 12:13       ` Eric Ludlam
2020-05-04 14:30       ` Eli Zaretskii
2020-05-04 15:49         ` Stefan Monnier
2020-05-04 16:19       ` Drew Adams
2020-05-05  2:51         ` Richard Stallman
2020-05-05  4:39           ` Drew Adams

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).