Skip to content

Commit 1711699

Browse files
author
George Moutsopoulos
committed
not much
1 parent 38dbe4e commit 1711699

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

org-annotate-index.el

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@ If nil then none. If true (but not a string) the use `org-annotate-code-heading0
2929
Supersedes choice in `org-annotate-code-heading0'."
3030
:group 'org-annotate-code)
3131

32-
3332
(defun org-annotate-index-get-filename ()
3433
"Return filename at point with no directory."
3534
(file-name-nondirectory
3635
(cond ((derived-mode-p 'dired-mode)
3736
(dired-get-filename nil t))
3837
((buffer-file-name)
3938
(buffer-file-name))
39+
((null (buffer-file-name))
40+
(user-error "Current buffer is not associated with a file."))
4041
(t
4142
(buffer-file-name)))))
4243

org-annotate-python.el

+10-4
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,13 @@ Optional squash for final annotation, if nil keep all, if zero keeps only filena
162162
(annotation (org-annotate-python-add-filename-node filename dottedannotation)))
163163
(org-annotate-python-squash-list-keep-and-last annotation (when squash (1+ squash))))) ; here squash=0 means keeping only filename.
164164

165-
(defun org-annotate-python-pydef-store-link (&optional nofile)
165+
(defun org-annotate-python-pydef-store-link (&optional nofile ask)
166166
"Store a link to a man page."
167167
(when (memq major-mode '(python-mode))
168168
;; This is a man page, we do make this link.
169169
(let* ((filename (buffer-file-name))
170170
(dotted (org-annotate-python-get-pydef-name))
171-
(name (org-annotate-python-pydef-select-candidate dotted))
171+
(name (if ask (org-annotate-python-pydef-select-candidate dotted) dotted))
172172
(description nil))
173173
(unless nofile
174174
(setq name (concat filename "::" name)))
@@ -218,13 +218,19 @@ Optional squash for final annotation, if nil keep all, if zero keeps only filena
218218
(if filename (find-file filename))
219219
(org-annotate-python-goto-dotted dotted)))
220220

221-
(defun org-annotate-python-info-at-point ()
221+
(defun org-annotate-python-info-at-point (&optional ask)
222222
"Return a plist with python info at point."
223+
(interactive "P")
223224
(let* ((filename (buffer-file-name))
224225
(dotted (org-annotate-python-get-pydef-name))
225-
(selection (org-annotate-python-pydef-select-candidate dotted org-annotate-python-squash-candidates-level)))
226+
(selection (if ask
227+
(org-annotate-python-pydef-select-candidate
228+
dotted
229+
org-annotate-python-squash-candidates-level)
230+
dotted)))
226231
(org-annotate-python-make-annotation-from-pydef filename selection org-annotate-python-squash-annotation-level)))
227232

233+
228234
(add-to-list 'org-annotate-code-info-alist (cons 'python-mode 'org-annotate-python-info-at-point))
229235

230236
(defun org-annotate-python-capture-finding-location ()

org-annotate-word.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
:export 'orgorg-annotate-word-export
2525
:store 'org-annotate-word-store-link)
2626

27-
(defcustom org-annotate-word-mode-blacklist '(org-mode pdf-view-mode)
27+
(defcustom org-annotate-word-mode-blacklist '(org-mode pdf-view-mode python-mode dired-mode)
2828
"Mode blacklist."
2929
:group 'org-annotate-code
3030
:type 'list)

0 commit comments

Comments
 (0)