home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / gnu / emacs / help / 4053 < prev    next >
Encoding:
Text File  |  1992-09-09  |  1.5 KB  |  42 lines

  1. Newsgroups: gnu.emacs.help
  2. Path: sparky!uunet!utcsri!torn!cunews!nrcnet0!bnrgate!bmerh85!bmerh85!hamish
  3. From: Hamish.Macdonald@x400gate.bnr.ca (Hamish Macdonald)
  4. Subject: Re: Equivalents to vi's H, M, L Commands?
  5. In-Reply-To: mac@crchh570.BNR.CA's message of Wed, 09 Sep 1992 18:35:31 GMT
  6. Message-ID: <1992Sep09.192805.12394@bmerh85.bnr.ca>
  7. Lines: 29
  8. Sender: news@bmerh85.bnr.ca (Usenet News)
  9. Organization: Bell Northern Research
  10. References: <1992Sep09.183531.5615@bnr.ca>
  11. Date: Wed, 09 Sep 92 19:28:05 GMT
  12.  
  13. >>>>> On Wed, 09 Sep 1992 18:35:31 GMT,
  14. >>>>> In message <1992Sep09.183531.5615@bnr.ca>,
  15. >>>>> mac@crchh570.BNR.CA (Michael Campbell) wrote:
  16.  
  17. Michael> Does anyone know of emacs functions that perform a similar
  18. Michael> function to the vi commands H, M, and L (Home, Middle, and
  19. Michael> Last)? These functions move the cursor to the top of the
  20. Michael> screen (Home), the middle line of the screen (Middle), and
  21. Michael> the last line of the screen (Last). They do not effect vi's
  22. Michael> position in the file - they simply allow you to move the
  23. Michael> cursor around the currently displayed screen. Please post any
  24. Michael> replies to this newsgroup. Thanks!
  25.  
  26. (defun top-of-window ()
  27.     "Go to top line of window"
  28.     (interactive)
  29.     (goto-char (window-start)))
  30.  
  31. (defun middle-of-window()
  32.     "Go to middle line of window"
  33.     (interactive)
  34.     (goto-char (/ (- (window-end) (window-start)) 2))
  35.     (beginning-of-line))
  36.  
  37. (defun bottom-of-window()
  38.     "Go to last line of window"
  39.     (interactive)
  40.     (goto-char (window-end))
  41.     (beginning-of-line))
  42.