The world's most popular open source database
#include <config.h>#include "el.h"Include dependency graph for emacs.c:

Go to the source code of this file.
Functions | |
| protected el_action_t | em_delete_or_list (EditLine *el, int c __attribute__((__unused__))) |
| protected el_action_t | em_delete_next_word (EditLine *el, int c __attribute__((__unused__))) |
| protected el_action_t | em_yank (EditLine *el, int c __attribute__((__unused__))) |
| protected el_action_t | em_kill_line (EditLine *el, int c __attribute__((__unused__))) |
| protected el_action_t | em_kill_region (EditLine *el, int c __attribute__((__unused__))) |
| protected el_action_t | em_copy_region (EditLine *el, int c __attribute__((__unused__))) |
| protected el_action_t | em_gosmacs_transpose (EditLine *el, int c) |
| protected el_action_t | em_next_word (EditLine *el, int c __attribute__((__unused__))) |
| protected el_action_t | em_upper_case (EditLine *el, int c __attribute__((__unused__))) |
| protected el_action_t | em_capitol_case (EditLine *el, int c __attribute__((__unused__))) |
| protected el_action_t | em_lower_case (EditLine *el, int c __attribute__((__unused__))) |
| protected el_action_t | em_set_mark (EditLine *el, int c __attribute__((__unused__))) |
| protected el_action_t | em_exchange_mark (EditLine *el, int c __attribute__((__unused__))) |
| protected el_action_t | em_universal_argument (EditLine *el, int c __attribute__((__unused__))) |
| protected el_action_t | em_meta_next (EditLine *el, int c __attribute__((__unused__))) |
| protected el_action_t | em_toggle_overwrite (EditLine *el, int c __attribute__((__unused__))) |
| protected el_action_t | em_copy_prev_word (EditLine *el, int c __attribute__((__unused__))) |
| protected el_action_t | em_inc_search_next (EditLine *el, int c __attribute__((__unused__))) |
| protected el_action_t | em_inc_search_prev (EditLine *el, int c __attribute__((__unused__))) |
| protected el_action_t | em_delete_prev_char (EditLine *el, int c __attribute__((__unused__))) |
| protected el_action_t em_capitol_case | ( | EditLine * | el, | |
| int c | __attribute__((__unused__)) | |||
| ) |
Definition at line 302 of file emacs.c.
References el_state_t::argument, c__next_word(), CC_REFRESH, ce__isword(), el_line_t::cursor, el, editline::el_line, editline::el_state, and el_line_t::lastchar.
00303 { 00304 char *cp, *ep; 00305 00306 ep = c__next_word(el->el_line.cursor, el->el_line.lastchar, 00307 el->el_state.argument, ce__isword); 00308 00309 for (cp = el->el_line.cursor; cp < ep; cp++) { 00310 if (isalpha((unsigned char)*cp)) { 00311 if (islower((unsigned char)*cp)) 00312 *cp = toupper((unsigned char)*cp); 00313 cp++; 00314 break; 00315 } 00316 } 00317 for (; cp < ep; cp++) 00318 if (isupper((unsigned char)*cp)) 00319 *cp = tolower((unsigned char)*cp); 00320 00321 el->el_line.cursor = ep; 00322 if (el->el_line.cursor > el->el_line.lastchar) 00323 el->el_line.cursor = el->el_line.lastchar; 00324 return (CC_REFRESH); 00325 }
Here is the call graph for this function:

| protected el_action_t em_copy_prev_word | ( | EditLine * | el, | |
| int c | __attribute__((__unused__)) | |||
| ) |
Definition at line 433 of file emacs.c.
References el_state_t::argument, el_line_t::buffer, c__prev_word(), c_insert(), CC_ERROR, CC_REFRESH, ce__isword(), el_line_t::cursor, el, editline::el_line, editline::el_state, and el_line_t::lastchar.
00434 { 00435 char *cp, *oldc, *dp; 00436 00437 if (el->el_line.cursor == el->el_line.buffer) 00438 return (CC_ERROR); 00439 00440 oldc = el->el_line.cursor; 00441 /* does a bounds check */ 00442 cp = c__prev_word(el->el_line.cursor, el->el_line.buffer, 00443 el->el_state.argument, ce__isword); 00444 00445 c_insert(el, oldc - cp); 00446 for (dp = oldc; cp < oldc && dp < el->el_line.lastchar; cp++) 00447 *dp++ = *cp; 00448 00449 el->el_line.cursor = dp;/* put cursor at end */ 00450 00451 return (CC_REFRESH); 00452 }
Here is the call graph for this function:

