Skip to content

b3m3bi/denote-completing-format

Repository files navigation

denote-completing-format

This small extension introduces denote-completing-format-open-or-create and denote-completing-format-link-or-create commands, an alterantive to denote-open-or-create and denote-link-or-create that align and fontify the elements of denote file names in completing-read prompt. (Note that this command does not perform well at large scale. See Laggs when working with lots of notes).

./denote-completing-format-img.png

Installation and configuration

Clone this repository:

git clone https://github.com/b3m3bi/denote-completing-format

Require and configure package on init.el:

(add-to-list 'load-path "./denote-completing-format") ; path to repo
(require 'denote-completing-format)
(global-key (kbd "C-n n f") #'denote-completing-format-open-or-create)
(global-key (kbd "C-n n i") #'denote-completing-format-link-or-create)

Configuration

You can configure the container sizes of different denote’s file name elements with the variables: denote-completing-format-subdir-width, denote-completing-format-date-width, denote-completing-format-title-width, denote-completing-format-keywords-width and denote-competing-format-extension-width.

Aditionally you can deslugiffy file title with denote-completing-format-desslugiffy, and customize the fonts by modifing the denote-completing-format-fonts- variables. Also you can change the function to create notes with denote-completing-format-create-function.

Laggs when working with lots of notes

The creation of the formatted completion table is inefficient and slow which implies long delays to prompt for file selection. In a test folder containing 13000 notes (created using Peter Prevos script) the execution time of the creation of the formatted completion table (denote-completing-format-open-or-create) is greater than 2.7 seconds ( benchmark-run). In contrast the file prompt used by denote-open-or-create (denote-file-prompt) takes approximatly 0.4 seconds.

TODOS

  • build the completion prompt in a more eficient and fast way
  • customize prompt formatting using a template instead of customizing multiple individual variables (similar to citar’s template)
  • implement completing-read best practices (e.g., add category metadata to completing candidates)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published