gnu-emacs-sources
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

thingatpt-util.el 1.7


From: Andreas Roehler
Subject: thingatpt-util.el 1.7
Date: Sun, 31 Dec 2006 10:12:43 +0100
User-agent: KNode/0.9.2

;;; thingatpt-util.el --- thing-at-point edit functions

;; Version: 1.7

;; Copyright (C) 2006  Andreas Roehler

;; Author: Andreas Roehler <address@hidden>
;; Keywords: convenience, lisp

;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; This file is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING.  If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

;;; Commentary: 

;; Should return something useful according to a
;; given THING. THING may be a well known form as
;; symbol', `list', `sexp', `defun' but also a new
;; defined and abstract thing.

;; Changes to previous version: User-functions made autoload,
;; defsubst

;; One major diff to thingatpt.el: core
;; function `bounds-of-thing-at-point' is replaced by a
;; new `bounds-of-thatpt' in order to make execution
;; more easy to follow and maintain.

;; Behavior in general is not validating; i.e. if you call
;; url-atpt and there is no url, all chars at point may be picked,
;; which could be part of a url. Sometimes, however, a kind of
;; validation may be introduced.

;; `bounds-of-thatpt' now first searches backward, as
;; it's the more complicated task, thus avoiding
;; trouble later on. However, as a consequence several
;; `beginning-op' and `end-op' constructs had to be
;; rewritten. In case of trouble, please send me a bug
;; report. With `thatpt-test' you may execute and check
;; all available functions at point at once.

;; Any ideas and comments welcome.

;; How it works: 

;; Thing-at-point delivers a portion of the buffer. This
;; substring is determined by two alternative ways:

;; - If a pair of move-functions is known, as forward-
;;   and backward-word, its used.
;; 
;; - A move-function specified for thingatpt, called
;;   beginning-op and end-op, may exist.
;; 
;; The latter case given, this form will be used
;; preferential. The point is stored after move.
;; Beginning and end are delivered as pair: as consed
;; bounds-of-thing. 

;; It's easy to write your own thing-at-point functions. 
;; You need three forms:
;; 
;; (defun MY-FORM-atpt (&optional arg ispec) 
;;   " "
;;   (interactive "p\np")
;;   (thatpt 'MY-FORM arg ispec))
;; 
;; (put 'MY-FORM 'beginning-op  (lambda () MY-FORWARD-MOVE-FUNKTION))

;; (put 'MY-FORM 'end-op
;;      (lambda () MY-BACKWARD-MOVE-FUNKTION))

;; For example if you want to pick all chars at point
;; which are written between a string "AAA" and a
;; "BBB", which may exist as

;; AAA Luckily detected a lot of things! BBB

;; After evaluation of

;; (put 'MY-FORM 'beginning-op
;;      (lambda ()
;;        (search-backward "AAA" nil t 1)
;;        ;; step chars of search expression back
;;        (forward-char 3)))
;; 
;; (put 'MY-FORM 'end-op
;;      (lambda ()
;;        (search-forward "BBB" nil t 1)
;;        (forward-char -3)))

;; together with the functions definition above, it's ready.

;; M-x MY-FORM-atpt 

;; (while point inside) you should see: 

;; " Luckily detected a lot of things! " 

;; in the minibuffer.

;;; Code:



(require 'thingatpt)

;;;###autoload
(defsubst word-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt 'word arg ispec))

;;;###autoload
(defsubst bounds-of-word-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-bounds 'word arg ispec))

;;;###autoload
(defsubst word-atpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-beginning 'word arg ispec))

;;;###autoload
(defsubst word-atpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-end 'word arg ispec))

;;;###autoload
(defsubst copy-word-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-copy 'word arg ispec))

;;;###autoload
(defsubst kill-word-atpt ()
  " "
  (interactive "*")
  (thatpt-kill 'word))

;;;###autoload
(defsubst word-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
      (forward-char -1) 
 (thatpt 'word arg ispec)))

;;;###autoload
(defsubst bounds-of-word-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)
    (thatpt-bounds 'word arg ispec)))

;;;###autoload
(defsubst word-bfpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-beginning 'word arg ispec)))

;;;###autoload
(defsubst word-bfpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-end 'word arg ispec)))

;;;###autoload
(defsubst copy-word-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-copy 'word arg ispec)))

;;;###autoload
(defsubst kill-word-bfpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-kill 'word)))

;;;###autoload
(defsubst word-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
     (thatpt 'word arg ispec)))

;;;###autoload
(defsubst bounds-of-word-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
      (thatpt-bounds 'word arg ispec)))

;;;###autoload
(defsubst word-afpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-beginning 'word arg ispec)))

;;;###autoload
(defsubst word-afpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-end 'word arg ispec)))

;;;###autoload
(defsubst copy-word-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-copy 'word arg ispec)))

;;;###autoload
(defsubst kill-word-afpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-kill 'word)))


;;;###autoload
(defsubst forward-word-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-forward " \t\n\r\f")
      ;; (forward-char 1)
  (thatpt-forward 'word arg ispec))

;;;###autoload
(defsubst backward-word-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-backward " \t\n\r\f")
      (forward-char -1)
  (thatpt-backward 'word arg ispec))

;;;;

;;;###autoload
(defsubst csv-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt 'csv arg ispec))

;;;###autoload
(defsubst bounds-of-csv-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-bounds 'csv arg ispec))

;;;###autoload
(defsubst csv-atpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-beginning 'csv arg ispec))

;;;###autoload
(defsubst csv-atpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-end 'csv arg ispec))

;;;###autoload
(defsubst copy-csv-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-copy 'csv arg ispec))

;;;###autoload
(defsubst kill-csv-atpt ()
  " "
  (interactive "*")
  (thatpt-kill 'csv))

;;;###autoload
(defsubst csv-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
      (forward-char -1) 
 (thatpt 'csv arg ispec)))

;;;###autoload
(defsubst bounds-of-csv-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)
    (thatpt-bounds 'csv arg ispec)))

;;;###autoload
(defsubst csv-bfpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-beginning 'csv arg ispec)))

;;;###autoload
(defsubst csv-bfpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-end 'csv arg ispec)))

;;;###autoload
(defsubst copy-csv-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-copy 'csv arg ispec)))

;;;###autoload
(defsubst kill-csv-bfpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-kill 'csv)))

;;;###autoload
(defsubst csv-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
     (thatpt 'csv arg ispec)))

;;;###autoload
(defsubst bounds-of-csv-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
      (thatpt-bounds 'csv arg ispec)))

;;;###autoload
(defsubst csv-afpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-beginning 'csv arg ispec)))

;;;###autoload
(defsubst csv-afpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-end 'csv arg ispec)))

;;;###autoload
(defsubst copy-csv-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-copy 'csv arg ispec)))

;;;###autoload
(defsubst kill-csv-afpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-kill 'csv)))


;;;###autoload
(defsubst forward-csv-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-forward " \t\n\r\f")
      ;; (forward-char 1)
  (thatpt-forward 'csv arg ispec))

;;;###autoload
(defsubst backward-csv-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-backward " \t\n\r\f")
      (forward-char -1)
  (thatpt-backward 'csv arg ispec))

;;;;

;;;###autoload
(defsubst phone-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt 'phone arg ispec))

;;;###autoload
(defsubst bounds-of-phone-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-bounds 'phone arg ispec))

;;;###autoload
(defsubst phone-atpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-beginning 'phone arg ispec))

;;;###autoload
(defsubst phone-atpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-end 'phone arg ispec))

;;;###autoload
(defsubst copy-phone-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-copy 'phone arg ispec))

;;;###autoload
(defsubst kill-phone-atpt ()
  " "
  (interactive "*")
  (thatpt-kill 'phone))

;;;###autoload
(defsubst phone-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
      (forward-char -1) 
 (thatpt 'phone arg ispec)))

;;;###autoload
(defsubst bounds-of-phone-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)
    (thatpt-bounds 'phone arg ispec)))

;;;###autoload
(defsubst phone-bfpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-beginning 'phone arg ispec)))

;;;###autoload
(defsubst phone-bfpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-end 'phone arg ispec)))

;;;###autoload
(defsubst copy-phone-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-copy 'phone arg ispec)))

;;;###autoload
(defsubst kill-phone-bfpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-kill 'phone)))

;;;###autoload
(defsubst phone-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
     (thatpt 'phone arg ispec)))

;;;###autoload
(defsubst bounds-of-phone-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
      (thatpt-bounds 'phone arg ispec)))

;;;###autoload
(defsubst phone-afpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-beginning 'phone arg ispec)))

;;;###autoload
(defsubst phone-afpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-end 'phone arg ispec)))

;;;###autoload
(defsubst copy-phone-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-copy 'phone arg ispec)))

;;;###autoload
(defsubst kill-phone-afpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-kill 'phone)))


;;;###autoload
(defsubst forward-phone-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-forward " \t\n\r\f")
      ;; (forward-char 1)
  (thatpt-forward 'phone arg ispec))

;;;###autoload
(defsubst backward-phone-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-backward " \t\n\r\f")
      (forward-char -1)
  (thatpt-backward 'phone arg ispec))

;;;;

;;;###autoload
(defsubst ml-text-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt 'ml-text arg ispec))

;;;###autoload
(defsubst bounds-of-ml-text-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-bounds 'ml-text arg ispec))

;;;###autoload
(defsubst ml-text-atpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-beginning 'ml-text arg ispec))

;;;###autoload
(defsubst ml-text-atpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-end 'ml-text arg ispec))

;;;###autoload
(defsubst copy-ml-text-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-copy 'ml-text arg ispec))

;;;###autoload
(defsubst kill-ml-text-atpt ()
  " "
  (interactive "*")
  (thatpt-kill 'ml-text))

;;;###autoload
(defsubst ml-text-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
      (forward-char -1) 
 (thatpt 'ml-text arg ispec)))

;;;###autoload
(defsubst bounds-of-ml-text-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)
    (thatpt-bounds 'ml-text arg ispec)))

;;;###autoload
(defsubst ml-text-bfpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-beginning 'ml-text arg ispec)))

;;;###autoload
(defsubst ml-text-bfpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-end 'ml-text arg ispec)))

;;;###autoload
(defsubst copy-ml-text-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-copy 'ml-text arg ispec)))

;;;###autoload
(defsubst kill-ml-text-bfpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-kill 'ml-text)))

;;;###autoload
(defsubst ml-text-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
     (thatpt 'ml-text arg ispec)))

;;;###autoload
(defsubst bounds-of-ml-text-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
      (thatpt-bounds 'ml-text arg ispec)))

;;;###autoload
(defsubst ml-text-afpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-beginning 'ml-text arg ispec)))

;;;###autoload
(defsubst ml-text-afpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-end 'ml-text arg ispec)))

;;;###autoload
(defsubst copy-ml-text-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-copy 'ml-text arg ispec)))

;;;###autoload
(defsubst kill-ml-text-afpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-kill 'ml-text)))


;;;###autoload
(defsubst forward-ml-text-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-forward " \t\n\r\f")
      ;; (forward-char 1)
  (thatpt-forward 'ml-text arg ispec))

;;;###autoload
(defsubst backward-ml-text-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-backward " \t\n\r\f")
      (forward-char -1)
  (thatpt-backward 'ml-text arg ispec))

;;;;

;;;###autoload
(defsubst symbol-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt 'symbol arg ispec))

;;;###autoload
(defsubst bounds-of-symbol-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-bounds 'symbol arg ispec))

;;;###autoload
(defsubst symbol-atpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-beginning 'symbol arg ispec))

;;;###autoload
(defsubst symbol-atpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-end 'symbol arg ispec))

;;;###autoload
(defsubst copy-symbol-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-copy 'symbol arg ispec))

;;;###autoload
(defsubst kill-symbol-atpt ()
  " "
  (interactive "*")
  (thatpt-kill 'symbol))

;;;###autoload
(defsubst symbol-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
      (forward-char -1) 
 (thatpt 'symbol arg ispec)))

;;;###autoload
(defsubst bounds-of-symbol-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)
    (thatpt-bounds 'symbol arg ispec)))

;;;###autoload
(defsubst symbol-bfpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-beginning 'symbol arg ispec)))

;;;###autoload
(defsubst symbol-bfpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-end 'symbol arg ispec)))

;;;###autoload
(defsubst copy-symbol-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-copy 'symbol arg ispec)))

;;;###autoload
(defsubst kill-symbol-bfpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-kill 'symbol)))

;;;###autoload
(defsubst symbol-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
     (thatpt 'symbol arg ispec)))

;;;###autoload
(defsubst bounds-of-symbol-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
      (thatpt-bounds 'symbol arg ispec)))

;;;###autoload
(defsubst symbol-afpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-beginning 'symbol arg ispec)))

;;;###autoload
(defsubst symbol-afpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-end 'symbol arg ispec)))

;;;###autoload
(defsubst copy-symbol-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-copy 'symbol arg ispec)))

;;;###autoload
(defsubst kill-symbol-afpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-kill 'symbol)))


;;;###autoload
(defsubst forward-symbol-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-forward " \t\n\r\f")
      ;; (forward-char 1)
  (thatpt-forward 'symbol arg ispec))

;;;###autoload
(defsubst backward-symbol-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-backward " \t\n\r\f")
      (forward-char -1)
  (thatpt-backward 'symbol arg ispec))

;;;;

;;;###autoload
(defsubst string-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt 'string arg ispec))

;;;###autoload
(defsubst bounds-of-string-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-bounds 'string arg ispec))

;;;###autoload
(defsubst string-atpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-beginning 'string arg ispec))

;;;###autoload
(defsubst string-atpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-end 'string arg ispec))

;;;###autoload
(defsubst copy-string-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-copy 'string arg ispec))

;;;###autoload
(defsubst kill-string-atpt ()
  " "
  (interactive "*")
  (thatpt-kill 'string))

;;;###autoload
(defsubst string-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
      (forward-char -1) 
 (thatpt 'string arg ispec)))

;;;###autoload
(defsubst bounds-of-string-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)
    (thatpt-bounds 'string arg ispec)))

;;;###autoload
(defsubst string-bfpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-beginning 'string arg ispec)))

;;;###autoload
(defsubst string-bfpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-end 'string arg ispec)))

;;;###autoload
(defsubst copy-string-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-copy 'string arg ispec)))

;;;###autoload
(defsubst kill-string-bfpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-kill 'string)))

;;;###autoload
(defsubst string-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
     (thatpt 'string arg ispec)))

;;;###autoload
(defsubst bounds-of-string-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
      (thatpt-bounds 'string arg ispec)))

;;;###autoload
(defsubst string-afpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-beginning 'string arg ispec)))

;;;###autoload
(defsubst string-afpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-end 'string arg ispec)))

;;;###autoload
(defsubst copy-string-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-copy 'string arg ispec)))

;;;###autoload
(defsubst kill-string-afpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-kill 'string)))


;;;###autoload
(defsubst forward-string-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-forward " \t\n\r\f")
      ;; (forward-char 1)
  (thatpt-forward 'string arg ispec))

;;;###autoload
(defsubst backward-string-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-backward " \t\n\r\f")
      (forward-char -1)
  (thatpt-backward 'string arg ispec))

;;;;

;;;###autoload
(defsubst line-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt 'line arg ispec))

;;;###autoload
(defsubst bounds-of-line-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-bounds 'line arg ispec))

;;;###autoload
(defsubst line-atpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-beginning 'line arg ispec))

;;;###autoload
(defsubst line-atpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-end 'line arg ispec))

;;;###autoload
(defsubst copy-line-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-copy 'line arg ispec))

;;;###autoload
(defsubst kill-line-atpt ()
  " "
  (interactive "*")
  (thatpt-kill 'line))

;;;###autoload
(defsubst line-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
      (forward-char -1) 
 (thatpt 'line arg ispec)))

;;;###autoload
(defsubst bounds-of-line-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)
    (thatpt-bounds 'line arg ispec)))

;;;###autoload
(defsubst line-bfpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-beginning 'line arg ispec)))

;;;###autoload
(defsubst line-bfpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-end 'line arg ispec)))

;;;###autoload
(defsubst copy-line-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-copy 'line arg ispec)))

;;;###autoload
(defsubst kill-line-bfpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-kill 'line)))

;;;###autoload
(defsubst line-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
     (thatpt 'line arg ispec)))

;;;###autoload
(defsubst bounds-of-line-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
      (thatpt-bounds 'line arg ispec)))

;;;###autoload
(defsubst line-afpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-beginning 'line arg ispec)))

;;;###autoload
(defsubst line-afpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-end 'line arg ispec)))

;;;###autoload
(defsubst copy-line-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-copy 'line arg ispec)))

;;;###autoload
(defsubst kill-line-afpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-kill 'line)))


;;;###autoload
(defsubst forward-line-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-forward " \t\n\r\f")
      ;; (forward-char 1)
  (thatpt-forward 'line arg ispec))

;;;###autoload
(defsubst backward-line-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-backward " \t\n\r\f")
      (forward-char -1)
  (thatpt-backward 'line arg ispec))

;;;;

;;;###autoload
(defsubst graphs-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt 'graphs arg ispec))

;;;###autoload
(defsubst bounds-of-graphs-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-bounds 'graphs arg ispec))

;;;###autoload
(defsubst graphs-atpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-beginning 'graphs arg ispec))

;;;###autoload
(defsubst graphs-atpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-end 'graphs arg ispec))

;;;###autoload
(defsubst copy-graphs-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-copy 'graphs arg ispec))

;;;###autoload
(defsubst kill-graphs-atpt ()
  " "
  (interactive "*")
  (thatpt-kill 'graphs))

;;;###autoload
(defsubst graphs-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
      (forward-char -1) 
 (thatpt 'graphs arg ispec)))

;;;###autoload
(defsubst bounds-of-graphs-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)
    (thatpt-bounds 'graphs arg ispec)))

;;;###autoload
(defsubst graphs-bfpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-beginning 'graphs arg ispec)))

;;;###autoload
(defsubst graphs-bfpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-end 'graphs arg ispec)))

;;;###autoload
(defsubst copy-graphs-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-copy 'graphs arg ispec)))

;;;###autoload
(defsubst kill-graphs-bfpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-kill 'graphs)))

;;;###autoload
(defsubst graphs-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
     (thatpt 'graphs arg ispec)))

;;;###autoload
(defsubst bounds-of-graphs-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
      (thatpt-bounds 'graphs arg ispec)))

;;;###autoload
(defsubst graphs-afpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-beginning 'graphs arg ispec)))

;;;###autoload
(defsubst graphs-afpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-end 'graphs arg ispec)))

;;;###autoload
(defsubst copy-graphs-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-copy 'graphs arg ispec)))

;;;###autoload
(defsubst kill-graphs-afpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-kill 'graphs)))


;;;###autoload
(defsubst forward-graphs-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-forward " \t\n\r\f")
      ;; (forward-char 1)
  (thatpt-forward 'graphs arg ispec))

;;;###autoload
(defsubst backward-graphs-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-backward " \t\n\r\f")
      (forward-char -1)
  (thatpt-backward 'graphs arg ispec))

;;;;

;;;###autoload
(defsubst email-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt 'email arg ispec))

;;;###autoload
(defsubst bounds-of-email-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-bounds 'email arg ispec))

;;;###autoload
(defsubst email-atpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-beginning 'email arg ispec))

;;;###autoload
(defsubst email-atpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-end 'email arg ispec))

;;;###autoload
(defsubst copy-email-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-copy 'email arg ispec))

;;;###autoload
(defsubst kill-email-atpt ()
  " "
  (interactive "*")
  (thatpt-kill 'email))

;;;###autoload
(defsubst email-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
      (forward-char -1) 
 (thatpt 'email arg ispec)))

;;;###autoload
(defsubst bounds-of-email-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)
    (thatpt-bounds 'email arg ispec)))

;;;###autoload
(defsubst email-bfpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-beginning 'email arg ispec)))

;;;###autoload
(defsubst email-bfpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-end 'email arg ispec)))

;;;###autoload
(defsubst copy-email-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-copy 'email arg ispec)))

;;;###autoload
(defsubst kill-email-bfpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-kill 'email)))

;;;###autoload
(defsubst email-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
     (thatpt 'email arg ispec)))

;;;###autoload
(defsubst bounds-of-email-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
      (thatpt-bounds 'email arg ispec)))

;;;###autoload
(defsubst email-afpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-beginning 'email arg ispec)))

;;;###autoload
(defsubst email-afpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-end 'email arg ispec)))

;;;###autoload
(defsubst copy-email-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-copy 'email arg ispec)))

;;;###autoload
(defsubst kill-email-afpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-kill 'email)))


;;;###autoload
(defsubst forward-email-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-forward " \t\n\r\f")
      ;; (forward-char 1)
  (thatpt-forward 'email arg ispec))

;;;###autoload
(defsubst backward-email-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-backward " \t\n\r\f")
      (forward-char -1)
  (thatpt-backward 'email arg ispec))

;;;;

;;;###autoload
(defsubst sentence-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt 'sentence arg ispec))

;;;###autoload
(defsubst bounds-of-sentence-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-bounds 'sentence arg ispec))

;;;###autoload
(defsubst sentence-atpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-beginning 'sentence arg ispec))

;;;###autoload
(defsubst sentence-atpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-end 'sentence arg ispec))

;;;###autoload
(defsubst copy-sentence-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-copy 'sentence arg ispec))

;;;###autoload
(defsubst kill-sentence-atpt ()
  " "
  (interactive "*")
  (thatpt-kill 'sentence))

;;;###autoload
(defsubst sentence-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
      (forward-char -1) 
 (thatpt 'sentence arg ispec)))

;;;###autoload
(defsubst bounds-of-sentence-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)
    (thatpt-bounds 'sentence arg ispec)))

;;;###autoload
(defsubst sentence-bfpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-beginning 'sentence arg ispec)))

;;;###autoload
(defsubst sentence-bfpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-end 'sentence arg ispec)))

;;;###autoload
(defsubst copy-sentence-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-copy 'sentence arg ispec)))

;;;###autoload
(defsubst kill-sentence-bfpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-kill 'sentence)))

;;;###autoload
(defsubst sentence-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
     (thatpt 'sentence arg ispec)))

;;;###autoload
(defsubst bounds-of-sentence-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
      (thatpt-bounds 'sentence arg ispec)))

;;;###autoload
(defsubst sentence-afpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-beginning 'sentence arg ispec)))

;;;###autoload
(defsubst sentence-afpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-end 'sentence arg ispec)))

;;;###autoload
(defsubst copy-sentence-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-copy 'sentence arg ispec)))

;;;###autoload
(defsubst kill-sentence-afpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-kill 'sentence)))


;;;###autoload
(defsubst forward-sentence-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-forward " \t\n\r\f")
      ;; (forward-char 1)
  (thatpt-forward 'sentence arg ispec))

;;;###autoload
(defsubst backward-sentence-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-backward " \t\n\r\f")
      (forward-char -1)
  (thatpt-backward 'sentence arg ispec))

;;;;

;;;###autoload
(defsubst defun-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt 'defun arg ispec))

;;;###autoload
(defsubst bounds-of-defun-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-bounds 'defun arg ispec))

;;;###autoload
(defsubst defun-atpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-beginning 'defun arg ispec))

;;;###autoload
(defsubst defun-atpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-end 'defun arg ispec))

;;;###autoload
(defsubst copy-defun-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-copy 'defun arg ispec))

;;;###autoload
(defsubst kill-defun-atpt ()
  " "
  (interactive "*")
  (thatpt-kill 'defun))

;;;###autoload
(defsubst defun-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
      (forward-char -1) 
 (thatpt 'defun arg ispec)))

;;;###autoload
(defsubst bounds-of-defun-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)
    (thatpt-bounds 'defun arg ispec)))

;;;###autoload
(defsubst defun-bfpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-beginning 'defun arg ispec)))

;;;###autoload
(defsubst defun-bfpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-end 'defun arg ispec)))

;;;###autoload
(defsubst copy-defun-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-copy 'defun arg ispec)))

;;;###autoload
(defsubst kill-defun-bfpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-kill 'defun)))

;;;###autoload
(defsubst defun-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
     (thatpt 'defun arg ispec)))

;;;###autoload
(defsubst bounds-of-defun-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
      (thatpt-bounds 'defun arg ispec)))

;;;###autoload
(defsubst defun-afpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-beginning 'defun arg ispec)))

;;;###autoload
(defsubst defun-afpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-end 'defun arg ispec)))

;;;###autoload
(defsubst copy-defun-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-copy 'defun arg ispec)))

;;;###autoload
(defsubst kill-defun-afpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-kill 'defun)))


;;;###autoload
(defsubst forward-defun-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-forward " \t\n\r\f")
      ;; (forward-char 1)
  (thatpt-forward 'defun arg ispec))

;;;###autoload
(defsubst backward-defun-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-backward " \t\n\r\f")
      (forward-char -1)
  (thatpt-backward 'defun arg ispec))

;;;;

;;;###autoload
(defsubst filename-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt 'filename arg ispec))

;;;###autoload
(defsubst bounds-of-filename-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-bounds 'filename arg ispec))

;;;###autoload
(defsubst filename-atpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-beginning 'filename arg ispec))

;;;###autoload
(defsubst filename-atpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-end 'filename arg ispec))

;;;###autoload
(defsubst copy-filename-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-copy 'filename arg ispec))

;;;###autoload
(defsubst kill-filename-atpt ()
  " "
  (interactive "*")
  (thatpt-kill 'filename))

;;;###autoload
(defsubst filename-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
      (forward-char -1) 
 (thatpt 'filename arg ispec)))

;;;###autoload
(defsubst bounds-of-filename-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)
    (thatpt-bounds 'filename arg ispec)))

;;;###autoload
(defsubst filename-bfpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-beginning 'filename arg ispec)))

;;;###autoload
(defsubst filename-bfpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-end 'filename arg ispec)))

;;;###autoload
(defsubst copy-filename-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-copy 'filename arg ispec)))

;;;###autoload
(defsubst kill-filename-bfpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-kill 'filename)))

;;;###autoload
(defsubst filename-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
     (thatpt 'filename arg ispec)))

;;;###autoload
(defsubst bounds-of-filename-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
      (thatpt-bounds 'filename arg ispec)))

;;;###autoload
(defsubst filename-afpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-beginning 'filename arg ispec)))

;;;###autoload
(defsubst filename-afpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-end 'filename arg ispec)))

;;;###autoload
(defsubst copy-filename-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-copy 'filename arg ispec)))

;;;###autoload
(defsubst kill-filename-afpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-kill 'filename)))


;;;###autoload
(defsubst forward-filename-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-forward " \t\n\r\f")
      ;; (forward-char 1)
  (thatpt-forward 'filename arg ispec))

;;;###autoload
(defsubst backward-filename-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-backward " \t\n\r\f")
      (forward-char -1)
  (thatpt-backward 'filename arg ispec))

;;;;

;;;###autoload
(defsubst whitespace-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt 'whitespace arg ispec))

;;;###autoload
(defsubst bounds-of-whitespace-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-bounds 'whitespace arg ispec))

;;;###autoload
(defsubst whitespace-atpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-beginning 'whitespace arg ispec))

;;;###autoload
(defsubst whitespace-atpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-end 'whitespace arg ispec))

;;;###autoload
(defsubst copy-whitespace-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-copy 'whitespace arg ispec))

;;;###autoload
(defsubst kill-whitespace-atpt ()
  " "
  (interactive "*")
  (thatpt-kill 'whitespace))

;;;###autoload
(defsubst whitespace-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward "^ \t\n\r\f")
     (forward-char -1) 
 (thatpt 'whitespace arg ispec)))

;;;###autoload
(defsubst bounds-of-whitespace-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward "^ \t\n\r\f")
      (forward-char -1)
    (thatpt-bounds 'whitespace arg ispec)))

;;;###autoload
(defsubst whitespace-bfpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward "^ \t\n\r\f")
      (forward-char -1)  (thatpt-beginning 'whitespace arg ispec)))

;;;###autoload
(defsubst whitespace-bfpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward "^ \t\n\r\f")
      (forward-char -1)  (thatpt-end 'whitespace arg ispec)))

;;;###autoload
(defsubst copy-whitespace-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward "^ \t\n\r\f")
      (forward-char -1)  (thatpt-copy 'whitespace arg ispec)))

;;;###autoload
(defsubst kill-whitespace-bfpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-backward "^ \t\n\r\f")
      (forward-char -1)  (thatpt-kill 'whitespace)))

;;;###autoload
(defsubst whitespace-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward "^ \t\n\r\f")
    (thatpt 'whitespace arg ispec)))

;;;###autoload
(defsubst bounds-of-whitespace-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward "^ \t\n\r\f")
     (thatpt-bounds 'whitespace arg ispec)))

;;;###autoload
(defsubst whitespace-afpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward "^ \t\n\r\f")
      (thatpt-beginning 'whitespace arg ispec)))

;;;###autoload
(defsubst whitespace-afpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward "^ \t\n\r\f")
      (thatpt-end 'whitespace arg ispec)))

;;;###autoload
(defsubst copy-whitespace-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward "^ \t\n\r\f")
      (thatpt-copy 'whitespace arg ispec)))

;;;###autoload
(defsubst kill-whitespace-afpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-forward "^ \t\n\r\f")
      (thatpt-kill 'whitespace)))


;;;###autoload
(defsubst forward-whitespace-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-forward "^ \t\n\r\f")
     ;; (forward-char 1)
  (thatpt-forward 'whitespace arg ispec))

;;;###autoload
(defsubst backward-whitespace-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-backward "^ \t\n\r\f")
     (forward-char -1)
  (thatpt-backward 'whitespace arg ispec))

;;;;

;;;###autoload
(defsubst url-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt 'url arg ispec))

;;;###autoload
(defsubst bounds-of-url-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-bounds 'url arg ispec))

;;;###autoload
(defsubst url-atpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-beginning 'url arg ispec))

;;;###autoload
(defsubst url-atpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-end 'url arg ispec))

;;;###autoload
(defsubst copy-url-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-copy 'url arg ispec))

;;;###autoload
(defsubst kill-url-atpt ()
  " "
  (interactive "*")
  (thatpt-kill 'url))

;;;###autoload
(defsubst url-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
      (forward-char -1) 
 (thatpt 'url arg ispec)))

;;;###autoload
(defsubst bounds-of-url-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)
    (thatpt-bounds 'url arg ispec)))

;;;###autoload
(defsubst url-bfpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-beginning 'url arg ispec)))

;;;###autoload
(defsubst url-bfpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-end 'url arg ispec)))

;;;###autoload
(defsubst copy-url-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-copy 'url arg ispec)))

;;;###autoload
(defsubst kill-url-bfpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-kill 'url)))

;;;###autoload
(defsubst url-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
     (thatpt 'url arg ispec)))

;;;###autoload
(defsubst bounds-of-url-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
      (thatpt-bounds 'url arg ispec)))

;;;###autoload
(defsubst url-afpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-beginning 'url arg ispec)))

;;;###autoload
(defsubst url-afpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-end 'url arg ispec)))

;;;###autoload
(defsubst copy-url-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-copy 'url arg ispec)))

;;;###autoload
(defsubst kill-url-afpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-kill 'url)))


;;;###autoload
(defsubst forward-url-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-forward " \t\n\r\f")
      ;; (forward-char 1)
  (thatpt-forward 'url arg ispec))

;;;###autoload
(defsubst backward-url-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-backward " \t\n\r\f")
      (forward-char -1)
  (thatpt-backward 'url arg ispec))

;;;;

;;;###autoload
(defsubst list-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt 'list arg ispec))

;;;###autoload
(defsubst bounds-of-list-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-bounds 'list arg ispec))

;;;###autoload
(defsubst list-atpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-beginning 'list arg ispec))

;;;###autoload
(defsubst list-atpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-end 'list arg ispec))

;;;###autoload
(defsubst copy-list-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-copy 'list arg ispec))

;;;###autoload
(defsubst kill-list-atpt ()
  " "
  (interactive "*")
  (thatpt-kill 'list))

;;;###autoload
(defsubst list-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
      (forward-char -1) 
 (thatpt 'list arg ispec)))

;;;###autoload
(defsubst bounds-of-list-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)
    (thatpt-bounds 'list arg ispec)))

;;;###autoload
(defsubst list-bfpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-beginning 'list arg ispec)))

;;;###autoload
(defsubst list-bfpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-end 'list arg ispec)))

;;;###autoload
(defsubst copy-list-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-copy 'list arg ispec)))

;;;###autoload
(defsubst kill-list-bfpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-kill 'list)))

;;;###autoload
(defsubst list-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
     (thatpt 'list arg ispec)))

;;;###autoload
(defsubst bounds-of-list-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
      (thatpt-bounds 'list arg ispec)))

;;;###autoload
(defsubst list-afpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-beginning 'list arg ispec)))

;;;###autoload
(defsubst list-afpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-end 'list arg ispec)))

;;;###autoload
(defsubst copy-list-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-copy 'list arg ispec)))

;;;###autoload
(defsubst kill-list-afpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-kill 'list)))


;;;###autoload
(defsubst forward-list-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-forward " \t\n\r\f")
      ;; (forward-char 1)
  (thatpt-forward 'list arg ispec))

;;;###autoload
(defsubst backward-list-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-backward " \t\n\r\f")
      (forward-char -1)
  (thatpt-backward 'list arg ispec))

;;;;

;;;###autoload
(defsubst number-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt 'number arg ispec))

;;;###autoload
(defsubst bounds-of-number-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-bounds 'number arg ispec))

;;;###autoload
(defsubst number-atpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-beginning 'number arg ispec))

;;;###autoload
(defsubst number-atpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-end 'number arg ispec))

;;;###autoload
(defsubst copy-number-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-copy 'number arg ispec))

;;;###autoload
(defsubst kill-number-atpt ()
  " "
  (interactive "*")
  (thatpt-kill 'number))

;;;###autoload
(defsubst number-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
      (forward-char -1) 
 (thatpt 'number arg ispec)))

;;;###autoload
(defsubst bounds-of-number-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)
    (thatpt-bounds 'number arg ispec)))

;;;###autoload
(defsubst number-bfpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-beginning 'number arg ispec)))

;;;###autoload
(defsubst number-bfpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-end 'number arg ispec)))

;;;###autoload
(defsubst copy-number-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-copy 'number arg ispec)))

;;;###autoload
(defsubst kill-number-bfpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-kill 'number)))

;;;###autoload
(defsubst number-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
     (thatpt 'number arg ispec)))

;;;###autoload
(defsubst bounds-of-number-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
      (thatpt-bounds 'number arg ispec)))

;;;###autoload
(defsubst number-afpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-beginning 'number arg ispec)))

;;;###autoload
(defsubst number-afpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-end 'number arg ispec)))

;;;###autoload
(defsubst copy-number-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-copy 'number arg ispec)))

;;;###autoload
(defsubst kill-number-afpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-kill 'number)))


;;;###autoload
(defsubst forward-number-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-forward " \t\n\r\f")
      ;; (forward-char 1)
  (thatpt-forward 'number arg ispec))

;;;###autoload
(defsubst backward-number-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-backward " \t\n\r\f")
      (forward-char -1)
  (thatpt-backward 'number arg ispec))

;;;;

;;;###autoload
(defsubst float-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt 'float arg ispec))

;;;###autoload
(defsubst bounds-of-float-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-bounds 'float arg ispec))

;;;###autoload
(defsubst float-atpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-beginning 'float arg ispec))

;;;###autoload
(defsubst float-atpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-end 'float arg ispec))

;;;###autoload
(defsubst copy-float-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-copy 'float arg ispec))

;;;###autoload
(defsubst kill-float-atpt ()
  " "
  (interactive "*")
  (thatpt-kill 'float))

;;;###autoload
(defsubst float-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
      (forward-char -1) 
 (thatpt 'float arg ispec)))

;;;###autoload
(defsubst bounds-of-float-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)
    (thatpt-bounds 'float arg ispec)))

;;;###autoload
(defsubst float-bfpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-beginning 'float arg ispec)))

;;;###autoload
(defsubst float-bfpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-end 'float arg ispec)))

;;;###autoload
(defsubst copy-float-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-copy 'float arg ispec)))

;;;###autoload
(defsubst kill-float-bfpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-kill 'float)))

;;;###autoload
(defsubst float-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
     (thatpt 'float arg ispec)))

;;;###autoload
(defsubst bounds-of-float-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
      (thatpt-bounds 'float arg ispec)))

;;;###autoload
(defsubst float-afpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-beginning 'float arg ispec)))

;;;###autoload
(defsubst float-afpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-end 'float arg ispec)))

;;;###autoload
(defsubst copy-float-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-copy 'float arg ispec)))

;;;###autoload
(defsubst kill-float-afpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-kill 'float)))


;;;###autoload
(defsubst forward-float-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-forward " \t\n\r\f")
      ;; (forward-char 1)
  (thatpt-forward 'float arg ispec))

;;;###autoload
(defsubst backward-float-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-backward " \t\n\r\f")
      (forward-char -1)
  (thatpt-backward 'float arg ispec))

;;;;

;;;###autoload
(defsubst page-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt 'page arg ispec))

;;;###autoload
(defsubst bounds-of-page-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-bounds 'page arg ispec))

;;;###autoload
(defsubst page-atpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-beginning 'page arg ispec))

;;;###autoload
(defsubst page-atpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-end 'page arg ispec))

;;;###autoload
(defsubst copy-page-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-copy 'page arg ispec))

;;;###autoload
(defsubst kill-page-atpt ()
  " "
  (interactive "*")
  (thatpt-kill 'page))

;;;###autoload
(defsubst page-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
      (forward-char -1) 
 (thatpt 'page arg ispec)))

;;;###autoload
(defsubst bounds-of-page-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)
    (thatpt-bounds 'page arg ispec)))

;;;###autoload
(defsubst page-bfpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-beginning 'page arg ispec)))

;;;###autoload
(defsubst page-bfpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-end 'page arg ispec)))

;;;###autoload
(defsubst copy-page-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-copy 'page arg ispec)))

;;;###autoload
(defsubst kill-page-bfpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-kill 'page)))

;;;###autoload
(defsubst page-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
     (thatpt 'page arg ispec)))

;;;###autoload
(defsubst bounds-of-page-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
      (thatpt-bounds 'page arg ispec)))

;;;###autoload
(defsubst page-afpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-beginning 'page arg ispec)))

;;;###autoload
(defsubst page-afpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-end 'page arg ispec)))

;;;###autoload
(defsubst copy-page-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-copy 'page arg ispec)))

;;;###autoload
(defsubst kill-page-afpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-kill 'page)))


;;;###autoload
(defsubst forward-page-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-forward " \t\n\r\f")
      ;; (forward-char 1)
  (thatpt-forward 'page arg ispec))

;;;###autoload
(defsubst backward-page-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-backward " \t\n\r\f")
      (forward-char -1)
  (thatpt-backward 'page arg ispec))

;;;;

;;;###autoload
(defsubst sexp-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt 'sexp arg ispec))

;;;###autoload
(defsubst bounds-of-sexp-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-bounds 'sexp arg ispec))

;;;###autoload
(defsubst sexp-atpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-beginning 'sexp arg ispec))

;;;###autoload
(defsubst sexp-atpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-end 'sexp arg ispec))

;;;###autoload
(defsubst copy-sexp-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-copy 'sexp arg ispec))

;;;###autoload
(defsubst kill-sexp-atpt ()
  " "
  (interactive "*")
  (thatpt-kill 'sexp))

;;;###autoload
(defsubst sexp-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
      (forward-char -1) 
 (thatpt 'sexp arg ispec)))

;;;###autoload
(defsubst bounds-of-sexp-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)
    (thatpt-bounds 'sexp arg ispec)))

;;;###autoload
(defsubst sexp-bfpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-beginning 'sexp arg ispec)))

;;;###autoload
(defsubst sexp-bfpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-end 'sexp arg ispec)))

;;;###autoload
(defsubst copy-sexp-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-copy 'sexp arg ispec)))

;;;###autoload
(defsubst kill-sexp-bfpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-kill 'sexp)))

;;;###autoload
(defsubst sexp-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
     (thatpt 'sexp arg ispec)))

;;;###autoload
(defsubst bounds-of-sexp-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
      (thatpt-bounds 'sexp arg ispec)))

;;;###autoload
(defsubst sexp-afpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-beginning 'sexp arg ispec)))

;;;###autoload
(defsubst sexp-afpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-end 'sexp arg ispec)))

;;;###autoload
(defsubst copy-sexp-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-copy 'sexp arg ispec)))

;;;###autoload
(defsubst kill-sexp-afpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-kill 'sexp)))


;;;###autoload
(defsubst forward-sexp-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-forward " \t\n\r\f")
      ;; (forward-char 1)
  (thatpt-forward 'sexp arg ispec))

;;;###autoload
(defsubst backward-sexp-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-backward " \t\n\r\f")
      (forward-char -1)
  (thatpt-backward 'sexp arg ispec))

;;;;

;;;###autoload
(defsubst paragraph-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt 'paragraph arg ispec))

;;;###autoload
(defsubst bounds-of-paragraph-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-bounds 'paragraph arg ispec))

;;;###autoload
(defsubst paragraph-atpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-beginning 'paragraph arg ispec))

;;;###autoload
(defsubst paragraph-atpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-end 'paragraph arg ispec))

;;;###autoload
(defsubst copy-paragraph-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (thatpt-copy 'paragraph arg ispec))

;;;###autoload
(defsubst kill-paragraph-atpt ()
  " "
  (interactive "*")
  (thatpt-kill 'paragraph))

;;;###autoload
(defsubst paragraph-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
      (forward-char -1) 
 (thatpt 'paragraph arg ispec)))

;;;###autoload
(defsubst bounds-of-paragraph-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)
    (thatpt-bounds 'paragraph arg ispec)))

;;;###autoload
(defsubst paragraph-bfpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-beginning 'paragraph arg ispec)))

;;;###autoload
(defsubst paragraph-bfpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-end 'paragraph arg ispec)))

;;;###autoload
(defsubst copy-paragraph-bfpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-copy 'paragraph arg ispec)))

;;;###autoload
(defsubst kill-paragraph-bfpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-backward " \t\n\r\f")
       (forward-char -1)  (thatpt-kill 'paragraph)))

;;;###autoload
(defsubst paragraph-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
     (thatpt 'paragraph arg ispec)))

;;;###autoload
(defsubst bounds-of-paragraph-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
      (thatpt-bounds 'paragraph arg ispec)))

;;;###autoload
(defsubst paragraph-afpt-beginning-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-beginning 'paragraph arg ispec)))

;;;###autoload
(defsubst paragraph-afpt-end-position (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-end 'paragraph arg ispec)))

;;;###autoload
(defsubst copy-paragraph-afpt (&optional arg ispec) 
  " "
  (interactive "p\np")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-copy 'paragraph arg ispec)))

;;;###autoload
(defsubst kill-paragraph-afpt ()
  " "
  (interactive "*")
  (save-excursion  
     (skip-chars-forward " \t\n\r\f")
       (thatpt-kill 'paragraph)))


;;;###autoload
(defsubst forward-paragraph-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-forward " \t\n\r\f")
      ;; (forward-char 1)
  (thatpt-forward 'paragraph arg ispec))

;;;###autoload
(defsubst backward-paragraph-atpt (&optional arg ispec) 
  " "
  (interactive "p\np")
       (skip-chars-backward " \t\n\r\f")
      (forward-char -1)
  (thatpt-backward 'paragraph arg ispec))

;;;;

;; End of user-functions


;;; CSV

;; Value of var `csv-separators' will be taken according to
;;; csv-mode.el --- major mode for editing comma-separated value files
;; Author: Francis J. Wright <F.J.Wright at qmul.ac.uk>
;; URL: http://centaur.maths.qmul.ac.uk/Emacs/

