Mercurial > emacs
annotate lisp/talk.el @ 79688:f82034083629
Copyright and version headers update.
Remove some outdated comments through the whole file.
(vc-bzr-program-args): Remove because unused.
(vc-bzr-log-switches): New customization option.
(vc-bzr-command): Use LC_MESSAGES=C instead of LC_ALL=C. No longer
use `vc-bzr-program-args'.
(vc-bzr-register): Fix for working with both 22.1 and CVS version of
`vc-find-root' (patch by Andreas Hoenen).
(vc-bzr-status): Update regex to match latest Bzr output.
Remove redundant test.
(vc-bzr-init-version): New function.
(vc-bzr-unregister): Must not delete file.
(vc-bzr-find-version): New function.
(vc-bzr-checkout): Argument `rev' is explicit revision only if it's
a non-empty string, otherwise take head revision.
(vc-bzr-print-log): Pass `vc-bzr-log-switches' to "bzr log".
(vc-bzr-diff): Simpler build of the revision spec string.
(vc-annotate-convert-time, vc-bzr-annotate-difference):
Remove: compatibility hacks for Emacs21, not needed in Emacs 22.
(vc-bzr-dir-state): Add code comments. Removed redundant statement.
(vc-bzr-dired-state-info): Only provide custom strings for
overloaded VC state 'edited; otherwise fallback to
`vc-default-dired-state-info'.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Fri, 04 Jan 2008 19:20:59 +0000 |
parents | 9355f9b7bbff |
children | 73661ddc7ac7 65663fcd2caa f55f9811f5d7 |
rev | line source |
---|---|
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
18383
diff
changeset
|
1 ;;; talk.el --- allow several users to talk to each other through Emacs |
11684 | 2 |
74442 | 3 ;; Copyright (C) 1995, 2001, 2002, 2003, 2004, 2005, |
75347 | 4 ;; 2006, 2007 Free Software Foundation, Inc. |
14169 | 5 |
45078 | 6 ;; Maintainer: FSF |
11684 | 7 ;; Keywords: comm, frames |
8 | |
9 ;; This file is part of GNU Emacs. | |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
78236
9355f9b7bbff
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
75347
diff
changeset
|
13 ;; the Free Software Foundation; either version 3, or (at your option) |
11684 | 14 ;; any later version. |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
14169 | 22 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
64091 | 23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
24 ;; Boston, MA 02110-1301, USA. | |
11684 | 25 |
26 ;;; Commentary: | |
27 | |
14169 | 28 ;; This is a multi-user talk package that runs in Emacs. |
29 ;; Use talk-connect to bring a new person into the conversation. | |
11684 | 30 |
31 ;;; Code: | |
32 | |
33 (defvar talk-display-alist nil | |
34 "Alist of displays on which Emacs talk is now running. | |
35 Each element has the form (DISPLAY FRAME BUFFER).") | |
36 | |
37 ;;;###autoload | |
38 (defun talk-connect (display) | |
39 "Connect to display DISPLAY for the Emacs talk group." | |
40 (interactive "sTalk to display: ") | |
41 ;; Make sure we have an entry for the current display. | |
42 (let ((mydisp (cdr (assq 'display (frame-parameters (selected-frame)))))) | |
43 (talk-add-display mydisp)) | |
44 ;; Make sure we have an entry for the specified display. | |
45 (talk-add-display display) | |
46 ;; Add the new buffers to all talk frames. | |
47 (talk-update-buffers)) | |
48 | |
49 (defun talk-add-display (display) | |
12461
578abe49e2d3
(talk-disconnect): Make it interactive.
Richard M. Stallman <rms@gnu.org>
parents:
11684
diff
changeset
|
50 (let* ((elt (assoc display talk-display-alist)) |
578abe49e2d3
(talk-disconnect): Make it interactive.
Richard M. Stallman <rms@gnu.org>
parents:
11684
diff
changeset
|
51 (name (concat "*talk-" display "*")) |
578abe49e2d3
(talk-disconnect): Make it interactive.
Richard M. Stallman <rms@gnu.org>
parents:
11684
diff
changeset
|
52 buffer frame) |
578abe49e2d3
(talk-disconnect): Make it interactive.
Richard M. Stallman <rms@gnu.org>
parents:
11684
diff
changeset
|
53 (if (not (and elt (frame-live-p (setq frame (nth 1 elt))))) |
578abe49e2d3
(talk-disconnect): Make it interactive.
Richard M. Stallman <rms@gnu.org>
parents:
11684
diff
changeset
|
54 (setq frame (make-frame-on-display display (list (cons 'name name))))) |
578abe49e2d3
(talk-disconnect): Make it interactive.
Richard M. Stallman <rms@gnu.org>
parents:
11684
diff
changeset
|
55 (if (not (and elt (buffer-name (get-buffer (setq buffer (nth 2 elt)))))) |
578abe49e2d3
(talk-disconnect): Make it interactive.
Richard M. Stallman <rms@gnu.org>
parents:
11684
diff
changeset
|
56 (setq buffer (get-buffer-create name))) |
578abe49e2d3
(talk-disconnect): Make it interactive.
Richard M. Stallman <rms@gnu.org>
parents:
11684
diff
changeset
|
57 (setq talk-display-alist |
578abe49e2d3
(talk-disconnect): Make it interactive.
Richard M. Stallman <rms@gnu.org>
parents:
11684
diff
changeset
|
58 (cons (list display frame buffer) (delq elt talk-display-alist))))) |
11684 | 59 |
60 (defun talk-disconnect () | |
61 "Disconnect this display from the Emacs talk group." | |
12461
578abe49e2d3
(talk-disconnect): Make it interactive.
Richard M. Stallman <rms@gnu.org>
parents:
11684
diff
changeset
|
62 (interactive) |
11684 | 63 (let* ((mydisp (cdr (assq 'display (frame-parameters (selected-frame))))) |
64 (elt (assoc mydisp talk-display-alist))) | |
65 (delete-frame (nth 1 elt)) | |
66 (kill-buffer (nth 2 elt)) | |
67 (setq talk-display-alist (delq elt talk-display-alist)) | |
68 (talk-update-buffers))) | |
69 | |
70 (defun talk-update-buffers () | |
71 "Update all the talk frames so that each shows all the talk buffers." | |
72 (let ((tail talk-display-alist)) | |
73 (while tail | |
74 (let ((frame (nth 1 (car tail))) | |
75 (this-buffer (nth 2 (car tail))) | |
76 (buffers | |
77 (mapcar (function (lambda (elt) (nth 2 elt))) | |
78 talk-display-alist))) | |
79 ;; Put this display's own talk buffer | |
80 ;; at the front of the list. | |
81 (setq buffers (cons this-buffer (delq this-buffer buffers))) | |
82 (talk-split-up-frame frame buffers)) | |
83 (setq tail (cdr tail))))) | |
84 | |
85 (defun talk-split-up-frame (frame buffers) | |
86 "Split FRAME into equal-sized windows displaying the buffers in BUFFERS. | |
87 Select the first of these windows, displaying the first of the buffers." | |
88 (let ((lines-per-buffer (/ (frame-height frame) (length buffers))) | |
89 (old-frame (selected-frame))) | |
90 (unwind-protect | |
91 (progn | |
92 (select-frame frame) | |
93 (select-window (frame-first-window frame)) | |
94 (delete-other-windows) | |
95 (while (progn | |
96 (switch-to-buffer (car buffers)) | |
97 (setq buffers (cdr buffers))) | |
98 (split-window-vertically lines-per-buffer) | |
99 (other-window 1)) | |
100 (select-window (frame-first-window frame))) | |
101 (select-frame old-frame)))) | |
102 | |
18383 | 103 (provide 'talk) |
104 | |
52401 | 105 ;;; arch-tag: 7ab0ad88-1788-4886-a44c-ae685e6f8a1a |
11684 | 106 ;;; talk.el ends here |