From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: raman Newsgroups: gmane.emacs.devel Subject: Re: Emacs Lisp's future Date: Mon, 10 Oct 2016 08:26:08 -0700 Message-ID: References: <87wq97i78i.fsf@earlgrey.lan> <86k2dk77w6.fsf@molnjunk.nocrew.org> <642fd4b4-8b1c-a537-5a5f-6940691ec4b9@gmail.com> <861szo4zgq.fsf@gko.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1476114412 14947 195.159.176.226 (10 Oct 2016 15:46:52 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 10 Oct 2016 15:46:52 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: emacs-devel@gnu.org To: Georges Ko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 10 17:46:48 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 1btcmO-0007Vo-S3 for ged-emacs-devel@m.gmane.org; Mon, 10 Oct 2016 17:46:17 +0200 Original-Received: from localhost ([::1]:50919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btcmI-0005cR-8V for ged-emacs-devel@m.gmane.org; Mon, 10 Oct 2016 11:46:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btcT3-00069D-Oc for emacs-devel@gnu.org; Mon, 10 Oct 2016 11:26:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btcT0-0006wm-20 for emacs-devel@gnu.org; Mon, 10 Oct 2016 11:26:16 -0400 Original-Received: from mail-pa0-x233.google.com ([2607:f8b0:400e:c03::233]:34181) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btcSz-0006wA-QS for emacs-devel@gnu.org; Mon, 10 Oct 2016 11:26:13 -0400 Original-Received: by mail-pa0-x233.google.com with SMTP id rz1so56405982pab.1 for ; Mon, 10 Oct 2016 08:26:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=cG2sSI8eBAFXTWE7OHHwXjjr6tYf5hPJY7vSDCNkBUE=; b=XrmwxUKlpMDoskbri28eLnoJOe8tsEGPSejSlgpZ39jKhKJyLL1IvM5iTDDRqIU+xq uuOA4Dg6l971uBGWWT6SkqOJZp0XJPL4nAaWFWUntmxOq6nSsyA7tnYMDpAn18LFHUru SOzqAr9WeuLMG+Hy4D41SxHPHR5xTUO5FHsSRhVgJmcmzJWT7TgHuB7JCLKWGZ25d6Tr B3GnlCegIS/Qxxr2AsUyr0RsL0gaySZe0IuMv5hawhjd52ZWkvX4I2VucYURwQ+Zw5Xj jE6xjGRcSp3X4hfITKRYPJ42vh218vfLI1d9DMLnBv8HxZBYC7yigHATiE9tAi00bPuj nKoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=cG2sSI8eBAFXTWE7OHHwXjjr6tYf5hPJY7vSDCNkBUE=; b=DgRo8bO3RC3xAZUAeqZXWOzWUHQZt/DSwS26IJPNAZwGnaYg3ae4D3GEYrCDeQ7CuG ADeZnKnQ+Ag1YQEf4PsoITBgS00TbAxnOc/lem9RThqZiVQKa0Qs64BriN39arAnfOYH JukBshCaIgBSIe+qSsBLC35Fi4IfaEzOxYEDkyokPvEafTWBD5xQkcZAo/Ih36VcBliD BPNtWS/HTLAXccXVCGWvZI0l1z3YjbAAVmxkRaoVvzn6h4Gl3KvhC9ZdmEuC6NXI07vN vEvmEjymRWRcts2vZ6xVTMUvZuf5rXHraG7PzfszcciLFyLECMwsDSdUa13oyMLNFd5a Ivfw== X-Gm-Message-State: AA6/9RnheVzYQfKrIJR7rAewu5/h0DObI/4k+wIxJG8GmxTroxgFDvuk6DkQKnJFhFMV/CYX X-Received: by 10.66.22.38 with SMTP id a6mr56629119paf.39.1476113173075; Mon, 10 Oct 2016 08:26:13 -0700 (PDT) Original-Received: from raman-glaptop2 ([207.198.106.187]) by smtp.gmail.com with ESMTPSA id l2sm59869784pav.7.2016.10.10.08.26.10 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 10 Oct 2016 08:26:12 -0700 (PDT) In-Reply-To: <861szo4zgq.fsf@gko.net> (Georges Ko's message of "Mon, 10 Oct 2016 12:09:25 +0800") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c03::233 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:208143 Archived-At: Georges Ko writes: All this would buy would be less typing -- but emacs completion does most of my typing for me anyway. another win perhaps might be for shorter lines because of shorter identifiers -- but for a large file, one might easily forget that the prefix has been set at the top -- e.g. when fixing a bug in the middle of a file. > 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. --