;; if its loaded

;;; CSV

(defcustom atpt-separator ";"
 "Char to distinguish datasets in a `comma`-separated row" 
:type 'string
:group 'convenience)

(if (boundp 'csv-separators)
  (setq separator-atpt csv-separators)
    (setq separator-atpt atpt-separator))

(put 'csv 'beginning-op
     (lambda ()
       (skip-chars-backward (concat "^" (car csv-separators)) 
(line-beginning-position))))

(put 'csv 'end-op
     (lambda ()
       (skip-chars-forward (concat "^" (car 
csv-separators))(line-end-position))))

;;; Symbol

(put 'symbol 'beginning-op
     (lambda ()
       (skip-syntax-backward "W_")))

(put 'symbol 'end-op
     (lambda ()
       (skip-syntax-forward "W_")))

;;; Word 

(put 'word 'beginning-op
     (lambda ()
       (when (and (looking-at "\\sw")
                (not (or (eq (char-before) ? )
                         (eq (char-before) ?\t)
                         (eq (char-before) ?\n)
                         (eq (char-before) ?\r)
                         (eq (char-before) ?\f)
                         )))
           (forward-word -1)))) 
      
(put 'word 'end-op
     (lambda ()
       (forward-word 1)))  
;; Url

(put 'url 'beginning-op
     (lambda ()
       (unless
           (looking-at "[\"\']")
         (skip-chars-backward "^\"\' " ))))

(put 'url 'end-op
     (lambda ()
         (re-search-forward  "[^\"\' ]+" (line-end-position) t 1)
         ;; provide for messages ending with `:'
         (skip-chars-backward ":")
         ;;      (backward-char 1)
         ))

;; Phone

(put 'phone 'beginning-op
     (lambda ()
       (when
           (and (looking-at "[0-9 \t.()-]")
                (not (eq (char-before) ?+)))
       (re-search-backward "[^0-9 \t.()-][0-9 ()\t-]+" 
(line-beginning-position) t 1) (forward-char 1)))) 

(put 'phone 'end-op
     (lambda ()
       (when
           (looking-at "[0-9;, \t()-]")
         (re-search-forward "[0-9 \t.()-]+[^0-9 \t-]" (1+ (line-end-position)) 
t 1) (forward-char -1)))) 

;; Text
;; Useful to extract texts between ml-tags

(put 'ml-text 'beginning-op
     (lambda ()
       (when
           (looking-at "[^>]") 
         (re-search-backward ">" nil t 1)
         (forward-char 1)))) 

(put 'ml-text 'end-op (lambda () (re-search-forward "</" nil t 1) (forward-char 
-2))) 

;; Email

(put 'email 'beginning-op
     (lambda ()
       (when
           (looking-at "[^ \t]")
         (re-search-backward 
"[,;][[:graph:]]\\|<[[:graph:]]\\|^[[:graph:]]\\|[^[:graph:]][[:graph:]]" 
(line-beginning-position) t 1)(when (looking-at "[[:space:];,]") (forward-char 
1))))) 

;; (put 'email 'end-op (lambda () (re-search-forward 
"[[:graph:]]+>\\|[[:graph:address@hidden:graph:]]+[> \t\n]*" 
(line-end-position) t 1)))

(put 'email 'end-op (lambda () (when (looking-at "[ 
<]\\{0,1\\}\\([[:graph:address@hidden:graph:]]+\\)[;,> \t\n]*")
                                 (goto-char (match-end 1))
                                 (skip-chars-backward "[[:punct:]]")
                                 )))

;; Graphs

(put 'graphs 'beginning-op (lambda () (when (looking-at "[^ \t]") 
(skip-chars-backward "[:graph:]"))))

(put 'graphs 'end-op (lambda () (skip-chars-forward "[:graph:]")))

;; Whitespace

(put 'whitespace 'beginning-op (lambda () (when (looking-at "[ \t]") 
(skip-chars-backward " \t\n\r\f"))))

(put 'whitespace 'end-op (lambda () (skip-chars-forward " \t\n\r\f")))

;; Number

(put 'number 'beginning-op (lambda () (when (numberp (read 
(buffer-substring-no-properties (point) (1+ (point)))))
    (skip-chars-backward "[0-9]"))))

(put 'number 'end-op
 (lambda ()
   (skip-chars-forward "[0-9]")))

;; Floats

(put 'float 'beginning-op (lambda () (when (numberp (read 
(buffer-substring-no-properties (point) (1+ (point)))))
    (skip-chars-backward "[0-9].,"))))

(put 'float 'end-op (lambda () (skip-chars-forward "[0-9.,]")))

;; Sexp

(defun beginning-of-sexp ()
  (let ((char-syntax (char-syntax (char-after (point)))))
    (if (eq char-syntax ?\))
        (backward-up-list)
      (when (and (eq char-syntax ?\") (in-string-p))
        (forward-char -1))
      (forward-sexp -1))))

;; Filename

(put 'filename 'beginning-op
     (lambda ()
       (re-search-backward (concat "[^" thing-at-point-file-name-chars "]") nil 
t)
       (forward-char 1)))

(put 'filename 'end-op
     (lambda ()
       (re-search-forward (concat "\\=[" thing-at-point-file-name-chars "]*")
                          nil t)
     (skip-chars-backward ": ")))

;; Defun

(put 'defun 'beginning-op (lambda (&optional arg) (beginning-of-defun (or arg 
1))))

(put 'defun 'end-op (lambda (&optional arg)(end-of-defun (or arg 1))))

;; Lines

(put 'line 'beginning-op (lambda () (beginning-of-line)))

;; Strings

(put 'string 'beginning-op  (lambda () (goto-char (with-syntax-table 
(standard-syntax-table) (nth 8 (syntax-ppss)))) (forward-char 1)))

(put 'string 'end-op
     (lambda ()
       (re-search-forward (concat (list (nth 3 (with-syntax-table 
(standard-syntax-table) (syntax-ppss))))) nil t 1) (forward-char -1)))
   
;;  Lists  

(put 'list 'end-op (lambda () (forward-list 1)
)) 

(put 'list 'beginning-op
(lambda ()
  (or (looking-at "\\s(")
      (when (nth 9 (syntax-ppss))
        (goto-char (car (last (nth 9 (syntax-ppss))))))))) 

(defun thatpt-test (&optional arg) 
  "Checks available THING-atpt forms at point
Prints forms with values in bufffer `thatpt-test', 
with ARG also forms, which returned `nil' "
  (interactive "P")
  (let 
      (
       (thatpt-fnlist '(
                        word-atpt
                        bounds-of-word-atpt
                        word-atpt-beginning-position
                        word-atpt-end-position
                        copy-word-atpt
                        word-bfpt
                        bounds-of-word-bfpt
                        word-bfpt-beginning-position
                        word-bfpt-end-position
                        copy-word-bfpt
                        word-afpt
                        bounds-of-word-afpt
                        word-afpt-beginning-position
                        word-afpt-end-position
                        copy-word-afpt
                        csv-atpt
                        bounds-of-csv-atpt
                        csv-atpt-beginning-position
                        csv-atpt-end-position
                        copy-csv-atpt
                        csv-bfpt
                        bounds-of-csv-bfpt
                        csv-bfpt-beginning-position
                        csv-bfpt-end-position
                        copy-csv-bfpt
                        csv-afpt
                        bounds-of-csv-afpt
                        csv-afpt-beginning-position
                        csv-afpt-end-position
                        copy-csv-afpt
                        phone-atpt
                        bounds-of-phone-atpt
                        phone-atpt-beginning-position
                        phone-atpt-end-position
                        copy-phone-atpt
                        phone-bfpt
                        bounds-of-phone-bfpt
                        phone-bfpt-beginning-position
                        phone-bfpt-end-position
                        copy-phone-bfpt
                        phone-afpt
                        bounds-of-phone-afpt
                        phone-afpt-beginning-position
                        phone-afpt-end-position
                        copy-phone-afpt
                        ml-text-atpt
                        bounds-of-ml-text-atpt
                        ml-text-atpt-beginning-position
                        ml-text-atpt-end-position
                        copy-ml-text-atpt
                        ml-text-bfpt
                        bounds-of-ml-text-bfpt
                        ml-text-bfpt-beginning-position
                        ml-text-bfpt-end-position
                        copy-ml-text-bfpt
                        ml-text-afpt
                        bounds-of-ml-text-afpt
                        ml-text-afpt-beginning-position
                        ml-text-afpt-end-position
                        copy-ml-text-afpt
                        symbol-atpt
                        bounds-of-symbol-atpt
                        symbol-atpt-beginning-position
                        symbol-atpt-end-position
                        copy-symbol-atpt
                        symbol-bfpt
                        bounds-of-symbol-bfpt
                        symbol-bfpt-beginning-position
                        symbol-bfpt-end-position
                        copy-symbol-bfpt
                        symbol-afpt
                        bounds-of-symbol-afpt
                        symbol-afpt-beginning-position
                        symbol-afpt-end-position
                        copy-symbol-afpt
                        string-atpt
                        bounds-of-string-atpt
                        string-atpt-beginning-position
                        string-atpt-end-position
                        copy-string-atpt
                        string-bfpt
                        bounds-of-string-bfpt
                        string-bfpt-beginning-position
                        string-bfpt-end-position
                        copy-string-bfpt
                        string-afpt
                        bounds-of-string-afpt
                        string-afpt-beginning-position
                        string-afpt-end-position
                        copy-string-afpt
                        line-atpt
                        bounds-of-line-atpt
                        line-atpt-beginning-position
                        line-atpt-end-position
                        copy-line-atpt
                        line-bfpt
                        bounds-of-line-bfpt
                        line-bfpt-beginning-position
                        line-bfpt-end-position
                        copy-line-bfpt
                        line-afpt
                        bounds-of-line-afpt
                        line-afpt-beginning-position
                        line-afpt-end-position
                        copy-line-afpt
                        graphs-atpt
                        bounds-of-graphs-atpt
                        graphs-atpt-beginning-position
                        graphs-atpt-end-position
                        copy-graphs-atpt
                        graphs-bfpt
                        bounds-of-graphs-bfpt
                        graphs-bfpt-beginning-position
                        graphs-bfpt-end-position
                        copy-graphs-bfpt
                        graphs-afpt
                        bounds-of-graphs-afpt
                        graphs-afpt-beginning-position
                        graphs-afpt-end-position
                        copy-graphs-afpt
                        email-atpt
                        bounds-of-email-atpt
                        email-atpt-beginning-position
                        email-atpt-end-position
                        copy-email-atpt
                        email-bfpt
                        bounds-of-email-bfpt
                        email-bfpt-beginning-position
                        email-bfpt-end-position
                        copy-email-bfpt
                        email-afpt
                        bounds-of-email-afpt
                        email-afpt-beginning-position
                        email-afpt-end-position
                        copy-email-afpt
                        sentence-atpt
                        bounds-of-sentence-atpt
                        sentence-atpt-beginning-position
                        sentence-atpt-end-position
                        copy-sentence-atpt
                        sentence-bfpt
                        bounds-of-sentence-bfpt
                        sentence-bfpt-beginning-position
                        sentence-bfpt-end-position
                        copy-sentence-bfpt
                        sentence-afpt
                        bounds-of-sentence-afpt
                        sentence-afpt-beginning-position
                        sentence-afpt-end-position
                        copy-sentence-afpt
                        defun-atpt
                        bounds-of-defun-atpt
                        defun-atpt-beginning-position
                        defun-atpt-end-position
                        copy-defun-atpt
                        defun-bfpt
                        bounds-of-defun-bfpt
                        defun-bfpt-beginning-position
                        defun-bfpt-end-position
                        copy-defun-bfpt
                        defun-afpt
                        bounds-of-defun-afpt
                        defun-afpt-beginning-position
                        defun-afpt-end-position
                        copy-defun-afpt
                        filename-atpt
                        bounds-of-filename-atpt
                        filename-atpt-beginning-position
                        filename-atpt-end-position
                        copy-filename-atpt
                        filename-bfpt
                        bounds-of-filename-bfpt
                        filename-bfpt-beginning-position
                        filename-bfpt-end-position
                        copy-filename-bfpt
                        filename-afpt
                        bounds-of-filename-afpt
                        filename-afpt-beginning-position
                        filename-afpt-end-position
                        copy-filename-afpt
                        whitespace-atpt
                        bounds-of-whitespace-atpt
                        whitespace-atpt-beginning-position
                        whitespace-atpt-end-position
                        copy-whitespace-atpt
                        whitespace-bfpt
                        bounds-of-whitespace-bfpt
                        whitespace-bfpt-beginning-position
                        whitespace-bfpt-end-position
                        copy-whitespace-bfpt
                        whitespace-afpt
                        bounds-of-whitespace-afpt
                        whitespace-afpt-beginning-position
                        whitespace-afpt-end-position
                        copy-whitespace-afpt
                        url-atpt
                        bounds-of-url-atpt
                        url-atpt-beginning-position
                        url-atpt-end-position
                        copy-url-atpt
                        url-bfpt
                        bounds-of-url-bfpt
                        url-bfpt-beginning-position
                        url-bfpt-end-position
                        copy-url-bfpt
                        url-afpt
                        bounds-of-url-afpt
                        url-afpt-beginning-position
                        url-afpt-end-position
                        copy-url-afpt
                        list-atpt
                        bounds-of-list-atpt
                        list-atpt-beginning-position
                        list-atpt-end-position
                        copy-list-atpt
                        list-bfpt
                        bounds-of-list-bfpt
                        list-bfpt-beginning-position
                        list-bfpt-end-position
                        copy-list-bfpt
                        list-afpt
                        bounds-of-list-afpt
                        list-afpt-beginning-position
                        list-afpt-end-position
                        copy-list-afpt
                        number-atpt
                        bounds-of-number-atpt
                        number-atpt-beginning-position
                        number-atpt-end-position
                        copy-number-atpt
                        number-bfpt
                        bounds-of-number-bfpt
                        number-bfpt-beginning-position
                        number-bfpt-end-position
                        copy-number-bfpt
                        number-afpt
                        bounds-of-number-afpt
                        number-afpt-beginning-position
                        number-afpt-end-position
                        copy-number-afpt
                        float-atpt
                        bounds-of-float-atpt
                        float-atpt-beginning-position
                        float-atpt-end-position
                        copy-float-atpt
                        float-bfpt
                        bounds-of-float-bfpt
                        float-bfpt-beginning-position
                        float-bfpt-end-position
                        copy-float-bfpt
                        float-afpt
                        bounds-of-float-afpt
                        float-afpt-beginning-position
                        float-afpt-end-position
                        copy-float-afpt
                        page-atpt
                        bounds-of-page-atpt
                        page-atpt-beginning-position
                        page-atpt-end-position
                        copy-page-atpt
                        page-bfpt
                        bounds-of-page-bfpt
                        page-bfpt-beginning-position
                        page-bfpt-end-position
                        copy-page-bfpt
                        page-afpt
                        bounds-of-page-afpt
                        page-afpt-beginning-position
                        page-afpt-end-position
                        copy-page-afpt
                        sexp-atpt
                        bounds-of-sexp-atpt
                        sexp-atpt-beginning-position
                        sexp-atpt-end-position
                        copy-sexp-atpt
                        sexp-bfpt
                        bounds-of-sexp-bfpt
                        sexp-bfpt-beginning-position
                        sexp-bfpt-end-position
                        copy-sexp-bfpt
                        sexp-afpt
                        bounds-of-sexp-afpt
                        sexp-afpt-beginning-position
                        sexp-afpt-end-position
                        copy-sexp-afpt
                        paragraph-atpt
                        bounds-of-paragraph-atpt
                        paragraph-atpt-beginning-position
                        paragraph-atpt-end-position
                        copy-paragraph-atpt
                        paragraph-bfpt
bounds-of-paragraph-bfpt
paragraph-bfpt-beginning-position
paragraph-bfpt-end-position
copy-paragraph-bfpt
paragraph-afpt
bounds-of-paragraph-afpt
paragraph-afpt-beginning-position
paragraph-afpt-end-position
copy-paragraph-afpt)))
    (save-excursion 
      (set-buffer (get-buffer-create "thatpt-test"))
      (erase-buffer))
    (dolist (elt thatpt-fnlist)
      (let* ((item (funcall elt))
             (output-p (if arg
                           t
                         (cond ((eq nil item)
                                nil)
                               ((and (listp item)
                                     (eq nil (car item)))
                                nil)
                               ((and (stringp item)
                                     (string= "" item))
                                nil)
                               (t t)))))
        (when output-p
          (save-excursion 
            (switch-to-buffer "thatpt-test")
            (if (listp item)
                (setq item (concat (format "%s" (car item))" "(format "%s" 
(cadr item)))))
            (insert (concat (format "%s: " elt) (format "%s \n" item)))))))))


(defun thatpt-mv-test ()
  "Checks available move-THING-atpt forms at point.
Shows moves while indicating executed form in message-buffer"
  (interactive)
  (let 
      (
       (thatpt-mv-fnlist '(
                           forward-word-atpt
                           backward-word-atpt
                           forward-csv-atpt
                           backward-csv-atpt
                           forward-phone-atpt
                           backward-phone-atpt
                           forward-ml-text-atpt
                           backward-ml-text-atpt
                           forward-symbol-atpt
                           backward-symbol-atpt
                           forward-string-atpt
                           backward-string-atpt
                           forward-line-atpt
                           backward-line-atpt
                           forward-graphs-atpt
                           backward-graphs-atpt
                           forward-email-atpt
                           backward-email-atpt
                           forward-sentence-atpt
                           backward-sentence-atpt
                           forward-defun-atpt
                           backward-defun-atpt
                           forward-filename-atpt
                           backward-filename-atpt
                           forward-whitespace-atpt
                           backward-whitespace-atpt
                           forward-url-atpt
                           backward-url-atpt
                           forward-list-atpt
                           backward-list-atpt
                           forward-number-atpt
                           backward-number-atpt
                           forward-float-atpt
                           backward-float-atpt
                           forward-page-atpt
                           backward-page-atpt
                           forward-sexp-atpt
                           backward-sexp-atpt
                           forward-paragraph-atpt
                           backward-paragraph-atpt)))
    (save-excursion 
      (dolist (elt thatpt-mv-fnlist)
        ;; if `forward-' is called, check if THING-afpt exists
        ;; if `backward-' check THING-bfpt
        (let ((direction-form
               (if
                   (string= "forward" (substring (format "%s" elt) 0 
(string-match "-" (format "%s" elt))))
                   (replace-regexp-in-string "-atpt" "-afpt" (substring (format 
"%s" elt) (1+ (string-match "-" (format "%s" elt)))))
                 (replace-regexp-in-string "-atpt" "-bfpt" (substring (format 
"%s" elt) (1+ (string-match "-" (format "%s" elt))))))))
          (when
              (funcall (intern-soft direction-form))
            (message "%s" elt)
            (save-excursion
              (funcall elt)
              (sit-for 2))))))))


(defun thatpt (thing &optional arg ispec) 
  "Returns a buffer substring according to THING.
THING may be a well known form as `symbol',
`list', `sexp', `defun'.
You may also define new and abstract kinds of THING.
See example given in thingatpt-util.el.
Called interactively, it always copies thing-at-point
as it's the most common use and faster than copy-thing.
Further functions with `thatpt' provide moves, transpositions.  
 "
  (let* ((bounds (bounds-of-thatpt thing arg))
         (type (if bounds
                   (buffer-substring-no-properties (car bounds) (cdr bounds))
                 nil)))
    (if ispec
        (if type
            (progn
              ;;              (if (eq thing 'whitespace)
              (kill-new type)
              ;;              (kill-new (string-strip type)))
              (message "%s" (car kill-ring)))
          (message "%s" "nil"))
      type)))

(defun bounds-of-thatpt (thing &optional arg move-flag)
  "Determine the start and end buffer locations for the THING at point.
     THING is a symbol which specifies the kind of syntactic entity you want.
     Possibilities include `symbol', `list', `sexp', `defun', `filename', `url',
     `word', `sentence', `whitespace', `line', `page' and others."
  (condition-case nil
      (save-excursion
        (let ((orig (point))
              (beg (progn 
                     (funcall ;; First, move to beg.
                      (or (get thing 'beginning-op) 
                          (lambda ()
                            (forward-char 1)
                            (forward-thing thing -1))))
                     (point)))
              (end
               (progn (funcall ;; Then move to end.
                       (or (get thing 'end-op)
                           (lambda () (forward-thing thing 1))))
                      (point)))
              ;; jump back to see if pos is identic to beg 
              (jumped-back
               (progn 
                 (forward-char -1) 
                 (funcall 
                  (or (get thing 'beginning-op) 
                      (lambda ()
                        (forward-thing thing -1))))
                 (point))))
          ;; if orig not between beg and end, failure, nil
          (when (or move-flag
                    (and (= beg jumped-back) (<= beg orig) (<= orig end) (< beg 
end)))
            (cons beg end))))
    (error nil)))

(defun thatpt-bounds (thing &optional arg ispec)
  "thatpt-bounds returns a cons (beg . end)
of THING if any suitable - nil otherwise.
Thatpt-beginning and thatpt-end return point."
  (let* ((bounds (bounds-of-thatpt thing arg))
         (start (car bounds))
         (end (cdr bounds)))
    (when ispec
      (message "%s %s" start end)) 
    (list start end)))

(defun thatpt-beginning (thing &optional arg ispec)
  (let* ((bounds (bounds-of-thatpt thing arg))
         (start (car bounds)))
    (when ispec
      (message "%s " start)) 
    start))

(defun thatpt-end (thing &optional arg ispec)
  (let* ((bounds (bounds-of-thatpt thing arg))
         (end (cdr bounds)))
    (when ispec
      (message "%s "  end)) 
    end))

(defun thatpt-copy (thing &optional arg ispec)
  (let ((newcopy (thatpt thing arg)))
    (if newcopy
        (progn
          (kill-new (thatpt thing arg))
          (if ispec
              (message "%s" (car kill-ring))
            (car kill-ring)))
      nil)))

(defun thatpt-kill (thing &optional arg) 
  " "
  (let* ((arg (or arg 1))
         (bounds (bounds-of-thatpt thing arg)) 
         (start (car bounds))
         (end (cdr bounds)))
    (kill-region start end)))

(defun thatpt-forward (thing &optional arg ispec) 
  " "
  (interactive "p\np")
  (or arg (setq arg 1))
  (let ((ep (cdr (bounds-of-thatpt thing arg t))))
    (when ep
      (goto-char ep)
      (when ispec
        (message "    %s" (point))))))

(defun thatpt-backward (thing &optional arg ispec) 
  " "
  (interactive "p\np")
  (or arg (setq arg 1))
  (let ((bp (car (bounds-of-thatpt thing arg t))))
    (when bp
      (goto-char bp)
      (when ispec
        (message "    %s" (point))))))


(provide 'thingatpt-util)


;;; thatpt-util.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]