Function: text-mode-context-menu

text-mode-context-menu is a byte-compiled function defined in text-mode.el.gz.

Signature

(text-mode-context-menu MENU CLICK)

Documentation

Populate MENU with text selection commands at CLICK.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/text-mode.el.gz
(defun text-mode-context-menu (menu click)
  "Populate MENU with text selection commands at CLICK."

  (when (thing-at-mouse click 'word)
    (define-key-after menu [select-region mark-word]
      `(menu-item "Word"
                  ,(lambda (e) (interactive "e") (mark-thing-at-mouse e 'word))
                  :help "Mark the word at click for a subsequent cut/copy")
      'mark-whole-buffer))
  (define-key-after menu [select-region mark-sentence]
    `(menu-item "Sentence"
                ,(lambda (e) (interactive "e") (mark-thing-at-mouse e 'sentence))
                :help "Mark the sentence at click for a subsequent cut/copy")
    'mark-whole-buffer)
  (define-key-after menu [select-region mark-paragraph]
    `(menu-item "Paragraph"
                ,(lambda (e) (interactive "e") (mark-thing-at-mouse e 'paragraph))
                :help "Mark the paragraph at click for a subsequent cut/copy")
    'mark-whole-buffer)

  menu)