From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: michael.cadilhac@lrde.org (=?iso-8859-1?Q?Micha=EBl?= Cadilhac) Newsgroups: gmane.emacs.devel Subject: Ispell loads dict twice. Date: Mon, 24 Apr 2006 21:36:40 +0200 Organization: Epita/LRDE Message-ID: <87k69eyddj.fsf@lrde.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1266328754==" X-Trace: sea.gmane.org 1145907428 22250 80.91.229.2 (24 Apr 2006 19:37:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 24 Apr 2006 19:37:08 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 24 21:37:03 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FY6rO-0003Im-JV for ged-emacs-devel@m.gmane.org; Mon, 24 Apr 2006 21:36:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FY6rN-0001zG-Ud for ged-emacs-devel@m.gmane.org; Mon, 24 Apr 2006 15:36:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FY6r9-0001yg-Kc for emacs-devel@gnu.org; Mon, 24 Apr 2006 15:36:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FY6r7-0001yT-19 for emacs-devel@gnu.org; Mon, 24 Apr 2006 15:36:22 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FY6r6-0001yQ-So for emacs-devel@gnu.org; Mon, 24 Apr 2006 15:36:20 -0400 Original-Received: from [62.39.139.2] (helo=kualalumpur.lrde.epita.fr) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FY6tP-0006ls-2i for emacs-devel@gnu.org; Mon, 24 Apr 2006 15:38:43 -0400 Original-Received: from mahaena.lrde.epita.fr ([192.168.101.66] helo=mahaena.lrde) by kualalumpur.lrde.epita.fr with esmtp (Exim 4.50) id 1FY6r3-000486-QO for emacs-devel@gnu.org; Mon, 24 Apr 2006 21:36:17 +0200 Original-To: emacs-devel@gnu.org Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEVWPh+Tai+5r5YKBAEU CQQzGAtiq7gjAAACR0lEQVQ4jW2UzW7lIAyFzVW8BzTZX5DmCZLuU2H2pMXv/ypzbK7aSh2kRCRf /HNsE0q7Sg+RQ7JFKaqtrRNAl5AIIKe6D5DBqgbmUAe5hBI1wIRFAHjeM0RKtZi7XVVEpb0BSNfA IddChChT5DildSLWOWhY5IEItMnncZgFcUAc/5jjwCMsDosRNdfKPDTFEdVBW8C+RebDb4N5Orio RhM1+11IJyx0ng2+LryFHBMPDQDYHrY6IfGuU3ouiXTQNE8LIJDKOWpNxERTFrggQwRPd7USUsTW fJ0XbR3bdj5KgBYy4SACpxDeUYEUAzLmtJ1iIrD2gczPq8Qomjhsh/RjGIgKIO8p7NITjwlx7WID nsnQe5NeuTvoBpi8LX6vLLOh5icjOHqBypgnuSp7M+RE1agbQKHQr5E2z1WObhYW4gMqeGQL7joM jCf2DxSk5ApADSYHfFF4igNfJZL1z0GKP0FN02s4XiDXr7V5P94W6I9v8MfBOQDmfwAaVYt+x8Da v4DJvX8BAdin3Knm5yMZYAO4ABDkDniZLLfi4P40gP1F0TPGZOu0CGwA1lcowxwlGy6A9705mD0V jHCxwVZT/hYdRJVUGZNlx6l7ScQBTluof6Wj6bsPYlvpwoTvXFD9gHPn2TZPF3ntI2ecxVrW5MrV XiCie5EeNa7BlWu/HNSkprDUva163PHxAv5jyGV7gVzyAghSKOTnat85UIYFICXbD2NV9rRiv0BS tKQsg6OHH4A15F1WW+UHKHHa32h6aPnAm3/pUcWp+WYnTQAAAABJRU5ErkJggg== User-Agent: Gnus/5.110005 (No Gnus v0.5) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:53350 Archived-At: --===============1266328754== Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi ! I use the latest CVS version. With the following : $ emacs -Q C-u M-x ispell-change-dictionary RET francais RET C-x b test1 RET M-x ispell-change-dictionary RET english RET M-x ispell-buffer C-x b test2 RET M-x ispell-change-dictionary RET english RET The =AB english =BB dictionary will be loaded twice: on the =AB ispell-buffer =BB and on the latest =AB ispell-change-dictionary =BB. The rest of this message is IMHO :-) What happens is the following on the second ispell-change-dictionary: - ispell-buffer-local-dict is called, - this one calls ispell-internal-change-dictionary, - ispell-local-dictionary being nil, and current dictionary (=AB english =BB) not being equal to default one (=AB francais =BB), the ispell process is killed. So it has to be restarted. The call to ispell-buffer-local-dict is mandatory (ispell-change-dictionary could be called with "" just to load default buffer's one), but it should not call ispell-internal-change-dictionary at this time. The proposed patch : - Delays this call, - Makes ispell-internal-change-dictionary checks for pdict, - Fixes the bug. =20=20 Could someone have a look and install it if needed ? --=-=-= Content-Type: text/x-patch; charset=iso-8859-1 Content-Disposition: inline; filename=ispell.patch Content-Transfer-Encoding: quoted-printable Content-Description: Patch for ispell Index: ChangeLog =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/emacs/emacs/lisp/ChangeLog,v retrieving revision 1.9435 diff -c -r1.9435 ChangeLog *** ChangeLog 23 Apr 2006 21:45:28 -0000 1.9435 =2D-- ChangeLog 24 Apr 2006 19:30:55 -0000 *************** *** 1,3 **** =2D-- 1,14 ---- + 2006-04-24 Micha=EBl Cadilhac +=20 + * textmodes/ispell.el (ispell-buffer-local-dict): Add a `no-reload' + argument to avoid the call to `ispell-internal-change-dictionary' + when not needed. + (ispell-change-dictionary): Use this argument and call + `ispell-internal-change-dictionary' after the possible change + to `ispell-local-dictionary'. + (ispell-internal-change-dictionary): Check for a change in + personal dictionary use too. +=20=09 2006-04-23 Michael Albinus =20=20 * net/tramp.el (tramp-register-file-name-handlers): New defun. Index: textmodes/ispell.el =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/emacs/emacs/lisp/textmodes/ispell.el,v retrieving revision 1.197 diff -c -r1.197 ispell.el *** textmodes/ispell.el 6 Apr 2006 19:20:37 -0000 1.197 =2D-- textmodes/ispell.el 24 Apr 2006 19:30:55 -0000 *************** *** 2607,2621 **** (mapcar 'list (ispell-valid-dictionary-list))) nil t) current-prefix-arg)) ! (unless arg (ispell-buffer-local-dict)) (if (equal dict "default") (setq dict nil)) ;; This relies on completing-read's bug of returning "" for no match (cond ((equal dict "") (message "Using %s dictionary" (or ispell-local-dictionary ispell-dictionary "default"))) ((equal dict (or ispell-local-dictionary ispell-dictionary "default")) ! ;; Specified dictionary is the default already. No-op (and (interactive-p) (message "No change, using %s dictionary" dict))) (t ; reset dictionary! =2D-- 2607,2624 ---- (mapcar 'list (ispell-valid-dictionary-list))) nil t) current-prefix-arg)) ! (unless arg (ispell-buffer-local-dict t)) (if (equal dict "default") (setq dict nil)) ;; This relies on completing-read's bug of returning "" for no match (cond ((equal dict "") + (ispell-internal-change-dictionary) (message "Using %s dictionary" (or ispell-local-dictionary ispell-dictionary "default"))) ((equal dict (or ispell-local-dictionary ispell-dictionary "default")) ! ;; Specified dictionary is the default already. Could reload ! ;; the dictionaries if needed. ! (ispell-internal-change-dictionary) (and (interactive-p) (message "No change, using %s dictionary" dict))) (t ; reset dictionary! *************** *** 2634,2646 **** dict)))) =20=20 (defun ispell-internal-change-dictionary () ! "Update the dictionary actually used by Ispell. This may kill the Ispell process; if so, a new one will be started when needed." ! (let ((dict (or ispell-local-dictionary ispell-dictionary))) ! (unless (equal ispell-current-dictionary dict) (ispell-kill-ispell t) ! (setq ispell-current-dictionary dict)))) =20=20 ;;; Spelling of comments are checked when ispell-check-comments is non-ni= l. =20=20 =2D-- 2637,2652 ---- dict)))) =20=20 (defun ispell-internal-change-dictionary () ! "Update the dictionary and the personal dictionary used by Ispell. This may kill the Ispell process; if so, a new one will be started when needed." ! (let ((dict (or ispell-local-dictionary ispell-dictionary)) ! (pdict (or ispell-local-pdict ispell-personal-dictionary))) ! (unless (and (equal ispell-current-dictionary dict) ! (equal ispell-current-personal-dictionary pdict)) (ispell-kill-ispell t) ! (setq ispell-current-dictionary dict ! ispell-current-personal-dictionary pdict)))) =20=20 ;;; Spelling of comments are checked when ispell-check-comments is non-ni= l. =20=20 *************** *** 3667,3674 **** =20=20 ;;; Can kill the current ispell process =20=20 ! (defun ispell-buffer-local-dict () "Initializes local dictionary and local personal dictionary. When a dictionary is defined in the buffer (see variable `ispell-dictionary-keyword'), it will override the local setting from \\[ispell-change-dictionary]. =2D-- 3673,3681 ---- =20=20 ;;; Can kill the current ispell process =20=20 ! (defun ispell-buffer-local-dict (&optional no-reload) "Initializes local dictionary and local personal dictionary. + If optional NO-RELOAD is non-nil, do not make any dictionary reloading. When a dictionary is defined in the buffer (see variable `ispell-dictionary-keyword'), it will override the local setting from \\[ispell-change-dictionary]. *************** *** 3695,3706 **** (if (re-search-forward " *\\([^ \"]+\\)" end t) (setq ispell-local-pdict (match-string-no-properties 1))))))) ! ;; Reload if new personal dictionary defined. ! (if (not (equal ispell-current-personal-dictionary ! (or ispell-local-pdict ispell-personal-dictionary))) ! (ispell-kill-ispell t)) ! ;; Reload if new dictionary defined. ! (ispell-internal-change-dictionary)) =20=20 =20=20 (defun ispell-buffer-local-words () =2D-- 3702,3710 ---- (if (re-search-forward " *\\([^ \"]+\\)" end t) (setq ispell-local-pdict (match-string-no-properties 1))))))) ! (unless no-reload ! ;; Reload if new dictionary (maybe the personal one) defined. ! (ispell-internal-change-dictionary))) =20=20 =20=20 (defun ispell-buffer-local-words () --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Thanks. =2D-=20 | Micha=EBl `Micha' Cadilhac | Mieux vaut se taire = | | Epita/LRDE Promo 2007 | Que de parler trop fort. = | | http://www.lrde.org/~cadilh_m | -- As de tr=E8fle = | `-- - JID: micha@amessage.be --' - -= -' --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFETSjLZYNf4qobZ7kRAga6AJ9VILmvEFRg0j94xL0tpTQjY4MKcwCfQqCn aa99L46++netcQbSSYIsYfg= =9O5s -----END PGP SIGNATURE----- --==-=-=-- --===============1266328754== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============1266328754==--