From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ruijie Yu via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Cannot find a variable that sets the "abbreviation" of a library name/prefix Date: Sat, 29 Apr 2023 22:47:49 +0800 Message-ID: Reply-To: Ruijie Yu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32055"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.22; emacs 30.0.50 To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 29 16:59:02 2023 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 1psm2P-0008BX-Bi for ged-emacs-devel@m.gmane-mx.org; Sat, 29 Apr 2023 16:59:01 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1psm1a-0003Ca-Ie; Sat, 29 Apr 2023 10:58:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1psm1U-0003Ag-Lq for emacs-devel@gnu.org; Sat, 29 Apr 2023 10:58:04 -0400 Original-Received: from netyu.xyz ([152.44.41.246] helo=mail.netyu.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1psm1S-00010H-4Q for emacs-devel@gnu.org; Sat, 29 Apr 2023 10:58:03 -0400 Original-Received: from fw.net.yu.netyu.xyz ( [222.248.4.98]) by netyu.xyz (OpenSMTPD) with ESMTPSA id afdbc8d3 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Sat, 29 Apr 2023 14:57:59 +0000 (UTC) Received-SPF: pass client-ip=152.44.41.246; envelope-from=ruijie@netyu.xyz; helo=mail.netyu.xyz X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:305722 Archived-At: Hello, I'm definitely not dreaming, but I saw a variable from a patch somewhere the other day, that works like this: When one sets this variable to an alist of full-name (string) -> short-name (string), the file itself defines symbols with short names, while the loader pretends they are using the long names. For example, lets say the full name is "library", and short name is "lib". Then, you can define functions or variables like this: ```emacs-lisp ;; library.el --- example (defvar lib-foo nil) (defun lib-bar () t) (provide 'library) ;; Local variables: ;; i-dont-know-what-this-variable-is-called: (("library" . "lib")) ;; End: ``` And the outside Elisp environment, when loading this file, now pretends that the variable `library-foo' and the function `library-bar' are defined. ```emacs-lisp (require 'library) (progn library-foo (library-bar)) ``` However, when I search for "abbrev" using M-x apropos-command, I cannot find anything. Have I actually been dreaming? Thanks. -- Best, RY [Please note that this mail might go to spam due to some misconfiguration in my mail server -- still investigating.]