Coder Social home page Coder Social logo

Comments (4)

protesilaos avatar protesilaos commented on July 28, 2024

Hello @shrysr

I do not think it makes a difference, but in case it is relevant - I use projectile.

Maybe it is relevant, as I cannot reproduce this on my end.

What I did:

  • Copied my notes repo inside my dotfiles, which are under version control.

  • (setq denote-directory "/home/prot/Git/Projects/dotfiles/emacs/.emacs.d/prot-lisp/testing-notes")

  • Visited a file that has links pointing to it.

  • The backlinking worked.

I can install projectile to test how it works with it. Though I have not used it in a long time. Will report back to you.

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

I tried with projectile: it still works. This is weird... Will continue testing.

from denote.

shrysr avatar shrysr commented on July 28, 2024

Thanks for your efforts. Out of curiosity, I tried with emacs -Q and a minimal config (placed below for reference, and taken from Denote's README), and backlinks did not work for the denote-directory placed within my org repo. Maybe the problem is an edge case that lies elsewhere or the config below is insufficient. I do not see anything in the source that gives me clues, but I would not trust my elisp cognizance anyway. If you would like to suggest a modified minimal config, I can try again when I find time, and I will probably give this another attempt on another machine and OS tomorrow.

Quick note: Denote's main branch was downloaded as a zip file from Github and just added to the path.


In any case - after a lot of reflection in the past few days - I have decided for now that Denote's general approach is not aligned to my process and how I would like to interact with my notes. Out of respect for your time, I will close the ticket, but will report back if I find anything. Please feel free to re-open if you see fit. I will also try to follow Denote's progress and contribute if I have anything meaningful. Thanks again!

(require 'package)

;; 1st priority
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)

;; 2nd priority
;; Install form melpa-stable' only if a package from 'melpa' is broken
(add-to-list 'package-archives
             '("melpa-stable" . "https://stable.melpa.org/packages/") t)

;; Initialize packages
(package-initialize)


;; GNU TLS connection issue workaround for Emacs 26.3
(require 'gnutls)

(add-to-list 'load-path "/Users/shrysr/Downloads/denote")


(require 'denote)

;; Remember to check the doc strings of those variables.
(setq denote-directory (expand-file-name "~/my_org/denotes/"))
(setq denote-known-keywords
      '("emacs" "philosophy" "politics" "economics"))
(setq denote-infer-keywords t)
(setq denote-sort-keywords t)
(setq denote-file-type nil) ; Org is the default, set others here

;; We allow multi-word keywords by default.  The author's personal
;; preference is for single-word keywords for a more rigid workflow.
(setq denote-allow-multi-word-keywords t)

(setq denote-date-format nil) ; read doc string

;; You will not need to `require' all those individually once the
;; package is available.
(require 'denote-retrieve)
(require 'denote-link)

;; By default, we fontify backlinks in their bespoke buffer.
(setq denote-link-fontify-backlinks t)

;; Also see `denote-link-backlinks-display-buffer-action' which is a bit
;; advanced.

;; If you use Markdown or plain text files (Org renders links as buttons
;; right away)
(add-hook 'find-file-hook #'denote-link-buttonize-buffer)

(require 'denote-dired)
(setq denote-dired-rename-expert nil)

;; We use different ways to specify a path for demo purposes.
;; (setq denote-dired-directories
;;       (list denote-directory
;;             (thread-last denote-directory (expand-file-name "attachments"))
;;             (expand-file-name "~/Documents/books")))

;; Generic (great if you rename files Denote-style in lots of places):
;; (add-hook 'dired-mode-hook #'denote-dired-mode)
;;
;; OR if only want it in `denote-dired-directories':
(add-hook 'dired-mode-hook #'denote-dired-mode-in-directories)

;; Here is a custom, user-level command from one of the examples we
;; showed in this manual.  We define it here and add it to a key binding
;; below.
(defun my-denote-journal ()
  "Create an entry tagged 'journal', while prompting for a title."
  (interactive)
  (denote
   (denote--title-prompt)
   "journal"))

;; Denote does not define any key bindings.  This is for the user to
;; decide.  For example:
(let ((map global-map))
  (define-key map (kbd "C-c n j") #'my-denote-journal) ; our custom command
  (define-key map (kbd "C-c n n") #'denote)
  (define-key map (kbd "C-c n N") #'denote-type)
  (define-key map (kbd "C-c n d") #'denote-date)
  (define-key map (kbd "C-c n s") #'denote-subdirectory)
  ;; If you intend to use Denote with a variety of file types, it is
  ;; easier to bind the link-related commands to the `global-map', as
  ;; shown here.  Otherwise follow the same pattern for `org-mode-map',
  ;; `markdown-mode-map', and/or `text-mode-map'.
  (define-key map (kbd "C-c n i") #'denote-link) ; "insert" mnemonic
  (define-key map (kbd "C-c n I") #'denote-link-add-links)
  (define-key map (kbd "C-c n l") #'denote-link-find-file) ; "list" links
  (define-key map (kbd "C-c n b") #'denote-link-backlinks)
  ;; Note that `denote-dired-rename-file' can work from any context, not
  ;; just Dired bufffers.  That is why we bind it here to the
  ;; `global-map'.
  (define-key map (kbd "C-c n r") #'denote-dired-rename-file))
 

from denote.

protesilaos avatar protesilaos commented on July 28, 2024

I slightly modified your sample config:

(require 'package)

;; 1st priority
(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)

;; 2nd priority
;; Install form melpa-stable' only if a package from 'melpa' is broken
(add-to-list 'package-archives
             '("melpa-stable" . "https://stable.melpa.org/packages/") t)

;; Initialize packages
(package-initialize)


;; GNU TLS connection issue workaround for Emacs 26.3
(require 'gnutls)



(require 'denote "/home/prot/Git/Projects/denote/denote.el")

;; Remember to check the doc strings of those variables.
(setq denote-directory (expand-file-name "~/Documents/notes/"))
(setq denote-known-keywords
      '("emacs" "philosophy" "politics" "economics"))
(setq denote-infer-keywords t)
(setq denote-sort-keywords t)
(setq denote-file-type nil) ; Org is the default, set others here

;; We allow multi-word keywords by default.  The author's personal
;; preference is for single-word keywords for a more rigid workflow.
(setq denote-allow-multi-word-keywords t)

(setq denote-date-format nil) ; read doc string

;; You will not need to `require' all those individually once the
;; package is available.
(require 'denote-retrieve "/home/prot/Git/Projects/denote/denote-retrieve.el")
(require 'denote-faces "/home/prot/Git/Projects/denote/denote-faces.el")
(require 'denote-link "/home/prot/Git/Projects/denote/denote-link.el")

;; By default, we fontify backlinks in their bespoke buffer.
(setq denote-link-fontify-backlinks t)

;; Also see `denote-link-backlinks-display-buffer-action' which is a bit
;; advanced.

;; If you use Markdown or plain text files (Org renders links as buttons
;; right away)
(add-hook 'find-file-hook #'denote-link-buttonize-buffer)

(require 'denote-dired "/home/prot/Git/Projects/denote/denote-dired.el")
(setq denote-dired-rename-expert nil)

;; We use different ways to specify a path for demo purposes.
;; (setq denote-dired-directories
;;       (list denote-directory
;;             (thread-last denote-directory (expand-file-name "attachments"))
;;             (expand-file-name "~/Documents/books")))

;; Generic (great if you rename files Denote-style in lots of places):
;; (add-hook 'dired-mode-hook #'denote-dired-mode)
;;
;; OR if only want it in `denote-dired-directories':
(add-hook 'dired-mode-hook #'denote-dired-mode-in-directories)

;; Here is a custom, user-level command from one of the examples we
;; showed in this manual.  We define it here and add it to a key binding
;; below.
(defun my-denote-journal ()
  "Create an entry tagged 'journal', while prompting for a title."
  (interactive)
  (denote
   (denote--title-prompt)
   "journal"))

;; Denote does not define any key bindings.  This is for the user to
;; decide.  For example:
(let ((map global-map))
  (define-key map (kbd "C-c n j") #'my-denote-journal) ; our custom command
  (define-key map (kbd "C-c n n") #'denote)
  (define-key map (kbd "C-c n N") #'denote-type)
  (define-key map (kbd "C-c n d") #'denote-date)
  (define-key map (kbd "C-c n s") #'denote-subdirectory)
  ;; If you intend to use Denote with a variety of file types, it is
  ;; easier to bind the link-related commands to the `global-map', as
  ;; shown here.  Otherwise follow the same pattern for `org-mode-map',
  ;; `markdown-mode-map', and/or `text-mode-map'.
  (define-key map (kbd "C-c n i") #'denote-link) ; "insert" mnemonic
  (define-key map (kbd "C-c n I") #'denote-link-add-links)
  (define-key map (kbd "C-c n l") #'denote-link-find-file) ; "list" links
  (define-key map (kbd "C-c n b") #'denote-link-backlinks)
  ;; Note that `denote-dired-rename-file' can work from any context, not
  ;; just Dired bufffers.  That is why we bind it here to the
  ;; `global-map'.
  (define-key map (kbd "C-c n r") #'denote-dired-rename-file))

I tried it in my regular notes' directory and also in a subdirectory of
a git project. In both cases the backlinks worked. I am confused about
what is going on here, especially since you mentioned how it works
without the .git directory.

What is the value of your M-x emacs-version, if you don't mind?

In any case - after a lot of reflection in the past few days - I have
decided for now that Denote's general approach is not aligned to my
process and how I would like to interact with my notes.

That's fine. As I explained in the other
thread
,
it is better to be honest with users and not trick them into a false
sense of comfort about what Denote is or can do.

Thanks again for your time and feedback!

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.