Maybe there is an obvious way to do what I'm asking, but since I don't
know it, I tried hacking up something like this. It almost works the
way I expect, until I drag a window's scrollbar. Then things run amok.

In my .emacs:

;; Don't show a stupid font context menu when shift-clicking a buffer.
(global-set-key [S-mouse-1] 'dave-shift-mouse-select)
(global-set-key [S-down-mouse-1] 'ignore)

(defun dave-shift-mouse-select (event)
  "Set the mark and then move point to the position clicked on with
the mouse.
This should be bound to a mouse click event type."
  (interactive "e")
  (mouse-minibuffer-check event)
  (if mark-active (exchange-point-and-mark))
  (set-mark-command nil)
  ;; Use event-end in case called from mouse-drag-region.
  ;; If EVENT is a click, event-end and event-start give same value.
  (posn-set-point (event-end event)))


On Nov 5, 10:41 pm, Dave Peck <[EMAIL PROTECTED]> wrote:
> Almost what I'm looking for. I want [S-mouse-1] to map to a function
> which:
> 1. Sets the mark to the previous point location
> 2. Sets the point to the shift-click location
> AKA, I expect that shift-click should select a region.
> This is the behavior of all standard OSX editors and I think it's much
> more useful than showing a font menu on shift-click.
> -Dave
> On Nov 5, 7:56 pm, Seiji Zenitani <[EMAIL PROTECTED]> wrote:
> > On 2007/11/05, at 17:11, Dave Peck wrote:
> > > Hi all,
> > > I'm happily using Carbon Emacs on my new Leopard machine.
> > > Often in standard OSX editors I will select a large region by placing
> > > the cursor where I want to start, scrolling to the end of the region,
> > > and shift-clicking to select everything from the original cursor
> > > placement to my final click.
> > > When I shift click with Carbon Emacs, I get a font context menu. How
> > > can I prevent this from happening?
> > > Thanks,
> > > Dave
> > You can put the below line(s) to your .emacs.el.
> > You can choose any function (e.g. 'ignore or 'mode-line-...) for shift
> > +clicking.
> > (global-set-key [S-down-mouse-1] 'ignore)
> > (global-set-key [S-down-mouse-1] 'mode-line-mode-menu)
> > Seiji

"Carbon Emacs" group mailing list.
To post to this group, send email to
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at

Reply via email to