Yevgnen / ivy-rich

More friendly interface for ivy.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error while executing counsel-describe-function with ivy-rich

seagle0128 opened this issue · comments

Debugger entered--Lisp error: (void-function nil)
  documentation(nil t)
  advice--make-docstring(doom-modeline-refresh-frame)
  documentation(doom-modeline-refresh-frame)
  ivy-rich-counsel-function-docstring("doom-modeline-refresh-frame")
  ivy-rich-format-column("doom-modeline-refresh-frame" (ivy-rich-counsel-function-docstring (:face font-lock-doc-face)))
  #f(compiled-function (column) #<bytecode 0x441f1cbd>)((ivy-rich-counsel-function-docstring (:face font-lock-doc-face)))
  mapconcat(#f(compiled-function (column) #<bytecode 0x441f1cbd>) ((counsel-describe-function-transformer (:width 50)) (ivy-rich-counsel-function-docstring (:face font-lock-doc-face))) " ")
  ivy-rich-format("doom-modeline-refresh-frame" ((counsel-describe-function-transformer (:width 50)) (ivy-rich-counsel-function-docstring (:face font-lock-doc-face))) " ")
  ivy-rich--counsel-describe-function-transformer("doom-modeline-refresh-frame")
  mapcar(ivy-rich--counsel-describe-function-transformer ("doom-modeline-mode" "doom-modeline-override-fancy-battery-modeline" "doom-modeline-override-mu4e-alert-modeline" "doom-modeline-project-root" "doom-modeline-refresh-bars" "doom-modeline-refresh-frame" "doom-modeline-segment--bar" "doom-modeline-segment--buffer-default-directory" "doom-modeline-segment--buffer-encoding"))
  ivy--format(("!cdr" "!cons" "%" "(setf seq-elt)" "*" "+" "," ",@" "-" "---partition-all-in-steps-reversed" "---truthy?" "-->" "--all-p" "--all?" "--annotate" "--any" "--any-p" "--any?" "--count" "--dotimes" "--doto" 
... 
 flyspell-generic-check-word-p gnus-save-startup-file-via-temp-buffer swiper--add-overlay url-cookie-store :unset expand-fun gnus-atomic-progn markdown-toggle-wiki-links python-shell-completion-module-string-code rmail-find-all-files Fontify\ Code\ Blocks\ Natively treemacs-icons-hash rmail-what-message company-echo-timer org-agenda-refile :stream bibtex-next-field gnus-balloon-face-function mail-encode-encoded-word-region all-the-icons-icon-for-dir github gnus-newsrc-alist dframe-iconify-frame-function git-st rails-rspec c-opt-asm-stmt-key usage dired-find-file-other-window markdown-next-heading ivy-index counsel-linux-app 0 gnus-widget-reversible-match] :predicate #f(compiled-function (sym) #<bytecode 0x42e74f41>) :require-match t :history counsel-describe-symbol-history :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :preselect "doom-modeline-refresh-frame" :sort t :action #f(compiled-function (x) #<bytecode 0x41033fad>) :caller counsel-describe-function)
  counsel-describe-function()
  funcall-interactively(counsel-describe-function)
  call-interactively(counsel-describe-function nil nil)
  #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x400c29cf>)(counsel-describe-function nil nil nil)
  ad-Advice-command-execute(#f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x400c29cf>) counsel-describe-function)
  apply(ad-Advice-command-execute #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x400c29cf>) counsel-describe-function)
  command-execute(counsel-describe-function)

Hi, where can I find this function doom-modeline-refresh-frame? I can only find doom-modeline-refresh-bars in doom-modeline.


I found it. I'll test it later.

FYI, it's not defined in 26.1+ and no docstring. The issue is weird.

Does it exist in emacs 26.1? I see your emacs is emacs 26.1 and the function is not defined in 26.1.

Yes, the cods check if after-focus-change-function exists and decides to define doom-modeline-refresh-frame or not. But I think it should not impact the counsel-describe-function behaviors.

(with-no-warnings
  (cond ((not (boundp 'after-focus-change-function))
         (add-hook 'focus-in-hook  #'doom-modeline-set-selected-window)
         (add-hook 'focus-out-hook #'doom-modeline-unset-selected-window))
        ((defun doom-modeline-refresh-frame ()
           (setq doom-modeline-current-window nil)
           (cl-loop for frame in (frame-list)
                    if (eq (frame-focus-state frame) t)
                    return (setq doom-modeline-current-window (frame-selected-window frame)))
           (force-mode-line-update))
         (add-function :after after-focus-change-function #'doom-modeline-refresh-frame))))

Can you describe steps of reproducing this? You're using emacs 26.1, and doom-modeline-refresh-frame should be not defined. If you enter doom-modeline-refresh-frame in counsel-describe-function, there should be no candidates.

The step is very simple. Move the cursor to doom-modeline-refresh-frame, and C-h f or M-x counsel-describe-function, then get this error.

I test this in Centaur Emacs and can't reproduce this. If the function is not define in emacs 26.1, when counsel-describe-function, the symbol should not be grabbed by emacs. Even inputing the symbol manually, I can not reproduce this.

Maybe you can try the master version, the elpa version has not been updated for serval months for unknown reasons.

i

OK. You mean melpa builds system doesn't work? I think you can file an issue on https://github.com/melpa/melpa. I encountered the similar issue a few months ago. They fixed and all run well now.

Update: I restart Emacs and no errors now. I don't know why the error occurred honestly. I am closing it now and keep testing. Thanks for the assistance!

Glad the issue is gone. Thanks for your information about melpa.