Skip to content
This repository has been archived by the owner on Jan 23, 2018. It is now read-only.

Commit

Permalink
Keep a .conspire file to indicate active conspiracy sessions, customi…
Browse files Browse the repository at this point in the history
…ze args from Emacs
  • Loading branch information
technomancy committed Jul 25, 2008
1 parent 5a7b87e commit 808b2a4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion lib/conspire.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@


module Conspire module Conspire
VERSION = '0.1.0' 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? HOSTNAME = `hostname`.chomp # TODO: is there a better way?


@conspirators = Set.new @conspirators = Set.new
Expand Down
2 changes: 1 addition & 1 deletion lib/conspire/gitjour_exts.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class << self


def init(path) def init(path)
abort "Repository already exists: #{path}" if File.exist? path + '/.git' 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` `mkdir -p #{path} && cd #{path} && git init`
`touch #{path}/.git/git-daemon-export-ok` `touch #{path}/.git/git-daemon-export-ok`
end end
Expand Down
13 changes: 9 additions & 4 deletions lib/conspire/support/conspire.el
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -39,15 +39,18 @@


;;; TODO: ;;; 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 ;; Don't bother with *Async Shell Command* output buffer
;; Color lines based on which conspirator wrote them? ;; Color lines based on which conspirator wrote them?


;;; Code: ;;; Code:


(defvar conspire-interval 0.25 (defcustom conspire-interval 0.25
"Number of seconds to wait before syncing with conspire.") "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 (defvar conspire-timer nil
"A timer to activate conspire synchronizing.") "A timer to activate conspire synchronizing.")


Expand All @@ -70,8 +73,10 @@ session will be started."
:lighter "-conspire" :lighter "-conspire"
(unless (file-exists-p (concat (file-name-directory buffer-file-name) (unless (file-exists-p (concat (file-name-directory buffer-file-name)
".conspire")) ".conspire"))
(shell-command (format "conspire %s >& /dev/null &" (save-window-excursion
(file-name-directory buffer-file-name)))) (shell-command (format "conspire %s %s >& /dev/null &"
(file-name-directory buffer-file-name)
conspire-arguments))))
(setq conspire-timer (setq conspire-timer
(or conspire-timer (or conspire-timer
(run-with-idle-timer conspire-interval :repeat (run-with-idle-timer conspire-interval :repeat
Expand Down

0 comments on commit 808b2a4

Please sign in to comment.