From: Stefan M. <mo...@ir...> - 2004-09-22 13:00:02
|
>>> The rationale behind "" was that a non-zero string may be >>> misinterpreted by a user/programmer as a real path, when its value >>> would just be ignored. >> >> Without explaining to use the reason why the file-name has to change, it's >> difficult to know what's the best solution. > Doing it this way allows people to store log files based on the date a > buffer is saved, such as using a new log file each month, or day. > Hooking into the save mechanism is a lot more straightforward than what? What alternatives have you considered? How is the buffer-save triggered (is it triggered by a timer, by the user selecting the buffer and hitting C-x C-s, by some other command in the main ERC buffer, indirectly by save-some-buffers, ...)? How about choosing the file name based on the date the buffer is created? How about using "foo/bar-latest at first and switching to "foo/bar-<date>" in before-save-hook? How about always using "foo/bar-latest" as buffer-file-name and link/copy/move the file to "foo/bar-<date>" in after-save-hook? How about using "foo/bar-<date>" at buffer creation and in before-save-hook update the "<date>" part if necessary (if the date only includes the month, it's unlikely to change, and if the user restarts Emacs every day, the same will hold even if the date includes the day)? > as it allows us to compute the file name on demand rather than attempt to > keep it updated by something like a timer. Hmmm.... doing it in a timer? That sounds like trouble, Stefan |