emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/denote fe348c5a18 4/5: Add denote--desluggify helper


From: ELPA Syncer
Subject: [elpa] externals/denote fe348c5a18 4/5: Add denote--desluggify helper
Date: Mon, 15 Aug 2022 06:57:29 -0400 (EDT)

branch: externals/denote
commit fe348c5a18eba79a3554b6c296e63bed20d47d66
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Add denote--desluggify helper
    
    This is based on the idea of Peter Prevos from commit 0ac3680.  Peter
    sent the code on the GitHub mirror, as pull request 93:
    <https://github.com/protesilaos/denote/pull/93>.
---
 denote.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/denote.el b/denote.el
index ec1e05ea42..a54b313e22 100644
--- a/denote.el
+++ b/denote.el
@@ -418,6 +418,10 @@ trailing hyphen."
             #'denote--sluggify-and-join)
           keywords))
 
+(defun denote--desluggify (str)
+  "Capitalize and dehyphenate STR, inverting `denote--sluggify'."
+  (capitalize (replace-regexp-in-string "-" " " str)))
+
 (defun denote--file-empty-p (file)
   "Return non-nil if FILE is empty."
   (zerop (or (file-attribute-size (file-attributes file)) 0)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]