From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?55Sy5paQ5bi45Ly4?= Subject: Re: org-eldoc error on shell src blocks Date: Sun, 31 Mar 2019 17:53:36 +0900 Message-ID: References: <87o9l5tchz.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000f397a90585600a85" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:56880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAWDy-0002a0-Ef for emacs-orgmode@gnu.org; Sun, 31 Mar 2019 04:53:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hAWDx-0005n0-11 for emacs-orgmode@gnu.org; Sun, 31 Mar 2019 04:53:54 -0400 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]:35535) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hAWDw-0005mf-DQ for emacs-orgmode@gnu.org; Sun, 31 Mar 2019 04:53:52 -0400 Received: by mail-lf1-x144.google.com with SMTP id u21so4160472lfu.2 for ; Sun, 31 Mar 2019 01:53:51 -0700 (PDT) In-Reply-To: <87o9l5tchz.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: =?UTF-8?Q?=C5=81ukasz_Gruner?= , Org-mode --000000000000f397a90585600a85 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=E5=B9=B42=E6=9C=884=E6=97=A5(=E6=97=A5) 16:56 Nicolas Goaziou : > Hello, > > "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 (funcal= l > > 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 > > --000000000000f397a90585600a85 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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 "or= g-src-lang-modes" as below, the error disappeared.

=C2=A0=C2=A0= =C2=A0 (defun org-eldoc-get-mode-local-documentation-function (lang)
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 "Check if LANG-mode sets eldoc-documentati= on-function and return its value."
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (= let ((cached-func (gethash lang org-eldoc-local-functions-cache 'empty)= )
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (mo= de-func (org-src--get-lang-mode lang))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 doc-func)
=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 (if (eq 'empty cached-func)
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (when (fboundp mode-func)
=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= (with-temp-buffer
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (funcall mode-func)
=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 (setq doc-func (and eldoc-documentation-function
=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (symbol-value 'eldoc-documen= tation-function)))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (puthash lang doc-func org-eldoc-lo= cal-functions-cache))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 doc-func)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 cached-func)))

The practical change is a on= e line.

=C2=A0=C2=A0=C2=A0 diff --git a/contrib/lisp/org-eldoc.el b/= contrib/lisp/org-eldoc.el
=C2=A0=C2=A0=C2=A0 index 556b945..fca13c3 1006= 44
=C2=A0=C2=A0=C2=A0 --- a/contrib/lisp/org-eldoc.el
=C2=A0=C2=A0=C2= =A0 +++ b/contrib/lisp/org-eldoc.el
=C2=A0=C2=A0=C2=A0 @@ -110,7 +110,7 = @@
=C2=A0=C2=A0=C2=A0=C2=A0 (defun org-eldoc-get-mode-local-documentatio= n-function (lang)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "Check if LA= NG-mode sets eldoc-documentation-function and return its value."
= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (let ((cached-func (gethash lang org-e= ldoc-local-functions-cache 'empty))
=C2=A0=C2=A0=C2=A0 -=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (mode-func (intern-soft (format "%s-mod= e" lang)))
=C2=A0=C2=A0=C2=A0 +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 (mode-func (org-src--get-lang-mode lang))
=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 doc-func)
=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (if (eq 'empty cached-func)
= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (w= hen (fboundp mode-func)


I confirmed this change works good on th= e following two environments.

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

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


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=E5=B9=B42=E6=9C=884=E6= =97=A5(=E6=97=A5) 16:56 Nicolas Goaziou <mail@nicolasgoaziou.fr>:
Hello,

"numbchild@gm= ail.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 (funca= ll
> mode-func) ...`. This caused `shell-mode()`.
> - [ ] check out `org-eldoc.el` source code, have not found any solutio= n 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

--000000000000f397a90585600a85--