Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

let org-ql-view-refresh respect custom buffer name #424

Closed
whudwl opened this issue May 3, 2024 · 2 comments
Closed

let org-ql-view-refresh respect custom buffer name #424

whudwl opened this issue May 3, 2024 · 2 comments

Comments

@whudwl
Copy link

whudwl commented May 3, 2024

OS/platform

any

Emacs version and provenance

not relevant

Org version and provenance

not relevant

org-ql package version and provenance

any

Description

Say I have done a search with the code below, notice that I've named the buffer habit

(org-ql-search '("~/org/habit.org") '(property "STYLE" "habit") :buffer "habit")

Now if I press r in the habit buffer, the buffer gets named to *Org QL View: (property STYLE habit)*.
If I rerun the code above, and press r again, the buffer gets named to *Org QL View: (property STYLE habit)*<1>.

I think it's preferable to let org-ql-view-refresh use the buffer name I've chosen.

Etc.

No response

@alphapapa
Copy link
Owner

BTW, note that there's already a habit predicate, so you needn't use the property predicate to find them.

Anyway, how would you suggest that we know whether the user wants to keep a buffer's name or change it to match the new search?

I'd generally suggest that you assign the search a title and access it with, e.g. saved views, bookmarks, or links, rather than manually evaluating that expression.

@whudwl
Copy link
Author

whudwl commented May 6, 2024

That makes a lot of sense, I'll use or-ql-view instead for my pre-defined searches.

Out of curiosity, in which case is the following part in org-ql-view-refresh useful? It seems I can just remove it without causing any issues.

(rename-buffer (format "%s %s*"
                           org-ql-view-buffer-name-prefix
                           (or org-ql-view-title org-ql-view-query))
                   ;; Avoid any errors in case a buffer by this name already exists.
                   'unique)

Repository owner locked and limited conversation to collaborators May 8, 2024
@alphapapa alphapapa converted this issue into discussion #425 May 8, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

2 participants