Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: ${(t!)nameref}; ${(t)${nested}}; Doc/zshall.1



On Sat, Nov 8, 2025 at 7:15 PM Jim <linux.tech.guy@xxxxxxxxx> wrote:
>
>
>
> On Sat, Nov 8, 2025 at 12:47 AM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
>>
>>
>> E. zshall.1 sources the other man pages by using the roff(7) directive
>> ".so man1/zshexpn.1" [Doc/zsh.yo:73].  That works fine when
>> installed, but when one does «man Doc/zshall.1» in the build tree, those
>> directives pull in the /installed/ zshexpn(1) man page.
>>
>> Mikael points out that «ln -s Doc man1» is a workaround.
>>
>> Now, it would have been nice if we could change that directive to have
>> zshall.1's source say the moral equivalent of "source ${0:h}/zshexpn.1",
>> but unless there's a portable roff(7) syntax for that, I think having
>> the build system create that symlink would actually be a good idea,
>> since it'd make «man Doc/zshall.1» work as expected in the build tree,
>> rather than silently let the installed man pages follow the just-built
>> leading section.
>>
>> This wouldn't affect the installed tree in any way.
>
>
> Why not just use <man -l Doc/zshall.1>, this puts man in "local" mode.
>
> From the "man" man  page:
>
>        -l, --local-file
>               Activate "local" mode.  Format and display local manual files in‐
>               stead  of searching through the system’s manual collection.  Each
>               manual page argument will be interpreted as an nroff source  file
>               in  the  correct  format.   No  cat  file is produced.  If ’-’ is
>               listed as one of the arguments, input will be taken from stdin.
>
>               If this option is not used, then man will also fall back  to  in‐
>               terpreting manual page arguments as local file names if the argu‐
>               ment  contains  a  "/" character, since that is a good indication
>               that the argument refers to a path on the file system.`

This doesn't seem to actually work, presumably because the path
doesn't exist locally.
% strace -o /tmp/fifo -efile -f man -l Doc/zshall.1
5144  stat("man1/zshexpn.1", 0x7ffcc0846120) = -1 ENOENT (No such file
or directory)
5377  stat("/usr/local/share/man/man1/zshexpn.1",
{st_mode=S_IFREG|0644, st_size=143074, ...}) = 0
5144  openat(AT_FDCWD, "/usr/local/share/man/man1/zshexpn.1", O_RDONLY = 3

-- 
Mikael Magnusson




Messages sorted by: Reverse Date, Date, Thread, Author