emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: 甲斐常伸 <kai2nenobu@gmail.com>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: "Łukasz Gruner" <lukasz@gruner.lu>, Org-mode <emacs-orgmode@gnu.org>
Subject: Re: org-eldoc error on shell src blocks
Date: Sun, 31 Mar 2019 17:53:36 +0900	[thread overview]
Message-ID: <CAGnt=MORy2JLzbN4EwdvWFV5vAtYNwmkbsaBiipWEr-O1aobiQ@mail.gmail.com> (raw)
In-Reply-To: <87o9l5tchz.fsf@nicolasgoaziou.fr>

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

Hello,

I encounted the same error and I found it happens because "org-eldoc.el"
doesn't reflect a value of "org-src-lang-modes". When I redefine
"org-eldoc-get-mode-local-documentation-function" to reflect a value of
"org-src-lang-modes" as below, the error disappeared.

    (defun org-eldoc-get-mode-local-documentation-function (lang)
      "Check if LANG-mode sets eldoc-documentation-function and return its
value."
      (let ((cached-func (gethash lang org-eldoc-local-functions-cache
'empty))
            (mode-func (org-src--get-lang-mode lang))
            doc-func)
        (if (eq 'empty cached-func)
            (when (fboundp mode-func)
              (with-temp-buffer
                (funcall mode-func)
                (setq doc-func (and eldoc-documentation-function
                                    (symbol-value
'eldoc-documentation-function)))
                (puthash lang doc-func org-eldoc-local-functions-cache))
              doc-func)
          cached-func)))

The practical change is a one line.

    diff --git a/contrib/lisp/org-eldoc.el b/contrib/lisp/org-eldoc.el
    index 556b945..fca13c3 100644
    --- a/contrib/lisp/org-eldoc.el
    +++ b/contrib/lisp/org-eldoc.el
    @@ -110,7 +110,7 @@
     (defun org-eldoc-get-mode-local-documentation-function (lang)
       "Check if LANG-mode sets eldoc-documentation-function and return its
value."
       (let ((cached-func (gethash lang org-eldoc-local-functions-cache
'empty))
    -        (mode-func (intern-soft (format "%s-mode" lang)))
    +        (mode-func (org-src--get-lang-mode lang))
             doc-func)
         (if (eq 'empty cached-func)
             (when (fboundp mode-func)


I confirmed this change works good on the following two environments.

- Emacs 26.1 on Windows 10
  - (emacs-version) ; GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+
Version 3.22.30) of 2018-05-29
  - (org-version) ; Org mode version 9.2.2 (9.2.2-13-g0007df-elpaplus @
/home/kai2nenobu/.emacs.d/elpa/org-plus-contrib-20190318/)

- Emacs 26.1 on Ubuntu 18.04 on WSL (on above Windows 10)
  - (emacs-version) ; GNU Emacs 26.1 (build 1, x86_64-w64-mingw32) of
2018-05-31
  - (org-version) ; Org mode version 9.2.1 (9.2.1-8-g1b1797-elpaplus @
c:/Users/kai2nenobu/.emacs.d/elpa/org-plus-contrib-20190211/)


I'm ready to contribute this patch, but I don't know how to contribute to
"org-eldoc.el". Please tell me how to do it.


Best Regards,


2018年2月4日(日) 16:56 Nicolas Goaziou <mail@nicolasgoaziou.fr>:

> Hello,
>
> "numbchild@gmail.com" <numbchild@gmail.com> writes:
>
> > After some dive in deeper
> >
> > - [X] emacs minimal init test, confirmed issue in org-mode.
> > - [X] from the error log, seems `org-eldoc` try to call `(progn (funcall
> > mode-func) ...`. This caused `shell-mode()`.
> > - [ ] check out `org-eldoc.el` source code, have not found any solution
> or
> > options.
>
> > Hope some org-mode hacker can help to fix this issue?
>
> I'm Cc'ing Org Eldoc author about it.
>
> > And this might be a unit test in Org-mode testing?
>
> We don't test contrib packages. However, they can provide their own
> tests.
>
> Regards,
>
> --
> Nicolas Goaziou
>
>

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

  reply	other threads:[~2019-03-31  8:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-02  1:32 org-eldoc error on shell src blocks numbchild
2018-02-04  7:42 ` numbchild
2018-02-04  7:55   ` Nicolas Goaziou
2019-03-31  8:53     ` 甲斐常伸 [this message]
2019-04-04 15:14       ` Takaaki Ishikawa
2019-04-07  7:18         ` 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='CAGnt=MORy2JLzbN4EwdvWFV5vAtYNwmkbsaBiipWEr-O1aobiQ@mail.gmail.com' \
    --to=kai2nenobu@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=lukasz@gruner.lu \
    --cc=mail@nicolasgoaziou.fr \
    /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).