Subject: Re: bug#57821: 29.0.50; ANSI sequence not filtered in compilation buffer

From: "Basil L. Contovounesios" <[email-masked]>
Date: Sun, 18 Sep 2022 19:27:12 +0300

Matthias Meulien [2022-09-18 17:45 +0200] wrote:

> "Basil L. Contovounesios" <[email-masked]> writes:
>
>> Two spaces after a full stop, here and in the other patches.
>
> Thanks for your careful reading!  I failed to found places with this
> problem in the other patches...

In the Commentary section of osc.el:

  ;; Interpretation of OSC (Operating System Commands) escape
  ;; sequences. Handlers for OSC 2, 7 and 8 (for window title, current
              ^^
  ;; directory and hyperlinks respectively) are provided.

  ;; The function `osc-compilation-filter' can be added to
  ;; `compilation-filter-hook' to collect OSC sequences in compilation
  ;; buffers. The variable `osc-for-compilation-buffer' tells what to do
            ^^
  ;; with collected sequences.

>>> +all sequences are filtered out.
>>> +
>>> +A handler for OSC 2, the command to set a window title, is provided.
>>
>> Also OSC 7 and 8, no?
>
> Sure, I thought it's a new handler was implicit in the NEWS file;

Saying "new package 'osc'" followed by "a handler for OSC 2 is provided"
sounds like that is the only handler provided by the new 'osc' package,
or at least like the entry is talking about what is true rather than
what is new.

> handlers were already mentionned in NEWS.28. But let's try to be more
> precise.

The new text LGTM.

> Here is a patch improving the news entry and fixing the defalias for
> variables you mentionned in your other message.  I didn't tried to solve
> the alias for the button; I'll have to learn more about aliases first, I
> thought that just "maintaining" the symbol would be ok.

Symbols have three distinct slots in which values can be stored: the
value slot, the function slot, and the property list slot.

defalias changes the function slot, so it's only appropriate for symbols
which are meant to be called as functions.

defvaralias changes the value slot, so it's only appropriate for symbols
which are meant to be used as variables.

Button types are just symbols that record certain information in their
property list, like which function to call when clicked, which face to
be fontified with, etc.

So in this case it's the button type's plist that needs to be
aliased/cloned.  AFAIK there is no built-in incantation for this, so I
guess you need to resort to either:
(a) manually calling symbol-plist + setplist;
(b) defining one button type as the supertype of the other; or
(c) not bothering with the compatibility alias at all.

Thanks,

-- 
Basil