unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19696: 24.4; python.el: blank line eldoc error
@ 2015-01-26 17:32 Carlos Pita
       [not found] ` <handler.19696.B.14222935664090.ack@debbugs.gnu.org>
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Carlos Pita @ 2015-01-26 17:32 UTC (permalink / raw)
  To: 19696; +Cc: galli.87

On blank lines eldoc shows the following message in the echo area:

eldoc error: (void-function nil)






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

* bug#19696: Acknowledgement (24.4; python.el: blank line eldoc error)
       [not found] ` <handler.19696.B.14222935664090.ack@debbugs.gnu.org>
@ 2015-02-03 23:23   ` Carlos Pita
  2015-02-04 15:25     ` Stefan Monnier
  0 siblings, 1 reply; 15+ messages in thread
From: Carlos Pita @ 2015-02-03 23:23 UTC (permalink / raw)
  To: 19696; +Cc: galli.87

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

X-Debbugs-CC: galli.87@gmail.com
Tags: patch

Advising eldoc-documentation-function sometimes resulted in a function
void symbol error. I don't know exactly why but the fact is that
eldoc-print-current-symbol-info error handler ended up printing "eldoc
error: ...". Anyway the approach seems to me a bit contorted so I
replaced the advice by a more conventional local variable and it seems
to work fine now.

