comparison lisp/textmodes/ispell.el @ 57516:3d3c9896482e

(ispell-command-loop): Use with-no-warnings. (ispell-message): Likewise. (ispell-show-choices): Don't call get-buffer-window uselessly. (ispell-init-process): Use set-process-query-on-exit-flag.
author Richard M. Stallman <rms@gnu.org>
date Sat, 16 Oct 2004 15:07:09 +0000
parents 09766a703f68
children d4af4d8d512b f3ec05478165
comparison
equal deleted inserted replaced
57515:f2c7aff145a0 57516:3d3c9896482e
1616 ;; setup the *Choices* buffer with valid data. 1616 ;; setup the *Choices* buffer with valid data.
1617 (save-excursion 1617 (save-excursion
1618 (set-buffer (get-buffer-create ispell-choices-buffer)) 1618 (set-buffer (get-buffer-create ispell-choices-buffer))
1619 (setq mode-line-format (concat "-- %b -- word: " word)) 1619 (setq mode-line-format (concat "-- %b -- word: " word))
1620 ;; XEmacs: no need for horizontal scrollbar in choices window 1620 ;; XEmacs: no need for horizontal scrollbar in choices window
1621 (and (fboundp 'set-specifier) 1621 (with-no-warnings
1622 (boundp 'horizontal-scrollbar-visible-p) 1622 (and (fboundp 'set-specifier)
1623 (set-specifier horizontal-scrollbar-visible-p nil 1623 (boundp 'horizontal-scrollbar-visible-p)
1624 (cons (current-buffer) nil))) 1624 (set-specifier horizontal-scrollbar-visible-p nil
1625 (cons (current-buffer) nil))))
1625 (erase-buffer) 1626 (erase-buffer)
1626 (if guess 1627 (if guess
1627 (progn 1628 (progn
1628 (insert "Affix rules generate and capitalize " 1629 (insert "Affix rules generate and capitalize "
1629 "this word as shown below:\n\t") 1630 "this word as shown below:\n\t")
1869 (defun ispell-show-choices (line end) 1870 (defun ispell-show-choices (line end)
1870 "Shows the choices in another buffer or frame." 1871 "Shows the choices in another buffer or frame."
1871 (if (and ispell-use-framepop-p (fboundp 'framepop-display-buffer)) 1872 (if (and ispell-use-framepop-p (fboundp 'framepop-display-buffer))
1872 (progn 1873 (progn
1873 (framepop-display-buffer (get-buffer ispell-choices-buffer)) 1874 (framepop-display-buffer (get-buffer ispell-choices-buffer))
1874 (get-buffer-window ispell-choices-buffer t) 1875 ;;; (get-buffer-window ispell-choices-buffer t)
1875 (select-window (previous-window))) ; *Choices* window 1876 (select-window (previous-window))) ; *Choices* window
1876 ;; standard selection by splitting a small buffer out of this window. 1877 ;; standard selection by splitting a small buffer out of this window.
1877 (let ((choices-window (get-buffer-window ispell-choices-buffer))) 1878 (let ((choices-window (get-buffer-window ispell-choices-buffer)))
1878 (if choices-window 1879 (if choices-window
1879 (if (= line (ispell-adjusted-window-height choices-window)) 1880 (if (= line (ispell-adjusted-window-height choices-window))
2353 (setq ispell-filter nil) ; Discard version ID line 2354 (setq ispell-filter nil) ; Discard version ID line
2354 (let ((extended-char-mode (ispell-get-extended-character-mode))) 2355 (let ((extended-char-mode (ispell-get-extended-character-mode)))
2355 (if extended-char-mode ; ~ extended character mode 2356 (if extended-char-mode ; ~ extended character mode
2356 (ispell-send-string (concat extended-char-mode "\n")))) 2357 (ispell-send-string (concat extended-char-mode "\n"))))
2357 (if ispell-async-processp 2358 (if ispell-async-processp
2358 (process-kill-without-query ispell-process)))) 2359 (set-process-query-on-exit-flag ispell-process nil))))
2359 2360
2360 ;;;###autoload 2361 ;;;###autoload
2361 (defun ispell-kill-ispell (&optional no-error) 2362 (defun ispell-kill-ispell (&optional no-error)
2362 "Kill current Ispell process (so that you may start a fresh one). 2363 "Kill current Ispell process (so that you may start a fresh one).
2363 With NO-ERROR, just return non-nil if there was no Ispell running." 2364 With NO-ERROR, just return non-nil if there was no Ispell running."
3284 " \\|\t")) 3285 " \\|\t"))
3285 (cite-regexp ;Prefix of quoted text 3286 (cite-regexp ;Prefix of quoted text
3286 (cond 3287 (cond
3287 ((functionp 'sc-cite-regexp) ; sc 3.0 3288 ((functionp 'sc-cite-regexp) ; sc 3.0
3288 (concat "\\(" (sc-cite-regexp) "\\)" "\\|" 3289 (concat "\\(" (sc-cite-regexp) "\\)" "\\|"
3289 (ispell-non-empty-string sc-reference-tag-string))) 3290 (with-no-warnings
3291 (ispell-non-empty-string sc-reference-tag-string))))
3290 ((boundp 'sc-cite-regexp) ; sc 2.3 3292 ((boundp 'sc-cite-regexp) ; sc 2.3
3291 (concat "\\(" sc-cite-regexp "\\)" "\\|" 3293 (concat "\\(" sc-cite-regexp "\\)" "\\|"
3292 (ispell-non-empty-string sc-reference-tag-string))) 3294 (with-no-warnings
3295 (ispell-non-empty-string sc-reference-tag-string))))
3293 ((or (equal major-mode 'news-reply-mode) ;GNUS 4 & below 3296 ((or (equal major-mode 'news-reply-mode) ;GNUS 4 & below
3294 (equal major-mode 'message-mode)) ;GNUS 5 3297 (equal major-mode 'message-mode)) ;GNUS 5
3295 (concat "In article <" "\\|" 3298 (concat "In article <" "\\|"
3296 "[^,;&+=\n]+ <[^,;&+=]+> writes:" "\\|" 3299 "[^,;&+=\n]+ <[^,;&+=]+> writes:" "\\|"
3297 message-cite-prefix-regexp "\\|" 3300 (with-no-warnings message-cite-prefix-regexp)
3301 "\\|"
3298 default-prefix)) 3302 default-prefix))
3299 ((equal major-mode 'mh-letter-mode) ; mh mail message 3303 ((equal major-mode 'mh-letter-mode) ; mh mail message
3300 (concat "[^,;&+=\n]+ writes:" "\\|" 3304 (concat "[^,;&+=\n]+ writes:" "\\|"
3301 (ispell-non-empty-string mh-ins-buf-prefix))) 3305 (with-no-warnings
3306 (ispell-non-empty-string mh-ins-buf-prefix))))
3302 ((not internal-messagep) ; Assume nn sent us this message. 3307 ((not internal-messagep) ; Assume nn sent us this message.
3303 (concat "In [a-zA-Z.]+ you write:" "\\|" 3308 (concat "In [a-zA-Z.]+ you write:" "\\|"
3304 "In <[^,;&+=]+> [^,;&+=]+ writes:" "\\|" 3309 "In <[^,;&+=]+> [^,;&+=]+ writes:" "\\|"
3305 " *> *")) 3310 " *> *"))
3306 ((boundp 'vm-included-text-prefix) ; VM mail message 3311 ((boundp 'vm-included-text-prefix) ; VM mail message