alphapapa / org-ql

A searching tool for Org-mode, including custom query languages, commands, saved searches and agenda-like views, etc.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When multiple sorters are specified, something mutates the sorter list after first successful run

natrys opened this issue · comments

Setup

Emacs: GNU Emacs 28.0.50
Org-mode: 9.3
org-ql: org-ql-20200713.309
org-super-agenda version: org-super-agenda-20200310.1337

Issue

Hello, I am really grateful for this package (and org-super-agenda) and it helped me a lot in the last ~2 years (as I can't really make sense of built-in agenda).

The issue I am facing is that when multiple sorters are specified (such as with :sort '(deadline priority date)), it works perfectly in the first run, but then org-ql-view-sort gets weirdly mutated (to just the first sorter it seems (e.g. '(deadline)).

This means subsequent refresh with r, g doesn't produce the same view again.

Reproduction

(setq my-sorting-functions '(deadline priority date))

(org-ql-search "~/empty.org"
  '(todo)
  :super-groups nil
  :sort my-sorting-functions)

(print my-sorting-functions) ;; ==> Now it is changed to '(deadline) so is `org-ql-view-sort` in the buffer

Thanks, I hadn't noticed this issue. Your PR is probably the right fix. I will look at it when I have time.

Fixed in 29090c4 and 0.4.8.