summaryrefslogtreecommitdiff
path: root/lisp/thingatpt.el
Commit message (Collapse)AuthorAgeFilesLines
* Correctly detect URLs surrounded by parentheses in commentsPhilipp Stephani2017-06-161-1/+3
| | | | | | | | * lisp/thingatpt.el (thing-at-point--bounds-of-well-formed-url): Make parentheses match work inside comments. * test/lisp/thingatpt-tests.el (thing-at-point-url-in-comment): Add unit test.
* Merge from origin/emacs-25Paul Eggert2017-01-011-1/+1
|\ | | | | | | | | 2e2a806 Fix copyright years by hand 5badc81 Update copyright year to 2017
| * Update copyright year to 2017Paul Eggert2016-12-311-1/+1
| | | | | | | | Run admin/update-copyright.
* | (thing-at-point 'list) return nil if no list at pointTino Calancha2016-11-031-15/+10
| | | | | | | | | | | | | | | | | | | | * lisp/thingatpt.el (thing-at-point-bounds-of-list-at-point): Check first if we are at the beginning of a top-level sexp (Bug#24627). If point is inside a comment or string, look for a list out of the comment/string. Escape '[' in doc string. * test/lisp/thingatpt-tests.el (thing-at-point-bug24627): Update expected test result as pass.
* | form-at-point work for all kind of THINGSTino Calancha2016-10-111-3/+5
| | | | | | | | | | | | * lisp/thingatpt.el (form-at-point): Use thing-at-point--read-from-whole-string only if thing-at-point returns a string (Bug#24605).
* | Fix number-at-point in lisp buffersNicolas Richard2016-04-281-1/+4
|/ | | | | * lisp/thingatpt.el (number-at-point): Don't say that things like ?a are numbers in lisp mode buffers (bug#8634).
* Avoid inflooping in thing-at-point-looking-atEli Zaretskii2016-02-271-3/+10
| | | | | | | * lisp/thingatpt.el (thing-at-point-looking-at): Avoid inflooping with regular expressions whose matching doesn't move point. (Bug#22756) Describe the argument DISTANCE in the doc string.
* * lisp/thingatpt.el (thing-at-point-uri-schemes): Add "magnet:"Mark Oteiza2016-01-131-2/+2
|
* Update copyright year to 2016Paul Eggert2016-01-011-1/+1
| | | | Run admin/update-copyright.
* Backslash cleanup in Elisp source filesPaul Eggert2015-09-171-1/+1
| | | | | | | | | | | This patch should not change behavior. It typically omits backslashes where they are redundant (e.g., in the string literal "^\$"). In a few places, insert backslashes where they make regular expressions clearer: e.g., replace "^\*" (equivalent to "^*") with "^\\*", which has the same effect as a regular expression. Also, use ‘\ %’ instead of ‘\%’ when avoiding confusion with SCCS IDs, and similarly use ‘\ $’ instead of ‘\$’ when avoiding confusion with RCS IDs, as that makes it clearer that the backslash is intended.
* Avoid errors in thing-at-point with 2nd argument non-nilEli Zaretskii2015-09-051-1/+1
| | | | | * lisp/thingatpt.el (thing-at-point): Only call 'length' on sequences. (Bug#21391)
* * lisp/thingatpt.el (thing-at-point-uri-schemes): Add "man:"Mark Oteiza2015-09-031-1/+1
| | | | (bug#19441)
* Fix bug in thing-at-point--bounds-of-well-formed-urlLeo Liu2015-07-091-2/+6
| | | | | * lisp/thingatpt.el (thing-at-point--bounds-of-well-formed-url): Make sure boundary contains current point.
* * lisp/thingatpt.el (in-string-p): Revert last change,Stefan Monnier2015-06-111-6/+2
| | | | | | since in-string-p is not used in thingatpt.el but only from outside. Also, use lexical binding.
* Slight namespace cleanup for thingatpt.el.Glenn Morris2015-06-101-13/+27
| | | | | | | | * lisp/thingatpt.el (thing-at-point--in-string-p) (thing-at-point--end-of-sexp, thing-at-point--beginning-of-sexp) (thing-at-point--read-from-whole-string): Rename from old versions without "thing-at-point--" prefix. Keep old versions as obsolete aliases. Update all uses.
* Replace uses of in-string-p; make it obsoleteDmitry Gutov2015-06-061-2/+3
| | | | | * lisp/thingatpt.el (in-string-p): Declare obsolete (bug#20732). (end-of-sexp, beginning-of-sexp): Use syntax-ppss instead.
* Update copyright year to 2015Paul Eggert2015-01-011-1/+1
| | | | Run admin/update-copyright.
* Replace "Maintainer: FSF" with the emacs-devel mailing addressGlenn Morris2014-02-091-1/+1
|
* Update copyright year to 2014 by running admin/update-copyright.Paul Eggert2014-01-011-1/+1
|
* * thingatpt.el (thing-at-point-looking-at): Add optional argLeo Liu2013-11-061-5/+9
| | | | | | DISTANCE to bound the search. All uses changed. Fixes: debbugs:15808
* lisp/*.el: Remove lexical-binding warnings; additional small cleanups.Juanma Barranquero2013-08-101-68/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * calculator.el (calculator): Mark unused argument. (calculator-paste, calculator-quit, calculator-integer-p): Use ignore-errors. (calculator-string-to-number, calculator-decimal, calculator-exp) (calculator-op-or-exp): Use string-match-p. * dired-aux.el (dired-compress): Use ignore-errors. (dired-do-chxxx, dired-do-chmod, dired-trample-file-versions) (dired-do-async-shell-command, dired-do-shell-command) (dired-shell-stuff-it, dired-compress-file, dired-insert-subdir) (dired-insert-subdir-validate): Use string-match-p. (dired-map-dired-file-lines, dired-subdir-hidden-p): Use looking-at-p. (dired-add-entry): Use string-match-p, looking-at-p. (dired-insert-subdir-newpos): Remove unused local variable. * dired.el (dired-buffer-more-recently-used-p): Declare. (dired-insert-set-properties, dired-insert-old-subdirs): Use ignore-errors. * filenotify.el (file-notify-callback): Remove unused local variable. * filesets.el (filesets-error): Mark unused argument. (filesets-which-command-p, filesets-filter-dir-names) (filesets-directory-files, filesets-get-external-viewer) (filesets-ingroup-get-data): Use string-match-p. * find-file.el (ff-other-file-name, ff-other-file-name) (ff-find-the-other-file, ff-cc-hh-converter): Remove unused local variables. (ff-get-file-name): Use string-match-p. (ff-all-dirs-under): Use ignore-errors. * follow.el (follow-comint-scroll-to-bottom): Mark unused argument. (follow-select-if-visible): Remove unused local variable. * forms.el (read-file-filter): Move declaration. (forms--make-format, forms--make-parser, forms-insert-record): Quote function with #'. (forms--update): Use string-match-p. Quote function with #'. * help-mode.el (help-dir-local-var-def): Mark unused argument. (help-make-xrefs): Use looking-at-p. (help-xref-on-pp): Use looking-at-p, ignore-errors. * ibuffer.el (ibuffer-ext-visible-p): Declare. (ibuffer-confirm-operation-on): Use string-match-p. * msb.el (msb-item-handler, msb-dired-item-handler): Mark unused arguments. * ses.el (ses-decode-cell-symbol) (ses-kill-override): Remove unused local variable. (ses-create-cell-variable, ses-relocate-formula): Use string-match-p. (ses-load): Use ignore-errors, looking-at-p. (ses-jump-safe): Use ignore-errors. (ses-export-tsv, ses-export-tsf, ses-unsafe): Mark unused arguments. * tabify.el (untabify, tabify): Mark unused arguments. * thingatpt.el (thing-at-point--bounds-of-well-formed-url): Mark unused argument. (bounds-of-thing-at-point, thing-at-point-bounds-of-list-at-point) (thing-at-point-newsgroup-p, form-at-point): Use ignore-errors.
* * lisp/thingatpt.el (thing-at-point): Accept optional second argumentSam Steingold2013-05-081-6/+13
| | | | | | | | | NO-PROPERTIES to strip the text properties from the return value. * lisp/net/browse-url.el (browse-url-url-at-point): Pass NO-PROPERTIES to `thing-at-point' instead of stripping the properties ourselves. Also, when `thing-at-point' fails to find a url, prepend "http://" to the filename at point on the assumption that the user is pointing at something like gnu.org/gnu.
* Move forward-whitespace, forward-symbol, forward-same-syntax commands to ↵Ted Zlatanov2013-03-291-49/+0
| | | | | | | | | subr.el. Use forward-symbol in supermode.el again. * subr.el (forward-whitespace, forward-symbol) (forward-same-syntax): Move from thingatpt.el. * progmodes/subword.el: Back to using `forward-symbol'.
* Merge from emacs-24Stefan Monnier2013-03-161-1/+1
|\
| * * thingatpt.el (end-of-sexp): Use syntax-after.Leo Liu2013-03-141-1/+1
| |
| * * thingatpt.el (end-of-sexp): Fix bug#13952.Leo Liu2013-03-141-1/+1
| |
* | Merge FFAP's URI-detection code into thingatpt.el.Chong Yidong2013-02-041-89/+206
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/ffap.el: Require thingatpt. (ffap-url-at-point): Delegate URI detection to thing-at-point. All URI-valid characters are now recognized. (ffap-string-at-point): Use use-region-p. (ffap-url-regexp): Extra character is handled by thing-at-point. (ffap-string-at-point-mode-alist): Allow parentheses. (ffap-newsgroup-regexp, ffap-newsgroup-heads, ffap-newsgroup-p): Convert to aliases; code moved to thingatpt.el. (ffap-gnus-hook): Use setq-local. * lisp/thingatpt.el: Rewrite the URL detection routines, absorbing some code from ffap.el. (thing-at-point-beginning-of-url-regexp): New var. (thing-at-point-uri-schemes): Update list of URI schemes. (thing-at-point-url-regexp): Variable deleted. (thing-at-point-markedup-url-regexp): Disallow newlines. (thing-at-point-newsgroup-regexp) (thing-at-point-newsgroup-heads) (thing-at-point-default-mail-uri-scheme): New variables. (thing-at-point-bounds-of-url-at-point): Rewrite. Use ffap's method to find the possible bounds of the URI at point. New optional argument to find ill-formed URIs. (thing-at-point-url-at-point): Rewrite. New arguments for finding ill-formed URIs. Use thing-at-point-bounds-of-url-at-point, and the scheme-adding heuristics from ffap-url-at-point. (thing-at-point--bounds-of-well-formed-url): New function. Do parens matching to decide whether to include parens in the URI * test/automated/thingatpt.el: New file. Fixes: debbugs:5673
* Update copyright notices for 2013.Paul Eggert2013-01-011-1/+1
|
* * thingatpt.el (number-at-point): Apply a thing-at-point property.Chong Yidong2012-10-301-0/+1
|
* * thingatpt.el (thing-at-point): Doc fix.Chong Yidong2012-10-291-1/+1
| | | | Fixes: debbugs:12691
* * lisp/thingatpt.el (forward-same-syntax): Handle no ARG case.Aaron S. Hawley2012-05-251-0/+1
| | | | Fixes: debbugs:11560
* Add 2012 to FSF copyright years for Emacs filesGlenn Morris2012-01-051-1/+1
|
* Doc fixes for thingatpt.el.Chong Yidong2011-07-071-13/+49
| | | | | | | | | * lisp/thingatpt.el (forward-thing, bounds-of-thing-at-point) (thing-at-point, beginning-of-thing, end-of-thing, in-string-p) (end-of-sexp, beginning-of-sexp) (thing-at-point-bounds-of-list-at-point, forward-whitespace) (forward-symbol, forward-same-syntax, word-at-point) (sentence-at-point): Doc fix (Bug#1144).
* (thing-at-point-short-url-regexp): Require that short URLs have at least one ↵Lars Magne Ingebrigtsen2011-06-301-1/+1
| | | | dot in them (bug #7614).
* * lisp/thingatpt.el (forward-whitespace): Typo.Stefan Monnier2011-06-011-1/+1
|
* Miscellaneous tweaks.Stefan Monnier2011-06-011-1/+1
| | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-macs.el (dolist, dotimes): Use the same strategy for lexical scoping as in subr.el's dolist and dotimes. * lisp/emacs-lisp/bytecomp.el (byte-compile-unfold-bcf): Silence compiler warning. * lisp/thingatpt.el (forward-whitespace): Trivial coding style fix. * lisp/subr.el (with-output-to-temp-buffer): Provide an edebug spec. * lisp/international/ccl.el (ccl-compile): Trivial simplification. * lisp/help-fns.el (help-do-arg-highlight): Silence compiler warning. * lisp/emacs-lisp/testcover.el (testcover-end): Remove spurious `printflag' argument. * lisp/emacs-lisp/byte-run.el (make-obsolete, make-obsolete-variable): Purecopy the whole obsolescence data.
* * lisp/thingatpt.el (bounds-of-thing-at-point): Return nil rather thanStefan Monnier2011-05-131-4/+5
| | | | | | bounds for the empty string. Fixes: debbugs:8667
* Add support for defun in thingatpt.elDrew Adams2011-03-251-0/+6
|
* Refill some long/short copyright headers.Glenn Morris2011-01-261-2/+1
|
* Convert consecutive FSF copyright years to ranges.Glenn Morris2011-01-241-2/+1
|
* Nuke arch-tags.Glenn Morris2011-01-151-1/+0
|
* Add 2011 to FSF/AIST copyright years.Glenn Morris2011-01-021-1/+1
|
* Add 2010 to copyright years.Glenn Morris2010-01-131-1/+1
|
* * thingatpt.el (thing-at-point-bounds-of-list-at-point): NewChong Yidong2009-04-181-2/+20
| | | | function (Bug#3027).
* Add 2009 to copyright years.Glenn Morris2009-01-051-1/+1
|
* (end-of-sexp, beginning-of-sexp, forward-same-syntax): Omit defaultChong Yidong2008-10-251-4/+4
| | | | arguments to char-after and char-before.
* (sexp-at-point, symbol-at-point, number-at-point, list-at-point): AddChong Yidong2008-10-221-3/+10
| | | | docstrings.
* Fix for bug #572, removed () from url regexp.Joakim Verona2008-08-061-1/+1
|
* Switch to recommended form of GPLv3 permissions notice.Glenn Morris2008-05-061-4/+8
|
* Merge from emacs--rel--22Miles Bader2008-01-081-1/+1
|\ | | | | | | Revision: emacs@sv.gnu.org/emacs--devo--0--patch-987