From: Richard M. Stallman Date: Tue, 18 Jul 1995 21:37:32 +0000 (+0000) Subject: (forward-same-syntax): New function. X-Git-Tag: emacs-19.34~3266 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fde7326e6db7c2376fb65ef3b8f43ac399421801;p=emacs.git (forward-same-syntax): New function. --- 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 ;; 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))