home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / alt / lucidem / help / 100 next >
Encoding:
Text File  |  1992-07-21  |  9.3 KB  |  254 lines

  1. Newsgroups: alt.lucid-emacs.help
  2. Sender: help-lucid-emacs-request@lucid.com
  3. Date: Tue, 21 Jul 92 11:07:56 EDT
  4. From: lamour@maestro.mitre.org (Michael Lamoureux)
  5. Message-ID: <9207211507.AA19905@maestro.mitre.org>
  6. Subject: some examples
  7. Path: sparky!uunet!wendy-fate.uu.net!help-lucid-emacs
  8. Lines: 244
  9.  
  10.     Well, I've been hacking at this for a few days, and I guess
  11. this may be useful to someone else.  If anyone has any ideas for
  12. making this simpler, more useful, etc, please let me know.
  13.  
  14. Below:  key-bindings for Sun4 keyboard
  15.     Perl hilighting defs for lhilit
  16.     VM hiliting defs & hook for lhilit
  17.     sound bindings  (nothing much)
  18.     a menubar def
  19.     an x-find-file hack
  20.  
  21. BTW, this makes for a great menubar font (IMHO):
  22. Emacs*menubar*font: -adobe-times-bold-r-normal--14-140-75-75-p-77-iso8859-1
  23.  
  24. Just in case you wanted to know,
  25. Michael
  26. lamour@mitre.org
  27.  
  28. PS>  If you don't find this useful, then I guess you could just
  29.     consider it a long .sig  ;-)
  30.  
  31. ----------------------------- Cut Here --------------------------------
  32. ;;
  33. ;; Dot emacs file for Michael Lamoureux
  34. ;;     This file contains ideas stolen from a great many sources
  35. ;;     latest hack added on 7/21/92
  36. ;;
  37. ;; Added some organization to this mess on 2/15/92.  The following
  38. ;; sections can be found below by searching on the specified strings.
  39. ;;    &&lucid -  Lucid emacs 19 stuff
  40.  
  41. ;; [ I censored a couple hundred lines in here - mjl ]
  42.  
  43. ;; &&lucid ========== Lucid emacs 19 stuff ===========================
  44. (if (string-match "Lucid" emacs-version)
  45.     (progn
  46. ;; emacs-19 key bindings for Sun4 keyboard
  47. ;;
  48.      ;; Left keypad
  49.      (define-key global-map [(f11)] 'keyboard-quit)           ;; Stop
  50.      (define-key global-map [(f12)] 'repeat-complex-command)  ;; Again
  51.      (define-key global-map [(f14)] 'undo)                    ;; Undo
  52.      (define-key global-map [(f16)] 'kill-ring-save)          ;; Copy
  53.      (define-key global-map [(f18)] 'yank)                    ;; Paste
  54.      (define-key global-map [(control f18)] 'yank-pop)        ;; Paste
  55.      (define-key global-map [(f19)] 'isearch-forward)         ;; Find
  56.      (define-key global-map [(control f19)] 'query-replace)   ;; Find
  57.      (define-key global-map [(f20)] 'kill-region)             ;; Cut
  58.  
  59.      ;; Function keys
  60.      ;; F1 seems to be stolen, and F11 & F12 don't return X keysyms
  61.      (define-key global-map [(f2)] 'x-new-screen)
  62.      (define-key global-map [(control f2)] 'delete-screen)
  63.      (define-key global-map [(f3)] 'compile)
  64.      (define-key global-map [(f4)] 'next-error)
  65.      (define-key global-map [(f5)] 'find-tag)
  66.      (define-key global-map [(control f5)] 'find-next-tag)
  67.      (define-key global-map [(f6)] 'eval-region)
  68.      (define-key global-map [(f7)] 'fill-region)
  69.      (define-key global-map [(f8)] 'ispell-region)
  70.      (define-key global-map [(control f8)] 'ispell-buffer)
  71.      (define-key global-map [(f9)] 'vm)
  72.      (define-key global-map [(control f9)] 'gnus)
  73.      (define-key global-map [(f10)] 'manual-entry)
  74. ;; now that I look at it again, there appears to be much randomness in
  75. ;; the above bindings  ;-)
  76.  
  77.       ;; Right keypad
  78.      (define-key global-map [(f22)] 'lpr-buffer)                  ;; PrSc
  79.      (define-key global-map [(f23)] 'keyboard-quit)               ;; Break
  80.      (define-key global-map [(f27)] 'beginning-of-line)           ;; Home
  81.      (define-key global-map [(control f27)] 'beginning-of-buffer) ;; Home
  82.      (define-key global-map [(f29)] 'scroll-down)                 ;; PgUp
  83.      (define-key global-map [(control f29)] 'scroll-down)         ;; PgUp
  84.      (define-key global-map [(control left)] 'backward-word)      ;; <
  85.      (define-key global-map [(f31)] 'move-to-window-line)         ;; []
  86.      (define-key global-map [(control right)] 'forward-word)      ;; >
  87.      (define-key global-map [(f35)] 'scroll-up)                   ;; PgDn
  88.      (define-key global-map [(control f35)] 'scroll-up)           ;; PgDn
  89.      (define-key global-map [(r13)] 'end-of-line)                 ;; End
  90.      (define-key global-map [(control r13)] 'end-of-buffer)       ;; End
  91.      
  92.  
  93. ;; Some random sounds to amuse myself
  94.      (let ((default-directory exec-directory))
  95.        (load-sound-file "sounds/bark.au" 'undefined-key)
  96.        (load-sound-file "sounds/drip.au" 'undefined-click)    ;; broken???
  97.        (load-sound-file "sounds/whip.au" 'command-error 100)
  98.        (load-sound-file "sounds/gong.au" 'auto-save-error)    ;; non-std sound
  99.        (load-sound-file "sounds/whip.au" 'no-completion 100)
  100.        (load-sound-file "sounds/cuckoo.au" 'y-or-n-p)
  101.        (load-sound-file "sounds/cuckoo.au" 'yes-or-no-p))
  102.  
  103. ;; Menubar functions
  104. ;;  There must be a better way to do this
  105.      (defun find-dot-emacs ()
  106.        (interactive)
  107.        (find-file "~/.emacs")
  108.        )
  109.      (defun find-dot-cshrc ()
  110.        (interactive)
  111.        (find-file "~/.zshrc")
  112.        )
  113.      (defun find-dot-mailrc ()
  114.        (interactive)
  115.        (find-file "~/.mailrc")
  116.        )
  117.      (defun find-dot-login ()
  118.        (interactive)
  119.        (find-file "~/.zlogin")
  120.        )
  121.      (defun find-dot-xdefaults ()
  122.        (interactive)
  123.        (find-file "~/.Xdefaults")
  124.        )
  125.      (defun find-dot-openwin ()
  126.        (interactive)
  127.        (find-file "~/.openwin-init")
  128.        )
  129.  
  130. ;; Menubar def
  131. ;;   most of this stolen from menubar.el
  132.      (setq default-menubar
  133.        '(("File"    ["New Screen"        x-new-screen       t]
  134.           ["Open File..."        find-file        t]
  135.           ("Open Special"
  136.            ["Dot Emacs"             find-dot-emacs t]
  137.            ["Dot Login"             find-dot-login t]
  138.            ["Dot Cshrc"             find-dot-cshrc t]
  139.            ["Dot Mailrc"            find-dot-mailrc t]
  140.            ["Dot Xdefaults"         find-dot-xdefaults t]
  141.            ["Dot Openwin-init"      find-dot-openwin t]
  142.            )
  143.           ["Save Buffer"        save-buffer        t]
  144.           ["Save Buffer As..."    write-file        t]
  145.           ["Revert Buffer"        revert-buffer        t]
  146.           "-----"
  147.           ["Print Buffer"        lpr-buffer        t]
  148.           "-----"
  149.           ["Delete Screen"    delete-screen        t]
  150.           ["Kill Buffer..."    kill-buffer        t]
  151.           ["Exit Emacs"    save-buffers-kill-emacs    t]
  152.           )
  153.          ("Edit"    ["Undo"               advertised-undo       t]
  154.           ["Cut"               x-kill-primary-selection   t]
  155.           ["Copy"               x-copy-primary-selection   t]
  156.           ["Paste"        x-yank-clipboard-selection t]
  157.           ["Clear"        x-delete-primary-selection t]
  158.           )
  159.          ("Buffers"    "")
  160.          ("Applications" 
  161.           ["Read Mail"        vm            t]
  162.           ["Read News"        gnus            t]
  163.           ["Info"            info            t]
  164.           ["Compose Mail"        mail            t]
  165.           ["Compile"        compile            t]
  166.           )
  167.          ("Spelling"
  168.           ["Spell Word"        ispell-word        t]
  169.           ["Spell Region"        ispell-region        t]
  170.           ["Spell Buffer"        ispell-buffer        t]
  171.           )
  172.          ("Help"    ["Info"        info            t]
  173.           ["Describe Mode"        describe-mode        t]
  174.           ["Command Apropos..."    command-apropos        t]
  175.           ["List Keybindings"    describe-bindings    t]
  176.           ["Describe Key..."    describe-key        t]
  177.           ["Describe Function..."    describe-function    t]
  178.           ["Describe Variable..."    describe-variable    t]
  179.           "-----"
  180.           ["Unix Manual..."    manual-entry        t]
  181.           ["Emacs Tutorial"    help-with-tutorial    t]
  182.           ["Emacs News"    view-emacs-news        t]
  183.           )
  184.          ))
  185.      (set-screen-menubar default-menubar)
  186.  
  187.  
  188.      (load "lhilit" nil t)
  189.  
  190.      (set-face-foreground 'hilit0 "red3")
  191.      (set-face-foreground 'hilit1 "white")
  192.      (set-face-foreground 'hilit2 "blue3")
  193.      (set-face-foreground 'hilit6 "yellow")
  194.      (set-face-foreground 'hilit9 "seagreen")
  195.  
  196.      ;; I basically just ported my epoch lightbrite Perl defs
  197.      ;; to use lhilit
  198.      (setq perl-mode-hilit
  199.        '(
  200.          ("[ \n\t{]if[ \n\t;(]" nil hilit0)        ;; flow control
  201.          ("[ \n\t{]until[ \n\t;(]" nil hilit0)
  202.          ("[ \n\t{]while[ \n\t;(]" nil hilit0)
  203.          ("[ \n\t{]else[ \n\t;(]" nil hilit0)
  204.          ("[ \n\t{]elsif[ \n\t;(]" nil hilit0)
  205.          ("[ \n\t{]unless[ \n\t;(]" nil hilit0)
  206.          ("[ \n\t{]for[ \n\t;(]" nil hilit0)
  207.          ("[ \n\t{]foreach[ \n\t;(]" nil hilit0)
  208.          ("[ \n\t{]continue[ \n\t;(]" nil hilit0)
  209.          ("[ \n\t{]exit[ \n\t;(]" nil hilit0)
  210.          ("[ \n\t{]die[ \n\t;(]" nil hilit0)
  211.          ("[ \n\t{]last[ \n\t;(]" nil hilit0)
  212.          ("[ \n\t{]goto[ \n\t;(]" nil hilit0)
  213.          ("[ \n\t{]next[ \n\t;(]" nil hilit0)
  214.          ("[ \n\t{]redo[ \n\t;(]" nil hilit0)
  215.          ("[ \n\t{]return[ \n\t;(]" nil hilit0)
  216.  
  217.          ("^#if" nil hilit7)                        ;; cpp stuff
  218.          ("^#else" nil hilit7)
  219.          ("^#ifdef" nil hilit7)
  220.          ("^#ifndef" nil hilit7)
  221.          ("^#include" nil hilit7)
  222.          ("^#define" nil hilit7)
  223.          ("^#undef" nil hilit7)
  224.          ("^#endif" nil hilit7)
  225.  
  226.          ("#" "\n" hilit3)                          ;; comments
  227.  
  228.          ("^[ \n\t]*sub.*\\{" nil hilit1)          ;; subroutines
  229.          ("[ \n\t{]*eval[ \n\t(;]" nil hilit1)
  230.  
  231.          ("--- .* ---" nil hilit6)                 ;; markers
  232.          ("=== .* ===" nil hilit6)))
  233.  
  234.      (hilit::mode-list-update "Perl" perl-mode-hilit)
  235.  
  236.      (setq vm-mode-hilit
  237.        '(
  238.          ("^From:.*" nil hilit0)
  239.          ("^Subject:.*" nil hilit2)))
  240.      (hilit::mode-list-update "VM" vm-mode-hilit)
  241.      (add-hook 'vm-mode-hooks 'hilit::hilit-buffer)
  242.     
  243.  
  244.     ;; A 2-minute hack of x-find-file in Lucid emacs for Bob
  245.     ;;   This needs to do more, but I haven't had time
  246.     (defun x-find-file (filename)
  247.        "Does find file in new X Window"
  248.        (interactive "FX find file: ")
  249.        (select-screen (x-create-screen nil))
  250.        (switch-to-buffer (find-file-noselect filename)))
  251.     )
  252. )
  253. ;; Other Lucid specific code includes Guido Bosch's VM popup menu in ~/.vm
  254.