From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takaaki Ishikawa Subject: Re: org-eldoc error on shell src blocks Date: Fri, 5 Apr 2019 00:14:13 +0900 Message-ID: References: <87o9l5tchz.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Content-Type: multipart/signed; boundary="Apple-Mail=_C1541A74-C84F-4B8B-A5C8-5405A3E66100"; protocol="application/pgp-signature"; micalg=pgp-sha512 Return-path: Received: from eggs.gnu.org ([209.51.188.92]:53521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hC44N-0005zr-Au for emacs-orgmode@gnu.org; Thu, 04 Apr 2019 11:14:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hC44M-0001cc-2G for emacs-orgmode@gnu.org; Thu, 04 Apr 2019 11:14:23 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:37784) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hC44L-0001Xg-Hp for emacs-orgmode@gnu.org; Thu, 04 Apr 2019 11:14:22 -0400 Received: by mail-pg1-x543.google.com with SMTP id e6so1399340pgc.4 for ; Thu, 04 Apr 2019 08:14:20 -0700 (PDT) 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: =?utf-8?B?55Sy5paQ5bi45Ly4?= Cc: =?utf-8?Q?=C5=81ukasz_Gruner?= , Org-mode , Nicolas Goaziou --Apple-Mail=_C1541A74-C84F-4B8B-A5C8-5405A3E66100 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi folks, I just verified the proposed patch to org-eldoc.el in contrib dir, works = well. But the problem is we lost an appropriate contact point because https://bitbucket.org/ukaszg/org-eldoc was removed. Who can amend org-eldoc.el in contribution directory? Best regards, Takaaki > On Mar 31, 2019, at 17:53, =E7=94=B2=E6=96=90=E5=B8=B8=E4=BC=B8 = wrote: >=20 > Hello, >=20 > 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. >=20 > (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))) >=20 > The practical change is a one line. >=20 > 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) >=20 >=20 > I confirmed this change works good on the following two environments. >=20 > - 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/) >=20 > - 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/) >=20 >=20 > 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. >=20 >=20 > Best Regards, >=20 >=20 > 2018=E5=B9=B42=E6=9C=884=E6=97=A5(=E6=97=A5) 16:56 Nicolas Goaziou = : > Hello, >=20 > "numbchild@gmail.com" writes: >=20 > > 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. >=20 > > Hope some org-mode hacker can help to fix this issue? >=20 > I'm Cc'ing Org Eldoc author about it. >=20 > > And this might be a unit test in Org-mode testing? >=20 > We don't test contrib packages. However, they can provide their own > tests. >=20 > Regards, >=20 > -- > Nicolas Goaziou >=20 --Apple-Mail=_C1541A74-C84F-4B8B-A5C8-5405A3E66100 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEqm9vEitqoHWiBnEaGlP/TOZY7DoFAlymH0UACgkQGlP/TOZY 7Dr2uw/+LFJ1KSvJn2I+yCws9qw3eXSzjg6G4M+4ZgmOpPt1zLhfhF7nbijAwWY4 AeyhsMZtd/1DQP5+XxOT7axZ83KGR+1LuO8ZTRX3+b5+ZAr+9PJ/D6UXxlAx0hm4 V2ELMTVIpUdyNQGJZ1pAO4mBPmoJ3foTsyOrNwwSKWk08guCoBrF3/H1+ULeV/oo JO8fuv5v1DXrlt7I9UwhIdfmei3VvWQU30Cdt/SNmaG68QcUiGMFNB9v1BrcGC6B p1nK9h3fF5GqClakfLBQ6dcDdOGZBbAKbz9d4riYBUDzulGrSHphFOEmt5Bd+qeE KvPf0m9TjRdvzwjHigUAthnMBemVCRin8BEtI6+mVGqr24OmarK0N+NqaD+fBSPG b6K4iJmhpykXL7F/B3Fh36FX0ntDK7Lsb+3xLqGUS3padBCe5Gq8qRvpx6ciD+zV gSreSDjXep4V+IHNmQvxE3sKtC2TN/ZrFX/PgqcaF4cGTZ/ZKpEAlAOSfvu1O6j+ v1DHkAqHZhcS3+4NIYRFaiYxxO+OPEyVOewwrmFxtin1k9P7d6Jmel00Ou1xIaPX 9E0cqKqVJvOUtq5itIM0DVEtRLUs+w4GhdMeWwDGB8CIZceFadXKCR+7OgOrnLWy 6UgynqT4o2eRUCCrqXoM2npiNWJrWJMrb4oM5rxV6U+Dub0jfIo= =FIF/ -----END PGP SIGNATURE----- --Apple-Mail=_C1541A74-C84F-4B8B-A5C8-5405A3E66100--