emacs-devel
[Top][All Lists]
Advanced

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

Re: 23.0.50; wrong-type-argument number-or-marker-p nil while trying to


From: Stefan Monnier
Subject: Re: 23.0.50; wrong-type-argument number-or-marker-p nil while trying to edit abbrevs
Date: Sun, 18 Nov 2007 14:32:24 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

> I saw

> Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
>   define-abbrev([0 0 0 0 0 0 0 0 0 rho 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...] "rho" "right-hand opponent" 
> nil 1 nil)
>   apply(define-abbrev [0 0 0 0 0 0 0 0 0 rho 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...] ("rho" "right-hand 
> opponent" nil 1 nil))
>   define-abbrev-table(outline-mode-abbrev-table (("rho" "right-hand opponent" 
> nil 1 nil) ("pseudocode" "pseudo code" nil 0 nil) ("consitute" "constitute" 
> nil 0 nil)))
>   define-abbrevs(t)
>   edit-abbrevs-redefine()
>   call-interactively(edit-abbrevs-redefine)

I installed the patch below which should fix this bug,


        Stefan


Index: lisp/abbrev.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/abbrev.el,v
retrieving revision 1.63
diff -u -r1.63 abbrev.el
--- lisp/abbrev.el      16 Nov 2007 18:27:06 -0000      1.63
+++ lisp/abbrev.el      18 Nov 2007 19:31:16 -0000
@@ -524,8 +519,14 @@
 (defun clear-abbrev-table (table)
   "Undefine all abbrevs in abbrev table TABLE, leaving it empty."
   (setq abbrevs-changed t)
-  (dotimes (i (length table))
-    (aset table i 0)))
+  (let* ((sym (intern-soft "" table)))
+    (dotimes (i (length table))
+      (aset table i 0))
+    ;; Preserve the table's properties.
+    (assert sym)
+    (intern sym table)
+    (abbrev-table-put table :abbrev-table-modiff
+                      (1+ (abbrev-table-get table :abbrev-table-modiff)))))
 
 (defun define-abbrev (table name expansion &optional hook &rest props)
   "Define an abbrev in TABLE named NAME, to expand to EXPANSION and call HOOK.




reply via email to

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