unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ruijie Yu via "Emacs development discussions." <emacs-devel@gnu.org>
To: emacs-devel <emacs-devel@gnu.org>
Subject: Cannot find a variable that sets the "abbreviation" of a library name/prefix
Date: Sat, 29 Apr 2023 22:47:49 +0800	[thread overview]
Message-ID: <sdvv8heka7e.fsf@netyu.xyz> (raw)

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	other threads:[~2023-04-29 14:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-29 14:47 Ruijie Yu via Emacs development discussions. [this message]
2023-04-29 15:14 ` Cannot find a variable that sets the "abbreviation" of a library name/prefix Eli Zaretskii
2023-04-29 21:46 ` João Távora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sdvv8heka7e.fsf@netyu.xyz \
    --to=emacs-devel@gnu.org \
    --cc=ruijie@netyu.xyz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).