Skip to content

Commit

Permalink
Replace zero-width spaces in man pages with an empty string.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
QP committed Sep 4, 2024
1 parent 37bb5fe commit 0282c85
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions man/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0282c85

Please sign in to comment.