emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Omar Antolín Camarena" <omar@matem.unam.mx>
To: emacs-orgmode@gnu.org
Subject: [BUG] org-open-at-point-global fails on links with multiline descriptions in org-mode buffers [9.6.6 (release_9.6.6 @ /usr/share/emacs/29.1/lisp/org/)]
Date: Sat, 20 Jan 2024 13:44:30 -0600	[thread overview]
Message-ID: <87o7df7psx.fsf@localhost> (raw)


Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

     https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.
------------------------------------------------------------------------

If you have an org link with a newline embedded in the description in an org-mode buffer and put point on it, org-open-at-point correctly follows the link but org-open-at-point-global does not, it instead reports "No link found". (I have plenty of org links with newlines in the description, because org-fill-paragraph tends to reformat links that way.)

I understand that it is reasonable for org-open-at-point-global's regexp-based approach to only look for single-line links and am not suggesting this be changed for non-org-mode buffers, but I would like to suggest that org-open-at-point-global check to see if it is being run in an Org mode buffer and if so just call org-open-at-point. That way users can bind org-open-at-point-global and use that key binding everywhere including org-mode buffers without loss of functionality compared to org-open-at-point.


Emacs  : GNU Emacs 29.1 (build 1, arm-unknown-linux-gnueabihf, GTK+ Version 3.24.37, cairo version 1.16.0)
 of 2023-10-02, modified by Debian
Package: Org mode version 9.6.6 (release_9.6.6 @ /usr/share/emacs/29.1/lisp/org/)

