-
Notifications
You must be signed in to change notification settings - Fork 42
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
Feature Request: option to not use § #4
Comments
That's a good suggestion to make the package more universally usable. EDIT: Another issue would be the fontification. Currently, |
For the record, since I never used § links, I did not even know you highlighted links, so I would not miss that feature :) |
Would it make sense to just define a link as anything within |
I've made some adjustments so that you can change the Take a look at the changes in this commit. Make sure to I hope I didn't break anything else! How does this work in The Archive? Are links always included in |
For what it's worth I just use (defun zd-avy-link-search ()
"Call on avy to jump and search link ids indicated with [[.
Opens immediately if there is only one result."
(interactive)
(save-excursion
(avy-goto-char-2 ?\[?\[)
(zd-search-global (zd-lift-id (zd-get-thing-at-point))))) though I'm also just working in markdown. But I don't see why this would be a problem in org as well, unless you're doing a lot of other linking? |
Cool, I'll take a look when I have some time to play with it. Thanks!
The Archive always uses |
I just updated, but I can't test this yet because #6 means that I can't actually do searches. I mention it here just in case the two are related. |
@mediapathic I can't seem to replicate the issue. With Could you share your |
Hey, sorry about the delay. I include the relevant lines from my .init, but there's really nothing particularly weird that I see here. I have just realized that I'm setting my deft-extensions twice, and that is dumb, but I doubt it's relevant. However, in looking through the customize options and the way they write to the customize block in my init, I note: ` '(zd-link-indicator "nil") Which I think means that it's reading "nil" as a literal string. I can't figure out how to set it to actually Just in case, here's my init details:
|
You should use You could add that line to the To just execute the Finally, to see whether that worked, you can hit As an aside, there are many good introductions to |
I was unclear: that line is part of the auto-generated customize block, so it is already implicitly part of a
When I eval But, nonetheless, ids are still not working. Any other thoughts of avenues to explore? |
Very strange. I can't reproduce it, and don't really have much to go on. And what about other functions? Could you report the following for me:
Finally (or maybe test this first), what is the result when you evaluate the following code? I'm not really experienced in tracing bugs, so guessing a little here on how we could see what's going on behind the scenes. |
These work as expected. I get a helm search with all my zk, the first opens the file, the second inserts the title.
zd-id-regex is a variable defined in ‘zetteldeft.el’.
zd-id-format is a variable defined in ‘zetteldeft.el’. I don't read regex very well, but is that regex trying to pick up ids with dashes in them? If so, this would be odd, because searches with the non-dash id used to work.
I see no result from evaluating that.
I appreciate your continuing effort! I hope it will turn out that this is an actual problem I am helping you solve and not just a mistake on my part. |
Ah I see what's happening. Setting the value of In the documentation of the variable, I explain:
I should update the documentation, because now it is severely lacking. Anyway, you should update the
|
So close! That was definitely the issue, because the id functions work now. However, I think the regex is wrong, because it is consistently chopping off the first part of the id. So, for example,
becomes
ie, chopping off the leading "20". This seems to be a consistent pattern in the sparse couple of files I've tested with. |
Okay, so we have at least identified the cause. I don't know why I suggested that terrible regex in my earlier reply (lack of time, I guess), because it could be much simpler. Since your IDs consists of 12 digits, it could be as easy as setting it to that. To make it a little more strict, however, I suggest the following:
Now it will only detect a sequence of Let me know if it works. I'll update the documentation of |
Fantastic! That seems to work great. Thank you so much! I would recommend for documentation including this particular regex as an example at least, as I suspect most people who want to change their id style will want to change it to this, which I believe is currently the most popular style. Again, thank you for all the support. |
Great to hear that it works now. I updated the documentation to make things more clear. |
As far as I can tell, the § convention is falling out of favor with the ZK community. In private communication with sfast, he implied strongly that he no longer uses it in most note titles, and has relegated it to some specific meaning. And it's quite a few keystrokes to replicate in emacs :).
Therefore, can we have a flag that toggles whether or not functions that use § do so? I almost never use it, and every time I create a note link I have to delete it.
From my understanding, this should be fairly easy in terms of file creation, the only thing I see that might make this hard is the
zd-avy-link-search
, but I don't really understand the internals of that. And personally I never use that anyway, so if that function requires the § I'm ok with that.Thanks!
The text was updated successfully, but these errors were encountered: