From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Georges Ko Newsgroups: gmane.emacs.devel Subject: Re: Emacs Lisp's future Date: Mon, 10 Oct 2016 12:09:25 +0800 Organization: gko.net Message-ID: <861szo4zgq.fsf@gko.net> References: <87wq97i78i.fsf@earlgrey.lan> <86k2dk77w6.fsf@molnjunk.nocrew.org> <642fd4b4-8b1c-a537-5a5f-6940691ec4b9@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1476072670 1602 195.159.176.226 (10 Oct 2016 04:11:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 10 Oct 2016 04:11:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (windows-nt) Hamster/2.0.0.1 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 10 06:11:07 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btRve-0008DB-8i for ged-emacs-devel@m.gmane.org; Mon, 10 Oct 2016 06:11:06 +0200 Original-Received: from localhost ([::1]:47344 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btRvc-0003Sf-Ll for ged-emacs-devel@m.gmane.org; Mon, 10 Oct 2016 00:11:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btRv7-0003SY-NB for emacs-devel@gnu.org; Mon, 10 Oct 2016 00:10:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btRv3-0004tm-BK for emacs-devel@gnu.org; Mon, 10 Oct 2016 00:10:33 -0400 Original-Received: from [195.159.176.226] (port=60275 helo=blaine.gmane.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btRv3-0004sn-3a for emacs-devel@gnu.org; Mon, 10 Oct 2016 00:10:29 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1btRuj-0001PB-2J for emacs-devel@gnu.org; Mon, 10 Oct 2016 06:10:09 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 58 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:HbF7g3OPJ7wfp+Rr9garviMZmts= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:208133 Archived-At: Richard Stallman writes: > Namespace systems do not fit well into Lisp. Common Lisp's is a total > mess. It is better to use name prefixes. A first step could be to provide some simple prefix support for users, not stuff that comes with Emacs. Example: Let's say I want to write some code in sqlited.el to edit SQLite files. Instead of prefixing everything with sqlited- in sqlited.el, I would add this to the top of the file: (set-current-prefix 'sqlited-) and "magically", everything that is defined (functions, variables, ...) in this file are prefixed with "sqlited-" from the Emacs Lisp reader point of view: (defun file-header (file) ...) is read by the reader as: (defun sqlited-file-header (file) ...) When looking up for functions, variables, etc., in this file, the reader would first search with the sqlited- prefix, then the version without prefix. "Global" elements (without prefix) can be defined and used through some virtual prefix such as "emacs:": (defvar emacs:sqlited-load-hook nil) (defun emacs:sqlited-edit-file (...) (interactive) ...) Or it could be defined that anything starting with the prefix means global, like now: (defvar sqlited-load-hook nil) (defun sqlited-edit-file (...) (interactive) ...) Or the user can set it explicitely: (set-global-prefix 'g:) ... (defvar g:sqlited-load-hook nil) (defun g:sqlited-edit-file (...) (interactive) ...) When accessing elements using other prefixes: (require "sqlited-viewer") (set-prefix-map 'v: 'sqlited-viewer-) (v:view-file "...") v:view-file would be read as sqlited-viewer-view-file. -- Georges Ko gko@gko.net 2016-10-10