Quote:
>|>
>|>> People who add ".pl" to ordinary Perl executables are confusing the issue.
>|>
>|>Or we're underpriveleged MS-DOS users, who have seen enough light to use
>|>4dos and declare .pl as an executable extension.
>Or we're emacs users who need to use _some_ convention to tell emacs what
>mode to set up for the file.
emacs is much smarter than that. i have taught mine to automagically sniff
out perl files by scanning for "bin/perl" in the first 100 bytes like this..
(a snippet from my .emacs file) -- i always start my perlies with #!/usr/local/bin/perl
;;; find-file-hooks is a list of functions ...
(setq find-file-hooks '(my-find-file-hook))
(defun my-find-file-hook ()
"Runs with each new file found"
;; (message (concat "hello from the hook: " (buffer-file-name)))
;; (sit-for 2)
(save-excursion
(save-restriction
;; is this a perl file ??
(if (search-forward "bin/perl" 100 t)
(perl-mode))
;; can you find a script: line??
;; setup for sdsbuild then..
;; ...stuff deleted...
)
)
)
hope that helps,
paul
--
Paul Kent (SQL r&d) " nothing ventured, nothing disclaimed "