emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] export blocks no longer fontifying [9.7.10 (release_9.7.10 @ /Users/ben/Scripts/emacs/lisp/org/)]
@ 2024-09-01  4:35 Benjamin McMillan
  2024-09-10 17:01 ` Ihor Radchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Benjamin McMillan @ 2024-09-01  4:35 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 15518 bytes --]

At some point in the last few months, org mode stopped fontifying my
latex export blocks. However, an older version of emacs on my computer
still does fontify.
(The difference is seen even opening emacs with the -q flag)
It seems that there was a change to the function
org-fontify-meta-lines-and-blocks-1 in org.el, specifically at the
conditional that checks org-src-fontify-natively.
As the comment there explains, the intention is to only fontify src
blocks, but I don't see any option exposed to enable fontififcation of
export blocks, which is a fairly crucial feature to my workflow.

I think fontification of export blocks should follow that of src blocks,
or a separate option should be made. (Or, I may be missing some already
existing solution!)

For what it is worth, I can get the desired behavior by modifying the
code mentioned above to include "export", as in the following:
(and org-src-fontify-natively
    ;; Technically, according to
    ;; `org-src-fontify-natively' docstring, we should
    ;; only fontify src blocks.  However, it is common
    ;; to use undocumented fontification of example
    ;; blocks with undocumented language specifier.
    ;; Keep this undocumented feature for user
    ;; convenience.
    (member block-type '("src" "example" "export")))

Thanks,
Ben


Emacs  : GNU Emacs 31.0.50 (build 3, aarch64-apple-darwin23.5.0, NS
appkit-2487.60 Version 14.5 (Build 23F79))
 of 2024-08-29
Package: Org mode version 9.7.10 (release_9.7.10 @
/Users/ben/Scripts/emacs/lisp/org/)

current state:
==============
(setq
 org-noter-get-selected-text-hook '(org-noter-djvu--get-selected-text
org-noter-nov--get-selected-text
   org-noter-pdf--get-selected-text)
 org-yank-image-file-name-function 'org-yank-image-autogen-filename
 org-persist-before-write-hook '(org-element--cache-persist-before-write)
 org-noter-doc-split-fraction '(0.6 . 0.5)
 org-html-format-headline-function
'org-html-format-headline-default-function
 org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-noter--get-current-view-hook '(org-noter-djvu--get-current-view
org-noter-nov--get-current-view
   org-noter-pdf--get-current-view)
 org-log-into-drawer "LOG"
 org-latex-format-inlinetask-function
'org-latex-format-inlinetask-default-function
 org-M-RET-may-split-line nil
 org-noter--pretty-print-location-for-title-hook
'(org-noter-djvu--pretty-print-location
  org-noter-nov--pretty-print-location
  org-noter-pdf--pretty-print-location-for-title)
 org-babel-tangle-lang-exts '(("python" . "py") ("emacs-lisp" . "el")
("elisp" . "el"))
 org-treat-insert-todo-heading-as-state-change t
 org-noter--get-highlight-location-hook '(org-noter-pdf--get-highlight)
 org-roam-db-node-include-function #[0 "\300\207" [t] 1]
 org-timer-done-hook '(my/org-timer-done-actions)
 org-roam-log-setup-hook '(org-roam--register-completion-functions-h)
 org-speed-command-hook '(org-speed-command-activate
org-babel-speed-command-activate)
 org-export-in-background t
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-roam-preview-function 'org-roam-preview-default-function
 org-latex-format-headline-function
'org-latex-format-headline-default-function
 org-agenda-window-setup 'current-window
 org-noter--convert-to-location-cons-hook
'(org-noter-pdf--convert-to-location-cons)
 org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
 org-blank-before-new-entry '((heading) (plain-list-item))
 org-export-async-init-file "~/.emacs.d/org/export-dispatch-init.el"
 org-mode-hook '(my/org-mode-completion-setup #[nil ((org-bullets-mode 1))
(t)] er/add-org-mode-expansions
#[nil ((add-hook 'change-major-mode-hook 'org-fold-show-all 'append 'local))
  (org--rds reftex-docstruct-symbol org-attach-method
org--single-lines-list-is-paragraph
   org-element-greater-elements org-agenda-restrict-end
org-agenda-restrict-begin
   org-agenda-restrict visual-fill-column-width org-clock-history
org-agenda-current-date
   org-with-time org-defdecode org-def org-read-date-inactive org-ans2
org-ans1
   org-columns-current-fmt-compiled org-clock-current-task org-clock-effort
   org-agenda-skip-function org-agenda-skip-comment-trees
org-agenda-archives-mode
   org-end-time-was-given org-time-was-given org-log-note-extra
org-log-note-purpose
   org-log-post-message org-last-inserted-timestamp
org-last-changed-timestamp
   org-entry-property-inherited-from org-state
org-agenda-headline-snapshot-before-repeat
   org-agenda-buffer-name org-agenda-start-on-weekday
org-agenda-buffer-tmp-name
   org-log-note-marker org-priority-regexp org-mode-abbrev-table
org-element-cache-persistent
   org-element-cache-version org-tbl-menu org-org-menu org-struct-menu
org-entities
   org-last-state org-id-track-globally org-clock-start-time texmathp-why
remember-data-file
   org-agenda-tags-todo-honor-ignore-options calc-embedded-open-mode
calc-embedded-open-formula
   calc-embedded-close-formula align-mode-rules-list org-emphasis-alist
   org-emphasis-regexp-components org-export-registered-backends org-modules
   org-babel-load-languages org-id-overriding-file-name
org-indent-indentation-per-level
   org-element--timestamp-regexp org-element-cache-map-continue-from
   org-element-paragraph-separate org-agenda-buffer-name
org-inlinetask-min-level t)
  ]
#[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
#[0 "\301\211 \207" [imenu-create-index-function org-imenu-get-tree] 2])
 org-noter--doc-approx-location-hook '(org-noter-djvu--approx-location-cons
org-noter-nov--approx-location-cons
      org-noter-pdf--approx-location-cons)
 org-noter--pretty-print-highlight-location-hook
'(org-noter-pdf--pretty-print-highlight)
 org-noter-auto-save-last-location t
 org-noter-set-up-document-hook '(org-noter-djvu--setup-handler
org-noter-nov--setup-handler
 org-noter-pdf--doc-view-setup-handler
org-noter-pdf--pdf-view-setup-handler)
 org-capture-templates '(("i" "File to inbox" entry
 (file+olp "~/Projects/getitdone/getitdone.org" "PARA" "PROJECTS"
"PROCESS") "* %?")
("e" "File to emacs issues" entry
 (file+olp "~/.emacs.d/emacs-gtd.org" "Emacs PARA" "PROJECTS" "PROCESS") "*
%?")
("m" "Math note" entry
 (file+olp "~/Projects/getitdone/math-gtd.org" "MATH PARA" "PROJECTS"
"PROCESS") "* %?")
("f" "File to filing cabinet" entry
 (file+olp "~/Projects/getitdone/getitdone.org" "PARA" "PROJECTS" "FILE")
"* %?")
("l" "Local inbox" entry
 (file+headline
  (lambda nil (concat (file-name-directory (buffer-file-name))
".TODO.org")) "Inbox")
 "")
("r" "Research note" entry
 (file+headline (lambda nil (concat (buffer-file-name))) "RESEARCH NOTES")
 "* %?\n:LOG:\nENTRY-DATE: %t\n:END:\n- " :prepend t :jump-to-captured t)
("t" "File to tumble ideas" entry
 (file+olp "~/Projects/getitdone/getitdone.org" "PARA" "AREAS" "tumbles")
"* %?")
)
 org-id-link-consider-parent-id t
 org-confirm-shell-link-function 'yes-or-no-p
 org-export-dispatch-use-expert-ui t
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-src-window-setup "plain"
 org-noter--show-arrow-hook '(org-noter-pdf--show-arrow)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-occur-hook '(org-first-headline-recenter)
 org-ellipsis " \\/ "
 org-html-format-inlinetask-function
'org-html-format-inlinetask-default-function
 org-roam-node-annotation-function 'org-roam-node-read--annotation
 org-bullets-bullet-list '("○")
 org-confirm-babel-evaluate 'my/org-confirm-babel-evaluate
 org-ascii-format-drawer-function #[771 " \207" [] 4 "\n\n(fn NAME CONTENTS
WIDTH)"]
 org-roam-directory "/Users/ben/own/org-roam"
 org-indent-indentation-per-level 1
 org-roam-db-autosync-mode t
 org-roam-indirect-buffer-hook '(org-roam--register-completion-functions-h)
 org-bibtex-headline-format-function 'org-bibtex-headline-format-default
 org-capture-prepare-finalize-hook '(org-roam-capture--install-finalize-h)
 org-link-parameters '(("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)
      ("roam" :follow org-roam-link-follow-link)
      ("attachment" :follow org-attach-follow :complete
org-attach-complete-link)
      ("id" :follow org-roam-id-open :store org-id-store-link-maybe)
