Hi Florent, 2014-08-24 16:01 GMT+02:00 Florent Rougon <f.rou...@free.fr>: > Hello, > > Here is a tiny patch for a bug in the expansion of %' in TeX-expand-list > (tex.el): when it inserts the concatenation of TeX-command-text and > " \"\\input\"" into the command line being constructed, it does: > > (setq pos (+ (length TeX-command-text) 9)) > > where 9 is the length of " \"\\input\"". However, this number > (+ (length TeX-command-text) 9) should be *added to the current value* > of pos instead of replacing it. The result with the buggy code is that > TeX-command-expand will start expanding the command line under > construction again from (+ (length TeX-command-text) 9), which is > earlier than it should be (and therefore expand things that ought to be > left as is).
Thank you for the bug report and patch, I've installed it. This was a tiny change, but for the future consider assigning the copyright to the FSF, so you'll be able to provide much longer patches ;-) In addition, a ChangeLog entry for the possible future patches would be really useful. > One can exhibit the problem by putting for instance %%%% before the %' > in a TeX-command-list entry. Normally, this sequence should expand to > %%. However, because of the bug, it is expanded a second time after %' > has been expanded, thus yielding a single %. This is illustrated in the > attached file auctex-bugtest.el. Thank you also for the recipe to reproduce the bug, I'll try to write an ERT test for it. Bye, Mosè _______________________________________________ bug-auctex mailing list bug-auctex@gnu.org https://lists.gnu.org/mailman/listinfo/bug-auctex