From ea91cc015f396f9831379b4f4780bf4e47e671d9 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Tue, 15 Jun 2021 18:39:23 +0200 Subject: [PATCH] Fix wrong regex --- org-unique-id.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/org-unique-id.el b/org-unique-id.el index 26732f9..338c094 100644 --- a/org-unique-id.el +++ b/org-unique-id.el @@ -71,7 +71,7 @@ the variable `org-unique-id-prefix'." (progn (require 'message) (concat "@" (message-make-fqdn)))))) - (concat prefix (car (split-string (concat etime postfix) "-"))))) + (concat prefix "-" (car (split-string (concat etime postfix) "-"))))) ;;;###autoload (defun org-unique-id-get (&optional pom create prefix) @@ -90,11 +90,11 @@ CUSTOM_ID of the entry is returned." (replace-regexp-in-string "[_-][_-]+" "-" (replace-regexp-in-string - (rx (or alpha num "-" "_")) + "[^[:alpha:][:digit:]-_]" "-" (if (string= orgpath "") (org-get-heading t t t t) - (concat orgpath "_" (org-get-heading t t t t))))))) + (concat orgpath "-" (org-get-heading t t t t))))))) (id (org-entry-get nil "CUSTOM_ID"))) (cond ((and id @@ -106,7 +106,6 @@ CUSTOM_ID of the entry is returned." (buffer-file-name (buffer-base-buffer))) id))))) - ;;;###autoload (defun org-unique-id () "Add a CUSTOM_ID to all headers missing one.