("file+sys")
      ("file+emacs") ("shell" :follow org-link--open-shell)
      ("news" :follow
#[514 "\301\300\302 Q \"\207" ["news" browse-url ":"] 6 "\n\n(fn URL ARG)"])
      ("mailto" :follow
#[514 "\301\300\302 Q \"\207" ["mailto" browse-url ":"] 6 "\n\n(fn URL
ARG)"])
      ("https" :follow
#[514 "\301\300\302 Q \"\207" ["https" browse-url ":"] 6 "\n\n(fn URL
ARG)"])
      ("http" :follow
#[514 "\301\300\302 Q \"\207" ["http" browse-url ":"] 6 "\n\n(fn URL ARG)"])
      ("ftp" :follow
#[514 "\301\300\302 Q \"\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-log-buffer-setup-hook '(org-roam-log--setup)
 org-noter-create-skeleton-functions '(org-noter-djvu--create-skeleton
org-noter-nov--create-skeleton-epub
      org-noter-pdf--create-skeleton)
 org-noter-get-buffer-file-name-hook '(org-noter-nov--get-buffer-file-name
org-noter-pdf--get-buffer-file-name)
 org-cycle-tab-first-hook '(org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-todo-keywords '((sequence "TODO(t!)" "|" "SUSP(s@)" "DONE(d!)"))
 org-return-follows-link t
 org-noter--get-containing-element-hook '(org-noter--get-containing-heading
 org-noter--get-containing-property-drawer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-agenda-restore-windows-after-quit t
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-sort-function 'string-collate-lessp
 org--warnings nil
 org-startup-folded t
 org-babel-pre-tangle-hook '(save-buffer)
 org-roam-capture-new-node-hook '(org-roam-capture--insert-captured-ref-h)
 org-highlight-latex-and-related '(latex script entities)
 org-noter--get-precise-info-hook '(org-noter-djvu--get-precise-info
org-noter-nov--get-precise-info
   org-noter-pdf--doc-view-get-precise-info
   org-noter-pdf--pdf-view-get-precise-info)
 org-tags-column -90
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-link-shell-confirm-function 'yes-or-no-p
 org-cycle-emulate-tab nil
 org-fold-core-isearch-open-function 'org-fold--isearch-reveal
 org-yank-adjusted-subtrees t
 org-roam-capture-preface-hook '(org-roam-capture--try-capture-to-ref-h)
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-noter--doc-goto-location-hook '(org-noter-djvu--goto-location
org-noter-nov--goto-location
    org-noter-pdf--goto-location)
 org-src-mode-hook '(perject--auto-add-buffer
org-src-babel-configure-edit-buffer
    org-src-mode-configure-edit-buffer)
 org-roam-find-file-hook '(org-roam-buffer--setup-redisplay-h
org-roam--register-completion-functions-h
  org-roam--replace-roam-links-on-save-h
org-roam-db-autosync--setup-update-on-save-h)
 org-babel-load-languages '((emacs-lisp . t) (python . t) (gnuplot \.t))
 org-roam-ref-annotation-function 'org-roam-ref-read--annotation
 org-agenda-loop-over-headlines-in-active-region nil
 org-agenda-files '("~/Areas/reading/.TODO.org" "~/Areas/reading/
read_log.org" "~/Areas/talks/Stacks/.TODO.org"
   "~/.emacs.d/.TODO.org" "~/.emacs.d/emacs-gtd.org"
"~/.emacs.d/emacs-gtd.org_archive"
   "~/Projects/235embeddingsPaper/sagecalcs/.TODO.org"
   "~/Projects/235embeddingsPaper/.TODO.org"
"~/Projects/235embeddingsPaper/.TODO.org_archive"
   "~/Projects/235embeddingsPaper/embeddings.org"
"~/Projects/235embeddingsPaper/paper.org"
   "~/Projects/HessianMetrics/sagecalcs/.TODO.org"
"~/Projects/HessianMetrics/.TODO.org"
   "~/Projects/HessianMetrics/hessianmetrics.org"
"~/Projects/distributionmaps/.TODO.org"
   "~/Projects/distributionmaps/distributionmaps.org"
"~/Projects/foliations/Ben/.TODO.org"
   "~/Projects/foliations/Ben/singularfolia.org"
"~/Projects/getitdone/.TODO.org"
   "~/Projects/getitdone/KoreanTaxes.org" "~/Projects/getitdone/
filingcabinet.org"
   "~/Projects/getitdone/getitdone.org"
"~/Projects/getitdone/getitdone.org_archive"
   "~/Projects/getitdone/math-gtd.org" "~/Projects/glenelg/.TODO.org"
   "~/Projects/glenelg/glenelg.org" "~/Projects/lecturenotes/.TODO.org"
   "~/Projects/lecturenotes/notes.org" "~/Projects/miscmath/unfullblown.org"
   "~/Projects/pdemoduli/.TODO.org" "~/Projects/pdemoduli/pdemoduli.org"
   "~/Projects/singularities/.TODO.org")
 org-babel-python-command "python3"
 org-noter-create-session-from-document-hook
'(org-noter--create-session-from-document-file-default)
 org-link-elisp-confirm-function 'yes-or-no-p
 org-noter--add-highlight-hook '(org-noter-pdf--highlight-location)
 org-startup-indented t
 org-odt-format-inlinetask-function
'org-odt-format-inlinetask-default-function
 org-src-lang-modes '(("latex" . LaTeX) ("C" . c) ("C++" . c++)
("asymptote" . asy) ("beamer" . latex)
     ("calc" . fundamental) ("cpp" . c++) ("ditaa" . artist) ("desktop" .
conf-desktop)
     ("dot" . fundamental) ("elisp" . emacs-lisp) ("ocaml" . tuareg)
("screen" . shell-script)
     ("sqlite" . sql) ("toml" . conf-toml) ("shell" . sh) ("ash" . sh)
("sh" . sh)
     ("bash" . sh) ("jsh" . sh) ("bash2" . sh) ("dash" . sh) ("dtksh" . sh)
("ksh" . sh)
     ("es" . sh) ("rc" . sh) ("itcsh" . sh) ("tcsh" . sh) ("jcsh" . sh)
("csh" . sh)
     ("ksh88" . sh) ("oash" . sh) ("pdksh" . sh) ("mksh" . sh) ("posix" .
sh) ("wksh" . sh)
     ("wsh" . sh) ("zsh" . sh) ("rpm" . sh))
 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-persist-before-read-hook '(org-element--cache-persist-before-read)
 org-noter--pretty-print-location-hook
'(org-noter-djvu--pretty-print-location
org-noter-nov--pretty-print-location
org-noter-pdf--pretty-print-location)
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-id-link-to-org-use-id 'create-if-interactive
 org-agenda-skip-archived-trees nil
 )

