summaryrefslogtreecommitdiff
path: root/lisp/thingatpt.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-07-18 21:37:32 +0000
committerRichard M. Stallman <rms@gnu.org>1995-07-18 21:37:32 +0000
commit1ba1bb31839c52e2fce869507e5d57f8724f38ab (patch)
tree44638376ff5fc2037e9d7a651a0c9a4d6c5eff4c /lisp/thingatpt.el
parent69f4c10ea2a5d8b5369ab8cc9f8813f8dad94b9c (diff)
downloademacs-1ba1bb31839c52e2fce869507e5d57f8724f38ab.tar.gz
(forward-same-syntax): New function.
Diffstat (limited to 'lisp/thingatpt.el')
-rw-r--r--lisp/thingatpt.el14
1 files changed, 13 insertions, 1 deletions
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index af456e3f698..77cc7352169 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -1,6 +1,6 @@
;;; thingatpt.el --- Get the `thing' at point
-;; Copyright (C) 1991,1992,1993 Free Software Foundation, Inc.
+;; Copyright (C) 1991,1992,1993,1994,1995 Free Software Foundation, Inc.
;; Author: Mike Williams <mikew@gopher.dosli.govt.nz>
;; Keywords: extensions, matching, mouse
@@ -174,6 +174,18 @@ bounds-of-thing-at-point."
(skip-syntax-backward "w_"))
(setq ARG (1+ ARG)))))
+;;--- Syntax blocks ---
+
+(defun forward-same-syntax (&optional arg)
+ (interactive "p")
+ (while (< arg 0)
+ (skip-syntax-backward
+ (char-to-string (char-syntax (char-after (1- (point))))))
+ (setq arg (1+ arg)))
+ (while (> arg 0)
+ (skip-syntax-forward (char-to-string (char-syntax (char-after (point)))))
+ (setq arg (1- arg))))
+
;;=== Aliases =============================================================
(defun word-at-point () (thing-at-point 'word))