+2012-05-30 Agustín Martín Domingo <agustin.martin@hispalinux.es>
+
+ * textmodes/ispell.el (ispell-with-no-warnings):
+ Define as a macro.
+ (ispell-kill-ispell, ispell-change-dictionary): Use
+ `called-interactively-p' for Emacs instead of obsolete
+ `interactive-p'.
+
2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/byte-run.el (defmacro, defun): Move from C.
(declare-function ispell-check-minver "ispell" (v1 v2))
(declare-function ispell-looking-back "ispell"
(regexp &optional limit &rest ignored))
-(declare-function ispell-with-no-warnings (&rest body))
(if (fboundp 'version<=)
(defalias 'ispell-check-minver 'version<=)
(save-excursion
(re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t))))
-;;; XEmacs21 does not have `with-no-warnings'
-
-(if (fboundp 'with-no-warnings)
- (defalias 'ispell-with-no-warnings 'with-no-warnings)
- (defun ispell-with-no-warnings (&rest body)
- "Like `progn', but prevents compiler warnings in the body."
- ;; Taken from Emacs' byte-run.el
- ;; The implementation for the interpreter is basically trivial.
- (car (last body))))
+;;; XEmacs21 does not have `with-no-warnings'. Taken from org mode.
+(defmacro ispell-with-no-warnings (&rest body)
+ (cons (if (fboundp 'with-no-warnings) 'with-no-warnings 'progn) body))
;;; Code:
;; This hook is typically used by flyspell to flush some variables used
;; to optimize the common cases.
(run-hooks 'ispell-kill-ispell-hook)
- (if (or clear (interactive-p))
+ (if (or clear
+ (if (featurep 'xemacs)
+ (interactive-p)
+ (called-interactively-p 'interactive)))
(setq ispell-buffer-session-localwords nil))
(if (not (and ispell-process
(eq (ispell-process-status) 'run)))
;; Specified dictionary is the default already. Could reload
;; the dictionaries if needed.
(ispell-internal-change-dictionary)
- (and (interactive-p)
+ (and (if (featurep 'xemacs)
+ (interactive-p)
+ (called-interactively-p 'interactive))
(message "No change, using %s dictionary" dict)))
(t ; reset dictionary!
(if (or (assoc dict ispell-local-dictionary-alist)
(cond
((functionp 'sc-cite-regexp) ; sc 3.0
(ispell-with-no-warnings
- (concat "\\(" (sc-cite-regexp) "\\)" "\\|"
- (ispell-non-empty-string sc-reference-tag-string))))
+ (concat "\\(" (sc-cite-regexp) "\\)" "\\|"
+ (ispell-non-empty-string sc-reference-tag-string))))
((boundp 'sc-cite-regexp) ; sc 2.3
(concat "\\(" sc-cite-regexp "\\)" "\\|"
(ispell-with-no-warnings