jacktasia / dumb-jump

an Emacs "jump to definition" package for 50+ languages
GNU General Public License v3.0
1.57k stars 150 forks source link

add org src block feature #411

Open Pierre-Andre opened 2 years ago

Pierre-Andre commented 2 years ago

This PR aims at providing a dumb-jump "definition search" in org-mode src-block. It closes (in some way) issue #135.

phikal commented 2 years ago

I don't think that fixing "unrelated" checkdoc issues should be part of this pull request.

Pierre-Andre commented 2 years ago

I have undone all "unrelated checkdoc issues" on my local repos. I can push it if needed.

phikal commented 2 years ago

That would be nice.

On 29 January 2022 15:27:31 CET, Pierre-Andre @.***> wrote:

I have undone all "unrelated checkdoc issues" on my local repos. I can push it if needed.

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

jacktasia commented 2 years ago

Looks like the 24.x tests are failing with

Symbol's value as variable is void: org-src--beg-marker

phikal commented 2 years ago

Using (org-)internal variables is bound to trigger issues eventually, but I don't know enough about Org internals to understand what they are being used for. Is there any alternative to using these variables directly? Having dumb-jump depend on a newer version of org would be a sad solution.

Pierre-Andre commented 2 years ago

I will investigate on a better solution. I apologize  for this proposal that needs to be fine-tuned.

5 févr. 2022 22:55:20 Philip @.***>:

Using (org-)internal variables is bound to trigger issues eventually, but I don't know enough about Org internals to understand what they are being used for. Is there any alternative to using these variables directly? Having dumb-jump depend on a newer version of org would be a sad solution.

— Reply to this email directly, view it on GitHub[https://github.com/jacktasia/dumb-jump/pull/411#issuecomment-1030705567], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AFOUQVFH3HWIE4BR5IN6G6TUZWMEPANCNFSM5MH5KNXQ]. Triage notifications on the go with GitHub Mobile for iOS[https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675] or Android[https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub]. You are receiving this because you authored the thread. [data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAABCCAYAAADjVADoAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAAnSURBVHic7cEBDQAAAMKg909tDwcUAAAAAAAAAAAAAAAAAAAAAPBjRFIAASHKmKkAAAAASUVORK5CYII=###24x24:true###][Image de pistage][https://github.com/notifications/beacon/AFOUQVCMNO3GNOGTVQLVFODUZWMEPA5CNFSM5MH5KNX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHVXVDHY.gif]

jacktasia commented 2 years ago

The 24.x tests hung. Retriggering them

Pierre-Andre commented 2 years ago

Well I need to set up a docker image of emacs 24.5 and 24.4 to understand what's going on. It will take much more time…

Pierre-Andre commented 2 years ago

emacs 24.x tests hung because

  1. silversearch-ag version is too old (2.1.0 needed) -> fix: test are done with rg using dumb-jump-force-searcher
  2. org-version is less than 9 and it implies that
    • there is a bug in org-edit-src-exit : when a src-edit buffer is openned with org-edit-src-code and no change is made and the src-buffer is closed with org-edit-src-exit the org buffer is seen (wrongly) as modified -> fix: I added (save-buffer) for these versions
    • there another bug in dumb-jump determination of project-root and the test cannot be done properly -> fix: I set dumb-jump-project

I hope that all will be fixed but as docker tests with 24.5 does not work at all I cannot be sure…

Pierre-Andre commented 2 years ago

Using the following Dockerfile

FROM debian
## basic downloads clients
RUN apt-get update && \
    apt-get --no-install-recommends install -y \
         ca-certificates \
         curl \
         git \
         openssh-client \
    && rm -rf /var/lib/apt/lists/*

## for emacs building process
RUN apt-get update && \
    apt-get --no-install-recommends install -y \
        autoconf \
        autogen \
        gcc \
        libgnutls28-dev \
        libncurses-dev \
        make \
        pkg-config \
        texinfo \
    && rm -rf /var/lib/apt/lists/*

######## silvergrep
RUN apt-get update && \
    apt-get --no-install-recommends install -y \
        silversearcher-ag  \
    && rm -rf /var/lib/apt/lists/*

######## ripgrep
RUN curl -LO https://github.com/BurntSushi/ripgrep/releases/download/0.10.0/ripgrep_0.10.0_amd64.deb && dpkg -i ripgrep_0.10.0_amd64.deb && rm ripgrep_0.10.0_amd64.deb && rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true

######## Emacs
RUN cd / && mkdir -p /src && cd /src \
  && git clone --depth 1 git://git.sv.gnu.org/emacs.git emacs
 RUN cd /src/emacs   \
     && ./autogen.sh \
     && ./configure  --without-gif\
                          --with-x-toolkit=no \
                          --without-x \
                          --without-all \
                          --with-gnutls \
                          --prefix="/usr/local" \
     && make  && make install
# #
# ######### Cask
ENV PATH="/root/.cask/bin:$PATH"
RUN mkdir -p /CASK && cd /CASK \
     && git clone https://github.com/cask/cask /CASK/.cask
ENV PATH="/CASK/.cask/bin:$PATH"

######### misc
RUN mkdir -p DUMBJUMP
WORKDIR /DUMBJUMP

ENTRYPOINT ["bash"]

I can run the snapshot version and the

(NB: EVM emacs-git-snapshot recipe does not work on my laptop.)

Conclusion: these check problems on "snapshot" are not coming from org-mode