#2 Infinite looping in template-unique-file function

v1.0_(example)
closed
nobody
3.3 (1)
5
2015-03-04
2008-02-19
newt0311
No

The template-unique-file function goes into an infinite loop whenever auto-numbering is enabled and the file-directory has more directories inside. Here is the offending code:
(while list
(unless (:EMACS file-directory-p (car list))
(setq auto-num
(max (template-filename-number
(cddr (template-split-filename (car list) dir))
raw ext)
auto-num)
list (cdr list))))

Notice the list is only updated then the car is not a directory. The fix is to move that setq outside the unless statement as follows:

(while list
(unless (:EMACS file-directory-p (car list))
(setq auto-num
(max (template-filename-number
(cddr (template-split-filename (car list) dir))
raw ext)
auto-num)))
(setq list (cdr list)))

Discussion

  • Christoph Wedler

    Thanks for the report.
    Fixed in v3.3.

     
  • Christoph Wedler

    • labels: --> 3.3
    • status: open --> closed
    • Group: --> v1.0_(example)
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks