alternate editor issues

Harvey Eneman <[email protected]>
Newsgroups gmane.mail.exmh.user
Message-ID <[email protected]>
Here are couple more for those of us that switch between the "simple editor" 
and an "alternate editor" (of our choice) when editing messages that aren't
in the "draft" folder.  

First, if you happen to have one or more periods ('.') in the name of a
folder in the path to the message, you'll note that when you attempt to switch
to the "alternate editor", the periods have been replaced by underscores ('_').
It's not surprising that the "alternate editor" fails to find the file.  This
issue may be resolved by applying the attached sedit.tcl patch.

The next issues occurs when you attempt to switch back from the "alternate
editor".  If PGP is enabled, you'll notice that it hasn't been initialized
via a tcl error report.  Then, you'll discover that the program expects to
find the message you were editing in the "draft" folder.  Both of these 
issues are resolved in the attached editor.tcl and exmh-async.MASTER patch.

Harv

_______________________________________________
Exmh-users mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/exmh-users
editor.tcl.patch (application/x-patch, 1.3 KB)
*** editor.tcl.orig	2004-08-23 20:39:01.000000000 -0700
--- editor.tcl	2007-08-05 17:17:43.000000000 -0700
***************
*** 147,154 ****
      }
  }
  # For compatibility with old versions of mxedit
! proc EditDialog {draftID} {
!     Edit_Dialog $draftID
  }
  
  # Turn passphrase pane ON/OFF/disabled depending on pgp(seditpgp) and
--- 147,171 ----
      }
  }
  # For compatibility with old versions of mxedit
! proc EditDialog {draft} {
!     global mhProfile pgp
!     if [regsub ^$mhProfile(path)/$mhProfile(draft-folder)/ $draft {} newdraft] {
!         Edit_Dialog $newdraft
!     } else {
!         if $pgp(enabled) {
!             # Copy the default PGP values into this window only if they
!             # don't already exists. This way, we preserve values between
!             # re-edit sessions. Edit_Done takes care of resetting to 
!             # preference values when we send or abort (ie. get done draft).
!             set draftID [file tail $draft]
!             foreach var {encrypt sign format version} {
!                 if ![info exists pgp($var,$draftID)] {
!                     set pgp($var,$draftID) $pgp($var)
!                 }
!             }
!         }
!         Sedit_Start $draft
!     }
  }
  
  # Turn passphrase pane ON/OFF/disabled depending on pgp(seditpgp) and
exmh-async.MASTER.patch (application/x-patch, 990 B)
*** exmh-2.7.2/exmh-async.MASTER	2004-06-14 08:23:54.000000000 -0700
--- nexmh/exmh-async.MASTER	2007-08-05 17:32:31.000000000 -0700
***************
*** 13,19 ****
  set exmh [lindex $argv 0]
  set editorCmd [lrange $argv 1 end]
  set draftpath [lindex $argv [expr {[llength $argv] - 1}]]
! set draftm [file tail $draftpath]
  
  send $exmh [list Edit_Ident [winfo name .]]
  
--- 13,19 ----
  set exmh [lindex $argv 0]
  set editorCmd [lrange $argv 1 end]
  set draftpath [lindex $argv [expr {[llength $argv] - 1}]]
! # set draftm [file tail $draftpath]
  
  send $exmh [list Edit_Ident [winfo name .]]
  
***************
*** 26,31 ****
  if [catch {eval exec $editorCmd} err] {
      send $exmh [list Exmh_Status "exmh-async: editor failed: $err" purple]
  }
! send $exmh EditDialog $draftm
  
  exit 0
--- 26,31 ----
  if [catch {eval exec $editorCmd} err] {
      send $exmh [list Exmh_Status "exmh-async: editor failed: $err" purple]
  }
! send $exmh EditDialog $draftpath
  
  exit 0
sedit.tcl.patch (application/x-patch, 652 B)
*** sedit.tcl.orig	2004-08-23 20:39:03.000000000 -0700
--- sedit.tcl	2007-08-05 16:12:58.000000000 -0700
***************
*** 633,640 ****
      return 1
  }
  proc SeditAlternate { draft t } {
      SeditSave $draft $t SeditNuke
!     Edit_Done alternate [SeditId $draft] {}
  }
  proc SeditSaveBody { t outfile } {
      set out [open $outfile w 0600]
--- 633,642 ----
      return 1
  }
  proc SeditAlternate { draft t } {
+     global mhProfile
      SeditSave $draft $t SeditNuke
!     regsub ^$mhProfile(path)/ $draft {} newdraft
!     Edit_Done alternate $newdraft {}
  }
  proc SeditSaveBody { t outfile } {
      set out [open $outfile w 0600]
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Exmh version 2.7.2 01/07/2005

iD8DBQFGtm2lJWLrSYxEfJMRAqkVAKDHJBbugTTznBUAl9H+nn1t5YY10gCgp0ve
h4emYQElJTFa6Xm/FlfCAUo=
=LyLM
-----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.