ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/urxvt.pm
(Generate patch)

Comparing rxvt-unicode/src/urxvt.pm (file contents):
Revision 1.257 by root, Thu Jul 13 10:31:27 2017 UTC vs.
Revision 1.258 by root, Tue Sep 17 20:38:14 2019 UTC

115the C<urxvt::extension> section below. 115the C<urxvt::extension> section below.
116 116
117=head2 META comments 117=head2 META comments
118 118
119Rxvt-unicode recognizes special meta comments in extensions that define 119Rxvt-unicode recognizes special meta comments in extensions that define
120different types of metadata. 120different types of metadata. These comments are scanned whenever a
121terminal is created and are typically used to autoload extensions when
122their resources or command line parameters are used.
121 123
122Currently, it recognises only one such comment: 124Currently, it recognises only one such comment:
123 125
124=over 4 126=over 4
125 127
126=item #:META:RESOURCE:name:type:desc 128=item #:META:RESOURCE:name:type:desc
127 129
128The RESOURCE comment defines a resource used by the extension, where 130The RESOURCE comment defines a resource used by the extension, where
129C<name> is the resource name, C<type> is the resource type, C<boolean> 131C<name> is the resource name, C<type> is the resource type, C<boolean>
130or C<string>, and C<desc> is the resource description. 132or C<string>, and C<desc> is the resource description.
133
134The extension will be autoloaded when this resource is specified or used
135as a command line parameter.
131 136
132=back 137=back
133 138
134=head2 Hooks 139=head2 Hooks
135 140
600sub parse_resource { 605sub parse_resource {
601 my ($term, $name, $isarg, $longopt, $flag, $value) = @_; 606 my ($term, $name, $isarg, $longopt, $flag, $value) = @_;
602 607
603 $term->scan_extensions; 608 $term->scan_extensions;
604 609
610 # iterating over all resources has quadratic time overhead
611 # overall, maybe this could be optimised?
605 my $r = $term->{meta}{resource}; 612 my $r = $term->{meta}{resource};
606 keys %$r; # reset iterator 613 keys %$r; # reset iterator
607 while (my ($k, $v) = each %$r) { 614 while (my ($k, $v) = each %$r) {
608 my $pattern = $k; 615 my $pattern = $k;
609 $pattern =~ y/./-/ if $isarg; 616 $pattern =~ y/./-/ if $isarg;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines