home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: alt.lucid-emacs.help
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!uwm.edu!linac!uchinews!spssig.spss.com!bobhays
- From: bobhays@spss.com (Bob Hays)
- Subject: Re: Left mouse button deselects before popup
- Message-ID: <C0Fu6v.6I8@spss.com>
- Sender: news@spss.com (Net News Admin)
- Organization: SPSS, Inc.
- References: <C0FqCF.585@spss.com>
- Date: Wed, 6 Jan 1993 15:11:18 GMT
- Lines: 67
-
- In article <C0FqCF.585@spss.com>, bobhays@spss.com (Bob Hays) writes:
- > I'd like to have some popup menu items that act on the current region.
- > However, when the right mouse button goes down the current selection
- > turns off. Is there an easy (and easy to apply in the future) way to
- > turn this "feature" off?
-
- I kind netter recommended adding
-
- (setq zmacs-region-stays t)
-
- to my menu popup procedure. This fixed the immediate problem but not
- the final problem - active regions are still not working when I lift
- the mouse button. Here is my (early, tentative) popup menu code for
- c-mode:
-
- (defun c-menu (e)
- (interactive "e")
- (setq zmacs-region-stays t)
- (if (null (mark))
- (progn
- (setq c-menu (nconc (list "C" "C Mode:" "----")
- (list
- ["Goto Line" goto-line t]
- ["Indent Region" 'indent-region nil]
- ["Comment Region" 'comment-region nil]
- ["Uncomment Region" 'uncomment-region nil]
- ["Recomment Region" 'recomment-region nil]
- ["Compile" compile t]
- )
- )
- )
- )
- (progn
- (setq c-menu (nconc (list "C" "C Mode:" "----")
- (list
- ["Goto Line" goto-line t]
- ["Indent Region" 'indent-region t]
- ["Comment Region" 'comment-region t]
- ["Uncomment Region" 'uncomment-region t]
- ["Recomment Region" 'recomment-region t]
- ["Compile" compile t]
- )
- )
- )
- )
- )
- (popup-menu c-menu)
- )
-
- (define-key c-mode-map 'button3 'c-menu)
-
- I'd like menu items that require regions to be insensitive when no
- region is active. That part works. But, when I have a region and
- select, say, Indent Region, the region becomes inactive and nothing
- happens, i.e. the region is not indented. It works from the menu bar,
- BTW. Can anyone suggest yet more things I should try?
-
- Thanks and have fun! - Bob
-
- P.S. Finalizing the menus is the last step here for unleashing our
- users on lucid! - RLH
-
- --
- ===============================================================================
- The opinions expressed above are those of Bob Hays and not SPSS, Inc.
- bobhays@spss.com Phone: (312) 329-3529 | "I'm hovering like a fly, waiting
- Fax: (312) 329-3657 | for a windshield on a freeway" -PG
-