home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / mutt / spoint.mut < prev    next >
Text File  |  1988-05-15  |  698b  |  25 lines

  1.   ;; spoint.mut :
  2.   ;; Save and restore point of current buffer through buffer changes
  3.   ;; Kinda like GosMacs save-excursion
  4.   ;; Note: leaves some garbage on the msg line - you may want to (msg "").
  5.  
  6. (const CMARK 9)            ; the mark to use to save the cursor
  7.  
  8. (string saved-buffer-name 20)    ; the buffer to return to
  9. (int wrow)            ; the screen row the cursor is on
  10.  
  11. (defun
  12.   save-point HIDDEN
  13.   {
  14.     (saved-buffer-name (buffer-name -1))
  15.     (arg-prefix CMARK)(set-mark)    ; save the cursor
  16.     (wrow (window-row))
  17.   }
  18.   restore-point HIDDEN
  19.   {
  20.     (switch-to-buffer saved-buffer-name)
  21.     (arg-prefix CMARK)(exchange-dot-and-mark)
  22.     (arg-prefix wrow)(reposition-window)
  23.   }
  24. )
  25.