Permalink
Browse files

emacs support now makes conspiracy sessions buffer-local

  • Loading branch information...
1 parent 06f7779 commit 9e2351675ee5d4a8e8ad5bd42cf86d1a3a6e037a @technomancy committed Jul 24, 2008
Showing with 18 additions and 18 deletions.
  1. +1 −4 README.rdoc
  2. +17 −14 lib/conspire/support/conspire.el
View
@@ -28,8 +28,7 @@ conspire from there on the files with which you wish to collaborate.
See lib/conspire/support to see which editors are supported. In Emacs,
install conspire.el and then visit the file you want to edit and
-pressing M-x conspire-mode, though this is still very rough and should
-be done in its own Emacs instance.
+pressing M-x conspire-mode.
Repository history is cleared in between conspiracy sessions.
@@ -46,8 +45,6 @@ Set the DEBUG environment variable to get more information on the console.
* Conflict resolution remains entirely unhandled.
-* The Emacs frontend currently requires its own Emacs instance.
-
* When using Avahi for your ZeroConf implementation, you will not be
able to do anything unless you have an active network connection. So
disconnected conspirancy sessions are not possible without bringing
@@ -3,8 +3,8 @@
;; Copyright (C) 2008 Phil Hagelberg
;; Author: Phil Hagelberg <technomancy@gmail.com>
-;; URL: http://www.emacswiki.org/cgi-bin/wiki/Conspire
-;; Version: 0.1
+;; URL: http://conspire.rubyforge.org
+;; Version: 0.2
;; Created: 2008-07-22
;; Keywords: collaboration
@@ -39,11 +39,8 @@
;;; TODO:
-;; In its current state, it's very dangerous to start a conspire
-;; session and then switch buffers, since the timer is not yet buffer
-;; local. Watch out!
-
;; Automatically launch conspire executable.
+;; Color lines based on which conspirator wrote them?
;;; Code:
@@ -53,20 +50,26 @@
(defvar conspire-timer nil
"A timer to activate conspire synchronizing.")
+(make-variable-buffer-local 'conspire-mode)
+
;;;###autoload
(defun conspire-mode ()
"Activate conspire-mode for real-time collaborative editing."
(interactive)
- (set (make-local-variable 'conspire-timer)
- (run-with-idle-timer conspire-interval
- :repeat 'conspire-sync-buffer)))
+ (setq conspire-mode t)
+ (setq conspire-timer
+ (run-with-idle-timer conspire-interval :repeat 'conspire-sync-buffer)))
+
(defun conspire-sync-buffer ()
"Synchronize buffer with Conspire repository."
- (when (buffer-modified-p)
- (save-buffer)
- (shell-command (format "git add %s && git commit -m \"conspire\""
- buffer-file-name)))
- (revert-buffer nil t))
+ (when conspire-mode
+ (when (buffer-modified-p)
+ (save-buffer)
+ (shell-command (format "git add %s && git commit -m \"conspire\""
+ buffer-file-name)))
+ (revert-buffer nil t)
+ ;; revert resets local variables; heh
+ (setq conspire-mode t)))
;;; conspire.el ends here

0 comments on commit 9e23516

Please sign in to comment.