From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Need advice for naming practice for namespaces in Elisp. Date: Tue, 5 Feb 2013 22:42:07 -0800 Message-ID: <1396EDC456CE46C784B8F45242B3B6FA@us.oracle.com> References: <87ehguo5ha.fsf@gavenkoa.example.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1360134011 10253 80.91.229.3 (6 Feb 2013 07:00:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Feb 2013 07:00:11 +0000 (UTC) To: "'Oleksandr Gavenko'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 06 08:00:31 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U2yzc-0004pL-5A for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Feb 2013 08:00:28 +0100 Original-Received: from localhost ([::1]:38514 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2yzG-0000ak-1W for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Feb 2013 02:00:06 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:54867) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2yz7-0000Kb-7b for help-gnu-emacs@gnu.org; Wed, 06 Feb 2013 02:00:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U2ywP-0004zu-GJ for help-gnu-emacs@gnu.org; Wed, 06 Feb 2013 01:57:13 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:20609) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2yi2-0001Rr-IT for help-gnu-emacs@gnu.org; Wed, 06 Feb 2013 01:42:19 -0500 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r166gFXh019154 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 6 Feb 2013 06:42:16 GMT Original-Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r166gE5H017268 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 6 Feb 2013 06:42:15 GMT Original-Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id r166gEw9016679; Wed, 6 Feb 2013 00:42:14 -0600 Original-Received: from dradamslap1 (/10.159.229.67) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 05 Feb 2013 22:42:14 -0800 X-Mailer: Microsoft Office Outlook 11 Thread-Index: Ac4D4bM9R/lRDButQrC+4bDSxOnhKAAUr5MA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 In-Reply-To: <87ehguo5ha.fsf@gavenkoa.example.com> X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:88983 Archived-At: > I read very small amount of elisp code and found practice to > put '->' in the name of elisp var/func: > > Also I search for dot in names: > and for colon: > > Seems that official sources don't often use special marker to > separate package name and command and some times uses '->', > ':' and '.' > > I want to choose good marker for package to simplify reading > my code and make it more syntactically structured. I am > feeling good with dot: > > but would be glad to hear any suggestion and coding > practices... I say use whatever you like. The Elisp manual suggests using a hyphen (`-'). See (elisp) `Coding Conventions': ,---- |* You should choose a short word to distinguish your program from | other Lisp programs. The names of all global variables, | constants, and functions in your program should begin with that | chosen prefix. Separate the prefix from the rest of the name with | a hyphen, `-'. 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(1). | | Occasionally, for a command name intended for users to use, it is | more convenient if some words come before the package's name | prefix. And constructs that define functions, variables, etc., | work better if they start with `defun' or `defvar', so put the | name prefix later on in the name. | | This recommendation applies even to names for traditional Lisp | primitives that are not primitives in Emacs Lisp--such as | `copy-list'. Believe it or not, there is more than one plausible | way to define `copy-list'. Play it safe; append your name prefix | to produce a name like `foo-copy-list' or `mylib-copy-list' | instead. | | If you write a function that you think ought to be added to Emacs | under a certain name, such as `twiddle-files', don't call it by | that name in your program. Call it `mylib-twiddle-files' in your | program, and send mail to `bug-gnu-emacs@gnu.org' suggesting we add | it to Emacs. If and when we do, we can change the name easily | enough. | | If one prefix is insufficient, your package can use two or three | alternative common prefixes, so long as they make sense. `----