File:  [Research Unix] / researchv9 / cmd / emacs / macros / balance
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:59 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv9-SUN3_old, researchv9-SUN3, HEAD
researchv9-SUN3(old)

backscan -- scan backwards for [](){}

Warren A. Montgomery, IH 6E314, Version 3.4

 returns 0 if not found, 1 if found.

.  This set requires emacs version 3.2, with the case command

|�	see if at beggining of file
	�<[][(){}]
		-4��If not, backsearch
	� 0�False
�
match) match a right parenthesis

	Returns 1 if it can match the current (, 0 otherwise
^�|���backscan
	!�	see what backscan found
		�)�match)
�
		�]�match]
�
		�}�match}
���
	� 0���	found something that made us stop
~�(
)paren_match Shows matching ( for a )


)�|�
	��match)
	�
	� ��
match] match a right bracket

	Returns 1 if it can match the current ], 0 otherwise
^�|���backscan
	!�	see what backscan found
		�)�match)
�
		�]�match]
�
		�}�match}
���
	� 0���	found something that made us stop
~�[
]bracket_match Shows matching [ for a ]


]�|�
	��match]
	�
	� ��
match} match a right curly bracket

	Returns 1 if it can match the current }, 0 otherwise
^�|���backscan
	!�	see what backscan found
		�)�match)
�
		�]�match]
�
		�}�match}
���
	� 0���	found something that made us stop
~�{
}brace_match  Show matching { for }


|�
	�~�	�
	� ��	simulate c mode
}�|�
	��match}
	�
	� ��
�Show_match -- show matching terminator.
�!�		Match the current character
	�)�match)
�
	�]�match]
�
	�}�match}
�
	��		Not matchable
�
�

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.