aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-10-02 16:07:57 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-02 16:07:57 -0700
commit34faa14e34c3eb2dfe3fd2cad02826f12f00ec5b (patch)
tree33e10f6aea81f131c4a225ebb7b14bf552806a9d
parentd861ad1bd06f20f505c99314c8d9004d13cb6625 (diff)
downloaduemacs-34faa14e34c3eb2dfe3fd2cad02826f12f00ec5b.tar.gz
Try updated rule for "is new paragraph"
This makes non-alphabetic characters at the beginning be a mark of a paragraph. That's probably bogus, but let's try how it works. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--basic.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/basic.c b/basic.c
index 3c9befa..010288c 100644
--- a/basic.c
+++ b/basic.c
@@ -272,20 +272,24 @@ int backline(int f, int n)
#if WORDPRO
static int is_new_para(void)
{
- int c;
+ int i, len;
- /* Empty line? Always a new paragraph */
- if (!llength(curwp->w_dotp))
- return 1;
+ len = llength(curwp->w_dotp);
+ for (i = 0; i < len; i++) {
+ int c = lgetc(curwp->w_dotp, i);
+ if (c == ' ' || c == TAB) {
#if PKCODE
- /* "Justification" only stops at empty lines */
- if (justflag == TRUE)
- return 0;
+ if (justflag)
+ continue;
#endif
-
- c = lgetc(curwp->w_dotp, curwp->w_doto);
- return c == TAB || c == ' ';
+ return 1;
+ }
+ if (!isletter(c))
+ return 1;
+ return 0;
+ }
+ return 1;
}
/*