Re: slime-edit-definition from within of (defpackage )
Luís Oliveira <[email protected]> Fri, 2 Sep 2022 09:35:26 +0100
| Newsgroups | gmane.lisp.slime.devel |
|---|---|
| Message-ID | <CAB-HnLS310C5RHZ_xu=rRfQX=SADDd-cvoPReD+ktCiySq7k7A@mail.gmail.com> |
--00000000000041ad6805e7ad9de8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable That makes sense. There already exist other similar extensions to M-. that allow it to find local functions for instance. See the slime-mdot-fu contrib. Cheers, Lu=C3=ADs On Fri, 2 Sep 2022 at 03:43, Anton Vodonosov <[email protected]> wrote: > Hello. > > People may want to open package.lisp of some library to study the public > API, > and quickly navigate to definition of any symbol from the :export list, > in order to read the docstring. > > I use slime-edit-definition (with the M-. shortcut) for navigation to > docstrings. > > But that usually does not work from within of (defpackage ) form, > because slime determines the current package based on the (in-package) > at the top of the file and usually package files have > > (in-package :cl-user) > > (defpackage :some-lib > (:export #:some-function > #:another-function > ...)) > > > So when cursor stays on #:some-function and M-. is pressed > slime says "No known definition for: #:some-function (in :cl-user)" > > As a workaround I temporarily insert (in-pakcage :some-lib) above the > (defpackage ). > > But it would be convenient if slime understood that the within the :expor= t > option of defpackage the symbols belong to the package being defined > and not to the closest (in-package ). > > So that the proposal for consideration of the slime maintainers. > > Best regards, > - Anton > --=20 Lu=C3=ADs Oliveira https://kerno.org/~luis/ --00000000000041ad6805e7ad9de8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"auto">That makes sense. There already exist other similar exten= sions to M-. that allow it to find local functions for instance. See the sl= ime-mdot-fu contrib.</div><div dir=3D"auto"><br></div><div dir=3D"auto">Che= ers,</div><div dir=3D"auto">Lu=C3=ADs=C2=A0</div><div><br><div class=3D"gma= il_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, 2 Sep 2022 at 03:43= , Anton Vodonosov <<a href=3D"mailto:[email protected]">avodonosov@ya= ndex.ru</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"= margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padd= ing-left:1ex;border-left-color:rgb(204,204,204)"><div>Hello.</div><div>=C2= =A0</div><div>People may want to open package.lisp of some library to study= the public API,</div><div>and quickly navigate to definition of any symbol= from the :export list,</div><div>in order to read the docstring.</div><div= >=C2=A0</div><div>I use slime-edit-definition (with the M-. shortcut) for n= avigation to docstrings.</div><div>=C2=A0</div><div>But that usually does n= ot work from within of (defpackage ) form,</div><div>because slime determin= es the current package based on the (in-package)</div><div>at the top of th= e file and usually package files have</div><div>=C2=A0</div><div><div>=C2= =A0 =C2=A0(in-package :cl-user)</div><div><br>=C2=A0 =C2=A0(defpackage :som= e-lib</div><div>=C2=A0 =C2=A0 =C2=A0 (:export #:some-function</div><div>=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 #:anothe= r-function</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0...))</div><div>=C2=A0</div><div>=C2=A0</div><div>S= o when cursor stays on #:some-function and M-. is pressed</div><div>slime s= ays "No known definition for: #:some-function (in :cl-user)"</div= ><div>=C2=A0</div><div>As a workaround I temporarily insert (in-pakcage :so= me-lib) above the (defpackage ).</div><div>=C2=A0</div><div>But it would be= convenient if slime understood that the within the :export</div><div>optio= n of defpackage the symbols belong to the package being defined</div><div>a= nd not to the closest (in-package ).</div><div>=C2=A0</div><div>So that the= proposal for consideration of the slime maintainers.</div><div>=C2=A0</div= ><div>Best regards,</div><div>- Anton</div></div></blockquote></div></div>-= - <br><div dir=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"gmail_si= gnature"><div dir=3D"ltr">Lu=C3=ADs Oliveira<br><a href=3D"https://kerno.or= g/~luis/" target=3D"_blank">https://kerno.org/~luis/</a></div></div> --00000000000041ad6805e7ad9de8--