]> code.delx.au - gnu-emacs/blobdiff - lisp/mouse.el
Use require instead of eval-and-compile.
[gnu-emacs] / lisp / mouse.el
index 01f4479465fb699e24a4d487e710a769cc4c2080..9b80ccc0cf5062b51a0e5449cb09f6d4d11b3465 100644 (file)
@@ -166,7 +166,7 @@ Default to the Edit menu if the major mode doesn't define a menu."
          (lookup-key menubar (vector (car submap)))))))
 
 (defun mouse-popup-menubar (event prefix)
-  "Pops up a menu equivalent to the menu bar a keyboard EVENT with PREFIX.
+  "Pop up a menu equivalent to the menu bar for keyboard EVENT with PREFIX.
 The contents are the items that would be in the menu bar whether or
 not it is actually displayed."
   (interactive "@e \nP")
@@ -895,12 +895,12 @@ If DIR is positive skip forward; if negative, skip backward."
           (while (and (not (eobp)) (= (following-char) char))
             (forward-char 1))))))
 
-;; Return a list of region bounds based on START and END according to MODE.
-;; If MODE is 0 then set point to (min START END), mark to (max START END).
-;; If MODE is 1 then set point to start of word at (min START END),
-;; mark to end of word at (max START END).
-;; If MODE is 2 then do the same for lines.
 (defun mouse-start-end (start end mode)
+"Return a list of region bounds based on START and END according to MODE.
+If MODE is 0 then set point to (min START END), mark to (max START END).
+If MODE is 1 then set point to start of word at (min START END),
+mark to end of word at (max START END).
+If MODE is 2 then do the same for lines."
   (if (> start end)
       (let ((temp start))
         (setq start end
@@ -2175,11 +2175,12 @@ and selects that window."
 (defun mouse-set-font (&rest fonts)
   "Select an emacs font from a list of known good fonts and fontsets."
   (interactive
-   (and (display-multi-font-p)
-       (x-popup-menu
-        last-nonmenu-event
-        ;; Append list of fontsets currently defined.
-        (append x-fixed-font-alist (list (generate-fontset-menu))))))
+   (progn (unless (display-multi-font-p)
+           (error "Cannot change fonts on this display"))
+         (x-popup-menu
+          last-nonmenu-event
+          ;; Append list of fontsets currently defined.
+          (append x-fixed-font-alist (list (generate-fontset-menu))))))
   (if fonts
       (let (font)
        (while fonts
@@ -2191,8 +2192,7 @@ and selects that window."
            (error
             (setq fonts (cdr fonts)))))
        (if (null font)
-           (error "Font not found")))
-    (message "Cannot change fonts on this display")))
+           (error "Font not found")))))
 \f
 ;;; Bindings for mouse commands.
 
@@ -2204,6 +2204,10 @@ and selects that window."
 (global-set-key [double-mouse-1] 'mouse-set-point)
 (global-set-key [triple-mouse-1] 'mouse-set-point)
 
+;; Clicking on the fringes causes hscrolling:
+(global-set-key [left-fringe mouse-1]  'mouse-set-point)
+(global-set-key [right-fringe mouse-1] 'mouse-set-point)
+
 (global-set-key [mouse-2]      'mouse-yank-at-click)
 (global-set-key [mouse-3]      'mouse-save-then-kill)
 
@@ -2245,4 +2249,5 @@ and selects that window."
 (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