-
Notifications
You must be signed in to change notification settings - Fork 89
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
support jedi:goto-definition from within dedicated src-block buffers in org-babel #350
base: master
Are you sure you want to change the base?
Conversation
Could you elaborate what is the problem that you are fixing here? I don't think I understand how |
Yes, so jedi:source-dir is trying to find the source-directory of the file that is opened in the current-buffer, which is so that jedi can figure out where python modules are located and find definitions-at-point. So, say you have
and from that new buffer run M-x eval-expression RET (buffer-file-name) you get nil back instead of the file-name of the org-file from which you opened the new buffer. So, in the special case of Org Src buffers, you need to do some extra work to provide the correct source directory. |
jedi-core.el
Outdated
default-directory)) | ||
(defvar jedi:source-dir | ||
(if (string-match "\*Org Src" (buffer-name (current-buffer))) | ||
(file-name-directory (buffer-file-name (org-src-source-buffer (current-buffer)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should actually be just (org-src-source-buffer) without (current-buffer) as argument to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need to touch this variable, because it is the location of jedi's own sources. It probably wouldn't work anyway, because this is only evaluated once, when jedi itself is loaded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, you are totally right. It all works fine without changing this one - everything is solved by fixing jedi:-buffer-file-name.
Fixed so that jedi:source-dir is not changed. |
…ers in org-babel - C-c ' - based on content in the org-src-source-buffer
No description provided.