| protected el_action_t em_copy_region | ( | EditLine * | el, | |
| int c | __attribute__((__unused__)) | |||
| ) |
Definition at line 204 of file emacs.c.
References c_kill_t::buf, el_chared_t::c_kill, CC_ERROR, CC_NORM, lineinfo::cursor, el_line_t::cursor, el, editline::el_chared, el_line(), editline::el_line, c_kill_t::last, and c_kill_t::mark.
00205 { 00206 char *kp, *cp; 00207 00208 if (!el->el_chared.c_kill.mark) 00209 return (CC_ERROR); 00210 00211 if (el->el_chared.c_kill.mark > el->el_line.cursor) { 00212 cp = el->el_line.cursor; 00213 kp = el->el_chared.c_kill.buf; 00214 while (cp < el->el_chared.c_kill.mark) 00215 *kp++ = *cp++; /* copy it */ 00216 el->el_chared.c_kill.last = kp; 00217 } else { 00218 cp = el->el_chared.c_kill.mark; 00219 kp = el->el_chared.c_kill.buf; 00220 while (cp < el->el_line.cursor) 00221 *kp++ = *cp++; /* copy it */ 00222 el->el_chared.c_kill.last = kp; 00223 } 00224 return (CC_NORM); 00225 }
Here is the call graph for this function:

| protected el_action_t em_delete_next_word | ( | EditLine * | el, | |
| int c | __attribute__((__unused__)) | |||
| ) |
Definition at line 85 of file emacs.c.
References el_state_t::argument, c_kill_t::buf, c__next_word(), c_delafter(), el_chared_t::c_kill, CC_ERROR, CC_REFRESH, ce__isword(), el_line_t::cursor, el, editline::el_chared, editline::el_line, editline::el_state, c_kill_t::last, el_line_t::lastchar, and p.
00086 { 00087 char *cp, *p, *kp; 00088 00089 if (el->el_line.cursor == el->el_line.lastchar) 00090 return (CC_ERROR); 00091 00092 cp = c__next_word(el->el_line.cursor, el->el_line.lastchar, 00093 el->el_state.argument, ce__isword); 00094 00095 for (p = el->el_line.cursor, kp = el->el_chared.c_kill.buf; p < cp; p++) 00096 /* save the text */ 00097 *kp++ = *p; 00098 el->el_chared.c_kill.last = kp; 00099 00100 c_delafter(el, cp - el->el_line.cursor); /* delete after dot */ 00101 if (el->el_line.cursor > el->el_line.lastchar) 00102 el->el_line.cursor = el->el_line.lastchar; 00103 /* bounds check */ 00104 return (CC_REFRESH); 00105 }
Here is the call graph for this function:

| protected el_action_t em_delete_or_list | ( | EditLine * | el, | |
| int c | __attribute__((__unused__)) | |||
| ) |
Definition at line 48 of file emacs.c.
References el_state_t::argument, el_line_t::buffer, c_delafter(), c_delafter1(), CC_EOF, CC_ERROR, CC_REFRESH, el_line_t::cursor, el_state_t::doingarg, el, editline::el_line, editline::el_state, el_line_t::lastchar, STReof, term__flush(), term_beep(), and term_overwrite().
00049 { 00050 00051 if (el->el_line.cursor == el->el_line.lastchar) { 00052 /* if I'm at the end */ 00053 if (el->el_line.cursor == el->el_line.buffer) { 00054 /* and the beginning */ 00055 term_overwrite(el, STReof, 4); /* then do a EOF */ 00056 term__flush(); 00057 return (CC_EOF); 00058 } else { 00059 /* 00060 * Here we could list completions, but it is an 00061 * error right now 00062 */ 00063 term_beep(el); 00064 return (CC_ERROR); 00065 } 00066 } else { 00067 if (el->el_state.doingarg) 00068 c_delafter(el, el->el_state.argument); 00069 else 00070 c_delafter1(el); 00071 if (el->el_line.cursor > el->el_line.lastchar) 00072 el->el_line.cursor = el->el_line.lastchar; 00073 /* bounds check */ 00074 return (CC_REFRESH); 00075 } 00076 }
Here is the call graph for this function:

