source: trunk/athena/bin/discuss/edsc/discuss-acl.el @ 12350

Revision 12350, 2.7 KB checked in by ghudson, 26 years ago (diff)
Some RCS ID cleanup: delete $Log$ and replace other RCS keywords with $Id$.
Line 
1;;;
2;;;     Copyright (C) 1990 by the Massachusetts Institute of Technology
3;;;     Developed by the MIT Student Information Processing Board (SIPB).
4;;;     For copying information, see the file mit-copyright.h in this release.
5;;;
6;;;     $Id: discuss-acl.el,v 1.3 1999-01-22 23:09:42 ghudson Exp $
7;;;
8;;;  Emacs lisp code to deal with ACL manipulation in discuss meetings
9;;;  Written by Theodore Ts'o
10;;;
11
12(defvar discuss-acl-mode-map nil
13  "Keymap used by the acl mode of the discuss subsystem")
14
15(defvar discuss-acl-filename nil
16  "Filename used to store the ACL information.")
17
18;;; Discuss acl mode
19
20(defun discuss-acl-mode ()
21"Major mode for looking at the ACL (Access Control List)  of a meeting under
22the discuss subsystem.
23All normal editing commands are turned off.
24Instead, these commands are available:
25\\[describe-mode]       List available commands.
26\\[scroll-up]   Scroll to next screen of this transaction.
27\\[scroll-down] Scroll to previous screen of this transaction.
28\\[discuss-acl-quit]    Quit looking at the ACL"
29  (interactive)
30  (kill-all-local-variables)
31  (setq major-mode 'discuss-acl-mode)
32  (setq mode-name "Discuss (acl)")
33  (use-local-map discuss-acl-mode-map)
34  (setq buffer-read-only t)
35  (run-hooks 'discuss-acl-hooks))
36
37
38(defun discuss-list-acl ()
39  "Display the ACL of the meeting"
40  (interactive)
41  (if (and discuss-acl-filename
42           (file-exists-p discuss-acl-filename))
43      (delete-file discuss-acl-filename))
44  (setq discuss-acl-filename (make-temp-name (format "/tmp/discuss-acl-%s"
45                                                     discuss-current-meeting)))
46  (discuss-send-cmd (format "(pacl %s %s)\n"
47                            discuss-acl-filename
48                            discuss-current-meeting)
49                    'discuss-end-list-acl 'discuss-read-form))
50
51(defun discuss-end-list-acl ()
52  (message "done list acl")
53  (setq discuss-acl-buf
54        (get-buffer-create "*discuss-acl*"))
55  (let ((pop-up-windows t))
56    (pop-to-buffer discuss-acl-buf))
57  (discuss-acl-mode)
58  (let ((buffer-read-only nil))
59    (insert-file-contents discuss-acl-filename))
60  )
61
62(defun discuss-acl-quit ()
63  (interactive)
64  (if (and discuss-acl-filename
65           (file-exists-p discuss-acl-filename))
66      (delete-file discuss-acl-filename))
67  (setq discuss-acl-filename nil)
68  (if discuss-current-meeting
69      (switch-to-buffer discuss-cur-mtg-buf))
70  (delete-other-windows)
71  (if (and discuss-acl-buf
72           (buffer-name discuss-acl-buf))
73      (kill-buffer discuss-acl-buf))
74  (setq discuss-acl-buf nil))
75
76(if discuss-acl-mode-map
77    nil
78  (setq discuss-acl-mode-map (make-keymap))
79  (suppress-keymap discuss-acl-mode-map)
80  (define-key discuss-acl-mode-map "?" 'describe-mode)
81  (define-key discuss-acl-mode-map " " 'scroll-up)
82  (define-key discuss-acl-mode-map "\177" 'scroll-down)
83  (define-key discuss-acl-mode-map "q" 'discuss-acl-quit)
84)
85
Note: See TracBrowser for help on using the repository browser.