diff options
| author | Agustín Martín | 2012-05-30 18:14:37 +0200 |
|---|---|---|
| committer | Agustín Martín | 2012-05-30 18:14:37 +0200 |
| commit | 6e8a178669e918fb40a0cffce00757b2caae973d (patch) | |
| tree | cfea5ab2cf88bfd83b8cb70d4f482b79e4fd1a41 /lisp | |
| parent | baac5bc76d4ac3d2bf73c20d085d36e062bb19cb (diff) | |
| download | emacs-6e8a178669e918fb40a0cffce00757b2caae973d.tar.gz emacs-6e8a178669e918fb40a0cffce00757b2caae973d.zip | |
ispell.el: Define `ispell-with-no-warnings' as a macro. Deal with obsolete `interactive-p'
* Current `ispell-with-no-warnings' definition does not avoid warnings.
Use a macro definition taken from orgmode.
* Deal with a couple of occurrences of obsolete `interactive-p'.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/textmodes/ispell.el | 26 |
2 files changed, 20 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ccd4de5f754..62405960593 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2012-05-30 Agustín Martín Domingo <agustin.martin@hispalinux.es> | ||
| 2 | |||
| 3 | * textmodes/ispell.el (ispell-with-no-warnings): | ||
| 4 | Define as a macro. | ||
| 5 | (ispell-kill-ispell, ispell-change-dictionary): Use | ||
| 6 | `called-interactively-p' for Emacs instead of obsolete | ||
| 7 | `interactive-p'. | ||
| 8 | |||
| 1 | 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca> | 9 | 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 10 | ||
| 3 | * emacs-lisp/byte-run.el (defmacro, defun): Move from C. | 11 | * emacs-lisp/byte-run.el (defmacro, defun): Move from C. |
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 1d45a7059c1..197f7b6f92f 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el | |||
| @@ -203,7 +203,6 @@ | |||
| 203 | (declare-function ispell-check-minver "ispell" (v1 v2)) | 203 | (declare-function ispell-check-minver "ispell" (v1 v2)) |
| 204 | (declare-function ispell-looking-back "ispell" | 204 | (declare-function ispell-looking-back "ispell" |
| 205 | (regexp &optional limit &rest ignored)) | 205 | (regexp &optional limit &rest ignored)) |
| 206 | (declare-function ispell-with-no-warnings (&rest body)) | ||
| 207 | 206 | ||
| 208 | (if (fboundp 'version<=) | 207 | (if (fboundp 'version<=) |
| 209 | (defalias 'ispell-check-minver 'version<=) | 208 | (defalias 'ispell-check-minver 'version<=) |
| @@ -255,15 +254,9 @@ full featured `looking-back' function is missing." | |||
| 255 | (save-excursion | 254 | (save-excursion |
| 256 | (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t)))) | 255 | (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t)))) |
| 257 | 256 | ||
| 258 | ;;; XEmacs21 does not have `with-no-warnings' | 257 | ;;; XEmacs21 does not have `with-no-warnings'. Taken from org mode. |
| 259 | 258 | (defmacro ispell-with-no-warnings (&rest body) | |
| 260 | (if (fboundp 'with-no-warnings) | 259 | (cons (if (fboundp 'with-no-warnings) 'with-no-warnings 'progn) body)) |
| 261 | (defalias 'ispell-with-no-warnings 'with-no-warnings) | ||
| 262 | (defun ispell-with-no-warnings (&rest body) | ||
| 263 | "Like `progn', but prevents compiler warnings in the body." | ||
| 264 | ;; Taken from Emacs' byte-run.el | ||
| 265 | ;; The implementation for the interpreter is basically trivial. | ||
| 266 | (car (last body)))) | ||
| 267 | 260 | ||
| 268 | ;;; Code: | 261 | ;;; Code: |
| 269 | 262 | ||
| @@ -2804,7 +2797,10 @@ With CLEAR, buffer session localwords are cleaned." | |||
| 2804 | ;; This hook is typically used by flyspell to flush some variables used | 2797 | ;; This hook is typically used by flyspell to flush some variables used |
| 2805 | ;; to optimize the common cases. | 2798 | ;; to optimize the common cases. |
| 2806 | (run-hooks 'ispell-kill-ispell-hook) | 2799 | (run-hooks 'ispell-kill-ispell-hook) |
| 2807 | (if (or clear (interactive-p)) | 2800 | (if (or clear |
| 2801 | (if (featurep 'xemacs) | ||
| 2802 | (interactive-p) | ||
| 2803 | (called-interactively-p 'interactive))) | ||
| 2808 | (setq ispell-buffer-session-localwords nil)) | 2804 | (setq ispell-buffer-session-localwords nil)) |
| 2809 | (if (not (and ispell-process | 2805 | (if (not (and ispell-process |
| 2810 | (eq (ispell-process-status) 'run))) | 2806 | (eq (ispell-process-status) 'run))) |
| @@ -2853,7 +2849,9 @@ By just answering RET you can find out what the current dictionary is." | |||
| 2853 | ;; Specified dictionary is the default already. Could reload | 2849 | ;; Specified dictionary is the default already. Could reload |
| 2854 | ;; the dictionaries if needed. | 2850 | ;; the dictionaries if needed. |
| 2855 | (ispell-internal-change-dictionary) | 2851 | (ispell-internal-change-dictionary) |
| 2856 | (and (interactive-p) | 2852 | (and (if (featurep 'xemacs) |
| 2853 | (interactive-p) | ||
| 2854 | (called-interactively-p 'interactive)) | ||
| 2857 | (message "No change, using %s dictionary" dict))) | 2855 | (message "No change, using %s dictionary" dict))) |
| 2858 | (t ; reset dictionary! | 2856 | (t ; reset dictionary! |
| 2859 | (if (or (assoc dict ispell-local-dictionary-alist) | 2857 | (if (or (assoc dict ispell-local-dictionary-alist) |
| @@ -3725,8 +3723,8 @@ You can bind this to the key C-c i in GNUS or mail by adding to | |||
| 3725 | (cond | 3723 | (cond |
| 3726 | ((functionp 'sc-cite-regexp) ; sc 3.0 | 3724 | ((functionp 'sc-cite-regexp) ; sc 3.0 |
| 3727 | (ispell-with-no-warnings | 3725 | (ispell-with-no-warnings |
| 3728 | (concat "\\(" (sc-cite-regexp) "\\)" "\\|" | 3726 | (concat "\\(" (sc-cite-regexp) "\\)" "\\|" |
| 3729 | (ispell-non-empty-string sc-reference-tag-string)))) | 3727 | (ispell-non-empty-string sc-reference-tag-string)))) |
| 3730 | ((boundp 'sc-cite-regexp) ; sc 2.3 | 3728 | ((boundp 'sc-cite-regexp) ; sc 2.3 |
| 3731 | (concat "\\(" sc-cite-regexp "\\)" "\\|" | 3729 | (concat "\\(" sc-cite-regexp "\\)" "\\|" |
| 3732 | (ispell-with-no-warnings | 3730 | (ispell-with-no-warnings |