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

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