| protected el_action_t em_delete_prev_char | ( | EditLine * | el, | |
| int c | __attribute__((__unused__)) | |||
| ) |
Definition at line 487 of file emacs.c.
References el_state_t::argument, el_line_t::buffer, c_delbefore(), c_delbefore1(), CC_ERROR, CC_REFRESH, el_line_t::cursor, el_state_t::doingarg, el, editline::el_line, and editline::el_state.
00488 { 00489 00490 if (el->el_line.cursor <= el->el_line.buffer) 00491 return (CC_ERROR); 00492 00493 if (el->el_state.doingarg) 00494 c_delbefore(el, el->el_state.argument); 00495 else 00496 c_delbefore1(el); 00497 el->el_line.cursor -= el->el_state.argument; 00498 if (el->el_line.cursor < el->el_line.buffer) 00499 el->el_line.cursor = el->el_line.buffer; 00500 return (CC_REFRESH); 00501 }
Here is the call graph for this function:

| protected el_action_t em_exchange_mark | ( | EditLine * | el, | |
| int c | __attribute__((__unused__)) | |||
| ) |
Definition at line 372 of file emacs.c.
References el_chared_t::c_kill, CC_CURSOR, el_line_t::cursor, el, editline::el_chared, editline::el_line, and c_kill_t::mark.
00373 { 00374 char *cp; 00375 00376 cp = el->el_line.cursor; 00377 el->el_line.cursor = el->el_chared.c_kill.mark; 00378 el->el_chared.c_kill.mark = cp; 00379 return (CC_CURSOR); 00380 }
| protected el_action_t em_gosmacs_transpose | ( | EditLine * | el, | |
| int | c | |||
| ) |
Definition at line 233 of file emacs.c.
References el_line_t::buffer, CC_ERROR, CC_REFRESH, el_line_t::cursor, el, and editline::el_line.
00234 { 00235 00236 if (el->el_line.cursor > &el->el_line.buffer[1]) { 00237 /* must have at least two chars entered */ 00238 c = el->el_line.cursor[-2]; 00239 el->el_line.cursor[-2] = el->el_line.cursor[-1]; 00240 el->el_line.cursor[-1] = c; 00241 return (CC_REFRESH); 00242 } else 00243 return (CC_ERROR); 00244 }
| protected el_action_t em_inc_search_next | ( | EditLine * | el, | |
| int c | __attribute__((__unused__)) | |||
| ) |
Definition at line 460 of file emacs.c.
References ce_inc_search(), el, editline::el_search, and el_search_t::patlen.
00461 { 00462 00463 el->el_search.patlen = 0; 00464 return (ce_inc_search(el, ED_SEARCH_NEXT_HISTORY)); 00465 }
Here is the call graph for this function:

| protected el_action_t em_inc_search_prev | ( | EditLine * | el, | |
| int c | __attribute__((__unused__)) | |||
| ) |
Definition at line 473 of file emacs.c.
References ce_inc_search(), el, editline::el_search, and el_search_t::patlen.
00474 { 00475 00476 el->el_search.patlen = 0; 00477 return (ce_inc_search(el, ED_SEARCH_PREV_HISTORY)); 00478 }
Here is the call graph for this function:

| protected el_action_t em_kill_line | ( | EditLine * | el, | |
| int c | __attribute__((__unused__)) | |||
| ) |
Definition at line 149 of file emacs.c.
References c_kill_t::buf, el_line_t::buffer, el_chared_t::c_kill, CC_REFRESH, el_line_t::cursor, el, editline::el_chared, el_line(), editline::el_line, c_kill_t::last, el_line_t::lastchar, and lineinfo::lastchar.
Referenced by vi_substitute_line().
00150 { 00151 char *kp, *cp; 00152 00153 cp = el->el_line.buffer; 00154 kp = el->el_chared.c_kill.buf; 00155 while (cp < el->el_line.lastchar) 00156 *kp++ = *cp++; /* copy it */ 00157 el->el_chared.c_kill.last = kp; 00158 /* zap! -- delete all of it */ 00159 el->el_line.lastchar = el->el_line.buffer; 00160 el->el_line.cursor = el->el_line.buffer; 00161 return (CC_REFRESH); 00162 }
Here is the call graph for this function:

Here is the caller graph for this function:

| protected el_action_t em_kill_region | ( | EditLine * | el, | |
| int c | __attribute__((__unused__)) | |||
| ) |
Definition at line 171 of file emacs.c.
References c_kill_t::buf, c_delafter(), c_delbefore(), el_chared_t::c_kill, CC_ERROR, CC_REFRESH, lineinfo::cursor, el_line_t::cursor, el, editline::el_chared, el_line(), editline::el_line, c_kill_t::last, and c_kill_t::mark.
00172 { 00173 char *kp, *cp; 00174 00175 if (!el->el_chared.c_kill.mark) 00176 return (CC_ERROR); 00177 00178 if (el->el_chared.c_kill.mark > el->el_line.cursor) { 00179 cp = el->el_line.cursor; 00180 kp = el->el_chared.c_kill.buf; 00181 while (cp < el->el_chared.c_kill.mark) 00182 *kp++ = *cp++; /* copy it */ 00183 el->el_chared.c_kill.last = kp; 00184 c_delafter(el, cp - el->el_line.cursor); 00185 } else { /* mark is before cursor */ 00186 cp = el->el_chared.c_kill.mark; 00187 kp = el->el_chared.c_kill.buf; 00188 while (cp < el->el_line.cursor) 00189 *kp++ = *cp++; /* copy it */ 00190 el->el_chared.c_kill.last = kp; 00191 c_delbefore(el, cp - el->el_chared.c_kill.mark); 00192 el->el_line.cursor = el->el_chared.c_kill.mark; 00193 } 00194 return (CC_REFRESH); 00195 }
Here is the call graph for this function:

| protected el_action_t em_lower_case | ( | EditLine * | el, | |
| int c | __attribute__((__unused__)) | |||
| ) |
Definition at line 334 of file emacs.c.
References el_state_t::argument, c__next_word(), CC_REFRESH, ce__isword(), el_line_t::cursor, el, editline::el_line, editline::el_state, and el_line_t::lastchar.
00335 { 00336 char *cp, *ep; 00337 00338 ep = c__next_word(el->el_line.cursor, el->el_line.lastchar, 00339 el->el_state.argument, ce__isword); 00340 00341 for (cp = el->el_line.cursor; cp < ep; cp++) 00342 if (isupper((unsigned char)*cp)) 00343 *cp = tolower((unsigned char)*cp); 00344 00345 el->el_line.cursor = ep; 00346 if (el->el_line.cursor > el->el_line.lastchar) 00347 el->el_line.cursor = el->el_line.lastchar; 00348 return (CC_REFRESH); 00349 }
Here is the call graph for this function:

