[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bad purecopy in ethiopic.el?
From: |
Glenn Morris |
Subject: |
Re: Bad purecopy in ethiopic.el? |
Date: |
Fri, 13 Nov 2009 12:14:18 -0500 |
User-agent: |
Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) |
Eli Zaretskii wrote:
> language/ethiopic.el:33:1:Warning: third arg to `defconst
> ccl-encode-ethio-font' is not a string: (purecopy CCL program to encode
> an
> Ethiopic code to code point of Ethiopic font.)
Presumably purecopy'd strings are acceptable as doc-strings.
I think byte-compile-defvar should be patched something like this
(line numbers may be off):
***************
*** 3929,3937 ****
(when (and (cddr form) (null byte-compile-current-form))
`(push ',var current-load-list))
(when (> (length form) 3)
! (when (and string (not (stringp string)))
! (byte-compile-warn "third arg to `%s %s' is not a string: %s"
! fun var string))
`(put ',var 'variable-documentation ,string))
(if (cddr form) ; `value' provided
(let ((byte-compile-not-obsolete-vars (list var)))
--- 3821,3832 ----
(when (and (cddr form) (null byte-compile-current-form))
`(push ',var current-load-list))
(when (> (length form) 3)
! (or (not string)
! (stringp string)
! (and (eq (car-safe string) 'purecopy)
! (string-or-null-p (car-safe (cdr-safe string))))
! (byte-compile-warn "third arg to `%s %s' is not a string: %s"
! fun var string))
`(put ',var 'variable-documentation ,string))
(if (cddr form) ; `value' provided
(let ((byte-compile-not-obsolete-vars (list var)))
Perhaps the string-or-null-p should be a stringp and ccl.el should
also be changed:
*** ccl.el 11 Nov 2009 06:18:20 -0000 1.52
--- ccl.el 13 Nov 2009 17:09:11 -0000
***************
*** 1523,1529 ****
(fset 'charset-id 'charset-id-internal)
(ccl-compile (eval ccl-program)))
(fmakunbound 'charset-id))))
! (defconst ,name prog (purecopy ,doc))
(put ',name 'ccl-program-idx (register-ccl-program ',name
prog))
nil))
--- 1523,1529 ----
(fset 'charset-id 'charset-id-internal)
(ccl-compile (eval ccl-program)))
(fmakunbound 'charset-id))))
! (defconst ,name prog (if ,doc (purecopy ,doc)))
(put ',name 'ccl-program-idx (register-ccl-program ',name
prog))
nil))