[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: thingatpt-utils-base.el 1.0
From: |
Andreas Roehler |
Subject: |
Re: thingatpt-utils-base.el 1.0 |
Date: |
Sun, 21 Jan 2007 17:18:46 +0100 |
User-agent: |
KNode/0.9.2 |
;; Evaluate this the get new THING `region' to operate on
;; respectively. As region-before and after point
;; doesn't make sense AFAIK, it's dropped here.
;; Also a comes a missing var to get
;;
;; `list-of-things-atpt' working.
;; __
;; Andreas Roehler
;;; Region
(put 'region 'beginning-op
(lambda ()
(setq region-atpt-beginning (region-beginning))
(setq region-atpt-end (region-end))
(goto-char region-atpt-beginning)))
(put 'region 'end-op
(lambda ()
(goto-char region-atpt-end)))
;;;###autoload
(defsubst region-atpt (&optional arg ispec)
"Returns region at point if any, nil otherwise"
(interactive "p\np")
(thatpt 'region arg ispec))
;;;###autoload
(defsubst bounds-of-region-atpt (&optional arg ispec)
"Returns borders of region at point if any, nil otherwise "
(interactive "p\np")
(thatpt-bounds 'region arg ispec))
;;;###autoload
(defsubst region-atpt-beginning-position (&optional arg ispec)
"Returns beginning of symbol or char-class region at point if any, nil
otherwise "
(interactive "p\np")
(thatpt-beginning 'region arg ispec))
;;;###autoload
(defsubst region-atpt-end-position (&optional arg ispec)
"Returns end position of symbol or char-class region at point if any, nil
otherwise "
(interactive "p\np")
(thatpt-end 'region arg ispec))
;;;###autoload
(defsubst copy-region-atpt (&optional arg ispec)
"Makes a copy of symbol or char-class region at point if any, nil otherwise "
(interactive "p\np")
(thatpt-copy 'region arg ispec))
;;;###autoload
(defsubst separate-region-atpt (&optional arg ispec)
"Separates region at point if any, does nothing otherwise
inserts newlines, borders are the beginning or the end of buffer "
(interactive "p\np")
(thatpt-separate 'region arg ispec))
;;;###autoload
(defsubst comment-region-atpt (&optional arg ispec)
"Comments region at point if any, does nothing otherwise "
(interactive "p\np")
(thatpt-comment 'region arg ispec))
;;;###autoload
(defsubst doublequote-region-atpt (&optional arg ispec)
"Doublequotes region at point if any, does nothing otherwise "
(interactive "p\np")
(thatpt-delim 'region 'doublequote arg ispec))
;;;###autoload
(defsubst singlequote-region-atpt (&optional arg ispec)
"Singlequotes region at point if any, does nothing otherwise "
(interactive "p\np")
(thatpt-delim 'region 'singlequote arg ispec))
;;;###autoload
(defsubst parentize-region-atpt (&optional arg ispec)
"Parentizes region at point if any, does nothing otherwise"
(interactive "p\np")
(thatpt-delim 'region 'parentize arg ispec))
;;;###autoload
(defsubst brace-region-atpt (&optional arg ispec)
"Braces region at point if any, does nothing otherwise "
(interactive "p\np")
(thatpt-delim 'region 'brace arg ispec))
;;;###autoload
(defsubst bracket-region-atpt (&optional arg ispec)
"Brackets region after point if any, does nothing otherwise "
(interactive "p\np")
(thatpt-delim 'region 'bracket arg ispec))
;;;###autoload
(defsubst kill-region-atpt ()
"Kills region at point if any, does nothing otherwise "
(interactive "*")
(thatpt-kill 'region))
;;;###autoload
(defsubst forward-region-atpt (&optional arg ispec)
"Moves forward over region at point if any, does nothing otherwise "
(interactive "p\np")
(unless (eobp)
(skip-chars-forward " \t\n\r\f")
;; (forward-char 1)
(thatpt-forward 'region arg ispec)))
;;;###autoload
(defsubst backward-region-atpt (&optional arg ispec)
"Moves backward over region before point if any, does nothing otherwise "
(interactive "p\np")
(skip-chars-backward " \t\n\r\f")
(unless (bobp)
(forward-char -1)
(thatpt-backward 'region arg ispec)))
(setq thatpt-forms-list '(
region
list
symbol
word
sexp
paragraph
string
line
sentence
defun
email
csv
phone
ml-text
filename
url
number
float
page
whitespace
alnum
alpha
ascii
blank
cntrl
digit
graph
lower
multibyte
nonascii
print
punct
space
unibyte
upper
xdigit))
;; end