home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
me34src.zip
/
me3
/
mutt
/
contrib
/
smarttab.mut
< prev
next >
Wrap
Lisp/Scheme
|
1995-01-14
|
804b
|
32 lines
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; smart-tab : Use previous line as a tabbing templete if possible, ;
;; or act as a standrd tab if not. ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Nadav Horesh Public Domain 2/93
(defun smart-tab {
(int prev-pos next-pos)
(prev-pos (current-column))
(if (forward-line -1) {
(current-column prev-pos)
(if (looking-at '.+\<') {
(re-search-forward '.\<')
(next-pos (current-column))
(next-line)
(current-column prev-pos)
(to-col next-pos)
(current-column next-pos)
; (msg next-pos)
(done)
}
)
}
)
; else
(next-line)
(current-column prev-pos)
(tab)
(msg "Hard TAB")
})