unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#16725: 24.3.50; (wrong-type-argument stringp t) with `apropos-documentation'
@ 2014-02-11 22:34 Drew Adams
  2016-04-29 16:23 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2014-02-11 22:34 UTC (permalink / raw)
  To: 16725

Yes, this normally will not happen.  But the code is unnecessarily
fragile, and here is a simple case that breaks it.

I had this mistaken autoload sexp in a startup file:

(autoload 'insert-time-string "insert-time-string" t 
          "Insert current time at point.")

(The last two args are swapped.)

I have `apropos-do-all' = t.

I did `M-x apropos-documentation RET empty list RET
And I got the error message.

This fragile code, in `apropos-documentation' is the cause:

	  (if do-all
	      (mapatoms
	       (lambda (symbol)
		 (setq f (apropos-safe-documentation symbol))
                 (setq v (get symbol 'variable-documentation))
		 (if (integerp v) (setq v))
		 (setq f (apropos-documentation-internal f)
		       v (apropos-documentation-internal v))

The return value of `apropos-safe-cocumentation' for symbol
`insert-time-string' is `t'.   And that causes
`apropos-documentation-internal' to raise the error.

To improve the code, test the values of `f' and `v' before passing them
to `apropos-documentation-internal', or make that function itself
failsafe for a non-string arg.

BTW, this same error exists as far back as Emacs 20!


In GNU Emacs 24.3.50.1 (i686-pc-mingw32)
 of 2014-02-06 on ODIEONE
Bzr revision: 116299 rgm@gnu.org-20140207032552-3ycw6hai2zl7yynq
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/Devel/emacs/binary --enable-checking=yes,glyphs
 'CFLAGS=-O0 -g3' LDFLAGS=-Lc:/Devel/emacs/lib
 CPPFLAGS=-Ic:/Devel/emacs/include'





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

* bug#16725: 24.3.50; (wrong-type-argument stringp t) with `apropos-documentation'
  2014-02-11 22:34 bug#16725: 24.3.50; (wrong-type-argument stringp t) with `apropos-documentation' Drew Adams
@ 2016-04-29 16:23 ` Lars Ingebrigtsen
  2017-02-21  2:58   ` npostavs
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2016-04-29 16:23 UTC (permalink / raw)
  To: Drew Adams; +Cc: 16725

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

> Yes, this normally will not happen.  But the code is unnecessarily
> fragile, and here is a simple case that breaks it.
>
> I had this mistaken autoload sexp in a startup file:
>
> (autoload 'insert-time-string "insert-time-string" t 
>           "Insert current time at point.")
>
> (The last two args are swapped.)
>
> I have `apropos-do-all' = t.
>
> I did `M-x apropos-documentation RET empty list RET
> And I got the error message.

I've now made the code less fragile.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#16725: 24.3.50; (wrong-type-argument stringp t) with `apropos-documentation'
  2016-04-29 16:23 ` Lars Ingebrigtsen
@ 2017-02-21  2:58   ` npostavs
  0 siblings, 0 replies; 3+ messages in thread
From: npostavs @ 2017-02-21  2:58 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 16725

tags 16725 fixed
close 16725 26.1
quit

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Drew Adams <drew.adams@oracle.com> writes:
>
>> Yes, this normally will not happen.  But the code is unnecessarily
>> fragile, and here is a simple case that breaks it.
>>
> I've now made the code less fragile.

Marking as fixed [1: 1a3a1f709d].

1: 2016-04-29 18:22:58 +0200 1a3a1f709d43836772bc0a84fa67694ff8123df5
  Add a sanity check to apropos-documentation-internal





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

end of thread, other threads:[~2017-02-21  2:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-11 22:34 bug#16725: 24.3.50; (wrong-type-argument stringp t) with `apropos-documentation' Drew Adams
2016-04-29 16:23 ` Lars Ingebrigtsen
2017-02-21  2:58   ` npostavs

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).