/***************************************************************************
* This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne. JOVE *
* is provided to you without charge, and with no warranty. You may give *
* away copies of JOVE, including sources, provided that this notice is *
* included in all the files. *
***************************************************************************/
s_mess(": %f %s", get_time((time_t *) 0, (char *) 0, 0, -1));
ins_str(sprint("\\%03o", c
), NO
);
static char inquotes
[] = "Where are the quotes?";
char *first
= StrIndex(-1, linebuf
, curchar
, '"'),
*last
= StrIndex(1, linebuf
, curchar
+ 1, '"'),
if (first
== 0 || last
== 0)
while (num
-- && isdigit(*first
++) && first
< last
)
s_mess("%d characters", numchars
);
/* Transpos cur_char with cur_char - 1 */
if (curchar
== 0 || (eolp() && curchar
== 1))
complain((char *) 0); /* BEEP */
before
= linebuf
[curchar
- 1];
/* Switch current line with previous one */
old_prev
= curline
->l_prev
->l_dline
;
curline
->l_prev
->l_dline
= curline
->l_dline
;
curline
->l_dline
= old_prev
;
line_move(FORWARD
, 1, NO
);
/* If argument is specified, kill that many lines down. Otherwise,
if we "appear" to be at the end of a line, i.e. everything to the
right of the cursor is white space, we delete the line separator
as if we were at the end of the line. */
if (num
== 0) { /* Kill to beginning of line */
line2
= next_line(curline
, num
);
if ((LineDist(curline
, line2
) < num
) || (line2
== curline
))
} else if (blnkp(&linebuf
[curchar
])) {
line2
= next_line(curline
, 1);
reg_kill(line2
, char2
, 0);
/* kill to beginning of sentence */
/* Kill to end of sentence */
reg_kill(line1
, char1
, 1);
reg_kill(line1
, char1
, 1);
s_mess("[%sunbound]", key_strokes
);
if (killbuf
[killptr
] == 0)
complain("[Nothing to yank!]");
dot
= DoYank(line
, 0, lp
, length(lp
), curline
, curchar
, curbuf
);
message("[No buffers need saving]");
register Buffer
*oldb
= curbuf
,
for (b
= world
; b
!= 0; b
= b
->b_next
) {
if (!IsModified(b
) || b
->b_type
!= B_FILE
)
SetBuf(b
); /* Make this current Buffer */
if (curbuf
->b_fname
== 0) {
newname
= ask(NullStr
, "Buffer \"%s\" needs a file name; type Return to skip: ", b
->b_name
);
if (askp
&& (yes_or_no_p("Write %s? ", curbuf
->b_fname
) == NO
))
filemunge(curbuf
->b_fname
);
#if !(defined(MSDOS) || defined(MAC))
chk_mtime(curbuf
, curbuf
->b_fname
, "save");
file_write(curbuf
->b_fname
, 0);
for (cp
= linebuf
; c
= *cp
; cp
++)
if (c
!= ' ' && c
!= '\t')
/* GoLine -- go to a line, usually wired to goto-line, ESC g or ESC G.
If no argument is specified it asks for a line number. */
set_arg_value(ask_int("Line: ",10));
#else /* not ANSICODES */
if (!is_an_arg() || arg_value() <= 0) {
putpad(SP
, 1); /* Ask for cursor position */
set_arg_value(ask_int("Line: ", 10));
newline
= next_line(curbuf
->b_first
, arg_value() - 1);
register struct scrimage
*sp
= &PhysScreen
[line
];
sp
= &PhysScreen
[--line
];
if (sp
->s_flags
& MODELINE
)
if (curwind
!= sp
->s_window
)
curchar
= how_far(sp
->s_lp
, col
);
static char *unsupported
= "[Unsupported ANSI code received]";
while (isdigit(c
= getch()))
num1
= (num1
* 10) + (c
- '0');
while (isdigit(c
= getch()))
num2
= (num2
* 10) + (c
- '0');
MoveToCursor(--num1
, --num2
);
ExecCmd((data_obj
*) FindCmd(IncFSearch
));
ExecCmd((data_obj
*) FindCmd(QRepSearch
));
ExecCmd((data_obj
*) FindCmd(ForSearch
));
ExecCmd((data_obj
*) FindCmd(RevSearch
));
case 'z': /* Sun function keys send <esc>[Nz */
ExecCmd((data_obj
*) FindCmd(QRepSearch
));
ExecCmd((data_obj
*) FindCmd(IncFSearch
));
ExecCmd((data_obj
*) FindCmd(RepSearch
));
ExecCmd((data_obj
*) FindCmd(IncRSearch
));
case 215: /* R8 == UpArrow */
case 217: /* R10 == LeftArrow */
case 219: /* R12 == RightArrow */
case 221: /* R14 == DownArrow */
num1
= -1; /* Hack flags failure */
LMargin
= calc_pos(linebuf
, curchar
);
RMargin
= calc_pos(linebuf
, curchar
);