From 0282c8551dc3c7b3038eef81e5fb63c0df59b054 Mon Sep 17 00:00:00 2001 From: QP Date: Wed, 4 Sep 2024 12:34:53 +0200 Subject: [PATCH] Replace zero-width spaces in man pages with an empty string. The zero-width spaces are added by the `man-link` macro to ensure bold text formatting when exporting from org, but they interfere with man page functionality in Emacs. --- man/meson.build | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/man/meson.build b/man/meson.build index 76018354f..5251964f5 100644 --- a/man/meson.build +++ b/man/meson.build @@ -80,10 +80,16 @@ foreach src : man_orgs configure_file(input: src, output:'@BASENAME@.org', configuration: conf_data) + # (replace-regexp-in-string) removes zero-width spaces — added for + # text formatting purposes by the man-link macro — from the + # resulting man page. expr_tmpl = ''.join([ '(progn', ' (require \'ox-man)', ' (setq org-export-with-sub-superscripts \'{})', + ' (add-to-list \'org-export-filter-plain-text-functions', + ' (lambda (text _backend _info)', + ' (replace-regexp-in-string "\u200b" "" text)))', ' (org-export-to-file \'man "@0@"))']) expr = expr_tmpl.format(org.substring(0,-4)) sectiondir = join_paths(mandir, 'man' + section)