Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M-x zetteldeft-new-file C-c d n ERROR #88

Open
OrionRandD opened this issue Oct 27, 2020 · 7 comments
Open

M-x zetteldeft-new-file C-c d n ERROR #88

OrionRandD opened this issue Oct 27, 2020 · 7 comments

Comments

@OrionRandD
Copy link

I am geting this error

zetteldeft-new-file: Wrong number of arguments: ((t) nil "Generate an ID in the format of `zetteldeft-id-format'." (format-time-string 'zetteldeft-id-format)), 1

on calling

M-x zetteldeft-new-file C-c d n

;;;;;;;;;;;;;;;;;;

It was working without problems until I upgraded to
Emacs27.1 on GNU/Linux Debian yesterday

And my config is as follows:

(use-package! deft
:custom
(deft-directory "/org/deft-notes")
(deft-extensions '("org" "md"))
(deft-recursive t)
(deft-use-filename-as-title nil)
(deft-filter-only-filenames t)
(deft-auto-save-interval 30.0)
(deft-file-limit 200))

(defun cypher/deft-open-other ()
(interactive)
(deft-open-file-other-window t))

(defun cypher/deft-open-preview ()
(interactive)
(deft-open-file-other-window))

(with-eval-after-load 'deft
(define-key deft-mode-map
(kbd "") 'cypher/deft-open-preview)
(define-key deft-mode-map
(kbd "") 'cypher/deft-open-other)
(define-key deft-mode-map
(kbd "s-j") 'evil-next-line)
(define-key deft-mode-map (kbd "s-k") 'evil-previous-line))

(setq deft-strip-summary-regexp
(concat "\("
"[\n\t]" ;; blank
"\|^#\+[a-zA-Z_]+:.*$" ;;org-mode metadata
"\)"))

;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(use-package! zetteldeft
:after deft
:config
(setq deft-new-file-format zetteldeft-id-format)
(zetteldeft-set-classic-keybindings))

(defun zetteldeft-generate-id ()
"Generate an ID in the format of `zetteldeft-id-format'."
(format-time-string 'zetteldeft-id-format))

;; a fix to the bug
;; #70 (comment)

;; This was an attempt to fix the bug
;; (after! zetteldeft
;; (setq zetteldeft-title-prefix nil))
;;
;; let us try this one

(set-file-template! "\.org$" :ignore t)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

@EFLS
Copy link
Owner

EFLS commented Oct 27, 2020

The problem is with your defun zetteldeft-generate-id. Unless you want to change how IDs are generated, you shouldn't need to define the function yourself (and if you do, make sure it takes arguments -- see the docs).

So remove that defun and it should work fine (same as #87).

@OrionRandD
Copy link
Author

OrionRandD commented Oct 27, 2020 via email

@OrionRandD
Copy link
Author

OrionRandD commented Nov 2, 2020 via email

@EFLS
Copy link
Owner

EFLS commented Nov 2, 2020

No clue what would cause that, to be honest, as neither of those functions are called by Zetteldeft.

Is Deft itself working fine? Can you create new notes via the classic Deft functions?

@OrionRandD
Copy link
Author

OrionRandD commented Nov 2, 2020 via email

@EFLS
Copy link
Owner

EFLS commented Nov 26, 2020

Did you get your issue fixed, @OrionRandD?

@OrionRandD
Copy link
Author

OrionRandD commented Nov 27, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants