Convert consecutive FSF copyright years to ranges.
[bpt/emacs.git] / lisp / mouse.el
index 02ce487..c572263 100644 (file)
@@ -1,7 +1,6 @@
 ;;; mouse.el --- window system-independent mouse support
 
-;; Copyright (C) 1993, 1994, 1995, 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+;; Copyright (C) 1993-1995, 1999-2011  Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: hardware, mouse
@@ -185,6 +184,7 @@ items `Turn Off' and `Help'."
     (minor-mode-menu-from-indicator indicator)))
 
 (defun mouse-menu-major-mode-map ()
+  (run-hooks 'activate-menubar-hook 'menu-bar-update-hook)
   (let* (;; Keymap from which to inherit; may be null.
         (ancestor (mouse-menu-non-singleton
                    (and (current-local-map)
@@ -217,6 +217,7 @@ Otherwise return the whole menu."
   "Return a keymap equivalent to the menu bar.
 The contents are the items that would be in the menu bar whether or
 not it is actually displayed."
+  (run-hooks 'activate-menubar-hook 'menu-bar-update-hook)
   (let* ((local-menu (and (current-local-map)
                          (lookup-key (current-local-map) [menu-bar])))
         (global-menu (lookup-key global-map [menu-bar]))
@@ -1280,7 +1281,16 @@ regardless of where you click."
   (or mouse-yank-at-point (mouse-set-point click))
   (let ((primary
         (cond
-         ((fboundp 'x-get-selection-value) ; MS-DOS and MS-Windows
+         ((eq system-type 'windows-nt)
+          ;; MS-Windows emulates PRIMARY in x-get-selection, but not
+          ;; in x-get-selection-value (the latter only accesses the
+          ;; clipboard).  So try PRIMARY first, in case they selected
+          ;; something with the mouse in the current Emacs session.
+          (or (x-get-selection 'PRIMARY)
+              (x-get-selection-value)))
+         ((fboundp 'x-get-selection-value) ; MS-DOS and X.
+          ;; On X, x-get-selection-value supports more formats and
+          ;; encodings, so use it in preference to x-get-selection.
           (or (x-get-selection-value)
               (x-get-selection 'PRIMARY)))
          ;; FIXME: What about xterm-mouse-mode etc.?
@@ -2130,12 +2140,4 @@ choose a font."
 
 (provide 'mouse)
 
-;; This file contains the functionality of the old mldrag.el.
-(defalias 'mldrag-drag-mode-line 'mouse-drag-mode-line)
-(defalias 'mldrag-drag-vertical-line 'mouse-drag-vertical-line)
-(make-obsolete 'mldrag-drag-mode-line 'mouse-drag-mode-line "21.1")
-(make-obsolete 'mldrag-drag-vertical-line 'mouse-drag-vertical-line "21.1")
-(provide 'mldrag)
-
-;; arch-tag: 9a710ce1-914a-4923-9b81-697f7bf82ab3
 ;;; mouse.el ends here