Homepage Project

XFF -- extended find-file

Description
Known Problems
Download
Version history

Description

This package extends `find-file' with some special syntax of the form:

	file*keyword1=arg1*keyword2=arg2
	file*keyword1=arg1*keyword2:rest

A split char in the file name has to be escaped with a backslash.

At the moment the following keywords are defined (see `xff-commands'):

line=LINE
goto line
char=CHAR
goto char
find=TEXT or rather find:SOME TEXT
find text
select=BEG-END
select/mark the region from BEG to END

Installation: Put (require 'xff) (xff-install) into your init file (~/.xemacs/init.el or ~/.emacs.el).

Original Syntax

The original syntax can still be enabled setting `xff-mode' to 'original, though it is not recommended to change this variable:

	file?keyword1=arg1&keyword2=arg2&...
	file?keyword1=arg1&keyword2:rest

The REST argument may contain any characters, incl. '&'.

Examples:

	(find-file "~/.bashrc?line=10")
	(find-file "~/.bashrc?char=10")
	(find-file "~/.bashrc?select=10-20")
	(find-file "~/.bashrc?find=TEXINPUTS")

or from the command line:

	editclient.sh ~/.bashrc?find=TEXINPUTS

Simplified Syntax

Basically the same as the original syntax, except that the split-string and the next-string are asterisks. An asterisk in the filename has to be escaped by prepending "\".

	file*keyword1=arg1*keyword2=arg2
	file*keyword1=arg1*keyword2:rest

Revised Syntax

(This doesn't work, when running XEmacs via gnuclient from bash.)

Following a proposal by D. Goel (aka deego AT glue umd edu), I revised the syntax as follows:

	command1=arg1&command2=arg2&...&commandN=argN?filename
	?filename-including-a-question-mark?

The revised-1 syntax can be enabled setting `xff-mode' to revised-1.

Commands: Should not contain one of these characters: ?, &, =.

Arguments: "&" or "?" have to be escaped with "\". Thus, an argument like "bla&bla?" would have to be written as "bla\&bla\?".

A "\" always escapes the following character. Consequently, "\\" yields "\".

Examples:

	(find-file "~/.bashrc")
	(find-file "line=10?~/.bashrc")
	(find-file "char=10?~/.bashrc")
	(find-file "select=10-20?~/.bashrc")
	(find-file "find=TEX?~/.bashrc")
	(let ((xff-allow-function-calls-flag t))
		(find-file "search-forward=tex?~/.bashrc"))

or from the command line:

	editclient.sh find=TEXINPUTS?~/.bashrc

Known Problems

Download

Requirements: tellib

1.2: xff.el.gz

Version history

1.2
Revised syntax (following a proposal by D. Goel aka deego AT glue umd edu); check if we are dealing with a xff argument first; simplified original syntax (new default mode); works with gnuserv.
1.1
Initial release (tested with XEmacs 21.4.8)


(c) 2003 Thomas Link (last updated Mar 20 2003) home top