release-1.10release-1.4release-1.5release-1.6release-1.7release-1.8release-1.9
|
Last change
on this file since eb6cedc was
c6ecf5c,
checked in by Nelson Elhage <nelhage@mit.edu>, 17 years ago
|
|
Implement text_{before,after)_point in Perl.
These can easily be implemented in perl using save_excursion and
get_region, so there's no need for them in C.
|
-
Property mode set to
100644
|
|
File size:
857 bytes
|
| Line | |
|---|
| 1 | use warnings; |
|---|
| 2 | use strict; |
|---|
| 3 | |
|---|
| 4 | =head1 NAME |
|---|
| 5 | |
|---|
| 6 | BarnOwl::Editwin |
|---|
| 7 | |
|---|
| 8 | =head1 DESCRIPTION |
|---|
| 9 | |
|---|
| 10 | Functions for interfacing with the BarnOwl editwin. Most of the |
|---|
| 11 | functions in this module are defined in perlglue.xs; This module |
|---|
| 12 | exists to provide Exporter hooks and documentation for them. |
|---|
| 13 | |
|---|
| 14 | =cut |
|---|
| 15 | |
|---|
| 16 | package BarnOwl::Editwin; |
|---|
| 17 | use base qw(Exporter); |
|---|
| 18 | |
|---|
| 19 | our @EXPORT_OK = qw(text_before_point text_after_point replace |
|---|
| 20 | point_move replace_region get_region |
|---|
| 21 | save_excursion current_column point mark); |
|---|
| 22 | |
|---|
| 23 | sub text_before_point { |
|---|
| 24 | save_excursion { |
|---|
| 25 | BarnOwl::command('edit:set-mark'); |
|---|
| 26 | BarnOwl::command('edit:move-to-buffer-start'); |
|---|
| 27 | get_region(); |
|---|
| 28 | } |
|---|
| 29 | } |
|---|
| 30 | |
|---|
| 31 | sub text_after_point { |
|---|
| 32 | save_excursion { |
|---|
| 33 | BarnOwl::command('edit:set-mark'); |
|---|
| 34 | BarnOwl::command('edit:move-to-buffer-end'); |
|---|
| 35 | get_region(); |
|---|
| 36 | } |
|---|
| 37 | } |
|---|
| 38 | |
|---|
| 39 | 1; |
|---|
Note: See
TracBrowser
for help on using the repository browser.