[-- Attachment #2: eldoc.patch --]
[-- Type: text/x-patch, Size: 671 bytes --]

diff --git a/.emacs.d/lisp/python.el b/.emacs.d/lisp/python.el
index ce9ed96..4c8f4c6 100644
--- a/.emacs.d/lisp/python.el
+++ b/.emacs.d/lisp/python.el
@@ -4707,8 +4707,8 @@ Arguments START and END narrow the buffer region to work on."
                                                  (current-column))))
          (^ '(- (1+ (current-indentation))))))
 
-  (add-function :before-until (local 'eldoc-documentation-function)
-                #'python-eldoc-function)
+  (set (make-local-variable 'eldoc-documentation-function)
+       #'python-eldoc-function)
 
   (add-to-list 'hs-special-modes-alist
                `(python-mode "\\s-*\\(?:def\\|class\\)\\>" nil "#"

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

* bug#19696: Acknowledgement (24.4; python.el: blank line eldoc error)
  2015-02-03 23:23   ` bug#19696: Acknowledgement (24.4; python.el: blank line eldoc error) Carlos Pita
@ 2015-02-04 15:25     ` Stefan Monnier
  2015-02-04 18:01       ` Carlos Pita
  0 siblings, 1 reply; 15+ messages in thread
From: Stefan Monnier @ 2015-02-04 15:25 UTC (permalink / raw)
  To: Carlos Pita; +Cc: 19696, galli.87

> Advising eldoc-documentation-function sometimes resulted in a function
> void symbol error.

Can you show the exact error?


        Stefan





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

* bug#19696: Acknowledgement (24.4; python.el: blank line eldoc error)
  2015-02-04 15:25     ` Stefan Monnier
@ 2015-02-04 18:01       ` Carlos Pita
  2015-02-04 18:11         ` Carlos Pita
  0 siblings, 1 reply; 15+ messages in thread
From: Carlos Pita @ 2015-02-04 18:01 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 19696, Fabian Ezequiel Gallina

Sure Stefan.

This:


#[128 "\300\301^B\"\206^K^@\300\302^B\"\207" [apply
python-eldoc-function #[128 "\301\302\300!^B\"\207"
[eldoc-documentation-function apply default-value] 4 "

(fn &rest ARGS)"] nil] 4 nil]


is the content of eldoc-documentation-function at this point of execution:


     (if eldoc-documentation-function
         (eldoc-message (funcall eldoc-documentation-function))
      [...]


The error raised by the evaluation of the funcall is:


    Symbol's function definition is void: nil


And that triggers the message in the echo area:


    eldoc error: (void-function nil)





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

* bug#19696: Acknowledgement (24.4; python.el: blank line eldoc error)
  2015-02-04 18:01       ` Carlos Pita
@ 2015-02-04 18:11         ` Carlos Pita
  2015-02-04 18:35           ` Stefan Monnier
  0 siblings, 1 reply; 15+ messages in thread
From: Carlos Pita @ 2015-02-04 18:11 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 19696, Fabian Ezequiel Gallina

I'm not the expert here, but could it be that there is no previous
value for eldoc-documentation-function? I mean, from:

    (add-function WHERE PLACE FUNCTION &optional PROPS)

    Add a piece of advice on the function stored at PLACE.
    [...]
    `:before-until'    (lambda (&rest r) (or  (apply FUNCTION r)
(apply OLDFUN r)))

What is OLDFUN at the point where python.el advises it?:

  (add-function :before-until (local 'eldoc-documentation-function)
                #'python-eldoc-function)

It makes sense that if fails only when there is no symbol to get info
about, as (apply FUNCTION r) evals to nil and (apply OLDFUN r) gets
called, while OLDFUN has no value in its function cell.



On Wed, Feb 4, 2015 at 3:01 PM, Carlos Pita <carlosjosepita@gmail.com> wrote:
> Sure Stefan.
>
> This:
>
>
> #[128 "\300\301^B\"\206^K^@\300\302^B\"\207" [apply
> python-eldoc-function #[128 "\301\302\300!^B\"\207"
> [eldoc-documentation-function apply default-value] 4 "
>
> (fn &rest ARGS)"] nil] 4 nil]
>
>
> is the content of eldoc-documentation-function at this point of execution:
>
>
>      (if eldoc-documentation-function
>          (eldoc-message (funcall eldoc-documentation-function))
>       [...]
>
>
> The error raised by the evaluation of the funcall is:
>
>
>     Symbol's function definition is void: nil
>
>
> And that triggers the message in the echo area:
>
>
>     eldoc error: (void-function nil)





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

* bug#19696: Acknowledgement (24.4; python.el: blank line eldoc error)
  2015-02-04 18:11         ` Carlos Pita
@ 2015-02-04 18:35           ` Stefan Monnier
  2015-02-04 18:43             ` Carlos Pita
  0 siblings, 1 reply; 15+ messages in thread
From: Stefan Monnier @ 2015-02-04 18:35 UTC (permalink / raw)
  To: Carlos Pita; +Cc: 19696, Fabian Ezequiel Gallina

> I'm not the expert here, but could it be that there is no previous
> value for eldoc-documentation-function?

eldoc-documentation-function is defined in eldoc.el as:

    (defvar eldoc-documentation-function #'ignore
      ...)

and eldoc.el is preloaded, so the var should not be nil.

Which version of Emacs is that?  Your report seems to say Emacs-24.4,
but the add-function call in python.el is new in master, AFAICT.
Are you by any chance using the python.el from master with an
older Emacs?


        Stefan





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

* bug#19696: Acknowledgement (24.4; python.el: blank line eldoc error)
  2015-02-04 18:35           ` Stefan Monnier
@ 2015-02-04 18:43             ` Carlos Pita
  2015-02-04 18:59               ` Carlos Pita
  0 siblings, 1 reply; 15+ messages in thread
From: Carlos Pita @ 2015-02-04 18:43 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 19696, Fabian Ezequiel Gallina

When I initially reported this bug I was using an early build (post
24.4) of master. Now I'm at work with 24.4 and downloaded the latest
python.el from master just to answer you. But let me build the latest
master and try again.

On Wed, Feb 4, 2015 at 3:35 PM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> I'm not the expert here, but could it be that there is no previous
>> value for eldoc-documentation-function?
>
> eldoc-documentation-function is defined in eldoc.el as:
>
>     (defvar eldoc-documentation-function #'ignore
>       ...)
>
> and eldoc.el is preloaded, so the var should not be nil.
>
> Which version of Emacs is that?  Your report seems to say Emacs-24.4,
> but the add-function call in python.el is new in master, AFAICT.
> Are you by any chance using the python.el from master with an
> older Emacs?
>
>
>         Stefan





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

* bug#19696: Acknowledgement (24.4; python.el: blank line eldoc error)
  2015-02-04 18:43             ` Carlos Pita
@ 2015-02-04 18:59               ` Carlos Pita
  2015-02-04 19:34                 ` Stefan Monnier
  0 siblings, 1 reply; 15+ messages in thread
From: Carlos Pita @ 2015-02-04 18:59 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 19696, Fabian Ezequiel Gallina

You're right Stefan, my bad. I've been working quite a lot in
python.el and somehow mixed versions in the way (I use master at home
but 24.4 at work). The default is now #'ignore and the advise is to
advice eldoc-documentation-function. So feel free to close this.

On Wed, Feb 4, 2015 at 3:43 PM, Carlos Pita <carlosjosepita@gmail.com> wrote:
> When I initially reported this bug I was using an early build (post
> 24.4) of master. Now I'm at work with 24.4 and downloaded the latest
> python.el from master just to answer you. But let me build the latest
> master and try again.
>
> On Wed, Feb 4, 2015 at 3:35 PM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>>> I'm not the expert here, but could it be that there is no previous
>>> value for eldoc-documentation-function?
>>
>> eldoc-documentation-function is defined in eldoc.el as:
>>
>>     (defvar eldoc-documentation-function #'ignore
>>       ...)
>>
>> and eldoc.el is preloaded, so the var should not be nil.
>>
>> Which version of Emacs is that?  Your report seems to say Emacs-24.4,
>> but the add-function call in python.el is new in master, AFAICT.
>> Are you by any chance using the python.el from master with an
>> older Emacs?
>>
>>
>>         Stefan





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

* bug#19696: Acknowledgement (24.4; python.el: blank line eldoc error)
  2015-02-04 18:59               ` Carlos Pita
@ 2015-02-04 19:34                 ` Stefan Monnier
  2015-02-04 19:47                   ` Carlos Pita
  2015-02-04 22:38                   ` Fabián Ezequiel Gallina
  0 siblings, 2 replies; 15+ messages in thread
From: Stefan Monnier @ 2015-02-04 19:34 UTC (permalink / raw)
  To: Carlos Pita; +Cc: 19696, Fabian Ezequiel Gallina

> You're right Stefan, my bad. I've been working quite a lot in
> python.el and somehow mixed versions in the way (I use master at home
> but 24.4 at work). The default is now #'ignore and the advise is to
> advice eldoc-documentation-function. So feel free to close this.

OK, thanks.  I know that Fabián has worked on master's python.el using
an older version of Emacs (at some point in the past at least), so maybe
python.el should be fixed to handle that case (e.g. checking if
eldoc-documentation-function is nil before using `add-function' on it).


        Stefan





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

* bug#19696: Acknowledgement (24.4; python.el: blank line eldoc error)
  2015-02-04 19:34                 ` Stefan Monnier
@ 2015-02-04 19:47                   ` Carlos Pita
  2015-02-04 22:38                   ` Fabián Ezequiel Gallina
  1 sibling, 0 replies; 15+ messages in thread
From: Carlos Pita @ 2015-02-04 19:47 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 19696, Fabian Ezequiel Gallina

> OK, thanks.  I know that Fabián has worked on master's python.el using
> an older version of Emacs (at some point in the past at least), so maybe

Btw, now that we're on that subject. What would you advise to keep
things in sync? Specifically, I want to work on master so I clone it
and add a new online remote, say in gitlab/github/bitbucket, to keep
my local repos (home, work, laptop) in touch. The problem is the repo
is huge, so I make a shallow clone and some cleanup, and this indeed
ameliorates the size issue. The repo passes from huge to just big. But
still, I'm just working on one or two files at the time being... so
eventually I ended up deciding to only pull python.el and avoid the
full repo approach. I don't want to post noisy reports as this one but
it's difficult when you're not a fulltime emacs developer.





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

* bug#19696: Acknowledgement (24.4; python.el: blank line eldoc error)
  2015-02-04 19:34                 ` Stefan Monnier
  2015-02-04 19:47                   ` Carlos Pita
@ 2015-02-04 22:38                   ` Fabián Ezequiel Gallina
  2015-02-05  2:47                     ` Stefan Monnier
  1 sibling, 1 reply; 15+ messages in thread
From: Fabián Ezequiel Gallina @ 2015-02-04 22:38 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Carlos Pita, 19696, Fabian Ezequiel Gallina

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:
>
> OK, thanks.  I know that Fabián has worked on master's python.el using
> an older version of Emacs (at some point in the past at least), so maybe
> python.el should be fixed to handle that case (e.g. checking if
> eldoc-documentation-function is nil before using `add-function' on it).
>

I want to keep the master's python.el compatible with Emacs 24 to the
maximum extent possible, to the point that if something doesn't work
with Emacs 24.x, I consider it a bug.  I'll be checking this later on,
but mind you I'm not finding much hacking time lately, so don't hold
your breath.


Cheers,
Fabián






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

* bug#19696: Acknowledgement (24.4; python.el: blank line eldoc error)
  2015-02-04 22:38                   ` Fabián Ezequiel Gallina
@ 2015-02-05  2:47                     ` Stefan Monnier
  2015-02-05  9:09                       ` Fabián Ezequiel Gallina
  0 siblings, 1 reply; 15+ messages in thread
From: Stefan Monnier @ 2015-02-05  2:47 UTC (permalink / raw)
  To: Fabián Ezequiel Gallina; +Cc: Carlos Pita, 19696, Fabian Ezequiel Gallina

> I want to keep the master's python.el compatible with Emacs 24 to the
> maximum extent possible, to the point that if something doesn't work
> with Emacs 24.x, I consider it a bug.  I'll be checking this later on,
> but mind you I'm not finding much hacking time lately, so don't hold
> your breath.

I've just installed a patch which should fix this incompatibility.


        Stefan





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

* bug#19696: Acknowledgement (24.4; python.el: blank line eldoc error)
  2015-02-05  2:47                     ` Stefan Monnier
@ 2015-02-05  9:09                       ` Fabián Ezequiel Gallina
  0 siblings, 0 replies; 15+ messages in thread
From: Fabián Ezequiel Gallina @ 2015-02-05  9:09 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Carlos Pita, 19696

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

>> I want to keep the master's python.el compatible with Emacs 24 to the
>> maximum extent possible, to the point that if something doesn't work
>> with Emacs 24.x, I consider it a bug.  I'll be checking this later on,
>> but mind you I'm not finding much hacking time lately, so don't hold
>> your breath.
>
> I've just installed a patch which should fix this incompatibility.
>

Thanks Stefan!






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

* bug#19696: python.el: blank line eldoc error
  2015-01-26 17:32 bug#19696: 24.4; python.el: blank line eldoc error Carlos Pita
       [not found] ` <handler.19696.B.14222935664090.ack@debbugs.gnu.org>
@ 2015-02-09 15:56 ` Carlos Pita
  2015-02-10  2:54 ` Fabián Ezequiel Gallina
  2 siblings, 0 replies; 15+ messages in thread
From: Carlos Pita @ 2015-02-09 15:56 UTC (permalink / raw)
  To: 19696

It must have been set instead of setq.





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

* bug#19696: python.el: blank line eldoc error
  2015-01-26 17:32 bug#19696: 24.4; python.el: blank line eldoc error Carlos Pita
       [not found] ` <handler.19696.B.14222935664090.ack@debbugs.gnu.org>
  2015-02-09 15:56 ` bug#19696: python.el: blank line eldoc error Carlos Pita
@ 2015-02-10  2:54 ` Fabián Ezequiel Gallina
  2 siblings, 0 replies; 15+ messages in thread
From: Fabián Ezequiel Gallina @ 2015-02-10  2:54 UTC (permalink / raw)
  To: 19696-done


Fixed at revno 880415a in the master branch.


Cheers,
Fabián.





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

end of thread, other threads:[~2015-02-10  2:54 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-26 17:32 bug#19696: 24.4; python.el: blank line eldoc error Carlos Pita
     [not found] ` <handler.19696.B.14222935664090.ack@debbugs.gnu.org>
2015-02-03 23:23   ` bug#19696: Acknowledgement (24.4; python.el: blank line eldoc error) Carlos Pita
2015-02-04 15:25     ` Stefan Monnier
2015-02-04 18:01       ` Carlos Pita
2015-02-04 18:11         ` Carlos Pita
2015-02-04 18:35           ` Stefan Monnier
2015-02-04 18:43             ` Carlos Pita
2015-02-04 18:59               ` Carlos Pita
2015-02-04 19:34                 ` Stefan Monnier
2015-02-04 19:47                   ` Carlos Pita
2015-02-04 22:38                   ` Fabián Ezequiel Gallina
2015-02-05  2:47                     ` Stefan Monnier
2015-02-05  9:09                       ` Fabián Ezequiel Gallina
2015-02-09 15:56 ` bug#19696: python.el: blank line eldoc error Carlos Pita
2015-02-10  2:54 ` Fabián Ezequiel Gallina

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