auctex-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-diffs] Changes to auctex/tex.el


From: Ralf Angeli
Subject: [AUCTeX-diffs] Changes to auctex/tex.el
Date: Tue, 07 Feb 2006 10:14:58 +0000

Index: auctex/tex.el
diff -u auctex/tex.el:5.558 auctex/tex.el:5.559
--- auctex/tex.el:5.558 Tue Feb  7 10:04:07 2006
+++ auctex/tex.el       Tue Feb  7 10:14:58 2006
@@ -191,7 +191,7 @@
     ("Index" "makeindex %s" TeX-run-command nil t :help "Create index file")
     ("Check" "lacheck %s" TeX-run-compile nil (latex-mode)
      :help "Check LaTeX file for correctness")
-    ("Spell" "<ignored>" TeX-run-ispell-on-document nil t
+    ("Spell" "(TeX-ispell-document \"\")" TeX-run-function nil t
      :help "Spell-check the document")
     ("Clean" "TeX-clean" TeX-run-function nil t
      :help "Delete generated intermediate files")
@@ -275,7 +275,6 @@
                                (function-item TeX-run-silent)
                                (function-item TeX-run-discard-foreground)
                                (function-item TeX-run-function)
-                               (function-item TeX-run-ispell-on-document)
                                (function :tag "Other"))
                        (boolean :tag "Prompt")
                        (choice :tag "Modes"
@@ -4715,6 +4714,39 @@
        (t
         (spell-buffer))))
 
+(defun TeX-ispell-document (name)
+  "Run ispell on all open files belonging to the current document."
+  (interactive (list (TeX-master-file)))
+  (if (string-equal name "")
+      (setq name (TeX-master-file)))
+
+  (let ((found nil)
+       (regexp (concat "\\`\\("
+                       (mapconcat (lambda (dir)
+                                    (regexp-quote
+                                     (expand-file-name 
+                                      (file-name-as-directory dir))))
+                                  (append (when (file-name-directory name)
+                                            (list (file-name-directory name)))
+                                          TeX-check-path)
+                                  "\\|")
+                       "\\).*\\("
+                       (mapconcat 'regexp-quote
+                                  (cons (file-name-nondirectory name)
+                                        (TeX-style-list)) "\\|")
+                       "\\)\\.\\("
+                       (mapconcat 'regexp-quote TeX-file-extensions "\\|")
+                       "\\)\\'"))
+       (buffers (buffer-list)))
+    (while buffers
+      (let* ((buffer (car buffers))
+            (name (buffer-file-name buffer)))
+       (setq buffers (cdr buffers))
+       (if (and name (string-match regexp name))
+           (progn
+             (save-excursion (switch-to-buffer buffer) (ispell-buffer))
+             (setq found t)))))))
+
 ;; Some versions of ispell 3 use this.
 (defvar ispell-tex-major-modes nil)
 (setq ispell-tex-major-modes




reply via email to

[Prev in Thread] Current Thread [Next in Thread]