Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!sdd.hp.com!elroy.jpl.nasa.gov!ames!ncar!neit.cgd.ucar.edu!southern From: southern@neit.cgd.ucar.edu Newsgroups: comp.emacs Subject: toggling key definitions Message-ID: <9322@ncar.ucar.edu> Date: 28 Nov 90 19:32:39 GMT Sender: news@ncar.ucar.edu Reply-To: southern@neit.cgd.ucar.edu () Organization: Climate and Global Dynamics Division/NCAR, Boulder, CO Lines: 44 As a new Emacs user coming from years in a CMS/Xedit environment, it didn't take long for the level of the features that I am trying to build into my .emacs file to outstripped my ability to correctly write and impliment them. So, I'm hoping to get some guidance on a couple of definitions. First, there are a number of complimentary commands that I would like to define in such a manner that they are toggled by a single key. These include: 1. moving between the beginning and end-of-line, 2. moving between the beginning and end-of-buffer, 3. issuing start and end-kbd-macro commands. For example, I currently define my 7 and 8 keypad keys to begin and end a keyboard macro definition as such: (define-key function-keymap "7" 'start-kbd-macro) ;NCD [7] (define-key function-keymap "8" 'end-kbd-macro) ;NCD [8] I would like to use only one key to toggle between the start-kbd-macro and end-kbd-macro commands such that: if I currently am not defining a keyboard macro, 7 maps to start-kbd-macro if I currently am defining a keyboard macro, 7 maps to end-kbd-macro. Similarly, I would like to define a single key which bounces me between the beginning and end-of-line and another to bounce between beginning and end-of-buffer. Can anyone show me a simple generic method to do this for the various cases that I'm currently working on as well as others which might crop up in the future. The second definition I would like to make may be similar to the first. When I scroll-down through a buffer and reach the last full screen, the cursor is left a number of lines up from the bottom of the buffer and I get a beep and a "End of buffer" message. I would like to define the scroll-down such that when I reach the last full screen and issue another scroll-down, the cursor is placed at the end-of-buffer rather than being left a half screen up. Thanks, Lawrence Buja southern@ncar.ucar.edu