Open lazzalazza opened 1 year ago
I'm seeing this one too, I'm on a recent commit of emacs (30.0.50, rev cb4f4dd89131e5a8956c788fee7ede65f13b2a69) which might be part of the problem.
This is a problem with org-noter-pdftools becoming an unmaintained package for about a year now.
See https://github.com/fuxialexander/org-pdftools/issues/93#issuecomment-1493314118 and https://github.com/fuxialexander/org-pdftools/pull/94
Note that the maintained repo of org noter is now https://github.com/org-noter/org-noter/. You will get faster response from us if you post issues to that repo.
I am trying to solve a problem after a recent update in spacemacs. Whenever I call org-noter-inser-note I encounter this error. I've tryed to rebuild pdftools and reinstalled the packages many times with no success.
This is the debug trace:
Debugger entered--Lisp error: (wrong-type-argument listp #s(org-noter-pdftools--location :path "pdf:~/Dropbox/Autori/Cinquecento/Confalonieri - To..." :page 5 :height 0.0 :annot-id nil :search-string nil :original-property "pdf:~/Dropbox/Autori/Cinquecento/Confalonieri - To...")) cdr(#s(org-noter-pdftools--location :path "pdf:~/Dropbox/Autori/Cinquecento/Confalonieri - To..." :page 5 :height 0.0 :annot-id nil :search-string nil :original-property "pdf:~/Dropbox/Autori/Cinquecento/Confalonieri - To...")) (listp (cdr location)) (if (listp (cdr location)) (car (cdr location)) (cdr location)) org-noter--get-location-top(#s(org-noter-pdftools--location :path "pdf:~/Dropbox/Autori/Cinquecento/Confalonieri - To..." :page 5 :height 0.0 :annot-id nil :search-string nil :original-property "pdf:~/Dropbox/Autori/Cinquecento/Confalonieri - To...")) (let ((mode (progn (or (progn (and (memq ... cl-struct-org-noter--session-tags) t)) (signal 'wrong-type-argument (list 'org-noter--session session))) (aref session 7))) (vpos (org-noter--get-location-top location)) (hpos (org-noter--get-location-left location)) (vtxt "") (htxt "") pagelabel) (cond ((eq mode 'pdf-view-mode) (if (> hpos 0) (setq htxt (format " H: %d%%" (round ( 100 hpos))))) (if (or (> vpos 0) (> hpos 0)) (setq vtxt (format " V: %d%%" (round ( 100 vpos))))) (select-window (org-noter--get-doc-window)) (setq pagelabel (pdf-view-current-pagelabel)) (select-window (org-noter--get-notes-window)) (format "%s%s%s" pagelabel vtxt htxt)) ((eq mode 'doc-view-mode) (org-noter-pdf--pretty-print-location location)))) (progn (let ((mode (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... session))) (aref session 7))) (vpos (org-noter--get-location-top location)) (hpos (org-noter--get-location-left location)) (vtxt "") (htxt "") pagelabel) (cond ((eq mode 'pdf-view-mode) (if (> hpos 0) (setq htxt (format " H: %d%%" (round ...)))) (if (or (> vpos 0) (> hpos 0)) (setq vtxt (format " V: %d%%" (round ...)))) (select-window (org-noter--get-doc-window)) (setq pagelabel (pdf-view-current-pagelabel)) (select-window (org-noter--get-notes-window)) (format "%s%s%s" pagelabel vtxt htxt)) ((eq mode 'doc-view-mode) (org-noter-pdf--pretty-print-location location))))) (progn (progn (let ((mode (progn (or (progn ...) (signal ... ...)) (aref session 7))) (vpos (org-noter--get-location-top location)) (hpos (org-noter--get-location-left location)) (vtxt "") (htxt "") pagelabel) (cond ((eq mode 'pdf-view-mode) (if (> hpos 0) (setq htxt (format " H: %d%%" ...))) (if (or (> vpos 0) (> hpos 0)) (setq vtxt (format " V: %d%%" ...))) (select-window (org-noter--get-doc-window)) (setq pagelabel (pdf-view-current-pagelabel)) (select-window (org-noter--get-notes-window)) (format "%s%s%s" pagelabel vtxt htxt)) ((eq mode 'doc-view-mode) (org-noter-pdf--pretty-print-location location)))))) (if (org-noter--valid-session session) (progn (progn (let ((mode (progn (or ... ...) (aref session 7))) (vpos (org-noter--get-location-top location)) (hpos (org-noter--get-location-left location)) (vtxt "") (htxt "") pagelabel) (cond ((eq mode 'pdf-view-mode) (if (> hpos 0) (setq htxt ...)) (if (or ... ...) (setq vtxt ...)) (select-window (org-noter--get-doc-window)) (setq pagelabel (pdf-view-current-pagelabel)) (select-window (org-noter--get-notes-window)) (format "%s%s%s" pagelabel vtxt htxt)) ((eq mode 'doc-view-mode) (org-noter-pdf--pretty-print-location location))))))) (let ((session org-noter--session)) (if (org-noter--valid-session session) (progn (progn (let ((mode (progn ... ...)) (vpos (org-noter--get-location-top location)) (hpos (org-noter--get-location-left location)) (vtxt "") (htxt "") pagelabel) (cond ((eq mode ...) (if ... ...) (if ... ...) (select-window ...) (setq pagelabel ...) (select-window ...) (format "%s%s%s" pagelabel vtxt htxt)) ((eq mode ...) (org-noter-pdf--pretty-print-location location)))))))) org-noter-pdf--pretty-print-location-for-title(#s(org-noter-pdftools--location :path "pdf:~/Dropbox/Autori/Cinquecento/Confalonieri - To..." :page 5 :height 0.0 :annot-id nil :search-string nil :original-property "pdf:~/Dropbox/Autori/Cinquecento/Confalonieri - To...")) run-hook-with-args-until-success(org-noter-pdf--pretty-print-location-for-title #s(org-noter-pdftools--location :path "pdf:~/Dropbox/Autori/Cinquecento/Confalonieri - To..." :page 5 :height 0.0 :annot-id nil :search-string nil :original-property "pdf:~/Dropbox/Autori/Cinquecento/Confalonieri - To...")) (progn (run-hook-with-args-until-success 'org-noter--pretty-print-location-for-title-hook location)) (progn (progn (run-hook-with-args-until-success 'org-noter--pretty-print-location-for-title-hook location))) (if (org-noter--valid-session session) (progn (progn (run-hook-with-args-until-success 'org-noter--pretty-print-location-for-title-hook location)))) (let ((session org-noter--session)) (if (org-noter--valid-session session) (progn (progn (run-hook-with-args-until-success 'org-noter--pretty-print-location-for-title-hook location))))) org-noter--pretty-print-location-for-title(#s(org-noter-pdftools--location :path "pdf:~/Dropbox/Autori/Cinquecento/Confalonieri - To..." :page 5 :height 0.0 :annot-id nil :search-string nil :original-property "pdf:~/Dropbox/Autori/Cinquecento/Confalonieri - To...")) (replace-regexp-in-string (regexp-quote "$p$") (org-noter--pretty-print-location-for-title location) org-noter-default-heading-title) (or short-selected-text (replace-regexp-in-string (regexp-quote "$p$") (org-noter--pretty-print-location-for-title location) org-noter-default-heading-title)) (let ((view-info (org-noter--get-view-info current-view location)) (minibuffer-local-completion-map org-noter--completing-read-keymap) collection title note-body existing-note (default-title (or short-selected-text (replace-regexp-in-string (regexp-quote "$p$") (org-noter--pretty-print-location-for-title location) org-noter-default-heading-title))) (empty-lines-number (if org-noter-separate-notes-from-heading 2 1))) (if precise-info nil (let ((--dolist-tail-- (progn (or (progn ...) (signal ... ...)) (aref view-info 1)))) (while --dolist-tail-- (let ((note-cons (car --dolist-tail--))) (let ((display ...)) (setq collection (cons ... collection))) (setq --dolist-tail-- (cdr --dolist-tail--)))))) (setq collection (nreverse collection) title (if org-noter-insert-note-no-questions default-title (completing-read "Note: " collection nil nil nil nil default-title)) note-body (if (and selected-text-p (not (equal title short-selected-text))) selected-text) existing-note (if precise-info nil (cdr (assoc title collection)))) (if existing-note (let ((note (car existing-note)) (insert-before-element (cdr existing-note)) (has-content (eq (org-element-map (org-element-contents note) org-element-all-elements #'... nil t) t))) (if has-content (progn (setq empty-lines-number 2))) (if insert-before-element (goto-char (org-element-property :begin insert-before-element)) (goto-char (org-element-property :end note))) (if (org-at-heading-p) (progn (org-N-empty-lines-before-current empty-lines-number) (forward-line -1)) (if (bolp) nil (insert "\n")) (org-N-empty-lines-before-current (1- empty-lines-number))) (if (and org-noter-insert-selected-text-inside-note note-body) (progn (if short-selected-text (insert "``" note-body "''") (insert "#+BEGIN_QUOTE\n" note-body "\n#+END_QUOTE"))))) (let ((reference-element-cons (progn (or (progn ...) (signal ... ...)) (aref view-info 4))) level) (if reference-element-cons (progn (cond ((eq ... ...) (goto-char ...)) ((eq ... ...) (goto-char ...))) (if (org-at-heading-p) (progn (backward-char))) (setq level (org-element-property :level (cdr reference-element-cons)))) (goto-char (or (org-element-map contents 'section #'... nil t org-element-all-elements) (point-max)))) (setq level (or level (1+ (or (org-element-property :level ast) 0)))) (if (org-noter--no-heading-p) nil (outline-show-entry)) (org-noter--insert-heading level title empty-lines-number location) (let ((s (and t highlight-location)) (serialized-highlight (and s (org-noter--get-serialized-highlight highlight-location)))) (if serialized-highlight (org-set-property "HIGHLIGHT" serialized-highlight) nil)) (if note-body (progn (save-excursion (if short-selected-text (insert "
" note-body "''") (insert "#+BEGIN_QUOTE\n" note-body "\n#+END_QUOTE"))))) (if (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... session))) (aref session 17)) (progn (org-overview))) (progn (or (progn (and (memq ... cl-struct-org-noter--session-tags) t)) (signal 'wrong-type-argument (list 'org-noter--session session))) (let* ((v session)) (aset v 12 (1+ (progn ... ...))))))) (org-show-set-visibility t) (org-cycle-hide-drawers 'all) (org-cycle-show-empty-lines t) (if org-noter-highlight-selected-text (progn (select-frame-set-input-focus (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... session))) (aref session 2))) (select-window (get-buffer-window (progn (or (progn ...) (signal ... ...)) (aref session 3)))) (run-hook-with-args-until-success 'org-noter--add-highlight-hook major-mode highlight-location)))) (let ((inhibit-quit nil)) (select-frame-set-input-focus (window-frame window)) (select-window window) (let ((view-info (org-noter--get-view-info current-view location)) (minibuffer-local-completion-map org-noter--completing-read-keymap) collection title note-body existing-note (default-title (or short-selected-text (replace-regexp-in-string (regexp-quote "$p$") (org-noter--pretty-print-location-for-title location) org-noter-default-heading-title))) (empty-lines-number (if org-noter-separate-notes-from-heading 2 1))) (if precise-info nil (let ((--dolist-tail-- (progn (or ... ...) (aref view-info 1)))) (while --dolist-tail-- (let ((note-cons ...)) (let (...) (setq collection ...)) (setq --dolist-tail-- (cdr --dolist-tail--)))))) (setq collection (nreverse collection) title (if org-noter-insert-note-no-questions default-title (completing-read "Note: " collection nil nil nil nil default-title)) note-body (if (and selected-text-p (not (equal title short-selected-text))) selected-text) existing-note (if precise-info nil (cdr (assoc title collection)))) (if existing-note (let* ((note (car existing-note)) (insert-before-element (cdr existing-note)) (has-content (eq (org-element-map ... org-element-all-elements ... nil t) t))) (if has-content (progn (setq empty-lines-number 2))) (if insert-before-element (goto-char (org-element-property :begin insert-before-element)) (goto-char (org-element-property :end note))) (if (org-at-heading-p) (progn (org-N-empty-lines-before-current empty-lines-number) (forward-line -1)) (if (bolp) nil (insert "\n")) (org-N-empty-lines-before-current (1- empty-lines-number))) (if (and org-noter-insert-selected-text-inside-note note-body) (progn (if short-selected-text (insert "
" note-body "''") (insert "#+BEGIN_QUOTE\n" note-body "\n#+END_QUOTE"))))) (let ((reference-element-cons (progn (or ... ...) (aref view-info 4))) level) (if reference-element-cons (progn (cond (... ...) (... ...)) (if (org-at-heading-p) (progn ...)) (setq level (org-element-property :level ...))) (goto-char (or (org-element-map contents ... ... nil t org-element-all-elements) (point-max)))) (setq level (or level (1+ (or ... 0)))) (if (org-noter--no-heading-p) nil (outline-show-entry)) (org-noter--insert-heading level title empty-lines-number location) (let ((s (and t highlight-location)) (serialized-highlight (and s ...))) (if serialized-highlight (org-set-property "HIGHLIGHT" serialized-highlight) nil)) (if note-body (progn (save-excursion (if short-selected-text ... ...)))) (if (progn (or (progn ...) (signal ... ...)) (aref session 17)) (progn (org-overview))) (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... session))) (let ((v session)) (aset v 12 (1+ ...)))))) (org-show-set-visibility t) (org-cycle-hide-drawers 'all) (org-cycle-show-empty-lines t) (if org-noter-highlight-selected-text (progn (select-frame-set-input-focus (progn (or (progn ...) (signal ... ...)) (aref session 2))) (select-window (get-buffer-window (progn (or ... ...) (aref session 3)))) (run-hook-with-args-until-success 'org-noter--add-highlight-hook major-mode highlight-location))))) (condition-case nil (let ((inhibit-quit nil)) (select-frame-set-input-focus (window-frame window)) (select-window window) (let ((view-info (org-noter--get-view-info current-view location)) (minibuffer-local-completion-map org-noter--completing-read-keymap) collection title note-body existing-note (default-title (or short-selected-text (replace-regexp-in-string (regexp-quote "$p$") (org-noter--pretty-print-location-for-title location) org-noter-default-heading-title))) (empty-lines-number (if org-noter-separate-notes-from-heading 2 1))) (if precise-info nil (let ((--dolist-tail-- (progn ... ...))) (while --dolist-tail-- (let (...) (let ... ...) (setq --dolist-tail-- ...))))) (setq collection (nreverse collection) title (if org-noter-insert-note-no-questions default-title (completing-read "Note: " collection nil nil nil nil default-title)) note-body (if (and selected-text-p (not (equal title short-selected-text))) selected-text) existing-note (if precise-info nil (cdr (assoc title collection)))) (if existing-note (let ((note (car existing-note)) (insert-before-element (cdr existing-note)) (has-content (eq ... t))) (if has-content (progn (setq empty-lines-number 2))) (if insert-before-element (goto-char (org-element-property :begin insert-before-element)) (goto-char (org-element-property :end note))) (if (org-at-heading-p) (progn (org-N-empty-lines-before-current empty-lines-number) (forward-line -1)) (if (bolp) nil (insert "\n")) (org-N-empty-lines-before-current (1- empty-lines-number))) (if (and org-noter-insert-selected-text-inside-note note-body) (progn (if short-selected-text ... ...)))) (let ((reference-element-cons (progn ... ...)) level) (if reference-element-cons (progn (cond ... ...) (if ... ...) (setq level ...)) (goto-char (or ... ...))) (setq level (or level (1+ ...))) (if (org-noter--no-heading-p) nil (outline-show-entry)) (org-noter--insert-heading level title empty-lines-number location) (let ((s ...) (serialized-highlight ...)) (if serialized-highlight (org-set-property "HIGHLIGHT" serialized-highlight) nil)) (if note-body (progn (save-excursion ...))) (if (progn (or ... ...) (aref session 17)) (progn (org-overview))) (progn (or (progn ...) (signal ... ...)) (let (...) (aset v 12 ...))))) (org-show-set-visibility t) (org-cycle-hide-drawers 'all) (org-cycle-show-empty-lines t) (if org-noter-highlight-selected-text (progn (select-frame-set-input-focus (progn (or ... ...) (aref session 2))) (select-window (get-buffer-window (progn ... ...))) (run-hook-with-args-until-success 'org-noter--add-highlight-hook major-mode highlight-location))))) (quit (setq quit-flag t) (eval '(ignore nil)))) (let ((inhibit-quit t) (short-selected-text (if (and selected-text-p (<= (length selected-text) org-noter-max-short-selected-text-length)) selected-text)) (org-noter-highlight-selected-text (if toggle-highlight (not org-noter-highlight-selected-text) org-noter-highlight-selected-text)) (highlight-location (if org-noter-highlight-selected-text (org-noter--get-highlight-location)))) (condition-case nil (let ((inhibit-quit nil)) (select-frame-set-input-focus (window-frame window)) (select-window window) (let ((view-info (org-noter--get-view-info current-view location)) (minibuffer-local-completion-map org-noter--completing-read-keymap) collection title note-body existing-note (default-title (or short-selected-text (replace-regexp-in-string ... ... org-noter-default-heading-title))) (empty-lines-number (if org-noter-separate-notes-from-heading 2 1))) (if precise-info nil (let ((--dolist-tail-- ...)) (while --dolist-tail-- (let ... ... ...)))) (setq collection (nreverse collection) title (if org-noter-insert-note-no-questions default-title (completing-read "Note: " collection nil nil nil nil default-title)) note-body (if (and selected-text-p (not ...)) selected-text) existing-note (if precise-info nil (cdr (assoc title collection)))) (if existing-note (let ((note ...) (insert-before-element ...) (has-content ...)) (if has-content (progn ...)) (if insert-before-element (goto-char ...) (goto-char ...)) (if (org-at-heading-p) (progn ... ...) (if ... nil ...) (org-N-empty-lines-before-current ...)) (if (and org-noter-insert-selected-text-inside-note note-body) (progn ...))) (let ((reference-element-cons ...) level) (if reference-element-cons (progn ... ... ...) (goto-char ...)) (setq level (or level ...)) (if (org-noter--no-heading-p) nil (outline-show-entry)) (org-noter--insert-heading level title empty-lines-number location) (let (... ...) (if serialized-highlight ... nil)) (if note-body (progn ...)) (if (progn ... ...) (progn ...)) (progn (or ... ...) (let ... ...)))) (org-show-set-visibility t) (org-cycle-hide-drawers 'all) (org-cycle-show-empty-lines t) (if org-noter-highlight-selected-text (progn (select-frame-set-input-focus (progn ... ...)) (select-window (get-buffer-window ...)) (run-hook-with-args-until-success 'org-noter--add-highlight-hook major-mode highlight-location))))) (quit (setq quit-flag t) (eval '(ignore nil)))) (if quit-flag (progn (select-frame-set-input-focus (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... session))) (aref session 2))) (select-window (get-buffer-window (progn (or (progn ...) (signal ... ...)) (aref session 3))))))) (let ((ast (org-noter--parse-root)) (contents (org-element-contents ast)) (window (org-noter--get-notes-window 'force)) (selected-text (run-hook-with-args-until-success 'org-noter-get-selected-text-hook (progn (or (progn (and ... t)) (signal 'wrong-type-argument (list ... session))) (aref session 7)))) (selected-text-p (> (length selected-text) 0)) force-new (location (org-noter--doc-approx-location (or precise-info 'interactive) (cons #'(lambda nil force-new) #'(lambda (gv--val) (setq force-new gv--val))))) (current-view (org-noter--get-current-view))) (let ((inhibit-quit t) (short-selected-text (if (and selected-text-p (<= (length selected-text) org-noter-max-short-selected-text-length)) selected-text)) (org-noter-highlight-selected-text (if toggle-highlight (not org-noter-highlight-selected-text) org-noter-highlight-selected-text)) (highlight-location (if org-noter-highlight-selected-text (org-noter--get-highlight-location)))) (condition-case nil (let ((inhibit-quit nil)) (select-frame-set-input-focus (window-frame window)) (select-window window) (let ((view-info (org-noter--get-view-info current-view location)) (minibuffer-local-completion-map org-noter--completing-read-keymap) collection title note-body existing-note (default-title (or short-selected-text ...)) (empty-lines-number (if org-noter-separate-notes-from-heading 2 1))) (if precise-info nil (let (...) (while --dolist-tail-- ...))) (setq collection (nreverse collection) title (if org-noter-insert-note-no-questions default-title (completing-read "Note: " collection nil nil nil nil default-title)) note-body (if (and selected-text-p ...) selected-text) existing-note (if precise-info nil (cdr ...))) (if existing-note (let (... ... ...) (if has-content ...) (if insert-before-element ... ...) (if ... ... ... ...) (if ... ...)) (let (... level) (if reference-element-cons ... ...) (setq level ...) (if ... nil ...) (org-noter--insert-heading level title empty-lines-number location) (let ... ...) (if note-body ...) (if ... ...) (progn ... ...))) (org-show-set-visibility t) (org-cycle-hide-drawers 'all) (org-cycle-show-empty-lines t) (if org-noter-highlight-selected-text (progn (select-frame-set-input-focus ...) (select-window ...) (run-hook-with-args-until-success ... major-mode highlight-location))))) (quit (setq quit-flag t) (eval '(ignore nil)))) (if quit-flag (progn (select-frame-set-input-focus (progn (or (progn ...) (signal ... ...)) (aref session 2))) (select-window (get-buffer-window (progn (or ... ...) (aref session 3)))))))) (progn (let ((ast (org-noter--parse-root)) (contents (org-element-contents ast)) (window (org-noter--get-notes-window 'force)) (selected-text (run-hook-with-args-until-success 'org-noter-get-selected-text-hook (progn (or (progn ...) (signal ... ...)) (aref session 7)))) (selected-text-p (> (length selected-text) 0)) force-new (location (org-noter--doc-approx-location (or precise-info 'interactive) (cons #'(lambda nil force-new) #'(lambda ... ...)))) (current-view (org-noter--get-current-view))) (let ((inhibit-quit t) (short-selected-text (if (and selected-text-p (<= ... org-noter-max-short-selected-text-length)) selected-text)) (org-noter-highlight-selected-text (if toggle-highlight (not org-noter-highlight-selected-text) org-noter-highlight-selected-text)) (highlight-location (if org-noter-highlight-selected-text (org-noter--get-highlight-location)))) (condition-case nil (let ((inhibit-quit nil)) (select-frame-set-input-focus (window-frame window)) (select-window window) (let ((view-info ...) (minibuffer-local-completion-map org-noter--completing-read-keymap) collection title note-body existing-note (default-title ...) (empty-lines-number ...)) (if precise-info nil (let ... ...)) (setq collection (nreverse collection) title (if org-noter-insert-note-no-questions default-title ...) note-body (if ... selected-text) existing-note (if precise-info nil ...)) (if existing-note (let ... ... ... ... ...) (let ... ... ... ... ... ... ... ... ...)) (org-show-set-visibility t) (org-cycle-hide-drawers 'all) (org-cycle-show-empty-lines t) (if org-noter-highlight-selected-text (progn ... ... ...)))) (quit (setq quit-flag t) (eval '(ignore nil)))) (if quit-flag (progn (select-frame-set-input-focus (progn (or ... ...) (aref session 2))) (select-window (get-buffer-window (progn ... ...)))))))) (progn (progn (let ((ast (org-noter--parse-root)) (contents (org-element-contents ast)) (window (org-noter--get-notes-window 'force)) (selected-text (run-hook-with-args-until-success 'org-noter-get-selected-text-hook (progn (or ... ...) (aref session 7)))) (selected-text-p (> (length selected-text) 0)) force-new (location (org-noter--doc-approx-location (or precise-info 'interactive) (cons #'... #'...))) (current-view (org-noter--get-current-view))) (let ((inhibit-quit t) (short-selected-text (if (and selected-text-p ...) selected-text)) (org-noter-highlight-selected-text (if toggle-highlight (not org-noter-highlight-selected-text) org-noter-highlight-selected-text)) (highlight-location (if org-noter-highlight-selected-text (org-noter--get-highlight-location)))) (condition-case nil (let ((inhibit-quit nil)) (select-frame-set-input-focus (window-frame window)) (select-window window) (let (... ... collection title note-body existing-note ... ...) (if precise-info nil ...) (setq collection ... title ... note-body ... existing-note ...) (if existing-note ... ...) (org-show-set-visibility t) (org-cycle-hide-drawers ...) (org-cycle-show-empty-lines t) (if org-noter-highlight-selected-text ...))) (quit (setq quit-flag t) (eval '...))) (if quit-flag (progn (select-frame-set-input-focus (progn ... ...)) (select-window (get-buffer-window ...)))))))) (if (org-noter--valid-session session) (progn (progn (let ((ast (org-noter--parse-root)) (contents (org-element-contents ast)) (window (org-noter--get-notes-window 'force)) (selected-text (run-hook-with-args-until-success 'org-noter-get-selected-text-hook (progn ... ...))) (selected-text-p (> (length selected-text) 0)) force-new (location (org-noter--doc-approx-location (or precise-info ...) (cons ... ...))) (current-view (org-noter--get-current-view))) (let ((inhibit-quit t) (short-selected-text (if ... selected-text)) (org-noter-highlight-selected-text (if toggle-highlight ... org-noter-highlight-selected-text)) (highlight-location (if org-noter-highlight-selected-text ...))) (condition-case nil (let (...) (select-frame-set-input-focus ...) (select-window window) (let ... ... ... ... ... ... ... ...)) (quit (setq quit-flag t) (eval ...))) (if quit-flag (progn (select-frame-set-input-focus ...) (select-window ...)))))))) (let ((session org-noter--session)) (if (org-noter--valid-session session) (progn (progn (let ((ast (org-noter--parse-root)) (contents (org-element-contents ast)) (window (org-noter--get-notes-window ...)) (selected-text (run-hook-with-args-until-success ... ...)) (selected-text-p (> ... 0)) force-new (location (org-noter--doc-approx-location ... ...)) (current-view (org-noter--get-current-view))) (let ((inhibit-quit t) (short-selected-text ...) (org-noter-highlight-selected-text ...) (highlight-location ...)) (condition-case nil (let ... ... ... ...) (quit ... ...)) (if quit-flag (progn ... ...)))))))) org-noter-insert-note(nil) funcall-interactively(org-noter-insert-note nil) command-execute(org-noter-insert-note)