branch: externals/denote-markdown commit db4b6a8607be149ce1304b79601263afd95201ec Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Rename denote-md-extras to denote-markdown --- denote-markdown.el | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/denote-markdown.el b/denote-markdown.el index d2242fdbe1..318f389f6f 100644 --- a/denote-markdown.el +++ b/denote-markdown.el @@ -1,4 +1,4 @@ -;;; denote-md-extras.el --- Denote extensions for Markdown mode -*- lexical-binding: t -*- +;;; denote-markdown.el --- Denote extensions for Markdown mode -*- lexical-binding: t -*- ;; Copyright (C) 2024-2025 Free Software Foundation, Inc. @@ -44,7 +44,7 @@ ;;;; Convert links -(defun denote-md-extras--get-regexp (type) +(defun denote-markdown--get-regexp (type) "Return regular expression to match link TYPE. TYPE is a symbol among `denote', `file', `obsidian', and `reverse-obsidian'." (pcase type @@ -55,7 +55,7 @@ TYPE is a symbol among `denote', `file', `obsidian', and `reverse-obsidian'." (_ (error "`%s' is an unknown type of link" type)))) ;;;###autoload -(defun denote-md-extras-convert-links-to-file-paths (&optional absolute) +(defun denote-markdown-convert-links-to-file-paths (&optional absolute) "Convert denote: links to file paths. Ignore all other link types. Also ignore links that do not resolve to a file in the variable `denote-directory'. @@ -67,7 +67,7 @@ relative to the variable `denote-directory'." (save-excursion (let ((count 0)) (goto-char (point-min)) - (while (re-search-forward (denote-md-extras--get-regexp 'denote) nil :no-error) + (while (re-search-forward (denote-markdown--get-regexp 'denote) nil :no-error) (when-let* ((id (match-string-no-properties 1)) (file (save-match-data (if absolute @@ -79,18 +79,18 @@ relative to the variable `denote-directory'." (user-error "The current file is not using Markdown mode"))) ;;;###autoload -(defun denote-md-extras-convert-links-to-denote-type () +(defun denote-markdown-convert-links-to-denote-type () "Convert generic file links to denote: links in the current Markdown buffer. Ignore all other link types. Also ignore file links that do not point to a file with a Denote file name. -Also see `denote-md-extras-convert-obsidian-links-to-denote-type'." +Also see `denote-markdown-convert-obsidian-links-to-denote-type'." (interactive nil markdown-mode) (if (derived-mode-p 'markdown-mode) (save-excursion (let ((count 0)) (goto-char (point-min)) - (while (re-search-forward (denote-md-extras--get-regexp 'file) nil :no-error) + (while (re-search-forward (denote-markdown--get-regexp 'file) nil :no-error) (let* ((file (match-string-no-properties 1)) (id (save-match-data (denote-retrieve-filename-identifier file)))) (when id @@ -100,7 +100,7 @@ Also see `denote-md-extras-convert-obsidian-links-to-denote-type'." (user-error "The current file is not using Markdown mode"))) ;;;###autoload -(defun denote-md-extras-convert-links-to-obsidian-type () +(defun denote-markdown-convert-links-to-obsidian-type () "Convert denote: links to Obsidian-style file paths. Ignore all other link types. Also ignore links that do not resolve to a file in the variable `denote-directory'." @@ -109,7 +109,7 @@ resolve to a file in the variable `denote-directory'." (save-excursion (let ((count 0)) (goto-char (point-min)) - (while (re-search-forward (denote-md-extras--get-regexp 'obsidian) nil :no-error) + (while (re-search-forward (denote-markdown--get-regexp 'obsidian) nil :no-error) (when-let* ((id (match-string-no-properties 1)) (path (save-match-data (denote-get-relative-path-by-id id))) (name (file-name-sans-extension path))) @@ -119,18 +119,18 @@ resolve to a file in the variable `denote-directory'." (user-error "The current file is not using Markdown mode"))) ;;;###autoload -(defun denote-md-extras-convert-obsidian-links-to-denote-type () +(defun denote-markdown-convert-obsidian-links-to-denote-type () "Convert Obsidian-style links to denote: links in the current Markdown buffer. Ignore all other link types. Also ignore file links that do not point to a file with a Denote file name. -Also see `denote-md-extras-convert-links-to-denote-type'." +Also see `denote-markdown-convert-links-to-denote-type'." (interactive nil markdown-mode) (if (derived-mode-p 'markdown-mode) (save-excursion (let ((count 0)) (goto-char (point-min)) - (while (re-search-forward (denote-md-extras--get-regexp 'reverse-obsidian) nil :no-error) + (while (re-search-forward (denote-markdown--get-regexp 'reverse-obsidian) nil :no-error) (let ((file nil) (id nil) (description nil)) @@ -144,5 +144,5 @@ Also see `denote-md-extras-convert-links-to-denote-type'." (message "Converted %d Obsidian-style links to `denote:' links" count))) (user-error "The current file is not using Markdown mode"))) -(provide 'denote-md-extras) -;;; denote-md-extras.el ends here +(provide 'denote-markdown) +;;; denote-markdown.el ends here