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: Thu, 7 Jul 2016 11:33:51 +0200 [thread overview]
Message-ID: <CAFgFV9MJ0cZsYKXQVTsatKf621i_WPfSNmnJ0bjD99No0pzG+w@mail.gmail.com> (raw)
In-Reply-To: <87shvmfoek.fsf@saiph.selenimh>
[-- Attachment #1.1: Type: text/plain, Size: 1135 bytes --]
Here a 2 very small patches for contrib/lisp/org-eldoc.el
Regards,
Fabrice
2016-07-06 23:27 GMT+02:00 Nicolas Goaziou <mail@nicolasgoaziou.fr>:
> Fabrice Popineau <fabrice.popineau@gmail.com> writes:
>
> > 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))))))))
>
> Wouldn't
>
> (when (functionp doc-fun) (funcall doc-fun))
>
> be enough?
>
> Also, would you provide a patch for this?
>
> Thank you.
>
> Regards,
>
[-- Attachment #1.2: Type: text/html, Size: 1789 bytes --]
[-- Attachment #2: 0001-The-doc-fun-object-may-be-a-function-object-and-not-.patch --]
[-- Type: application/octet-stream, Size: 986 bytes --]
From 23a20e70d81495bdea93f902d1d674c1f365aab3 Mon Sep 17 00:00:00 2001
From: Fabrice Popineau <fabrice.popineau@gmail.com>
Date: Thu, 7 Jul 2016 11:26:50 +0200
Subject: [PATCH] The doc-fun object may be a function object and not a symbol.
---
contrib/lisp/org-eldoc.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/lisp/org-eldoc.el b/contrib/lisp/org-eldoc.el
index ea12037..046918d 100644
--- a/contrib/lisp/org-eldoc.el
+++ b/contrib/lisp/org-eldoc.el
@@ -155,7 +155,7 @@
(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 (functionp doc-fun) (funcall doc-fun))))))))
;;;###autoload
(defun org-eldoc-load ()
--
2.9.0
base-commit: f55f7a1ccba127dfe9983eb9a4d1eea584f3ffd7
[-- Attachment #3: 0001-When-inserting-a-new-src-block-the-language-may-not-.patch --]
[-- Type: application/octet-stream, Size: 989 bytes --]
From f55f7a1ccba127dfe9983eb9a4d1eea584f3ffd7 Mon Sep 17 00:00:00 2001
From: Fabrice Popineau <fabrice.popineau@gmail.com>
Date: Thu, 7 Jul 2016 11:25:12 +0200
Subject: [PATCH] When inserting a new src block, the language may not yet be
chosen when this is called.
---
contrib/lisp/org-eldoc.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/lisp/org-eldoc.el b/contrib/lisp/org-eldoc.el
index 3b112a6..ea12037 100644
--- a/contrib/lisp/org-eldoc.el
+++ b/contrib/lisp/org-eldoc.el
@@ -74,7 +74,7 @@
(save-match-data
(when (looking-at "^[ \t]*#\\+\\(begin\\|end\\)_src")
(setq info (org-babel-get-src-block-info 'light)
- lang (propertize (nth 0 info) 'face 'font-lock-string-face)
+ lang (propertize (or (nth 0 info) "no lang") 'face 'font-lock-string-face)
hdr-args (nth 2 info))
(concat
lang
--
2.9.0
base-commit: 286b53e9d5dc7c3f6989715ef48814bdfaff6d04
next prev parent reply other threads:[~2016-07-07 9:34 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
2016-07-06 21:27 ` Nicolas Goaziou
2016-07-07 9:33 ` Fabrice Popineau [this message]
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=CAFgFV9MJ0cZsYKXQVTsatKf621i_WPfSNmnJ0bjD99No0pzG+w@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).