Re: Went to 64bit/Fc11, EXMH no longer spellchecking

Alexander Zangerl <[email protected]>
Newsgroups gmane.mail.exmh.user
Message-ID <[email protected]>
On Fri, 22 Apr 2011 13:01:22 CST, Harry G McGavran Jr writes:
>Hopefully it will save someone from spending a long searching
>for an answer.

harry, i just checked in a number of consolidation fixes and improvements
regarding your spell checking issues (also attached as patch). the brand new 
debian version 2.7.2-23 has those same fixes and should percolate to ubuntu 
in the near future.

what's changed?

i've moved the main spell checking options to the simple editor prefs
page, because that's the only program affected. it's also down to just
two items (which main choice, and iff custom, which custom program).

the choices are now: spell, ispell, custom, interactive.
interactive is new, that enables the I-Spell module for interactive 
checking/markup/correction. 

all the related doc strings were updated. the exmh-async mess was cleaned up, 
ispell and custom are now handled in the same consistent fashion.

i-spell should now work out of the box without any fiddling with 
exmh/app-defaults. there's a new menu item in sedit's more... menu for 
(re)i-spelling the whole buffer. that's greyed out if i-spell isn't enabled. 


	       I halve a spelling chequer
	       It came with my pea sea
	       It plane lee marques four my revue
	       Miss steaks aye ken knot sea
	        
J.S. Tenn, Owed to a Spell Chequer 
<URL:http://www.phys-astro.sonoma.edu/PEOPLE/faculty/tenn/SpellingChequer.html>

regards
az

-- 
+ Alexander Zangerl + DSA 42BD645D + (RSA 5B586291)
"I still think -vomit-frame-pointer needs to be a legal argument to gcc."
 -- Anthony de Boer

_______________________________________________
Exmh-users mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/exmh-users
exmh-spell.patch (text/x-diff, 13.6 KB)
diff -ub ./lib//app-defaults /usr/lib/exmh//app-defaults
--- ./lib//app-defaults	2011-04-21 17:37:45.000000000 +1000
+++ /usr/lib/exmh//app-defaults	2011-04-23 16:19:11.000000000 +1000
@@ -869,7 +869,7 @@
 *Sedit.Menubar.text.m.c_bigger:	SeditMimeEnriched bigger
 
 *Sedit.Menubar.more.text:	More...
-*Sedit.Menubar.more.m.entrylist: keep format receipt cite attach addr whom spell find  save preview alt
+*Sedit.Menubar.more.m.entrylist: keep format receipt cite attach addr whom spell ispell find  save preview alt
 *Sedit.Menubar.more.m.l_keep: Keep on send
 *Sedit.Menubar.more.m.t_keep: check
 *Sedit.Menubar.more.m.v_keep: sedit($t,keep)
@@ -926,6 +926,10 @@
 *Sedit.Menubar.more.m.c_save: SeditSave {$draft} {$t}
 *Sedit.Menubar.more.m.l_spell: Spell...
 *Sedit.Menubar.more.m.c_spell: SeditSpell {$draft} $f {$t}
+
+*Sedit.Menubar.more.m.l_ispell: I-Spell Whole Buffer
+*Sedit.Menubar.more.m.c_ispell: Ispell_CheckEntireWindow {$t}
+
 *Sedit.Menubar.more.m.l_find: Find SEL
 *Sedit.Menubar.more.m.c_find: Sedit_Find {$draft} {$t}
 *Sedit.Menubar.more.m.l_preview: Mime Preview
diff -ub ./lib//editor.tcl /usr/lib/exmh//editor.tcl
--- ./lib//editor.tcl	2011-04-21 17:37:45.000000000 +1000
+++ /usr/lib/exmh//editor.tcl	2011-04-23 13:14:25.000000000 +1000
@@ -62,9 +62,6 @@
 "If enabled, after editing with external editor, exmh will bring the message
 up in sedit.  This is so you can initially create the message with your
 favorite editor, and then pop into to sedit for richtext or attachments."] \
-    [list editor(spell) spellCmd "exmh-async xterm -e ispell" {Spell command} \
-"The spell command specifies a program used to spell-check mail messages. 
-The filename will be appended to the command."] \
         [list editor(mhn) mhnCmd "mhn" {MHN command} \
 "The mhn command specifies a program used to reformat
 a message with the MH mhn program.
