• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/

Lines Matching +defs:delete +defs:selection +defs:mode

98 ;; Provide a mode-specific menu on a mouse button.
125 ;; mouse-major-mode-menu was using a weird:
152 ;; mouse-major-mode-menu was using `command-execute' instead.
155 (defvar mouse-major-mode-menu-prefix) ; dynamically bound
157 (defun mouse-major-mode-menu (event &optional prefix)
158 "Pop up a mode-specific menu of mouse commands.
159 Default to the Edit menu if the major mode doesn't define a menu."
161 ;; the mode's commands may not make sense.
163 ;; Let the mode update its menus first.
165 (let* (;; This is where mouse-major-mode-menu-prefix
168 (mouse-major-mode-menu-prefix nil)
170 (ancestor (mouse-major-mode-menu-1
176 (make-sparse-keymap (concat mode-name " Mode"))
186 ;;;(defun mouse-major-mode-menu-compute-equiv-keys (menu)
197 ;;; (mouse-major-mode-menu-compute-equiv-keys tail))))
200 ;; Given a mode's menu bar keymap,
204 (defun mouse-major-mode-menu-1 (menubar)
216 (setq mouse-major-mode-menu-prefix (list (car submap)))
233 (minor-mode-menus
237 (let* ((minor-mode (car menu))
246 minor-mode)))
250 (minor-mode-key-binding [menu-bar])))
256 (cons (concat mode-name " Mode Menu")
266 minor-mode-menus)
270 "Popup a menu like either `mouse-major-mode-menu' or `mouse-popup-menubar'.
275 (mouse-major-mode-menu event prefix)))
288 (defun mouse-delete-window (click)
295 (delete-window (posn-window (event-start click)))))
318 (delete-window window)))
320 (defun mouse-delete-other-windows ()
323 (delete-other-windows))
398 (defun mouse-drag-mode-line-1 (start-event mode-line-p)
399 "Change the height of a window by dragging on the mode or header line.
401 MODE-LINE-P non-nil means dragging a mode line; nil means a header line."
418 mode-line-p
464 (cond (mode-line-p
485 (if mode-line-p
502 mode-line-p
506 (defun mouse-drag-mode-line (start-event)
507 "Change the height of a window by dragging on the mode line."
509 (mouse-drag-mode-line-1 start-event t))
526 (mouse-drag-mode-line-1 start-event nil))))
659 (or transient-mark-mode
675 ;; Set transient-mark-mode for a little while.
676 (if (memq transient-mark-mode '(nil identity))
677 (setq transient-mark-mode 'only))
739 ;; Create an overlay and immediately delete it, to get "overlay in no buffer".
742 (delete-overlay ol)
746 (defvar mouse-selection-click-count 0)
748 (defvar mouse-selection-click-count-buffer nil)
754 In Transient Mark mode, the highlighting remains as long as the mark
872 (defun mouse-move-drag-overlay (ol start end mode)
884 (let ((range (mouse-start-end start end mode)))
894 (setq mouse-selection-click-count-buffer (current-buffer))
911 ;; Don't count the mode line.
928 (setq mouse-selection-click-count click-count)
1018 (delete-overlay mouse-drag-overlay)
1037 (delete-overlay mouse-drag-overlay)
1082 (delete-overlay mouse-drag-overlay)))))
1117 (defun mouse-start-end (start end mode)
1127 (setq mode (mod mode 3))
1128 (cond ((= mode 0)
1130 ((and (= mode 1)
1139 ((and (= mode 1)
1148 ((and (= mode 1)
1173 ((= mode 1)
1182 ((= mode 2)
1225 (defcustom mouse-region-delete-keys '([delete] [deletechar] [backspace])
1234 (x-lost-selection-functions
1235 (when (boundp 'x-lost-selection-functions)
1236 (copy-sequence x-lost-selection-functions))))
1237 (add-hook 'x-lost-selection-functions
1242 (if transient-mark-mode
1243 (delete-overlay mouse-drag-overlay)
1260 (not (member key mouse-region-delete-keys)))))
1271 ;; If we lost the selection, just turn off the highlighting.
1273 ;; For certain special keys, delete the region.
1274 (if (member key mouse-region-delete-keys)
1281 (setq this-original-command 'delete-region)
1290 (unless transient-mark-mode
1291 (delete-overlay mouse-drag-overlay))))
1305 (or transient-mark-mode
1333 (setq mouse-selection-click-count 0)
1338 This does not delete the region; it acts like \\[kill-ring-save]."
1345 ;;; This function used to delete the text between point and the mouse
1353 (defun mouse-save-then-kill-delete-region (beg end)
1359 ;; just delete.
1360 (delete-region beg end)
1362 ;; First, delete just one char, so in case buffer is being modified
1365 (delete-region beg
1371 ;; Now delete the rest of the specified region,
1375 (error "Lossage in mouse-save-then-kill-delete-region"))
1376 (delete-region beg end))
1392 which prepares for a second click to delete the text.
1395 selection through the word or line clicked on. If you do this
1396 again in a different position, it extends the selection again.
1397 If you do this twice in the same position, the selection is killed."
1409 (and (mark t) (> (mod mouse-selection-click-count 3) 0)
1411 (eq mouse-selection-click-count-buffer
1419 mouse-selection-click-count)))
1437 (mouse-save-then-kill-delete-region (mark) (point))
1438 (setq mouse-selection-click-count 0)
1445 ;; mouse-save-then-kill, delete the text from the buffer.
1447 (mouse-save-then-kill-delete-region (point) (mark))
1451 ;; We are adjusting an old selection or creating a new one.
1454 (and mark-active transient-mark-mode)
1458 (not transient-mark-mode))))
1459 ;; We have a selection or suitable region, so adjust it.
1492 (delete-overlay ol)
1493 (overlay-put ol 'face 'secondary-selection)
1495 "An overlay which records the current secondary selection.
1496 It is deleted when there is no secondary selection.")
1500 ;; A marker which records the specified first end for a secondary selection.
1505 "Set one end of the secondary selection to the position clicked on.
1507 and complete the secondary selection."
1512 ;; Cancel any preexisting secondary selection.
1513 (delete-overlay mouse-secondary-overlay)
1521 "Set the secondary selection to the text that the mouse is dragged over.
1532 (x-set-selection
1538 "Set the secondary selection to the text that the mouse is dragged over.
1541 The function returns a non-nil value if it creates a secondary selection."
1552 ;; Don't count the mode line.
1558 ;; Double or triple press: make an initial selection
1567 ;; Single-press: cancel any preexisting secondary selection.
1571 (delete-overlay mouse-secondary-overlay))
1609 (delete-overlay mouse-secondary-overlay)
1610 (x-set-selection 'SECONDARY nil)
1616 (x-set-selection
1622 "Insert the secondary selection at the position clicked on.
1630 (insert (x-get-selection 'SECONDARY)))
1633 "Kill the text in the secondary selection.
1638 must be the one that the secondary selection is in. This requirement
1647 (error "Select or click on the buffer where the secondary selection is")))
1652 (delete-overlay mouse-secondary-overlay)
1653 ;;; (x-set-selection 'SECONDARY nil)
1663 which prepares for a second click with this command to delete the text.
1665 If you have already made a secondary selection in that buffer,
1666 this command extends or retracts the selection to where you click.
1668 again. If you do this twice in the same position, it kills the selection."
1711 (mouse-save-then-kill-delete-region
1716 (delete-overlay mouse-secondary-overlay)))
1722 ;; mouse-secondary-save-then-kill, delete the text from the buffer.
1724 (mouse-save-then-kill-delete-region
1728 (delete-overlay mouse-secondary-overlay))
1730 ;; We have a selection, so adjust it.
1756 ;; All we have is one end of a selection,
1764 (x-set-selection 'SECONDARY
1777 (defcustom mouse-buffer-menu-mode-mult 4
1778 "*Group the buffers by the major mode groups on \\[mouse-buffer-menu]?
1781 `mouse-buffer-menu-mode-groups') or just by menu length.
1782 Set to 1 (or even 0!) if you want to group by major mode always, and to
1788 (defvar mouse-buffer-menu-mode-groups
1801 If the major mode's name string matches REGEXP, use GROUPNAME instead.")
1804 "Pop up a menu of buffers for selection with the mouse.
1809 (let ((buffers (buffer-list)) alist menu split-by-major-mode sum-of-squares)
1816 (let* ((adjusted-major-mode major-mode) elt)
1817 (let ((tail mouse-buffer-menu-mode-groups))
1819 (if (string-match (car (car tail)) mode-name)
1820 (setq adjusted-major-mode (cdr (car tail))))
1822 (setq elt (assoc adjusted-major-mode split-by-major-mode))
1824 (setq elt (list adjusted-major-mode
1825 (if (stringp adjusted-major-mode)
1826 adjusted-major-mode
1827 mode-name))
1828 split-by-major-mode (cons elt split-by-major-mode)))
1832 ;; Compute the sum of squares of sizes of the major-mode buckets.
1833 (let ((tail split-by-major-mode))
1840 (if (< (* sum-of-squares mouse-buffer-menu-mode-mult)
1845 (setq split-by-major-mode
1846 (sort split-by-major-mode
1849 ;; Make a separate submenu for each major mode
1852 (while (and split-by-major-mode
1853 (and (> (length (car split-by-major-mode)) 3)
1855 (let ((this-mode-list (mouse-buffer-menu-alist
1856 (cdr (cdr (car split-by-major-mode))))))
1857 (and this-mode-list
1860 (nth 1 (car split-by-major-mode))
1861 this-mode-list)
1864 (- buffers-left (length (cdr (car split-by-major-mode)))))
1865 (setq split-by-major-mode (cdr split-by-major-mode)))
1868 (if split-by-major-mode
1871 ;; we don't need split-by-major-mode any more,
1873 (apply 'nconc (mapcar 'cddr split-by-major-mode)))))
2058 ;;;!! (global-set-key [mode-line S-mouse-2]
2234 ;;;!! ;; Some playthings suitable for picture mode? They need work.
2275 ;;;!! (delete-char
2321 ;; Font selection.
2328 (delete (assoc "Default" elt) elt))
2452 ;; event to make the selection, saving a click.
2463 ;; Binding mouse-1 to mouse-select-window when on mode-, header-, or
2467 (global-set-key [mode-line mouse-1] 'mouse-select-window)
2468 (global-set-key [mode-line drag-mouse-1] 'mouse-select-window)
2469 (global-set-key [mode-line down-mouse-1] 'mouse-drag-mode-line)
2472 (global-set-key [mode-line mouse-2] 'mouse-delete-other-windows)
2473 (global-set-key [mode-line mouse-3] 'mouse-delete-window)
2474 (global-set-key [mode-line C-mouse-2] 'mouse-split-window-horizontally)
2483 (defalias 'mldrag-drag-mode-line 'mouse-drag-mode-line)
2485 (make-obsolete 'mldrag-drag-mode-line 'mouse-drag-mode-line "21.1")