-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
consult-org-heading
preview
#726
Comments
Yes, this ist due to technical limitations of the overlay unfolding API. The new org-fold API is not an improvement but rather a complication. Also org-fold is a bit buggy. Feel free to experiment with the API, see consult--invisible-open-temporarily. We could consider making it configurable, but I am actually happy with the status quo. Regarding your password use case I recommend to use a netrc auth file instead. It provides a mode which hides passwords (via overlays). You could also develop a similar mode for Org. |
I feared as much... But, well, I had to ask. Anyway, thanks for considering and answering.
I'll take a look at it. Thanks for the suggestion. Edit: For the record, the feature is implemented by |
Iirc you can also configure this on the level of Org. There is a configuration variable (I don't remember the name) which sets how much should be unfolded for certain Org operations. Consult behaves like Isearch from the perspective of Org. |
Is that Edit: At least for Org 9.5.5, which is what I have here, |
@minad I'm not sure this is something you want to, or should for that matter, worry about, but for the record. You've recommended me above the password hiding technique of So we get something like: Again, sounds like I'm getting what I asked for. But I still thought it worth to bring to your consideration. |
@GusBR Yes, this is expected. |
I just had an idea - I think you should implement a vertico-censor-mode which modifies vertico--format-candidate and hides via predicates or regexps. I would say that this is the right solution for the problem. The other alternative would be to modify the candidates directly but this seems more ad-hoc, see consult--line-candidates. |
That's an interesting idea, sounds promising. I'll play with it. Thanks! |
consult-org-heading
's previews will show the current candidate in the buffer "as is", if the candidate happens to be visible. However, if the candidate is invisible, the preview completely unfolds it, showing full contents of the headings around, including drawers, etc. So, the more hidden something is at the start of completion, the more it is shown on preview.I think it would be more consistent if
consult-org-heading
was less aggressive in unfolding candidates, and only showed sibling headings instead.To demonstrate the mentioned effect, start with
emacs -Q
, do a minimal setup:Visit an .org file with contents:
The file will open as:
Call
consult-org-heading
, and navigate candidate by candidate usingC-n
. While on "Heading 1" and its subheadings, the preview does not show anything else other than the folded headings. But, when "Heading 2.1" is reached, now we get:I'm not sure if this behavior is due to technical limitations, or if this is related to the new
org-fold
library (which I don't yet have here), as discussed in #563. But, if the "unfold only sibling headings" behavior is possible, I think it would be desirable, and an improvement over the current one.The point above is general but, for context, I got concerned with this because I use an .org.gpg file as my password manager, with a derived major mode provided by a personal library akin to
org-passwords.el
, where I disable the usual stuff, like not lettingsearch-invisible
be'open
etc. But regardless of that,consult-org-heading
is quite indiscreet. For the time being, I setconsult-preview-key
locally to nil. This works because it is a personal library, but if it wasn't, it would still not be a safe way to disable it, since it can always be overridden byconsult-customize
. But I diverge, the point here is just a suggestion of better unfolding behavior for the previews.(Running GNU Emacs 28.2 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0) of 2022-09-12, Org mode version 9.5.5 (release_9.5.5 @ /usr/local/share/emacs/28.2/lisp/org/) and the packages' versions loaded above).
The text was updated successfully, but these errors were encountered: