Search for latexmk in more places#584
Conversation
|
It would be good if this pull request could be reviewed by someone who edits Rnoweb files. Section CONFIGURATION/INITIALIZATION (RC) FILES of |
|
Looking at the code: shouldn't we have a break at the end of the if (length(idx) == 1) {
logf <- paste0(
sub(".*\\$out_dir\\s*=\\s*['\"](.*)['\"].*", "\\1", lmk[idx]),
"/",
sub("\\....$", ".log", rnwf)
)
break
} |
|
The |
No, it shouldn't break in this case. It's scanning the files in reverse order of priority, so the last match should stand. I do still need to add the other locations mentioned in the man page (and then those additional locations should be added to lua code from the previous PR). |
It would be more efficient to scan the files in the order of priority and break on the first match. |
I think so too :) |
Added all locations latexmk searches for the *user* rc file. Then, since we're only grabbing a single variable/entry, reversed the search to look at the highest priority first and break/terminate the search when found.
Fair enough, as long as we're only interested in one variable/setting, searching from the highest priority to the lowest and terminating the search when found is definitely more efficient. (This is the opposite of what latexmk does, however, as it is merging multiple values and the highest priority -- most "local" -- options should override less "local" ones.) I've reversed the search order and added the break as well as added all the locations latexmk looks for the user rc. |
|
Thank you! I'll merge it... |
This follows up on PR #582, adding similar logic to search the home directory, cwd (typically the project root), and then file's directory for a ".latexmkrc" file to "nvimcom/R/interlace.R" (the other place where the latexmkrc file i searched for). As in the rmw.lua case, it does this in reverse of the stated order, so that the "most local" 'out_dir' configuration stands.