Add: Save position when refreshing search buffers
This commit is contained in:
parent
dbd385c664
commit
932960c686
2 changed files with 14 additions and 7 deletions
|
|
@ -460,6 +460,7 @@ Expands into a call to ~org-ql-select~ with the same arguments. For convenience
|
||||||
+ Command ~org-ql-view~, which displays views saved to variable ~org-ql-views~, which can be saved from ~org-ql-search~ buffers with command ~org-ql-search-save~, which is bound to =C-x C-s= in view buffers.
|
+ Command ~org-ql-view~, which displays views saved to variable ~org-ql-views~, which can be saved from ~org-ql-search~ buffers with command ~org-ql-search-save~, which is bound to =C-x C-s= in view buffers.
|
||||||
+ Variable ~org-ql-view-map~, active in view buffers displayed by ~org-ql-search~, ~org-ql-agenda~, and ~org-ql-view~.
|
+ Variable ~org-ql-view-map~, active in view buffers displayed by ~org-ql-search~, ~org-ql-agenda~, and ~org-ql-view~.
|
||||||
+ =random= sort method.
|
+ =random= sort method.
|
||||||
|
+ Save position when refreshing search buffers.
|
||||||
|
|
||||||
*Changed*
|
*Changed*
|
||||||
+ Function ~org-ql-query~ renamed to ~org-ql-select~. ~org-ql-query~ now refers to a new function.
|
+ Function ~org-ql-query~ renamed to ~org-ql-select~. ~org-ql-query~ now refers to a new function.
|
||||||
|
|
|
||||||
|
|
@ -252,13 +252,19 @@ TITLE: An optional string displayed in the header."
|
||||||
(defun org-ql-search-refresh ()
|
(defun org-ql-search-refresh ()
|
||||||
"Refresh current `org-ql-search' buffer."
|
"Refresh current `org-ql-search' buffer."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(let ((current-line (buffer-substring-no-properties (line-beginning-position) (line-end-position)))
|
||||||
|
(old-pos (point)))
|
||||||
(org-ql-agenda--agenda org-ql-buffers-files
|
(org-ql-agenda--agenda org-ql-buffers-files
|
||||||
org-ql-query
|
org-ql-query
|
||||||
:sort org-ql-sort
|
:sort org-ql-sort
|
||||||
:narrow org-ql-narrow
|
:narrow org-ql-narrow
|
||||||
:super-groups org-ql-super-groups
|
:super-groups org-ql-super-groups
|
||||||
:title org-ql-title
|
:title org-ql-title
|
||||||
:buffer (current-buffer)))
|
:buffer (current-buffer))
|
||||||
|
(goto-char (point-min))
|
||||||
|
(or (search-forward current-line nil t)
|
||||||
|
(goto-char old-pos))
|
||||||
|
(beginning-of-line)))
|
||||||
|
|
||||||
(defun org-ql-search-save ()
|
(defun org-ql-search-save ()
|
||||||
"Save current `org-ql-search' buffer to `org-ql-views'."
|
"Save current `org-ql-search' buffer to `org-ql-views'."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue