emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/textmodes/ispell.el


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/lisp/textmodes/ispell.el
Date: Thu, 30 May 2002 13:09:58 -0400

Index: emacs/lisp/textmodes/ispell.el
diff -c emacs/lisp/textmodes/ispell.el:1.129 
emacs/lisp/textmodes/ispell.el:1.130
*** emacs/lisp/textmodes/ispell.el:1.129        Sun Feb 17 07:15:17 2002
--- emacs/lisp/textmodes/ispell.el      Thu May 30 13:09:58 2002
***************
*** 714,720 ****
  (defun check-ispell-version (&optional interactivep)
    "Ensure that `ispell-program-name' is valid and the correct version.
  Returns version number if called interactively.
! Otherwise returns the library path if defined."
    ;; This is a little wasteful as we actually launch ispell twice: once
    ;; to make sure it's the right version, and once for real.  But people
    ;; get confused by version mismatches *all* the time (and I've got the
--- 714,720 ----
  (defun check-ispell-version (&optional interactivep)
    "Ensure that `ispell-program-name' is valid and the correct version.
  Returns version number if called interactively.
! Otherwise returns the library directory name, if that is defined."
    ;; This is a little wasteful as we actually launch ispell twice: once
    ;; to make sure it's the right version, and once for real.  But people
    ;; get confused by version mismatches *all* the time (and I've got the
***************
*** 748,754 ****
                                 ", "
                                 ispell-version))
            (message result))
!       ;; return library path.
        (if (re-search-forward "LIBDIR = \\\"\\([^ \t\n]*\\)\\\"" nil t)
            (setq result (buffer-substring (match-beginning 1) (match-end 1)))))
        (goto-char (point-min))
--- 748,754 ----
                                 ", "
                                 ispell-version))
            (message result))
!       ;; return library directory.
        (if (re-search-forward "LIBDIR = \\\"\\([^ \t\n]*\\)\\\"" nil t)
            (setq result (buffer-substring (match-beginning 1) (match-end 1)))))
        (goto-char (point-min))
***************
*** 810,819 ****
         (not xemacsp)
         'reload))
  
