emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cannot find a variable that sets the "abbreviation" of a library name/pr


From: Ruijie Yu
Subject: Cannot find a variable that sets the "abbreviation" of a library name/prefix
Date: Sat, 29 Apr 2023 22:47:49 +0800
User-agent: mu4e 1.9.22; emacs 30.0.50

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.]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]