branch: externals/denote commit 2a5dfea29bba57f44f4a7c02b18615fbad69ada3 Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Rename denote-change-file-type to avoid confusion --- README.org | 18 +++++++++++------- denote.el | 7 ++++++- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/README.org b/README.org index b62b288752..f7794d3b0f 100644 --- a/README.org +++ b/README.org @@ -1265,19 +1265,23 @@ respective front matter. :CUSTOM_ID: h:85b65995-89fd-4978-bba3-7bb6c8d6f945 :END: -#+findex: denote-change-file-type -The command ~denote-change-file-type~ provides the convenience of -converting a note taken in one file type, say, =.txt= into another -like =.org=. It presents a choice among the ~denote-file-type~ -options. +[ The command is renamed from ~denote-change-file-type~ to + ~denote-change-file-type-and-front-matter~ as part of {{{development-version}}} + because some users thought it was performing full text conversion. ] + +#+findex: denote-change-file-type-and-front-matter +The command ~denote-change-file-type-and-front-matter~ provides the +convenience of converting a note taken in one file type, say, =.txt= +into another like =.org=. It presents a choice among the +~denote-file-type~ options. The conversion does NOT modify the existing front matter. Instead, it prepends new front matter to the top of the file. We do this as a safety precaution since the user can, in principle, add arbitrary extras to their front matter that we would not want to touch. -If in Dired, ~denote-change-file-type~ operates on the file at point, -else it prompts with minibuffer completion for one. +If in Dired, ~denote-change-file-type-and-front-matter~ operates on +the file at point, else it prompts with minibuffer completion for one. The title of the file is retrieved from a line starting with a title field in the file's front matter, depending on the previous file type diff --git a/denote.el b/denote.el index 3d3bddf373..ae1edb157e 100644 --- a/denote.el +++ b/denote.el @@ -2349,8 +2349,13 @@ files)." (denote-rewrite-front-matter new-name title keywords file-type) (denote--add-front-matter new-name title keywords id file-type)))))) +(define-obsolete-function-alias + 'denote-change-file-type + 'denote-change-file-type-and-front-matter + "2.1.0") + ;;;###autoload -(defun denote-change-file-type (file new-file-type) +(defun denote-change-file-type-and-front-matter (file new-file-type) "Change file type of FILE and add an appropriate front matter. If in Dired, consider FILE to be the one at point, else prompt