Permalink
Browse files

Keep a .conspire file to indicate active conspiracy sessions, customi…

…ze args from Emacs
  • Loading branch information...
1 parent 5a7b87e commit 808b2a415e0f1213f10090ff0494e5382c8a41d1 @technomancy committed Jul 25, 2008
Showing with 12 additions and 6 deletions.
  1. +2 −1 lib/conspire.rb
  2. +1 −1 lib/conspire/gitjour_exts.rb
  3. +9 −4 lib/conspire/support/conspire.el
View
3 lib/conspire.rb
@@ -10,7 +10,8 @@
module Conspire
VERSION = '0.1.0'
- DEFAULTS = { :port => 7456, :name => 'conspiracy', :sync_interval => 0.5 }
+ # TODO: play with optimal intervals; perhaps auto-adjust based on latency?
+ DEFAULTS = { :port => 7456, :name => 'conspiracy', :sync_interval => 0.25 }
HOSTNAME = `hostname`.chomp # TODO: is there a better way?
@conspirators = Set.new
View
2 lib/conspire/gitjour_exts.rb
@@ -5,7 +5,7 @@ class << self
def init(path)
abort "Repository already exists: #{path}" if File.exist? path + '/.git'
- at_exit { FileUtils.rm_rf path + '/.git' } unless ENV['KEEP']
+ at_exit { FileUtils.rm_rf [path + '/.git', path + '/.conspire'] } unless ENV['KEEP']
`mkdir -p #{path} && cd #{path} && git init`
`touch #{path}/.git/git-daemon-export-ok`
end
View
13 lib/conspire/support/conspire.el
@@ -39,15 +39,18 @@
;;; TODO:
-;; Automatically launch conspire executable.
+;; For some reason conspire-sync-buffer only runs on cursor movement
;; Don't bother with *Async Shell Command* output buffer
;; Color lines based on which conspirator wrote them?
;;; Code:
-(defvar conspire-interval 0.25
+(defcustom conspire-interval 0.25
"Number of seconds to wait before syncing with conspire.")
+(defcustom conspire-arguments ""
+ "Arguments to pass the `conspire' executable, like port, name, etc.")
+
(defvar conspire-timer nil
"A timer to activate conspire synchronizing.")
@@ -70,8 +73,10 @@ session will be started."
:lighter "-conspire"
(unless (file-exists-p (concat (file-name-directory buffer-file-name)
".conspire"))
- (shell-command (format "conspire %s >& /dev/null &"
- (file-name-directory buffer-file-name))))
+ (save-window-excursion
+ (shell-command (format "conspire %s %s >& /dev/null &"
+ (file-name-directory buffer-file-name)
+ conspire-arguments))))
(setq conspire-timer
(or conspire-timer
(run-with-idle-timer conspire-interval :repeat

0 comments on commit 808b2a4

Please sign in to comment.