[-- Attachment #2: Type: text/html, Size: 19608 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [BUG] export blocks no longer fontifying [9.7.10 (release_9.7.10 @ /Users/ben/Scripts/emacs/lisp/org/)]
  2024-09-01  4:35 [BUG] export blocks no longer fontifying [9.7.10 (release_9.7.10 @ /Users/ben/Scripts/emacs/lisp/org/)] Benjamin McMillan
@ 2024-09-10 17:01 ` Ihor Radchenko
  2024-09-16 14:27   ` Benjamin McMillan
  0 siblings, 1 reply; 7+ messages in thread
From: Ihor Radchenko @ 2024-09-10 17:01 UTC (permalink / raw)
  To: Benjamin McMillan; +Cc: emacs-orgmode

Benjamin McMillan <mcmillanbb@gmail.com> writes:

> At some point in the last few months, org mode stopped fontifying my
> latex export blocks. However, an older version of emacs on my computer
> still does fontify.
> (The difference is seen even opening emacs with the -q flag)
> It seems that there was a change to the function
> org-fontify-meta-lines-and-blocks-1 in org.el, specifically at the
> conditional that checks org-src-fontify-natively.
> As the comment there explains, the intention is to only fontify src
> blocks, but I don't see any option exposed to enable fontififcation of
> export blocks, which is a fairly crucial feature to my workflow.
>
> I think fontification of export blocks should follow that of src blocks,
> or a separate option should be made. (Or, I may be missing some already
> existing solution!)
>
> For what it is worth, I can get the desired behavior by modifying the
> code mentioned above to include "export", as in the following:
> (and org-src-fontify-natively
>     ;; Technically, according to
>     ;; `org-src-fontify-natively' docstring, we should
>     ;; only fontify src blocks.  However, it is common
>     ;; to use undocumented fontification of example
>     ;; blocks with undocumented language specifier.
>     ;; Keep this undocumented feature for user
>     ;; convenience.
>     (member block-type '("src" "example" "export")))

Since we already do it for example blocks, I see not why we should not
for export blocks.

Would you be interested to submit a patch with your modification?
See https://orgmode.org/worg/org-contribute.html#first-patch

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [BUG] export blocks no longer fontifying [9.7.10 (release_9.7.10 @ /Users/ben/Scripts/emacs/lisp/org/)]
  2024-09-10 17:01 ` Ihor Radchenko
@ 2024-09-16 14:27   ` Benjamin McMillan
  2024-09-17 12:29     ` Benjamin McMillan
  0 siblings, 1 reply; 7+ messages in thread
From: Benjamin McMillan @ 2024-09-16 14:27 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2150 bytes --]

Ok, I am happy to submit a patch. It would be my first, so I will have to
find time to make the commit properly.

On Wed, Sep 11, 2024 at 1:59 AM Ihor Radchenko <yantar92@posteo.net> wrote:

> Benjamin McMillan <mcmillanbb@gmail.com> writes:
>
> > At some point in the last few months, org mode stopped fontifying my
> > latex export blocks. However, an older version of emacs on my computer
> > still does fontify.
> > (The difference is seen even opening emacs with the -q flag)
> > It seems that there was a change to the function
> > org-fontify-meta-lines-and-blocks-1 in org.el, specifically at the
> > conditional that checks org-src-fontify-natively.
> > As the comment there explains, the intention is to only fontify src
> > blocks, but I don't see any option exposed to enable fontififcation of
> > export blocks, which is a fairly crucial feature to my workflow.
> >
> > I think fontification of export blocks should follow that of src blocks,
> > or a separate option should be made. (Or, I may be missing some already
> > existing solution!)
> >
> > For what it is worth, I can get the desired behavior by modifying the
> > code mentioned above to include "export", as in the following:
> > (and org-src-fontify-natively
> >     ;; Technically, according to
> >     ;; `org-src-fontify-natively' docstring, we should
> >     ;; only fontify src blocks.  However, it is common
> >     ;; to use undocumented fontification of example
> >     ;; blocks with undocumented language specifier.
> >     ;; Keep this undocumented feature for user
> >     ;; convenience.
> >     (member block-type '("src" "example" "export")))
>
> Since we already do it for example blocks, I see not why we should not
> for export blocks.
>
> Would you be interested to submit a patch with your modification?
> See https://orgmode.org/worg/org-contribute.html#first-patch
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>

[-- Attachment #2: Type: text/html, Size: 3077 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [BUG] export blocks no longer fontifying [9.7.10 (release_9.7.10 @ /Users/ben/Scripts/emacs/lisp/org/)]
  2024-09-16 14:27   ` Benjamin McMillan
@ 2024-09-17 12:29     ` Benjamin McMillan
  2024-09-17 18:44       ` Ihor Radchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Benjamin McMillan @ 2024-09-17 12:29 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2939 bytes --]

I attach the patch here.

However, I have two questions.
First, I am not certain that I set up the repository correctly, because
when I run "make test" it generates 55 unexpected failures. This without
making any changes.
(The patch submitted here does not generate any new failures.)

Second, the existing comment at the patch becomes slightly out of date with
the change.
In fact, I propose that it might be good to update the docstring for
`org-src-fontify-natively' to explicitly state that it enable fontification
for src, example, and export blocks.
If that is agreed on, I am happy to submit a further patch.
Thanks,
Ben

On Mon, Sep 16, 2024 at 11:27 PM Benjamin McMillan <mcmillanbb@gmail.com>
wrote:

> Ok, I am happy to submit a patch. It would be my first, so I will have to
> find time to make the commit properly.
>
> On Wed, Sep 11, 2024 at 1:59 AM Ihor Radchenko <yantar92@posteo.net>
> wrote:
>
>> Benjamin McMillan <mcmillanbb@gmail.com> writes:
>>
>> > At some point in the last few months, org mode stopped fontifying my
>> > latex export blocks. However, an older version of emacs on my computer
>> > still does fontify.
>> > (The difference is seen even opening emacs with the -q flag)
>> > It seems that there was a change to the function
>> > org-fontify-meta-lines-and-blocks-1 in org.el, specifically at the
>> > conditional that checks org-src-fontify-natively.
>> > As the comment there explains, the intention is to only fontify src
>> > blocks, but I don't see any option exposed to enable fontififcation of
>> > export blocks, which is a fairly crucial feature to my workflow.
>> >
>> > I think fontification of export blocks should follow that of src blocks,
>> > or a separate option should be made. (Or, I may be missing some already
>> > existing solution!)
>> >
>> > For what it is worth, I can get the desired behavior by modifying the
>> > code mentioned above to include "export", as in the following:
>> > (and org-src-fontify-natively
>> >     ;; Technically, according to
>> >     ;; `org-src-fontify-natively' docstring, we should
>> >     ;; only fontify src blocks.  However, it is common
>> >     ;; to use undocumented fontification of example
>> >     ;; blocks with undocumented language specifier.
>> >     ;; Keep this undocumented feature for user
>> >     ;; convenience.
>> >     (member block-type '("src" "example" "export")))
>>
>> Since we already do it for example blocks, I see not why we should not
>> for export blocks.
>>
>> Would you be interested to submit a patch with your modification?
>> See https://orgmode.org/worg/org-contribute.html#first-patch
>>
>> --
>> Ihor Radchenko // yantar92,
>> Org mode contributor,
>> Learn more about Org mode at <https://orgmode.org/>.
>> Support Org development at <https://liberapay.com/org-mode>,
>> or support my work at <https://liberapay.com/yantar92>
>>
>

[-- Attachment #1.2: Type: text/html, Size: 4223 bytes --]

[-- Attachment #2: 0001-lisp-org.el-Change-native-fontification-to-include-e.patch --]
[-- Type: application/octet-stream, Size: 1107 bytes --]

From 2e543eb4393b01a640c2b1d66de55a744be75bca Mon Sep 17 00:00:00 2001
From: Benjamin McMillan <mcmillanbb@gmail.com>
Date: Tue, 17 Sep 2024 21:05:07 +0900
Subject: [PATCH] lisp/org.el: Change native fontification to include export
 blocks

lisp/org.el (org-fontify-meta-lines-and-blocks-1): Add "export" to
list of block types that are fontified if org-src-fontify-natively
is non-nil.

TINYCHANGE
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index d5c1dcb35..156e1716f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5497,7 +5497,7 @@ by a #."
                    ;; blocks with undocumented language specifier.
                    ;; Keep this undocumented feature for user
                    ;; convenience.
-                   (member block-type '("src" "example")))
+                   (member block-type '("src" "example" "export")))
 	      (save-match-data
                 (org-src-font-lock-fontify-block (or lang "") block-start block-end))
 	      (add-text-properties bol-after-beginline block-end '(src-block t)))
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [BUG] export blocks no longer fontifying [9.7.10 (release_9.7.10 @ /Users/ben/Scripts/emacs/lisp/org/)]
  2024-09-17 12:29     ` Benjamin McMillan
@ 2024-09-17 18:44       ` Ihor Radchenko
       [not found]         ` <CALo8A5Vm-gik0qQC7KacNg7kN2VzL0Y1e8_LXxV8S7-we9CYSw@mail.gmail.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Ihor Radchenko @ 2024-09-17 18:44 UTC (permalink / raw)
  To: Benjamin McMillan; +Cc: emacs-orgmode

Benjamin McMillan <mcmillanbb@gmail.com> writes:

> I attach the patch here.

Thanks!

> However, I have two questions.
> First, I am not certain that I set up the repository correctly, because
> when I run "make test" it generates 55 unexpected failures. This without
> making any changes.
> (The patch submitted here does not generate any new failures.)

That's odd. May you share the log?

> Second, the existing comment at the patch becomes slightly out of date with
> the change.

Then, may you please update the comment?

Also, may you change the commit message to not sound like it is a new
feature? Just explain the purpose of the change as you did in this
email thread (but shorter, and then add a link to this thread).

> In fact, I propose that it might be good to update the docstring for
> `org-src-fontify-natively' to explicitly state that it enable fontification
> for src, example, and export blocks.

I'd rather not document this in `org-src-fontify-natively'. The name of
this variable does not really hint that it has anything to do with
export or example blocks.

We may eventually rename it to something more generic, but example
blocks may need to be re-considered because specifying language of the
example block is not even a part of Org syntax. So, generalizing and
documenting this is a bit tricky.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [BUG] export blocks no longer fontifying [9.7.10 (release_9.7.10 @ /Users/ben/Scripts/emacs/lisp/org/)]
       [not found]         ` <CALo8A5Vm-gik0qQC7KacNg7kN2VzL0Y1e8_LXxV8S7-we9CYSw@mail.gmail.com>
@ 2024-09-22  9:53           ` Ihor Radchenko
  2024-09-23 13:17             ` Benjamin McMillan
  0 siblings, 1 reply; 7+ messages in thread
From: Ihor Radchenko @ 2024-09-22  9:53 UTC (permalink / raw)
  To: Benjamin McMillan; +Cc: emacs-orgmode

[ Adding Org mailing list back to CC to keep the conversation public ]

Benjamin McMillan <mcmillanbb@gmail.com> writes:

> Dear Ihor,
> I am happy to make the changes.
> I am not sure what exactly made the last commit message read like a new
> feature, but hopefully the following is better:
> lisp/org.el: Add "export" to list of native fontified blocks
> If not, I can modify again.

Thanks!
Applied, onto bugfix.
I modified the commit message a bit.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=2a85367ea8

I also added you to the contributor list.
https://git.sr.ht/~bzg/worg/commit/84bb23ce

Fixed.

> And thanks for the explanation, it makes sense.
>
> Regards the logs, it may be because I don't have the org git repository set
> up properly.
> I cloned the source into a folder that has no relation to my emacs setup,
> so that might be causing problems.
> Logs:
> Ran 1284 tests, 1216 results as expected, 55 unexpected, 13 skipped
> (2024-09-17 19:52:08+0900, 75.466775 sec)
> 2 expected failures
> ...

Most of the failing tests are concerning running external programs (java
and maxima). It looks like you have them installed, but they somehow
misbehave. Maybe old versions?

>    FAILED  test-org-table/sort-lines  ((should (equal "| a | x |\n| B | 4
> |\n| c | 3 |\n" (org-test-with-temp-text "| <point>a | x |\n| c | 3 |\n| B
> | 4 |\n" (org-table-sort-lines nil 97) (buffer-string)))) :form (equal "| a
> | x |\n| B | 4 |\n| c | 3 |\n" #("| B | 4 |\n| a | x |\n| c | 3 |\n" 0 9
> (face org-table) 9 10 (face org-table-row) 10 19 (face org-table) 19 20
> (face org-table-row) 20 29 (face org-table) 29 30 (face org-table-row)))
> :value nil :explanation (array-elt 2 (different-atoms (97 "#x61" "?a") (66
> "#x42" "?B"))))

This is probably your locale. The test is checking sorting and sorting
depends on language settings. This one is kind of expected. Although it
would be nice to make test account for locales as well.

> 55 unexpected results:
>    FAILED  ob-java/args-quoted-string  ((should (string= "forty two\n42\n"
> (org-babel-execute-src-block))) :form (string= "forty two\n42\n" "") :value
> nil :explanation (arrays-of-different-length 13 0 "forty two\n42\n" ""
> first-mismatch-at 0))
>    FAILED  ob-java/import_library  ((should (string= "encoded=NDI=,
> decoded=42" (org-babel-execute-src-block))) :form (string= "encoded=NDI=,
> decoded=42" "") :value nil :explanation (arrays-of-different-length 24 0
> "encoded=NDI=, decoded=42" "" first-mismatch-at 0))
>    FAILED  ob-java/import_library_inline  ((should (string= "encoded=NDI=,
> decoded=42" (org-babel-execute-src-block))) :form (string= "encoded=NDI=,
> decoded=42" "") :value nil :explanation (arrays-of-different-length 24 0
> "encoded=NDI=, decoded=42" "" first-mismatch-at 0))
>    FAILED  ob-java/inhomogeneous_table  ((should (equal '(("forty" 4)
> ("two" 2)) (org-babel-execute-src-block))) :form (equal (("forty" 4) ("two"
> 2)) "") :value nil :explanation (different-types (("forty" 4) ("two" 2))
> ""))
>    FAILED  ob-java/integer-var  ((should (string= "42"
> (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at 0))
>    FAILED  ob-java/list-var  ((should (equal '("forty" "two")
> (org-babel-execute-src-block))) :form (equal ("forty" "two") "") :value nil
> :explanation (different-types ("forty" "two") ""))
>    FAILED  ob-java/matrix-var  ((should (equal '((2 4) (1 2))
> (org-babel-execute-src-block))) :form (equal ((2 4) (1 2)) "") :value nil
> :explanation (different-types ((2 4) (1 2)) ""))
>    FAILED  ob-java/matrix-var-with-header  ((should (equal '(("col1"
> "col2") hline (2 4) (1 2)) (org-babel-execute-src-block))) :form (equal
> (("col1" "col2") hline (2 4) (1 2)) ((""))) :value nil :explanation
> (proper-lists-of-different-length 4 1 (("col1" "col2") hline (2 4) (1 2))
> (("")) first-mismatch-at 0))
>    FAILED  ob-java/one-arg  ((should (string= "fortytwo"
> (org-babel-execute-src-block))) :form (string= "fortytwo" "") :value nil
> :explanation (arrays-of-different-length 8 0 "fortytwo" ""
> first-mismatch-at 0))
>    FAILED  ob-java/output-list-with-spaces  ((should (equal "forty
> two\nforty two\n" (org-babel-execute-src-block))) :form (equal "forty
> two\nforty two\n" "") :value nil :explanation (arrays-of-different-length
> 20 0 "forty two\nforty two\n" "" first-mismatch-at 0))
>    FAILED  ob-java/output-table-with-header  ((should (equal
> "|col1|col2|\n|-\n|2|1\n|4|2\n" (org-babel-execute-src-block))) :form
> (equal "|col1|col2|\n|-\n|2|1\n|4|2\n" "") :value nil :explanation
> (arrays-of-different-length 25 0 "|col1|col2|\n|-\n|2|1\n|4|2\n" ""
> first-mismatch-at 0))
>    FAILED  ob-java/read-list-return-array  ((should (equal '("forty" "two")
> (org-babel-execute-src-block))) :form (equal ("forty" "two") "") :value nil
> :explanation (different-types ("forty" "two") ""))
>    FAILED  ob-java/read-return-list  ((should (equal '("forty" "two")
> (org-babel-execute-src-block))) :form (equal ("forty" "two") "") :value nil
> :explanation (different-types ("forty" "two") ""))
>    FAILED  ob-java/read-return-list-with-package  ((should (equal '("forty"
> "two") (org-babel-execute-src-block))) :form (equal ("forty" "two") "")
> :value nil :explanation (different-types ("forty" "two") ""))
>    FAILED  ob-java/return-vector-using-array  ((should (equal '((4) (2))
> (org-babel-execute-src-block))) :form (equal ((4) (2)) ((""))) :value nil
> :explanation (proper-lists-of-different-length 2 1 ((4) (2)) ((""))
> first-mismatch-at 0))
>    FAILED  ob-java/return-vector-using-list  ((should (equal '((4) (2))
> (org-babel-execute-src-block))) :form (equal ((4) (2)) ((""))) :value nil
> :explanation (proper-lists-of-different-length 2 1 ((4) (2)) ((""))
> first-mismatch-at 0))
>    FAILED  ob-java/simple  ((should (string= "42"
> (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at 0))
>    FAILED  ob-java/simple-dir  ((should (string= "42" (unwind-protect
> (org-babel-execute-src-block) (delete-file (concat ... "Main.java"))
> (delete-file (concat ... "Main.class"))))) :form (string= "42" "") :value
> nil :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at
> 0))
>    FAILED  ob-java/simple-dir-with-package  ((should (string= "42"
> (unwind-protect (org-babel-execute-src-block) (delete-file (concat ...
> "pkg/Main.java")) (delete-file (concat ... "pkg/Main.class"))
> (delete-directory (concat ... "pkg"))))) :form (string= "42" "") :value nil
> :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at 0))
>    FAILED  ob-java/simple-return-float  ((should (equal 42.0
> (org-babel-execute-src-block))) :form (equal 42.0 "") :value nil
> :explanation (different-types 42.0 ""))
>    FAILED  ob-java/simple-return-int  ((should (eq 42
> (org-babel-execute-src-block))) :form (eq 42 "") :value nil)
>    FAILED  ob-java/simple-return-string  ((should (string= "forty two"
> (org-babel-execute-src-block))) :form (string= "forty two" "") :value nil
> :explanation (arrays-of-different-length 9 0 "forty two" ""
> first-mismatch-at 0))
>    FAILED  ob-java/simple-with-bracket  ((should (string= "[42"
> (org-babel-execute-src-block))) :form (string= "[42" "") :value nil
> :explanation (arrays-of-different-length 3 0 "[42" "" first-mismatch-at 0))
>    FAILED  ob-java/simple-with-class  ((should (string= "42"
> (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at 0))
>    FAILED  ob-java/simple-with-class-and-package  ((should (string= "42"
> (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at 0))
>    FAILED  ob-java/simple-with-class-attr  ((should (string= "42"
> (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at 0))
>    FAILED  ob-java/simple-with-class-attr-with-package  ((should (string=
> "42" (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at 0))
>    FAILED  ob-java/simple-with-main  ((should (string= "42"
> (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at 0))
>    FAILED  ob-java/simple-with-main-args-array  ((should (string= "42"
> (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at 0))
>    FAILED  ob-java/simple-with-main-whitespace  ((should (string= "42"
> (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at 0))
>    FAILED  ob-java/simple-with-no-main  ((should (string= "success"
> (org-babel-execute-src-block))) :form (string= "success" "") :value nil
> :explanation (arrays-of-different-length 7 0 "success" "" first-mismatch-at
> 0))
>    FAILED  ob-java/simple-with-non-public-class  ((should (string= "42"
> (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at 0))
>    FAILED  ob-java/simple-with-quote  ((should (string= "\"42\""
> (org-babel-execute-src-block))) :form (string= "\"42\"" "") :value nil
> :explanation (arrays-of-different-length 4 0 "\"42\"" "" first-mismatch-at
> 0))
>    FAILED  ob-java/simple-with-two-methods  ((should (string= "42"
> (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at 0))
>    FAILED  ob-java/string-var  ((should (string= "forty two, len=9"
> (org-babel-execute-src-block))) :form (string= "forty two, len=9" "")
> :value nil :explanation (arrays-of-different-length 16 0 "forty two, len=9"
> "" first-mismatch-at 0))
>    FAILED  ob-java/two-vars  ((should (string= "42"
> (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at 0))
>    FAILED  ob-java/var-with-class  ((should (string= "42"
> (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at 0))
>    FAILED  ob-java/var-with-class-and-hanging-curlies  ((should (string=
> "42" (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at 0))
>    FAILED  ob-java/var-with-class-and-package  ((should (string= "42"
> (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at 0))
>    FAILED  ob-java/var-with-main  ((should (string= "42"
> (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at 0))
>    FAILED  ob-java/vector-var  ((should (equal '("forty" "two")
> (org-babel-execute-src-block))) :form (equal ("forty" "two") "") :value nil
> :explanation (different-types ("forty" "two") ""))
>    FAILED  ob-maxima/batch+verbatim  ((should (equal
> (org-babel-execute-src-block) "(assume(z >
> 0),integrate(exp(-t)*t^z,t,0,inf))\n
> gamma(z + 1)")) :form (equal "(linenum:0,\n(assume(z >
> 0),integrate(exp(-t)*t^z,t,0,inf))\n
> gamma(z + 1)" "(assume(z > 0),integrate(exp(-t)*t^z,t,0,inf))\n
>                     gamma(z + 1)") :value nil :explanation
> (arrays-of-different-length 104 92 "(linenum:0,\n(assume(z >
> 0),integrate(exp(-t)*t^z,t,0,inf))\n
> gamma(z + 1)" "(assume(z > 0),integrate(exp(-t)*t^z,t,0,inf))\n
>                     gamma(z + 1)" first-mismatch-at 1))
>    FAILED  ob-maxima/batch+verbatim+:lisp  ((should (equal
> (org-babel-execute-src-block) "((%GAMMA SIMP) ((MPLUS SIMP) 1 $Z))")) :form
> (equal "(%i1) (linenum:0,\n((%GAMMA SIMP) ((MPLUS SIMP) 1 $Z))" "((%GAMMA
> SIMP) ((MPLUS SIMP) 1 $Z))") :value nil :explanation
> (arrays-of-different-length 53 35 "(%i1) (linenum:0,\n((%GAMMA SIMP)
> ((MPLUS SIMP) 1 $Z))" "((%GAMMA SIMP) ((MPLUS SIMP) 1 $Z))"
> first-mismatch-at 1))
>    FAILED  ob-maxima/batch+verbatim+empty-string  ((should (equal
> (org-babel-execute-src-block) "(%i1) \"\"\n(%o1) ")) :form (equal "(%i1)
> (linenum:0,\n(%i1) \"\"\n(%o1) " "(%i1) \"\"\n(%o1) ") :value nil
> :explanation (arrays-of-different-length 33 15 "(%i1) (linenum:0,\n(%i1)
> \"\"\n(%o1) " "(%i1) \"\"\n(%o1) " first-mismatch-at 6))
>    FAILED  ob-maxima/batch+verbatim+empty-string-vq  ((should (equal
> (org-babel-execute-src-block) "\"\"\n ")) :form (equal "(linenum:0,\n\"\"\n
> " "\"\"\n ") :value nil :explanation (arrays-of-different-length 16 4
> "(linenum:0,\n\"\"\n " "\"\"\n " first-mismatch-at 0))
>    FAILED  ob-maxima/batch+verbatim+quiet  ((should (equal
> (org-babel-execute-src-block) "(%i1) (assume(z >
> 0),integrate(exp(-t)*t^z,t,0,inf))\n(%o1)
>  gamma(z + 1)")) :form (equal "(%i1) (linenum:0,\n(%i1) (assume(z >
> 0),integrate(exp(-t)*t^z,t,0,inf))\n(%o1)
>  gamma(z + 1)" "(%i1) (assume(z > 0),integrate(exp(-t)*t^z,t,0,inf))\n(%o1)
>                            gamma(z + 1)") :value nil :explanation
> (arrays-of-different-length 116 98 "(%i1) (linenum:0,\n(%i1) (assume(z >
> 0),integrate(exp(-t)*t^z,t,0,inf))\n(%o1)
>  gamma(z + 1)" "(%i1) (assume(z > 0),integrate(exp(-t)*t^z,t,0,inf))\n(%o1)
>                            gamma(z + 1)" first-mismatch-at 7))
>    FAILED  ob-maxima/batch+verbatim+whitespace-string  ((should (equal
> (org-babel-execute-src-block) "(%i1) \" \"\n(%o1)
>         ")) :form (equal "(%i1) (linenum:0,\n(%i1) \" \"\n(%o1)
>                       " "(%i1) \" \"\n(%o1)
>   ") :value nil :explanation (arrays-of-different-length 68 50 "(%i1)
> (linenum:0,\n(%i1) \" \"\n(%o1)                                   " "(%i1)
> \" \"\n(%o1)                                   " first-mismatch-at 6))
>    FAILED  ob-maxima/integer-input  ((should (equal 4
> (org-babel-execute-src-block))) :form (equal 4 (("(linenum:0,") (4)))
> :value nil :explanation (different-types 4 (("(linenum:0,") (4))))
>    FAILED  ob-maxima/list-input  ((should (equal "[2, [2, 3], 4] "
> (org-babel-execute-src-block))) :form (equal "[2, [2, 3], 4] "
> "(linenum:0,\n[2, [2, 3], 4] ") :value nil :explanation
> (arrays-of-different-length 15 27 "[2, [2, 3], 4] " "(linenum:0,\n[2, [2,
> 3], 4] " first-mismatch-at 0))
>    FAILED  ob-maxima/matrix-output  ((should (equal '((1 2 3) (2 3 4) (3 4
> 5)) (org-babel-execute-src-block))) :form (equal ((1 2 3) (2 3 4) (3 4 5))
> (("(linenum:0," "" "") (1 2 3) (2 3 4) (3 4 5))) :value nil :explanation
> (proper-lists-of-different-length 3 4 ((1 2 3) (2 3 4) (3 4 5))
> (("(linenum:0," "" "") (1 2 3) (2 3 4) (3 4 5)) first-mismatch-at 0))
>    FAILED  ob-maxima/simple-list-input  ((should (equal "[1, 2, 3] "
> (org-babel-execute-src-block))) :form (equal "[1, 2, 3] " "(linenum:0,\n[1,
> 2, 3] ") :value nil :explanation (arrays-of-different-length 10 22 "[1, 2,
> 3] " "(linenum:0,\n[1, 2, 3] " first-mismatch-at 0))
>    FAILED  ob-maxima/string-input  ((should (equal "- sin(x)"
> (org-babel-execute-src-block))) :form (equal "- sin(x)" (("(linenum:0," "")
> ("-" "sin(x)"))) :value nil :explanation (different-types "- sin(x)"
> (("(linenum:0," "") ("-" "sin(x)"))))
>    FAILED  ob-maxima/table-input1  ((should (equal "[[2.0], [3.0]] "
> (org-babel-execute-src-block))) :form (equal "[[2.0], [3.0]] "
> "(linenum:0,\n[[2.0], [3.0]] ") :value nil :explanation
> (arrays-of-different-length 15 27 "[[2.0], [3.0]] " "(linenum:0,\n[[2.0],
> [3.0]] " first-mismatch-at 0))
>    FAILED  ob-maxima/table-input2  ((should (equal "[[2.0, 3.0]] "
> (org-babel-execute-src-block))) :form (equal "[[2.0, 3.0]] "
> "(linenum:0,\n[[2.0, 3.0]] ") :value nil :explanation
> (arrays-of-different-length 13 25 "[[2.0, 3.0]] " "(linenum:0,\n[[2.0,
> 3.0]] " first-mismatch-at 0))
>    FAILED  test-org-table/sort-lines  ((should (equal "| a | x |\n| B | 4
> |\n| c | 3 |\n" (org-test-with-temp-text "| <point>a | x |\n| c | 3 |\n| B
> | 4 |\n" (org-table-sort-lines nil 97) (buffer-string)))) :form (equal "| a
> | x |\n| B | 4 |\n| c | 3 |\n" #("| B | 4 |\n| a | x |\n| c | 3 |\n" 0 9
> (face org-table) 9 10 (face org-table-row) 10 19 (face org-table) 19 20
> (face org-table-row) 20 29 (face org-table) 29 30 (face org-table-row)))
> :value nil :explanation (array-elt 2 (different-atoms (97 "#x61" "?a") (66
> "#x42" "?B"))))
>
> 13 skipped results:
>   SKIPPED  org-missing-dependency/test-ob-R  ((skip-unless nil) :form nil
> :value nil)
>   SKIPPED  org-missing-dependency/test-ob-clojure  ((skip-unless nil) :form
> nil :value nil)
>   SKIPPED  org-missing-dependency/test-ob-haskell-ghci  ((skip-unless nil)
> :form nil :value nil)
>   SKIPPED  org-missing-dependency/test-ob-julia  ((skip-unless nil) :form
> nil :value nil)
>   SKIPPED  org-missing-dependency/test-ob-lua  ((skip-unless nil) :form nil
> :value nil)
>   SKIPPED  org-missing-dependency/test-ob-octave  ((skip-unless nil) :form
> nil :value nil)
>   SKIPPED  org-missing-dependency/test-ob-python  ((skip-unless nil) :form
> nil :value nil)
>   SKIPPED  org-missing-dependency/test-ob-ruby  ((skip-unless nil) :form
> nil :value nil)
>   SKIPPED  org-missing-dependency/test-ob-scheme  ((skip-unless nil) :form
> nil :value nil)
>   SKIPPED  org-missing-dependency/test-org-attach-git  ((skip-unless nil)
> :form nil :value nil)
>   SKIPPED  test-ob-shell/bash-uses-assoc-arrays  ((skip-unless (if-let
> ((bash (executable-find "bash"))) (eq 0 (process-file bash nil nil nil "-c"
> "declare -A assoc_array")))) :form (let* ((bash (and t (executable-find
> "bash")))) (if bash (eq 0 (process-file bash nil nil nil "-c" "declare -A
> assoc_array")) nil)) :value nil)
>   SKIPPED  test-ob-shell/bash-uses-assoc-arrays-with-lists  ((skip-unless
> (if-let ((bash (executable-find "bash"))) (eq 0 (process-file bash nil nil
> nil "-c" "declare -A assoc_array")))) :form (let* ((bash (and t
> (executable-find "bash")))) (if bash (eq 0 (process-file bash nil nil nil
> "-c" "declare -A assoc_array")) nil)) :value nil)
>   SKIPPED  test-org-fold/org-fold-display-inline-images  ((skip-unless (not
> noninteractive)) :form (not t) :value nil)
>
> make: *** [test] Error 1
>
>
>
>
>
>
> On Wed, Sep 18, 2024 at 3:43 AM Ihor Radchenko <yantar92@posteo.net> wrote:
>
>> Benjamin McMillan <mcmillanbb@gmail.com> writes:
>>
>> > I attach the patch here.
>>
>> Thanks!
>>
>> > However, I have two questions.
>> > First, I am not certain that I set up the repository correctly, because
>> > when I run "make test" it generates 55 unexpected failures. This without
>> > making any changes.
>> > (The patch submitted here does not generate any new failures.)
>>
>> That's odd. May you share the log?
>>
>> > Second, the existing comment at the patch becomes slightly out of date
>> with
>> > the change.
>>
>> Then, may you please update the comment?
>>
>> Also, may you change the commit message to not sound like it is a new
>> feature? Just explain the purpose of the change as you did in this
>> email thread (but shorter, and then add a link to this thread).
>>
>> > In fact, I propose that it might be good to update the docstring for
>> > `org-src-fontify-natively' to explicitly state that it enable
>> fontification
>> > for src, example, and export blocks.
>>
>> I'd rather not document this in `org-src-fontify-natively'. The name of
>> this variable does not really hint that it has anything to do with
>> export or example blocks.
>>
>> We may eventually rename it to something more generic, but example
>> blocks may need to be re-considered because specifying language of the
>> example block is not even a part of Org syntax. So, generalizing and
>> documenting this is a bit tricky.
>>
>> --
>> Ihor Radchenko // yantar92,
>> Org mode contributor,
>> Learn more about Org mode at <https://orgmode.org/>.
>> Support Org development at <https://liberapay.com/org-mode>,
>> or support my work at <https://liberapay.com/yantar92>
>>
> From c245df2136778fd34d3ed263208331ca4e35e54d Mon Sep 17 00:00:00 2001
> From: Benjamin McMillan <mcmillanbb@gmail.com>
> Date: Fri, 20 Sep 2024 23:43:55 +0900
> Subject: [PATCH] lisp/org.el: Add "export" to list of native fontified blocks
>
> * lisp/org.el (org-fontify-meta-lines-and-blocks-1): Add "export" to
> list of block types that are fontified if org-src-fontify-natively
> is non-nil.
>
> Link: https://list.orgmode.org/87h6aejf17.fsf@localhost/
> TINYCHANGE
> ---
>  lisp/org.el | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/lisp/org.el b/lisp/org.el
> index d5c1dcb35..df58b47be 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -5490,14 +5490,14 @@ by a #."
>  	    (org-remove-flyspell-overlays-in nl-before-endline end-of-endline)
>              (cond
>  	     ((and org-src-fontify-natively
> -                   ;; Technically, according to
> +                   ;; Technically, according to the
>                     ;; `org-src-fontify-natively' docstring, we should
>                     ;; only fontify src blocks.  However, it is common
> -                   ;; to use undocumented fontification of example
> -                   ;; blocks with undocumented language specifier.
> -                   ;; Keep this undocumented feature for user
> -                   ;; convenience.
> -                   (member block-type '("src" "example")))
> +                   ;; to use undocumented fontification of export and
> +                   ;; example blocks. (The latter which do not support a
> +                   ;; language specifier.) Keep this undocumented feature
> +                   ;; for user convenience.
> +                   (member block-type '("src" "export" "example")))
>  	      (save-match-data
>                  (org-src-font-lock-fontify-block (or lang "") block-start block-end))
>  	      (add-text-properties bol-after-beginline block-end '(src-block t)))
> -- 
> 2.46.0
>

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [BUG] export blocks no longer fontifying [9.7.10 (release_9.7.10 @ /Users/ben/Scripts/emacs/lisp/org/)]
  2024-09-22  9:53           ` Ihor Radchenko
@ 2024-09-23 13:17             ` Benjamin McMillan
  0 siblings, 0 replies; 7+ messages in thread
From: Benjamin McMillan @ 2024-09-23 13:17 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 24491 bytes --]

Thank you!
And you are right, I haven't installed java on this computer, and a
terminal call to java returns the message "The operation couldn’t be
completed. Unable to locate a Java Runtime."
Is that expected behavior? I'm not very familiar with testing frameworks,
but wouldn't expect that the environment should be a source of failed tests
like that.

If it's not important, we can let the matter rest here. But for future
contributions, I would want the regression tests to be providing useful
feedback!

On Sun, Sep 22, 2024 at 6:51 PM Ihor Radchenko <yantar92@posteo.net> wrote:

> [ Adding Org mailing list back to CC to keep the conversation public ]
>
> Benjamin McMillan <mcmillanbb@gmail.com> writes:
>
> > Dear Ihor,
> > I am happy to make the changes.
> > I am not sure what exactly made the last commit message read like a new
> > feature, but hopefully the following is better:
> > lisp/org.el: Add "export" to list of native fontified blocks
> > If not, I can modify again.
>
> Thanks!
> Applied, onto bugfix.
> I modified the commit message a bit.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=2a85367ea8
>
> I also added you to the contributor list.
> https://git.sr.ht/~bzg/worg/commit/84bb23ce
>
> Fixed.
>
> > And thanks for the explanation, it makes sense.
> >
> > Regards the logs, it may be because I don't have the org git repository
> set
> > up properly.
> > I cloned the source into a folder that has no relation to my emacs setup,
> > so that might be causing problems.
> > Logs:
> > Ran 1284 tests, 1216 results as expected, 55 unexpected, 13 skipped
> > (2024-09-17 19:52:08+0900, 75.466775 sec)
> > 2 expected failures
> > ...
>
> Most of the failing tests are concerning running external programs (java
> and maxima). It looks like you have them installed, but they somehow
> misbehave. Maybe old versions?
>
> >    FAILED  test-org-table/sort-lines  ((should (equal "| a | x |\n| B | 4
> > |\n| c | 3 |\n" (org-test-with-temp-text "| <point>a | x |\n| c | 3 |\n|
> B
> > | 4 |\n" (org-table-sort-lines nil 97) (buffer-string)))) :form (equal
> "| a
> > | x |\n| B | 4 |\n| c | 3 |\n" #("| B | 4 |\n| a | x |\n| c | 3 |\n" 0 9
> > (face org-table) 9 10 (face org-table-row) 10 19 (face org-table) 19 20
> > (face org-table-row) 20 29 (face org-table) 29 30 (face org-table-row)))
> > :value nil :explanation (array-elt 2 (different-atoms (97 "#x61" "?a")
> (66
> > "#x42" "?B"))))
>
> This is probably your locale. The test is checking sorting and sorting
> depends on language settings. This one is kind of expected. Although it
> would be nice to make test account for locales as well.
>
> > 55 unexpected results:
> >    FAILED  ob-java/args-quoted-string  ((should (string= "forty
> two\n42\n"
> > (org-babel-execute-src-block))) :form (string= "forty two\n42\n" "")
> :value
> > nil :explanation (arrays-of-different-length 13 0 "forty two\n42\n" ""
> > first-mismatch-at 0))
> >    FAILED  ob-java/import_library  ((should (string= "encoded=NDI=,
> > decoded=42" (org-babel-execute-src-block))) :form (string= "encoded=NDI=,
> > decoded=42" "") :value nil :explanation (arrays-of-different-length 24 0
> > "encoded=NDI=, decoded=42" "" first-mismatch-at 0))
> >    FAILED  ob-java/import_library_inline  ((should (string=
> "encoded=NDI=,
> > decoded=42" (org-babel-execute-src-block))) :form (string= "encoded=NDI=,
> > decoded=42" "") :value nil :explanation (arrays-of-different-length 24 0
> > "encoded=NDI=, decoded=42" "" first-mismatch-at 0))
> >    FAILED  ob-java/inhomogeneous_table  ((should (equal '(("forty" 4)
> > ("two" 2)) (org-babel-execute-src-block))) :form (equal (("forty" 4)
> ("two"
> > 2)) "") :value nil :explanation (different-types (("forty" 4) ("two" 2))
> > ""))
> >    FAILED  ob-java/integer-var  ((should (string= "42"
> > (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> > :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at
> 0))
> >    FAILED  ob-java/list-var  ((should (equal '("forty" "two")
> > (org-babel-execute-src-block))) :form (equal ("forty" "two") "") :value
> nil
> > :explanation (different-types ("forty" "two") ""))
> >    FAILED  ob-java/matrix-var  ((should (equal '((2 4) (1 2))
> > (org-babel-execute-src-block))) :form (equal ((2 4) (1 2)) "") :value nil
> > :explanation (different-types ((2 4) (1 2)) ""))
> >    FAILED  ob-java/matrix-var-with-header  ((should (equal '(("col1"
> > "col2") hline (2 4) (1 2)) (org-babel-execute-src-block))) :form (equal
> > (("col1" "col2") hline (2 4) (1 2)) ((""))) :value nil :explanation
> > (proper-lists-of-different-length 4 1 (("col1" "col2") hline (2 4) (1 2))
> > (("")) first-mismatch-at 0))
> >    FAILED  ob-java/one-arg  ((should (string= "fortytwo"
> > (org-babel-execute-src-block))) :form (string= "fortytwo" "") :value nil
> > :explanation (arrays-of-different-length 8 0 "fortytwo" ""
> > first-mismatch-at 0))
> >    FAILED  ob-java/output-list-with-spaces  ((should (equal "forty
> > two\nforty two\n" (org-babel-execute-src-block))) :form (equal "forty
> > two\nforty two\n" "") :value nil :explanation (arrays-of-different-length
> > 20 0 "forty two\nforty two\n" "" first-mismatch-at 0))
> >    FAILED  ob-java/output-table-with-header  ((should (equal
> > "|col1|col2|\n|-\n|2|1\n|4|2\n" (org-babel-execute-src-block))) :form
> > (equal "|col1|col2|\n|-\n|2|1\n|4|2\n" "") :value nil :explanation
> > (arrays-of-different-length 25 0 "|col1|col2|\n|-\n|2|1\n|4|2\n" ""
> > first-mismatch-at 0))
> >    FAILED  ob-java/read-list-return-array  ((should (equal '("forty"
> "two")
> > (org-babel-execute-src-block))) :form (equal ("forty" "two") "") :value
> nil
> > :explanation (different-types ("forty" "two") ""))
> >    FAILED  ob-java/read-return-list  ((should (equal '("forty" "two")
> > (org-babel-execute-src-block))) :form (equal ("forty" "two") "") :value
> nil
> > :explanation (different-types ("forty" "two") ""))
> >    FAILED  ob-java/read-return-list-with-package  ((should (equal
> '("forty"
> > "two") (org-babel-execute-src-block))) :form (equal ("forty" "two") "")
> > :value nil :explanation (different-types ("forty" "two") ""))
> >    FAILED  ob-java/return-vector-using-array  ((should (equal '((4) (2))
> > (org-babel-execute-src-block))) :form (equal ((4) (2)) ((""))) :value nil
> > :explanation (proper-lists-of-different-length 2 1 ((4) (2)) ((""))
> > first-mismatch-at 0))
> >    FAILED  ob-java/return-vector-using-list  ((should (equal '((4) (2))
> > (org-babel-execute-src-block))) :form (equal ((4) (2)) ((""))) :value nil
> > :explanation (proper-lists-of-different-length 2 1 ((4) (2)) ((""))
> > first-mismatch-at 0))
> >    FAILED  ob-java/simple  ((should (string= "42"
> > (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> > :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at
> 0))
> >    FAILED  ob-java/simple-dir  ((should (string= "42" (unwind-protect
> > (org-babel-execute-src-block) (delete-file (concat ... "Main.java"))
> > (delete-file (concat ... "Main.class"))))) :form (string= "42" "") :value
> > nil :explanation (arrays-of-different-length 2 0 "42" ""
> first-mismatch-at
> > 0))
> >    FAILED  ob-java/simple-dir-with-package  ((should (string= "42"
> > (unwind-protect (org-babel-execute-src-block) (delete-file (concat ...
> > "pkg/Main.java")) (delete-file (concat ... "pkg/Main.class"))
> > (delete-directory (concat ... "pkg"))))) :form (string= "42" "") :value
> nil
> > :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at
> 0))
> >    FAILED  ob-java/simple-return-float  ((should (equal 42.0
> > (org-babel-execute-src-block))) :form (equal 42.0 "") :value nil
> > :explanation (different-types 42.0 ""))
> >    FAILED  ob-java/simple-return-int  ((should (eq 42
> > (org-babel-execute-src-block))) :form (eq 42 "") :value nil)
> >    FAILED  ob-java/simple-return-string  ((should (string= "forty two"
> > (org-babel-execute-src-block))) :form (string= "forty two" "") :value nil
> > :explanation (arrays-of-different-length 9 0 "forty two" ""
> > first-mismatch-at 0))
> >    FAILED  ob-java/simple-with-bracket  ((should (string= "[42"
> > (org-babel-execute-src-block))) :form (string= "[42" "") :value nil
> > :explanation (arrays-of-different-length 3 0 "[42" "" first-mismatch-at
> 0))
> >    FAILED  ob-java/simple-with-class  ((should (string= "42"
> > (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> > :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at
> 0))
> >    FAILED  ob-java/simple-with-class-and-package  ((should (string= "42"
> > (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> > :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at
> 0))
> >    FAILED  ob-java/simple-with-class-attr  ((should (string= "42"
> > (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> > :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at
> 0))
> >    FAILED  ob-java/simple-with-class-attr-with-package  ((should (string=
> > "42" (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> > :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at
> 0))
> >    FAILED  ob-java/simple-with-main  ((should (string= "42"
> > (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> > :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at
> 0))
> >    FAILED  ob-java/simple-with-main-args-array  ((should (string= "42"
> > (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> > :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at
> 0))
> >    FAILED  ob-java/simple-with-main-whitespace  ((should (string= "42"
> > (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> > :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at
> 0))
> >    FAILED  ob-java/simple-with-no-main  ((should (string= "success"
> > (org-babel-execute-src-block))) :form (string= "success" "") :value nil
> > :explanation (arrays-of-different-length 7 0 "success" ""
> first-mismatch-at
> > 0))
> >    FAILED  ob-java/simple-with-non-public-class  ((should (string= "42"
> > (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> > :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at
> 0))
> >    FAILED  ob-java/simple-with-quote  ((should (string= "\"42\""
> > (org-babel-execute-src-block))) :form (string= "\"42\"" "") :value nil
> > :explanation (arrays-of-different-length 4 0 "\"42\"" ""
> first-mismatch-at
> > 0))
> >    FAILED  ob-java/simple-with-two-methods  ((should (string= "42"
> > (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> > :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at
> 0))
> >    FAILED  ob-java/string-var  ((should (string= "forty two, len=9"
> > (org-babel-execute-src-block))) :form (string= "forty two, len=9" "")
> > :value nil :explanation (arrays-of-different-length 16 0 "forty two,
> len=9"
> > "" first-mismatch-at 0))
> >    FAILED  ob-java/two-vars  ((should (string= "42"
> > (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> > :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at
> 0))
> >    FAILED  ob-java/var-with-class  ((should (string= "42"
> > (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> > :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at
> 0))
> >    FAILED  ob-java/var-with-class-and-hanging-curlies  ((should (string=
> > "42" (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> > :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at
> 0))
> >    FAILED  ob-java/var-with-class-and-package  ((should (string= "42"
> > (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> > :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at
> 0))
> >    FAILED  ob-java/var-with-main  ((should (string= "42"
> > (org-babel-execute-src-block))) :form (string= "42" "") :value nil
> > :explanation (arrays-of-different-length 2 0 "42" "" first-mismatch-at
> 0))
> >    FAILED  ob-java/vector-var  ((should (equal '("forty" "two")
> > (org-babel-execute-src-block))) :form (equal ("forty" "two") "") :value
> nil
> > :explanation (different-types ("forty" "two") ""))
> >    FAILED  ob-maxima/batch+verbatim  ((should (equal
> > (org-babel-execute-src-block) "(assume(z >
> > 0),integrate(exp(-t)*t^z,t,0,inf))\n
> > gamma(z + 1)")) :form (equal "(linenum:0,\n(assume(z >
> > 0),integrate(exp(-t)*t^z,t,0,inf))\n
> > gamma(z + 1)" "(assume(z > 0),integrate(exp(-t)*t^z,t,0,inf))\n
> >                     gamma(z + 1)") :value nil :explanation
> > (arrays-of-different-length 104 92 "(linenum:0,\n(assume(z >
> > 0),integrate(exp(-t)*t^z,t,0,inf))\n
> > gamma(z + 1)" "(assume(z > 0),integrate(exp(-t)*t^z,t,0,inf))\n
> >                     gamma(z + 1)" first-mismatch-at 1))
> >    FAILED  ob-maxima/batch+verbatim+:lisp  ((should (equal
> > (org-babel-execute-src-block) "((%GAMMA SIMP) ((MPLUS SIMP) 1 $Z))"))
> :form
> > (equal "(%i1) (linenum:0,\n((%GAMMA SIMP) ((MPLUS SIMP) 1 $Z))" "((%GAMMA
> > SIMP) ((MPLUS SIMP) 1 $Z))") :value nil :explanation
> > (arrays-of-different-length 53 35 "(%i1) (linenum:0,\n((%GAMMA SIMP)
> > ((MPLUS SIMP) 1 $Z))" "((%GAMMA SIMP) ((MPLUS SIMP) 1 $Z))"
> > first-mismatch-at 1))
> >    FAILED  ob-maxima/batch+verbatim+empty-string  ((should (equal
> > (org-babel-execute-src-block) "(%i1) \"\"\n(%o1) ")) :form (equal "(%i1)
> > (linenum:0,\n(%i1) \"\"\n(%o1) " "(%i1) \"\"\n(%o1) ") :value nil
> > :explanation (arrays-of-different-length 33 15 "(%i1) (linenum:0,\n(%i1)
> > \"\"\n(%o1) " "(%i1) \"\"\n(%o1) " first-mismatch-at 6))
> >    FAILED  ob-maxima/batch+verbatim+empty-string-vq  ((should (equal
> > (org-babel-execute-src-block) "\"\"\n ")) :form (equal
> "(linenum:0,\n\"\"\n
> > " "\"\"\n ") :value nil :explanation (arrays-of-different-length 16 4
> > "(linenum:0,\n\"\"\n " "\"\"\n " first-mismatch-at 0))
> >    FAILED  ob-maxima/batch+verbatim+quiet  ((should (equal
> > (org-babel-execute-src-block) "(%i1) (assume(z >
> > 0),integrate(exp(-t)*t^z,t,0,inf))\n(%o1)
> >  gamma(z + 1)")) :form (equal "(%i1) (linenum:0,\n(%i1) (assume(z >
> > 0),integrate(exp(-t)*t^z,t,0,inf))\n(%o1)
> >  gamma(z + 1)" "(%i1) (assume(z >
> 0),integrate(exp(-t)*t^z,t,0,inf))\n(%o1)
> >                            gamma(z + 1)") :value nil :explanation
> > (arrays-of-different-length 116 98 "(%i1) (linenum:0,\n(%i1) (assume(z >
> > 0),integrate(exp(-t)*t^z,t,0,inf))\n(%o1)
> >  gamma(z + 1)" "(%i1) (assume(z >
> 0),integrate(exp(-t)*t^z,t,0,inf))\n(%o1)
> >                            gamma(z + 1)" first-mismatch-at 7))
> >    FAILED  ob-maxima/batch+verbatim+whitespace-string  ((should (equal
> > (org-babel-execute-src-block) "(%i1) \" \"\n(%o1)
> >         ")) :form (equal "(%i1) (linenum:0,\n(%i1) \" \"\n(%o1)
> >                       " "(%i1) \" \"\n(%o1)
> >   ") :value nil :explanation (arrays-of-different-length 68 50 "(%i1)
> > (linenum:0,\n(%i1) \" \"\n(%o1)                                   "
> "(%i1)
> > \" \"\n(%o1)                                   " first-mismatch-at 6))
> >    FAILED  ob-maxima/integer-input  ((should (equal 4
> > (org-babel-execute-src-block))) :form (equal 4 (("(linenum:0,") (4)))
> > :value nil :explanation (different-types 4 (("(linenum:0,") (4))))
> >    FAILED  ob-maxima/list-input  ((should (equal "[2, [2, 3], 4] "
> > (org-babel-execute-src-block))) :form (equal "[2, [2, 3], 4] "
> > "(linenum:0,\n[2, [2, 3], 4] ") :value nil :explanation
> > (arrays-of-different-length 15 27 "[2, [2, 3], 4] " "(linenum:0,\n[2, [2,
> > 3], 4] " first-mismatch-at 0))
> >    FAILED  ob-maxima/matrix-output  ((should (equal '((1 2 3) (2 3 4) (3
> 4
> > 5)) (org-babel-execute-src-block))) :form (equal ((1 2 3) (2 3 4) (3 4
> 5))
> > (("(linenum:0," "" "") (1 2 3) (2 3 4) (3 4 5))) :value nil :explanation
> > (proper-lists-of-different-length 3 4 ((1 2 3) (2 3 4) (3 4 5))
> > (("(linenum:0," "" "") (1 2 3) (2 3 4) (3 4 5)) first-mismatch-at 0))
> >    FAILED  ob-maxima/simple-list-input  ((should (equal "[1, 2, 3] "
> > (org-babel-execute-src-block))) :form (equal "[1, 2, 3] "
> "(linenum:0,\n[1,
> > 2, 3] ") :value nil :explanation (arrays-of-different-length 10 22 "[1,
> 2,
> > 3] " "(linenum:0,\n[1, 2, 3] " first-mismatch-at 0))
> >    FAILED  ob-maxima/string-input  ((should (equal "- sin(x)"
> > (org-babel-execute-src-block))) :form (equal "- sin(x)" (("(linenum:0,"
> "")
> > ("-" "sin(x)"))) :value nil :explanation (different-types "- sin(x)"
> > (("(linenum:0," "") ("-" "sin(x)"))))
> >    FAILED  ob-maxima/table-input1  ((should (equal "[[2.0], [3.0]] "
> > (org-babel-execute-src-block))) :form (equal "[[2.0], [3.0]] "
> > "(linenum:0,\n[[2.0], [3.0]] ") :value nil :explanation
> > (arrays-of-different-length 15 27 "[[2.0], [3.0]] " "(linenum:0,\n[[2.0],
> > [3.0]] " first-mismatch-at 0))
> >    FAILED  ob-maxima/table-input2  ((should (equal "[[2.0, 3.0]] "
> > (org-babel-execute-src-block))) :form (equal "[[2.0, 3.0]] "
> > "(linenum:0,\n[[2.0, 3.0]] ") :value nil :explanation
> > (arrays-of-different-length 13 25 "[[2.0, 3.0]] " "(linenum:0,\n[[2.0,
> > 3.0]] " first-mismatch-at 0))
> >    FAILED  test-org-table/sort-lines  ((should (equal "| a | x |\n| B | 4
> > |\n| c | 3 |\n" (org-test-with-temp-text "| <point>a | x |\n| c | 3 |\n|
> B
> > | 4 |\n" (org-table-sort-lines nil 97) (buffer-string)))) :form (equal
> "| a
> > | x |\n| B | 4 |\n| c | 3 |\n" #("| B | 4 |\n| a | x |\n| c | 3 |\n" 0 9
> > (face org-table) 9 10 (face org-table-row) 10 19 (face org-table) 19 20
> > (face org-table-row) 20 29 (face org-table) 29 30 (face org-table-row)))
> > :value nil :explanation (array-elt 2 (different-atoms (97 "#x61" "?a")
> (66
> > "#x42" "?B"))))
> >
> > 13 skipped results:
> >   SKIPPED  org-missing-dependency/test-ob-R  ((skip-unless nil) :form nil
> > :value nil)
> >   SKIPPED  org-missing-dependency/test-ob-clojure  ((skip-unless nil)
> :form
> > nil :value nil)
> >   SKIPPED  org-missing-dependency/test-ob-haskell-ghci  ((skip-unless
> nil)
> > :form nil :value nil)
> >   SKIPPED  org-missing-dependency/test-ob-julia  ((skip-unless nil) :form
> > nil :value nil)
> >   SKIPPED  org-missing-dependency/test-ob-lua  ((skip-unless nil) :form
> nil
> > :value nil)
> >   SKIPPED  org-missing-dependency/test-ob-octave  ((skip-unless nil)
> :form
> > nil :value nil)
> >   SKIPPED  org-missing-dependency/test-ob-python  ((skip-unless nil)
> :form
> > nil :value nil)
> >   SKIPPED  org-missing-dependency/test-ob-ruby  ((skip-unless nil) :form
> > nil :value nil)
> >   SKIPPED  org-missing-dependency/test-ob-scheme  ((skip-unless nil)
> :form
> > nil :value nil)
> >   SKIPPED  org-missing-dependency/test-org-attach-git  ((skip-unless nil)
> > :form nil :value nil)
> >   SKIPPED  test-ob-shell/bash-uses-assoc-arrays  ((skip-unless (if-let
> > ((bash (executable-find "bash"))) (eq 0 (process-file bash nil nil nil
> "-c"
> > "declare -A assoc_array")))) :form (let* ((bash (and t (executable-find
> > "bash")))) (if bash (eq 0 (process-file bash nil nil nil "-c" "declare -A
> > assoc_array")) nil)) :value nil)
> >   SKIPPED  test-ob-shell/bash-uses-assoc-arrays-with-lists  ((skip-unless
> > (if-let ((bash (executable-find "bash"))) (eq 0 (process-file bash nil
> nil
> > nil "-c" "declare -A assoc_array")))) :form (let* ((bash (and t
> > (executable-find "bash")))) (if bash (eq 0 (process-file bash nil nil nil
> > "-c" "declare -A assoc_array")) nil)) :value nil)
> >   SKIPPED  test-org-fold/org-fold-display-inline-images  ((skip-unless
> (not
> > noninteractive)) :form (not t) :value nil)
> >
> > make: *** [test] Error 1
> >
> >
> >
> >
> >
> >
> > On Wed, Sep 18, 2024 at 3:43 AM Ihor Radchenko <yantar92@posteo.net>
> wrote:
> >
> >> Benjamin McMillan <mcmillanbb@gmail.com> writes:
> >>
> >> > I attach the patch here.
> >>
> >> Thanks!
> >>
> >> > However, I have two questions.
> >> > First, I am not certain that I set up the repository correctly,
> because
> >> > when I run "make test" it generates 55 unexpected failures. This
> without
> >> > making any changes.
> >> > (The patch submitted here does not generate any new failures.)
> >>
> >> That's odd. May you share the log?
> >>
> >> > Second, the existing comment at the patch becomes slightly out of date
> >> with
> >> > the change.
> >>
> >> Then, may you please update the comment?
> >>
> >> Also, may you change the commit message to not sound like it is a new
> >> feature? Just explain the purpose of the change as you did in this
> >> email thread (but shorter, and then add a link to this thread).
> >>
> >> > In fact, I propose that it might be good to update the docstring for
> >> > `org-src-fontify-natively' to explicitly state that it enable
> >> fontification
> >> > for src, example, and export blocks.
> >>
> >> I'd rather not document this in `org-src-fontify-natively'. The name of
> >> this variable does not really hint that it has anything to do with
> >> export or example blocks.
> >>
> >> We may eventually rename it to something more generic, but example
> >> blocks may need to be re-considered because specifying language of the
> >> example block is not even a part of Org syntax. So, generalizing and
> >> documenting this is a bit tricky.
> >>
> >> --
> >> Ihor Radchenko // yantar92,
> >> Org mode contributor,
> >> Learn more about Org mode at <https://orgmode.org/>.
> >> Support Org development at <https://liberapay.com/org-mode>,
> >> or support my work at <https://liberapay.com/yantar92>
> >>
> > From c245df2136778fd34d3ed263208331ca4e35e54d Mon Sep 17 00:00:00 2001
> > From: Benjamin McMillan <mcmillanbb@gmail.com>
> > Date: Fri, 20 Sep 2024 23:43:55 +0900
> > Subject: [PATCH] lisp/org.el: Add "export" to list of native fontified
> blocks
> >
> > * lisp/org.el (org-fontify-meta-lines-and-blocks-1): Add "export" to
> > list of block types that are fontified if org-src-fontify-natively
> > is non-nil.
> >
> > Link: https://list.orgmode.org/87h6aejf17.fsf@localhost/
> > TINYCHANGE
> > ---
> >  lisp/org.el | 12 ++++++------
> >  1 file changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/lisp/org.el b/lisp/org.el
> > index d5c1dcb35..df58b47be 100644
> > --- a/lisp/org.el
> > +++ b/lisp/org.el
> > @@ -5490,14 +5490,14 @@ by a #."
> >           (org-remove-flyspell-overlays-in nl-before-endline
> end-of-endline)
> >              (cond
> >            ((and org-src-fontify-natively
> > -                   ;; Technically, according to
> > +                   ;; Technically, according to the
> >                     ;; `org-src-fontify-natively' docstring, we should
> >                     ;; only fontify src blocks.  However, it is common
> > -                   ;; to use undocumented fontification of example
> > -                   ;; blocks with undocumented language specifier.
> > -                   ;; Keep this undocumented feature for user
> > -                   ;; convenience.
> > -                   (member block-type '("src" "example")))
> > +                   ;; to use undocumented fontification of export and
> > +                   ;; example blocks. (The latter which do not support a
> > +                   ;; language specifier.) Keep this undocumented
> feature
> > +                   ;; for user convenience.
> > +                   (member block-type '("src" "export" "example")))
> >             (save-match-data
> >                  (org-src-font-lock-fontify-block (or lang "")
> block-start block-end))
> >             (add-text-properties bol-after-beginline block-end
> '(src-block t)))
> > --
> > 2.46.0
> >
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>

[-- Attachment #2: Type: text/html, Size: 31950 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-09-23 13:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-01  4:35 [BUG] export blocks no longer fontifying [9.7.10 (release_9.7.10 @ /Users/ben/Scripts/emacs/lisp/org/)] Benjamin McMillan
2024-09-10 17:01 ` Ihor Radchenko
2024-09-16 14:27   ` Benjamin McMillan
2024-09-17 12:29     ` Benjamin McMillan
2024-09-17 18:44       ` Ihor Radchenko
     [not found]         ` <CALo8A5Vm-gik0qQC7KacNg7kN2VzL0Y1e8_LXxV8S7-we9CYSw@mail.gmail.com>
2024-09-22  9:53           ` Ihor Radchenko
2024-09-23 13:17             ` Benjamin McMillan

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).