[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WANTED: More Emacs-like Fred



In article <950428021716_99266545@aol.com> Wookye@aol.com writes:
>Chuck;
>
>The file assorted-fred-commands.lisp in the MCL Examples
>folder contains c-L and a few other commands.
>
>I believe you will need to change the line:
>(comtab-set-key *comtab* '(:control #\l) 'ed-refresh-screen) to:
>(comtab-set-key *comtab* '(:control #\l) 'ed-scroll-cursor-to-top)
>
>There may be others at ftp.digitool.com.
>
>_Steve
>

I wrote these functions for the same reason. I use them all the time.
Unfortunately, ed-delete-whitespace has a bug and crashes at the
end of the buffer, with a "buffer position out of bounds" message.

;;; Functions to eliminate excess whitespace.

(defmethod ed-join-line ((w fred-mixin)) 
  (ED-BEGINNING-OF-LINE w)
  (ED-DELETE-WHITESPACE w))

(comtab-set-key *control-x-comtab* '(#\^) 'ed-join-line) 
(comtab-set-key *comtab* '(:meta #\^) 'ed-join-line) 

(defmethod ed-close-whitespace ((w fred-mixin))
  (ed-delete-whitespace w)
  (ed-open-line w)
  (ed-open-line w)
  (ed-forward-char w)) 

(comtab-set-key *control-x-comtab* '(:control #\o) 'ed-close-whitespace)

-Chris Eliot