unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: 16725@debbugs.gnu.org
Subject: bug#16725: 24.3.50; (wrong-type-argument stringp t) with `apropos-documentation'
Date: Tue, 11 Feb 2014 14:34:50 -0800 (PST)	[thread overview]
Message-ID: <e049eff2-d375-4291-8ab0-9ba8c245cc8e@default> (raw)

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'





             reply	other threads:[~2014-02-11 22:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-11 22:34 Drew Adams [this message]
2016-04-29 16:23 ` bug#16725: 24.3.50; (wrong-type-argument stringp t) with `apropos-documentation' Lars Ingebrigtsen
2017-02-21  2:58   ` npostavs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e049eff2-d375-4291-8ab0-9ba8c245cc8e@default \
    --to=drew.adams@oracle.com \
    --cc=16725@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).