all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: emacs-devel@gnu.org
Subject: library prefixes (versus other name prefixes)
Date: Sat, 2 May 2020 12:35:59 -0700 (PDT)	[thread overview]
Message-ID: <73dcba36-03d1-408e-84ac-b07edde8ef77@default> (raw)

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?



             reply	other threads:[~2020-05-02 19:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-02 19:35 Drew Adams [this message]
2020-05-03 15:07 ` library prefixes (versus other name prefixes) Adam Porter

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=73dcba36-03d1-408e-84ac-b07edde8ef77@default \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /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 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.