home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / alt / lucidem / help / 845 < prev    next >
Encoding:
Text File  |  1993-01-06  |  3.0 KB  |  79 lines

  1. Newsgroups: alt.lucid-emacs.help
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!uwm.edu!linac!uchinews!spssig.spss.com!bobhays
  3. From: bobhays@spss.com (Bob Hays)
  4. Subject: Re: Left mouse button deselects before popup
  5. Message-ID: <C0Fu6v.6I8@spss.com>
  6. Sender: news@spss.com (Net News Admin)
  7. Organization: SPSS, Inc.
  8. References:  <C0FqCF.585@spss.com>
  9. Date: Wed, 6 Jan 1993 15:11:18 GMT
  10. Lines: 67
  11.  
  12. In article <C0FqCF.585@spss.com>, bobhays@spss.com (Bob Hays) writes:
  13. > I'd like to have some popup menu items that act on the current region.
  14. > However, when the right mouse button goes down the current selection
  15. > turns off.  Is there an easy (and easy to apply in the future) way to
  16. > turn this "feature" off?
  17.  
  18. I kind netter recommended adding
  19.  
  20.   (setq zmacs-region-stays t)
  21.  
  22. to my menu popup procedure.  This fixed the immediate problem but not
  23. the final problem - active regions are still not working when I lift
  24. the mouse button.  Here is my (early, tentative) popup menu code for
  25. c-mode:
  26.  
  27. (defun c-menu (e)
  28.   (interactive "e")
  29.   (setq zmacs-region-stays t)
  30.   (if (null (mark))
  31.       (progn
  32.         (setq c-menu (nconc (list "C" "C Mode:" "----")
  33.                           (list
  34.                            ["Goto Line" goto-line t]
  35.                            ["Indent Region" 'indent-region nil]
  36.                            ["Comment Region" 'comment-region nil]
  37.                            ["Uncomment Region" 'uncomment-region nil]
  38.                            ["Recomment Region" 'recomment-region nil]
  39.                            ["Compile" compile t]
  40.                            )
  41.                           )
  42.               )
  43.         )
  44.       (progn
  45.         (setq c-menu (nconc (list "C" "C Mode:" "----")
  46.                           (list
  47.                            ["Goto Line" goto-line t]
  48.                            ["Indent Region" 'indent-region t]
  49.                            ["Comment Region" 'comment-region t]
  50.                            ["Uncomment Region" 'uncomment-region t]
  51.                            ["Recomment Region" 'recomment-region t]
  52.                            ["Compile" compile t]
  53.                            )
  54.                           )
  55.               )
  56.         )
  57.       )
  58.   (popup-menu c-menu)
  59. )
  60.  
  61. (define-key c-mode-map 'button3 'c-menu)
  62.  
  63. I'd like menu items that require regions to be insensitive when no
  64. region is active.  That part works.  But, when I have a region and
  65. select, say, Indent Region, the region becomes inactive and nothing
  66. happens, i.e. the region is not indented.  It works from the menu bar,
  67. BTW.  Can anyone suggest yet more things I should try?
  68.  
  69. Thanks and have fun! - Bob
  70.  
  71. P.S.  Finalizing the menus is the last step here for unleashing our
  72. users on lucid! - RLH
  73.  
  74. -- 
  75. ===============================================================================
  76. The opinions expressed above are those of Bob Hays and not SPSS, Inc.
  77.  bobhays@spss.com  Phone: (312) 329-3529 | "I'm hovering like a fly, waiting
  78.                    Fax:   (312) 329-3657 |  for a windshield on a freeway" -PG
  79.