emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Fabrice Popineau <fabrice.popineau@gmail.com>
To: Fabrice Popineau <fabrice.popineau@gmail.com>,
	"emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Problem with eldoc and Python
Date: Wed, 6 Jul 2016 23:04:11 +0200	[thread overview]
Message-ID: <CAFgFV9PAG2RG7cXriHCytoHyAXtATzXzO=1gs4QwGLRhTcHUZA@mail.gmail.com> (raw)
In-Reply-To: <8760sih53f.fsf@saiph.selenimh>

[-- Attachment #1: Type: text/plain, Size: 2405 bytes --]

2016-07-06 22:41 GMT+02:00 Nicolas Goaziou <mail@nicolasgoaziou.fr>:

> Hello,
>
> Fabrice Popineau <fabrice.popineau@gmail.com> writes:
>
> > Am I alone to see this recently:
> >
> > insert an src python block with <s Tab python
> > moving inside the src block
> > and then some timer function breaking with:
> >
> > Debugger entered--Lisp error: (wrong-type-argument symbolp #[128
> "\300\301
> > \"\206 ... [eldoc-documentation-function apply default-value] 4 "
> > (fn &rest ARGS)"] nil] 4 nil])
> >   fboundp(#[128 "\300\301...[apply python-eldoc-function #[128
> > "\301\302\300!^B\"\207" [eldoc-documentation-function apply
> default-value]
> > 4 "\n\n(fn &rest ARGS)"] nil] 4 nil])
> >   org-eldoc-documentation-function()
> >   eldoc-print-current-symbol-info()
> > ...
> > timer-event-handler([t 0 0 500000 nil #[0 "... [eldoc-mode
> > global-eldoc-mode eldoc-documentation-function (nil ignore)
> > eldoc-print-current-symbol-info] 2] nil idle 0])
> >
> > This is with the latest emacs-25 "soon to be released" and the latest Org
> > mode.
> >
> > Any help appreciated.
>
> Could you send a backtrace with non byte-compiled code?
>
>
Hi Nicolas,

The problem is that the byte code comes from Python mode.
I solved the problem with this:

$ diff -uw contrib/lisp/org-eldoc.el contrib/lisp/org-eldoc.el
--- contrib/lisp/org-eldoc.el   2016-02-29 11:13:22.330099500 +0100
+++ contrib/lisp/org-eldoc.el   2016-07-04 07:11:10.466144400 +0200
@@ -155,7 +155,8 @@
              (string= lang "golang")) (when (require 'go-eldoc nil t)

 (go-eldoc--documentation-function)))
            (t (let ((doc-fun
(org-eldoc-get-mode-local-documentation-function lang)))
-                (when (fboundp doc-fun) (funcall doc-fun))))))))
+                (when (or (and (symbolp doc-fun) (fboundp doc-fun))
+                         (functionp doc-fun)) (funcall doc-fun))))))))

 ;;;###autoload
 (defun org-eldoc-load ()



In python.el, one can find this around line 5129:

  (if (null eldoc-documentation-function)
      ;; Emacs<25
      (set (make-local-variable 'eldoc-documentation-function)
           #'python-eldoc-function)
    (add-function :before-until (local 'eldoc-documentation-function)
                  #'python-eldoc-function))

which stores byte code in eldoc-documentation-function, which makes
fboundp fail because the object is not a symbol. However it is a function.

Regards,

Fabrice

[-- Attachment #2: Type: text/html, Size: 3696 bytes --]

  reply	other threads:[~2016-07-06 21:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-03 22:09 Problem with eldoc and Python Fabrice Popineau
2016-07-06 20:41 ` Nicolas Goaziou
2016-07-06 21:04   ` Fabrice Popineau [this message]
2016-07-06 21:27     ` Nicolas Goaziou
2016-07-07  9:33       ` Fabrice Popineau
2016-07-07 10:21         ` Nicolas Goaziou

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.orgmode.org/

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

  git send-email \
    --in-reply-to='CAFgFV9PAG2RG7cXriHCytoHyAXtATzXzO=1gs4QwGLRhTcHUZA@mail.gmail.com' \
    --to=fabrice.popineau@gmail.com \
    --cc=emacs-orgmode@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/org-mode.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).