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

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

[elpa] externals/denote dee430a586 1/2: Fix: Handle signature in denote-


From: ELPA Syncer
Subject: [elpa] externals/denote dee430a586 1/2: Fix: Handle signature in denote-dired-rename-marked-files-with-keywords
Date: Sat, 18 Nov 2023 03:57:55 -0500 (EST)

branch: externals/denote
commit dee430a58676bd95eae627c268f93f4b264da613
Author: Vedang Manerikar <ved.manerikar@gmail.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    Fix: Handle signature in denote-dired-rename-marked-files-with-keywords
    
    I hit this bug when I called `M-x
    denote-dired-rename-marked-files-with-keywords` on the file at point
    in a dired buffer. The stack-trace is as follows:
    
    ```
    Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
      replace-regexp-in-string("[][{}!@#$%^&*()=+'\"?,.|;:~`‘’“”/]*-" "" nil)
      denote--slug-no-punct(nil "-")
      denote-sluggify-signature(nil)
      denote-dired-rename-marked-files-with-keywords()
      ```
    
    `denote-sluggify-signature` gets a `nil` input which it cannot handle.
    This happens because the signature is extracted using
    `denote-retrieve-filename-signature`, which can return a `nil` value.
    
    The fix is to only call `denote-sluggify-signature` when we have a
    signature to handle.
---
 denote.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/denote.el b/denote.el
index 23e074d24f..9d8e006f73 100644
--- a/denote.el
+++ b/denote.el
@@ -2530,7 +2530,7 @@ Specifically, do the following:
                  (file-type (denote-filetype-heuristics file))
                  (title (denote--retrieve-title-or-filename file file-type))
                  (extension (denote-get-file-extension file))
-                 (new-name (denote-format-file-name dir id keywords 
(denote-sluggify title 'title) extension (denote-sluggify-signature 
signature))))
+                 (new-name (denote-format-file-name dir id keywords 
(denote-sluggify title 'title) extension (when signature 
(denote-sluggify-signature signature)))))
             (denote-rename-file-and-buffer file new-name)
             (when (denote-file-is-writable-and-supported-p new-name)
               (if (denote--edit-front-matter-p new-name file-type)



reply via email to

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