alphapapa / alphapapa/org-ql

`link` predicate fails when heading contains another link before it

Open
#493 3 comments 0 reactions 1 assignee Claimed by @alphapapa View on GitHub
bug
Dominant language
Emacs Lisp
Stars
1.6k
Forks
120
PR merge metrics
No merged PRs in 30d

Description

### OS/platform

Ubuntu

### Emacs version and provenance

Emacs 30.1

### Emacs command

emacs-client

### Org version and provenance

9.7.11

### org-ql package version and provenance

20250421.133

### Actions taken

```
#+begin_src emacs-lisp
(org-ql-search (current-buffer) `(ancestors (link :target "ref")))
#+end_src

* Ref
:PROPERTIES:
:ID: ref
:END:

* [[x][x]] [[id:ref][Ref]]

** hello

```

Run the query in the src block.

### Observed results

Org-ql does not find the "hello" heading

### Expected results

I expect the query to return the `hello` heading, which indeed I get when I leave out the `[[x][x]]` link preceding the link I filter on. Interestingly the query works when I move it to the right side, ie ` [[id:ref][Ref]] [[x][x]]`.

### Backtrace

```elisp

```

### Etc.

Thanks for the amazing package which I rely on a lot.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.