[comp.emacs] Terminal mode/sysv

mly@PREP.AI.MIT.EDU (Richard Mlynarik) (12/31/87)

Terminal mode will work with sysv as soon as somebody writes code to
make it happen.  I probably won't be the one to do it -- you'd have to
pay me to get me to use SysV.  I can't imagine that it is that hard to
do -- all that is needed is to somwhow translate the termcap entry
appended into a terminfo binary.

Somebody asked some time ago how to clear out crud from dired buffers.
Apart from the obvious solution of only specifying the desired files
(using one's shell's idiosyncratic wildcard syntax) one could use
something like the following (with the wired-in regexp changed to suit
one's own requirements)

(defun clean-dired ()
  (interactive)
  (save-excursion
    (goto-char (point-min))
    (forward-line 1)
    (let ((case-fold-search t)
	  (buffer-read-only nil))
      (while (re-search-forward
	       "\\.o$\\|~$\\|\\.bak$\\|\\.old$\\|\\.LCK$\\|\\.[a-z0-9]*bin$\\|\\.log$\\|#[0-9]*$\\| \\.\\.?$\\| TAGS$"
	       nil t)
	(beginning-of-line)
	(delete-region (point) (progn (end-of-line) (point)))
	(or (eobp) (delete-char 1))))))



For anyone who cares to do the work for terminal.el, the relevant
termcap entry is:

             ;; Because of Unix Brain Death(tm), we can't change
             ;;  the terminal type of a running process, and so
             ;;  terminal size and scrollability are wired-down
             ;;  at this point.  ("Detach?  What's that?")
             (concat (format "emacs-virtual:co#%d:li#%d:%s"
                             ;; Sigh.  These can't be dynamically changed.
                             te-width te-height (if terminal-scrolling
                                                    "" "ns:"))
                     ;;-- Basic things
                     ;; cursor-motion, bol, forward/backward char
                     "cm=^p=%+ %+ :cr=^p^a:le=^p^b:nd=^p^f:"
                     ;; newline, clear eof/eof, audible bell
                     "nw=^j:ce=^pc:cd=^pC:cl=^p^l:bl=^p^g:"
                     ;; insert/delete char/line
                     "IC=^p_%+ :DC=^pd%+ :AL=^p^o%+ :DL=^p^k%+ :"
                     ;;-- Not-widely-known (ie nonstandard) flags, which mean
                     ;; o writing in the last column of the last line
                     ;;   doesn't cause idiotic scrolling, and
                     ;; o never use idiotic c-s/c-q
                     "LP:NF:"
                     ;;-- For stupid or obsolete programs
                     "ic=^p_!:dc=^pd!:al=^p^o!:dl=^p^k!:ho=^p=  :"
                     ;;-- For disgusting programs.
                     ;; (VI? What losers need these, I wonder?)
                     "im=:ei=:dm=:ed=:mi:do=^p^j:nl=^p^j:bs:")))