home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / me34src.zip / me3 / mutt / builtin / me3.mut < prev    next >
Lisp/Scheme  |  1995-01-14  |  5KB  |  150 lines

  1.     ;; what(1) string:
  2. "@(#)me3.mut (The part of ME3 written in Mutt) 3/93 v1.4 2/94"
  3.  
  4. ;; C Durland    Public Domain
  5.  
  6. (include me.mh)
  7.  
  8. (defun
  9.   center-cursor { (arg-prefix 0)(reposition-window) }
  10.   CR->CR&indent
  11.   {
  12.     (bind-key LOCAL-KEYMAP "newline-and-indent" "C-m")
  13.     (msg "CR mapped to newline-and-indent")
  14.   }
  15.   CR->CR
  16.   {
  17.     (bind-key LOCAL-KEYMAP "newline" "C-m")
  18.     (msg "CR mapped to newline")
  19.   }
  20.   cut-the-line    { (beginning-of-line)(arg-prefix 1)(cut-line) }
  21.   insert-line    { (beginning-of-line)(open-line) }
  22.   mark-and-end    { (set-mark)(end-of-buffer) }
  23.   mark-and-home    { (set-mark)(beginning-of-buffer) }
  24.   rename-buffer
  25.   {
  26.     (if (not (file-name -1 (complete CC_FNAME "New file name for buffer: ")))
  27.        (msg "Could not rename buffer."))
  28.   }
  29.   not-modified { (buffer-modified -1 FALSE) }
  30.   Goto-line
  31.   {
  32.     (current-line
  33.     (if (arg-flag) (arg-prefix) (convert-to NUMBER (ask "Goto line: "))))
  34.   }
  35.   toggle-overstrike { (overstrike (- 1 (overstrike))) }
  36. )
  37.  
  38. (defun
  39.   shell-region
  40.   {
  41.     (int bag-id)
  42.  
  43.     (bag-id (create-bag))
  44.     (append-to-bag bag-id APPEND-REGION)
  45. ;    (shell-command (bag-to-string bag-id))
  46.     (ask-user)(OS-command (bag-to-string bag-id) "[Return to resume editing]")
  47.     (free-bag)
  48.   }
  49. )
  50.  
  51. (const RECTANGLE-BAG 0)
  52. (defun        ;; rectangle commands
  53.   copy-rectangle  { (append-to-bag RECTANGLE-BAG APPEND-RECTANGLE) }
  54.   cut-rectangle
  55.       { (append-to-bag RECTANGLE-BAG APPEND-RECTANGLE) (erase-rectangle TRUE) }
  56.   delete-rectangle { (erase-rectangle TRUE) }
  57.   clear-rectangle  { (erase-rectangle FALSE) }
  58. )
  59.  
  60. (defun insert-file-name { (insert-text (complete CC_FNAME "File name: ")) })
  61.  
  62. (include modeline.mut)
  63. (include hook.mut)
  64. (include require.mut)
  65. (include basic.mut)
  66.  
  67. (include popup.mut)    ;; popup windows and menus
  68. (include wspace.mut)    ;; white space
  69.  
  70. (include cmdline.mut)    ;; process the command line
  71. (include sysvar.mut)    ;; allow user to view or modify system vars
  72. (include bstats.mut)    ;; buffer stats
  73.  
  74. (include alamode.mut)    ;; set modes
  75. (include help.mut)
  76.  
  77. (include indent.mut)    ;; shift a region right or left
  78. (include register.mut)    ;; GNU like register stuff
  79. (include case.mut)    ;;
  80. (include delbuf.mut)    ;; buffer deletion
  81.  
  82. (include isearch.mut)    ;; incremental search
  83. (include search.mut)    ;; nonincremental search
  84. (include qr.mut)    ;; query replace
  85. (include twiddle.mut)    ;; transpose characters
  86. (include window.mut)
  87. (include undo.mut)    ;; undo support
  88.  
  89. (include filter.mut)    ;; filter region
  90. (include mltime.mut)    ;; modeline time
  91.  
  92. (include hidebuf.mut)    ;; 
  93. (include pmatch.mut)    ;; paren matching
  94. (include markring.mut)    ;; a ring of marks
  95.  
  96. (include autoload.mut)
  97. (defun
  98.   adjust-lines       { (autoload "adjust-lines"      "adjust"   (push-args 0)) }
  99.   buffer-menu       { (autoload "buffer-menu"      "buf-menu") }
  100.   calculator       { (autoload "calculator"      "calc")     }
  101.   c-mode       { (autoload "c-mode"          "cmode")    }
  102.   dabbrev-expand   { (autoload "dabbrev-expand"      "dabbrev")  }
  103.   mutt-mode       { (autoload "mutt-mode"      "muttmode") }
  104.   text-mode       { (autoload "text-mode"      "textmode") }
  105.   pu           { (autoload "pu"          "dir"      (push-args 0)) }
  106.   cd           { (autoload "cd"          "dir"      (push-args 0)) }
  107.   pwd           { (autoload "pwd"          "dir")      }
  108.   edit-picture       { (autoload "edit-picture"      "picture")  }
  109.   mail-mode        { (autoload "mail-mode"      "mailmode") }
  110.   compile       { (autoload "compile"      "compile"  (push-args 0)) }
  111.   grep           { (autoload "grep"          "compile")  }
  112.   findit       { (autoload "findit"          "findit")   }
  113.   spell-buffer       { (autoload "spell-buffer"      "spell")    }
  114.   spell-region       { (autoload "spell-region"      "spell")    }
  115.   spell-word       { (autoload "spell-word"      "spell")    }
  116.   do-mouse       { (autoload "do-mouse"      "mouse")    }
  117. )
  118.  
  119. (defun start-ME-up    ;; and now get things started!
  120. {
  121.   (modeline-title
  122.     (concat (vn VERSION-NAME)(vn VERSION-MAJOR) "." (vn VERSION-MINOR)))
  123.  
  124. ;  (display-time)
  125.  
  126.   (load-code "osstuff" FALSE)    ;; load OS specific ME extensions
  127.   (load-code "site"    FALSE)    ;; load site specific ME extensions
  128.   (load-code "myme"    FALSE)    ;; load your personal ME extensions
  129.   (load-code "./mext"  FALSE)    ;; load directory local ME extensions
  130.  
  131.   (update)
  132.  
  133.   (if (== 1 (argc))        ;; empty command line
  134.     {
  135.       (if (pgm-exists "cmd-line-empty")
  136.     (floc "cmd-line-empty"())
  137.     (version))        ;; stick something in the message line
  138.     }
  139.     (process-command-line))
  140.  
  141.     ;; Delete the *scratch* buffer, even if it is the only buffer.
  142.     ;; If it is the only buffer, this will cause (create-buffer-hook) to be
  143.     ;;   called.  Since *scratch* was created before this code was loaded,
  144.     ;;   (create-buffer-hook) hadn't been called.
  145.     ;; Gotta be careful - *scratch* might already be gone if this file is
  146.     ;;   loaded twice.
  147.   (if (!= -2 (attached-buffer "*scratch*"))
  148.     (free-buffer (attached-buffer "*scratch*")))
  149. })
  150.