From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Adam Porter Newsgroups: gmane.emacs.devel Subject: Re: Imports / inclusion of s.el into Emacs Date: Tue, 12 May 2020 14:14:29 -0500 Message-ID: <87a72dge3u.fsf@alphapapa.net> References: <0c88192c-3c33-46ed-95cb-b4c6928016e3@default> <87mu6dctgg.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="125637"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 12 21:15:59 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYaNj-000WY9-Bh for ged-emacs-devel@m.gmane-mx.org; Tue, 12 May 2020 21:15:59 +0200 Original-Received: from localhost ([::1]:56368 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYaNi-0000pb-8y for ged-emacs-devel@m.gmane-mx.org; Tue, 12 May 2020 15:15:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYaMQ-0008Hb-PY for emacs-devel@gnu.org; Tue, 12 May 2020 15:14:38 -0400 Original-Received: from ciao.gmane.io ([159.69.161.202]:38970) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYaMP-0000BE-CK for emacs-devel@gnu.org; Tue, 12 May 2020 15:14:38 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1jYaMN-000UuD-Qy for emacs-devel@gnu.org; Tue, 12 May 2020 21:14:35 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=159.69.161.202; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/12 15:14:35 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:250026 Archived-At: João Távora writes: > However, if people are looking for other constructs to manage > namespaces, it very much possible to develop shorthand.el so that you > can have: > > (shorthand-in-namespace FOO :as "f") > > For more complicated cases where the library foo.el doesn't have a > single prefix or renaming rule, we can use more sophisticated forms. > > I just provided the buffer-local-variable technique: > > ;; Local Variables: > ;; shorthand-shorthands: (("^s-" . "magnar-string-")) > ;; End: > > because it's practical, understood, and would be self-evident, i.e. work > without much "magic". I'm hopeful that this solution, or something like it, will make it into Emacs! Thank you for working on this, João. One minor drawback I see is that the symbol renaming is placed at the bottom of an Elisp file, while the loading of the library whose symbols are renamed is (usually) at the top of the file. Would a macro something like this be feasible, to (require ...) the library and specify the renamings together? (shorthand-require 'magnar-string :with "^s-" :as "magnar-string-")