Closed quaepoena closed 2 months ago
@Tristan02d: any thoughts on this? Thanks!
I was making a silly mistake in meson.build
by defining my function and adding to org-export-filter-plain-text-functions
after org-export-to-file
was called. The code below works as intended.
expr_tmpl = ''.join([
'(progn',
' (require \'ox-man)',
' (setq org-export-with-sub-superscripts \'{})',
' (defun qp-man-filter-remove-zero-width-space (text backend _info)',
' (when (org-export-derived-backend-p backend \'man)',
' (replace-regexp-in-string "" "" text)))',
' (add-to-list \'org-export-filter-plain-text-functions',
' \'qp-man-filter-remove-zero-width-space)',
' (org-export-to-file \'man "@0@"))'])
Now it's a question of whether this fix is desirable. One further thing to note is that the check in when
isn't strictly necessary since this is only used to build man pages.
Suggested fix using a lambda and no when
-statement.
All these spaces do is deleting an extra visual space when manual pages are rendered in either the terminal or Emacs. This small enhancement might not be worth adding too much complexity to the build system. For now the provided fix works well and is simple, so I think keeping these spaces and merging it is OK. But if one day a problem from these spaces require adding 10 lines in the Meson files, just getting rid of them would be better I think.
@Tristan02d: thanks!
@quaepoena: can you make a PR? The change looks okay but could you add a comment describing with it does? And esp. the replace-regexp-in-string
, can we use some unicode codepoint for the zero-width string so it becomes a bit clearer? Thanks.
Describe the issue
The use of a zero width space (0x200B) in the
man-link
macro prevents Emacs' man page viewer from parsing the SEE ALSO section of the mu* man pages, e.g. withMan-follow-manual-reference
. I understand why it's there, and I don't see a way to fix this issue that involves changing the macro itself.I was somewhat able to fix this, though, with the following code and then running
C-c C-e M m
or(org-export-to-buffer 'man "mu.1.org-out")
.When I tried to add that code to
man/meson.build
, however, the resulting files inbuild/man/
still have the zero width spaces.An example line exported manually:
An example line exported from make:
I know very little about exporting from org and building with meson, so I don't have any further ideas about how to solve this.
Environment
Emacs 29.4 mu 1.12.6