[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote-journal 900fd2bce7 2/8: Rename denote-journal-ex
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote-journal 900fd2bce7 2/8: Rename denote-journal-extras to denote-journal |
Date: |
Fri, 14 Mar 2025 03:59:16 -0400 (EDT) |
branch: externals/denote-journal
commit 900fd2bce7030c73fd8ca8cda244312ee9fcc853
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Rename denote-journal-extras to denote-journal
---
denote-journal.el | 132 +++++++++++++++++++++++++++---------------------------
1 file changed, 66 insertions(+), 66 deletions(-)
diff --git a/denote-journal.el b/denote-journal.el
index 4de9e06b80..1fc097e787 100644
--- a/denote-journal.el
+++ b/denote-journal.el
@@ -1,4 +1,4 @@
-;;; denote-journal-extras.el --- Convenience functions for daily journaling
-*- lexical-binding: t; -*-
+;;; denote-journal.el --- Convenience functions for daily journaling -*-
lexical-binding: t; -*-
;; Copyright (C) 2023-2025 Free Software Foundation, Inc.
@@ -31,13 +31,13 @@
(require 'denote)
-(defgroup denote-journal-extras nil
+(defgroup denote-journal nil
"Denote for daily journaling."
:group 'denote
:link '(info-link "(denote) Top")
:link '(url-link :tag "Homepage" "https://protesilaos.com/emacs/denote"))
-(defcustom denote-journal-extras-directory
+(defcustom denote-journal-directory
(expand-file-name "journal" denote-directory)
"Directory for storing daily journal entries.
This can either be the same as the variable `denote-directory' or
@@ -46,20 +46,20 @@ a subdirectory of it.
A value of nil means to use the variable `denote-directory'.
Journal entries will thus be in a flat listing together with all
other notes. They can still be retrieved easily by searching for
-the variable `denote-journal-extras-keyword'."
- :group 'denote-journal-extras
+the variable `denote-journal-keyword'."
+ :group 'denote-journal
:type '(choice (directory :tag "Provide directory path (is created if
missing)")
(const :tag "Use the `denote-directory'" nil)))
-(defcustom denote-journal-extras-keyword "journal"
+(defcustom denote-journal-keyword "journal"
"Single word keyword or list of keywords to tag journal entries.
-It is used by `denote-journal-extras-new-entry' (or related)."
- :group 'denote-journal-extras
+It is used by `denote-journal-new-entry' (or related)."
+ :group 'denote-journal
:type '(choice (string :tag "Keyword")
(repeat :tag "List of keywords" string)))
-(defcustom denote-journal-extras-title-format 'day-date-month-year-24h
- "Date format to construct the title with `denote-journal-extras-new-entry'.
+(defcustom denote-journal-title-format 'day-date-month-year-24h
+ "Date format to construct the title with `denote-journal-new-entry'.
The value is either a symbol or an arbitrary string that is
passed to `format-time-string' (consult its documentation for the
technicalities).
@@ -73,11 +73,11 @@ Acceptable symbols and their corresponding styles are:
| day-date-month-year-24h | Monday 19 September 2023 20:49 |
| day-date-month-year-12h | Monday 19 September 2023 08:49 PM |
-With a nil value, make `denote-journal-extras-new-entry' prompt
+With a nil value, make `denote-journal-new-entry' prompt
for a title."
- :group 'denote-journal-extras
+ :group 'denote-journal
:type '(choice
- (const :tag "Prompt for title with
`denote-journal-extras-new-entry'" nil)
+ (const :tag "Prompt for title with `denote-journal-new-entry'" nil)
(const :tag "Monday"
:doc "The `format-time-string' is: %A"
day)
@@ -92,53 +92,53 @@ for a title."
day-date-month-year-12h)
(string :tag "Custom string with `format-time-string' specifiers")))
-(defcustom denote-journal-extras-hook nil
- "Normal hook called after `denote-journal-extras-new-entry'.
+(defcustom denote-journal-hook nil
+ "Normal hook called after `denote-journal-new-entry'.
Use this to, for example, set a timer after starting a new
journal entry (refer to the `tmr' package on GNU ELPA)."
- :group 'denote-journal-extras
+ :group 'denote-journal
:type 'hook)
-(defun denote-journal-extras-directory ()
- "Make the variable `denote-journal-extras-directory' and its parents."
- (if-let* (((stringp denote-journal-extras-directory))
- (directory (file-name-as-directory (expand-file-name
denote-journal-extras-directory))))
+(defun denote-journal-directory ()
+ "Make the variable `denote-journal-directory' and its parents."
+ (if-let* (((stringp denote-journal-directory))
+ (directory (file-name-as-directory (expand-file-name
denote-journal-directory))))
(progn
- (when (not (file-directory-p denote-journal-extras-directory))
+ (when (not (file-directory-p denote-journal-directory))
(make-directory directory :parents))
directory)
(denote-directory)))
-(defun denote-journal-extras-keyword ()
- "Return the value of the variable `denote-journal-extras-keyword' as a list."
- (if (stringp denote-journal-extras-keyword)
- (list denote-journal-extras-keyword)
- denote-journal-extras-keyword))
+(defun denote-journal-keyword ()
+ "Return the value of the variable `denote-journal-keyword' as a list."
+ (if (stringp denote-journal-keyword)
+ (list denote-journal-keyword)
+ denote-journal-keyword))
-(defun denote-journal-extras--keyword-regex ()
+(defun denote-journal--keyword-regex ()
"Return a regular expression string that matches the journal keyword(s)."
- (let ((keywords-sorted (mapcar #'regexp-quote (denote-keywords-sort
(denote-journal-extras-keyword)))))
+ (let ((keywords-sorted (mapcar #'regexp-quote (denote-keywords-sort
(denote-journal-keyword)))))
(concat "_" (string-join keywords-sorted ".*_"))))
-(defun denote-journal-extras-file-is-journal-p (file)
+(defun denote-journal-file-is-journal-p (file)
"Return non-nil if FILE is a journal entry."
(and (denote-file-is-note-p file)
- (string-match-p (denote-journal-extras--keyword-regex)
(file-name-nondirectory file))))
+ (string-match-p (denote-journal--keyword-regex) (file-name-nondirectory
file))))
-(defun denote-journal-extras-filename-is-journal-p (filename)
+(defun denote-journal-filename-is-journal-p (filename)
"Return non-nil if FILENAME is a valid name for a journal entry."
(and (denote-filename-is-note-p filename)
- (string-match-p (denote-journal-extras--keyword-regex)
(file-name-nondirectory filename))))
+ (string-match-p (denote-journal--keyword-regex) (file-name-nondirectory
filename))))
-(defun denote-journal-extras-daily--title-format (&optional date)
- "Return present date in `denote-journal-extras-title-format' or prompt for
title.
+(defun denote-journal-daily--title-format (&optional date)
+ "Return present date in `denote-journal-title-format' or prompt for title.
With optional DATE, use it instead of the present date. DATE has
the same format as that returned by `current-time'."
(format-time-string
- (if (and denote-journal-extras-title-format
- (stringp denote-journal-extras-title-format))
- denote-journal-extras-title-format
- (pcase denote-journal-extras-title-format
+ (if (and denote-journal-title-format
+ (stringp denote-journal-title-format))
+ denote-journal-title-format
+ (pcase denote-journal-title-format
('day "%A")
('day-date-month-year "%A %e %B %Y")
('day-date-month-year-24h "%A %e %B %Y %H:%M")
@@ -146,24 +146,24 @@ the same format as that returned by `current-time'."
(_ (denote-title-prompt (format-time-string "%F" date)))))
date))
-(defun denote-journal-extras--get-template ()
+(defun denote-journal--get-template ()
"Return template that has `journal' key in `denote-templates'.
If no template with `journal' key exists but `denote-templates'
is non-nil, prompt the user for a template among
`denote-templates'. Else return nil.
-Also see `denote-journal-extras-new-entry'."
+Also see `denote-journal-new-entry'."
(if-let* ((template (alist-get 'journal denote-templates)))
template
(when denote-templates
(denote-template-prompt))))
;;;###autoload
-(defun denote-journal-extras-new-entry (&optional date)
- "Create a new journal entry in variable `denote-journal-extras-directory'.
-Use the variable `denote-journal-extras-keyword' as a keyword for the
+(defun denote-journal-new-entry (&optional date)
+ "Create a new journal entry in variable `denote-journal-directory'.
+Use the variable `denote-journal-keyword' as a keyword for the
newly created file. Set the title of the new entry according to the
-value of the user option `denote-journal-extras-title-format'.
+value of the user option `denote-journal-title-format'.
With optional DATE as a prefix argument, prompt for a date. If
`denote-date-prompt-use-org-read-date' is non-nil, use the Org
@@ -174,15 +174,15 @@ that covered in the documentation of the `denote'
function. It
is internally processed by `denote-valid-date-p'."
(interactive (list (when current-prefix-arg (denote-date-prompt))))
(let ((internal-date (or (denote-valid-date-p date) (current-time)))
- (denote-directory (denote-journal-extras-directory)))
+ (denote-directory (denote-journal-directory)))
(denote
- (denote-journal-extras-daily--title-format internal-date)
- (denote-journal-extras-keyword)
+ (denote-journal-daily--title-format internal-date)
+ (denote-journal-keyword)
nil nil date
- (denote-journal-extras--get-template))
- (run-hooks 'denote-journal-extras-hook)))
+ (denote-journal--get-template))
+ (run-hooks 'denote-journal-hook)))
-(defun denote-journal-extras--filename-date-regexp (&optional date)
+(defun denote-journal--filename-date-regexp (&optional date)
"Regular expression to match journal entries for today or optional DATE.
DATE has the same format as that returned by `denote-valid-date-p'."
(let* ((identifier (format "%sT[0-9]\\{6\\}" (format-time-string "%Y%m%d"
date)))
@@ -190,21 +190,21 @@ DATE has the same format as that returned by
`denote-valid-date-p'."
(id-index (seq-position order 'identifier))
(kw-index (seq-position order 'keywords)))
(if (> kw-index id-index)
- (format "%s.*?_%s" identifier (denote-journal-extras--keyword-regex))
- (format "_%s.*?@@%s" (denote-journal-extras--keyword-regex)
identifier))))
+ (format "%s.*?_%s" identifier (denote-journal--keyword-regex))
+ (format "_%s.*?@@%s" (denote-journal--keyword-regex) identifier))))
-(defun denote-journal-extras--entry-today (&optional date)
+(defun denote-journal--entry-today (&optional date)
"Return list of files matching a journal for today or optional DATE.
DATE has the same format as that returned by `denote-valid-date-p'."
- (denote-directory-files (denote-journal-extras--filename-date-regexp date)))
+ (denote-directory-files (denote-journal--filename-date-regexp date)))
(define-obsolete-function-alias
'denote-journal-extra-path-to-new-or-existing-entry
- 'denote-journal-extras-path-to-new-or-existing-entry
+ 'denote-journal-path-to-new-or-existing-entry
"3.2.0")
;;;###autoload
-(defun denote-journal-extras-path-to-new-or-existing-entry (&optional date)
+(defun denote-journal-path-to-new-or-existing-entry (&optional date)
"Return path to existing or new journal file.
With optional DATE, do it for that date, else do it for today. DATE is
a string and has the same format as that covered in the documentation of
@@ -215,7 +215,7 @@ If there are multiple journal entries for the date, prompt
for one among
them using minibuffer completion. If there is only one, return it. If
there is no journal entry, create it."
(let* ((internal-date (or (denote-valid-date-p date) (current-time)))
- (files (denote-journal-extras--entry-today internal-date)))
+ (files (denote-journal--entry-today internal-date)))
(cond
((length> files 1)
(completing-read "Select journal entry: " files nil t))
@@ -223,15 +223,15 @@ there is no journal entry, create it."
(car files))
(t
(save-window-excursion
- (denote-journal-extras-new-entry date)
+ (denote-journal-new-entry date)
(save-buffer)
(buffer-file-name))))))
;;;###autoload
-(defun denote-journal-extras-new-or-existing-entry (&optional date)
+(defun denote-journal-new-or-existing-entry (&optional date)
"Locate an existing journal entry or create a new one.
A journal entry is one that has the value of the variable
-`denote-journal-extras-keyword' as part of its file name.
+`denote-journal-keyword' as part of its file name.
If there are multiple journal entries for the current date,
prompt for one using minibuffer completion. If there is only
@@ -249,13 +249,13 @@ It is internally processed by `denote-valid-date-p'."
(list
(when current-prefix-arg
(denote-date-prompt))))
- (find-file (denote-journal-extras-path-to-new-or-existing-entry date)))
+ (find-file (denote-journal-path-to-new-or-existing-entry date)))
;;;###autoload
-(defun denote-journal-extras-link-or-create-entry (&optional date id-only)
+(defun denote-journal-link-or-create-entry (&optional date id-only)
"Use `denote-link' on journal entry, creating it if necessary.
A journal entry is one that has the value of the variable
-`denote-journal-extras-keyword' as part of its file name.
+`denote-journal-keyword' as part of its file name.
If there are multiple journal entries for the current date,
prompt for one using minibuffer completion. If there is only
@@ -277,11 +277,11 @@ file's title. This has the same meaning as in
`denote-link'."
(pcase current-prefix-arg
('(16) (list (denote-date-prompt) :id-only))
('(4) (list (denote-date-prompt)))))
- (let ((path (denote-journal-extras-path-to-new-or-existing-entry date)))
+ (let ((path (denote-journal-path-to-new-or-existing-entry date)))
(denote-link path
(denote-filetype-heuristics (buffer-file-name))
(denote-get-link-description path)
id-only)))
-(provide 'denote-journal-extras)
-;;; denote-journal-extras.el ends here
+(provide 'denote-journal)
+;;; denote-journal.el ends here
- [elpa] branch externals/denote-journal created (now f6061c49c4), ELPA Syncer, 2025/03/14
- [elpa] externals/denote-journal 69fdb3c027 1/8: Move file out of the main Denote directory WORK-IN-PROGRESS, ELPA Syncer, 2025/03/14
- [elpa] externals/denote-journal 900fd2bce7 2/8: Rename denote-journal-extras to denote-journal,
ELPA Syncer <=
- [elpa] externals/denote-journal 64b3e603d5 3/8: Update the header to make it stand out as a package, ELPA Syncer, 2025/03/14
- [elpa] externals/denote-journal 45f6ff6640 4/8: Update the description of the package, ELPA Syncer, 2025/03/14
- [elpa] externals/denote-journal 2c4c6fa6ef 6/8: Add a gitignore file to the repository, ELPA Syncer, 2025/03/14
- [elpa] externals/denote-journal 2f41e137b5 7/8: Write the manual of denote-journal, ELPA Syncer, 2025/03/14
- [elpa] externals/denote-journal c42eb73d74 5/8: Update the README.md of denote-journal, ELPA Syncer, 2025/03/14
- [elpa] externals/denote-journal f6061c49c4 8/8: Add .elpaignore file for GNU ELPA, ELPA Syncer, 2025/03/14