From: Glenn Morris <rgm@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Bad purecopy in ethiopic.el?
Date: Fri, 13 Nov 2009 12:14:18 -0500 [thread overview]
Message-ID: <xk8wea1h5h.fsf@fencepost.gnu.org> (raw)
In-Reply-To: 83hbsyolg2.fsf@gnu.org
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))
next prev parent reply other threads:[~2009-11-13 17:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-13 8:53 Bad purecopy in ethiopic.el? Eli Zaretskii
2009-11-13 17:14 ` Glenn Morris [this message]
2009-11-13 17:57 ` Andreas Schwab
2009-11-14 2:03 ` Dan Nicolaescu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xk8wea1h5h.fsf@fencepost.gnu.org \
--to=rgm@gnu.org \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.