Closed shogunverde closed 3 years ago
I guess this may be caused by the empty attach-dir. Try the newest version. If this still doesn't work, call edebug-defun
on function org-media-note-mpv-smart-play
and show me the debug info.
Thank you very much I will do it very soon.
I have tried the newest version, but I got the same error too.
I got this error too. There is no check to see if .cache exists before proceding so it fails if ~/.emacs.d/.cache does not exist.
Could someone post the debug info?
It works well in my environment and I can't reproduce this error.
Debugger entered--Lisp error: (void-function org-media-note-get-media-file-by-key)
apply(debug error (void-function org-media-note-get-media-file-by-key))
edebug(error (void-function org-media-note-get-media-file-by-key))
(org-media-note-get-media-file-by-key key)
(let* ((key (org-media-note--current-org-ref-key)) (media-file-by-key (org-media-note-get-media-file-by-key key)) (media-url-by-key (org-media-note-get-url-by-key key)) (attach-dir (if (org-attach-dir) (format "%s/" (org-attach-dir))))) (cond ((and (org-media-note-ref-cite-p) media-file-by-key) (mpv-play media-file-by-key)) ((and (org-media-note-ref-cite-p) media-url-by-key) (org-media-note--mpv-play-online-video media-url-by-key)) (attach-dir (let* ((media-files-in-attach-dir (org-media-note--media-files-in-dir attach-dir)) (number-of-media-files (length media-files-in-attach-dir))) (if (= 1 number-of-media-files) (mpv-play (car media-files-in-attach-dir)) (mpv-play (read-file-name "File to play: " attach-dir))))) (t (if (y-or-n-p "Local media (`n` to enter remote URL)? ") (mpv-play (read-file-name "File to play: ")) (org-media-note-play-online-video)))))
org-media-note-mpv-smart-play()
backtrace-eval((org-media-note-mpv-smart-play) 0 edebug-after)
edebug-eval((org-media-note-mpv-smart-play))
edebug-eval-expression((org-media-note-mpv-smart-play))
edebug-eval-last-sexp(nil)
funcall-interactively(edebug-eval-last-sexp nil)
call-interactively(edebug-eval-last-sexp nil nil)
command-execute(edebug-eval-last-sexp)
recursive-edit()
#f(compiled-function (arg-mode) #<bytecode 0x1563754ccea1>)(before)
transient--edebug--recursive-edit(#f(compiled-function (arg-mode) #<bytecode 0x1563754ccea1>) before)
apply(transient--edebug--recursive-edit #f(compiled-function (arg-mode) #<bytecode 0x1563754ccea1>) before)
edebug--recursive-edit(before)
edebug--display-1(nil 0 before)
edebug--display(nil 0 before)
edebug-debugger(0 before nil)
edebug-before(0)
(edebug-after (edebug-before 0) 1 (org-media-note-mpv-smart-play))
(closure (t) nil (edebug-after (edebug-before 0) 1 (org-media-note-mpv-smart-play)))()
edebug-default-enter(edebug-anon0 nil (closure (t) nil (edebug-after (edebug-before 0) 1 (org-media-note-mpv-smart-play))))
edebug-default-enter(edebug-anon0 nil (closure (t) nil (edebug-after (edebug-before 0) 1 (org-media-note-mpv-smart-play))))
edebug-enter(edebug-anon0 nil (closure (t) nil (edebug-after (edebug-before 0) 1 (org-media-note-mpv-smart-play))))
eval((edebug-enter 'edebug-anon0 nil #'(lambda nil (edebug-after (edebug-before 0) 1 (org-media-note-mpv-smart-play)))) t)
eval-expression((edebug-enter 'edebug-anon0 nil #'(lambda nil (edebug-after (edebug-before 0) 1 (org-media-note-mpv-smart-play)))))
edebug-defun()
funcall-interactively(edebug-defun)
call-interactively(edebug-defun record nil)
command-execute(edebug-defun record)
counsel-M-x-action("edebug-defun")
ivy-call()
ivy-read("M-x " ("edebug-defun" "customize-group" "smartparens-mode" "my-copy-simple" "imenu" "lispy-mode" "emacs-lisp-mode" "org-clock-in-last" "quickrun" "mu4e" "org-mode" "variable-pitch-mode" "load-theme" "package-delete" "org-ref-insert-link" "calibredb" "flyspell-mode" "replace-regexp" "wttrin-display-weather-in-mode-line" "package-install" "wttrin-cancel-display-in-mode-line" "compose-mail" "counsel-git-grep" "lisp-interaction-mode" "org-roam-setup" "org-roam-ref-add" "org-display-inline-images" "org-ref-insert-bibliography-link" "eval-buffer" "dashboard-mode" "org-noter" "package-list-packages" "Eli/dict-search" "org-ref" "org-publish" "query-replace-regexp" "dired-mark-files-regexp" "dashboard-refresh-buffer" "package-refresh-contents" "org-roam-graph" "golden-ratio-mode" "wttrin" "counsel-rg" "org-remove-file" "doom-modeline-mode" "hydra-org-agenda/body" "helm-org-rifle-current-buffer" "magit" "ansi-term" "ace-window" ...) :predicate counsel--M-x-externs-predicate :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
counsel-M-x()
funcall-interactively(counsel-M-x)
call-interactively(counsel-M-x nil nil)
command-execute(counsel-M-x)
我有同样的问题,直接用命令行打开之后,其他功能都是没问题的
Sorry for the late reply.
Finally, I found the reason was that org-media-note-mpv-smart-play
would call org-media-note-get-media-file-by-key
even if one don't use org-ref. Thanks @Elilif for providing the debug info.
Try the newest version. Also check the readme for the right config.
Its always the same . If you Can help me, i will be very thankful