Loading ...
Sorry, an error occurred while loading the content.

2465Re: [jasspa] Problem while running gdiff via the command line

Expand Messages
  • Jon Green
    Oct 20, 2009
    • 0 Attachment
      Jon Green wrote:
      > azynheira wrote:
      >> Hello All,
      >> I've found some bug in gdiff :-)
      >> If I execute gdiff as an independent tool via:
      >> me "@gdiff" <old> <new>
      >> and I have the toolbar enabled, gdiff will never diff anything and complain with the usual message "gdiff Error: usage <new> <old".
      >>
      >> If I disable the toolbar it will work perfectly. It seems gdiff and toolbar do not mix together.
      >
      > Cor! Yes you are right. It is because gdiff runs me.emf in its startup and is restoring the session.
      >
      > Here is a temporary patch for the end of the gdiff.emf, replaced the existing startup code.
      > It basically kills the toolbar *item-list* which is causing the problem.
      > I have not figured out why there is a !force find-buffer #l0 in here at the moment, I do not think it is needed:
      >
      > !if .start-up
      > define-macro start-up
      > !force 2 delete-other-windows
      > ; Delete the item list if the toolbar is enabled.
      > !force 1 delete-buffer "*item-list*"
      > !if &seq $buffer-bname "*scratch*"
      > next-buffer
      > !endif
      > set-variable #l0 $buffer-fname
      > set-variable #l2 $buffer-bname
      > ; Why is this here?
      > ; !force find-buffer #l0
      > next-buffer
      > !if &seq $buffer-bname "*scratch*"
      > next-buffer
      > set-variable #l1 $buffer-fname
      > set-variable #l3 $buffer-bname
      > !else
      > set-variable #l1 $buffer-fname
      > set-variable #l3 $buffer-bname
      > next-buffer
      > !endif
      > next-buffer
      > !if &or ¬ &seq $buffer-bname #l2 &seq #l2 #l3
      > ml-write "[Usage error: me \"@gdiff\" <old> <new>]"
      > !else
      > gdiff #l0 #l1
      > !endif
      > !emacro
      > !endif
      >

      Here is a better fix. I only have 1 tool installed, but you may have 2 so this will not work.
      The following should sort that problem.

      Regards
      Jon.

      !if .start-up
      define-macro start-up
      ; Delete all of the windows. We use 2 to force this as there may be a
      ; toolbar present.
      !force 2 delete-other-windows
      ; Find the *scratch* buffer as our starting point.
      !while ¬ &seq $buffer-bname "*scratch*"
      next-buffer
      !done
      ; We are at *scratch*. Iterate around the list of buffers and delete
      ; any toolbar type buffers which will be temporary buffers.
      !repeat
      next-buffer
      !if &and ¬ &seq $buffer-bname "*scratch*" &seq "*" &lef $buffer-bname 1
      !force 1 delete-buffer $buffer-bname
      !endif
      !until &seq $buffer-bname "*scratch*"
      ; We are now at *scratch* advance to next buffer.
      next-buffer
      set-variable #l0 $buffer-fname
      set-variable #l2 $buffer-bname
      ; Why is this here?
      ; !force find-buffer #l0
      next-buffer
      !if &seq $buffer-bname "*scratch*"
      next-buffer
      set-variable #l1 $buffer-fname
      set-variable #l3 $buffer-bname
      !else
      set-variable #l1 $buffer-fname
      set-variable #l3 $buffer-bname
      next-buffer
      !endif
      next-buffer
      !if &or ¬ &seq $buffer-bname #l2 &seq #l2 #l3
      ml-write "[Usage error: me \"@gdiff\" <old> <new>]"
      !else
      gdiff #l0 #l1
      !endif
      !emacro
      !endif




      >
      >
      >> Another minor problem is that if diff.exe (in Win32 of course!) does not exist in the PATH it will not complain and will think the files are equal :-)
      >>
      >
      > In the 20091011 windows installer then you can install the windows tools as an option.
      > These are placed in the "ME" directory so they should be found. Did you install these or are you using something else (possibly nothing)?
      >
      > Regards
      > Jon
      >
      >
      >> My 10c :P
      >> Pedro
      >>
      >>
      >>
      >>
      >>
      >> ------------------------------------
      >>
      >> __________________________________________________________________________
      >>
      >> This is an unmoderated list, but new members are moderated to ensure that there are no spam users. JASSPA is not responsible for the content of
      >> any material posted to this list.
      >>
      >> To un-subscribe, send a mail message to
      >>
      >> mailto:jasspa-unsubscribe@yahoogroups.com
      >>
      >> or visit http://groups.yahoo.com/group/jasspa and
      >> modify your account settings manually.
      >>
      >>
      >> Yahoo! Groups Links
      >>
      >>
      >>
      >>
      >
      >
      >
      > ------------------------------------
      >
      > __________________________________________________________________________
      >
      > This is an unmoderated list, but new members are moderated to ensure that there are no spam users. JASSPA is not responsible for the content of
      > any material posted to this list.
      >
      > To un-subscribe, send a mail message to
      >
      > mailto:jasspa-unsubscribe@yahoogroups.com
      >
      > or visit http://groups.yahoo.com/group/jasspa and
      > modify your account settings manually.
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
    • Show all 14 messages in this topic