From e029ea87f69a0711fcfda6713cc392b4b8fe89ed Mon Sep 17 00:00:00 2001 From: Riyyi Date: Tue, 23 Mar 2021 15:09:44 +0100 Subject: [PATCH] Convert C++ to cpp in org-roam-title-to-slug function --- .config/emacs/config.org | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.config/emacs/config.org b/.config/emacs/config.org index 2794d28..0b34680 100644 --- a/.config/emacs/config.org +++ b/.config/emacs/config.org @@ -1361,8 +1361,9 @@ If point is on: #+BEGIN_SRC emacs-lisp (defun dot/org-roam-title-to-slug (title) "Convert TITLE to a filename-suitable slug, strip out common words." - (let ((common-words '("a" "an" "and" "as" "at" "by" "is" "it" "of" "the" "to")) - (words (split-string (org-roam--title-to-slug title) "\_"))) + (let* ((common-words '("a" "an" "and" "as" "at" "by" "is" "it" "of" "the" "to")) + (title (replace-regexp-in-string "\\(c\\+\\+\\)" "cpp" title)) + (words (split-string (org-roam--title-to-slug title) "\_"))) (string-join (seq-remove (lambda (element) (member element common-words)) words) "_"))) #+END_SRC