GNU bug report logs - #65051
internal_equal manipulates symbols with position without checking symbols-with-pos-enabled.

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Fri, 4 Aug 2023 14:01:02 UTC

Severity: normal

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Alan Mackenzie <acm <at> muc.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 65051 <at> debbugs.gnu.org
Subject: bug#65051: internal_equal manipulates symbols with position without checking symbols-with-pos-enabled.
Date: Sat, 12 Aug 2023 10:41:24 +0000
Hello, Stefan.

On Sat, Aug 12, 2023 at 01:36:08 -0400, Stefan Monnier wrote:

[ .... ]

> ..... (BTW, why we do handle SWP specially in `time-convert`?).

That was this patch:

commit 343482d641511b54aa0444791770b4ea70d27cc7
Author: Paul Eggert <eggert <at> cs.ucla.edu>
Date:   Wed Jun 15 23:08:03 2022 -0500

    Streamline time decoding and conversion

    * src/lisp.h (lisp_h_BASE2_EQ, BASE2_EQ): New macros and functions.
    * src/timefns.c (tzlookup, Fdecode_time): Use them.
    (Ftime_convert): Convert to symbol once, instead of many times.  <=====

..  form, if a SWP, gets replaced by its bare symbol, so that the
following comparisons can be done by BASE_EQ rather than EQ.  It's an
optimisation, though I can't really see why it's worthwhile.

If you remove that SWP handling, as you are proposing, you'll need to
set these BASE_EQ's back to EQ's, too.

>         Stefan

[ .... ]

> diff --git a/src/timefns.c b/src/timefns.c
> index 151f5b482a3..7e030da3fcd 100644
> --- a/src/timefns.c
> +++ b/src/timefns.c
> @@ -1767,8 +1767,6 @@ DEFUN ("time-convert", Ftime_convert, Stime_convert, 1, 2, 0,
>    enum timeform input_form = decode_lisp_time (time, false, &t, 0);
>    if (NILP (form))
>      form = current_time_list ? Qlist : Qt;
> -  if (symbols_with_pos_enabled && SYMBOL_WITH_POS_P (form))
> -    form = SYMBOL_WITH_POS_SYM (form);
>    if (BASE_EQ (form, Qlist))
>      return ticks_hz_list4 (t.ticks, t.hz);
>    if (BASE_EQ (form, Qinteger))

-- 
Alan Mackenzie (Nuremberg, Germany).




This bug report was last modified 1 year and 314 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.