2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
5 * %sccs.include.redist.c%
9 static char sccsid
[] = "$Id: ex_abbrev.c,v 8.6 1993/12/22 16:15:15 bostic Exp $ (Berkeley) $Date: 1993/12/22 16:15:15 $";
12 #include <sys/types.h>
21 * ex_abbr -- :abbreviate [key replacement]
22 * Create an abbreviation or display abbreviations.
32 if (seq_dump(sp
, SEQ_ABBREV
, 0) == 0)
33 msgq(sp
, M_INFO
, "No abbreviations to display.");
41 if (seq_set(sp
, NULL
, 0, cmdp
->argv
[0]->bp
, cmdp
->argv
[0]->len
,
42 cmdp
->argv
[1]->bp
, cmdp
->argv
[1]->len
, SEQ_ABBREV
, 1))
44 F_SET(sp
->gp
, G_ABBREV
);
49 * ex_unabbr -- :unabbreviate key
50 * Delete an abbreviation.
53 ex_unabbr(sp
, ep
, cmdp
)
61 if (!F_ISSET(sp
->gp
, G_ABBREV
) ||
62 seq_delete(sp
, ap
->bp
, ap
->len
, SEQ_ABBREV
)) {
63 msgq(sp
, M_ERR
, "\"%s\" is not an abbreviation.", ap
->bp
);
71 * Save the abbreviation sequences to a file.
78 return (seq_save(sp
, fp
, "abbreviate ", SEQ_ABBREV
));