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

(wrong-type-argument integer-or-marker-p nil) #17

Open
Mercurius-Lee opened this issue Aug 12, 2023 · 2 comments
Open

(wrong-type-argument integer-or-marker-p nil) #17

Mercurius-Lee opened this issue Aug 12, 2023 · 2 comments

Comments

@Mercurius-Lee
Copy link

        (end (save-excursion (goto-char (plist-get node :end)) (skip-chars-backward " \t") (point))))

在mpv的链接中执行命令时,mpvi-parse-link-at-point 函数报错,执行(node(cadr org-element-context))得到的node 中并没有 :end 参数。源码中的:end 指的是?

@lorniu
Copy link
Owner

lorniu commented Mar 9, 2024

能不能提供下链接我测试下?:end 来自 org-element.el 对 org 的解析,表示这个链接结束的位置。

@qingshuizheng
Copy link

qingshuizheng commented Jul 26, 2024

能不能提供下链接我测试下?:end 来自 org-element.el 对 org 的解析,表示这个链接结束的位置。

我也遇到了,测试视频:https://www.bilibili.com/video/BV1cW42197mq

错误:

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  goto-char(nil)
  (save-excursion (goto-char (plist-get node :end)) (skip-chars-backward " \11") (point))
  (let ((meta (mpvi-parse-link (plist-get node :path))) (end (save-excursion (goto-char (plist-get node :end)) (skip-chars-backward " \11") (point)))) (cons ':path (cons (car meta) (cons ':vbeg (cons (car (cdr meta)) (cons ':vend (cons (car ...) (cons ... ...))))))))
  (progn (let ((meta (mpvi-parse-link (plist-get node :path))) (end (save-excursion (goto-char (plist-get node :end)) (skip-chars-backward " \11") (point)))) (cons ':path (cons (car meta) (cons ':vbeg (cons (car (cdr meta)) (cons ':vend (cons ... ...))))))))
  (if (equal "mpv" (plist-get node :type)) (progn (let ((meta (mpvi-parse-link (plist-get node :path))) (end (save-excursion (goto-char (plist-get node :end)) (skip-chars-backward " \11") (point)))) (cons ':path (cons (car meta) (cons ':vbeg (cons (car ...) (cons ... ...))))))))
  (let ((node (car (cdr (org-element-context))))) (if (equal "mpv" (plist-get node :type)) (progn (let ((meta (mpvi-parse-link (plist-get node :path))) (end (save-excursion (goto-char ...) (skip-chars-backward " \11") (point)))) (cons ':path (cons (car meta) (cons ':vbeg (cons ... ...))))))))
  mpvi-parse-link-at-point()
  (let ((node (mpvi-parse-link-at-point))) (if (and node (not (equal (plist-get node :path) (mpvi-origin-path)))) (progn (user-error "Current link is not the actived one, do nothing"))) (if node (progn (let ((ret (mpvi-seek (or ... ...) (format "Set end position (%d-%d): " ... ...)))) (delete-region (plist-get node :begin) (plist-get node :end)) (let ((link (funcall mpvi-build-link-function ... ... ...))) (save-excursion (insert link)))))))
  (progn (mpvi-check-live) (let ((node (mpvi-parse-link-at-point))) (if (and node (not (equal (plist-get node :path) (mpvi-origin-path)))) (progn (user-error "Current link is not the actived one, do nothing"))) (if node (progn (let ((ret (mpvi-seek ... ...))) (delete-region (plist-get node :begin) (plist-get node :end)) (let ((link ...)) (save-excursion (insert link))))))))
  mpvi-current-link-update-end-pos()
  funcall-interactively(mpvi-current-link-update-end-pos)
  call-interactively(mpvi-current-link-update-end-pos nil nil)
  command-execute(mpvi-current-link-update-end-pos)

对以下mpvi中的链接执行:(cadr (org-element-context)),内容为:

[[mpv:https://www.bilibili.com/video/BV1cW42197mq#51.334][▶ 00:51]] 测试

得到

(:standard-properties [359 nil 417 424 427 1 nil nil nil nil nil nil ...] :type "mpv" :type-explicit-p t :path "https://www.bilibili.com/video/BV1cW42197mq#51.334" :format bracket :raw-link "mpv:https://www.bilibili.com/video/BV1cW42197mq#51.334" ...)

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

3 participants