diff -ub ./lib//extrasInit.tcl /usr/lib/exmh//extrasInit.tcl
--- ./lib//extrasInit.tcl	2011-04-21 17:37:45.000000000 +1000
+++ /usr/lib/exmh//extrasInit.tcl	2011-04-24 13:03:28.000000000 +1000
@@ -479,20 +479,20 @@
 "If the type of a file cannot be determined from the mime.types file
 and from the file -m program, use this as the default MIME type
 when attaching files."}
-    {sedit(spell) seditSpell {CHOICE spell ispell custom} {spell program}
-"This chooses the spell program used by the built-in editor.
-Use custom if you want to define the program explicitly."}
-    {editor(spell) spellCmd {exmh-async xterm -e ispell} {custom spell command}
-"NOTE: this affects the same internal variable as the
-Spell Command in Editor preferences.
+    {sedit(spell) seditSpell {CHOICE spell ispell custom interactive} {Spell program}
+"This chooses the spell program used by the built-in editor. \"spell\" selects the standard
+spell program (which is not interactive). \"ispell\" enables checking 
+with the ispell program. \"custom\" runs the program set in the next preference.
+\"interactive\" enables the I-Spell module, which has its own preference page."}
+    {editor(spell) spellCmd {exmh-async xterm -e ispell} {Custom spell command}
+"This option is ignored unless you chose \"custom\" as the spell program option.
 
 There are two flavors of spell programs.  If your spell program just
 prints out the misspelled words, then just specify it directly.
-Examples include the standard \"spell\" program.  If you spell program
-is interactive, then run it from exmh-async:
-exmh-async xterm -e ispell
-(This is faked - exmh-async isn't really used.  Instead a temporary
-wish script is used.)"}
+Examples include the standard \"spell\" program.  If your spell program
+is interactive, then prefix it with exmh-async:
+ exmh-async xterm -e ispell
+Your spell program will be given the file name to check as argument."}
     {sedit(notifySuccess) seditNotifySuccess OFF {Notify on sucessful delivery}
 "This lets you say whether you would like to be informed (via an email
 message) when your mail has been delivered.  For it to work you will
diff -ub ./lib//ispell.tcl /usr/lib/exmh//ispell.tcl
--- ./lib//ispell.tcl	2002-02-28 15:13:46.000000000 +1000
+++ /usr/lib/exmh//ispell.tcl	2011-04-24 13:04:31.000000000 +1000
@@ -184,111 +184,90 @@
 proc Ispell_Preferences {} { 
 
     Preferences_Add "I-Spell" \
-	    "This is a module to allow interactive spelling within a sedit window
-it has many fine features include suggested correction and the ability
-to add new words to a session or to your personnel dictionary.
+	    "This is a module to allow interactive spell checking  within 
+a sedit window.
+It's many fine features include suggested correction and the ability
+to add new words to a session or to your personal dictionary.
 For words that are either not correct or not generated 
 by a combination of roots or compounds, the word is marked as not
-spelled correctly." { 
+spelled correctly.
 
-	{ ispellVars(on) ispellOnOff ON {Turn Ispell On/Off} 
-	"This turns the ispell feature on/off.  Note that the feature
-	needs to be enabled BEFORE a message is brought up" } 
+Please note that the I-Spell module is only active if you select 
+the option \"interactive\" as Spell program (Simple Editor preferences).
+" { 
 
 	{ ispellVars(ReCheckAfterAdd) ispellRecheckAfterAdd ON {Re-Verify after Adds?} 
 	"Check this box if you want to re spell check words 
-	currently marked Miss Spelled after you add to the dictionary 
-	or session.  In general a good idea except if you work 
-	in extremely long documents a small delay may be noticed 
-	after you add words to your personal dictionary
+	currently marked as misspelled after you add to the dictionary 
+	or session.  In general this is a good idea except for 
+	extremely long documents where a small delay may be noticed 
+	after you add words to your personal dictionary.
 	Additionally the right mouse button can be used to
-	accept suggested words" }
+	accept suggested words." }
 
 	{ ispellVars(textOnly) ispellTextOnly OFF {Spell Check 'Text' only?} 
 	"Check this box if you want to only perform spell checking 
-of the text marked as 'text', this should avoid spell checking 
-To:, CC: & X-Face: lines, it comes at a small time penalty, turn it off
-if you want to see a small improvement in response time
-Note that turning this option on will also not spell check 'attachements'
+of the text marked as 'text'. This should avoid spell checking 
+To:, CC: & X-Face: lines. It comes at a small time penalty, turn it off
+if you want to see a small improvement in response time.
+Note that turning this option on will also not spell check 'attachments'
 unless they are marked as Content-Type: text/enriched or text/plain.
-if you find that spell checking STOPS working in a section of the document you
-may want to turn this off" }
+If you find that spell checking STOPS working in a section of the document you
+may want to turn this off." }
 
 	{ ispellVars(defaultCommand) ispellCommand "ispell -a -S" {Default speller invocation}
 	"This is the program used to actually do the real work
 'ispell -a' is probably a good choice.  if you want to 
 use an alternate dictionary, 'ispell -a -d <dictionary-file>' may be 
-appropriate. you may find that -S sorts the list of possible
-words better, see the ispell(1) man page for more details.
-(really, it's got a lot of details and you can really personalize
-how it works to fit best with your environment" } 
+appropriate. You may find that -S sorts the list of possible
+words better, see the ispell(1) man page for more details." } 
 	{ ispellVars(otherCommands) ispellOthers " German  { ispell -a -d deutsch } \
 		French { ispell -a -d francais } English { ispell -a -d english } " { Other Invocations }
-	"Alternate Invocations of of the 'Ispell' programs, mostly intended for 
-our friends in Europe who have to work in a variety of languages, this entry should
-be in label/invocation pairs" } 
+	"Alternate Invocations of the 'Ispell' programs, mostly intended for 
+our friends in Europe who have to work in a variety of languages. This 
+entry must be in label/invocation pairs." } 
 
 	
 	{ ispellVars(popupBinding) ispellPopupBinding "ButtonPress-3" {Menu popup bound to:}
-	" This controls what the 'popup' window is bound to, some examples include:
+	" A popup window is used for interactive correction of the word 
+under the mouse pointer. This option controls how the popup window is invoked. 
+
+Any TK bind() event specification that involves the mouse is allowed. Some examples:
 ButtonPress-3 
 ButtonPress-2
 ButtonPress-1
 Shift-3
 Control-3
 Meta-2
-Alt-1
-etc...
+Alt-1" }
 
-Note that the menu is unposted on any ButtonRelease" }
+	{ ispellVars(viewStyle) ispellStyle {CHOICE underline italic bold bgcolor fgcolor other } {Misspelled word style}
+	    "This is how to display misspelled words.
+Use the built in types or create your own using 'other'. 
+Colors are given as X11 color names or #RGB.
 
-	{ ispellVars(viewStyle) ispellStyle {CHOICE underline italic bold bgcolor fgcolor other } {Miss-spelled word style}
-	" this is how to display misspelled words
-	use the built in types or create your own
-	using 'other', for 'color' ones fill in the color 
-	examples using other include 
+Some examples for the 'other' style (see the TK docs for more info):
 	-underline t
 	-background red
 	-foreground Bisque
 	-font <font>
+ -font *italic*
+ -font *bold*
+ -relief <relief>
 	-fgstipple <bitmap>
 	-bgstipple <bitmap>
 
-	Bitmap's can be many things, 'gray50' and 'gray25' are popular
-
-	For example....
-
-	-font *italic*
-	or   -font *bold*
-	or   -font *24*    (Big!)
-
-	or   -font *italic*24* (big italics)
-
-	-relief <relief> (see tk doc's for more info...)
-
-	
-	Effects can also be combined as in 
+Bitmaps can be many things, 'gray50' and 'gray25' are popular.
+Effects can also be combined:
 	
 	-underline t -foreground red
-	-bgstipple gray25 -color red
-
-	
-	" } 
+ -bgstipple gray25 -color red" } 
 	{ ispellVars(viewStyle-Color) ispellStyleColor red {color:} 
 	"color for fgcolor and bgcolor" }
 	{ ispellVars(viewStyle-Other) ispellStyleOther {-underline t -foreground red}  {other:}
 	"Style if 'other' is selected" }
     }
-    if { [ info exists ispellVars(CheckButton) ] } {
-	if {$ispellVars(CheckButton) == 1} {
-
-	    option add *Sedit.Menubar.ubuttonlist {ispell}
-	    
-	    option add *Sedit.Menubar.ispell.text {Ispell}
 	    
-	    option add *Sedit.Menubar.ispell.command {Ispell_CheckEntireWindow $t}
-	}
-    }
     global ispellVars
     set ispellVars(language) default
     trace variable ispellVars(on) w IspellOnOff    
@@ -679,10 +658,22 @@
 # a call to 'IspellPreferences' should do the trick...
 ##########################################################
 proc Hook_SeditInit_TagMissSpelled { file window } {
-    global ispellVars
+    global ispellVars sedit
     # only configure the window for ispell support if it is
     # actually needed, and if the appropriate variables exist
-    # 
+    set id [SeditId $file]
+    set b .sedit${id}.but
+    if {$sedit(spell) == "interactive"} {
+	set ispellVars(on) 1
+	$b.more.m entryconfigure Spell* -state disabled
+	$b.more.m entryconfigure I-Spell* -state normal
+    } else { 
+	set ispellVars(on) 0
+	$b.more.m entryconfigure Spell* -state normal
+	$b.more.m entryconfigure I-Spell* -state disabled
+	return
+    }
+    
     # bind the window.....
     # use default style of underline
     set style "-underline t"
@@ -705,12 +696,11 @@
     }
     
     # Only bind the window if 'ispell' is turned on...
-    if { [ info exists ispellVars(on) ] } {
+    # and if so, disable external ispell (and vice-versa)
+
 	if { $ispellVars(on) == 1 } { 
 	    set ispellVars($window,effect) 1
 	    Ispellbind $window 
-
-	}
     }
 
     set ispellVars(command) $ispellVars(defaultCommand)
@@ -901,7 +891,6 @@
     # no user configurable way to select the unpost...
     # tk_popup should unpost the menu for us automatically
 #    bind $text <Any-ButtonRelease> { IspellUnPostMenuChoices %W } 
-    
 }
 
 
diff -ub ./lib//seditExtras.tcl /usr/lib/exmh//seditExtras.tcl
--- ./lib//seditExtras.tcl	2011-04-21 17:37:45.000000000 +1000
+++ /usr/lib/exmh//seditExtras.tcl	2011-04-23 14:02:01.000000000 +1000
@@ -690,10 +690,13 @@
 
     set async_hack 0
     switch -- $sedit(spell) {
-	ispell {set prog "${argv0}-async xterm -e ispell" ; set async_hack 1}
+	ispell {set prog "exmh-async xterm -e ispell" ; set async_hack 1}
 	custom {set prog $editor(spell)}
 	default {set prog spell}
     }
+    if {[regexp ^exmh-async $prog]} {
+	set async_hack 1
+    }
     if {$async_hack} {
 	# exmh-async isn't really right
 	# craft a wish script instead
@@ -704,7 +707,7 @@
 	}
 	puts $out "wm withdraw ."
 	puts $out "catch \{"
-	puts $out "exec [lrange $editor(spell) 1 end] $path"
+	puts $out "exec [lrange $prog 1 end] $path"
 	puts $out "\}"
 	puts $out [list send [winfo name .] [list SeditReplaceBody $t $path]]
 	puts $out "file delete -force $path"
diff -ub ./lib//seditSel.tcl /usr/lib/exmh//seditSel.tcl
--- ./lib//seditSel.tcl	2011-04-21 17:37:45.000000000 +1000
+++ /usr/lib/exmh//seditSel.tcl	2011-04-23 14:02:20.000000000 +1000
@@ -147,10 +147,13 @@
 
     set async_hack 0
     switch -- $sedit(spell) {
-	ispell {set prog "${argv0}-async xterm -e ispell" ; set async_hack 1}
+	ispell {set prog "exmh-async xterm -e ispell" ; set async_hack 1}
 	custom {set prog $editor(spell)}
 	default {set prog spell}
     }
+    if {[regexp ^exmh-async $prog]} {
+	set async_hack 1
+    }
     if {$async_hack} {
 	# exmh-async isn't really right
 	# craft a wish script instead
@@ -161,7 +164,7 @@
 	}
 	puts $out "wm withdraw ."
 	puts $out "catch \{"
-	puts $out "exec [lrange $editor(spell) 1 end] $path"
+	puts $out "exec [lrange $prog 1 end] $path"
 	puts $out "\}"
 	puts $out [list send [winfo name .] [list SeditReplaceSel $t $path]]
 	puts $out "file delete -force $path"
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk2zoM4ACgkQpy/2bEK9ZF3sWwCfQGiH/J+AaaEg9BLZCY4KUw7H
jU0AoIhthFJ1mB0eWoel9NI6bL3ceons
=CyFn
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.