]> git.eshelyaron.com Git - emacs.git/commitdiff
(define-char-code-property): Workaround for bug#52945
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 2 Jan 2022 07:25:55 +0000 (02:25 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 2 Jan 2022 07:25:55 +0000 (02:25 -0500)
* lisp/international/mule-cmds.el (define-char-code-property): Ignore
requests to re-setup lazy loading after the char-table is already loaded.

lisp/international/mule-cmds.el

index 7fd1430c03bd8cb1ee97294451b0d75665f970c8..28be35d65d21868ff8e63aabd45ed6cb59dbbcd8 100644 (file)
@@ -2936,8 +2936,14 @@ See also the documentation of `get-char-code-property' and
     (or (stringp table)
        (error "Not a char-table nor a file name: %s" table)))
   (if (stringp table) (setq table (purecopy table)))
-  (setf (alist-get name char-code-property-alist) table)
-  (put name 'char-code-property-documentation (purecopy docstring)))
+  (if (and (stringp table)
+           (char-table-p (alist-get name char-code-property-alist)))
+      ;; The table is already setup and we're apparently trying to
+      ;; undo that, probably because `charprop.el' is being re-loaded.
+      ;; Just skip it, in order to work around a recursive load (bug#52945).
+      nil
+    (setf (alist-get name char-code-property-alist) table)
+    (put name 'char-code-property-documentation (purecopy docstring))))
 
 (defvar char-code-property-table
   (make-char-table 'char-code-property-table)