Subject: Re: bug#76193: 30.0.93; Wrong type argument in outline-minor-mode

From: Juri Linkov <[email-masked]>
Date: Tue, 11 Feb 2025 09:53:25 +0200

> 1. Open scratch buffer
> 2. M-: (setq outline-minor-mode-use-buttons 'in-margins) RET
> 3. M-: (setq left-margin-width 2) RET
> 4. M-x outline-minor-mode [Outline minor mode enabled in current buffer]
> 5. M-x outline-minor-mode [Wrong type argument: number-or-mark-p, nil]
>
> The error happens on line 616 of outline.el, because
> outline--margin-width is nil when outline-minor-mode is disabled.  It
> turns out that it was never set when outline-minor-mode was enabled,
> because the condition on line 552 fails when left-margin-width is greater than
> zero.

Thanks for the bug report.  outline-minor-mode was not intended
to work for left-margin-width set to a non-zero value from outside.

I wonder do you know a case where the same margin is successfully shared
between outline-minor-mode and some other package?

In any case this information is not required for fixing outline-minor-mode
that should support any value of left-margin-width.

Do you agree that the right fix would be just do nothing
when outline--margin-width is nil?