EFLS / zetteldeft

A Zettelkasten system! Or rather, some functions on top of the emacs deft package.
https://efls.github.io/zetteldeft
GNU General Public License v3.0
394 stars 42 forks source link

Avy cannot find invisible zetteldeft-link-indicators, such as "[[" #106

Open localauthor opened 3 years ago

localauthor commented 3 years ago

When using 'The Archive' style UIDs and links, such as [[202102171159]], emacs renders the enclosing brackets invisible in the buffer.

As a consequence, the avy functions zetteldeft-avy-file-search or zetteldeft-avy-link-search return "zero candidates." Presumably avy cannot see invisible characters.

One possible solution is to invoke 'visible-mode,' to make the brackets visible.

But I wonder if it is possible to configure Avy to see invisible characters?

EFLS commented 3 years ago

If Avy could see those, that would be the easiest solution, but I don't think it can.

When using [[ style links, are you not in Markdown mode? Or does Markdown mode also hide the brackets?

Not sure what the best solution would be to address this, but I'm open for suggestions.

localauthor commented 3 years ago

I am in org-mode, so that might be the root of the problem. My hacky solution, then, is to add (eval visible-mode 1) to my zettekasten directory's "directory local variables" file.

I actually quite like to have the brackets visible, so this solution satisfies me. But I wanted to raise the issue anyway, in case others were finding that running zetteldeft-avy-file-search and zetteldeft-avy-link-search always returned "zero candidates" as it did for me.

So, perhaps no action needed here. :)

edit: Except, of course, that visible-mode disables org-mode's folding feature... thumb's down

edit edit: An alternative might be to use ace-link instead of avy, but that would require some elisp jerry rigging that I'm not capable of (yet).

EFLS commented 3 years ago

My hacky solution, then, is to add (eval visible-mode 1) to my zettekasten directory's "directory local variables" file.

Except, of course, that visible-mode disables org-mode's folding feature... thumb's down

Seems like a good solution, but you might want to check the ~variable org-hide-emphasis-markers instead~ (wrong: see below). That should include the [[ visibility, if I remember correctly.

localauthor commented 3 years ago

Seems like a good solution, but you might want to check the variable org-hide-emphasis-markers instead. That should include the [[ visibility, if I remember correctly.

The variable org-hide-emphasis-marks only applies to markers for bold, italic, underline, etc.

The visibility of link brackets is handled by the variable org-link-descriptive, which can be toggled by the function org-toggle-link-display.