;ELC ;;; Compiled by cyd@localhost on Mon Apr 23 22:21:12 2007 ;;; from file /home/cyd/emacs/lisp/thingatpt.el ;;; in Emacs version 22.0.99 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. (if (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`thingatpt.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (provide 'thingatpt) #@48 Move forward to the end of the Nth next THING. (defalias 'forward-thing #[(thing &optional n) "\301N\206\f\303\304\305\"!\306 !\203 \n\206\307!\202!\310\311\")\207" [thing forward-op n intern-soft format "forward-%s" functionp 1 error "Can't determine how to move over a %s"] 4 (#$ . 586)]) #@484 Determine the start and end buffer locations for the THING at point. THING is a symbol which specifies the kind of syntactic entity you want. Possibilities include `symbol', `list', `sexp', `defun', `filename', `url', `word', `sentence', `whitespace', `line', `page' and others. See the file `thingatpt.el' for documentation on how to define a symbol as a valid THING. The value is a cons cell (START . END) giving the start and end positions of the textual entity that was found. (defalias 'bounds-of-thing-at-point #[(thing) "\302N\203 \302N \207`\303\304\305\217)\207" [thing orig bounds-of-thing-at-point nil (byte-code "\212\306N\206\307 \210\310N\206\311 \210`\211\203 \nV\204E\306N\206&\312 \210` \205A \205A \nX\205A\n X\205A B)\202\nb\210\310N\206O\313 \210\306N\206X\314 \210`\310N\206b\315 \210`\f\205~ \205~\f\nX\205~\n X\205~\f B**\207" [thing beg orig real-end real-beg end end-op #[nil "\301\302\"\207" [thing forward-thing 1] 3] beginning-op #[nil "\301\302\"\207" [thing forward-thing -1] 3] #[nil "\301\302\"\207" [thing forward-thing 1] 3] #[nil "\301\302\"\207" [thing forward-thing -1] 3] #[nil "\301\302\"\207" [thing forward-thing 1] 3] #[nil "\301\302\"\207" [thing forward-thing -1] 3]] 4) ((error))] 3 (#$ . 894)]) #@329 Return the THING at point. THING is a symbol which specifies the kind of syntactic entity you want. Possibilities include `symbol', `list', `sexp', `defun', `filename', `url', `word', `sentence', `whitespace', `line', `page' and others. See the file `thingatpt.el' for documentation on how to define a symbol as a valid THING. (defalias 'thing-at-point #[(thing) "\302N\203 \302N \207\303!\211\205 @ A{)\207" [thing bounds thing-at-point bounds-of-thing-at-point] 3 (#$ . 2186)]) (defalias 'beginning-of-thing #[(thing) "\302!\211\204 \303\304\"\210 @b)\207" [thing bounds bounds-of-thing-at-point error "No %s here"] 4]) (defalias 'end-of-thing #[(thing) "\302!\211\204 \303\304\"\210 Ab)\207" [thing bounds bounds-of-thing-at-point error "No %s here"] 4]) (put 'line 'beginning-op #[nil "n\203\300y\207\301 \207" [-1 beginning-of-line] 1]) (defalias 'in-string-p #[nil "`\212\301 \210\302\303`\"8*\207" [orig beginning-of-defun 3 parse-partial-sexp] 4]) (defalias 'end-of-sexp #[nil "`fz\211\301=\204\302=\203\303 \203\304u\202\305\304!)\207" [char-syntax 41 34 in-string-p 1 forward-sexp] 3]) (put 'sexp 'end-op 'end-of-sexp) (defalias 'beginning-of-sexp #[nil "`Sfz\211\301=\204\302=\203\303 \203\304u\202\305\304!)\207" [char-syntax 40 34 in-string-p -1 forward-sexp] 3]) (byte-code "\300\301\302\303#\210\300\304\305\306#\210\300\304\302\307#\207" [put sexp beginning-op beginning-of-sexp list end-op #[nil "\300\301!\207" [up-list 1] 2] backward-sexp] 4) #@36 Characters allowable in filenames. (defvar thing-at-point-file-name-chars "-~/[:alnum:]_.${}#%,:" (#$ . 3694)) (byte-code "\300\301\302\303#\210\300\301\304\305#\207" [put filename end-op #[nil "\301\302\303Q\304\305#\207" [thing-at-point-file-name-chars re-search-forward "\\=[" "]*" nil t] 4] beginning-op #[nil "\301\302\303Q\304\305#\203\304u\207eb\207" [thing-at-point-file-name-chars re-search-backward "[^" "]" nil t] 4]] 4) #@87 A regular expression probably matching the host and filename or e-mail part of a URL. (defvar thing-at-point-url-path-regexp "[^] \n \"'()<>[^`{}]*[^] \n \"'()<>[^`{}.,;]+" (#$ . 4136)) #@155 A regular expression probably matching a URL without an access scheme. Hostname matching is stricter in this case than for ``thing-at-point-url-regexp''. (defvar thing-at-point-short-url-regexp (concat "[-A-Za-z0-9.]+" thing-at-point-url-path-regexp) (#$ . 4329)) #@44 Uniform Resource Identifier (URI) Schemes. (defvar thing-at-point-uri-schemes '("ftp://" "http://" "gopher://" "mailto:" "news:" "nntp:" "telnet://" "wais://" "file:/" "prospero:" "z39.50s:" "z39.50r:" "cid:" "mid:" "vemmi:" "service:" "imap:" "nfs:" "acap:" "rtsp:" "tip:" "pop:" "data:" "dav:" "opaquelocktoken:" "sip:" "tel:" "fax:" "modem:" "ldap:" "https://" "soap.beep:" "soap.beeps:" "urn:" "go:" "afs:" "tn3270:" "mailserver:" "crid:" "dict:" "dns:" "dtn:" "h323:" "im:" "info:" "ipp:" "iris.beep:" "mtqp:" "mupdate:" "pres:" "sips:" "snmp:" "tag:" "tftp:" "xmlrpc.beep:" "xmlrpc.beeps:" "xmpp:" "snews:" "irc:" "mms://" "mmsh://") (#$ . 4599)) #@56 A regular expression probably matching a complete URL. (defvar thing-at-point-url-regexp (byte-code "\302\303\304\305#\306 R\207" [thing-at-point-uri-schemes thing-at-point-url-path-regexp "\\<\\(" mapconcat identity "\\|" "\\)"] 5) (#$ . 5258)) #@111 A regular expression matching a URL marked up per RFC1738. This may contain whitespace (including newlines) . (defvar thing-at-point-markedup-url-regexp "]+>" (#$ . 5512)) (put 'url 'bounds-of-thing-at-point 'thing-at-point-bounds-of-url-at-point) (defalias 'thing-at-point-bounds-of-url-at-point #[nil "\305!\211\204\305\n!\205#\306\224\306\225 \203\f\307\\ S\f *B)\207" [thing-at-point-markedup-url-regexp strip thing-at-point-url-regexp end beginning thing-at-point-looking-at 0 5] 3]) (put 'url 'thing-at-point 'thing-at-point-url-at-point) #@298 Return the URL around or before point. Search backwards for the start of a URL ending at or after point. If no URL found, return nil. The access scheme will be prepended if absent: "mailto:" if the string contains "@", "ftp://" if it starts with "ftp" and not "ftp:/", or "http://" by default. (defalias 'thing-at-point-url-at-point #[nil "\306\307\211\310 !\211\204\310\f!\204\310 !\211\205n\311\312\224\312\225\"\203,\n\313\314O\315\316\n\"\203=\317\306\320\211\n$\202, \203f\315\321\n\"\203L\306\202c\315\322\n\"\203W\323\202c\315\324\n\"\203b\325\202c\326\nP\n\306\230?\205n\n+\207" [strip short url thing-at-point-markedup-url-regexp thing-at-point-url-regexp thing-at-point-short-url-regexp "" nil thing-at-point-looking-at buffer-substring-no-properties 0 5 -1 string-match "[ \n ]+" replace-match t "^[a-zA-Z]+:" "@" "mailto:" "^ftp" "ftp://" "http://"] 5 (#$ . 6083)]) #@139 Return non-nil if point is in or just after a match for REGEXP. Set the match data from the earliest such match ending at or after point. (defalias 'thing-at-point-looking-at #[(regexp) "\212`\303\304\n!\203\305\225 Y\203`\306\n\303\307#\210\310\n\303\311#\203<\305\224 V\204\304\n!\203<\305\225 Y\203<`\211\204\205cb\210o\204]\312u\210\304\n!\203]\305\225 Y\203]`\211\204Cb\210\304\n!+\207" [match old-point regexp nil looking-at 0 re-search-forward limit re-search-backward t -1] 4 (#$ . 6998)]) (byte-code "\300\301\302\303#\210\300\301\304\305#\207" [put url end-op #[nil "\301 \211\203 Ab\202\302\303!)\207" [bounds thing-at-point-bounds-of-url-at-point error "No URL here"] 3] beginning-op #[nil "\301 \211\203 @b\202\302\303!)\207" [bounds thing-at-point-bounds-of-url-at-point error "No URL here"] 3]] 4) (defalias 'forward-whitespace #[(arg) "\301!\203 \302\303\304\305$\207\306W\205.\307\303\304\305#\203'\306\224f\310=\204'\311\304x\210T\211\202\207" [arg natnump re-search-forward "[ ]+\\|\n" nil move 0 re-search-backward 10 " "] 6 nil "p"]) (byte-code "\300\301\302\303#\210\300\301\304\305#\207" [put buffer end-op #[nil "db\207" [] 1] beginning-op #[nil "eb\207" [] 1]] 4) (defalias 'forward-symbol #[(arg) "\301!\203 \302\303\304\305$\207\306W\205&\307\303\304\305#\203\310\311!\210T\211\202\207" [arg natnump re-search-forward "\\(\\sw\\|\\s_\\)+" nil move 0 re-search-backward skip-syntax-backward "w_"] 6 nil "p"]) (defalias 'forward-same-syntax #[(&optional arg) "\301W\203\302\303`Sfz!!\210T\211\202\301V\205+\304\303`fz!!\210S\211\202\207" [arg 0 skip-syntax-backward char-to-string skip-syntax-forward] 4 nil "p"]) (defalias 'word-at-point #[nil "\300\301!\207" [thing-at-point word] 2]) (defalias 'sentence-at-point #[nil "\300\301!\207" [thing-at-point sentence] 2]) #@85 Read a Lisp expression from STR. Signal an error if the entire string was not used. (defalias 'read-from-whole-string #[(str) "\303!\304\305\306\217\211\203\307\310!\202 @*\207" [str read-data more-left read-from-string nil (byte-code "\302 A\303O!\210\304\207" [str read-data read-from-string nil t] 4) ((end-of-file)) error "Can't read whole string"] 4 (#$ . 8868)]) (defalias 'form-at-point #[(&optional thing pred) "\302\303\304\217 \203 !\205)\207" [sexp pred nil (byte-code "\301\302\206\303!!\207" [thing read-from-whole-string thing-at-point sexp] 3) ((error))] 3]) (defalias 'sexp-at-point #[nil "\300\301!\207" [form-at-point sexp] 2]) (defalias 'symbol-at-point #[nil "\301\302!\211\205 \303!)\207" [thing thing-at-point symbol intern] 3]) (defalias 'number-at-point #[nil "\300\301\302\"\207" [form-at-point sexp numberp] 3]) (defalias 'list-at-point #[nil "\300\301\302\"\207" [form-at-point list listp] 3])