bug#42484: 26.1: org-mode should display value of links in mini-buffer
> this is an interesting discussion. is there any side discussion that > takes into account both mouse and cursor? Indeed, you can see a side discussion at https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg00885.html where we discussed highlighting the completion candidate the same way whether the mouse pointer hovered over it, or the cursor moved to its buffer position. That discussion also mentions another way to display help-text using cursor-sensor-mode, i.e. after enabling it, cursor-sensor-functions can detect when the cursor enters the help-text property, then display it in the echo area. > 1] displaying value of link in echo area [the problem you are > discussing -- don't let me derail it] with a short nonzero delay > 2] doing so *for both cursor and mouse* -- too much futzing here > 3] also doing other stuff -- also futzing > > other stuff includes maybe [or maybe not] showing function signature > or docstrings in elisp buffers [possibly with longer delay], and > showing the time span in number of days from now to the org timestamp > at point or under mouse in any mode. This looks like the 5th possible way to implement this using eldoc, in addition to tooltips, post-command-hook, help-at-pt, cursor-sensor-mode. > i have code for the last thing. the problem is figuring out making > tooltips, eldoc, help-at-pt, or post-command-hook work with mouse > and keyboard without verbose help-echo like in dired. also the > major/minor modes and help-at-pt has an option to ignore verbose help-echo in dired. post-command-hook can be enabled locally only in org-mode buffers. I don't know how to do the same in eldoc. > i guess i am saying [back to topic] this is a bit complex and i wonder > if a more orthogonal solution is called for? as some might want mouse > activation also, and eldoc already shows elisp stuff. > > and another suggestion: org-link-minor-mode is what i might use to > identify when to activate org links and timestamps. You mean to activate is to display their help-echo?
Re: [PATCH] Enhance org-html--build-meta-info
TEC writes: >> Sorry, I still see the flycheck warning and "&" for "&". > Maybe I accidently sent you the old patches? I'll check tomorrow. Hah, I check and guess what I see? The changes were unstaged 😂. Sorry about that, here's an actual revision. -- Timothy >From 3ab8b4f108c8cfa4b0bf11842907c31846832f1a Mon Sep 17 00:00:00 2001 From: TEC Date: Mon, 14 Dec 2020 17:41:33 +0800 Subject: [PATCH 1/2] lisp/ox-html.el: make html meta tag builder nicer * lisp/ox-html.el (org-html--build-meta-info): Multi-line repeated structure extracted to new function `org-html--build-meta-entry'. The keyword value formatting is changed from `org-export-data' to `org-html-encode-plain-text' to avoid potentially nesting HTML tags in meta tags and the element, which would violate W3C. --- lisp/ox-html.el | 118 1 file changed, 60 insertions(+), 58 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 03145e35c..f18f8a2ef 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -1835,78 +1835,80 @@ INFO is a plist used as a communication channel." ;;; Template +(defun org-html--build-meta-entry +(label identity &optional content-format &rest content-formatters) + "Build a meta tag using the provided information. + +Construct tag of form , or when CONTENT-FORMAT +is present: + +Here {content} is determined by applying any CONTENT-FORMATTERS to the +CONTENT-FORMAT and encoding the result as plain text." + (concat "\n")) + (defun org-html--build-meta-info (info) "Return meta tags for exported document. INFO is a plist used as a communication channel." - (let* ((protect-string - (lambda (str) -(replace-regexp-in-string - "\"" """ (org-html-encode-plain-text str - (title (org-export-data (plist-get info :title) info)) - ;; Set title to an invisible character instead of leaving it - ;; empty, which is invalid. - (title (if (org-string-nw-p title) title "‎")) - (author (and (plist-get info :with-author) - (let ((auth (plist-get info :author))) + (let* ((title (org-html-plain-text + (org-element-interpret-data (plist-get info :title)) info)) + ;; Set title to an invisible character instead of leaving it + ;; empty, which is invalid. + (title (if (org-string-nw-p title) title "‎")) + (author (and (plist-get info :with-author) + (let ((auth (plist-get info :author))) ;; Return raw Org syntax. -(and auth (org-element-interpret-data auth) - (description (plist-get info :description)) - (keywords (plist-get info :keywords)) - (charset (or (and org-html-coding-system - (fboundp 'coding-system-get) - (coding-system-get org-html-coding-system - 'mime-charset)) - "iso-8859-1"))) + (and auth (org-html-plain-text + (org-element-interpret-data auth) info) + (charset (or (and org-html-coding-system + (fboundp 'coding-system-get) + (symbol-name + (coding-system-get org-html-coding-system + 'mime-charset))) + "iso-8859-1"))) (concat (when (plist-get info :time-stamp-file) (format-time-string (concat "\n"))) - (format - (if (org-html-html5-p info) - (org-html-close-tag "meta" "charset=\"%s\"" info) - (org-html-close-tag - "meta" "http-equiv=\"Content-Type\" content=\"text/html;charset=%s\"" - info)) - charset) "\n" + + (if (org-html-html5-p info) + (org-html--build-meta-entry "charset" charset) + (org-html--build-meta-entry "http-equiv" "Content-Type" + (concat "text/html;charset=" charset))) + (let ((viewport-options (cl-remove-if-not (lambda (cell) (org-string-nw-p (cadr cell))) (plist-get info :html-viewport - (and viewport-options - (concat - (org-html-close-tag - "meta" - (format "name=\"viewport\" content=\"%s\"" - (mapconcat - (lambda (elm) (format "%s=%s" (car elm) (cadr elm))) - viewport-options ", ")) - info) - "\n"))) + (if viewport-options + (org-html--build-meta-entry "name" "viewport" + (mapconcat + (lambda (elm) + (format "%s=%s" (car elm) (cadr elm))) + viewport-options ", " + (format "%s\n" title) - (org-html-close-tag "meta" "name=\"generator\" content=\"Org mode\"" info) - "\n" - (and (org-string-nw-p author) - (concat - (org-html-close-tag "meta" - (format "name=\"author\" content=\"%s\"" - (funcall protect-string author)) - info) - "\n")) - (and (org-string-nw-p description) - (concat - (org-html-close-tag "meta" - (format "name=\"description\" content=\"%s\"\n" - (funcall protect-string description)) - info) -
[Patch] [Objective]Caml dialect in listings
Hi, I have just started using `org-mode`, and it is very cool ! Thank you for your collective work. There is a small patch I would like to submit : when writing listings for the OCaml programming language, one should use the "[Objective]Caml" dialect, which is different from the "Caml" dialect. This is not reflected in the latex exported code. The attached patch changes this. Thank you in advance for your patience, this is my first patch so I hope I did everything correctly. Cheers ! -- Basile Pesin Inria Paris - PARKAS >From 7343ff30927876966d3eabd3c1ee9c2afa018d2e Mon Sep 17 00:00:00 2001 From: Basile Pesin Date: Thu, 14 Jan 2021 13:16:54 +0100 Subject: [PATCH] ox-latex.el : Use [Objective]Caml dialect * ox-latex.el (org-latex-listings-langs): Change the binding for `ocaml' to "[Objective]Caml" The "[Objective]Caml" dialect syntax highlighting is different from the "Caml" one (reflecting the added features of OCaml compared to Caml-light). TINYCHANGE --- lisp/ox-latex.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 2a14b25d5..3b1fb71f2 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -956,7 +956,7 @@ URL `https://orgmode.org/worg/org-tutorials/org-latex-preview.html'." (tex "TeX") (latex "[LaTeX]TeX") (shell-script "bash") (gnuplot "Gnuplot") -(ocaml "Caml") (caml "Caml") +(ocaml "[Objective]Caml") (caml "Caml") (sql "SQL") (sqlite "sql") (makefile "make") (R "r")) -- 2.29.2
Bug: Unexpected movement of cursor when commenting code blocks
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. When I am inside a code block like this: #+begin_src emacs-lisp (use-package org :defer :config (setq blahblah t)) ; cursor on this line #+end_src and I hit "C-x C-;" to comment the line, the cursor automatically jumps to the second line of the code block after the comment is made. I would expect the cursor to move forward one line like it usually does and this only happens in Org-mode, not when I edit the code block in a separate buffer with "C-c C-'". #+begin_src emacs-lisp (use-package org :defer ; cursor jumps to this line :config ;; (setq blahblah t)) #+end_src This happens no matter how big the code block is, and it always jumps to the second line of the code block. I was able to reproduce this with the "minimal-org.el" file. Emacs : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.23, cairo version 1.16.0) Package: Org mode version 9.4.4 (9.4.4-3-gbd1c31-elpaplus @ /nix/store/ybfrs7h4byc03f963flgc845n3m1dkhi-emacs-packages-deps/share/emacs/site-lisp/elpa/org-plus-contrib-20201228/)
Ready to merge! Re: [PATCH] Enhance org-html--build-meta-info
This thread has dragged on ages, and if no-one else is following this chain I wouldn't blame them in the slightest. To help indicate that this is actually ready (at last) now, I'm just going to add that info the the subject line in the hope it helps Bastien or any others notice that this is actually good to go now :) -- Timothy Jens Lechtenboerger writes: > This looks fine to me. Many thanks! > > Best wishes > Jens
Re: [PATCH] Enhance org-html--build-meta-info
On 2021-01-14, TEC wrote: > TEC writes: > >>> Sorry, I still see the flycheck warning and "&" for "&". >> Maybe I accidently sent you the old patches? I'll check tomorrow. > > Hah, I check and guess what I see? The changes were unstaged 😂. > > Sorry about that, here's an actual revision. This looks fine to me. Many thanks! Best wishes Jens smime.p7s Description: S/MIME cryptographic signature
bug#42484: 26.1: org-mode should display value of links in mini-buffer
by activate i mean display, in echo area, whatever it is i want to display. i think help-echo is a text property, and i might or might not want to display it, depending. and i might want to display the other stuff even if there is no help-echo. i use [and adore] org-link-minor mode in elisp mode. it highlights links and timestamps and makes links followable. i even use [[target]] <> within elisp buffers, and org id links that go from elisp to org and vice-versa. if org-link-minor-mode is active in an elisp buffer, i can run the following to detect whether cursor is over an org ts. (defun hoka-eldoc-at-point () (when (eq 'org-date (get-text-property (point) 'face)) (format "%s" (when (fboundp 'alpha-org-time-span) (with-no-warnings (alpha-org-time-span)) then i get the time span in the echo area. a time span is e.g. -1 for yesterday. it could just as well be a timestamp in a different format or lang. so that's great. but i want mouse hover to do the same thing, and to do so with a delay. and i want links of course. more generally, i might occasionally want /some/ eldoc type stuff and /some/ help-echo stuff. so org-link-minor-mode was useful in my case because it [i think it is it] adds face property which can be used. and i thought that might be useful to you. idk though. in my case i find it a bit overwhelming to get whatever solution i use for cursor to also work for mouse [with appropriate delays]. and get whatever else to work and to not have anything annoyingly display. On 1/14/21, Juri Linkov wrote: >> this is an interesting discussion. is there any side discussion that >> takes into account both mouse and cursor? > > Indeed, you can see a side discussion at > https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg00885.html > where we discussed highlighting the completion candidate > the same way whether the mouse pointer hovered over it, > or the cursor moved to its buffer position. > > That discussion also mentions another way to display > help-text using cursor-sensor-mode, i.e. after enabling it, > cursor-sensor-functions can detect when the cursor enters > the help-text property, then display it in the echo area. > >> 1] displaying value of link in echo area [the problem you are >> discussing -- don't let me derail it] with a short nonzero delay >> 2] doing so *for both cursor and mouse* -- too much futzing here >> 3] also doing other stuff -- also futzing >> >> other stuff includes maybe [or maybe not] showing function signature >> or docstrings in elisp buffers [possibly with longer delay], and >> showing the time span in number of days from now to the org timestamp >> at point or under mouse in any mode. > > This looks like the 5th possible way to implement this using eldoc, > in addition to tooltips, post-command-hook, help-at-pt, cursor-sensor-mode. > >> i have code for the last thing. the problem is figuring out making >> tooltips, eldoc, help-at-pt, or post-command-hook work with mouse >> and keyboard without verbose help-echo like in dired. also the >> major/minor modes and > > help-at-pt has an option to ignore verbose help-echo in dired. > post-command-hook can be enabled locally only in org-mode buffers. > I don't know how to do the same in eldoc. > >> i guess i am saying [back to topic] this is a bit complex and i wonder >> if a more orthogonal solution is called for? as some might want mouse >> activation also, and eldoc already shows elisp stuff. >> >> and another suggestion: org-link-minor-mode is what i might use to >> identify when to activate org links and timestamps. > > You mean to activate is to display their help-echo? > -- The Kafka Pandemic Please learn what misopathy is. https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html
na=\"nil\" in ob-R.elo
Probably a silly question, but in ob-R.el, what is the reason for setting na=\"nil\" when defining org-babel-R-write-object-command? Is this an elisp compatibility thing? Regardless, I generally (always?) want na=\"\" for this, so I am finding all those "nil"s very annoying, and the only way that I see to defeat them is to redefine org-babel-R-write-object-command. If there is no reason for the current behavior (doubtful I know) and if I am not missing an obvious work-around, then I would like to suggest changing this behavior. Otherwise, would it be feasible to add an option for R code blocks (:nastring?) where one could specify the NA replacement string? What do you think? It's easy to suggest I know and certainly beyond my elisp coding skills at present, but I am supposing that someone more fluent in elisp could do this safely without too much trouble.