… | |
… | |
115 | the C<urxvt::extension> section below. |
115 | the C<urxvt::extension> section below. |
116 | |
116 | |
117 | =head2 META comments |
117 | =head2 META comments |
118 | |
118 | |
119 | Rxvt-unicode recognizes special meta comments in extensions that define |
119 | Rxvt-unicode recognizes special meta comments in extensions that define |
120 | different types of metadata. |
120 | different types of metadata. These comments are scanned whenever a |
|
|
121 | terminal is created and are typically used to autoload extensions when |
|
|
122 | their resources or command line parameters are used. |
121 | |
123 | |
122 | Currently, it recognises only one such comment: |
124 | Currently, 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 | |
128 | The RESOURCE comment defines a resource used by the extension, where |
130 | The RESOURCE comment defines a resource used by the extension, where |
129 | C<name> is the resource name, C<type> is the resource type, C<boolean> |
131 | C<name> is the resource name, C<type> is the resource type, C<boolean> |
130 | or C<string>, and C<desc> is the resource description. |
132 | or C<string>, and C<desc> is the resource description. |
|
|
133 | |
|
|
134 | The extension will be autoloaded when this resource is specified or used |
|
|
135 | as a command line parameter. |
131 | |
136 | |
132 | =back |
137 | =back |
133 | |
138 | |
134 | =head2 Hooks |
139 | =head2 Hooks |
135 | |
140 | |
… | |
… | |
518 | PrivMode_Screen, PrivMode_Autowrap, PrivMode_aplCUR, PrivMode_aplKP, |
523 | PrivMode_Screen, PrivMode_Autowrap, PrivMode_aplCUR, PrivMode_aplKP, |
519 | PrivMode_HaveBackSpace, PrivMode_BackSpace, PrivMode_ShiftKeys, |
524 | PrivMode_HaveBackSpace, PrivMode_BackSpace, PrivMode_ShiftKeys, |
520 | PrivMode_VisibleCursor, PrivMode_MouseX10, PrivMode_MouseX11, |
525 | PrivMode_VisibleCursor, PrivMode_MouseX10, PrivMode_MouseX11, |
521 | PrivMode_scrollBar, PrivMode_TtyOutputInh, PrivMode_Keypress, |
526 | PrivMode_scrollBar, PrivMode_TtyOutputInh, PrivMode_Keypress, |
522 | PrivMode_smoothScroll, PrivMode_vt52, PrivMode_LFNL, PrivMode_MouseBtnEvent, |
527 | PrivMode_smoothScroll, PrivMode_vt52, PrivMode_LFNL, PrivMode_MouseBtnEvent, |
523 | PrivMode_MouseAnyEvent, PrivMode_BracketPaste, PrivMode_ExtModeMouse, |
528 | PrivMode_MouseAnyEvent, PrivMode_BracketPaste, PrivMode_ExtMouseUTF8, |
524 | PrivMode_ExtMouseRight, PrivMode_BlinkingCursor, PrivMode_mouse_report, |
529 | PrivMode_ExtMouseUrxvt, PrivMode_BlinkingCursor, PrivMode_mouse_report, |
525 | PrivMode_Default |
530 | PrivMode_Default |
526 | |
531 | |
527 | Constants for checking DEC private modes. |
532 | Constants for checking DEC private modes. |
528 | |
533 | |
529 | =back |
534 | =back |
… | |
… | |
600 | sub parse_resource { |
605 | sub 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; |
… | |
… | |
722 | @TERM_EXT = (); |
729 | @TERM_EXT = (); |
723 | $TERM->register_package ($_) for @pkg; |
730 | $TERM->register_package ($_) for @pkg; |
724 | } |
731 | } |
725 | |
732 | |
726 | for ( |
733 | for ( |
|
|
734 | @{ delete $TERM->{perl_ext_3} }, |
727 | (grep $_, map { split /,/, $TERM->resource ("perl_ext_$_") } 1, 2), |
735 | (grep $_, map { split /,/, $TERM->resource ("perl_ext_$_") } 1, 2), |
728 | @{ delete $TERM->{perl_ext_3} } |
|
|
729 | ) { |
736 | ) { |
730 | if ($_ eq "default") { |
737 | if ($_ eq "default") { |
731 | |
738 | |
732 | $ext_arg{$_} = [] |
739 | $ext_arg{$_} = [] |
733 | for qw(selection option-popup selection-popup readline searchable-scrollback); |
740 | for qw(selection option-popup selection-popup readline searchable-scrollback); |