;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\303\304\305\306\307\310\311\312&\210\313\314\315\316\317\320\321\322\311\304& \210\313\323\324\325\317\320\321\326\311\304& \207" [require browse-url thingatpt custom-declare-group mouseme nil "Popup menu of commands that work on strings." :prefix "mouse-me-" :group hypermedia custom-declare-variable mouse-me-get-string-function 'mouse-me-get-string "*Function used by `mouse-me' to get string when no region selected.\nThe default is `mouse-me-get-string' but this variable may commonly\nbe made buffer local and set to something more appropriate for\na specific mode (e.g., `word-at-point'). The function will be called\nwith no arguments and with point at where the mouse was clicked.\nIt can return either the string or to be most efficient, a list of\nthree elements: the string and the beginning and ending points of the\nstring in the buffer." :type function :options (mouse-me-get-string) mouse-me-build-menu-function 'mouse-me-build-menu "*Function used by `mouse-me' to build the popup menu.\nThe default is `mouse-me-build-menu' but this variable may commonly\nbe made buffer local and set to something more appropriate for\na specific mode. The function will be called with one argument,\nthe string selected, as returned by `mouse-me-get-string-function'." (mouse-me-build-menu)] 10) #@76 *If non-nil `mouse-me-grep' grep's in files with current file's extension. (defvar mouse-me-grep-use-extension t (#$ . -1428)) (byte-code "\300\301\302\303\304\305\306\307&\210\310\311\312\313#\210\310\314\312\313#\210\310\315\312\313#\210\310\316\312\313#\210\310\317\312\313#\207" [custom-declare-variable mouse-me-menu-commands '(("Copy" . kill-new) ("Kill" . kill-region) ("Capitalize" . capitalize-region) ("Lowercase" . downcase-region) ("Uppercase" . upcase-region) ("ISpell" . ispell-region) "----" ("Browse URL" . browse-url) ("Dired" . dired) ("Execute File" . mouse-me-execute) ("Mail to" . compose-mail) ("Finger" . mouse-me-finger) ("BBDB Lookup" . mouse-me-bbdb) "----" ("Imenu" . imenu) ("Find Tag" . find-tag) ("Grep" . mouse-me-grep) ("Find-Grep" . mouse-me-find-grep) "----" ("Apropos" . apropos) ("Describe Function" . mouse-me-describe-function) ("Describe Variable" . mouse-me-describe-variable) ("Command Info" . mouse-me-emacs-command-info) ("Man Page" if (fboundp 'woman) 'woman 'man) ("Profile Function" . mouse-me-elp-instrument-function)) "*Command menu used by `mouse-me-build-menu'.\nA list of elements where each element is either a cons cell or a string.\nIf a cons cell the car is a string to be displayed in the menu and the\ncdr is either a function to call passing a string to, or a list which evals\nto a function to call passing a string to. If the element is a string\nit makes a non-selectable element in the menu. To make a separator line\nuse a string consisting solely of hyphens.\n\nThe function returned from this menu will be called with one string\nargument. Or if the function has the symbol property `mouse-me-type'\nand if its value is the symbol `region' it will be called with the\nbeginning and ending points of the selected string. If the value is\nthe symbol `string' it will be called with one string argument." :type (repeat sexp) :group mouseme put kill-region mouse-me-type region ispell-region capitalize-region downcase-region upcase-region] 8) #@64 Popup a menu of functions to run on selected string or region. (defalias 'mouse-me #[(event) "\301\302\"\207" [event mouse-me-helper #[(name) "\303 \n!\"\206\f\304\305!\207" [event mouse-me-build-menu-function name x-popup-menu error "No command to run"] 4]] 3 (#$ . 3444) "e"]) #@187 Return a string from the buffer of text surrounding point. Returns a list of three elements, the string and the beginning and ending positions of the string in the buffer in that order. (defalias 'mouse-me-get-string #[nil "\306 \307\216\212`\310\211\211\211\311\312!\210` b\210\313\312!\210`\314\f \"\315\316\n\"\2036\n\317\225\310O\f\317\225\\\315\320\n\"\203H\n\317\225\310O\f\317\225\\\315\321\n\"\203] \322\317\n\"GZ\n\323\317\224O\n\f E.\207" [save-match-data-internal p str end beg start match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] nil skip-syntax-forward "^ >()\"" skip-syntax-backward buffer-substring-no-properties string-match "^\\([][\"'`.,?:;!@#$%^&*()_+={}|<>-]+\\)" 1 "^\\(URL:\\)" "\\([][\"'.,?:;!@#$%^&*()_+={}|<>-]+\\)$" match-string 0] 5 (#$ . 3733)]) #@79 Return a menu tailored for NAME for `mouse-me' from `mouse-me-menu-commands'. (defalias 'mouse-me-build-menu #[(name) "\302\211\303G\304W\203\202\305\306B\307D \"BD\207" [name mouse-me-menu-commands "Mouse Me" append 65 "...Long String..." kill-new "---"] 5 (#$ . 4575)]) #@46 Look in Emacs info for command named STRING. (defalias 'mouse-me-emacs-command-info #[(string) "\302!\211\203\303 !\203\304 !\202\305\306\")\207" [string s intern-soft commandp Info-goto-emacs-command-node error "No command named `%s'"] 4 (#$ . 4859) "sCommand: "]) #@33 Describe function named STRING. (defalias 'mouse-me-describe-function #[(string) "\302!\211\203\303 !\203\304 !\202\305\306\")\207" [string s intern-soft fboundp describe-function error "No function named `%s'"] 4 (#$ . 5140) "sFunction: "]) #@32 Desribe variable named STRING. (defalias 'mouse-me-describe-variable #[(string) "\302!\211\203\303 !\203\304 !\202\305\306\")\207" [string s intern-soft boundp describe-variable error "No variable named `%s'"] 4 (#$ . 5397) "sVariable: "]) #@40 Instrument Lisp function named STRING. (defalias 'mouse-me-elp-instrument-function #[(string) "\302!\211\203\303 !\203\304 !\202\305\306!)\207" [string s intern-soft fboundp elp-instrument-function error "Must be the name of an existing Lisp function"] 3 (#$ . 5652) "sFunction: "]) #@31 Execute STRING as a filename. (defalias 'mouse-me-execute #[(string) "\301\302!\203 \302\303\304!\"\207\305\306!\207" [string fboundp w32-shell-execute "open" convert-standard-filename message "This function currently working only in W32."] 4 (#$ . 5949) "sFile: "]) #@24 Lookup STRING in bbdb. (defalias 'mouse-me-bbdb #[(string) "\301\302!\203 \302\303\"\207\304\305!\207" [string fboundp bbdb nil error "BBDB not loaded"] 3 (#$ . 6224) "sBBDB Lookup: "]) #@31 Finger a STRING mail address. (defalias 'mouse-me-finger #[(string) "\302 \303\216\304\305 \"\203\306\307\310 \"\307\311 \"\"\202\312\313 \"*\207" [save-match-data-internal string match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] string-match "\\(.*\\)@\\([-.a-zA-Z0-9]+\\)$" finger match-string 1 2 error "Not in user@host form: %s"] 5 (#$ . 6418) "sFinger: "]) #@20 Grep for a STRING. (defalias 'mouse-me-grep #[(string) "\304\305!\210\306 \210\307 \310 \n \205\203\311P\202\311Q!)\207" [ext grep-command string mouse-me-grep-use-extension require compile grep-compute-defaults mouse-me-buffer-file-extension grep " *"] 5 (#$ . 6832) "sGrep: "]) #@20 Grep for a STRING. (defalias 'mouse-me-find-grep #[(string) "\306 \210\307 \310\211\311\312\f\"\203%\313\314\f\" \205\315 \316Q\313\317\f\"Q\320\fP!,\207" [grep-find-command end beg ext reg mouse-me-grep-use-extension grep-compute-defaults mouse-me-buffer-file-extension nil string-match "\\(^.+-type f \\)\\(.+$\\)" match-string 1 "-name \"*" "\" " 2 grep-find string] 5 (#$ . 7127) "sGrep: "]) #@118 Return the extension of the current buffer's filename or nil. Returned extension is a string begining with a period. (defalias 'mouse-me-buffer-file-extension #[nil "\303 \211\205\n\304!\211\205\305\306 \"\211\203 \n\307O\202 \310+\207" [bfn filename index buffer-file-name file-name-sans-versions string-match "\\.[^.]*$" nil ""] 4 (#$ . 7541)]) #@72 Determine the string to use to process EVENT and call FUNC to get cmd. (defalias 'mouse-me-helper #[(event func) "\306\211\211\211\211\211\211\211\307 \310\216\212`\311\312!\313\314!\211@\262!q\210\315\314!!b \203g\203B\204I \316=\203g\f ^\211Y\203g\f ]\211X\203g \n{\202\234! \211<\203\203A@\3178@\202\234\fb\210\320\321!!\204\225\322u\210\202\206`\323!+\203\257;\203\263\324\230\203\263\325\326!\210\" \211<\203\300\327 ! \330N\211\331\267\202\330 \n\"\202\334 !\202\334 !.\207" [mmtype cmd end beg mouse sm nil match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3] mark t window-buffer event-start posn-point mouse-drag-region 2 looking-at regexp-quote -1 search-forward "" error "No string to pass to function" eval mouse-me-type #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (region 202 string 209)) sp name save-match-data-internal event transient-mark-mode mark-active last-command mouse-me-get-string-function func] 9 (#$ . 7904)]) (provide 'mouseme)