emacs-diffs
[Top][All Lists]
Advanced

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

scratch/pkg 96325ad4ef0 1/5: First steps for package-local nicknames


From: Gerd Moellmann
Subject: scratch/pkg 96325ad4ef0 1/5: First steps for package-local nicknames
Date: Tue, 19 Dec 2023 03:35:45 -0500 (EST)

branch: scratch/pkg
commit 96325ad4ef0e2c886f0d0f887b8a4f45b4ffd28f
Author: Gerd Möllmann <gerd@gnu.org>
Commit: Gerd Möllmann <gerd@gnu.org>

    First steps for package-local nicknames
    
    * src/lisp.h (Lisp_Package): New member local_nicknames.
    * src/pkg.c (Fpackage_percent_local_nicknames,
    (Fpackage_percent_set_local_nicknames): New functions.
    (syms_of_pkg): Defsubrs for new functions.
---
 src/lisp.h |  3 +++
 src/pkg.c  | 18 ++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/src/lisp.h b/src/lisp.h
index 7e62c4fab73..daeb9e570bf 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2229,6 +2229,9 @@ struct Lisp_Package
   /* Package nicknames, a List of strings.  */
   Lisp_Object nicknames;
 
+  /* Package-local nicknames, an alist of (NICKNAME . PACKAGE).  */
+  Lisp_Object local_nicknames;
+
   /* List of package objects for the packages used by this
      package.  */
   Lisp_Object use_list;
diff --git a/src/pkg.c b/src/pkg.c
index 4ad8125775a..87f082adae2 100644
--- a/src/pkg.c
+++ b/src/pkg.c
@@ -836,6 +836,22 @@ DEFUN ("package-%set-nicknames", 
Fpackage_percent_set_nicknames,
   return XPACKAGE (package)->nicknames = nicknames;
 }
 
+DEFUN ("package-%local-nicknames", Fpackage_percent_local_nicknames,
+       Spackage_percent_local_nicknames, 1, 1, 0, doc:  /* Internal use only.  
*/)
+  (Lisp_Object package)
+{
+  CHECK_PACKAGE (package);
+  return XPACKAGE (package)->local_nicknames;
+}
+
+DEFUN ("package-%set-local-nicknames", Fpackage_percent_set_local_nicknames,
+       Spackage_percent_set_local_nicknames, 2, 2, 0, doc:  /* Internal use 
only.  */)
+  (Lisp_Object package, Lisp_Object nicknames)
+{
+  CHECK_PACKAGE (package);
+  return XPACKAGE (package)->local_nicknames = nicknames;
+}
+
 DEFUN ("package-%use-list", Fpackage_percent_use_list,
        Spackage_percent_use_list, 1, 1, 0, doc:  /* Internal use only.  */)
   (Lisp_Object package)
@@ -1120,9 +1136,11 @@ syms_of_pkg (void)
   defsubr (&Smake_percent_package);
   defsubr (&Spackage_percent_name);
   defsubr (&Spackage_percent_nicknames);
+  defsubr (&Spackage_percent_local_nicknames);
   defsubr (&Spackage_percent_register);
   defsubr (&Spackage_percent_set_name);
   defsubr (&Spackage_percent_set_nicknames);
+  defsubr (&Spackage_percent_set_local_nicknames);
   defsubr (&Spackage_percent_set_shadowing_symbols);
   defsubr (&Spackage_percent_set_status);
   defsubr (&Spackage_percent_set_symbol_package);



reply via email to

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