Commit graph

98 commits

Author SHA1 Message Date
Protesilaos Stavrou d09249d48f
Make 'default-directory' safe for denote-directory
This relates to the example we cover in the manual, which was updated in
commit 47a9024.

Thanks to Sven Seebeck for reporting the bug in issue 16 over at the
GitHub mirror: <https://github.com/protesilaos/denote/issues/16>.
2022-06-17 18:45:21 +03:00
Protesilaos Stavrou 7ce2f7d3e3
Use the 'denote-directory' function, not variable
Just to be sure we always get the appropriate value.
2022-06-17 18:44:53 +03:00
Protesilaos Stavrou c8f3e707c2
Revise one-line descriptions, where needed 2022-06-16 12:44:03 +03:00
Protesilaos Stavrou d5b62c4e58
Add denote-date command (notes for past date)
Thanks to user svnsbck for suggesting the idea in issue 15 over at the
GitHub repo: <https://github.com/protesilaos/denote/issues/15>.
2022-06-16 12:09:33 +03:00
Protesilaos Stavrou e1c45e25f4
Optionally no current in files in dir regexp match 2022-06-16 11:56:39 +03:00
Protesilaos Stavrou 31fc567702
Accept optional filetype in front matter formatter 2022-06-16 08:47:34 +03:00
Protesilaos Stavrou 979bf352d6
Clarify requirements for good front matter value 2022-06-16 08:47:34 +03:00
Protesilaos Stavrou a7a0bf0255
Tweak doc string 2022-06-16 08:47:34 +03:00
Protesilaos Stavrou 683180bcfc
Remove superfluous function and var
I believe we were using those in the early code that inserted backlinks
in files.  Now it is not required.
2022-06-16 08:47:34 +03:00
Protesilaos Stavrou f8b2d44508
Depend on Emacs 27.2, not 27.1 2022-06-16 05:49:29 +03:00
Protesilaos Stavrou 2e56f06381
Install aliases for certain commands
The alternative names might help the user understand what the command
does just by looking at the commands' symbol.
2022-06-15 19:10:21 +03:00
Protesilaos Stavrou 5195f13f55
Add optional absolute for denote--directory-files
There is currently no use for it, but I am aware at least of one
function we might use in the future which requires absolute paths.
2022-06-15 16:53:33 +03:00
Protesilaos Stavrou 8a33364dc6
Add helper fn to filter files matching regexp 2022-06-15 07:54:57 +03:00
Protesilaos Stavrou fc9f909061
Change denote--id to denote--id-format
It is important for clarity, otherwise I keep getting confused.
2022-06-14 21:09:33 +03:00
Protesilaos Stavrou 553c10a9cc
Tweak doc string 2022-06-14 21:06:16 +03:00
Protesilaos Stavrou d9f439e47f
Add helper function to prepare completion table 2022-06-14 18:30:56 +03:00
Protesilaos Stavrou b42f68c8e8
Add denote-type command 2022-06-13 15:04:08 +03:00
Protesilaos Stavrou 97e8c30bcf
Rewrite the package Overview 2022-06-13 08:11:37 +03:00
Protesilaos Stavrou 7b719e6274
Add user option to disable multi-word keywords 2022-06-13 07:34:36 +03:00
Protesilaos Stavrou 0e75e46b32
Improve denote-dired-rename-file
It now preserves the identifier, if it exists.  So if you want to change
the title/keywords in a note's front matter, this command can then be
called to also update the file name (maybe there is some way to automate
this, but let's leave it for now).
2022-06-12 05:34:33 +03:00
Protesilaos Stavrou 8a35382067
Rename internal variable for clarity 2022-06-11 17:45:09 +03:00
Protesilaos Stavrou d83c166c0d
Fix regexp for keywords
Regression was caused by commit 7cba33e.  Thanks to svnsbck for
reporting the problem in issue 9 over at the GitHub mirror:
<https://github.com/protesilaos/denote/issues/9>.
2022-06-11 17:43:09 +03:00
Protesilaos Stavrou c225201c49
Use appropriate name for internal variable 2022-06-11 17:38:00 +03:00
Protesilaos Stavrou 11be1d6b40
Change "tml" to "toml" in denote-toml-front-matter
Thanks to Kaushal Modi for spotting the typo:
<73dc07ac00 (r75861972)>.
2022-06-11 17:32:22 +03:00
Protesilaos Stavrou 0cb5c9f06e
Simplify attribution comment to ox-hugo
Per its author's request:
<https://github.com/protesilaos/denote/issues/7#issuecomment-1152932554>.
2022-06-11 17:29:21 +03:00
Protesilaos Stavrou 7cba33e08e
LAST BREAKING CHANGE to file-naming scheme
The pattern now is:

    DATE--TITLE__KEYWORDS.EXTENSION

Multiple keywords are separated by underscores.  A multi-word keyword is
separated by hyphens:

    _two_keywords
    one-keyword-many-words

Also see the enforcement of sluggified keywords in commit 6000313.
2022-06-11 12:56:27 +03:00
Protesilaos Stavrou 6000313eec
Enforce sluggification of keywords; document it 2022-06-11 12:19:26 +03:00
Protesilaos Stavrou c5a5748594
Abstract plain text front matter delimiter 2022-06-11 09:21:25 +03:00
Protesilaos Stavrou bca23b3e3d
Clarify how front matter variables are used
This "hidden option" lets the user do something like this (I prepend >
to escape the #):

>    (setq denote-org-front-matter
>          ":PROPERTIES:
>    :ID: %4$s
>    :END:
>    #+title:      %1$s
>    #+date:       %2$s
>    #+filetags:   %3$s
>    #+identifier: %4$s
>    \n")

Ultimately though, it gives us more flexibility if we ever want to
support extra features.

One such feature is the ability to create links using the org-id.el
library.  See issue 8 over at the GitHub mirror, with feedback from
Kaushal Modi: <https://github.com/protesilaos/denote/issues/8>.
2022-06-11 09:13:11 +03:00
Protesilaos Stavrou 73dc07ac00
Make front matter variables "public"
By removing the double hyphens, we indicate that these variables can be
relied upon by the user.  In other words: these are hidden customisation
options for those who want to maintain some Do-It-Yourself code.
2022-06-11 08:37:29 +03:00
Protesilaos Stavrou 254a6cd0f3
Update date function; enforce RFC3339 when needed
Thanks ot Kaushal Modi for the feedback in issue 7 over at the GitHub
mirror: <https://github.com/protesilaos/denote/issues/7>.
2022-06-11 08:33:46 +03:00
Protesilaos Stavrou 21e415e2e7
Remove obsolete symbol of command 2022-06-10 20:58:52 +03:00
Protesilaos Stavrou 82eeb381dc
Make all front matter abstractions consistent 2022-06-10 20:27:59 +03:00
Protesilaos Stavrou 308322afab
Fix markdown-toml identifier value
Thanks to Kaushal Modi for the feedback in issue 4 over at the GitHub
mirror: <https://github.com/protesilaos/denote/issues/4>.
2022-06-10 20:11:48 +03:00
Protesilaos Stavrou 85e33cb523
Remove needless single quotes 2022-06-10 19:55:17 +03:00
Protesilaos Stavrou 7366004e91
Fix markdown-toml front matter format
Thanks to Kaushal Modi for the feedback in issue 4 over at the GitHub
mirror: <https://github.com/protesilaos/denote/issues/4>.
2022-06-10 19:51:58 +03:00
Protesilaos Stavrou 5fd4e97dad
Add support for markdown-toml
Thanks to Kaushal Modi for the feedback in issue 4 over at the GitHub
mirror: <https://github.com/protesilaos/denote/issues/4>.
2022-06-10 19:19:54 +03:00
Protesilaos Stavrou 1a8b57a9a8
Fix const in denote-file-type (extends 2bc5df6) 2022-06-10 17:49:37 +03:00
Protesilaos Stavrou 2bc5df6011
denote-file-type: 'markdown-yaml', not 'markdown'
This makes it specific that the front matter is YAML-compliant.  It also
gives us the option to support TOML.

Thanks to Kaushal Modi for the feedback in issue 4 over at the GitHub
mirror: <https://github.com/protesilaos/denote/issues/4>.
2022-06-10 17:32:24 +03:00
Protesilaos Stavrou f9b86149fc
Rephrase package overview 2022-06-10 16:10:07 +03:00
Protesilaos Stavrou 3f9bfcb74e
Name the FSF as the copyright holder
This is for the eventual inclusion in the official GNU ELPA archive (as
with all my Emacs packages: <https://protesilaos.com/emacs>).
2022-06-10 16:01:46 +03:00
Protesilaos Stavrou 3e2b560548
Elaborate on the Overview of Denote 2022-06-10 14:21:55 +03:00
Protesilaos Stavrou 299b8970ee
Add support for notes in Markdown and Plain Text
The new user option 'denote-file-type' lets the user pick between the
aforementioned two or Org (which remains the default).
2022-06-10 13:29:36 +03:00
Protesilaos Stavrou e1bd4c9cb8
BREAKING Put keywords after the title
Putting the tags/keywords at the end of the file has several advantages:

1. It is consistent with how such interfaces are designed, such as with
   the 'elfeed', 'notmuch', and 'mu4e' Emacs packages.

2. It makes it easier to read the title of the file even if it is
   truncated.

3. Makes fontification look better, as the more intensely coloured
   keywords are further apart from the date/identifier which is also
   colourful.

One way to update existing file names in Dired:

* Switch to wdired (C-x C-q by default)
* M-x isearch-forward-regexp (bound to C-M-s by default)
* Search for (without the quotes) '--\(.*?\)--\(.*?\)\.org'
* While in isearch, type M-%
* For the replacement use (without the quotes) '--\2--\1.org'
* Verify the conversion as you go through the query-replace.

A similar series of steps can be followed for file contents (e.g. by
making the grep buffer editable with the wgrep package).
2022-06-10 08:08:37 +03:00
Protesilaos Stavrou db9584f51d
BREAKING Change date/identifier pattern
Before it was like 20220531_091625, but now it is 20220531T091625.

I also introduced a new face, in case someone wants to style the time
part separately.
2022-06-10 07:46:52 +03:00
Protesilaos Stavrou 9f192263db
Remove file path from front matter; improve links
It is not necessary to pollute the front matter with such details.
Files are always relative to the present directory.  The linking
facility is updated to work as intended (per commit 929157d).

This is an update on commit cfe6e98, which was reverted earlier by
8167d0c.
2022-06-10 05:43:42 +03:00
Protesilaos Stavrou 8167d0c30c
Revert "Stop recording the file path in the front matter"
This reverts commit cfe6e98e7b.

We actually need it for making links.  Perhaps we can find a way to only
rely on the identifier.  Will need to check this further.
2022-06-10 05:14:35 +03:00
Protesilaos Stavrou cfe6e98e7b
Stop recording the file path in the front matter
It ultimately is irrelevant as links are always relative to the current
directory.  Also see commit 929157d.
2022-06-10 05:12:05 +03:00
Protesilaos Stavrou 929157d424
Stop using link abbreviation
Links will now always be relative to the current directory and use the
standard "file:" prefix.

This means that other packages, like org-transclusion, will work with
our notes without further tweaks.
2022-06-10 05:05:21 +03:00
Protesilaos Stavrou eafc777268
Use 'denote-directory' function for '#+link'
The function ensures that the path is always returned as a directory.

This commit builds on dfc3a8f.  Thanks to Jack Baty for recognising the
problem.
2022-06-08 14:34:19 +03:00