From: Jambunathan K <kjambunathan@gmail.com>
To: emacs-orgmode@gnu.org
Cc: Nicolas Goaziou <n.goaziou@gmail.com>
Subject: [BUG] crash while ping-ponging between back-to-back footnotes.
Date: Wed, 29 Jun 2011 17:18:47 +0530 [thread overview]
Message-ID: <81hb78n9i8.fsf@gmail.com> (raw)
Summary: Sample org file down below also doubles up as bug report.
* Sample
Add footnote-1 using C-c C-x f [fn:1][fn:2]
* Footnotes
[fn:1] This is footnote-1. Jump back to the text by mouse-clicking the
footnote link. Once you jump back, immediately create another
footnote reference using C-c C-x f.
[fn:2] This footnote-2. Try jumping back to text by mouse-clicking
this fn-2 link. Note the following message on the screen "if: Cannot
find reference of footnote fn:2". Stack trace is attached..
Debugger entered--Lisp error: (error #("Cannot find reference of footnote fn:2" 34 38 (face org-footnote keymap (keymap (follow-link . mouse-face) (mouse-3 . org-find-file-at-mouse) (mouse-2 . org-open-at-mouse)) mouse-face highlight org-no-flyspell t help-echo "Footnote definition" fontified t)))
signal(error (#("Cannot find reference of footnote fn:2" 34 38 (face org-footnote keymap (keymap (follow-link . mouse-face) (mouse-3 . org-find-file-at-mouse) (mouse-2 . org-open-at-mouse)) mouse-face highlight org-no-flyspell t help-echo "Footnote definition" fontified t))))
error("Cannot find reference of footnote %s" #("fn:2" 0 4 (fontified t help-echo "Footnote definition" org-no-flyspell t mouse-face highlight keymap (keymap (follow-link . mouse-face) (mouse-3 . org-find-file-at-mouse) (mouse-2 . org-open-at-mouse)) face org-footnote)))
(if (not ref) (error "Cannot find reference of footnote %s" label) (goto-char (nth 1 ref)) (org-show-context (quote link-search)))
(let* ((label (org-footnote-normalize-label label)) ref) (save-excursion (setq ref (or (org-footnote-get-next-reference label t) (org-footnote-get-next-reference label) (save-restriction (widen) (or (org-footnote-get-next-reference label t) (org-footnote-get-next-reference label)))))) (if (not ref) (error "Cannot find reference of footnote %s" label) (goto-char (nth 1 ref)) (org-show-context (quote link-search))))
org-footnote-goto-previous-reference(#("fn:2" 0 4 (fontified t help-echo "Footnote definition" org-no-flyspell t mouse-face highlight keymap (keymap (follow-link . mouse-face) (mouse-3 . org-find-file-at-mouse) (mouse-2 . org-open-at-mouse)) face org-footnote)))
(cond (special (message "Footnotes: [s]ort | [r]enumber fn:N | [S]=r+s |->[n]umeric | [d]elete") (setq c (read-char-exclusive)) (cond ((equal c 115) (org-footnote-normalize (quote sort))) ((equal c 114) (org-footnote-renumber-fn:N)) ((equal c 83) (org-footnote-renumber-fn:N) (org-footnote-normalize (quote sort))) ((equal c 110) (org-footnote-normalize)) ((equal c 100) (org-footnote-delete)) (t (error "No such footnote command %c" c)))) ((setq tmp (org-footnote-at-reference-p)) (if (car tmp) (org-footnote-goto-definition (car tmp)) (goto-char (nth 1 tmp)) (forward-char 5))) ((setq tmp (org-footnote-at-definition-p)) (org-footnote-goto-previous-reference (car tmp))) (t (org-footnote-new)))
(let (tmp c) (cond (special (message "Footnotes: [s]ort | [r]enumber fn:N | [S]=r+s |->[n]umeric | [d]elete") (setq c (read-char-exclusive)) (cond ((equal c 115) (org-footnote-normalize (quote sort))) ((equal c 114) (org-footnote-renumber-fn:N)) ((equal c 83) (org-footnote-renumber-fn:N) (org-footnote-normalize (quote sort))) ((equal c 110) (org-footnote-normalize)) ((equal c 100) (org-footnote-delete)) (t (error "No such footnote command %c" c)))) ((setq tmp (org-footnote-at-reference-p)) (if (car tmp) (org-footnote-goto-definition (car tmp)) (goto-char (nth 1 tmp)) (forward-char 5))) ((setq tmp (org-footnote-at-definition-p)) (org-footnote-goto-previous-reference (car tmp))) (t (org-footnote-new))))
org-footnote-action()
(cond ((and (org-on-heading-p) (not (org-in-regexp (concat org-plain-link-re "\\|" org-bracket-link-regexp "\\|" org-angle-link-re "\\|" "[ ]:[^ \n]+:[ ]*$"))) (not (get-text-property (point) (quote org-linked-text)))) (or (org-offer-links-in-entry arg) (progn (require (quote org-attach)) (org-attach-reveal (quote if-exists))))) ((run-hook-with-args-until-success (quote org-open-at-point-functions))) ((org-at-timestamp-p t) (org-follow-timestamp-link)) ((and (or (org-footnote-at-reference-p) (org-footnote-at-definition-p)) (not (org-in-regexp org-bracket-link-regexp))) (org-footnote-action)) (t (let (type path link line search (pos (point))) (catch (quote match) (save-excursion (skip-chars-forward "^]\n") (when (org-in-regexp org-bracket-link-regexp 1) (setq link (org-extract-attributes ...)) (while (string-match " *\n *" link) (setq link ...)) (setq link (org-link-expand-abbrev link)) (cond (... ...) (... ...) (t ...)) (throw (quote match) t))) (when (get-text-property (point) (quote org-linked-text)) (setq type "thisfile" pos (if (get-text-property ... ...) (1+ ...) (point)) path (buffer-substring (or ... ...) (or ... ...))) (throw (quote match) t)) (save-excursion (when (or (org-in-regexp org-angle-link-re) (org-in-regexp org-plain-link-re)) (setq type (match-string 1) path (match-string 2)) (throw (quote match) t))) (save-excursion (when (org-in-regexp (org-re "\\(:[[:alnum:]_@#%:]+\\):[ ]*$")) (setq type "tags" path (match-string 1)) (while (string-match ":" path) (setq path ...)) (throw (quote match) t))) (when (org-in-regexp "<\\([^><\n]+\\)>") (setq type "tree-match" path (match-string 1)) (throw (quote match) t))) (unless path (error "No link found")) (with-current-buffer (or reference-buffer (current-buffer)) (if (string-match " +\\'" path) (setq path (replace-match "" t t path))) (if (and org-link-translation-function (fboundp org-link-translation-function)) (let ((tmp ...)) (setq type (car tmp) path (cdr tmp)))) (cond ((assoc type org-link-protocols) (funcall (nth 1 ...) path)) ((equal type "mailto") (let (... ... args1 ... ... a) (if ... ...) (while args ...) (apply cmd ...))) ((member type (quote ...)) (browse-url (concat type ":" ...))) ((string= type "doi") (browse-url (concat "http://dx.doi.org/" ...))) ((member type (quote ...)) (browse-url (concat type ":" path))) ((string= type "tags") (org-tags-view arg path)) ((string= type "tree-match") (org-occur (concat "\\[" ... "\\]"))) ((string= type "file") (if (string-match "::\\([0-9]+\\)\\'" path) (setq line ... path ...) (if ... ...)) (if (string-match "[*?{]" ...) (dired path) (org-open-file path arg line search))) ((string= type "shell") (let (...) (if ... ... ...))) ((string= type "elisp") (let (...) (if ... ... ...))) ((and (string= type "thisfile") (run-hook-with-args-until-success ... path))) ((string= type "thisfile") (if arg (switch-to-buffer-other-window ...) (org-mark-ring-push)) (let (...) (condition-case nil ... ...))) (t (browse-url-at-point)))))))
(if (call-interactively (function org-babel-open-src-block-result)) nil (org-load-modules-maybe) (move-marker org-open-link-marker (point)) (setq org-window-config-before-follow-link (current-window-configuration)) (org-remove-occur-highlights nil nil t) (cond ((and (org-on-heading-p) (not (org-in-regexp (concat org-plain-link-re "\\|" org-bracket-link-regexp "\\|" org-angle-link-re "\\|" "[ ]:[^ \n]+:[ ]*$"))) (not (get-text-property (point) (quote org-linked-text)))) (or (org-offer-links-in-entry arg) (progn (require (quote org-attach)) (org-attach-reveal (quote if-exists))))) ((run-hook-with-args-until-success (quote org-open-at-point-functions))) ((org-at-timestamp-p t) (org-follow-timestamp-link)) ((and (or (org-footnote-at-reference-p) (org-footnote-at-definition-p)) (not (org-in-regexp org-bracket-link-regexp))) (org-footnote-action)) (t (let (type path link line search (pos (point))) (catch (quote match) (save-excursion (skip-chars-forward "^]\n") (when (org-in-regexp org-bracket-link-regexp 1) (setq link ...) (while ... ...) (setq link ...) (cond ... ... ...) (throw ... t))) (when (get-text-property (point) (quote org-linked-text)) (setq type "thisfile" pos (if ... ... ...) path (buffer-substring ... ...)) (throw (quote match) t)) (save-excursion (when (or ... ...) (setq type ... path ...) (throw ... t))) (save-excursion (when (org-in-regexp ...) (setq type "tags" path ...) (while ... ...) (throw ... t))) (when (org-in-regexp "<\\([^><\n]+\\)>") (setq type "tree-match" path (match-string 1)) (throw (quote match) t))) (unless path (error "No link found")) (with-current-buffer (or reference-buffer (current-buffer)) (if (string-match " +\\'" path) (setq path (replace-match "" t t path))) (if (and org-link-translation-function (fboundp org-link-translation-function)) (let (...) (setq type ... path ...))) (cond ((assoc type org-link-protocols) (funcall ... path)) ((equal type "mailto") (let ... ... ... ...)) ((member type ...) (browse-url ...)) ((string= type "doi") (browse-url ...)) ((member type ...) (browse-url ...)) ((string= type "tags") (org-tags-view arg path)) ((string= type "tree-match") (org-occur ...)) ((string= type "file") (if ... ... ...) (if ... ... ...)) ((string= type "shell") (let ... ...)) ((string= type "elisp") (let ... ...)) ((and ... ...)) ((string= type "thisfile") (if arg ... ...) (let ... ...)) (t (browse-url-at-point))))))) (move-marker org-open-link-marker nil) (run-hook-with-args (quote org-follow-link-hook)))
(unless (call-interactively (function org-babel-open-src-block-result)) (org-load-modules-maybe) (move-marker org-open-link-marker (point)) (setq org-window-config-before-follow-link (current-window-configuration)) (org-remove-occur-highlights nil nil t) (cond ((and (org-on-heading-p) (not (org-in-regexp (concat org-plain-link-re "\\|" org-bracket-link-regexp "\\|" org-angle-link-re "\\|" "[ ]:[^ \n]+:[ ]*$"))) (not (get-text-property (point) (quote org-linked-text)))) (or (org-offer-links-in-entry arg) (progn (require (quote org-attach)) (org-attach-reveal (quote if-exists))))) ((run-hook-with-args-until-success (quote org-open-at-point-functions))) ((org-at-timestamp-p t) (org-follow-timestamp-link)) ((and (or (org-footnote-at-reference-p) (org-footnote-at-definition-p)) (not (org-in-regexp org-bracket-link-regexp))) (org-footnote-action)) (t (let (type path link line search (pos (point))) (catch (quote match) (save-excursion (skip-chars-forward "^]\n") (when (org-in-regexp org-bracket-link-regexp 1) (setq link ...) (while ... ...) (setq link ...) (cond ... ... ...) (throw ... t))) (when (get-text-property (point) (quote org-linked-text)) (setq type "thisfile" pos (if ... ... ...) path (buffer-substring ... ...)) (throw (quote match) t)) (save-excursion (when (or ... ...) (setq type ... path ...) (throw ... t))) (save-excursion (when (org-in-regexp ...) (setq type "tags" path ...) (while ... ...) (throw ... t))) (when (org-in-regexp "<\\([^><\n]+\\)>") (setq type "tree-match" path (match-string 1)) (throw (quote match) t))) (unless path (error "No link found")) (with-current-buffer (or reference-buffer (current-buffer)) (if (string-match " +\\'" path) (setq path (replace-match "" t t path))) (if (and org-link-translation-function (fboundp org-link-translation-function)) (let (...) (setq type ... path ...))) (cond ((assoc type org-link-protocols) (funcall ... path)) ((equal type "mailto") (let ... ... ... ...)) ((member type ...) (browse-url ...)) ((string= type "doi") (browse-url ...)) ((member type ...) (browse-url ...)) ((string= type "tags") (org-tags-view arg path)) ((string= type "tree-match") (org-occur ...)) ((string= type "file") (if ... ... ...) (if ... ... ...)) ((string= type "shell") (let ... ...)) ((string= type "elisp") (let ... ...)) ((and ... ...)) ((string= type "thisfile") (if arg ... ...) (let ... ...)) (t (browse-url-at-point))))))) (move-marker org-open-link-marker nil) (run-hook-with-args (quote org-follow-link-hook)))
org-open-at-point()
org-open-at-mouse((mouse-2 (#<window 3 on *Backtrace*> 249 (55 . 235) 67349250 nil 249 (4 . 11) nil (7 . 15) (12 . 20))))
call-interactively(org-open-at-mouse nil nil)
--
next reply other threads:[~2011-06-29 11:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-29 11:48 Jambunathan K [this message]
2011-06-29 12:28 ` [BUG] crash while ping-ponging between back-to-back footnotes Nicolas Goaziou
2011-06-29 12:52 ` Jambunathan K
2011-06-29 13:26 ` Bastien
2011-06-29 14:11 ` Jambunathan K
2011-06-29 17:41 ` Nicolas Goaziou
2011-06-30 8:29 ` Bastien
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=81hb78n9i8.fsf@gmail.com \
--to=kjambunathan@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=n.goaziou@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).