[Cc'ing back to xemacs-beta]
Paul Foley <mycroft(a)actrix.gen.nz> writes:
On 26 Apr 1998 18:01:49 -0700, SL Baur wrote:
>> Comparison between integer and character is constant nil (?\; and 0)
>> [fume-find-next-c-function-name, funcall, ...
> from `fume-find-next-c-function-name' in func-menu.el.
> `following-char' returns integer 0 when the end of the buffer is
> reached. This used to lose when integer 0 was indistinguishable from
> the character NUL, but now it doesn't. You may safely ignore this
> message.
So it's OK when it occurs due to end-of-buffer, but I assume
it's a
Bad Thing when comparing non-zero-valued characters?
More or less. The usual cause of an Ebola notice at the beginning or
end of a buffer is due to use of preceding-char and following-char.
Those functions return integer 0 at the boundary. Since they really
want to return something that cannot be a character, this is O.K.
Kind of yucky, but O.K. We have replacement functions `char-after'
and `char-before' that return nil at buffer boundaries, but they're
not really needed except for pedants.
In general, an Ebola notice of a comparison of a character and integer
0 when generated from usage of preceding-char and following-char is
not Ebola and is safe usage.
I've been getting these things from SKK -- when the SKK tutorial
hits the line
;; (skktut-today)
one "Ebola" notice occurs, and every time I enter okurigana
on a word,
a notice occurs. [These are with non-zero values.]
That might well be Ebola. Please post the notices you are getting.
If you can figure out which file they are coming from, evaluate that
file in an XEmacs buffer and repeat the action that caused the notice
-- the stacktraces will be that much better.
You said
> It's an Ebola notice. Characters used to be equivalent to integers
> and now they are not. This causes code like (eq ?A 65) which used to
> return t in XEmacs 19 (and FSF Emacs) to now return nil.
but this loses if you really want to compare ?A and integer 65, yes?
That's correct.
Implies a porting problem?
Yup.
[Is it correct to use (eq (char-int ?A) 65)?]
Yes.
It is also _incorrect_ (and Ebola) to do something like (eq ?B (1+ ?A)).
Arithmetic on characters is allowed, but turns the characters into
integers. You would have to do (eq ?B (int-char (1+ ?A))) to make it
work right.