help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gnus + emacs.stackexchange


From: Artur Malabarba
Subject: Re: Gnus + emacs.stackexchange
Date: Mon, 11 May 2015 16:03:33 +0100

2015-05-11 14:54 GMT+01:00 Drew Adams <drew.adams@oracle.com>:
>> >>> (wrong-type-argument char-or-string-p nil) in
>> >>> tabulated-list-print
>> >>
>> >> Ok, would you be willing to produce a backtrace?
>> >> (with M-x toggle-debug-on-error)
>> >
>> > This is what it says for `sx-search':
>> >
>> >     Debugger entered--Lisp error: (wrong-type-argument char-or-
>> >                                    string-p nil)
>> >       tabulated-list-print-fake-header()
>> >       tabulated-list-print(remember)
>>
>> Ok. It looks like something is setting your
>> `tabulated-list-use-header-line' variable to nil *between* the
>> buffer initialization and the list printing. So the
>> `tabulated-list--header-string' variable doesn't get set (it's
>> normally set during buffer initialization), but when it's time to
>> print, the variable is expected to be a string.
>> I think that's a bug in tabulated-list-mode (which I'll try to get
>> fixed now), but do you have any hooks or advices that may be causing
>> that?
>
> Check where you call the major (derived) mode, which calls
> `tabulated-list-mode'.  If it calls it after you have already
> inserted the header line then that line will be removed when
> `tabulated-list-mode' (calls `special-mode' which) kills all
> local variables.

Activating the mode is the first thing we do on a new buffer. All
variables are set after that.

And sx has no reference to `tabulated-list-use-header-line' or
`tabulated-list--header-string', which is why I suspect there's a hook
gone rogue somewhere. Of course, I may be wrong.

> IMO, the `tabulated-list-mode' doc is not clear about such
> things.  Put differently, the design of `tabulated-list-mode'
> seems to be a bit fragile.  You need to do things in a specific
> order, which is not well documented.
>
> Caveat: I'm no expert on `tabulated-list-mode'.  Just starting
> to wade through it myself, actually - which is why I think I
> recognize the above error.  When I understand it better I will
> perhaps file a bug report or two - doc or otherwise.

I never had huge problems with this when writing paradox or sx.el.
That said, I was following the lead of `package-menu-mode's
definition, so I can't say how clear the documentation is on its own.

But I do think it's a bug that tabulated-list just barfs if the user
changes a variable to a legal value (even if it's done at the wrong
time). So I'll be fixing that this week.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]