Mercurial > emacs
changeset 112389:75fb060ecbc3
Don't mess with *temp*.
* lisp/obsolete/spell.el: Move from textmodes/spell.el.
(spell-string):
* lisp/term.el (term-read-input-ring):
* lisp/startup.el (display-startup-echo-area-message):
* lisp/progmodes/antlr-mode.el (antlr-directory-dependencies):
* lisp/gnus/message.el (message-mailer-swallows-blank-line):
* lisp/comint.el (comint-read-input-ring): Use with-temp-buffer.
* lisp/international/mule.el (ctext-pre-write-conversion):
Don't hardcode point-min==1.
* lisp/gnus/mm-util.el (mm-find-buffer-file-coding-system): Don't forget to
kill the temp buffer.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Thu, 20 Jan 2011 17:36:12 -0500 |
parents | e5e8faa33346 |
children | 1b25cd6a6e36 |
files | lisp/ChangeLog lisp/comint.el lisp/gnus/ChangeLog lisp/gnus/message.el lisp/gnus/mm-util.el lisp/international/mule.el lisp/obsolete/spell.el lisp/progmodes/antlr-mode.el lisp/startup.el lisp/term.el lisp/textmodes/spell.el src/ChangeLog |
diffstat | 12 files changed, 303 insertions(+), 304 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Thu Jan 20 16:57:15 2011 -0500 +++ b/lisp/ChangeLog Thu Jan 20 17:36:12 2011 -0500 @@ -1,3 +1,16 @@ +2011-01-20 Stefan Monnier <monnier@iro.umontreal.ca> + + Don't mess with *temp*. + * obsolete/spell.el: Move from textmodes/spell.el. + (spell-string): + * term.el (term-read-input-ring): + * startup.el (display-startup-echo-area-message): + * progmodes/antlr-mode.el (antlr-directory-dependencies): + * comint.el (comint-read-input-ring): Use with-temp-buffer. + * international/mule.el (ctext-pre-write-conversion): Don't hardcode + point-min==1. + + 2011-01-20 Ken Manheimer <ken.manheimer@gmail.com> * allout.el: Summary - migrate to defining allout mode using @@ -8,8 +21,8 @@ allout-mode-map is now a keymap by virtue of being a defalias to allout-mode-map-value, which contains the actual keymap structure. - (allout-mode): Use define-minor-mode rather than defun. Remove - now-unnecessary minor-mode setup activities from the body. + (allout-mode): Use define-minor-mode rather than defun. + Remove now-unnecessary minor-mode setup activities from the body. Specify :keymap as allout-mode-map so the minor-mode-map-alist entry will be '(allout-mode . allout-mode-map) - see allout-mode-map-value, below. Adjust docstring to track changes. @@ -19,7 +32,7 @@ keymap is allout-mode-map-value, via defalias. (allout-mode-map-value): The variable holding the actual mode keymap structure, by virtue of defalias from allout-mode-map. - (allout-compose-and-institute-keymap): Renamed from + (allout-compose-and-institute-keymap): Rename from allout-bind-keys, and including the binding-composition functionality of the former produce-allout-mode-map and allout-setup-mode-map. @@ -27,14 +40,14 @@ allout-setup-mode-map. Reassign allout-mode-map-value value and update the defalias. (allout-command-prefix) (allout-prefixed-keybindings) - (allout-unprefixed-keybindings): Use - allout-compose-and-institute-keymap to process the bindings. + (allout-unprefixed-keybindings): + Use allout-compose-and-institute-keymap to process the bindings. (allout-unprefixed-keybindings): Remove extraneous '?' question marks. (allout-prefixed-keybindings): Elide binding to (prefixed) \C-h - - user can customize if they want to use that binding. Bind - allout-copy-topic-as-kill to (prefixed) \M-k. Bind - allout-up-current-level to (prefixed) \C-u. (I think i mistakenly + user can customize if they want to use that binding. + Bind allout-copy-topic-as-kill to (prefixed) \M-k. + Bind allout-up-current-level to (prefixed) \C-u. (I think i mistakenly elided that, previously, instead of the one for \C-h.) (allout-hotspot-key-handler): Remove attempt to resolve the key through the literal key-string lookup on allout-keybindings-list.
--- a/lisp/comint.el Thu Jan 20 16:57:15 2011 -0500 +++ b/lisp/comint.el Thu Jan 20 17:36:12 2011 -0500 @@ -918,41 +918,36 @@ (message "Cannot read history file %s" comint-input-ring-file-name))) (t - (let* ((history-buf (get-buffer-create " *temp*")) - (file comint-input-ring-file-name) + (let* ((file comint-input-ring-file-name) (count 0) (size comint-input-ring-size) (ring (make-ring size))) - (unwind-protect - (with-current-buffer history-buf - (widen) - (erase-buffer) - (insert-file-contents file) - ;; Save restriction in case file is already visited... - ;; Watch for those date stamps in history files! - (goto-char (point-max)) - (let (start end history) - (while (and (< count size) - (re-search-backward comint-input-ring-separator - nil t) - (setq end (match-beginning 0))) - (setq start - (if (re-search-backward comint-input-ring-separator - nil t) - (match-end 0) - (point-min))) - (setq history (buffer-substring start end)) - (goto-char start) - (if (and (not (string-match comint-input-history-ignore - history)) - (or (null comint-input-ignoredups) - (ring-empty-p ring) - (not (string-equal (ring-ref ring 0) - history)))) - (progn - (ring-insert-at-beginning ring history) - (setq count (1+ count))))))) - (kill-buffer history-buf)) + (with-temp-buffer + (insert-file-contents file) + ;; Save restriction in case file is already visited... + ;; Watch for those date stamps in history files! + (goto-char (point-max)) + (let (start end history) + (while (and (< count size) + (re-search-backward comint-input-ring-separator + nil t) + (setq end (match-beginning 0))) + (setq start + (if (re-search-backward comint-input-ring-separator + nil t) + (match-end 0) + (point-min))) + (setq history (buffer-substring start end)) + (goto-char start) + (if (and (not (string-match comint-input-history-ignore + history)) + (or (null comint-input-ignoredups) + (ring-empty-p ring) + (not (string-equal (ring-ref ring 0) + history)))) + (progn + (ring-insert-at-beginning ring history) + (setq count (1+ count))))))) (setq comint-input-ring ring comint-input-ring-index nil)))))
--- a/lisp/gnus/ChangeLog Thu Jan 20 16:57:15 2011 -0500 +++ b/lisp/gnus/ChangeLog Thu Jan 20 17:36:12 2011 -0500 @@ -1,3 +1,9 @@ +2011-01-20 Stefan Monnier <monnier@iro.umontreal.ca> + + * mm-util.el (mm-find-buffer-file-coding-system): Don't forget to kill + the temp buffer. + * message.el (message-mailer-swallows-blank-line): Use with-temp-buffer. + 2011-01-19 Katsumi Yamaoka <yamaoka@jpl.org> * gnus-art.el (gnus-article-highlight): Remove argument passed to @@ -22,8 +28,8 @@ 2011-01-13 Chong Yidong <cyd@stupidchicken.com> - * message.el (message-tool-bar-gnome): Tweak tool-bar items. Add - :vert-only tags. + * message.el (message-tool-bar-gnome): Tweak tool-bar items. + Add :vert-only tags. (message-mail): New arg RETURN-ACTION. (message-return-action): New var. (message-bury): Use it. @@ -38,8 +44,8 @@ * nnimap.el (nnimap-convert-partial-article): Protect against zero-length body parts. - * mm-decode.el (mm-preferred-alternative-precedence): Discourage - showing empty parts. + * mm-decode.el (mm-preferred-alternative-precedence): + Discourage showing empty parts. * gnus-int.el (gnus-request-accept-article): Don't try to update marks and stuff if the backend didn't return the article number. This fixes @@ -295,8 +301,8 @@ 2010-12-13 Lars Magne Ingebrigtsen <larsi@gnus.org> - * gnus-sum.el (gnus-summary-enter-digest-group): Mention - gnus-auto-select-on-ephemeral-exit. + * gnus-sum.el (gnus-summary-enter-digest-group): + Mention gnus-auto-select-on-ephemeral-exit. * proto-stream.el (proto-stream-open-network-only): Fix the calling convention of the network-only option. @@ -535,8 +541,8 @@ (nnir-mode): Install nnir-specific hooks for updating the registry. * gnus-sum.el - (gnus-article-original-subject,gnus-newsgroup-original-name): Remove - obsolete variables. + (gnus-article-original-subject,gnus-newsgroup-original-name): + Remove obsolete variables. (gnus-summary-move-article): Remove use of obsolete variables. (gnus-summary-local-variables): Make move and delete hooks local to summary buffers. @@ -652,7 +658,7 @@ * nntp.el (nntp-open-connection): Report what the connection error is. - * proto-stream.el (open-protocol-stream): Renamed from + * proto-stream.el (open-protocol-stream): Rename from open-proto-stream. 2010-11-27 Lars Magne Ingebrigtsen <larsi@gnus.org> @@ -933,8 +939,8 @@ * shr.el (shr-parse-style): Replace \n with space in style parsing. - * shr-color.el (shr-color-hsl-to-rgb-fractions): Use - shr-color-hue-to-rgb. + * shr-color.el (shr-color-hsl-to-rgb-fractions): + Use shr-color-hue-to-rgb. (shr-color->hexadecimal): Call shr-color-hsl-to-rgb-fractions. 2010-11-23 Lars Magne Ingebrigtsen <larsi@gnus.org>
--- a/lisp/gnus/message.el Thu Jan 20 16:57:15 2011 -0500 +++ b/lisp/gnus/message.el Thu Jan 20 17:36:12 2011 -0500 @@ -1184,14 +1184,11 @@ (if (and (string-match "sparc-sun-sunos\\(\\'\\|[^5]\\)" system-configuration) (file-readable-p "/etc/sendmail.cf") - (let ((buffer (get-buffer-create " *temp*"))) - (unwind-protect - (with-current-buffer buffer - (insert-file-contents "/etc/sendmail.cf") - (goto-char (point-min)) - (let ((case-fold-search nil)) - (re-search-forward "^OR\\>" nil t))) - (kill-buffer buffer)))) + (with-temp-buffer + (insert-file-contents "/etc/sendmail.cf") + (goto-char (point-min)) + (let ((case-fold-search nil)) + (re-search-forward "^OR\\>" nil t)))) ;; According to RFC822, "The field-name must be composed of printable ;; ASCII characters (i. e., characters that have decimal values between ;; 33 and 126, except colon)", i. e., any chars except ctl chars,
--- a/lisp/gnus/mm-util.el Thu Jan 20 16:57:15 2011 -0500 +++ b/lisp/gnus/mm-util.el Thu Jan 20 17:36:12 2011 -0500 @@ -1604,7 +1604,7 @@ (insert decomp) (setq filename (file-name-sans-extension filename))) (goto-char (point-min)) - (prog1 + (unwind-protect (cond ((boundp 'set-auto-coding-function) ;; Emacs (if filename
--- a/lisp/international/mule.el Thu Jan 20 16:57:15 2011 -0500 +++ b/lisp/international/mule.el Thu Jan 20 17:36:12 2011 -0500 @@ -1611,7 +1611,7 @@ (set-buffer (generate-new-buffer " *temp")) (set-buffer-multibyte (multibyte-string-p from)) (insert from) - (setq from 1 to (point-max))) + (setq from (point-min) to (point-max))) (save-restriction (narrow-to-region from to) (goto-char from)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lisp/obsolete/spell.el Thu Jan 20 17:36:12 2011 -0500 @@ -0,0 +1,171 @@ +;;; spell.el --- spelling correction interface for Emacs + +;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +;; 2009, 2010, 2011 Free Software Foundation, Inc. + +;; Maintainer: FSF +;; Keywords: wp, unix +;; Obsolete-since: 23.1 + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. + +;;; Commentary: + +;; This mode provides an Emacs interface to the UNIX spell(1) program. +;; Entry points are `spell-buffer', `spell-word', `spell-region' and +;; `spell-string'. + +;; See also ispell.el for an interface to the ispell program. + +;;; Code: + +(defgroup spell nil + "Interface to the UNIX spell(1) program." + :prefix "spell-" + :group 'applications) + +(defcustom spell-command "spell" + "Command to run the spell program." + :type 'string + :group 'spell) + +(defcustom spell-filter nil + "Filter function to process text before passing it to spell program. +This function might remove text-processor commands. +nil means don't alter the text before checking it." + :type '(choice (const nil) function) + :group 'spell) + +;;;###autoload +(put 'spell-filter 'risky-local-variable t) + +;;;###autoload +(defun spell-buffer () + "Check spelling of every word in the buffer. +For each incorrect word, you are asked for the correct spelling +and then put into a query-replace to fix some or all occurrences. +If you do not want to change a word, just give the same word +as its \"correct\" spelling; then the query replace is skipped." + (interactive) + ;; Don't warn about spell-region being obsolete. + (with-no-warnings + (spell-region (point-min) (point-max) "buffer"))) +;;;###autoload +(make-obsolete 'spell-buffer 'ispell-buffer "23.1") + +;;;###autoload +(defun spell-word () + "Check spelling of word at or before point. +If it is not correct, ask user for the correct spelling +and `query-replace' the entire buffer to substitute it." + (interactive) + (let (beg end spell-filter) + (save-excursion + (if (not (looking-at "\\<")) + (forward-word -1)) + (setq beg (point)) + (forward-word 1) + (setq end (point))) + ;; Don't warn about spell-region being obsolete. + (with-no-warnings + (spell-region beg end (buffer-substring beg end))))) +;;;###autoload +(make-obsolete 'spell-word 'ispell-word "23.1") + +;;;###autoload +(defun spell-region (start end &optional description) + "Like `spell-buffer' but applies only to region. +Used in a program, applies from START to END. +DESCRIPTION is an optional string naming the unit being checked: +for example, \"word\"." + (interactive "r") + (let ((filter spell-filter) + (buf (get-buffer-create " *temp*"))) + (with-current-buffer buf + (widen) + (erase-buffer)) + (message "Checking spelling of %s..." (or description "region")) + (if (and (null filter) (= ?\n (char-after (1- end)))) + (if (string= "spell" spell-command) + (call-process-region start end "spell" nil buf) + (call-process-region start end shell-file-name + nil buf nil "-c" spell-command)) + (let ((oldbuf (current-buffer))) + (with-current-buffer buf + (insert-buffer-substring oldbuf start end) + (or (bolp) (insert ?\n)) + (if filter (funcall filter)) + (if (string= "spell" spell-command) + (call-process-region (point-min) (point-max) "spell" t buf) + (call-process-region (point-min) (point-max) shell-file-name + t buf nil "-c" spell-command))))) + (message "Checking spelling of %s...%s" + (or description "region") + (if (with-current-buffer buf + (> (buffer-size) 0)) + "not correct" + "correct")) + (let (word newword + (case-fold-search t) + (case-replace t)) + (while (with-current-buffer buf + (> (buffer-size) 0)) + (with-current-buffer buf + (goto-char (point-min)) + (setq word (downcase + (buffer-substring (point) + (progn (end-of-line) (point))))) + (forward-char 1) + (delete-region (point-min) (point)) + (setq newword + (read-string (concat "`" word + "' not recognized; edit a replacement: ") + word)) + (flush-lines (concat "^" (regexp-quote word) "$"))) + (if (not (equal word newword)) + (progn + (goto-char (point-min)) + (query-replace-regexp (concat "\\b" (regexp-quote word) "\\b") + newword))))))) +;;;###autoload +(make-obsolete 'spell-region 'ispell-region "23.1") + +;;;###autoload +(defun spell-string (string) + "Check spelling of string supplied as argument." + (interactive "sSpell string: ") + (with-temp-buffer + (widen) + (erase-buffer) + (insert string "\n") + (if (string= "spell" spell-command) + (call-process-region (point-min) (point-max) "spell" + t t) + (call-process-region (point-min) (point-max) shell-file-name + t t nil "-c" spell-command)) + (if (= 0 (buffer-size)) + (message "%s is correct" string) + (goto-char (point-min)) + (while (search-forward "\n" nil t) + (replace-match " ")) + (message "%sincorrect" (buffer-substring 1 (point-max)))))) +;;;###autoload +(make-obsolete 'spell-string "The `spell' package is obsolete - use `ispell'." + "23.1") + +(provide 'spell) + +;;; spell.el ends here
--- a/lisp/progmodes/antlr-mode.el Thu Jan 20 16:57:15 2011 -0500 +++ b/lisp/progmodes/antlr-mode.el Thu Jan 20 17:36:12 2011 -0500 @@ -2182,36 +2182,32 @@ export vocabulary specified in that file." (let ((grammar (directory-files dirname t "\\.g\\'"))) (when grammar - (let ((temp-buffer (get-buffer-create - (generate-new-buffer-name " *temp*"))) - (antlr-imenu-name nil) ; dynamic-let: no imenu - (expanded-regexp (concat (format (regexp-quote - (cadr antlr-special-file-formats)) - ".+") - "\\'")) + (let ((antlr-imenu-name nil) ; dynamic-let: no imenu + (expanded-regexp + (concat (format (regexp-quote + (cadr antlr-special-file-formats)) + ".+") + "\\'")) classes dependencies) - (unwind-protect - (with-current-buffer temp-buffer - (widen) ; just in case... - (dolist (file grammar) - (when (and (file-regular-p file) - (null (string-match expanded-regexp file))) - (insert-file-contents file t nil nil t) - (normal-mode t) ; necessary for major-mode, syntax + (with-temp-buffer + (dolist (file grammar) + (when (and (file-regular-p file) + (null (string-match expanded-regexp file))) + (insert-file-contents file t nil nil t) + (normal-mode t) ; necessary for major-mode, syntax ; table and `antlr-language' - (when (derived-mode-p 'antlr-mode) - (let* ((file-deps (antlr-file-dependencies)) - (file (car file-deps))) - (when file-deps - (dolist (class-def (caadr file-deps)) - (let ((file-evocab (cons file (cdr class-def))) - (class-spec (assoc (car class-def) classes))) - (if class-spec - (nconc (cdr class-spec) (list file-evocab)) - (push (list (car class-def) file-evocab) - classes)))) - (push file-deps dependencies))))))) - (kill-buffer temp-buffer)) + (when (derived-mode-p 'antlr-mode) + (let* ((file-deps (antlr-file-dependencies)) + (file (car file-deps))) + (when file-deps + (dolist (class-def (caadr file-deps)) + (let ((file-evocab (cons file (cdr class-def))) + (class-spec (assoc (car class-def) classes))) + (if class-spec + (nconc (cdr class-spec) (list file-evocab)) + (push (list (car class-def) file-evocab) + classes)))) + (push file-deps dependencies))))))) (cons (nreverse classes) (nreverse dependencies))))))
--- a/lisp/startup.el Thu Jan 20 16:57:15 2011 -0500 +++ b/lisp/startup.el Thu Jan 20 17:36:12 2011 -0500 @@ -2017,7 +2017,7 @@ (defun display-startup-echo-area-message () (let ((resize-mini-windows t)) - (or noninteractive ;(input-pending-p) init-file-had-error + (or noninteractive ;(input-pending-p) init-file-had-error ;; t if the init file says to inhibit the echo area startup message. (and inhibit-startup-echo-area-message user-init-file @@ -2027,24 +2027,21 @@ (user-login-name) init-file-user))) ;; Wasn't set with custom; see if .emacs has a setq. - (let ((buffer (get-buffer-create " *temp*"))) - (prog1 - (condition-case nil - (with-current-buffer buffer - (insert-file-contents user-init-file) - (re-search-forward - (concat - "([ \t\n]*setq[ \t\n]+" - "inhibit-startup-echo-area-message[ \t\n]+" - (regexp-quote - (prin1-to-string - (if (equal init-file-user "") - (user-login-name) - init-file-user))) - "[ \t\n]*)") - nil t)) - (error nil)) - (kill-buffer buffer))))) + (condition-case nil + (with-temp-buffer + (insert-file-contents user-init-file) + (re-search-forward + (concat + "([ \t\n]*setq[ \t\n]+" + "inhibit-startup-echo-area-message[ \t\n]+" + (regexp-quote + (prin1-to-string + (if (equal init-file-user "") + (user-login-name) + init-file-user))) + "[ \t\n]*)") + nil t)) + (error nil)))) (message "%s" (startup-echo-area-message))))) (defun display-startup-screen (&optional concise)
--- a/lisp/term.el Thu Jan 20 16:57:15 2011 -0500 +++ b/lisp/term.el Thu Jan 20 17:36:12 2011 -0500 @@ -1537,29 +1537,24 @@ (message "Cannot read history file %s" term-input-ring-file-name))) (t - (let ((history-buf (get-buffer-create " *temp*")) - (file term-input-ring-file-name) + (let ((file term-input-ring-file-name) (count 0) (ring (make-ring term-input-ring-size))) - (unwind-protect - (with-current-buffer history-buf - (widen) - (erase-buffer) - (insert-file-contents file) - ;; Save restriction in case file is already visited... - ;; Watch for those date stamps in history files! - (goto-char (point-max)) - (while (and (< count term-input-ring-size) - (re-search-backward "^[ \t]*\\([^#\n].*\\)[ \t]*$" - nil t)) - (let ((history (buffer-substring (match-beginning 1) - (match-end 1)))) - (when (or (null term-input-ignoredups) - (ring-empty-p ring) - (not (string-equal (ring-ref ring 0) history))) - (ring-insert-at-beginning ring history))) - (setq count (1+ count)))) - (kill-buffer history-buf)) + (with-temp-buffer + (insert-file-contents file) + ;; Save restriction in case file is already visited... + ;; Watch for those date stamps in history files! + (goto-char (point-max)) + (while (and (< count term-input-ring-size) + (re-search-backward "^[ \t]*\\([^#\n].*\\)[ \t]*$" + nil t)) + (let ((history (buffer-substring (match-beginning 1) + (match-end 1)))) + (when (or (null term-input-ignoredups) + (ring-empty-p ring) + (not (string-equal (ring-ref ring 0) history))) + (ring-insert-at-beginning ring history))) + (setq count (1+ count)))) (setq term-input-ring ring term-input-ring-index nil)))))
--- a/lisp/textmodes/spell.el Thu Jan 20 16:57:15 2011 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,171 +0,0 @@ -;;; spell.el --- spelling correction interface for Emacs - -;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, -;; 2009, 2010, 2011 Free Software Foundation, Inc. - -;; Maintainer: FSF -;; Keywords: wp, unix - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;; This mode provides an Emacs interface to the UNIX spell(1) program. -;; Entry points are `spell-buffer', `spell-word', `spell-region' and -;; `spell-string'. - -;; See also ispell.el for an interface to the ispell program. - -;;; Code: - -(defgroup spell nil - "Interface to the UNIX spell(1) program." - :prefix "spell-" - :group 'applications) - -(defcustom spell-command "spell" - "Command to run the spell program." - :type 'string - :group 'spell) - -(defcustom spell-filter nil - "Filter function to process text before passing it to spell program. -This function might remove text-processor commands. -nil means don't alter the text before checking it." - :type '(choice (const nil) function) - :group 'spell) - -;;;###autoload -(put 'spell-filter 'risky-local-variable t) - -;;;###autoload -(defun spell-buffer () - "Check spelling of every word in the buffer. -For each incorrect word, you are asked for the correct spelling -and then put into a query-replace to fix some or all occurrences. -If you do not want to change a word, just give the same word -as its \"correct\" spelling; then the query replace is skipped." - (interactive) - ;; Don't warn about spell-region being obsolete. - (with-no-warnings - (spell-region (point-min) (point-max) "buffer"))) -;;;###autoload -(make-obsolete 'spell-buffer 'ispell-buffer "23.1") - -;;;###autoload -(defun spell-word () - "Check spelling of word at or before point. -If it is not correct, ask user for the correct spelling -and `query-replace' the entire buffer to substitute it." - (interactive) - (let (beg end spell-filter) - (save-excursion - (if (not (looking-at "\\<")) - (forward-word -1)) - (setq beg (point)) - (forward-word 1) - (setq end (point))) - ;; Don't warn about spell-region being obsolete. - (with-no-warnings - (spell-region beg end (buffer-substring beg end))))) -;;;###autoload -(make-obsolete 'spell-word 'ispell-word "23.1") - -;;;###autoload -(defun spell-region (start end &optional description) - "Like `spell-buffer' but applies only to region. -Used in a program, applies from START to END. -DESCRIPTION is an optional string naming the unit being checked: -for example, \"word\"." - (interactive "r") - (let ((filter spell-filter) - (buf (get-buffer-create " *temp*"))) - (with-current-buffer buf - (widen) - (erase-buffer)) - (message "Checking spelling of %s..." (or description "region")) - (if (and (null filter) (= ?\n (char-after (1- end)))) - (if (string= "spell" spell-command) - (call-process-region start end "spell" nil buf) - (call-process-region start end shell-file-name - nil buf nil "-c" spell-command)) - (let ((oldbuf (current-buffer))) - (with-current-buffer buf - (insert-buffer-substring oldbuf start end) - (or (bolp) (insert ?\n)) - (if filter (funcall filter)) - (if (string= "spell" spell-command) - (call-process-region (point-min) (point-max) "spell" t buf) - (call-process-region (point-min) (point-max) shell-file-name - t buf nil "-c" spell-command))))) - (message "Checking spelling of %s...%s" - (or description "region") - (if (with-current-buffer buf - (> (buffer-size) 0)) - "not correct" - "correct")) - (let (word newword - (case-fold-search t) - (case-replace t)) - (while (with-current-buffer buf - (> (buffer-size) 0)) - (with-current-buffer buf - (goto-char (point-min)) - (setq word (downcase - (buffer-substring (point) - (progn (end-of-line) (point))))) - (forward-char 1) - (delete-region (point-min) (point)) - (setq newword - (read-string (concat "`" word - "' not recognized; edit a replacement: ") - word)) - (flush-lines (concat "^" (regexp-quote word) "$"))) - (if (not (equal word newword)) - (progn - (goto-char (point-min)) - (query-replace-regexp (concat "\\b" (regexp-quote word) "\\b") - newword))))))) -;;;###autoload -(make-obsolete 'spell-region 'ispell-region "23.1") - -;;;###autoload -(defun spell-string (string) - "Check spelling of string supplied as argument." - (interactive "sSpell string: ") - (let ((buf (get-buffer-create " *temp*"))) - (with-current-buffer buf - (widen) - (erase-buffer) - (insert string "\n") - (if (string= "spell" spell-command) - (call-process-region (point-min) (point-max) "spell" - t t) - (call-process-region (point-min) (point-max) shell-file-name - t t nil "-c" spell-command)) - (if (= 0 (buffer-size)) - (message "%s is correct" string) - (goto-char (point-min)) - (while (search-forward "\n" nil t) - (replace-match " ")) - (message "%sincorrect" (buffer-substring 1 (point-max))))))) -;;;###autoload -(make-obsolete 'spell-string "The `spell' package is obsolete - use `ispell'." - "23.1") - -(provide 'spell) - -;;; spell.el ends here
--- a/src/ChangeLog Thu Jan 20 16:57:15 2011 -0500 +++ b/src/ChangeLog Thu Jan 20 17:36:12 2011 -0500 @@ -667,9 +667,9 @@ 2011-01-11 Tassilo Horn <tassilo@member.fsf.org> - * image.c (imagemagick_load_image, Finit_image_library): Free - intermediate image after creating a MagickWand from it. Terminate - MagickWand environment after image loading. + * image.c (imagemagick_load_image, Finit_image_library): + Free intermediate image after creating a MagickWand from it. + Terminate MagickWand environment after image loading. 2011-01-10 Michael Albinus <michael.albinus@gmx.de> @@ -740,7 +740,7 @@ 2011-01-04 Jan Moringen <jan.moringen@uni-bielefeld.de> - * dbusbind.c (Fdbus_register_method): Added optional parameter + * dbusbind.c (Fdbus_register_method): Add optional parameter dont_register_service. Updated docstring accordingly. 2011-01-04 Glenn Morris <rgm@gnu.org>