source: perl/lib/BarnOwl/Editwin.pm @ 7c83a32

release-1.4release-1.5release-1.6release-1.7release-1.8release-1.9
Last change on this file since 7c83a32 was c6ecf5c, checked in by Nelson Elhage <nelhage@mit.edu>, 13 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 
1use warnings;
2use strict;
3
4=head1 NAME
5
6BarnOwl::Editwin
7
8=head1 DESCRIPTION
9
10Functions for interfacing with the BarnOwl editwin. Most of the
11functions in this module are defined in perlglue.xs; This module
12exists to provide Exporter hooks and documentation for them.
13
14=cut
15
16package BarnOwl::Editwin;
17use base qw(Exporter);
18
19our @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
23sub 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
31sub 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
391;
Note: See TracBrowser for help on using the repository browser.