From mboxrd@z Thu Jan 1 00:00:00 1970 From: "numbchild@gmail.com" Subject: Re: org-eldoc error on shell src blocks Date: Sun, 4 Feb 2018 15:42:18 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c094be89364f605645e17d5" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiEwu-0000ZB-JF for emacs-orgmode@gnu.org; Sun, 04 Feb 2018 02:42:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eiEws-0001aB-ES for emacs-orgmode@gnu.org; Sun, 04 Feb 2018 02:42:52 -0500 Received: from mail-oi0-x233.google.com ([2607:f8b0:4003:c06::233]:42352) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eiEws-0001Zs-5O for emacs-orgmode@gnu.org; Sun, 04 Feb 2018 02:42:50 -0500 Received: by mail-oi0-x233.google.com with SMTP id c8so19103765oiy.9 for ; Sat, 03 Feb 2018 23:42:49 -0800 (PST) In-Reply-To: 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: Org-mode --94eb2c094be89364f605645e17d5 Content-Type: text/plain; charset="UTF-8" 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? And this might be a unit test in Org-mode testing? [stardiviner] GPG key ID: 47C32433 IRC(freeenode): stardiviner Twitter: @numbchild Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 Blog: http://stardiviner.github.io/ On Fri, Feb 2, 2018 at 9:32 AM, numbchild@gmail.com wrote: > When I enable `eldoc-mode` in org-mode. > eldoc timer running when on `shell` src blocks like: > > #+begin_src shell > git log $rev..origin/emacs-25 -- lisp/org doc/misc/org.texi \ > etc/refcards/orgcard.tex etc/ORG-NEWS etc/org \ > etc/schema/od-manifest-schema-v1.2-os.rnc \ > etc/schema/od-schema-v1.2-os.rnc > #+end_src > > I got the following error. > > #+begin_example > Debugger entered--Lisp error: (wrong-type-argument processp nil) > process-command(nil) > shell-mode() > funcall(shell-mode) > (progn (funcall mode-func) (setq doc-func (and > eldoc-documentation-function (symbol-value 'eldoc-documentation-function))) > (puthash lang doc-func org-eldoc-local-functions-cache)) > (unwind-protect (progn (funcall mode-func) (setq doc-func (and > eldoc-documentation-function (symbol-value 'eldoc-documentation-function))) > (puthash lang doc-func org-eldoc-local-functions-cache)) (and > (buffer-name temp-buffer) (kill-buffer temp-buffer))) > (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn > (funcall mode-func) (setq doc-func (and eldoc-documentation-function > (symbol-value 'eldoc-documentation-function))) (puthash lang doc-func > org-eldoc-local-functions-cache)) (and (buffer-name temp-buffer) > (kill-buffer temp-buffer)))) > (let ((temp-buffer (generate-new-buffer " *temp*"))) > (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn > (funcall mode-func) (setq doc-func (and eldoc-documentation-function > (symbol-value 'eldoc-documentation-function))) (puthash lang doc-func > org-eldoc-local-functions-cache)) (and (buffer-name temp-buffer) > (kill-buffer temp-buffer))))) > (progn (let ((temp-buffer (generate-new-buffer " *temp*"))) > (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn > (funcall mode-func) (setq doc-func (and eldoc-documentation-function > (symbol-value 'eldoc-documentation-function))) (puthash lang doc-func > org-eldoc-local-functions-cache)) (and (buffer-name temp-buffer) > (kill-buffer temp-buffer))))) doc-func) > (if (fboundp mode-func) (progn (let ((temp-buffer (generate-new-buffer " > *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect > (progn (funcall mode-func) (setq doc-func (and eldoc-documentation-function > (symbol-value 'eldoc-documentation-function))) (puthash lang doc-func > org-eldoc-local-functions-cache)) (and (buffer-name temp-buffer) > (kill-buffer temp-buffer))))) doc-func)) > (if (eq 'empty cached-func) (if (fboundp mode-func) (progn (let > ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer > (set-buffer temp-buffer) (unwind-protect (progn (funcall mode-func) (setq > doc-func (and eldoc-documentation-function (symbol-value > 'eldoc-documentation-function))) (puthash lang doc-func > org-eldoc-local-functions-cache)) (and (buffer-name temp-buffer) > (kill-buffer temp-buffer))))) doc-func)) cached-func) > (let ((cached-func (gethash lang org-eldoc-local-functions-cache > 'empty)) (mode-func (intern-soft (format "%s-mode" lang))) doc-func) (if > (eq 'empty cached-func) (if (fboundp mode-func) (progn (let ((temp-buffer > (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer > temp-buffer) (unwind-protect (progn (funcall mode-func) (setq doc-func (and > eldoc-documentation-function (symbol-value 'eldoc-documentation-function))) > (puthash lang doc-func org-eldoc-local-functions-cache)) (and > (buffer-name temp-buffer) (kill-buffer temp-buffer))))) doc-func)) > cached-func)) > org-eldoc-get-mode-local-documentation-function("shell") > (let ((doc-fun (org-eldoc-get-mode-local-documentation-function lang))) > (if (functionp doc-fun) (progn (funcall doc-fun)))) > (cond ((or (string= lang "emacs-lisp") (string= lang "elisp")) (if > (fboundp 'elisp-eldoc-documentation-function) (elisp-eldoc-documentation-function) > (let (eldoc-documentation-function) (eldoc-print-current-symbol-info)))) > ((or (string= lang "c") (string= lang "C")) (if (require 'c-eldoc nil t) > (progn (c-eldoc-print-current-symbol-info)))) ((string= lang "css") (if > (require 'css-eldoc nil t) (progn (css-eldoc-function)))) ((string= lang > "php") (if (require 'php-eldoc nil t) (progn (php-eldoc-function)))) ((or > (string= lang "go") (string= lang "golang")) (if (require 'go-eldoc nil t) > (progn (go-eldoc--documentation-function)))) (t (let ((doc-fun > (org-eldoc-get-mode-local-documentation-function lang))) (if (functionp > doc-fun) (progn (funcall doc-fun)))))) > (let ((lang (org-eldoc-get-src-lang))) (cond ((or (string= lang > "emacs-lisp") (string= lang "elisp")) (if (fboundp > 'elisp-eldoc-documentation-function) (elisp-eldoc-documentation-function) > (let (eldoc-documentation-function) (eldoc-print-current-symbol-info)))) > ((or (string= lang "c") (string= lang "C")) (if (require 'c-eldoc nil t) > (progn (c-eldoc-print-current-symbol-info)))) ((string= lang "css") (if > (require 'css-eldoc nil t) (progn (css-eldoc-function)))) ((string= lang > "php") (if (require 'php-eldoc nil t) (progn (php-eldoc-function)))) ((or > (string= lang "go") (string= lang "golang")) (if (require 'go-eldoc nil t) > (progn (go-eldoc--documentation-function)))) (t (let ((doc-fun > (org-eldoc-get-mode-local-documentation-function lang))) (if (functionp > doc-fun) (progn (funcall doc-fun))))))) > (or (org-eldoc-get-breadcrumb) (org-eldoc-get-src-header) (let ((lang > (org-eldoc-get-src-lang))) (cond ((or (string= lang "emacs-lisp") (string= > lang "elisp")) (if (fboundp 'elisp-eldoc-documentation-function) > (elisp-eldoc-documentation-function) (let (eldoc-documentation-function) > (eldoc-print-current-symbol-info)))) ((or (string= lang "c") (string= > lang "C")) (if (require 'c-eldoc nil t) (progn > (c-eldoc-print-current-symbol-info)))) ((string= lang "css") (if (require > 'css-eldoc nil t) (progn (css-eldoc-function)))) ((string= lang "php") (if > (require 'php-eldoc nil t) (progn (php-eldoc-function)))) ((or (string= > lang "go") (string= lang "golang")) (if (require 'go-eldoc nil t) (progn > (go-eldoc--documentation-function)))) (t (let ((doc-fun > (org-eldoc-get-mode-local-documentation-function lang))) (if (functionp > doc-fun) (progn (funcall doc-fun)))))))) > org-eldoc-documentation-function() > eldoc-print-current-symbol-info() > #f(compiled-function () #)() > apply(#f(compiled-function () #) nil) > timer-event-handler([t 0 0 500000 nil #f(compiled-function () # 0x27fd5d>) nil idle 0]) > #+end_example > > > [stardiviner] GPG key ID: 47C32433 > IRC(freeenode): stardiviner Twitter: @numbchild > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 > Blog: http://stardiviner.github.io/ > --94eb2c094be89364f605645e17d5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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-e= ldoc.el` source code, have not found any solution or options.
=
Hope some org-mode hacker can help to fix this issue?
And this might be a unit test in Org-mode testing?

[stardiviner]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= <Hack this world!>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 GPG key ID: 47C3243= 3
IRC(freeenode): stardiviner =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 Tw= itter:=C2=A0 @numbchild
Key fingerprint =3D 9BAA 92BC CDDD B9EF 3B36=C2= =A0 CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Fri, Feb 2, 2018 at 9:32 AM, numbchild@gmail.com <numbchild@gmail.com<= /a>> wrote:
When I enable `eldoc-mode` in org-mode.
eldoc timer running when on `shell` src block= s like:

#+begin_src shell
=C2=A0 git log $rev..origin/emacs-25 --= lisp/org doc/misc/org.texi \
=C2=A0=C2=A0=C2=A0 etc/refcards/orgcard.te= x etc/ORG-NEWS etc/org \
=C2=A0=C2=A0=C2=A0 etc/schema/od-manifest-schem= a-v1.2-os.rnc \
=C2=A0=C2=A0=C2=A0 etc/schema/od-schema-v1.2-os.rnc
#+end_src

I got the foll= owing error.

#+begin_example
D= ebugger entered--Lisp error: (wrong-type-argument processp nil)
=C2=A0 p= rocess-command(nil)
=C2=A0 shell-mode()
=C2=A0 funcall(shell-mode)=C2=A0 (progn (funcall mode-func) (setq doc-func (and eldoc-documentation-= function (symbol-value 'eldoc-documentation-function))) (puthash l= ang doc-func org-eldoc-local-functions-cache))
=C2=A0 (unwind-prote= ct (progn (funcall mode-func) (setq doc-func (and eldoc-documentation-funct= ion (symbol-value 'eldoc-documentation-function))) (puthash lang d= oc-func org-eldoc-local-functions-cache)) (and (buffer-name temp-buffe= r) (kill-buffer temp-buffer)))
=C2=A0 (save-current-buffer (set-buffer t= emp-buffer) (unwind-protect (progn (funcall mode-func) (setq doc-func (and = eldoc-documentation-function (symbol-value 'eldoc-documentation-functio= n))) (puthash lang doc-func org-eldoc-local-functions-cache)) (an= d (buffer-name temp-buffer) (kill-buffer temp-buffer))))
=C2=A0 (let ((t= emp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer= (set-buffer temp-buffer) (unwind-protect (progn (funcall mode-func) (setq = doc-func (and eldoc-documentation-function (symbol-value 'eldoc-documen= tation-function))) (puthash lang doc-func org-eldoc-local-functions-cache)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
= =C2=A0 (progn (let ((temp-buffer (generate-new-buffer " *temp*"))= ) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (fun= call mode-func) (setq doc-func (and eldoc-documentation-function (symbol-va= lue 'eldoc-documentation-function))) (puthash lang doc-func org-el= doc-local-functions-cache)) (and (buffer-name temp-buffer) (kill-buffe= r temp-buffer))))) doc-func)
=C2=A0 (if (fboundp mode-func) (progn (let = ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buf= fer (set-buffer temp-buffer) (unwind-protect (progn (funcall mode-func) (se= tq doc-func (and eldoc-documentation-function (symbol-value 'eldoc-docu= mentation-function))) (puthash lang doc-func org-eldoc-local-functions= -cache)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) = doc-func))
=C2=A0 (if (eq 'empty cached-func) (if (fboundp mode-func= ) (progn (let ((temp-buffer (generate-new-buffer " *temp*"))) (sa= ve-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (funcall = mode-func) (setq doc-func (and eldoc-documentation-function (symbol-value &= #39;eldoc-documentation-function))) (puthash lang doc-func org-eldoc-l= ocal-functions-cache)) (and (buffer-name temp-buffer) (kill-buffer tem= p-buffer))))) doc-func)) cached-func)
=C2=A0 (let ((cached-func (gethash= lang org-eldoc-local-functions-cache 'empty)) (mode-func (intern-= soft (format "%s-mode" lang))) doc-func) (if (eq 'empty cache= d-func) (if (fboundp mode-func) (progn (let ((temp-buffer (generate-new-buf= fer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (u= nwind-protect (progn (funcall mode-func) (setq doc-func (and eldoc-document= ation-function (symbol-value 'eldoc-documentation-function))) (put= hash lang doc-func org-eldoc-local-functions-cache)) (and (buffer-name= temp-buffer) (kill-buffer temp-buffer))))) doc-func)) cached-func))
=C2= =A0 org-eldoc-get-mode-local-documentation-function("shell"<= wbr>)
=C2=A0 (let ((doc-fun (org-eldoc-get-mode-local-documentation= -function lang))) (if (functionp doc-fun) (progn (funcall doc-fun))))
= =C2=A0 (cond ((or (string=3D lang "emacs-lisp") (string=3D lang &= quot;elisp")) (if (fboundp 'elisp-eldoc-documentation-functio= n) (elisp-eldoc-documentation-function) (let (eldoc-documentation-func= tion) (eldoc-print-current-symbol-info)))) ((or (string=3D lang "= c") (string=3D lang "C")) (if (require 'c-eldoc nil t) (= progn (c-eldoc-print-current-symbol-info)))) ((string=3D lang "cs= s") (if (require 'css-eldoc nil t) (progn (css-eldoc-function)))) = ((string=3D lang "php") (if (require 'php-eldoc nil t) (progn= (php-eldoc-function)))) ((or (string=3D lang "go") (string=3D la= ng "golang")) (if (require 'go-eldoc nil t) (progn (go-eldoc-= -documentation-function)))) (t (let ((doc-fun (org-eldoc-get-mode-loca= l-documentation-function lang))) (if (functionp doc-fun) (progn (funca= ll doc-fun))))))
=C2=A0 (let ((lang (org-eldoc-get-src-lang))) (cond ((o= r (string=3D lang "emacs-lisp") (string=3D lang "elisp"= )) (if (fboundp 'elisp-eldoc-documentation-function) (elisp-eldoc-= documentation-function) (let (eldoc-documentation-function) (eldoc-pri= nt-current-symbol-info)))) ((or (string=3D lang "c") (string= =3D lang "C")) (if (require 'c-eldoc nil t) (progn (c-eldoc-p= rint-current-symbol-info)))) ((string=3D lang "css") (if (re= quire 'css-eldoc nil t) (progn (css-eldoc-function)))) ((string=3D lang= "php") (if (require 'php-eldoc nil t) (progn (php-eldoc-func= tion)))) ((or (string=3D lang "go") (string=3D lang "golang&= quot;)) (if (require 'go-eldoc nil t) (progn (go-eldoc--documentation-<= wbr>function)))) (t (let ((doc-fun (org-eldoc-get-mode-local-documenta= tion-function lang))) (if (functionp doc-fun) (progn (funcall doc-fun))))))= )
=C2=A0 (or (org-eldoc-get-breadcrumb) (org-eldoc-get-src-header) (let = ((lang (org-eldoc-get-src-lang))) (cond ((or (string=3D lang "emacs-li= sp") (string=3D lang "elisp")) (if (fboundp 'elisp-eldoc= -documentation-function) (elisp-eldoc-documentation-function) (le= t (eldoc-documentation-function) (eldoc-print-current-symbol-info)))) = ((or (string=3D lang "c") (string=3D lang "C")) (if (re= quire 'c-eldoc nil t) (progn (c-eldoc-print-current-symbol-info)))= ) ((string=3D lang "css") (if (require 'css-eldoc nil t) (pro= gn (css-eldoc-function)))) ((string=3D lang "php") (if (require &= #39;php-eldoc nil t) (progn (php-eldoc-function)))) ((or (string=3D lang &q= uot;go") (string=3D lang "golang")) (if (require 'go-eld= oc nil t) (progn (go-eldoc--documentation-function)))) (t (let ((doc-f= un (org-eldoc-get-mode-local-documentation-function lang))) (if (funct= ionp doc-fun) (progn (funcall doc-fun))))))))
=C2=A0 org-eldoc-documenta= tion-function()
=C2=A0 eldoc-print-current-symbol-info()
= =C2=A0 #f(compiled-function () #<bytecode 0x27fd5d>)()
=C2=A0 appl= y(#f(compiled-function () #<bytecode 0x27fd5d>) nil)
=C2=A0 timer-= event-handler([t 0 0 500000 nil #f(compiled-function () #<bytecode 0x27f= d5d>) nil idle 0])
#+end_example


=
<= div dir=3D"ltr">[stardiviner]=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 <Hack this world!>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 GPG = key ID: 47C32433
IRC(freeenode): stardiviner =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 Twitter:=C2=A0 @numbchild
Key fingerprint =3D 9BAA 92BC CDD= D B9EF 3B36=C2=A0 CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/
<= /div>

--94eb2c094be89364f605645e17d5--