(dun-climb): Handle unknown object name.
[bpt/emacs.git] / lisp / thingatpt.el
index fe62b73..77cc735 100644 (file)
@@ -1,11 +1,10 @@
 ;;; 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
+;; Keywords: extensions, matching, mouse
 ;; Created: Thu Mar 28 13:48:23 1991
-;; Version: $Revision: 1.16 $
 
 ;; This file is part of GNU Emacs.
 
 ;;     (thing-at-point 'line)
 ;;     (thing-at-point 'page)
 
-;;; Code:
+;;; Code: =================================================================
 
 (provide 'thingatpt)
 
-;;=== Version =============================================================
-
-(defconst thing@pt-version (substring "$Revision: 1.16 $" 11 -2)
-  "The revision number of thing@pt (as string).  The complete RCS id is:
-
-  $Id: thing@pt.el,v 1.16 1993/09/30 23:54:56 mike Exp $")
-
 ;;=== Basic movement ======================================================
 
 ;;;###autoload
@@ -114,6 +106,14 @@ bounds-of-thing-at-point."
 
 ;;=== Special cases =======================================================
 
+;;--- Lines ---
+
+;; bolp will be false when you click on the last line in the buffer
+;; and it has no final newline.
+
+(put 'line 'beginning-op
+     (function (lambda () (if (bolp) (forward-line -1) (beginning-of-line)))))
+
 ;;--- Sexps ---
 
 (defun in-string-p ()
@@ -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))