diff options
author | Thiago Farina <tfransosi@gmail.com> | 2010-08-26 13:20:25 -0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-28 13:59:13 -0700 |
commit | 7622263b457be5cc46ebd1747dcc3faa46faa9bf (patch) | |
tree | 77e71eb257f6dd4508791bbdc1563b30a8f4cfb2 | |
parent | 799b74b9e7ad2b8d68ac6b592c7577927de80f60 (diff) | |
download | uemacs-7622263b457be5cc46ebd1747dcc3faa46faa9bf.tar.gz |
uemacs: Make getgoal function private to basic.c.
This functions is only used internally by basic.c, so marking it static,
to make it private.
Signed-off-by: Thiago Farina <tfransosi@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | basic.c | 68 | ||||
-rw-r--r-- | efunc.h | 16 |
2 files changed, 41 insertions, 43 deletions
@@ -15,6 +15,36 @@ #include "efunc.h" /* + * This routine, given a pointer to a struct line, and the current cursor goal + * column, return the best choice for the offset. The offset is returned. + * Used by "C-N" and "C-P". + */ +static int getgoal(struct line *dlp) +{ + int c; + int col; + int newcol; + int dbo; + + col = 0; + dbo = 0; + while (dbo != llength(dlp)) { + c = lgetc(dlp, dbo); + newcol = col; + if (c == '\t') + newcol |= tabmask; + else if (c < 0x20 || c == 0x7F) + ++newcol; + ++newcol; + if (newcol > curgoal) + break; + col = newcol; + ++dbo; + } + return dbo; +} + +/* * Move the cursor to the beginning of the current line. */ int gotobol(int f, int n) @@ -316,36 +346,6 @@ int gotoeop(int f, int n) #endif /* - * This routine, given a pointer to a struct line, and the current cursor goal - * column, return the best choice for the offset. The offset is returned. - * Used by "C-N" and "C-P". - */ -int getgoal(struct line *dlp) -{ - int c; - int col; - int newcol; - int dbo; - - col = 0; - dbo = 0; - while (dbo != llength(dlp)) { - c = lgetc(dlp, dbo); - newcol = col; - if (c == '\t') - newcol |= tabmask; - else if (c < 0x20 || c == 0x7F) - ++newcol; - ++newcol; - if (newcol > curgoal) - break; - col = newcol; - ++dbo; - } - return (dbo); -} - -/* * Scroll forward by a specified number of lines, or by a full page if no * argument. Bound to "C-V". The "2" in the arithmetic on the window size is * the overlap; this value is the default overlap value in ITS EMACS. Because @@ -368,7 +368,7 @@ int forwpage(int f, int n) if (n <= 0) /* Forget the overlap. */ n = 1; /* If tiny window. */ } else if (n < 0) - return (backpage(f, -n)); + return backpage(f, -n); #if CVMVAS else /* Convert from pages. */ n *= curwp->w_ntrows; /* To lines. */ @@ -410,10 +410,10 @@ int backpage(int f, int n) if (n <= 0) /* Don't blow up if the. */ n = 1; /* Window is tiny. */ } else if (n < 0) - return (forwpage(f, -n)); + return forwpage(f, -n); #if CVMVAS - else /* Convert from pages */ - n *= curwp->w_ntrows; /* to lines. */ + else /* Convert from pages. */ + n *= curwp->w_ntrows; /* To lines. */ #endif lp = curwp->w_linep; while (n-- && lback(lp) != curbp->b_linep) @@ -1,16 +1,15 @@ -/* EFUNC.H +/* efunc.h * - * Function declarations and names + * Function declarations and names. * - * This file list all the C code functions used - * and the names to use to bind keys to them. To add functions, - * declare it here in both the extern function list and the name - * binding table. + * This file list all the C code functions used and the names to use + * to bind keys to them. To add functions, declare it here in both the + * extern function list and the name binding table. * * modified by Petri Kutvonen */ -/* External function declarations */ +/* External function declarations. */ /* word.c */ extern int wrapword(int f, int n); @@ -78,14 +77,13 @@ extern int forwline(int f, int n); extern int backline(int f, int n); extern int gotobop(int f, int n); extern int gotoeop(int f, int n); -extern int getgoal(struct line *dlp); extern int forwpage(int f, int n); extern int backpage(int f, int n); extern int setmark(int f, int n); extern int swapmark(int f, int n); /* random.c */ -extern int tabsize; /* Tab size (0: use real tabs) */; +extern int tabsize; /* Tab size (0: use real tabs). */ extern int setfillcol(int f, int n); extern int showcpos(int f, int n); extern int getcline(void); |