1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-11 09:20:51 +00:00
Commit Graph

88 Commits

Author SHA1 Message Date
Mark Oteiza
a70b064282 * lisp/thingatpt.el (thing-at-point-uri-schemes): Add "magnet:" 2016-01-13 20:18:53 -05:00
Paul Eggert
0e963201d0 Update copyright year to 2016
Run admin/update-copyright.
2016-01-01 01:34:24 -08:00
Paul Eggert
284c470ef7 Backslash cleanup in Elisp source files
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.
2015-09-17 16:09:39 -07:00
Eli Zaretskii
ec14f08753 Avoid errors in thing-at-point with 2nd argument non-nil
* lisp/thingatpt.el (thing-at-point): Only call 'length' on
sequences.  (Bug#21391)
2015-09-05 11:22:11 +03:00
Mark Oteiza
c37ef7546d * lisp/thingatpt.el (thing-at-point-uri-schemes): Add "man:"
(bug#19441)
2015-09-03 11:49:57 -04:00
Leo Liu
7a94f28a47 Fix bug in thing-at-point--bounds-of-well-formed-url
* lisp/thingatpt.el (thing-at-point--bounds-of-well-formed-url): Make
  sure boundary contains current point.
2015-07-09 10:19:42 +08:00
Stefan Monnier
eda386fc71 * lisp/thingatpt.el (in-string-p): Revert last change,
since in-string-p is not used in thingatpt.el but only from outside.

Also, use lexical binding.
2015-06-11 13:20:41 -04:00
Glenn Morris
cabaa992fa Slight namespace cleanup for thingatpt.el.
* 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.
2015-06-10 19:07:09 -04:00
Dmitry Gutov
73e6f36ed6 Replace uses of in-string-p; make it obsolete
* lisp/thingatpt.el (in-string-p): Declare obsolete (bug#20732).
(end-of-sexp, beginning-of-sexp): Use syntax-ppss instead.
2015-06-06 12:57:59 +03:00
Paul Eggert
7e09ef09a4 Update copyright year to 2015
Run admin/update-copyright.
2015-01-01 14:26:41 -08:00
Glenn Morris
34dc21db6e Replace "Maintainer: FSF" with the emacs-devel mailing address 2014-02-09 17:34:22 -08:00
Paul Eggert
ba3189039a Update copyright year to 2014 by running admin/update-copyright. 2014-01-01 07:43:34 +00:00
Leo Liu
5d5c701ef9 * thingatpt.el (thing-at-point-looking-at): Add optional arg
DISTANCE to bound the search. All uses changed.

Fixes: debbugs:15808
2013-11-06 17:06:05 +08:00
Juanma Barranquero
45fdb48240 lisp/*.el: Remove lexical-binding warnings; additional small cleanups.
* 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.
2013-08-10 17:17:29 +02:00
Sam Steingold
72d3cfca0a * lisp/thingatpt.el (thing-at-point): Accept optional second argument
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.
2013-05-08 11:13:25 -04:00
Ted Zlatanov
0b93819010 Move forward-whitespace, forward-symbol, forward-same-syntax commands to 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'.
2013-03-29 21:32:12 -04:00
Stefan Monnier
78be8b6465 Merge from emacs-24 2013-03-16 18:08:22 -04:00
Leo Liu
95b43468a4 * thingatpt.el (end-of-sexp): Use syntax-after. 2013-03-14 22:16:00 +08:00
Leo Liu
00094c26f3 * thingatpt.el (end-of-sexp): Fix bug#13952. 2013-03-14 19:48:05 +08:00
Chong Yidong
6e5c1569e9 Merge FFAP's URI-detection code into thingatpt.el.
* 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
2013-02-04 20:02:25 +08:00
Paul Eggert
ab422c4d68 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
Chong Yidong
748b0d840f * thingatpt.el (number-at-point): Apply a thing-at-point property. 2012-10-30 06:58:53 +08:00
Chong Yidong
e84cad57ef * thingatpt.el (thing-at-point): Doc fix.
Fixes: debbugs:12691
2012-10-29 18:03:21 +08:00
Aaron S. Hawley
34a008d93c * lisp/thingatpt.el (forward-same-syntax): Handle no ARG case.
Fixes: debbugs:11560
2012-05-25 19:40:47 -07:00
Glenn Morris
acaf905b11 Add 2012 to FSF copyright years for Emacs files 2012-01-05 01:46:05 -08:00
Chong Yidong
f5bd068933 Doc fixes for thingatpt.el.
* 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).
2011-07-07 14:31:57 -04:00
Lars Magne Ingebrigtsen
d61bdd5d04 (thing-at-point-short-url-regexp): Require that short URLs have at least one dot in them (bug #7614). 2011-06-30 04:04:32 +02:00
Stefan Monnier
ec8bd86f04 * lisp/thingatpt.el (forward-whitespace): Typo. 2011-06-01 11:28:54 -03:00
Stefan Monnier
2462470b9e Miscellaneous tweaks.
* 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.
2011-06-01 11:19:45 -03:00
Stefan Monnier
f278f87fe6 * lisp/thingatpt.el (bounds-of-thing-at-point): Return nil rather than
bounds for the empty string.

Fixes: debbugs:8667
2011-05-13 14:02:56 -03:00
Drew Adams
e8974c48ae Add support for defun in thingatpt.el 2011-03-25 00:38:12 +08:00
Glenn Morris
95df8112a0 Refill some long/short copyright headers. 2011-01-26 00:36:39 -08:00
Glenn Morris
73b0cd5003 Convert consecutive FSF copyright years to ranges. 2011-01-24 20:08:28 -08:00
Glenn Morris
0d9f702fd0 Nuke arch-tags. 2011-01-15 15:16:57 -08:00
Glenn Morris
5df4f04cd3 Add 2011 to FSF/AIST copyright years. 2011-01-02 15:50:46 -08:00
Glenn Morris
114f9c9679 Add 2010 to copyright years. 2010-01-13 00:35:10 -08:00
Chong Yidong
965b9376cf * thingatpt.el (thing-at-point-bounds-of-list-at-point): New
function (Bug#3027).
2009-04-18 03:39:28 +00:00
Glenn Morris
ae940284fa Add 2009 to copyright years. 2009-01-05 03:18:22 +00:00
Chong Yidong
ce8fb8aa95 (end-of-sexp, beginning-of-sexp, forward-same-syntax): Omit default
arguments to char-after and char-before.
2008-10-25 00:12:37 +00:00
Chong Yidong
de285f273d (sexp-at-point, symbol-at-point, number-at-point, list-at-point): Add
docstrings.
2008-10-22 20:51:23 +00:00
Joakim Verona
42986283a1 Fix for bug #572, removed () from url regexp. 2008-08-06 22:36:55 +00:00
Glenn Morris
eb3fa2cfcf Switch to recommended form of GPLv3 permissions notice. 2008-05-06 08:06:51 +00:00
Miles Bader
59ce725a3b Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-987
2008-01-08 20:46:54 +00:00
Glenn Morris
409cc4a3ea Add 2008 to copyright years. 2008-01-07 02:45:14 +00:00
Miles Bader
9aecacd08a Merge from emacs--rel--22
Patches applied:

 * emacs--rel--22  (patch 70-73)

   - Update from CVS

2007-07-25  Glenn Morris  <rgm@gnu.org>

   * Relicense all FSF files to GPLv3 or later.

Revision: emacs@sv.gnu.org/emacs--devo--0--patch-828
2007-07-26 05:28:10 +00:00
Glenn Morris
b4aa60262c Switch license to GPLv3 or later. 2007-07-25 04:50:21 +00:00
Karl Fogel
8626551860 * thingatpt.el (thing-at-point-email-regexp): Don't require two chars
before the "@" in an email address.  Andreas Roehler noticed this problem.
2007-06-16 01:25:25 +00:00
Karl Fogel
baef4cbec3 * thingatpt.el: Add support for email addresses (`email').
(thing-at-point, bounds-of-thing-at-point): Document `email' support.
  (thing-at-point-email-regexp): New variable.
  (`email'): Put `bounds-of-thing-at-point' and `thing-at-point'
  properties on this symbol, with lambda forms for values.
2007-06-16 01:03:35 +00:00
Glenn Morris
d7a0267c8d Add 2007 to copyright years. 2007-01-21 03:53:13 +00:00
Glenn Morris
c90f275771 Update copyright years. 2006-12-05 07:06:08 +00:00