Coder Social home page Coder Social logo

Links and Custom Folders about denote HOT 14 CLOSED

protesilaos avatar protesilaos commented on July 28, 2024
Links and Custom Folders

from denote.

Comments (14)

protesilaos avatar protesilaos commented on July 28, 2024

Hi Sven,

I do however get duplicates when using denote-link-add-links and
searching only for date, say 20220617. I guess this is because the
regex searches both filename and title, hence creates duplicates.

If your files have a date in their title field, then yes those results
you are getting are to be expected.

If you want to match the start of the file where the identifier/date is,
start your regexp with ^. For example ^20220617.

When I'm though in another folder, say Docs/journal and do the same
search it searches the /notes folder and respectively adds files
matching the same files with the difference that I can't seem to open
them. Adding a link via denote-link-insert-link adds the right link,
but I'm unable to open it.

Does this other folder have a .dir-locals.el which sets the
denote-directory to the current directory?

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

I found the bug and pushed a change. If you were using .dir-locals.el as the manual suggested, update its contents to this:

;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")

((nil . ((denote-directory . default-directory))))

The old value was faulty and I forgot to review it earlier.

Please let me know if this addresses your problems.

from denote.

svnsbck avatar svnsbck commented on July 28, 2024

Hi Prot,

thanks for your reply. I just now had the chance to do some testing and the new code for the .dir-locals file fixes the issue with the links. Adding links via "denote-link-find-file" and following those links via "denote-link-find-file" does now work as expected.

Adding links via denote-link-insert-links-matching-regexp"though doesn't seem to work and the error Opening input file: No such file or directory, (below that it shows the path and filename of the current document) comes up in the Minibuffer. This would be in the secondary folder containing the .dir-locals.el file.

In the primary folder it works, but still produces duplicates when for example searching for ^20220617 as you suggested. But that might be because I'm not familiar with regex (I would like to say "yet").

I also found something in the Backlinks buffer:

I'm not sure if this is intended or not, but it seems that the backlinks-buffer is build and fontified correctly, but it doesn't seem to be possible to open any of the links at the moment (Buffer is read only). The buffer also produces duplicates and also includes a link to the current document.

I noticed this behaviour both in the default folder, as well as in the secondary folder, that is the one containing the .dir-locals.el file.

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

Hello Sven,

the new code for the .dir-locals file fixes the issue with the links. Adding links via "denote-link-find-file" and following those links via "denote-link-find-file" does now work as expected.

Good!

Adding links via denote-link-insert-links-matching-regexp"though doesn't seem to work and the error Opening input file: No such file or directory, (below that it shows the path and filename of the current document) comes up in the Minibuffer. This would be in the secondary folder containing the .dir-locals.el file.

I can reproduce this. Will figure out what the problem is and report back to you.

In the primary folder it works, but still produces duplicates when for example searching for ^20220617 as you suggested. But that might be because I'm not familiar with regex (I would like to say "yet").

You mean duplicates as in the same file more than once or matches that are not exactly what you would like? If you show me some examples, I can help further.

I also found something in the Backlinks buffer:

I broke this yesterday when I added the sort mechanism. It should be fixed now per commit 429763c, aab484d.

from denote.

svnsbck avatar svnsbck commented on July 28, 2024

Great!

And I just figured out why there are duplicates showing.

Screenshot from 2022-06-18 07-35-57
Both instances open the same document, but looking at the folder in the files-app and not Dired reveals two files, but one with an .org~ ending. I guess that's an autosave or such file?

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

I guess that's an autosave or such file?

Yes, I noticed this a few minutes ago and pushed some changes. Thanks!

Now working on the error you reported.

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

Oh, I should ask here: the ~ in those files is only at the end? If so, I need to tweak the filter.

from denote.

svnsbck avatar svnsbck commented on July 28, 2024

Oh, I should ask here: the ~ in those files is only at the end? If so, I need to tweak the filter.

Yes, only at the end (checked also in eshell)
Screenshot from 2022-06-18 08-09-24
I should maybe set a different backup/autosave location in the process :--)

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

I should maybe set a different backup/autosave location in the process :--)

In principle, there should be no need to change that (if you like it that way). I just improved the check for it.

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

I believe I fixed the bug now. Please check.

from denote.

svnsbck avatar svnsbck commented on July 28, 2024

Great! Adding links the in a secondary folder works now as one might expect.

I noticed though that the Backlinks-Buffer also includes links to the backup/autosave files, which might cause confusion. This happens in both folders, the default and the secondary/alternative one.

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

Great! Adding links the in a secondary folder works now as one might expect.

Very well!

I noticed though that the Backlinks-Buffer also includes links to the backup/autosave files, which might cause confusion. This happens in both folders, the default and the secondary/alternative one.

Just pushed a change. It should remove all false positive. Please give it a try.

from denote.

svnsbck avatar svnsbck commented on July 28, 2024

Nice! Everything seems to work as expected! Perfect!

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

Excellent! Thanks again for the feedback! I am now closing this.

from denote.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.