在安装ukaszg/aria2
之后
(package! aria2 :recipe
(:host gitlab :repo "ukaszg/aria2"))
按照这种方式修改aria2.el
行:
(secret :initarg :secret
;:initform aria2-rcp-secret
:initform (identity aria2-rcp-secret)
:type string
:docstring "Secret value used for authentication with the aria2c process, for use with --rpc-secret= switch.")
在执行 aria2-downloads-list
出现:Debugger entered--Lisp error: (void-function defmethod)
Debugger entered--Lisp error: (void-function defmethod)
(defmethod get-next-id ((this aria2-controller)) "Return next request id json form. Resets back to 1..." (let ((id (1+ (eieio-oref this 'request-id)))) (eieio-oset this 'request-id (if (equal id most-positive-fixnum) 0 id)) id))
#<subr eval-buffer>(#<buffer *load*> nil "/Users/boyer/.emacs.d/.local/straight/build-29.0.5..." nil t)
apply(#<subr eval-buffer> (#<buffer *load*> nil "/Users/boyer/.emacs.d/.local/straight/build-29.0.5..." nil t))
eval-buffer(#<buffer *load*> nil "/Users/boyer/.emacs.d/.local/straight/build-29.0.5..." nil t) ; Reading at buffer position 10340
load-with-code-conversion("/Users/boyer/.emacs.d/.local/straight/build-29.0.5..." "/Users/boyer/.emacs.d/.local/straight/build-29.0.5..." nil t)
#<subr autoload-do-load>((autoload "aria2" ("/Users/boyer/.emacs.d/.local/autoloads.29.0.50.elc" . 1255376) t nil) aria2-downloads-list nil)
apply(#<subr autoload-do-load> ((autoload "aria2" ("/Users/boyer/.emacs.d/.local/autoloads.29.0.50.elc" . 1255376) t nil) aria2-downloads-list))
autoload-do-load((autoload "aria2" ("/Users/boyer/.emacs.d/.local/autoloads.29.0.50.elc" . 1255376) t nil) aria2-downloads-list)
command-execute(aria2-downloads-list record)
counsel-M-x-action("aria2-downloads-list")
ivy-call()
#f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially. An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero. Otherwise, use the first occurrence of\nPRESELECT in the collection. Comparison is first done with\n`equal'. If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input. It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode -0x14b625a617866f55>)("M-x " ("toggle-debug-on-error" "aria2-downloads-list" "doom/increase-font-size" "calibredb-find-counsel" "insert-file" "my-open-calendar" "multi-translate-at-point" "markdown-insert-gfm-checkbox" "transwin-ask-set-transparency" "org-archive-to-archive-sibling" "elgantt--reload" "multi-translate" "elfeed" "lsp-clear" "telega" "rime-deploy" "org-save-all-org-buffers" "easy-hugo" "org-force-cycle-archived" "eaf-open-demo" "rime-select-schema" "forge-add-repository" "doom/reload" "org-roam-ui-mode" "org-gcal-post-at-point" "undo" "+beancount/balance" "elgantt-open" "beancount-fava" "+lookup/in-all-docsets" "org-roam-db-sync" "+lookup/in-docsets" "counsel-dash" "forge-list-repositories" "swift-menu" "ido-switch-buffer" "pocket-reader" "eww" "calibredb" "replace-string" "+lookup/documentation" "+snippets/find-private" "eaf-create-mindmap" "dash-docs-install-docset" "org-mode" "eaf-open-browser" "forge-browse-issues" "org-download-clipboard" "w3m-goto-url" "org-gcal-sync" ...) :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)
apply(#f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially. An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero. Otherwise, use the first occurrence of\nPRESELECT in the collection. Comparison is first done with\n`equal'. If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input. It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode -0x14b625a617866f55>) ("M-x " ("toggle-debug-on-error" "aria2-downloads-list" "doom/increase-font-size" "calibredb-find-counsel" "insert-file" "my-open-calendar" "multi-translate-at-point" "markdown-insert-gfm-checkbox" "transwin-ask-set-transparency" "org-archive-to-archive-sibling" "elgantt--reload" "multi-translate" "elfeed" "lsp-clear" "telega" "rime-deploy" "org-save-all-org-buffers" "easy-hugo" "org-force-cycle-archived" "eaf-open-demo" "rime-select-schema" "forge-add-repository" "doom/reload" "org-roam-ui-mode" "org-gcal-post-at-point" "undo" "+beancount/balance" "elgantt-open" "beancount-fava" "+lookup/in-all-docsets" "org-roam-db-sync" "+lookup/in-docsets" "counsel-dash" "forge-list-repositories" "swift-menu" "ido-switch-buffer" "pocket-reader" "eww" "calibredb" "replace-string" "+lookup/documentation" "+snippets/find-private" "eaf-create-mindmap" "dash-docs-install-docset" "org-mode" "eaf-open-browser" "forge-browse-issues" "org-download-clipboard" "w3m-goto-url" "org-gcal-sync" ...) :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))
ivy-posframe--read(#f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially. An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero. Otherwise, use the first occurrence of\nPRESELECT in the collection. Comparison is first done with\n`equal'. If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input. It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode -0x14b625a617866f55>) "M-x " ("toggle-debug-on-error" "aria2-downloads-list" "doom/increase-font-size" "calibredb-find-counsel" "insert-file" "my-open-calendar" "multi-translate-at-point" "markdown-insert-gfm-checkbox" "transwin-ask-set-transparency" "org-archive-to-archive-sibling" "elgantt--reload" "multi-translate" "elfeed" "lsp-clear" "telega" "rime-deploy" "org-save-all-org-buffers" "easy-hugo" "org-force-cycle-archived" "eaf-open-demo" "rime-select-schema" "forge-add-repository" "doom/reload" "org-roam-ui-mode" "org-gcal-post-at-point" "undo" "+beancount/balance" "elgantt-open" "beancount-fava" "+lookup/in-all-docsets" "org-roam-db-sync" "+lookup/in-docsets" "counsel-dash" "forge-list-repositories" "swift-menu" "ido-switch-buffer" "pocket-reader" "eww" "calibredb" "replace-string" "+lookup/documentation" "+snippets/find-private" "eaf-create-mindmap" "dash-docs-install-docset" "org-mode" "eaf-open-browser" "forge-browse-issues" "org-download-clipboard" "w3m-goto-url" "org-gcal-sync" ...) :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)
apply(ivy-posframe--read #f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially. An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero. Otherwise, use the first occurrence of\nPRESELECT in the collection. Comparison is first done with\n`equal'. If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input. It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode -0x14b625a617866f55>) ("M-x " ("toggle-debug-on-error" "aria2-downloads-list" "doom/increase-font-size" "calibredb-find-counsel" "insert-file" "my-open-calendar" "multi-translate-at-point" "markdown-insert-gfm-checkbox" "transwin-ask-set-transparency" "org-archive-to-archive-sibling" "elgantt--reload" "multi-translate" "elfeed" "lsp-clear" "telega" "rime-deploy" "org-save-all-org-buffers" "easy-hugo" "org-force-cycle-archived" "eaf-open-demo" "rime-select-schema" "forge-add-repository" "doom/reload" "org-roam-ui-mode" "org-gcal-post-at-point" "undo" "+beancount/balance" "elgantt-open" "beancount-fava" "+lookup/in-all-docsets" "org-roam-db-sync" "+lookup/in-docsets" "counsel-dash" "forge-list-repositories" "swift-menu" "ido-switch-buffer" "pocket-reader" "eww" "calibredb" "replace-string" "+lookup/documentation" "+snippets/find-private" "eaf-create-mindmap" "dash-docs-install-docset" "org-mode" "eaf-open-browser" "forge-browse-issues" "org-download-clipboard" "w3m-goto-url" "org-gcal-sync" ...) :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))
ivy-read("M-x " ("toggle-debug-on-error" "aria2-downloads-list" "doom/increase-font-size" "calibredb-find-counsel" "insert-file" "my-open-calendar" "multi-translate-at-point" "markdown-insert-gfm-checkbox" "transwin-ask-set-transparency" "org-archive-to-archive-sibling" "elgantt--reload" "multi-translate" "elfeed" "lsp-clear" "telega" "rime-deploy" "org-save-all-org-buffers" "easy-hugo" "org-force-cycle-archived" "eaf-open-demo" "rime-select-schema" "forge-add-repository" "doom/reload" "org-roam-ui-mode" "org-gcal-post-at-point" "undo" "+beancount/balance" "elgantt-open" "beancount-fava" "+lookup/in-all-docsets" "org-roam-db-sync" "+lookup/in-docsets" "counsel-dash" "forge-list-repositories" "swift-menu" "ido-switch-buffer" "pocket-reader" "eww" "calibredb" "replace-string" "+lookup/documentation" "+snippets/find-private" "eaf-create-mindmap" "dash-docs-install-docset" "org-mode" "eaf-open-browser" "forge-browse-issues" "org-download-clipboard" "w3m-goto-url" "org-gcal-sync" ...) :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)
获取aria2.el中的rc-secret
rc-secret(动态生成的),可以通过相关属性获取到
在执行aria2--downloads-list
之后,通过查看aria2属性:aria2--cc
和aria2--cc-file
,中可以获取到secret。
aria2–cc-file默认值:~/.emacs.d/aria2-controller.eieio
;; Object aria2-controller-48954608
;; EIEIO PERSISTENT OBJECT
(aria2-controller "aria2-controller-48954608"
:file "aria2-controller.eieio"
:request-id 88
:rcp-url "http://localhost:6800/jsonrpc"
:secret "500D5E7A-2B0E-4EFB-985F-DA0561D4E5BD"
:pid 27731)
aria2-cc
属性:
#s(aria2-controller "/Users/boyer/.emacs.d/aria2-controller.eieio" 151 "http://localhost:6800/jsonrpc" "500D5E7A-2B0E-4EFB-985F-DA0561D4E5BD" 27731)