home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / microcrn / issue_49.arc / MYSTUFF.M < prev    next >
Text File  |  1989-07-11  |  2KB  |  51 lines

  1. ;** Micro Cornucopia Magazine - Issue #49
  2. ;** 86World Figure 2
  3. ;**
  4. ;**    mystuff.m - an example of a simple brief macro to
  5. ;**                add a couple key definitions to brief.
  6. ;**
  7. ;**    Laine Stump 6/10/89
  8. ;**
  9.  
  10. (macro _init
  11.   (
  12.     (autoload "wp" "reform") ;** tells brief where to find reform macro
  13.  
  14.     ;** first some simple redefinitions of existing commands
  15.     (assign_to_key "<Ctrl-O>" "reform")    ;** reformat paragraph
  16.     (assign_to_key "<Alt-D>"  "dos")       ;** escape to dos shell
  17.     (assign_to_key "<Right>"  "next_char") ;** go to next char in buffer
  18.     (assign_to_key "<Left>"   "prev_char") ;** go to prev char in buffer
  19.  
  20.     ;** now define a key to call our own new macro
  21.     (assign_to_key "<Alt-Z>"  "zoom_window")
  22.  
  23.   )
  24. )
  25.  
  26.  
  27. (extern display_file_name)
  28.  
  29. (macro zoom_window   ;** zoom the current window to fill the screen
  30.   (
  31.     (int lines cols zbuffer)
  32.  
  33.     (inq_screen_size lines cols)      ;** see how big we can get
  34.     (= zbuffer (inq_buffer))          ;** this is what is in the window
  35.     (create_window 0 (- lines 3) (- cols 2) 0
  36.                    "ZOOM MODE (alt+Z for WINDOW MODE)")
  37.     (set_buffer    zbuffer)           ;make the window and attach current
  38.     (attach_buffer zbuffer)           ; buffer
  39.     (refresh)                         ;update the display
  40.     (assign_to_key "<Alt-Z>" "exit")  ;provide a sure way out
  41.     (display_file_name)
  42.     (process)                         ;recursively call brief
  43.     (delete_window)                   ;remove the zoom window
  44.     (set_buffer    zbuffer)           ;reattach original window
  45.     (attach_buffer zbuffer)           ;in case we switched
  46.     (display_file_name)
  47.     (assign_to_key "<Alt-Z>" "zoom_window")
  48.   )
  49. )   ;** end of zoom_window
  50.  
  51.