Share

Template Package for Emacs

Tracker: Bugs

5 Infinite looping in template-unique-file function - ID: 1896574
Last Update: Tracker Item Submitted ( newt0311 )

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)))


newt0311 ( newt0311 ) - 2008-02-19 01:40

5

Open

None

Nobody/Anonymous

None

None

Public


Comments




Log in to comment.

No follow-up comments have been posted.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.