emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] scratch/raeburn-startup a1d17f3 4/4: Dump and restore the


From: Ken Raeburn
Subject: [Emacs-diffs] scratch/raeburn-startup a1d17f3 4/4: Dump and restore the standard category and syntax tables.
Date: Thu, 2 Feb 2017 08:28:55 +0000 (UTC)

branch: scratch/raeburn-startup
commit a1d17f3e7a521dec5782b8a7db3f0c645e29202e
Author: Ken Raeburn <address@hidden>
Commit: Ken Raeburn <address@hidden>

    Dump and restore the standard category and syntax tables.
    
    * src/category.c (Finternal_set_standard_category_table): New
    function.
    (syms_of_category): Make it known.
    * src/syntax.c (Finternal_set_standard_syntax_table): New function.
    (syms_of_syntax): Make it know.
    * lisp/loadup.el: Generate calls, supplying the table definitions at
    dump time.
---
 lisp/loadup.el |    6 ++++++
 src/category.c |   12 ++++++++++++
 src/syntax.c   |   13 +++++++++++++
 3 files changed, 31 insertions(+)

diff --git a/lisp/loadup.el b/lisp/loadup.el
index 6bc4833..b3cf740 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -486,6 +486,12 @@ lost after dumping")))
             (charsets '()) (charset-aliases '())
             (cmds '()))
         (setcdr global-buffers-menu-map nil) ;; Get rid of buffer objects!
+        (push `(internal--set-standard-syntax-table
+                ,(standard-syntax-table))
+              cmds)
+        (push `(internal--set-standard-category-table
+                ,(standard-category-table))
+              cmds)
         (mapatoms
          (lambda (s)
            (when (fboundp s)
diff --git a/src/category.c b/src/category.c
index 8315797..a8c60bd 100644
--- a/src/category.c
+++ b/src/category.c
@@ -291,6 +291,17 @@ Return TABLE.  */)
   return table;
 }
 
+DEFUN ("internal--set-standard-category-table",
+       Finternal_set_standard_category_table,
+       Sinternal_set_standard_category_table, 1, 1, 0,
+       doc: /* Replace the standard category table used for new buffers.  */)
+  (Lisp_Object table)
+{
+  table = check_category_table (table);
+  Vstandard_category_table = table;
+  return table;
+}
+
 
 Lisp_Object
 char_category_set (int c)
@@ -514,6 +525,7 @@ See the documentation of the variable 
`word-combining-categories'.  */);
   defsubr (&Schar_category_set);
   defsubr (&Scategory_set_mnemonics);
   defsubr (&Smodify_category_entry);
+  defsubr (&Sinternal_set_standard_category_table);
 
   category_table_version = 0;
 }
diff --git a/src/syntax.c b/src/syntax.c
index d463f7e..61e25c4 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1027,6 +1027,18 @@ It is a copy of the TABLE, which defaults to the 
standard syntax table.  */)
   return copy;
 }
 
+DEFUN ("internal--set-standard-syntax-table",
+       Finternal_set_standard_syntax_table,
+       Sinternal_set_standard_syntax_table, 1, 1, 0,
+       doc: /* Replace the standard syntax table, used for new buffers.  */)
+  (Lisp_Object table)
+{
+  check_syntax_table (table);
+  Vstandard_syntax_table = table;
+  Fset_char_table_parent (table, Qnil);
+  return table;
+}
+
 DEFUN ("set-syntax-table", Fset_syntax_table, Sset_syntax_table, 1, 1, 0,
        doc: /* Select a new syntax table for the current buffer.
 One argument, a syntax table.  */)
@@ -3760,6 +3772,7 @@ In both cases, LIMIT bounds the search. */);
   defsubr (&Sstring_to_syntax);
   defsubr (&Smodify_syntax_entry);
   defsubr (&Sinternal_describe_syntax_value);
+  defsubr (&Sinternal_set_standard_syntax_table);
 
   defsubr (&Sforward_word);
 



reply via email to

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