| protected el_action_t em_meta_next | ( | EditLine * | el, | |
| int c | __attribute__((__unused__)) | |||
| ) |
Definition at line 406 of file emacs.c.
References CC_ARGHACK, el, editline::el_state, and el_state_t::metanext.
00407 { 00408 00409 el->el_state.metanext = 1; 00410 return (CC_ARGHACK); 00411 }
| protected el_action_t em_next_word | ( | EditLine * | el, | |
| int c | __attribute__((__unused__)) | |||
| ) |
Definition at line 253 of file emacs.c.
References c_vcmd_t::action, el_state_t::argument, c__next_word(), el_chared_t::c_vcmd, CC_CURSOR, CC_ERROR, CC_REFRESH, ce__isword(), el_line_t::cursor, cv_delfini(), el, editline::el_chared, editline::el_line, editline::el_map, editline::el_state, el_line_t::lastchar, MAP_VI, NOP, and el_map_t::type.
00254 { 00255 if (el->el_line.cursor == el->el_line.lastchar) 00256 return (CC_ERROR); 00257 00258 el->el_line.cursor = c__next_word(el->el_line.cursor, 00259 el->el_line.lastchar, 00260 el->el_state.argument, 00261 ce__isword); 00262 00263 if (el->el_map.type == MAP_VI) 00264 if (el->el_chared.c_vcmd.action != NOP) { 00265 cv_delfini(el); 00266 return (CC_REFRESH); 00267 } 00268 return (CC_CURSOR); 00269 }
Here is the call graph for this function:

| protected el_action_t em_set_mark | ( | EditLine * | el, | |
| int c | __attribute__((__unused__)) | |||
| ) |
Definition at line 358 of file emacs.c.
References el_chared_t::c_kill, CC_NORM, el_line_t::cursor, el, editline::el_chared, editline::el_line, and c_kill_t::mark.
| protected el_action_t em_toggle_overwrite | ( | EditLine * | el, | |
| int c | __attribute__((__unused__)) | |||
| ) |
Definition at line 419 of file emacs.c.
References CC_NORM, el, editline::el_state, el_state_t::inputmode, MODE_INSERT, and MODE_REPLACE.
00420 { 00421 00422 el->el_state.inputmode = (el->el_state.inputmode == MODE_INSERT) ? 00423 MODE_REPLACE : MODE_INSERT; 00424 return (CC_NORM); 00425 }
| protected el_action_t em_universal_argument | ( | EditLine * | el, | |
| int c | __attribute__((__unused__)) | |||
| ) |
Definition at line 389 of file emacs.c.
References el_state_t::argument, CC_ARGHACK, CC_ERROR, el_state_t::doingarg, el, and editline::el_state.
00390 { /* multiply current argument by 4 */ 00391 00392 if (el->el_state.argument > 1000000) 00393 return (CC_ERROR); 00394 el->el_state.doingarg = 1; 00395 el->el_state.argument *= 4; 00396 return (CC_ARGHACK); 00397 }
| protected el_action_t em_upper_case | ( | EditLine * | el, | |
| int c | __attribute__((__unused__)) | |||
| ) |
Definition at line 278 of file emacs.c.
References el_state_t::argument, c__next_word(), CC_REFRESH, ce__isword(), el_line_t::cursor, el, editline::el_line, editline::el_state, and el_line_t::lastchar.
00279 { 00280 char *cp, *ep; 00281 00282 ep = c__next_word(el->el_line.cursor, el->el_line.lastchar, 00283 el->el_state.argument, ce__isword); 00284 00285 for (cp = el->el_line.cursor; cp < ep; cp++) 00286 if (islower((unsigned char)*cp)) 00287 *cp = toupper((unsigned char)*cp); 00288 00289 el->el_line.cursor = ep; 00290 if (el->el_line.cursor > el->el_line.lastchar) 00291 el->el_line.cursor = el->el_line.lastchar; 00292 return (CC_REFRESH); 00293 }
Here is the call graph for this function:

| protected el_action_t em_yank | ( | EditLine * | el, | |
| int c | __attribute__((__unused__)) | |||
| ) |
Definition at line 114 of file emacs.c.
References el_state_t::argument, c_kill_t::buf, c_insert(), el_chared_t::c_kill, CC_ERROR, CC_NORM, CC_REFRESH, el_line_t::cursor, el, editline::el_chared, editline::el_line, editline::el_state, c_kill_t::last, el_line_t::lastchar, el_line_t::limit, and c_kill_t::mark.

