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

Revision 8275, 2.8 KB checked in by ghudson, 29 years ago (diff)
Add a describe-mode command; use \\[...] to give key bindings rather than assuming the default map.
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;;;     $Source: /afs/dev.mit.edu/source/repository/athena/bin/discuss/edsc/discuss-acl.el,v $
7;;;     $Header: /afs/dev.mit.edu/source/repository/athena/bin/discuss/edsc/discuss-acl.el,v 1.2 1996-04-12 21:44:09 ghudson Exp $
8;;;
9;;;  Emacs lisp code to deal with ACL manipulation in discuss meetings
10;;;  Written by Theodore Ts'o
11;;;
12
13(defvar discuss-acl-mode-map nil
14  "Keymap used by the acl mode of the discuss subsystem")
15
16(defvar discuss-acl-filename nil
17  "Filename used to store the ACL information.")
18
19;;; Discuss acl mode
20
21(defun discuss-acl-mode ()
22"Major mode for looking at the ACL (Access Control List)  of a meeting under
23the discuss subsystem.
24All normal editing commands are turned off.
25Instead, these commands are available:
26\\[describe-mode]       List available commands.
27\\[scroll-up]   Scroll to next screen of this transaction.
28\\[scroll-down] Scroll to previous screen of this transaction.
29\\[discuss-acl-quit]    Quit looking at the ACL"
30  (interactive)
31  (kill-all-local-variables)
32  (setq major-mode 'discuss-acl-mode)
33  (setq mode-name "Discuss (acl)")
34  (use-local-map discuss-acl-mode-map)
35  (setq buffer-read-only t)
36  (run-hooks 'discuss-acl-hooks))
37
38
39(defun discuss-list-acl ()
40  "Display the ACL of the meeting"
41  (interactive)
42  (if (and discuss-acl-filename
43           (file-exists-p discuss-acl-filename))
44      (delete-file discuss-acl-filename))
45  (setq discuss-acl-filename (make-temp-name (format "/tmp/discuss-acl-%s"
46                                                     discuss-current-meeting)))
47  (discuss-send-cmd (format "(pacl %s %s)\n"
48                            discuss-acl-filename
49                            discuss-current-meeting)
50                    'discuss-end-list-acl 'discuss-read-form))
51
52(defun discuss-end-list-acl ()
53  (message "done list acl")
54  (setq discuss-acl-buf
55        (get-buffer-create "*discuss-acl*"))
56  (let ((pop-up-windows t))
57    (pop-to-buffer discuss-acl-buf))
58  (discuss-acl-mode)
59  (let ((buffer-read-only nil))
60    (insert-file-contents discuss-acl-filename))
61  )
62
63(defun discuss-acl-quit ()
64  (interactive)
65  (if (and discuss-acl-filename
66           (file-exists-p discuss-acl-filename))
67      (delete-file discuss-acl-filename))
68  (setq discuss-acl-filename nil)
69  (if discuss-current-meeting
70      (switch-to-buffer discuss-cur-mtg-buf))
71  (delete-other-windows)
72  (if (and discuss-acl-buf
73           (buffer-name discuss-acl-buf))
74      (kill-buffer discuss-acl-buf))
75  (setq discuss-acl-buf nil))
76
77(if discuss-acl-mode-map
78    nil
79  (setq discuss-acl-mode-map (make-keymap))
80  (suppress-keymap discuss-acl-mode-map)
81  (define-key discuss-acl-mode-map "?" 'describe-mode)
82  (define-key discuss-acl-mode-map " " 'scroll-up)
83  (define-key discuss-acl-mode-map "\177" 'scroll-down)
84  (define-key discuss-acl-mode-map "q" 'discuss-acl-quit)
85)
86
Note: See TracBrowser for help on using the repository browser.