4 apr. 2020 kl. 11.26 skrev Eli Zaretskii : > DECODE_FILE is called because the file name in question starts with a > "~"? Otherwise, I don't think I understand why would expand-file-name > need to decode a file name. Maybe it's because default-directory started with a tilde. It doesn't really matter; it's a common case, and the profiler tells us as much. > IME, the cases where we can safely assume it's OK to return the same > string are actually very rare. It is no accident that you saw so few > calls of these functions where we use that optional behavior. This does not mean that the remaining 179 calls require a copy; they just use the default value of the parameter. > Neither, IMO. Again, it's a separate problem, and let's keep our > sights squarely on the original issue you wanted to fix. Let's tackle > the NOCOPY issue in a separate discussion, OK? Thank you, a separate bug for it is fine. Here is a revised patch which takes the nocopy parameter into account (in its inverted sense). Obviously it needs to be adapted if the nocopy inversion is dealt with first; the two bugs do not commute.