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 >
Wrap
Lisp/Scheme
|
1995-01-14
|
5KB
|
150 lines
;; what(1) string:
"@(#)me3.mut (The part of ME3 written in Mutt) 3/93 v1.4 2/94"
;; C Durland Public Domain
(include me.mh)
(defun
center-cursor { (arg-prefix 0)(reposition-window) }
CR->CR&indent
{
(bind-key LOCAL-KEYMAP "newline-and-indent" "C-m")
(msg "CR mapped to newline-and-indent")
}
CR->CR
{
(bind-key LOCAL-KEYMAP "newline" "C-m")
(msg "CR mapped to newline")
}
cut-the-line { (beginning-of-line)(arg-prefix 1)(cut-line) }
insert-line { (beginning-of-line)(open-line) }
mark-and-end { (set-mark)(end-of-buffer) }
mark-and-home { (set-mark)(beginning-of-buffer) }
rename-buffer
{
(if (not (file-name -1 (complete CC_FNAME "New file name for buffer: ")))
(msg "Could not rename buffer."))
}
not-modified { (buffer-modified -1 FALSE) }
Goto-line
{
(current-line
(if (arg-flag) (arg-prefix) (convert-to NUMBER (ask "Goto line: "))))
}
toggle-overstrike { (overstrike (- 1 (overstrike))) }
)
(defun
shell-region
{
(int bag-id)
(bag-id (create-bag))
(append-to-bag bag-id APPEND-REGION)
; (shell-command (bag-to-string bag-id))
(ask-user)(OS-command (bag-to-string bag-id) "[Return to resume editing]")
(free-bag)
}
)
(const RECTANGLE-BAG 0)
(defun ;; rectangle commands
copy-rectangle { (append-to-bag RECTANGLE-BAG APPEND-RECTANGLE) }
cut-rectangle
{ (append-to-bag RECTANGLE-BAG APPEND-RECTANGLE) (erase-rectangle TRUE) }
delete-rectangle { (erase-rectangle TRUE) }
clear-rectangle { (erase-rectangle FALSE) }
)
(defun insert-file-name { (insert-text (complete CC_FNAME "File name: ")) })
(include modeline.mut)
(include hook.mut)
(include require.mut)
(include basic.mut)
(include popup.mut) ;; popup windows and menus
(include wspace.mut) ;; white space
(include cmdline.mut) ;; process the command line
(include sysvar.mut) ;; allow user to view or modify system vars
(include bstats.mut) ;; buffer stats
(include alamode.mut) ;; set modes
(include help.mut)
(include indent.mut) ;; shift a region right or left
(include register.mut) ;; GNU like register stuff
(include case.mut) ;;
(include delbuf.mut) ;; buffer deletion
(include isearch.mut) ;; incremental search
(include search.mut) ;; nonincremental search
(include qr.mut) ;; query replace
(include twiddle.mut) ;; transpose characters
(include window.mut)
(include undo.mut) ;; undo support
(include filter.mut) ;; filter region
(include mltime.mut) ;; modeline time
(include hidebuf.mut) ;;
(include pmatch.mut) ;; paren matching
(include markring.mut) ;; a ring of marks
(include autoload.mut)
(defun
adjust-lines { (autoload "adjust-lines" "adjust" (push-args 0)) }
buffer-menu { (autoload "buffer-menu" "buf-menu") }
calculator { (autoload "calculator" "calc") }
c-mode { (autoload "c-mode" "cmode") }
dabbrev-expand { (autoload "dabbrev-expand" "dabbrev") }
mutt-mode { (autoload "mutt-mode" "muttmode") }
text-mode { (autoload "text-mode" "textmode") }
pu { (autoload "pu" "dir" (push-args 0)) }
cd { (autoload "cd" "dir" (push-args 0)) }
pwd { (autoload "pwd" "dir") }
edit-picture { (autoload "edit-picture" "picture") }
mail-mode { (autoload "mail-mode" "mailmode") }
compile { (autoload "compile" "compile" (push-args 0)) }
grep { (autoload "grep" "compile") }
findit { (autoload "findit" "findit") }
spell-buffer { (autoload "spell-buffer" "spell") }
spell-region { (autoload "spell-region" "spell") }
spell-word { (autoload "spell-word" "spell") }
do-mouse { (autoload "do-mouse" "mouse") }
)
(defun start-ME-up ;; and now get things started!
{
(modeline-title
(concat (vn VERSION-NAME)(vn VERSION-MAJOR) "." (vn VERSION-MINOR)))
; (display-time)
(load-code "osstuff" FALSE) ;; load OS specific ME extensions
(load-code "site" FALSE) ;; load site specific ME extensions
(load-code "myme" FALSE) ;; load your personal ME extensions
(load-code "./mext" FALSE) ;; load directory local ME extensions
(update)
(if (== 1 (argc)) ;; empty command line
{
(if (pgm-exists "cmd-line-empty")
(floc "cmd-line-empty"())
(version)) ;; stick something in the message line
}
(process-command-line))
;; Delete the *scratch* buffer, even if it is the only buffer.
;; If it is the only buffer, this will cause (create-buffer-hook) to be
;; called. Since *scratch* was created before this code was loaded,
;; (create-buffer-hook) hadn't been called.
;; Gotta be careful - *scratch* might already be gone if this file is
;; loaded twice.
(if (!= -2 (attached-buffer "*scratch*"))
(free-buffer (attached-buffer "*scratch*")))
})