current state:
==============
(setq
 org-agenda-start-on-weekday nil
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-directory "~/Notes"
 org-refile-allow-creating-parent-nodes 'confirm
 org-ascii-format-drawer-function #[771 "\207" [] 4 "\n\n(fn NAME CONTENTS WIDTH)"]
 org-latex-format-inlinetask-function 'org-latex-format-inlinetask-default-function
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines
                  org-cycle-optimize-window-after-visibility-change org-cycle-display-inline-images)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand)
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function
 org-modern-mode-hook '(org-modern-mode-set-explicitly)
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-special-ctrl-a/e t
 org-pretty-entities t
 org-agenda-loop-over-headlines-in-active-region nil
 org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
 org-link-parameters '(("attachment" :follow org-attach-follow :complete org-attach-complete-link)
                       ("eww" :follow org-eww-open :store org-eww-store-link)
                       ("rmail" :follow org-rmail-open :store org-rmail-store-link)
                       ("mhe" :follow org-mhe-open :store org-mhe-store-link)
                       ("irc" :follow org-irc-visit :store org-irc-store-link :export org-irc-export)
                       ("info" :follow org-info-open :export org-info-export :store org-info-store-link :insert-description
                        org-info-description-as-command)
                       ("gnus" :follow org-gnus-open :store org-gnus-store-link)
                       ("docview" :follow org-docview-open :export org-docview-export :store org-docview-store-link)
                       ("bibtex" :follow org-bibtex-open :store org-bibtex-store-link)
                       ("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete org-bbdb-complete-link :store
                        org-bbdb-store-link)
                       ("w3m" :store org-w3m-store-link) ("doi" :follow org-link-doi-open :export org-link-doi-export)
                       ("arXiv" :face org-link :follow
                        (closure
                         ((arxiv-url-format . "https://arxiv.org/abs/%s") (arxiv-regexp . "^\\(.*?\\)\\(?:/\\(.*\\)\\)?$"))
                         (path)
                         (if (string-match arxiv-regexp path)
                          (progn (browse-url (format arxiv-url-format (match-string 1 path)))))
                         )
                        :export
                        (closure
                         ((title-format-2 . "arXiv:%s [%s]") (title-format-1 . "arXiv:%s")
                          (url-format . "https://arxiv.org/abs/%s") (path-regexp . "^\\(.*?\\)\\(?:/\\(.*\\)\\)?$"))
                         (path description backend)
                         (if (and (memq backend '(latex html)) (string-match path-regexp path))
                          (progn
                           (format
                            (cond ((memq backend '(beamer latex)) (let nil "\\href{%s}{%s}"))
                             ((eq backend 'html) (let nil "<a href=\"%s\">%s</a>")))
                            (format url-format (match-string 1 path))
                            (or description
                             (format
                              (cond ((memq backend '(beamer latex)) (let nil "\\texttt{%s}"))
                               ((eq backend 'html) (let nil "<code>%s</code>")))
                              (format (if (match-string 2 path) title-format-2 title-format-1) (match-string 1 path)
                               (match-string 2 path))
                              )
                             )
                            )
                           )
                          )
                         )
                        )
                       ("id" :follow org-id-open) ("org-title" :store store-org-title-link) ("file+sys") ("file+emacs")
                       ("geo" :follow (closure (t) (link _) (osm (concat "geo:" link))) :store
                        (closure (t) nil
                         (if (eq major-mode 'osm-mode) (progn (apply 'org-link-store-props (osm--org-link-props)))))
                        )
                       ("shell" :follow org-link--open-shell)
                       ("news" :follow #[514 "\301\300\302Q\"\207" ["news" browse-url ":"] 6 "\n\n(fn URL ARG)"])
                       ("mailto" :follow #[514 "\301\300\302Q\"\207" ["mailto" browse-url ":"] 6 "\n\n(fn URL ARG)"])
                       ("https" :follow #[514 "\301\300\302Q\"\207" ["https" browse-url ":"] 6 "\n\n(fn URL ARG)"])
                       ("http" :follow #[514 "\301\300\302Q\"\207" ["http" browse-url ":"] 6 "\n\n(fn URL ARG)"])
                       ("ftp" :follow #[514 "\301\300\302Q\"\207" ["ftp" browse-url ":"] 6 "\n\n(fn URL ARG)"])
                       ("help" :follow org-link--open-help :store org-link--store-help)
                       ("file" :complete org-link-complete-file) ("elisp" :follow org-link--open-elisp))
 org-outline-path-complete-in-steps nil
 org-agenda-skip-timestamp-if-done t
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-cycle-emulate-tab 'whitestart
 org-confirm-babel-evaluate nil
 org-export-async-init-file "~/.emacs.d/my-lisp/org-async-init.el"
 org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-publish-project-alist nil ; REDACTED
 org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function
 outline-mode-hook '(beginend-outline-mode)
 org-confirm-shell-link-function 'yes-or-no-p
 org-capture-templates '(("d" "Daily" entry (file+olp+datetree "Daily.org") "* TODO %?\n")
                         ("r" "Reply" entry (file+olp+datetree "Daily.org")
                          "* TODO Contestarle a %:fromname: [[%L][%:subject]]\n" :immediate-finish t)
                         ("n" "Note" entry (file+olp "Notes.org" "Miscellaneous") "* %?\n")
                         ("t" "Math talk" entry (file+olp "Math.org" "Talks")
                          "* [[%c][💻]] %^{Speaker}, /%^{Title}/ \n%^T\n%?")
                         ("v" "Talk" entry (file+olp "Notes.org" "Talks") "* [[%c][💻]] %?\n")
                         ("j" "Journal entry" plain (file+olp+datetree "Journal.org"))
                         ("a" "arXiv paper" entry (file+olp "Math.org" "Reading" "arXiv") "* %c\n" :immediate-finish t)
                         ("l" "Link" entry (file+olp "Notes.org" "Miscellaneous") "* %?%a\n")
                         ("c" "Clipboard link" entry (file+olp "Notes.org" "Miscellaneous") "* %?[[%c][%^{Title}]]")
                         ("p" "Blood Pressure" table-line (file+olp "Health.org" "Blood Pressure")
                          "| %U | %^{LSys} | %^{LDia} | %^{LPul} | %^{RSys} | %^{RDia} | %^{RPul} |" :immediate-finish t)
                         ("e" "Emacs templates") ("s" "Someday" entry (file "Someday.org") "* %?\n")
                         ("ei" "Idea" entry (file+olp "Emacs.org" "Ideas") "* %?\n")
                         ("et" "Tip" entry (file+olp "Emacs.org" "Tips") "* %?\n")
                         ("eq" "Question" entry (file+olp "Emacs.org" "Questions") "* %?\n")
                         ("ep" "Package" entry (file+olp "Emacs.org" "Packages") "* %?\n"))
 org-persist-before-write-hook '(org-element--cache-persist-before-write)
 org-agenda-skip-deadline-if-done t
 org-export-with-smart-quotes t
 org-hide-emphasis-markers t
 org-confirm-elisp-link-function 'yes-or-no-p
 org-entities-user '(("newline" "\\newline" nil "<br>" "\n" "\n" "⏎"))
 org-persist-before-read-hook '(org-element--cache-persist-before-read)
 org-cycle-tab-first-hook '(org-babel-hide-result-toggle-maybe org-babel-header-arg-expand)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer)
 org-hide-leading-stars t
 org-use-speed-commands t
 org-occur-hook '(org-first-headline-recenter)
 org-todo-keywords '((sequence "TODO" "|" "DONE" "NOPE") (sequence "WAIT(@)"))
 org-agenda-files '("~/Notes/Daily.org" "~/Notes/Work.org" "~/Notes/Math.org" "~/Notes/Home.org" "~/Notes/Health.org")
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-link-shell-confirm-function 'yes-or-no-p
 org-agenda-mode-hook '(beginend-org-agenda-mode)
 org-startup-indented t
 org-ql-completing-read-snippet-function 'org-ql-completing-read--snippet-simple
 org-src-lang-modes '(("latex-macros" . latex) ("inline-js" . javascript) ("C" . c) ("C++" . c++) ("asymptote" . asy)
                      ("bash" . sh) ("beamer" . latex) ("calc" . fundamental) ("cpp" . c++) ("ditaa" . artist)
                      ("desktop" . conf-desktop) ("dot" . fundamental) ("elisp" . emacs-lisp) ("ocaml" . tuareg)
                      ("screen" . shell-script) ("shell" . sh) ("sqlite" . sql) ("toml" . conf-toml))
 org-agenda-skip-scheduled-if-done t
 org-auto-align-tags nil
 org-preview-latex-image-directory "~/.cache/ltximg/"
 org-latex-classes nil; REDACTED
 org-structure-template-alist '(("a" . "export ascii") ("c" . "center") ("C" . "comment") ("e" . "example") ("E" . "export")
                                ("h" . "export html") ("l" . "export latex") ("q" . "quote") ("s" . "src") ("v" . "verse")
                                ("thm" . "theorem") ("pf" . "proof") ("lem" . "lemma") ("cor" . "corollary")
                                ("def" . "definition") ("rem" . "remark") ("exer" . "exercise") ("prop" . "proposition")
                                ("el" . "src emacs-lisp"))
 org-html-format-headline-function 'org-html-format-headline-default-function
 org-ellipsis "…"
 org-mode-hook '(#[0 "\301\211\207" [imenu-create-index-function org-imenu-get-tree] 2]
                 #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-fold-show-all append local] 5]
                 #[0 "\300\301\302\303\304$\207" [add-hook change-major-mode-hook org-babel-show-result-all append local] 5]
                 org-babel-result-hide-spec org-babel-hide-all-hashes add-pretty-entities-hook org-tweak-syntax-table
                 turn-off-visual-line-mode turn-on-auto-fill ediff-with-org-show-all turn-on-org-cdlatex beginend-org-mode)
 org-babel-pre-tangle-hook '(save-buffer)
 org-tags-column 0
 org-refile-use-outline-path 'file
 org-fold-core-isearch-open-function 'org-fold-core--isearch-reveal
 org-capture-templates-contexts '(("r" ((in-mode . "gnus-article-mode") (in-mode . "gnus-summary-mode"))))
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn ENTRY)"]
 org-link-from-user-regexp "REDACTED"
 org-log-into-drawer t
 org-latex-packages-alist '(("AUTO" "babel" t ("pdflatex")))
 org-highlight-latex-and-related '(latex script entities)
 org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-speed-command-hook '(org-speed-command-activate org-babel-speed-command-activate)
 org-refile-targets '((nil :maxlevel . 2) ("~/Notes/Notes.org" :maxlevel . 2) ("~/Notes/Someday.org" :level . 0)
                      ("~/Notes/Health.org" :maxlevel . 1) ("~/Notes/Home.org" :maxlevel . 1)
                      ("~/Notes/Work.org" :maxlevel . 2) ("~/Notes/Math.org" :maxlevel . 2))
 org-agenda-finalize-hook '(org-modern-agenda)
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-link-elisp-confirm-function 'yes-or-no-p
 )


             reply	other threads:[~2024-01-20 19:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-20 19:44 Omar Antolín Camarena [this message]
2024-01-21 12:18 ` [BUG] org-open-at-point-global fails on links with multiline descriptions in org-mode buffers [9.6.6 (release_9.6.6 @ /usr/share/emacs/29.1/lisp/org/)] Ihor Radchenko
2024-01-21 13:09   ` Gregor Zattler
2024-01-21 13:27     ` Ihor Radchenko
2024-01-21 17:50   ` Omar Antolín Camarena

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=87o7df7psx.fsf@localhost \
    --to=omar@matem.unam.mx \
    --cc=emacs-orgmode@gnu.org \
    /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).