• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/lisp/

Lines Matching defs:point

1 ;;; thingatpt.el --- get the `thing' at point
26 ;; point, whatever that "thing" happens to be. The "thing" is defined by
29 ;; The function bounds-of-thing-at-point finds the beginning and end
45 ;; (thing-at-point 'line)
46 ;; (thing-at-point 'page)
66 (defun bounds-of-thing-at-point (thing)
67 "Determine the start and end buffer locations for the THING at point.
77 (if (get thing 'bounds-of-thing-at-point)
78 (funcall (get thing 'bounds-of-thing-at-point))
79 (let ((orig (point)))
89 (let ((beg (point)))
99 (point))))
111 (let ((end (point))
117 (point))))
123 (defun thing-at-point (thing)
124 "Return the THING at point.
131 (if (get thing 'thing-at-point)
132 (funcall (get thing 'thing-at-point))
133 (let ((bounds (bounds-of-thing-at-point thing)))
140 (let ((bounds (bounds-of-thing-at-point thing)))
145 (let ((bounds (bounds-of-thing-at-point thing)))
162 (let ((orig (point)))
165 (nth 3 (parse-partial-sexp (point) orig)))))
168 (let ((char-syntax (char-syntax (char-after (point)))))
177 (let ((char-syntax (char-syntax (char-before (point)))))
192 (defvar thing-at-point-file-name-chars "-~/[:alnum:]_.${}#%,:"
197 (re-search-forward (concat "\\=[" thing-at-point-file-name-chars "]*")
201 (if (re-search-backward (concat "[^" thing-at-point-file-name-chars "]")
204 (goto-char (point-min)))))
206 (defvar thing-at-point-url-path-regexp
210 (defvar thing-at-point-short-url-regexp
211 (concat "[-A-Za-z0-9.]+" thing-at-point-url-path-regexp)
214 ``thing-at-point-url-regexp''.")
216 (defvar thing-at-point-uri-schemes
231 (defvar thing-at-point-url-regexp
232 (concat "\\<\\(" (mapconcat 'identity thing-at-point-uri-schemes "\\|") "\\)"
233 thing-at-point-url-path-regexp)
236 (defvar thing-at-point-markedup-url-regexp
241 (put 'url 'bounds-of-thing-at-point 'thing-at-point-bounds-of-url-at-point)
242 (defun thing-at-point-bounds-of-url-at-point ()
243 (let ((strip (thing-at-point-looking-at
244 thing-at-point-markedup-url-regexp))) ;; (url "") short
246 (thing-at-point-looking-at thing-at-point-url-regexp)
248 ;; (setq short (thing-at-point-looking-at
249 ;; thing-at-point-short-url-regexp))
258 (put 'url 'thing-at-point 'thing-at-point-url-at-point)
259 (defun thing-at-point-url-at-point ()
260 "Return the URL around or before point.
262 Search backwards for the start of a URL ending at or after point. If
268 (if (or (setq strip (thing-at-point-looking-at
269 thing-at-point-markedup-url-regexp))
270 (thing-at-point-looking-at thing-at-point-url-regexp)
272 (setq short (thing-at-point-looking-at
273 thing-at-point-short-url-regexp)))
298 ;; testing every position before point. Regexp searches won't find
302 (defun thing-at-point-looking-at (regexp)
303 "Return non-nil if point is in or just after a match for REGEXP.
305 point."
307 (let ((old-point (point)) match)
309 (>= (match-end 0) old-point)
310 (setq match (point)))
315 (or (> (match-beginning 0) old-point)
317 (>= (match-end 0) old-point)
318 (setq match (point))))))
325 (>= (match-end 0) old-point)
326 (setq match (point))))
332 (let ((bounds (thing-at-point-bounds-of-url-at-point)))
338 (let ((bounds (thing-at-point-bounds-of-url-at-point)))
357 (put 'buffer 'end-op (lambda () (goto-char (point-max))))
358 (put 'buffer 'beginning-op (lambda () (goto-char (point-min))))
377 (char-to-string (char-syntax (char-after (1- (point))))))
380 (skip-syntax-forward (char-to-string (char-syntax (char-after (point)))))
385 (defun word-at-point () (thing-at-point 'word))
386 (defun sentence-at-point () (thing-at-point 'sentence))
402 (defun form-at-point (&optional thing pred)
404 (read-from-whole-string (thing-at-point (or thing 'sexp)))
409 (defun sexp-at-point () (form-at-point 'sexp))
411 (defun symbol-at-point ()
412 (let ((thing (thing-at-point 'symbol)))
415 (defun number-at-point () (form-at-point 'sexp 'numberp))
417 (defun list-at-point () (form-at-point 'list 'listp))