! (defvar ispell-library-path (if (or (not (fboundp 'byte-compiling-files-p))
!                                   (not (byte-compiling-files-p)))
!                               (check-ispell-version))
!   "The directory where ispell dictionaries reside.")
  
  (defvar ispell-process nil
    "The process object for Ispell.")
--- 810,819 ----
         (not xemacsp)
         'reload))
  
! (defvar ispell-library-directory (condition-case ()
!                                    (check-ispell-version)
!                                  (error nil))
!   "Directory where ispell dictionaries reside.")
  
  (defvar ispell-process nil
    "The process object for Ispell.")
***************
*** 828,839 ****
    "Non-nil means that the OS supports asynchronous processes.")
  
  ;;;###autoload
! (if (and ispell-menu-map-needed
!        (or (not (fboundp 'byte-compiling-files-p))
!            (not (byte-compiling-files-p))))
      (let ((dicts (reverse (cons (cons "default" nil) 
ispell-dictionary-alist)))
!         ;; `ispell-library-path' intentionally not defined in autoload
!         (path (and (boundp 'ispell-library-path) ispell-library-path))
          name load-dict)
        (setq ispell-menu-map (make-sparse-keymap "Spell"))
        ;; add the dictionaries to the bottom of the list.
--- 828,836 ----
    "Non-nil means that the OS supports asynchronous processes.")
  
  ;;;###autoload
! (if ispell-menu-map-needed
      (let ((dicts (reverse (cons (cons "default" nil) 
ispell-dictionary-alist)))
!         (dir ispell-library-directory)
          name load-dict)
        (setq ispell-menu-map (make-sparse-keymap "Spell"))
        ;; add the dictionaries to the bottom of the list.
***************
*** 848,859 ****
                             (list 'lambda () '(interactive)
                                   (list
                                     'ispell-change-dictionary "default"))))))
!             ((or (not path)           ; load all if library dir not defined
!                  (file-exists-p (concat path "/" name ".hash"))
!                  (file-exists-p (concat path "/" name ".has"))
                   (and load-dict
!                       (or (file-exists-p(concat path "/" load-dict ".hash"))
!                           (file-exists-p(concat path "/" load-dict ".has")))))
               (define-key ispell-menu-map (vector (intern name))
                 (cons (concat "Select " (capitalize name) " Dict")
                       (list 'lambda () '(interactive)
--- 845,856 ----
                             (list 'lambda () '(interactive)
                                   (list
                                     'ispell-change-dictionary "default"))))))
!             ((or (not dir)            ; load all if library dir not defined
!                  (file-exists-p (concat dir "/" name ".hash"))
!                  (file-exists-p (concat dir "/" name ".has"))
                   (and load-dict
!                       (or (file-exists-p (concat dir "/" load-dict ".hash"))
!                           (file-exists-p (concat dir "/" load-dict ".has")))))
               (define-key ispell-menu-map (vector (intern name))
                 (cons (concat "Select " (capitalize name) " Dict")
                       (list 'lambda () '(interactive)
***************
*** 862,874 ****
  
  ;;; define commands in menu in opposite order you want them to appear.
  ;;;###autoload
! (if (and ispell-menu-map-needed
!        (or (not (fboundp 'byte-compiling-files-p))
!            (not (byte-compiling-files-p))))
      (progn
        (define-key ispell-menu-map [ispell-change-dictionary]
        '(menu-item "Change Dictionary..." ispell-change-dictionary
!                   :help "Supply explicit path to dictionary"))
        (define-key ispell-menu-map [ispell-kill-ispell]
        '(menu-item "Kill Process" ispell-kill-ispell
                    :enable (and (boundp 'ispell-process) ispell-process
--- 859,869 ----
  
  ;;; define commands in menu in opposite order you want them to appear.
  ;;;###autoload
! (if ispell-menu-map-needed
      (progn
        (define-key ispell-menu-map [ispell-change-dictionary]
        '(menu-item "Change Dictionary..." ispell-change-dictionary
!                   :help "Supply explicit dictionary file name"))
        (define-key ispell-menu-map [ispell-kill-ispell]
        '(menu-item "Kill Process" ispell-kill-ispell
                    :enable (and (boundp 'ispell-process) ispell-process
***************
*** 900,908 ****
                    :help "Complete word fragment at cursor"))))
  
  ;;;###autoload
! (if (and ispell-menu-map-needed
!        (or (not (fboundp 'byte-compiling-files-p))
!            (not (byte-compiling-files-p))))
      (progn
        (define-key ispell-menu-map [ispell-continue]
        '(menu-item "Continue Spell-Checking" ispell-continue
--- 895,901 ----
                    :help "Complete word fragment at cursor"))))
  
  ;;;###autoload
! (if ispell-menu-map-needed
      (progn
        (define-key ispell-menu-map [ispell-continue]
        '(menu-item "Continue Spell-Checking" ispell-continue
***************
*** 919,927 ****
                    :help "Spell-check only comments and strings"))))
  
  ;;;###autoload
! (if (and ispell-menu-map-needed
!        (or (not (fboundp 'byte-compiling-files-p))
!            (not (byte-compiling-files-p))))
      (progn
        (define-key ispell-menu-map [ispell-region]
        '(menu-item "Spell-Check Region" ispell-region
--- 912,918 ----
                    :help "Spell-check only comments and strings"))))
  
  ;;;###autoload
! (if ispell-menu-map-needed
      (progn
        (define-key ispell-menu-map [ispell-region]
        '(menu-item "Spell-Check Region" ispell-region
***************
*** 964,980 ****
        (setq name (car (car dicts))
              load-dict (car (cdr (member "-d" (nth 5 (car dicts)))))
              dicts (cdr dicts))
!       ;; Include if the dictionary is in the library, or path not defined.
        (if (and (stringp name)
!                (or (not ispell-library-path)
!                    (file-exists-p (concat ispell-library-path "/"
                                            name ".hash"))
!                    (file-exists-p (concat ispell-library-path "/"
                                            name ".has"))
                     (and load-dict
!                         (or (file-exists-p (concat ispell-library-path "/"
                                                     load-dict ".hash"))
!                             (file-exists-p (concat ispell-library-path "/"
                                                     load-dict ".has"))))))
            (setq menu (append menu
                               (list
--- 955,971 ----
        (setq name (car (car dicts))
              load-dict (car (cdr (member "-d" (nth 5 (car dicts)))))
              dicts (cdr dicts))
!       ;; Include if the dictionary is in the library, or dir not defined.
        (if (and (stringp name)
!                (or (not ispell-library-directory)
!                    (file-exists-p (concat ispell-library-directory "/"
                                            name ".hash"))
!                    (file-exists-p (concat ispell-library-directory "/"
                                            name ".has"))
                     (and load-dict
!                         (or (file-exists-p (concat ispell-library-directory 
"/"
                                                     load-dict ".hash"))
!                             (file-exists-p (concat ispell-library-directory 
"/"
                                                     load-dict ".has"))))))
            (setq menu (append menu
                               (list



reply via email to

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