alphapapa / alphapapa/org-ql

Add a order-by function for org-clock (my solution in here)

オープン
#405 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
discussion enhancement
主要言語
Emacs Lisp
スター
1.6k
フォーク
120
PR マージ指標
30日以内にマージされた PR はありません

説明

### OS/platform

Ubuntu

### Emacs version and provenance

28.1

### Org version and provenance

9.6.17

### org-ql package version and provenance

20240113.647 melpa

### Description

Hello, thanks again for the package!

I just wanted to query headings by the most recent I worked on. I automatically start org-clock when I navigate to a heading, so I wanted to use that as recency sorting.
Since your package is so configurable, I made my own comparing function to do the job:

``` elisp
(defun my/org-ql-compare-org-clocks (a b)
"Compare Org heading A with B using their last clock out time."
(flet ((get-clockout-time (h)
(with-current-buffer (marker-buffer (org-element-property :org-marker h))
(save-excursion
(goto-char (marker-position (org-element-property :org-marker h)))
(org-clock-get-last-clock-out-time)))) )
(ignore-errors (time-less-p (get-clockout-time b)
(get-clockout-time a)))))
```
I thought that maybe other users of org-clock would find it useful, so I wanted to share it here.
Feel free to add it to the package, if you think is general enough.

### Etc.

_No response_

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。