[Gllug] cariage returns in CVS

Nix nix at esperi.demon.co.uk
Sun Jun 15 20:30:10 UTC 2003


On Wed, 11 Jun 2003, Juan AMIGUET yowled:
> Forcing the dude to lick of all the ^M from the source code while 
> using x-emacs sounds like a good punishment

what's so hard about

(defun nix-mass-code-convert-recursively (encoding directory &optional REGEXP)
  "Recursively convert to ENCODING all files in DIRECTORY.
Optionally only convert names matching REGEXP."
  (let ((directory (expand-file-name directory))
        (unless (file-directory-p directory)
          (signal 'file-error (list "Removing old file name" "no such directory" directory))))
    (mapc
     #'(lambda (file)
         (cond
          ((and (file-directory-p file)
                (not (file-symlink-p file)))
           (nix-mass-code-convert-recursively encoding file regexp))
          ((file-regular-p file)
           (with-temp-buffer
             (insert-file-contents file)
             (write-file file nil encoding)))))
     (directory-files directory t regexp))))

anyway?

(disclaimer: totally untested.)

-- 
`It is an unfortunate coincidence that the date locarchive.h was
 written (in hex) matches Ritchie's birthday (in octal).'
               -- Roland McGrath on the libc-alpha list

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list