home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / lucid / lemacs-19.6 / lisp / vm / vm-lucid.el < prev    next >
Encoding:
Text File  |  1993-02-18  |  6.0 KB  |  172 lines

  1. ;;; Mouse and font support for VM running in Lucid GNU Emacs
  2. ;; Copyright (C) 1992-1993 Free Software Foundation, Inc.
  3.  
  4. ;; This file is part of GNU Emacs.
  5.  
  6. ;; GNU Emacs is free software; you can redistribute it and/or modify
  7. ;; it under the terms of the GNU General Public License as published by
  8. ;; the Free Software Foundation; either version 2, or (at your option)
  9. ;; any later version.
  10.  
  11. ;; GNU Emacs is distributed in the hope that it will be useful,
  12. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. ;; GNU General Public License for more details.
  15.  
  16. ;; You should have received a copy of the GNU General Public License
  17. ;; along with GNU Emacs; see the file COPYING.  If not, write to
  18. ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. ;; This requires a vm-summary-mode-hook, and vm-select-message-hook.
  21. ;; The version of VM distributed by Lucid has these, and future versions
  22. ;; of VM distributed by Kyle probably will have them.
  23.  
  24.  
  25. ;;; Right button pops up a menu of commands in all VM buffers.
  26. ;;; Middle button selects indicated article in VM Summary buffers.
  27.  
  28. (defvar vm-menu
  29.   '("View Mail"
  30.     ["Next Nondeleted Message"         vm-next-message t]
  31.     ["Previous Nondeleted Message"     vm-previous-message t]
  32.     ("Motion ..."
  33.      ["Goto Last Seen Message"        vm-goto-message-last-seen t]
  34.      ["Goto Message"            vm-goto-message    t]
  35.      ["Move Message Backward"        vm-move-message-backward t]
  36.      ["Move Message Forward"        vm-move-message-forward t]
  37.      ["Next Message"            vm-Next-message t]
  38.      ["Next Unread Message"        vm-next-unread-message t]
  39.      ["Previous Message"        vm-Previous-message t]
  40.      ["Previous Unread Message"        vm-previous-unread-message t]
  41.      )
  42.     "----"
  43.     ["Scroll Message Forward"        vm-scroll-forward t]
  44.     ["Scroll Message Backward"        vm-scroll-backward t]
  45.     ["Beginning Of Message"        vm-beginning-of-message t]
  46.     ["End Of Message"            vm-end-of-message t]
  47.     "----"
  48.     ["Display Summary"            vm-summarize t]
  49.     ["Get New Mail"            vm-get-new-mail t]
  50.  
  51.     ("Folders..."
  52.      ["Save Message"            vm-save-message t]
  53.      ["Save Message sans Headers"    vm-save-message-sans-headers t]
  54.      ["Auto-archive Messages"        vm-auto-archive-messages t]
  55.      ["Delete Message"            vm-delete-message t]
  56.      ["Undelete Message"        vm-undelete-message t]
  57.      ["Mark Message as Unread"        vm-unread-message t]
  58.      ["Expunge Folder"            vm-expunge-folder t]
  59.      "----"
  60.      ["Visit Folder"            vm-visit-folder t]
  61.      ["Visit Virtual Folder"        vm-visit-virtual-folder t]
  62.      ["Save Buffer"            vm-save-buffer t]
  63.      ["Save Folder"            vm-save-folder t]
  64.      ["Write File"            vm-write-file t]
  65.      )
  66.     ("Sending Messages..."
  67.      ["Send Mail"            vm-mail t]
  68.      ["Reply to Sender"            vm-reply t]
  69.      ["Reply to Sender (Citing Original)" vm-reply-include-text t]
  70.      ["Reply to All"            vm-followup t]
  71.      ["Reply to All (Citing Original)"    vm-followup-include-text t]
  72.      ["Forward Message"            vm-forward-message t]
  73.      ["Resend Message"            vm-resend-message t]
  74.      ["Retry Bounced Message"        vm-resend-bounced-message t]
  75.      ["Continue Composing Message"    vm-continue-composing-message t]
  76.      )
  77.     ("Marking Message..."
  78.      ["Mark Message"            vm-mark-message t]
  79.      ["Unmark Message"            vm-unmark-message t]
  80.      ["Unmark All Messages"        vm-mark-all-messages t]
  81.      ["Clear All Marks"            vm-clear-all-marks t]
  82.      ;;["Next Command Uses Marks"    vm-next-command-uses-marks t]
  83.      )
  84.     ("Digests..."
  85.      ["Send Digest"            vm-send-digest t]
  86.      ["Burst Digest"            vm-burst-digest t]
  87.      )
  88.     ("Window Configurations..."
  89.      ["Apply Window Configuration"    vm-apply-window-configuration t]
  90.      ["Delete Window Configuration"    vm-delete-window-configuration t]
  91.      ["Save Window Configuration"    vm-save-window-configuration t]
  92.      ["Window Help"            vm-window-help t]
  93.      )
  94.     ("Miscellaneous..."
  95.      ["Edit Message"            vm-edit-message t]
  96.      ["Group Messages"            vm-group-messages t]
  97.      ["Expose Hidden Headers"        vm-expose-hidden-headers t]
  98.      ["Isearch Forward"            vm-isearch-forward t]
  99.      ["Discard Cached Data"        vm-discard-cached-data t]
  100.      ["Kill Subject"            vm-kill-subject t]
  101.      ["Load Rc"                vm-load-rc t]
  102.      ["Pipe Message To Command"        vm-pipe-message-to-command t]
  103.      ["Shell Command"            shell-command t]
  104.      ["Show Copying Restrictions"    vm-show-copying-restrictions t]
  105.      ["Show No Warranty"        vm-show-no-warranty t]
  106.      ("BBDB"
  107.       ["Show Sender"            bbdb/vm-show-sender t]
  108.       ["Edit Notes"            bbdb/vm-edit-notes t])
  109.      )
  110.     "----"
  111.     ["Help"                vm-help t]
  112.     ["Undo"                vm-undo t]
  113.     ["Quit"                vm-quit t]
  114.     ["Quit Without Saving"        vm-quit-no-change t]
  115.     ))
  116.  
  117.  
  118. (defun vm-menu (e)
  119.   (interactive "e")
  120.   (mouse-set-point e)
  121.   (beginning-of-line)
  122.   (popup-menu vm-menu))
  123.  
  124. (defun vm-mouse-select (e)
  125.   (interactive "e")
  126.   (mouse-set-point e)
  127.   (beginning-of-line)
  128.   (or (eq major-mode 'vm-summary-mode) (error ""))
  129.   (let ((vm-follow-summary-cursor t))
  130.     (vm-scroll-forward)))
  131.  
  132. (define-key vm-mode-map 'button2 'vm-mouse-select)
  133. (define-key vm-mode-map 'button3 'vm-menu)
  134.  
  135.  
  136. ;;; originally defined in vm-folder.el
  137.  
  138. (require 'highlight-headers)
  139.  
  140. (or vm-highlighted-header-regexp
  141.     (setq vm-highlighted-header-regexp "^Subject: "))
  142.  
  143. (defun vm-highlight-headers (message window)
  144.   (let ((highlight-headers-regexp vm-highlighted-header-regexp))
  145.     (highlight-headers (marker-position (vm-start-of (car vm-message-pointer)))
  146.                (vm-text-end-of (car vm-message-pointer))
  147.                t)))
  148.  
  149.  
  150. ;;; Highlight the line under the mouse in the folder and summary buffers.
  151.  
  152. (defun vm-install-mouse-tracker ()
  153.   (require 'mode-motion)
  154.   (setq mode-motion-hook 'mode-motion-highlight-line))
  155.  
  156. (add-hook 'vm-summary-mode-hooks 'vm-install-mouse-tracker)
  157.  
  158.  
  159. ;;; Put the VM menu in the menubar
  160.  
  161. (defun vm-install-menubar ()
  162.   (if (and current-menubar (not (assoc "VM" current-menubar)))
  163.       (progn
  164.     (set-buffer-menubar (copy-sequence current-menubar))
  165.     (add-menu nil "VM" (cdr vm-menu)))))
  166.  
  167. (add-hook 'vm-mode-hooks 'vm-install-menubar)
  168. (add-hook 'vm-summary-mode-hooks 'vm-install-menubar)
  169.  
  170.  
  171. (provide 'vm-lucid)
  172.