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

Respect org-agenda-hide-tags-regexp in org-ql views #417

Closed
ParetoOptimalDev opened this issue Feb 28, 2024 · 2 comments
Closed

Respect org-agenda-hide-tags-regexp in org-ql views #417

ParetoOptimalDev opened this issue Feb 28, 2024 · 2 comments

Comments

@ParetoOptimalDev
Copy link

OS/platform

NixOS

Emacs version and provenance

GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.0)
NixOS using https://github.com/nix-community/emacs-overlay

Org version and provenance

Org mode version 9.6.19 ( @ /nix/store/d74and44lhvi9plj293jf9jhbjy6n95a-emacs-packages-deps/share/emacs/site-lisp/elpa/org-9.6.19/)

org-ql package version and provenance

Version: 0.9-pre

Description

I want org-ql views to respect org-agenda-hide-tags-regexp or provide an equivalent.

I found org-ql-tag-line-re and tried setting it to an empty string but the same tags were still matched.

Etc.

Context: I use olivetti-mode to center my org-agenda buffers to have whitespace on each side. When tags are aligned all the way to the right and olivetti centers things I get multiple lines per heading because the long lines get wrapped.

I'd prefer to just not show the tags to sidestep this issue, though it would be acceptable for org-ql view to somehow integrate better with olivetti-mode. I suspect the former will be the more preferred of the two given the value of using olivetti is very subjective.

@alphapapa
Copy link
Owner

alphapapa commented Feb 29, 2024

It's unlikely that I would add support for org-agenda-hide-tags-regexp specifically, because one of the reasons I developed org-ql was to have a simpler implementation without so many options that make for spaghetti code.

If you don't want tags to be displayed, you could copy the function org-ql-view--format-element and comment out the code that is related to tags.

Someday I hope to provide a more flexible means of formatting results, but that probably won't happen soon.

@evertedsphere
Copy link

evertedsphere commented Sep 7, 2024

I ended up with this, using el-patch templates:

(after! (:and el-patch org-ql)
  (el-patch-feature org-ql)
  (el-patch-define-and-eval-template
   (defun org-ql-view--format-element)
   (tag-string (when tag-list
                 (--> tag-list
                      (el-patch-add (remove "project" it) (remove "draft" it))
                      (el-patch-swap (s-join ":" it) (s-join " " it))
                      (el-patch-remove (s-wrap it ":"))
                      (org-add-props it nil 'face 'org-tag))))))

M-x el-patch-ediff-patch shows:

image

In your case you could go further and just make tag-list an empty list:

(el-patch-define-and-eval-template
   (defun org-ql-view--format-element)
   (tag-list (el-patch-swap ... nil)))

Repository owner locked and limited conversation to collaborators Sep 7, 2024
@alphapapa alphapapa converted this issue into discussion #464 Sep 7, 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

3 participants