From 2d1e9163e52eb9cae2e1b499674b29fedcdfd034 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Thu, 7 May 2020 22:48:10 +0100 Subject: [PATCH] Add lexspaces.c --- src/Makefile.in | 2 +- src/emacs.c | 1 + src/lexspaces.c | 40 ++++++++++++++++++++++++++++++++++++++++ src/lisp.h | 3 +++ 4 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 src/lexspaces.c diff --git a/src/Makefile.in b/src/Makefile.in index 552dd2e50ae..59050a01384 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -410,7 +410,7 @@ base_obj = dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \ $(CM_OBJ) term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \ emacs.o keyboard.o macros.o keymap.o sysdep.o \ bignum.o buffer.o filelock.o insdel.o marker.o \ - minibuf.o fileio.o dired.o \ + minibuf.o fileio.o dired.o lexspaces.o \ cmds.o casetab.o casefiddle.o indent.o search.o regex-emacs.o undo.o \ alloc.o pdumper.o data.o doc.o editfns.o callint.o \ eval.o floatfns.o fns.o font.o print.o lread.o $(MODULES_OBJ) \ diff --git a/src/emacs.c b/src/emacs.c index ea9c4cd79dc..a826a60adcf 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1812,6 +1812,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem syms_of_indent (); syms_of_insdel (); /* syms_of_keymap (); */ + syms_of_lexspaces (); syms_of_macros (); syms_of_marker (); syms_of_minibuf (); diff --git a/src/lexspaces.c b/src/lexspaces.c new file mode 100644 index 00000000000..ed15a507f4d --- /dev/null +++ b/src/lexspaces.c @@ -0,0 +1,40 @@ +/* Copyright (C) 2020 Free Software Foundation, Inc. + +Author: Andrea Corallo + +This file is part of GNU Emacs. + +GNU Emacs is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or (at +your option) any later version. + +GNU Emacs is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Emacs. If not, see . */ + +#include +#include "lisp.h" + +DEFUN ("in-lexspace", Fin_lexspace, Sin_lexspace, 1, 1, 0, + doc: /* Set NAME as current lexspace. Create it in case. */) + (Lisp_Object name) +{ + CHECK_SYMBOL (name); + return name; +} + +void +syms_of_lexspaces (void) +{ + DEFSYM (Qel, "el"); + DEFVAR_LISP ("current-lexspace-name", Vcurrent_lexspace_name, + doc: /* Internal use. */); + Vcurrent_lexspace_name = Qel; + + defsubr (&Sin_lexspace); +} diff --git a/src/lisp.h b/src/lisp.h index b4ac017dcf5..58ea559b281 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -4513,6 +4513,9 @@ extern Lisp_Object exec_byte_code (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, ptrdiff_t, Lisp_Object *); extern Lisp_Object get_byte_code_arity (Lisp_Object); +/* Defined in lexspaces.c. */ +extern void syms_of_lexspaces (void); + /* Defined in macros.c. */ extern void init_macros (void); extern void syms_of_macros (void); -- 2.39.5