GNU bug report logs - #17490
24.3.91; describe-function on some eieio class give (wrong-type-argument char-or-string-p nil)

Previous Next

Package: emacs;

Reported by: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>

Date: Wed, 14 May 2014 09:33:02 UTC

Severity: normal

Found in version 24.3.91

Done: David Engster <deng <at> randomsample.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
Subject: bug#17490: closed (Re: bug#17490: 24.3.91; describe-function on
 some eieio class give (wrong-type-argument char-or-string-p nil))
Date: Wed, 14 May 2014 20:59:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#17490: 24.3.91; describe-function on some eieio class give (wrong-type-argument char-or-string-p nil)

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 17490 <at> debbugs.gnu.org.

-- 
17490: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17490
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: David Engster <deng <at> randomsample.de>
To: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
Cc: 17490-done <at> debbugs.gnu.org
Subject: Re: bug#17490: 24.3.91;
 describe-function on some eieio class give (wrong-type-argument
 char-or-string-p nil)
Date: Wed, 14 May 2014 22:58:40 +0200
Nicolas Richard writes:
> Eval the following snippet (taken from (info "(eieio) Quick Start"),
> except that I removed the docstring in the method):

[...]

> FWIW I did this to fix it :
> --- a/lisp/emacs-lisp/eieio-opt.el
> +++ b/lisp/emacs-lisp/eieio-opt.el

[...]

> -		      (cdr cur)))
> +		      (or (cdr cur) "  Undocumented")))

Thanks for the report and the fix, which I just pushed to the emacs-24
branch, albeit with a small change: Instead of printing "Undocumented",
it simply prints nothing, since the other EIEIO help functions don't
explicitly denote a lack of documentation either. That might be a
mistake though, since describe-function/variable do that. I guess this
should be changed, but that would belong to trunk.

-David

[Message part 3 (message/rfc822, inline)]
From: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.91;
 describe-function on some eieio class give (wrong-type-argument
 char-or-string-p nil)
Date: Wed, 14 May 2014 11:32:41 +0200
Hi,

Eval the following snippet (taken from (info "(eieio) Quick Start"),
except that I removed the docstring in the method):

(progn
  (defclass record ()
    ((name :initarg :name
           :initform ""
           :type string
           :custom string
           :documentation "The name of a person.")
     (birthday :initarg :birthday
               :initform "Jan 1, 1970"
               :custom string
               :type string
               :documentation "The person's birthday.")
     (phone :initarg :phone
            :initform ""
            :documentation "Phone number."))
    "A single record for tracking people I know.")

  (defmethod call-record ((rec record) &optional scriptname)
    (message "Dialing the phone for %s"  (oref rec name))
    (shell-command (concat (or scriptname "dialphone.sh")
                           " "
                           (oref rec phone)))))

Then do C-h f record RET. This makes an error. Here's the backtrace:

Debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil)
  eieio-help-class(record)
    class = record
    doc = (nil nil ((rec &optional scriptname)))
    counter = 2
    type = [":STATIC" ":BEFORE" ":PRIMARY" ":AFTER"]
    methods = (call-record)
    cur = ((rec &optional scriptname))
    --dolist-tail-- = (((rec &optional scriptname)))
    debugger-may-continue = t
    inhibit-redisplay = nil
    inhibit-debugger = t
  eieio-help-constructor(record)
    ctr = record
    def = (lambda (newname &rest slots) "Create a new object with name NAME of class type record" (apply (quote constructor) record newname slots))
    location = nil
  run-hook-with-args(eieio-help-constructor record)
    [no locals]
  describe-function-1(record)
    [no locals]
  describe-function(record)

The error comes from this part of the code:
	      (insert " " (aref type counter) " "
		      (prin1-to-string (car cur) (current-buffer))
		      "\n"
		      (cdr cur))

(cdr cur) is nil and can't be inserted

FWIW I did this to fix it :

	Modified   lisp/emacs-lisp/eieio-opt.el
diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el
index a502901..4e0470d 100644
--- a/lisp/emacs-lisp/eieio-opt.el
+++ b/lisp/emacs-lisp/eieio-opt.el
@@ -141,7 +141,7 @@ If CLASS is actually an object, then also display current values of that object.
 	      (insert " " (aref type counter) " "
 		      (prin1-to-string (car cur) (current-buffer))
 		      "\n"
-		      (cdr cur)))
+		      (or (cdr cur) "  Undocumented")))
 	    (setq counter (1+ counter))))
 	(insert "\n\n")
 	(setq methods (cdr methods))))))


In GNU Emacs 24.3.91.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2014-05-12 on geodiff-mac3
Windowing system distributor `The X.Org Foundation', version 11.0.11304000
System Description:	Gentoo Base System release 2.2

Configured using:
 `configure --with-x-toolkit=lucid --enable-checking 'CFLAGS= -O0 -g3''

Important settings:
  value of $LANG: fr_FR.UTF-8
  locale-coding-system: utf-8-unix

-- 
Nico.



This bug report was last modified 11 years and 67 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.