|
|
@ -1361,8 +1361,9 @@ If point is on: |
|
|
|
#+BEGIN_SRC emacs-lisp |
|
|
|
#+BEGIN_SRC emacs-lisp |
|
|
|
(defun dot/org-roam-title-to-slug (title) |
|
|
|
(defun dot/org-roam-title-to-slug (title) |
|
|
|
"Convert TITLE to a filename-suitable slug, strip out common words." |
|
|
|
"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")) |
|
|
|
(let* ((common-words '("a" "an" "and" "as" "at" "by" "is" "it" "of" "the" "to")) |
|
|
|
(words (split-string (org-roam--title-to-slug title) "\_"))) |
|
|
|
(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) "_"))) |
|
|
|
(string-join (seq-remove (lambda (element) (member element common-words)) words) "_"))) |
|
|
|
#+END_SRC |
|
|
|
#+END_SRC |
|
|
|
|
|
|
|
|
|
|
|