unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#37507: 26.3; Non-number value for `fill-column' causes wrong-type-arg error for `C-h f'
@ 2019-09-24 18:23 Drew Adams
  2019-09-24 18:30 ` Drew Adams
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Drew Adams @ 2019-09-24 18:23 UTC (permalink / raw)
  To: 37507

`fill-column' is supposed to have an integer value > 0.

But if it has a non-numeric value then other functions can barf, unless
they watch out for that.

E.g.

emacs -Q

(setq fill-column nil)

C-h f forward-char ; raises error

That happens because `describe-function-1` calls
`fill-region-as-paragraph`, which ultimately calls
`fill-match-adaptive-prefix`, which barfs when it tries to add the
result of `current-fill-column` (nil) to integers.

This is a regression from older releases.


In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)
 of 2019-08-29
Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd
Windowing system distributor `Microsoft Corp.', version 10.0.17763
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#37507: 26.3; Non-number value for `fill-column' causes wrong-type-arg error for `C-h f'
  2019-09-24 18:23 bug#37507: 26.3; Non-number value for `fill-column' causes wrong-type-arg error for `C-h f' Drew Adams
@ 2019-09-24 18:30 ` Drew Adams
  2019-09-24 19:53 ` Noam Postavsky
  2019-10-19  0:35 ` Stefan Kangas
  2 siblings, 0 replies; 6+ messages in thread
From: Drew Adams @ 2019-09-24 18:30 UTC (permalink / raw)
  To: 37507

The regression (wrt `describe-function') was introduced in Emacs 26.3.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#37507: 26.3; Non-number value for `fill-column' causes wrong-type-arg error for `C-h f'
  2019-09-24 18:23 bug#37507: 26.3; Non-number value for `fill-column' causes wrong-type-arg error for `C-h f' Drew Adams
  2019-09-24 18:30 ` Drew Adams
@ 2019-09-24 19:53 ` Noam Postavsky
  2019-09-24 20:49   ` Drew Adams
  2019-09-25  6:37   ` Eli Zaretskii
  2019-10-19  0:35 ` Stefan Kangas
  2 siblings, 2 replies; 6+ messages in thread
From: Noam Postavsky @ 2019-09-24 19:53 UTC (permalink / raw)
  To: Drew Adams; +Cc: 37507

Drew Adams <drew.adams@oracle.com> writes:

> `fill-column' is supposed to have an integer value > 0.
>
> But if it has a non-numeric value then other functions can barf, unless
> they watch out for that.

Shouldn't users just not set it to a non-numeric value then?  I'm sure
you can cause all sort of errors by setting things to invalid values.

> emacs -Q
>
> (setq fill-column nil)

Do you mean setq-default (otherwise I can't reproduce)?

> C-h f forward-char ; raises error





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#37507: 26.3; Non-number value for `fill-column' causes wrong-type-arg error for `C-h f'
  2019-09-24 19:53 ` Noam Postavsky
@ 2019-09-24 20:49   ` Drew Adams
  2019-09-25  6:37   ` Eli Zaretskii
  1 sibling, 0 replies; 6+ messages in thread
From: Drew Adams @ 2019-09-24 20:49 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 37507

> > `fill-column' is supposed to have an integer value > 0.
> >
> > But if it has a non-numeric value then other functions
> > can barf, unless they watch out for that.
> 
> Shouldn't users just not set it to a non-numeric value then?

Should?  Yes.

Just?  I don't see why.

> I'm sure you can cause all sort of errors by setting
> things to invalid values.

And?

If this is only about users setting the value
then the answer is for them to always use
`set-fill-column'.  "Should [eom]."

But is there a reason why this shouldn't be protected
here?'

I wonder even whether there is a reason why
`current-column' shouldn't prevent that particular
error by, say, substituting 0 for a `fill-column'
value that's not an integer > 0.  I don't propose
that at this point (might break something that
depends on raising an error?), but I wonder if it
wouldn't be reasonable for `current-column' to do.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#37507: 26.3; Non-number value for `fill-column' causes wrong-type-arg error for `C-h f'
  2019-09-24 19:53 ` Noam Postavsky
  2019-09-24 20:49   ` Drew Adams
@ 2019-09-25  6:37   ` Eli Zaretskii
  1 sibling, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2019-09-25  6:37 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 37507

> From: Noam Postavsky <npostavs@gmail.com>
> Date: Tue, 24 Sep 2019 15:53:15 -0400
> Cc: 37507@debbugs.gnu.org
> 
> Drew Adams <drew.adams@oracle.com> writes:
> 
> > `fill-column' is supposed to have an integer value > 0.
> >
> > But if it has a non-numeric value then other functions can barf, unless
> > they watch out for that.
> 
> Shouldn't users just not set it to a non-numeric value then?  I'm sure
> you can cause all sort of errors by setting things to invalid values.
> 
> > emacs -Q
> >
> > (setq fill-column nil)
> 
> Do you mean setq-default (otherwise I can't reproduce)?

I agree that this is a cockpit error.  Users who are prone to such
mistakes should use Customize to set values of variables.  Users who
use setq-default should know what they are doing.

It is unreasonable to request that we have an explicit test for valid
values in every place that references a variable.  Our protection is
that we signal an error, and that should IMO be good enough in cases
such as this one.

P.S.  This bug report came from a question on Reddit, where it
received the same responses.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#37507: 26.3; Non-number value for `fill-column' causes wrong-type-arg error for `C-h f'
  2019-09-24 18:23 bug#37507: 26.3; Non-number value for `fill-column' causes wrong-type-arg error for `C-h f' Drew Adams
  2019-09-24 18:30 ` Drew Adams
  2019-09-24 19:53 ` Noam Postavsky
@ 2019-10-19  0:35 ` Stefan Kangas
  2 siblings, 0 replies; 6+ messages in thread
From: Stefan Kangas @ 2019-10-19  0:35 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Noam Postavsky, 37507

tags 37507 + notabug
close 37507
quit

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Noam Postavsky <npostavs@gmail.com>
>> Date: Tue, 24 Sep 2019 15:53:15 -0400
>> Cc: 37507@debbugs.gnu.org
>>
>> Drew Adams <drew.adams@oracle.com> writes:
>>
>> > `fill-column' is supposed to have an integer value > 0.
>> >
>> > But if it has a non-numeric value then other functions can barf, unless
>> > they watch out for that.
>>
>> Shouldn't users just not set it to a non-numeric value then?  I'm sure
>> you can cause all sort of errors by setting things to invalid values.
>>
>> > emacs -Q
>> >
>> > (setq fill-column nil)
>>
>> Do you mean setq-default (otherwise I can't reproduce)?
>
> I agree that this is a cockpit error.  Users who are prone to such
> mistakes should use Customize to set values of variables.  Users who
> use setq-default should know what they are doing.
>
> It is unreasonable to request that we have an explicit test for valid
> values in every place that references a variable.  Our protection is
> that we signal an error, and that should IMO be good enough in cases
> such as this one.
>
> P.S.  This bug report came from a question on Reddit, where it
> received the same responses.

I think the above makes it clear that this is not a bug.  I'm
consequently closing this report.

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-10-19  0:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-24 18:23 bug#37507: 26.3; Non-number value for `fill-column' causes wrong-type-arg error for `C-h f' Drew Adams
2019-09-24 18:30 ` Drew Adams
2019-09-24 19:53 ` Noam Postavsky
2019-09-24 20:49   ` Drew Adams
2019-09-25  6:37   ` Eli Zaretskii
2019-10-19  0:35 ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).