[PPL-devel] Any emacs guru out there?
Matthew Mundell
mattm at comp.leeds.ac.uk
Mon Feb 14 13:43:21 CET 2005
>> What's wrong with "M-x ispell-comments-and-strings"?
>
> It is near to perfect. What I would love to have is something like
> "M-x dired-do-ispell-comments-and-strings". I am sure there is a
> simple way to do it, but I don't know how.
A bit rough perhaps, but it seems to work:
(add-hook 'dired-load-hook
#'(lambda ()
(defun dired-ispell-comments-and-strings ()
;; Return nil for success, else offending file name.
(let* ((filename (dired-get-filename))
buffer-read-only failure)
(condition-case err
(with-current-buffer (find-file filename)
(save-excursion (ispell-comments-and-strings)))
(error
(setq failure err)))
(when failure
(dired-log "ispell-comments-and-strings error for %s:\n%s\n" filename failure)
(dired-make-relative filename))))
(defun dired-do-ispell-comments-and-strings (&optional arg)
"`ispell-comments-and-strings' marked (or next ARG) files."
(interactive "P")
(dired-map-over-marks-check (function dired-ispell-comments-and-strings)
arg 'ispell-comments-and-strings t))
(define-key dired-mode-map "c" 'dired-do-ispell-comments-and-strings)))
More information about the PPL-devel
mailing list