[ditz-talk] Emacs interface to Ditz

William Morgan wmorgan-ditz at masanjin.net
Sat Apr 12 22:49:01 EDT 2008

Reformatted excerpts from Kentaro Kuribayashi's message of 2008-04-12:
> For example, `ditz add' command provides line-based editing
> functionality first, then if user performes `/edit' command to edit
> description, ditz run $EDITOR. (Is my recognithion right?)


> Otherwise, `ditz edit' command runs $EDITOR immediately without user's
> performing `/edit' command. It's good if you're in tty, but you'll see
> an error message like below in Emacs:
>    *ERROR*: Terminal type "dumb" is not powerful enough to run Emacs
> Incidentally, my $EDITOR variable is bound to `emacsclient'.

Hm. When I run ditz through emacs, everything works fine. I do: M-x
server-start and M-x shell. Within shell-mode, TERM is "dumb" and EDITOR
is "vim". If I set EDITOR to emacsclient, then ditz edit and using
"/edit" both do the right thing---load the file into another Emacs
buffer, and C-x # sends the data back to ditz.

So somehow I suspect that EDITOR isn't being set to emacsclient when
you're calling ditz from within emacs. Is there any chance that it's
being set to just "emacs" somehow?

You can try this patch to find out:
--- a/lib/lowline.rb
+++ b/lib/lowline.rb
@@ -63,6 +63,9 @@ module Lowline
     cmd = "#{editor} #{f.path.inspect}"
     mtime = File.mtime f.path
+    puts "TERM IS #{ENV["TERM"].inspect}"
+    puts "EDITOR IS #{ENV["EDITOR"].inspect}"
+    puts "running: #{cmd}"
     system cmd or raise Error, "cannot execute command: #{cmd.inspect}"
     File.mtime(f.path) == mtime ? nil : f.path

William <wmorgan-ditz at masanjin.net>

More information about the ditz-talk mailing list