home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / Apps / EmacsTeX / Emacs-3.0.1 / Source / lisp / eterm-fns.el < prev    next >
Encoding:
Text File  |  1995-06-12  |  18.8 KB  |  538 lines

  1. ;; Subroutines of Mouse handling for NeXT "Emacs" front end
  2. ;; Ripped off of the Sun windows support code
  3. ;; Copyright (C) 1987 Free Software Foundation, Inc.
  4.  
  5. ;; This file is NOT part of the standard GNU Emacs distribution.
  6.  
  7. ;; GNU Emacs is distributed in the hope that it will be useful,
  8. ;; but WITHOUT ANY WARRANTY.  No author or distributor
  9. ;; accepts responsibility to anyone for the consequences of using it
  10. ;; or for whether it serves any particular purpose or works at all,
  11. ;; unless he says so in writing.  Refer to the GNU Emacs General Public
  12. ;; License for full details.
  13.  
  14. ;; Everyone is granted permission to copy, modify and redistribute
  15. ;; GNU Emacs, but only under the conditions described in the
  16. ;; GNU Emacs General Public License.   A copy of this license is
  17. ;; supposed to have been given to you along with GNU Emacs so you
  18. ;; can know your rights and responsibilities.  It should be in a
  19. ;; file named COPYING.  Among other things, the copyright notice
  20. ;; and this notice must be preserved on all copies.
  21.  
  22. ;;; Apr 4 '90 jgm    Ripped off of sun-fns.el
  23. ;;(provide 'eterm-fns)
  24. ;;(require 'eterm-mouse)
  25. ;;;
  26. ;;; Functions for manipulating via the mouse and mouse-map definitions
  27. ;;; for accessing them.  Also definitons of mouse menus.
  28. ;;; This file you should freely modify to reflect you personal tastes.
  29. ;;;
  30. ;;; First half of file defines functions to implement mouse commands,
  31. ;;; Don't delete any of those, just add what ever else you need.
  32. ;;; Second half of file defines mouse bindings, do whatever you want there.
  33.  
  34. ;;;
  35. ;;;         Mouse Functions.
  36. ;;;
  37. ;;; These functions follow the eterm-mouse-handler convention of being called
  38. ;;; with three arguements: (window x-pos y-pos)
  39. ;;; This makes it easy for a mouse executed command to know where the mouse is.
  40. ;;; Use the macro "eval-in-window" to execute a function 
  41. ;;; in a temporarily selected window.
  42. ;;;
  43. ;;; If you have a function that must be called with other arguments
  44. ;;; bind the mouse button to an s-exp that contains the necessary parameters.
  45. ;;; See "minibuffer" bindings for examples.
  46. ;;;
  47. (defconst cursor-pause-milliseconds 300
  48.   "*Number of milliseconds to display alternate cursor (usually the mark)")
  49.  
  50. (defun indicate-region (&optional pause)
  51.   "Bounce cursor to mark for cursor-pause-milliseconds and back again"
  52.   (or pause (setq pause cursor-pause-milliseconds))
  53.   (let ((times 0))
  54.     (exchange-point-and-mark)
  55.     (if (fboundp 'sit-for-millisecs)
  56.     (sit-for-millisecs pause)
  57.       (sit-for 1))
  58.     (exchange-point-and-mark)))
  59.  
  60. ;      (while (< times 20)
  61. ;    (sit-for 0)
  62. ;    (setq times (1+ times))))
  63.  
  64.  
  65. ;;;
  66. ;;; Text buffer operations
  67. ;;;
  68. (defun mouse-move-point (window x y)
  69.   "Move point to mouse cursor."
  70.   (select-window window)
  71.   (move-to-loc x y)
  72.   (if (memq last-command    ; support the mouse-copy/delete/yank
  73.         '(mouse-copy mouse-delete mouse-yank-move))
  74.       (setq this-command 'mouse-yank-move))
  75.   )
  76.  
  77. (defun mouse-set-mark (window x y)
  78.   "Set mark at mouse cursor."
  79.   (eval-in-window window    ;; use this to get the unwind protect
  80.     (let ((point (point)))
  81.       (move-to-loc x y)
  82.       (set-mark (point))
  83.       (goto-char point)
  84.       (indicate-region)))
  85.   )
  86.  
  87. (defun mouse-set-mark-and-select (window x y)
  88.   "Set mark at mouse cursor, and select that window."
  89.   (select-window window)
  90.   (mouse-set-mark window x y)
  91.   )
  92.  
  93. ;;;
  94. ;;; Simple mouse dragging stuff: marking with button up
  95. ;;;
  96.  
  97. (defvar *mouse-drag-window* nil)
  98. (defvar *mouse-drag-x* -1)
  99. (defvar *mouse-drag-y* -1)
  100.  
  101. (defun mouse-drag-move-point (window x y)
  102.   "Move point to mouse cursor, and allow dragging."
  103.   (mouse-move-point window x y)
  104.   (setq *mouse-drag-window* window
  105.     *mouse-drag-x* x
  106.     *mouse-drag-y* y))
  107.  
  108. (defun mouse-drag-set-mark (window x y)
  109.   "The up click handler that goes with mouse-drag-move-point.
  110. If mouse is in same WINDOW but at different X or Y than when
  111. mouse-drag-move-point was last executed, set the mark at mouse."
  112.   (if (and (eq *mouse-drag-window* window)
  113.        (not (and (equal *mouse-drag-x* x)
  114.              (equal *mouse-drag-y* y))))
  115.       (mouse-set-mark-and-select window x y)
  116.     (setq this-command last-command))    ; this was just an upclick no-op.
  117.   )
  118.  
  119. (defun mouse-select-or-drag-move-point (window x y)
  120.   "Select window if not selected, otherwise do mouse-drag-move-point."
  121.   (if (eq (selected-window) window)
  122.       (mouse-drag-move-point window x y)
  123.     (mouse-select-window window x y)))
  124.  
  125. ;;;
  126. ;;; esoteria:
  127. ;;;
  128. (defun mouse-exch-pt-and-mark (window x y)
  129.   "Exchange point and mark."
  130.   (select-window window)
  131.   (exchange-point-and-mark)
  132.   )
  133.  
  134. (defun mouse-call-kbd-macro (window x y)
  135.   "Invokes last keyboard macro at mouse cursor."
  136.   (mouse-move-point window x y)
  137.   (call-last-kbd-macro)
  138.   )
  139.  
  140. (defun mouse-mark-thing (window x y)
  141.   "Set point and mark to text object using syntax table.
  142. The resulting region is put in the NeXT pasteboard.
  143. Left or right Paren syntax marks an s-expression.  
  144. Clicking at the end of a line marks the line including a trailing newline.  
  145. If it doesn't recognize one of these it marks the character at point."
  146.   (mouse-move-point window x y)
  147.   (if (eobp) (open-line 1))
  148.   (let* ((char (char-after (point)))
  149.          (syntax (char-syntax char)))
  150.     (cond
  151.      ((eq syntax ?w)            ; word.
  152.       (forward-word 1)
  153.       (set-mark (point))
  154.       (forward-word -1))
  155.      ;; try to include a single following whitespace (is this a good idea?)
  156.      ;; No, not a good idea since inconsistent.
  157.      ;;(if (eq (char-syntax (char-after (mark))) ?\ )
  158.      ;;    (set-mark (1+ (mark))))
  159.      ((eq syntax ?\( )            ; open paren.
  160.       (mark-sexp 1))
  161.      ((eq syntax ?\) )            ; close paren.
  162.       (forward-char 1)
  163.       (mark-sexp -1)
  164.       (exchange-point-and-mark))
  165.      ((eolp)                ; mark line if at end.
  166.       (set-mark (1+ (point)))
  167.       (beginning-of-line 1))
  168.      (t                    ; mark character
  169.       (set-mark (1+ (point)))))
  170.     (indicate-region))            ; display region boundary.
  171.   )
  172.  
  173. (defun mouse-kill-thing (window x y)
  174.   "Kill thing at mouse, and put point there."
  175.   (mouse-mark-thing window x y)
  176.   (eterm-send-region-to-cut-buffer-and-wipe (region-beginning) (region-end))
  177.   )
  178.  
  179. (defun mouse-kill-thing-there (window x y)
  180.   "Kill thing at mouse, leave point where it was.
  181. See mouse-mark-thing for a description of the objects recognized."
  182.   (eval-in-window window 
  183.     (save-excursion
  184.       (mouse-mark-thing window x y)
  185.       (eterm-send-region-to-cut-buffer-and-wipe (region-beginning) (region-end))))
  186.   )
  187.  
  188. (defun mouse-save-thing (window x y &optional quiet)
  189.   "Put thing at mouse in kill ring.
  190. See mouse-mark-thing for a description of the objects recognized."
  191.   (mouse-mark-thing window x y)
  192.   (eterm-send-region-to-cut-buffer (region-beginning) (region-end))
  193.   (if (not quiet) (message "Thing saved"))
  194.   )
  195.  
  196. (defun mouse-save-thing-there (window x y &optional quiet)
  197.   "Put thing at mouse in kill ring, leave point as is.
  198. See mouse-mark-thing for a description of the objects recognized."
  199.   (eval-in-window window
  200.     (save-excursion
  201.       (mouse-save-thing window x y quiet))))
  202.  
  203. ;;;
  204. ;;; Mouse yanking...
  205. ;;;
  206. (defun mouse-copy-thing (window x y)
  207.   "Put thing at mouse in kill ring, yank to point.
  208. See mouse-mark-thing for a description of the objects recognized."
  209.   (setq last-command 'not-kill)     ;Avoids appending to previous kills.
  210.   (mouse-save-thing-there window x y t)
  211.   (yank)
  212.   (setq this-command 'yank))
  213.  
  214. (defun mouse-move-thing (window x y)
  215.   "Kill thing at mouse, yank it to point.
  216. See mouse-mark-thing for a description of the objects recognized."
  217.   (setq last-command 'not-kill)     ;Avoids appending to previous kills.
  218.   (mouse-kill-thing-there window x y)
  219.   (yank)
  220.   (setq this-command 'yank))
  221.  
  222. (defun mouse-yank-at-point (&optional window x y)
  223.   "Yank from kill-ring at point; then cycle thru kill ring."
  224.   (if (eq last-command 'yank)
  225.       (let ((before (< (point) (mark))))
  226.     (delete-region (point) (mark))
  227.     (rotate-yank-pointer 1)
  228.     (insert (car kill-ring-yank-pointer))
  229.     (if before (exchange-point-and-mark)))
  230.     (yank))
  231.   (setq this-command 'yank))
  232.  
  233. (defun mouse-yank-at-mouse (window x y)
  234.   "Yank from kill-ring at mouse; then cycle thru kill ring."
  235.   (mouse-move-point window x y)
  236.   (mouse-yank-at-point window x y))
  237.  
  238. (defun mouse-save/delete/yank (&optional window x y)
  239.   "Context sensitive save/delete/yank.
  240. Consecutive clicks perform as follows:
  241.     * first click saves region to kill ring,
  242.     * second click kills region,
  243.     * third click yanks from kill ring,
  244.     * subsequent clicks cycle thru kill ring.
  245. If mouse-move-point is performed after the first or second click,
  246. the next click will do a yank, etc.  Except for a possible mouse-move-point,
  247. this command is insensitive to mouse location."
  248.   (cond
  249.    ((memq last-command '(mouse-delete yank mouse-yank-move))    ; third+ click
  250.     (mouse-yank-at-point))
  251.    ((eq last-command 'mouse-copy)    ; second click
  252.     (kill-region (region-beginning) (region-end))
  253.     (setq this-command 'mouse-delete))
  254.    (t                    ; first click
  255.     (copy-region-as-kill (region-beginning) (region-end))
  256.     (message "Region saved")
  257.     (setq this-command 'mouse-copy))
  258.    ))
  259.  
  260.  
  261. (defun mouse-split-horizontally (window x y)
  262.   "Splits the window horizontally at mouse cursor."
  263.   (eval-in-window window (split-window-horizontally (1+ x))))
  264.  
  265. (defun mouse-split-vertically (window x y)
  266.   "Split the window vertically at the mouse cursor."
  267.   (eval-in-window window (split-window-vertically (1+ y))))
  268.  
  269. (defun mouse-select-window (window x y)
  270.   "Selects the window, restoring point."
  271.   (select-window window))
  272.  
  273. (defun mouse-delete-other-windows (window x y)
  274.   "Deletes all windows except the one mouse is in."
  275.   (delete-other-windows window))
  276.  
  277. (defun mouse-delete-window (window x y)
  278.   "Deletes the window mouse is in."
  279.   (delete-window window))
  280.  
  281. (defun mouse-undo (window x y)
  282.   "Invokes undo in the window mouse is in."
  283.   (eval-in-window window (undo)))
  284.  
  285. ;;;
  286. ;;; Scroll operations
  287. ;;;
  288.  
  289. ;;; The move-to-window-line is used below because otherwise
  290. ;;; scrolling a non-selected process window with the mouse, after
  291. ;;; the process has written text past the bottom of the window,
  292. ;;; gives an "End of buffer" error, and then scrolls.  The
  293. ;;; move-to-window-line seems to force recomputing where things are.
  294. (defun mouse-scroll-up (window x y)
  295.   "Scrolls the window upward."
  296.   (eval-in-window window (move-to-window-line 1) (scroll-up nil)))
  297.  
  298. (defun mouse-scroll-down (window x y)
  299.   "Scrolls the window downward."
  300.   (eval-in-window window (scroll-down nil)))
  301.  
  302. (defun mouse-scroll-proportional (window x y)
  303.   "Scrolls the window proportionally corresponding to window
  304. relative X divided by window width."
  305.   (eval-in-window window 
  306.     (if (>= x (1- (window-width)))
  307.     ;; When x is maximun (equal to or 1 less than window width),
  308.     ;; goto end of buffer.  We check for this special case
  309.     ;; becuase the calculated goto-char often goes short of the
  310.     ;; end due to roundoff error, and we often really want to go
  311.     ;; to the end.
  312.     (goto-char (point-max))
  313.       (progn
  314.     (goto-char (+ (point-min)    ; For narrowed regions.
  315.               (* x (/ (- (point-max) (point-min))
  316.                   (1- (window-width))))))
  317.     (beginning-of-line))
  318.       )
  319.     (what-cursor-position)        ; Report position.
  320.     ))
  321.  
  322. (defun mouse-line-to-top (window x y)
  323.   "Scrolls the line at the mouse cursor up to the top."
  324.   (eval-in-window window (scroll-up y)))
  325.  
  326. (defun mouse-top-to-line (window x y)
  327.   "Scrolls the top line down to the mouse cursor."
  328.   (eval-in-window window (scroll-down y)))
  329.  
  330. (defun mouse-line-to-bottom (window x y)
  331.   "Scrolls the line at the mouse cursor to the bottom."
  332.   (eval-in-window window (scroll-up (+ y (- 2 (window-height))))))
  333.  
  334. (defun mouse-bottom-to-line (window x y)
  335.   "Scrolls the bottom line up to the mouse cursor."
  336.   (eval-in-window window (scroll-down (+ y (- 2 (window-height))))))
  337.  
  338. (defun mouse-line-to-middle (window x y)
  339.   "Scrolls the line at the mouse cursor to the middle."
  340.   (eval-in-window window (scroll-up (- y -1 (/ (window-height) 2)))))
  341.  
  342. (defun mouse-middle-to-line (window x y)
  343.   "Scrolls the line at the middle to the mouse cursor."
  344.   (eval-in-window window (scroll-up (- (/ (window-height) 2) y 1))))
  345.  
  346.  
  347.  
  348. ;;;
  349. ;;; minibuffer
  350. ;;;
  351. (defun mini-move-point (window x y)
  352.   ;; -6 is good for most common cases
  353.   (mouse-move-point window (- x 6) 0))
  354.  
  355. (defun mini-set-mark-and-select (window x y)
  356.   ;; -6 is good for most common cases
  357.   (mouse-set-mark-and-select window (- x 6) 0))
  358.  
  359.  
  360. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
  361. ;;; Buffer-mode Mouse commands
  362. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
  363.  
  364. (defun Buffer-at-mouse (w x y)
  365.   "Calls Buffer-menu-buffer from mouse click."
  366.   (save-window-excursion 
  367.     (mouse-move-point w x y)
  368.     (beginning-of-line)
  369.     (Buffer-menu-buffer t)))
  370.  
  371. (defun mouse-buffer-bury (w x y)
  372.   "Bury the indicated buffer."
  373.   (bury-buffer (Buffer-at-mouse w x y))
  374.   )
  375.  
  376. (defun mouse-buffer-select (w x y)
  377.   "Put the indicated buffer in selected window."
  378.   (switch-to-buffer (Buffer-at-mouse w x y))
  379.   (list-buffers)
  380.   )
  381.  
  382. (defun mouse-buffer-delete (w x y)
  383.   "mark indicated buffer for delete"
  384.   (save-window-excursion
  385.     (mouse-move-point w x y)
  386.     (Buffer-menu-delete)
  387.     ))
  388.  
  389. (defun mouse-buffer-execute (w x y)
  390.   "execute buffer-menu selections"
  391.   (save-window-excursion
  392.     (mouse-move-point w x y)
  393.     (Buffer-menu-execute)
  394.     ))
  395.   
  396. (defun enable-mouse-in-buffer-list ()
  397.   "Call this to enable mouse selections in *Buffer List*
  398.     LEFT puts the indicated buffer in the selected window.
  399.     SHIFT-LEFT buries the indicated buffer.
  400.     RIGHT marks the indicated buffer for deletion.
  401.     SHIFT-RIGHT deletes the marked buffers.
  402. To unmark a buffer marked for deletion, select it with LEFT."
  403.   (save-window-excursion
  404.     (list-buffers)            ; Initialize *Buffer List*
  405.     (set-buffer "*Buffer List*")
  406.     (local-set-mouse '(text shift left) 'mouse-buffer-bury)
  407.     (local-set-mouse '(text left) 'mouse-buffer-select)        
  408.     (local-set-mouse '(text right) 'mouse-buffer-delete)
  409.     (local-set-mouse '(text shift right) 'mouse-buffer-execute)
  410.     )
  411.   )
  412.  
  413.  
  414. ;;;*******************************************************************
  415. ;;;
  416. ;;;           Global Mouse Bindings.
  417. ;;;
  418. ;;; There is some sense to this mouse binding madness:
  419. ;;; LEFT and RIGHT scrolls are inverses.
  420. ;;; SHIFT makes an opposite meaning in the scroll bar.
  421. ;;; META makes the scrollbar functions work in the text region.
  422. ;;; RIGHT operates the mark
  423. ;;; LEFT operates at point
  424.  
  425. ;;; META commands are generally non-destructive,
  426. ;;; SHIFT is a little more dangerous.
  427. ;;; CONTROL is for the really complicated ones.
  428.  
  429. ;;; CONTROL-META-SHIFT-RIGHT gives help on that region.
  430. ;;; (or so it would if I had time to implement it --jgm)
  431.  
  432. ;;;
  433. ;;; Text Region mousemap
  434. ;;;
  435. ;; The basics: Point, Mark, Menu, Sun-Select:
  436. (global-set-mouse '(text        left)    'mouse-drag-move-point)
  437. (global-set-mouse '(text     up left)    'mouse-drag-set-mark)
  438. (global-set-mouse '(text shift  left)    'mouse-exch-pt-and-mark)
  439.  
  440. (global-set-mouse '(text    right)    'mouse-set-mark-and-select)
  441.  
  442. ;; The Slymoblics multi-command for Save, Kill, Copy, Move:
  443. (global-set-mouse '(text shift    right)    'mouse-save/delete/yank)
  444.  
  445. ;; Save, Kill, Copy, Move Things:
  446. ;; control-left composes with control middle/right to produce copy/move
  447. (global-set-mouse '(text control right        )    'mouse-save-thing-there)
  448. ;(global-set-mouse '(text control right      )    'mouse-kill-thing-there)
  449. (global-set-mouse '(text control     left)    'mouse-yank-at-point)
  450.  
  451. ;(global-set-mouse '(text control middle    left)    'mouse-copy-thing)
  452. ;(global-set-mouse '(text control right    left)    'mouse-move-thing)
  453. ;(global-set-mouse '(text control right middle)    'mouse-mark-thing)
  454.  
  455. ;; The Universal mouse help command (press all buttons):
  456. ;(global-set-mouse '(text shift  control meta right)    'mouse-help-region)
  457.  
  458. ;;; Meta in Text Region is like meta version in scrollbar:
  459. (global-set-mouse '(text meta        left)    'mouse-line-to-top)
  460. (global-set-mouse '(text meta shift  left)    'mouse-line-to-bottom)
  461. ;(global-set-mouse '(text meta         middle)    'mouse-line-to-middle)
  462. ;(global-set-mouse '(text meta shift   middle)    'mouse-middle-to-line)
  463. ;(global-set-mouse '(text meta control middle)    'mouse-split-vertically)
  464. (global-set-mouse '(text meta        right)    'mouse-top-to-line)
  465. (global-set-mouse '(text meta shift  right)    'mouse-bottom-to-line)
  466.  
  467. ;; Miscellaneous:
  468. (global-set-mouse '(text meta control left)    'mouse-call-kbd-macro)
  469. (global-set-mouse '(text meta control right)    'mouse-undo)
  470.  
  471. ;;;
  472. ;;; Scrollbar mousemap.
  473. ;;; Are available in the Scrollbar Region, or with Meta Text (or Meta Scrollbar)
  474. ;;;
  475. (global-set-mouse '(scrollbar        left)    'mouse-line-to-top)
  476. (global-set-mouse '(scrollbar shift  left)    'mouse-line-to-bottom)
  477.  
  478. ;(global-set-mouse '(scrollbar         middle)    'mouse-line-to-middle)
  479. ;(global-set-mouse '(scrollbar shift   middle)    'mouse-middle-to-line)
  480. ;(global-set-mouse '(scrollbar control middle)    'mouse-split-vertically)
  481.  
  482. (global-set-mouse '(scrollbar        right)    'mouse-top-to-line)
  483. (global-set-mouse '(scrollbar shift  right)    'mouse-bottom-to-line)
  484.  
  485. (global-set-mouse '(scrollbar meta        left)        'mouse-line-to-top)
  486. (global-set-mouse '(scrollbar meta shift  left)        'mouse-line-to-bottom)
  487. ;(global-set-mouse '(scrollbar meta         middle)    'mouse-line-to-middle)
  488. ;(global-set-mouse '(scrollbar meta shift   middle)    'mouse-middle-to-line)
  489. ;(global-set-mouse '(scrollbar meta control middle)    'mouse-split-vertically)
  490. (global-set-mouse '(scrollbar meta        right)    'mouse-top-to-line)
  491. (global-set-mouse '(scrollbar meta shift  right)    'mouse-bottom-to-line)
  492.  
  493. ;; And the help menu:
  494. ;(global-set-mouse '(scrollbar shift  control meta right) 'mouse-help-region)
  495.  
  496. ;;;
  497. ;;; Modeline mousemap.
  498. ;;;
  499. ;;; Note: meta of any single button selects window.
  500.  
  501. (global-set-mouse '(modeline      left)    'mouse-scroll-up)
  502. (global-set-mouse '(modeline meta left)    'mouse-select-window)
  503.  
  504. ;(global-set-mouse '(modeline         middle)    'mouse-scroll-proportional)
  505. ;(global-set-mouse '(modeline meta    middle)    'mouse-select-window)
  506. ;(global-set-mouse '(modeline control middle)    'mouse-split-horizontally)
  507.  
  508. (global-set-mouse '(modeline      right)    'mouse-scroll-down)
  509. (global-set-mouse '(modeline meta right)    'mouse-select-window)
  510.  
  511. ;;; control-left selects this window, control-right deletes it.
  512. (global-set-mouse '(modeline control left)    'mouse-delete-other-windows)
  513. (global-set-mouse '(modeline control right)    'mouse-delete-window)
  514.  
  515. ;; in case of confusion, just select it:
  516. (global-set-mouse '(modeline control left right)'mouse-select-window)
  517.  
  518. ;; even without confusion (and without the keyboard) select it:
  519. (global-set-mouse '(modeline left right)    'mouse-select-window)
  520.  
  521. ;; And the help menu:
  522. ;(global-set-mouse '(modeline shift  control meta right)    'mouse-help-region)
  523.  
  524. ;;;
  525. ;;; Minibuffer Mousemap
  526. ;;; Demonstrating some variety:
  527. ;;;
  528. (global-set-mouse '(minibuffer left)        'mini-move-point)
  529. (global-set-mouse '(minibuffer right)    'mini-set-mark-and-select)
  530.  
  531. (global-set-mouse '(minibuffer shift   left) '(previous-complex-command 1))
  532. (global-set-mouse '(minibuffer control left) '(next-complex-command 1))
  533.  
  534. (global-set-mouse '(minibuffer shift   right) '(next-complex-command 1))
  535. (global-set-mouse '(minibuffer control right) '(previous-complex-command 1))
  536.  
  537. ;(global-set-mouse '(minibuffer shift  control meta right)  'mouse-help-region)
  538.