I recently noticed an issue in
man.el, in which sections in
Man--sections are listed backwards. That is, the value is is something like:
(#("SEE ALSO" 0 8 (face Man-overstrike)) #("COPYRIGHT" 0 9 (face Man-overstrike)) #("REPORTING BUGS" 0 14 (face Man-overstrike)) #("AUTHOR" 0 6 (face Man-overstrike)) #("EXAMPLES" 0 8 (face Man-overstrike)) #("DESCRIPTION" 0 11 (face Man-overstrike)) #("SYNOPSIS" 0 8 (face Man-overstrike)) #("NAME" 0 4 (face Man-overstrike)))
This is because
Man-build-section-alist scans the buffer from
push-ing values onto
Man--sections as it goes.
I wanted to change this behavior so that the sections are in the correct order, which matters to
However, changing the
Man-build-section-alist function, then re-evaluating it doesn't do any good, because it's defined with
defsubst instead of
defsubst inlines functions, which means that, when the file is byte-compiled, the function definition is directly inserted where the function is called. This means that redefining/evaluating the function doesn't work, since the bytecode is not changed.
defsubst offers a performance benefit, but is there really any reason to use it for a command like
Man-build-section-alist? Most functions in
defun, and I can't imagine that the performance benefit matters on hardware from the past 15 years.