all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: michael.cadilhac@lrde.org (Michaël Cadilhac)
Subject: Re: Ispell loads dict twice.
Date: Tue, 23 May 2006 20:26:19 +0200	[thread overview]
Message-ID: <87fyj0r41g.fsf@lrde.org> (raw)
In-Reply-To: <87k69eyddj.fsf@lrde.org> (Michaël Cadilhac's message of "Mon, 24 Apr 2006 21:36:40 +0200")


[-- Attachment #1.1.1: Type: text/plain, Size: 1997 bytes --]

michael.cadilhac@lrde.org (Michaël Cadilhac) writes:

>   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 « english » dictionary will be loaded twice: on the
>   « ispell-buffer » and on the latest « ispell-change-dictionary ».
>
>   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
>     (« english ») not being equal to default one (« francais »), 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.

  Well,  this  bug  is  still  triggered in  some  cases,  but  before
  I investigate, I was  wondering why ispell-kill-process took so much
  time to execute.

  This function does the following:
  - Send EOF to ispell,
  - Read its output if there is, timeout to 1 sec,
  - Kill the process if it's still not,
  - Wait for it to be really killed (sleeping for 0.25 sec between checks).

  I don't want to be ... rude, I'm really a pacifist actually, but why
  not just delete-process it ?

  I often have some flyspellized buffers in English and some others in
  French, the time I have to wait on every C-x o is kind of
  disturbing...

  I propose the following change:
  

[-- Attachment #1.1.2: ispell.patch --]
[-- Type: text/x-patch, Size: 1960 bytes --]

Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.9586
diff -c -B -b -r1.9586 ChangeLog
*** lisp/ChangeLog	23 May 2006 11:23:25 -0000	1.9586
--- lisp/ChangeLog	23 May 2006 18:17:41 -0000
***************
*** 1,3 ****
--- 1,9 ----
+ 2006-05-23  Michaël Cadilhac  <michael.cadilhac@lrde.org>
+ 
+ 	* textmodes/ispell.el (ispell-kill-ispell): If ispell has been
+ 	launched asynchronously, delete its process instead of being
+ 	cool.
+ 
  2006-05-23  Thien-Thi Nguyen  <ttn@gnu.org>
  
  	* emacs-lisp/ewoc.el (ewoc-delete): New function.
Index: lisp/textmodes/ispell.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/textmodes/ispell.el,v
retrieving revision 1.199
diff -c -B -b -r1.199 ispell.el
*** lisp/textmodes/ispell.el	21 May 2006 20:25:43 -0000	1.199
--- lisp/textmodes/ispell.el	23 May 2006 18:17:41 -0000
***************
*** 2572,2586 ****
        (or no-error
  	  (error "There is no ispell process running!"))
      (if ispell-async-processp
! 	(progn
! 	  (process-send-eof ispell-process)
! 	  (if (eq (ispell-process-status) 'run)
! 	      (ispell-accept-output 1))
! 	  (if (eq (ispell-process-status) 'run)
! 	      (kill-process ispell-process))
! 	  (while (not (or (eq (ispell-process-status) 'exit)
! 			  (eq (ispell-process-status) 'signal)))
! 	    (sleep-for 0.25)))
        ;; synchronous processes
        (ispell-send-string "\n")		; make sure side effects occurred.
        (kill-buffer ispell-output-buffer)
--- 2572,2578 ----
        (or no-error
  	  (error "There is no ispell process running!"))
      (if ispell-async-processp
! 	(delete-process ispell-process)
        ;; synchronous processes
        (ispell-send-string "\n")		; make sure side effects occurred.
        (kill-buffer ispell-output-buffer)

[-- Attachment #1.1.3: Type: text/plain, Size: 325 bytes --]



-- 
 |      Michaël `Micha' Cadilhac   |   Un certain Blaise Pascal             |
 |         Epita/LRDE Promo 2007   |     etc... etc...                      |
 | http://www.lrde.org/~cadilh_m   |   -- Prévert (Les paris stupides)      |
 `--  -   JID: micha@amessage.be --'                                   -  --'

[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

  parent reply	other threads:[~2006-05-23 18:26 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-24 19:36 Ispell loads dict twice Michaël Cadilhac
2006-04-26 10:14 ` Agustin Martin
2006-04-26 21:58   ` Michaël Cadilhac
2006-05-23 18:26 ` Michaël Cadilhac [this message]
2006-05-24 11:28   ` Agustin Martin
2006-05-25 10:57     ` delete-process bug (was: Ispell loads dict twice.) Michaël Cadilhac
2006-05-25 12:19       ` Agustin Martin
2006-05-25 14:55       ` delete-process bug Stefan Monnier
2006-05-25 14:59         ` David Kastrup
2006-05-25 15:17         ` Michaël Cadilhac
2006-05-25 15:26           ` David Kastrup
2006-05-25 19:40           ` Stefan Monnier
2006-05-25 23:51         ` Kim F. Storm
2006-05-26  4:49           ` Richard Stallman
2006-05-26 13:03           ` Stefan Monnier
2006-05-26  2:22         ` Richard Stallman
2006-05-26 11:29           ` Michaël Cadilhac
2006-05-27  3:36             ` Richard Stallman
2006-05-26 13:10           ` Stefan Monnier
2006-05-26 17:27             ` Michael Mauger
2006-05-27  9:19               ` Michaël Cadilhac
2006-05-27 14:16                 ` Stefan Monnier
2006-05-27 14:29                   ` Michaël Cadilhac
2006-05-28 16:01                     ` Michaël Cadilhac
2006-05-28 18:00                       ` Stefan Monnier
2006-05-28 18:32                         ` Michaël Cadilhac
2006-05-28 19:48                           ` Stefan Monnier
2006-05-28 20:26                             ` Michaël Cadilhac
2006-05-28 21:15                               ` Kim F. Storm
2006-05-28 21:36                                 ` Michaël Cadilhac
2006-05-28 23:54                                   ` Stefan Monnier
2006-05-29 11:39                                     ` Michaël Cadilhac
2006-05-29  8:22                                   ` Kim F. Storm
2006-05-29  8:50                                     ` David Kastrup
2006-05-29 19:04                                       ` Eli Zaretskii
2006-05-29 19:27                                     ` Eli Zaretskii
2006-05-29 21:42                                       ` Kim F. Storm
2006-05-29 22:08                                         ` Eli Zaretskii
2006-05-29  3:32                                 ` Eli Zaretskii
2006-05-29  8:14                                   ` Kim F. Storm
2006-05-29 10:59                                     ` Michaël Cadilhac
2006-05-29 19:25                                     ` Eli Zaretskii
2006-05-29 20:04                                       ` Michaël Cadilhac
2006-05-29 21:24                                         ` Eli Zaretskii
2006-05-29 21:42                                           ` Michaël Cadilhac
2006-05-29 22:11                                             ` Eli Zaretskii
2006-05-29 22:32                                               ` Michaël Cadilhac
2006-05-30 12:11                                         ` Kim F. Storm
2006-05-30 12:42                                           ` Michaël Cadilhac
2006-05-30 14:26                                             ` Kim F. Storm
2006-05-30 15:13                                               ` Michaël Cadilhac
2006-06-01 14:06                                                 ` Kim F. Storm
2006-06-01 14:20                                                   ` Michaël Cadilhac
2006-06-01 14:29                                                     ` Kim F. Storm
2006-06-01 16:05                                                       ` Michaël Cadilhac
2006-06-02  7:46                                                         ` Kim F. Storm
2006-06-01 16:41                                                     ` Agustin Martin
2006-06-01 16:55                                                       ` Michaël Cadilhac
2006-05-29 23:07                               ` Agustin Martin
2006-05-25 23:52       ` delete-process bug (was: Ispell loads dict twice.) Kim F. Storm
2006-06-06 20:45   ` Ispell loads dict twice Michaël Cadilhac
2006-06-09 13:02     ` Kim F. Storm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fyj0r41g.fsf@lrde.org \
    --to=michael.cadilhac@lrde.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.