all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* library prefixes (versus other name prefixes)
@ 2020-05-02 19:35 Drew Adams
  2020-05-03 15:07 ` Adam Porter
  0 siblings, 1 reply; 2+ messages in thread
From: Drew Adams @ 2020-05-02 19:35 UTC (permalink / raw)
  To: emacs-devel

Some of the discussion in threads "handling many
matches", "Imports / inclusion of s.el into Emacs",
and now "Add some aliases for re-related functions"
considers the use of a thing-type name as prefix
for function, var, etc. names.

For example, it's proposed to add aliases that
use prefix `re-' for regexp-related functions.

Currently, I see only these functions with that
prefix:

 re-builder  (command)
 re-search-backward  (command)
 re-search-backward-lax-whitespace 
 re-search-forward  (command)
 re-search-forward-lax-whitespace

I asked myself the question, "What if someone
wanted to add a library/package that uses
prefix `re-'? Already taken, in effect, and
not for a library.  Too bad.

How do we tell a library prefix from another
kind of prefix, including one that refers to
a type of thing returned or accepted as arg?

We can't, on the face of it.

So I wonder if it isn't time to reconsider the
convention of ending a library prefix with `-'.

I know that some libraries out there do use
a different char, in particular `/'.  Should
we change to that?  (I'm thinking maybe yes.)

If so, should we rename existing library
prefixes to respect that new convention?
(I'd say no.)
___

What about this proposal:

1. Change the library-prefix convention to use
   `/' instead of `-'.

   So instead of `mylib-foo' the name would be
   `mylib/foo'.

2. Say that the prefix should have at least 2
   chars, besides the `/'.

   So `s/foo' and `/foo' wouldn't conform.

3. "Internal" names would still use `-', after
   the prefix.

   So instead of `mylib--foo' the name would
   be `mylib/-foo'.

What would be some pros & cons in making such a change?



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

end of thread, other threads:[~2020-05-03 15:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-02 19:35 library prefixes (versus other name prefixes) Drew Adams
2020-05-03 15:07 ` Adam Porter

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.