1 Matching Annotations
  1. Feb 2025
    1. ; * eldoc integration (defun scimax-jupyter-signature () "Try to return a function signature for the thing at point." (when (and (eql major-mode 'org-mode) (string= (or (get-text-property (point) 'lang) "") "jupyter-python")) (save-window-excursion ;;; Essentially copied from (jupyter-inspect-at-point). (jupyter-org-with-src-block-client (cl-destructuring-bind (code pos) (jupyter-code-context 'inspect) (jupyter-inspect code pos nil 0))) (when (get-buffer "Help") (with-current-buffer "Help" (goto-char (point-min)) (prog1 (cond ((re-search-forward "Signature:" nil t 1) (buffer-substring (line-beginning-position) (line-end-position))) ((re-search-forward "Docstring:" nil t 1) (forward-line) (buffer-substring (line-beginning-position) (line-end-position))) (t nil)) ;; get rid of this so we don't accidentally show old results later (with-current-buffer "Help" (toggle-read-only) (erase-buffer))))))))