acme3k

Personal collection of acme patches
Log | Files | Refs | README

patch-acme3k (20540B)


      1 diff -u a/src/cmd/acme/acme.c b/src/cmd/acme/acme.c
      2 --- a/src/cmd/acme/acme.c	Sun Jan 12 22:18:48 2025
      3 +++ b/src/cmd/acme/acme.c	Sun Jan 12 22:18:57 2025
      4 @@ -11,6 +11,7 @@
      5  #include <libsec.h>
      6  #include "dat.h"
      7  #include "fns.h"
      8 +#include "config.h"
      9  	/* for generating syms in mkfile only: */
     10  	#include <bio.h>
     11  	#include "edit.h"
     12 @@ -297,7 +298,7 @@
     13  	nr = runestrlen(rb);
     14  	rs = cleanrname(runestr(rb, nr));
     15  	winsetname(w, rs.r, rs.nr);
     16 -	textload(&w->body, 0, s, 1);
     17 +	textload(&w->body, 0, s, 1, Hidedotfiles);
     18  	w->body.file->mod = FALSE;
     19  	w->dirty = FALSE;
     20  	winsettag(w);
     21 @@ -547,7 +548,7 @@
     22  		case MResize:
     23  			if(getwindow(display, Refnone) < 0)
     24  				error("attach to window");
     25 -			draw(screen, screen->r, display->white, nil, ZP);
     26 +			draw(screen, screen->r, framecols[BACK], nil, ZP);
     27  			iconinit();
     28  			scrlresize();
     29  			rowresize(&row, screen->clipr);
     30 @@ -1039,19 +1040,27 @@
     31  	Image *tmp;
     32  
     33  	if(tagcols[BACK] == nil) {
     34 -		/* Blue */
     35 -		tagcols[BACK] = allocimagemix(display, DPalebluegreen, DWhite);
     36 -		tagcols[HIGH] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DPalegreygreen);
     37 -		tagcols[BORD] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DPurpleblue);
     38 -		tagcols[TEXT] = display->black;
     39 -		tagcols[HTEXT] = display->black;
     40 +		tagcols[BACK] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, taghexcols[BACK]);
     41 +		tagcols[HIGH] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, taghexcols[HIGH]);
     42 +		tagcols[BORD] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, taghexcols[BORD]);
     43 +		tagcols[TEXT] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, taghexcols[TEXT]);
     44 +		tagcols[HTEXT] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, taghexcols[HTEXT]);
     45  
     46 -		/* Yellow */
     47 -		textcols[BACK] = allocimagemix(display, DPaleyellow, DWhite);
     48 -		textcols[HIGH] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DDarkyellow);
     49 -		textcols[BORD] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DYellowgreen);
     50 -		textcols[TEXT] = display->black;
     51 -		textcols[HTEXT] = display->black;
     52 +		textcols[BACK] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, texthexcols[BACK]);
     53 +		textcols[HIGH] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, texthexcols[HIGH]);
     54 +		textcols[BORD] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, texthexcols[BORD]);
     55 +		textcols[TEXT] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, texthexcols[TEXT]);
     56 +		textcols[HTEXT] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, texthexcols[HTEXT]);
     57 +
     58 +		framecols[BACK] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, framehexcols[BACK]);
     59 +		framecols[BORD] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, framehexcols[BORD]);
     60 +		framecols[TEXT] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, framehexcols[TEXT]);
     61 +
     62 +		button2cols[BACK] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, button2hexcols[BACK]);
     63 +		button2cols[TEXT] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, button2hexcols[TEXT]);
     64 +
     65 +		button3cols[BACK] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, button3hexcols[BACK]);
     66 +		button3cols[TEXT] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, button3hexcols[TEXT]);
     67  	}
     68  
     69  	r = Rect(0, 0, Scrollwid, font->height+1);
     70 @@ -1066,22 +1075,19 @@
     71  
     72  	button = allocimage(display, r, screen->chan, 0, DNofill);
     73  	draw(button, r, tagcols[BACK], nil, r.min);
     74 -	border(button, r, ButtonBorder, tagcols[BORD], ZP);
     75 +	border(button, r, ButtonBorder, framecols[TEXT], ZP);
     76  
     77  	r = button->r;
     78  	modbutton = allocimage(display, r, screen->chan, 0, DNofill);
     79  	draw(modbutton, r, tagcols[BACK], nil, r.min);
     80 -	border(modbutton, r, ButtonBorder, tagcols[BORD], ZP);
     81 +	border(modbutton, r, ButtonBorder, framecols[TEXT], ZP);
     82  	r = insetrect(r, ButtonBorder);
     83 -	tmp = allocimage(display, Rect(0,0,1,1), screen->chan, 1, DMedblue);
     84 +	tmp = allocimage(display, Rect(0,0,1,1), screen->chan, 1, framehexcols[HIGH]);
     85  	draw(modbutton, r, tmp, nil, ZP);
     86  	freeimage(tmp);
     87  
     88  	r = button->r;
     89 -	colbutton = allocimage(display, r, screen->chan, 0, DPurpleblue);
     90 -
     91 -	but2col = allocimage(display, r, screen->chan, 1, 0xAA0000FF);
     92 -	but3col = allocimage(display, r, screen->chan, 1, 0x006600FF);
     93 +	colbutton = allocimage(display, r, screen->chan, 0, framehexcols[HTEXT]);
     94  }
     95  
     96  /*
     97 diff -u a/src/cmd/acme/cols.c b/src/cmd/acme/cols.c
     98 --- a/src/cmd/acme/cols.c	Sun Jan 12 22:18:48 2025
     99 +++ b/src/cmd/acme/cols.c	Sun Jan 12 22:18:57 2025
    100 @@ -29,7 +29,7 @@
    101  	Rectangle r1;
    102  	Text *t;
    103  
    104 -	draw(screen, r, display->white, nil, ZP);
    105 +	draw(screen, r, framecols[BACK], nil, ZP);
    106  	c->r = r;
    107  	c->w = nil;
    108  	c->nw = 0;
    109 @@ -42,7 +42,7 @@
    110  	t->what = Columntag;
    111  	r1.min.y = r1.max.y;
    112  	r1.max.y += Border;
    113 -	draw(screen, r1, display->black, nil, ZP);
    114 +	draw(screen, r1, framecols[BORD], nil, ZP);
    115  	textinsert(t, 0, Lheader, 38, TRUE);
    116  	textsetselect(t, t->file->b.nc, t->file->b.nc);
    117  	draw(screen, t->scrollr, colbutton, nil, colbutton->r.min);
    118 @@ -117,7 +117,7 @@
    119  		r1.max.y = min(y, v->body.fr.r.min.y+v->body.fr.nlines*v->body.fr.font->height);
    120  		r1.min.y = winresize(v, r1, FALSE, FALSE);
    121  		r1.max.y = r1.min.y+Border;
    122 -		draw(screen, r1, display->black, nil, ZP);
    123 +		draw(screen, r1, framecols[BORD], nil, ZP);
    124  
    125  		/*
    126  		 * leave r with w's coordinates
    127 @@ -184,7 +184,7 @@
    128  	memmove(c->w+i, c->w+i+1, (c->nw-i)*sizeof(Window*));
    129  	c->w = realloc(c->w, c->nw*sizeof(Window*));
    130  	if(c->nw == 0){
    131 -		draw(screen, r, display->white, nil, ZP);
    132 +		draw(screen, r, framecols[BACK], nil, ZP);
    133  		return;
    134  	}
    135  	up = 0;
    136 @@ -246,7 +246,7 @@
    137  	draw(screen, c->tag.scrollr, colbutton, nil, colbutton->r.min);
    138  	r1.min.y = r1.max.y;
    139  	r1.max.y += Border;
    140 -	draw(screen, r1, display->black, nil, ZP);
    141 +	draw(screen, r1, framecols[BORD], nil, ZP);
    142  	r1.max.y = r.max.y;
    143  	new = Dy(r) - c->nw*(Border + font->height);
    144  	old = Dy(c->r) - c->nw*(Border + font->height);
    145 @@ -264,7 +264,7 @@
    146  		r1.max.y = max(r1.max.y, r1.min.y + Border+font->height);
    147  		r2 = r1;
    148  		r2.max.y = r2.min.y+Border;
    149 -		draw(screen, r2, display->black, nil, ZP);
    150 +		draw(screen, r2, framecols[BORD], nil, ZP);
    151  		r1.min.y = r2.max.y;
    152  		r1.min.y = winresize(w, r1, FALSE, i==c->nw-1);
    153  	}
    154 @@ -320,7 +320,7 @@
    155  			r.max.y = r.min.y+Dy(w->r)+Border;
    156  		r1 = r;
    157  		r1.max.y = r1.min.y+Border;
    158 -		draw(screen, r1, display->black, nil, ZP);
    159 +		draw(screen, r1, framecols[BORD], nil, ZP);
    160  		r.min.y = r1.max.y;
    161  		y = winresize(w, r, FALSE, i==c->nw-1);
    162  	}
    163 @@ -418,7 +418,7 @@
    164  			r.max.y += 1 + nl[j]*v->body.fr.font->height;
    165  		r.min.y = winresize(v, r, c->safe, FALSE);
    166  		r.max.y = r.min.y + Border;
    167 -		draw(screen, r, display->black, nil, ZP);
    168 +		draw(screen, r, framecols[BORD], nil, ZP);
    169  		y1 = r.max.y;
    170  	}
    171  	/* scan to see new size of everyone below */
    172 @@ -445,7 +445,7 @@
    173  	if(i < c->nw-1){
    174  		r.min.y = r.max.y;
    175  		r.max.y += Border;
    176 -		draw(screen, r, display->black, nil, ZP);
    177 +		draw(screen, r, framecols[BORD], nil, ZP);
    178  		for(j=i+1; j<c->nw; j++)
    179  			ny[j] -= (y2-r.max.y);
    180  	}
    181 @@ -462,7 +462,7 @@
    182  		if(j < c->nw-1){	/* no border on last window */
    183  			r.min.y = y1;
    184  			r.max.y += Border;
    185 -			draw(screen, r, display->black, nil, ZP);
    186 +			draw(screen, r, framecols[BORD], nil, ZP);
    187  			y1 = r.max.y;
    188  		}
    189  	}
    190 @@ -544,7 +544,7 @@
    191  	}
    192  	r.min.y = winresize(v, r, c->safe, FALSE);
    193  	r.max.y = r.min.y+Border;
    194 -	draw(screen, r, display->black, nil, ZP);
    195 +	draw(screen, r, framecols[BORD], nil, ZP);
    196  	r.min.y = r.max.y;
    197  	if(i == c->nw-1)
    198  		r.max.y = c->r.max.y;
    199 Only in b/src/cmd/acme: config.def.h
    200 Only in b/src/cmd/acme: config.h
    201 diff -u a/src/cmd/acme/dat.h b/src/cmd/acme/dat.h
    202 --- a/src/cmd/acme/dat.h	Sun Jan 12 22:18:48 2025
    203 +++ b/src/cmd/acme/dat.h	Sun Jan 12 22:18:57 2025
    204 @@ -213,7 +213,7 @@
    205  void		textframescroll(Text*, int);
    206  void		textinit(Text*, File*, Rectangle, Reffont*, Image**);
    207  void		textinsert(Text*, uint, Rune*, uint, int);
    208 -int		textload(Text*, uint, char*, int);
    209 +int		textload(Text*, uint, char*, int, int);
    210  Rune		textreadc(Text*, uint);
    211  void		textredraw(Text*, Rectangle, Font*, Image*, int);
    212  void		textreset(Text*);
    213 @@ -222,7 +222,7 @@
    214  void		textscroll(Text*, int);
    215  void		textselect(Text*);
    216  int		textselect2(Text*, uint*, uint*, Text**);
    217 -int		textselect23(Text*, uint*, uint*, Image*, int);
    218 +int		textselect23(Text*, uint*, uint*, Image*, Image*, int);
    219  int		textselect3(Text*, uint*, uint*);
    220  void		textsetorigin(Text*, uint, int);
    221  void		textsetselect(Text*, uint, uint);
    222 @@ -522,8 +522,6 @@
    223  Image		*modbutton;
    224  Image		*colbutton;
    225  Image		*button;
    226 -Image		*but2col;
    227 -Image		*but3col;
    228  Cursor		boxcursor;
    229  Cursor2		boxcursor2;
    230  Row			row;
    231 @@ -548,6 +546,9 @@
    232  char			*fontnames[2];
    233  Image		*tagcols[NCOL];
    234  Image		*textcols[NCOL];
    235 +Image		*framecols[NCOL];
    236 +Image		*button2cols[NCOL];
    237 +Image		*button3cols[NCOL];
    238  extern char		wdir[]; /* must use extern because no dimension given */
    239  int			editing;
    240  int			erroutfd;
    241 diff -u a/src/cmd/acme/exec.c b/src/cmd/acme/exec.c
    242 --- a/src/cmd/acme/exec.c	Sun Jan 12 22:18:48 2025
    243 +++ b/src/cmd/acme/exec.c	Sun Jan 12 22:18:57 2025
    244 @@ -13,6 +13,7 @@
    245  #include <9pclient.h>
    246  #include "dat.h"
    247  #include "fns.h"
    248 +#include "config.h"
    249  
    250  Buffer	snarfbuf;
    251  
    252 @@ -52,6 +53,7 @@
    253  void	put(Text*, Text*, Text*, int, int, Rune*, int);
    254  void	putall(Text*, Text*, Text*, int, int, Rune*, int);
    255  void	sendx(Text*, Text*, Text*, int, int, Rune*, int);
    256 +void dotshow(Text*, Text*, Text*, int, int, Rune*, int);
    257  void	sort(Text*, Text*, Text*, int, int, Rune*, int);
    258  void	tab(Text*, Text*, Text*, int, int, Rune*, int);
    259  void	zeroxx(Text*, Text*, Text*, int, int, Rune*, int);
    260 @@ -76,6 +78,7 @@
    261  static Rune LExit[] = { 'E', 'x', 'i', 't', 0 };
    262  static Rune LFont[] = { 'F', 'o', 'n', 't', 0 };
    263  static Rune LGet[] = { 'G', 'e', 't', 0 };
    264 +static Rune LHide[] = { 'H', 'i', 'd', 'e', 0 };
    265  static Rune LID[] = { 'I', 'D', 0 };
    266  static Rune LIncl[] = { 'I', 'n', 'c', 'l', 0 };
    267  static Rune LIndent[] = { 'I', 'n', 'd', 'e', 'n', 't', 0 };
    268 @@ -90,6 +93,7 @@
    269  static Rune LPutall[] = { 'P', 'u', 't', 'a', 'l', 'l', 0 };
    270  static Rune LRedo[] = { 'R', 'e', 'd', 'o', 0 };
    271  static Rune LSend[] = { 'S', 'e', 'n', 'd', 0 };
    272 +static Rune LShow[] = { 'S', 'h', 'o', 'w', 0 };
    273  static Rune LSnarf[] = { 'S', 'n', 'a', 'r', 'f', 0 };
    274  static Rune LSort[] = { 'S', 'o', 'r', 't', 0 };
    275  static Rune LTab[] = { 'T', 'a', 'b', 0 };
    276 @@ -106,7 +110,8 @@
    277  	{ LEdit,		edit,		FALSE,	XXX,		XXX		},
    278  	{ LExit,		xexit,	FALSE,	XXX,		XXX		},
    279  	{ LFont,		fontx,	FALSE,	XXX,		XXX		},
    280 -	{ LGet,		get,		FALSE,	TRUE,	XXX		},
    281 +	{ LGet,		get,		FALSE,	TRUE,	Hidedotfiles	},
    282 +	{ LHide,		dotshow,	FALSE,	TRUE,	TRUE	},
    283  	{ LID,		id,		FALSE,	XXX,		XXX		},
    284  	{ LIncl,		incl,		FALSE,	XXX,		XXX		},
    285  	{ LIndent,		indent,	FALSE,	XXX,		XXX		},
    286 @@ -121,6 +126,7 @@
    287  	{ LPutall,		putall,	FALSE,	XXX,		XXX		},
    288  	{ LRedo,		undo,	FALSE,	FALSE,	XXX		},
    289  	{ LSend,		sendx,	TRUE,	XXX,		XXX		},
    290 +	{ LShow,		dotshow,	FALSE,	TRUE,	FALSE	},
    291  	{ LSnarf,		cut,		FALSE,	TRUE,	FALSE	},
    292  	{ LSort,		sort,		FALSE,	XXX,		XXX		},
    293  	{ LTab,		tab,		FALSE,	XXX,		XXX		},
    294 @@ -585,7 +591,7 @@
    295  };
    296  
    297  void
    298 -get(Text *et, Text *t, Text *argt, int flag1, int _0, Rune *arg, int narg)
    299 +get(Text *et, Text *t, Text *argt, int flag1, int flag2, Rune *arg, int narg)
    300  {
    301  	char *name;
    302  	Rune *r;
    303 @@ -596,8 +602,6 @@
    304  	Dir *d;
    305  	long q0, q1;
    306  
    307 -	USED(_0);
    308 -
    309  	if(flag1)
    310  		if(et==nil || et->w==nil)
    311  			return;
    312 @@ -616,6 +620,7 @@
    313  		free(d);
    314  		if(isdir){
    315  			warning(nil, "%s is a directory; can't read with multiple windows on it\n", name);
    316 +			free(name);
    317  			return;
    318  		}
    319  	}
    320 @@ -635,7 +640,7 @@
    321  		windirfree(u->w);
    322  	}
    323  	samename = runeeq(r, n, t->file->name, t->file->nname);
    324 -	textload(t, 0, name, samename);
    325 +	textload(t, 0, name, samename, flag2);
    326  	if(samename){
    327  		t->file->mod = FALSE;
    328  		dirty = FALSE;
    329 @@ -1804,4 +1809,35 @@
    330  	arg[0] = c;
    331  	arg[1] = cpid;
    332  	threadcreate(runwaittask, arg, STACK);
    333 +}
    334 +
    335 +void
    336 +dotshow(Text *et, Text *t, Text *argt, int flag1, int flag2, Rune *arg, int narg) 
    337 +{
    338 +	Dir *d;
    339 +	int isdir;
    340 +	char *name;
    341 +	Window *w;
    342 +
    343 +	if(flag1)
    344 +		if(et==nil || et->w==nil)
    345 +			return;
    346 +	w = et->w;
    347 +	t = &w->body;
    348 +	name = getname(t, argt, arg, narg, FALSE);
    349 +	if (name==nil) {
    350 +		warning(nil, "no file name\n");
    351 +		return;
    352 +	}
    353 +	d = dirstat(name);
    354 +	isdir = (d!=nil && (d->qid.type & QTDIR));
    355 +	free(d);
    356 +	if (!isdir) {
    357 +		warning(nil, "%s is not a directory\n", name);
    358 +		free(name);
    359 +		return;
    360 +	}
    361 +
    362 +	get(et, t, argt, flag1, flag2, arg, narg);
    363 +	free(name);
    364  }
    365 diff -u a/src/cmd/acme/look.c b/src/cmd/acme/look.c
    366 --- a/src/cmd/acme/look.c	Sun Jan 12 22:18:48 2025
    367 +++ b/src/cmd/acme/look.c	Sun Jan 12 22:18:57 2025
    368 @@ -13,6 +13,7 @@
    369  #include <libsec.h>
    370  #include "dat.h"
    371  #include "fns.h"
    372 +#include "config.h"
    373  
    374  CFid *plumbsendfid;
    375  CFid *plumbeditfid;
    376 @@ -784,7 +785,7 @@
    377  		w = makenewwindow(t);
    378  		t = &w->body;
    379  		winsetname(w, e->name, e->nname);
    380 -		if(textload(t, 0, e->bname, 1) >= 0)
    381 +		if(textload(t, 0, e->bname, 1, Hidedotfiles) >= 0)
    382  			t->file->unread = FALSE;
    383  		t->file->mod = FALSE;
    384  		t->w->dirty = FALSE;
    385 Common subdirectories: a/src/cmd/acme/mail and b/src/cmd/acme/mail
    386 diff -u a/src/cmd/acme/rows.c b/src/cmd/acme/rows.c
    387 --- a/src/cmd/acme/rows.c	Sun Jan 12 22:18:49 2025
    388 +++ b/src/cmd/acme/rows.c	Sun Jan 12 22:18:57 2025
    389 @@ -12,6 +12,7 @@
    390  #include <libsec.h>
    391  #include "dat.h"
    392  #include "fns.h"
    393 +#include "config.h"
    394  
    395  static Rune Lcolhdr[] = {
    396  	'N', 'e', 'w', 'c', 'o', 'l', ' ',
    397 @@ -28,7 +29,7 @@
    398  	Rectangle r1;
    399  	Text *t;
    400  
    401 -	draw(screen, r, display->white, nil, ZP);
    402 +	draw(screen, r, framecols[BACK], nil, ZP);
    403  	row->r = r;
    404  	row->col = nil;
    405  	row->ncol = 0;
    406 @@ -42,7 +43,7 @@
    407  	t->col = nil;
    408  	r1.min.y = r1.max.y;
    409  	r1.max.y += Border;
    410 -	draw(screen, r1, display->black, nil, ZP);
    411 +	draw(screen, r1, framecols[BORD], nil, ZP);
    412  	textinsert(t, 0, Lcolhdr, 29, TRUE);
    413  	textsetselect(t, t->file->b.nc, t->file->b.nc);
    414  }
    415 @@ -73,7 +74,7 @@
    416  		r = d->r;
    417  		if(Dx(r) < 100)
    418  			return nil;
    419 -		draw(screen, r, display->white, nil, ZP);
    420 +		draw(screen, r, framecols[BACK], nil, ZP);
    421  		r1 = r;
    422  		r1.max.x = min(x-Border, r.max.x-50);
    423  		if(Dx(r1) < 50)
    424 @@ -81,7 +82,7 @@
    425  		colresize(d, r1);
    426  		r1.min.x = r1.max.x;
    427  		r1.max.x = r1.min.x+Border;
    428 -		draw(screen, r1, display->black, nil, ZP);
    429 +		draw(screen, r1, framecols[BORD], nil, ZP);
    430  		r.min.x = r1.max.x;
    431  	}
    432  	if(c == nil){
    433 @@ -115,7 +116,7 @@
    434  	textresize(&row->tag, r1, TRUE);
    435  	r1.min.y = r1.max.y;
    436  	r1.max.y += Border;
    437 -	draw(screen, r1, display->black, nil, ZP);
    438 +	draw(screen, r1, framecols[BORD], nil, ZP);
    439  	r.min.y = r1.max.y;
    440  	r1 = r;
    441  	r1.max.x = r1.min.x;
    442 @@ -130,7 +131,7 @@
    443  		if(i > 0){
    444  			r2 = r1;
    445  			r2.max.x = r2.min.x+Border;
    446 -			draw(screen, r2, display->black, nil, ZP);
    447 +			draw(screen, r2, framecols[BORD], nil, ZP);
    448  			r1.min.x = r2.max.x;
    449  		}
    450  		colresize(c, r1);
    451 @@ -191,14 +192,14 @@
    452  		p.x = c->r.max.x-80-Scrollwid;
    453  	r = d->r;
    454  	r.max.x = c->r.max.x;
    455 -	draw(screen, r, display->white, nil, ZP);
    456 +	draw(screen, r, framecols[BACK], nil, ZP);
    457  	r.max.x = p.x;
    458  	colresize(d, r);
    459  	r = c->r;
    460  	r.min.x = p.x;
    461  	r.max.x = r.min.x;
    462  	r.max.x += Border;
    463 -	draw(screen, r, display->black, nil, ZP);
    464 +	draw(screen, r, framecols[BORD], nil, ZP);
    465  	r.min.x = r.max.x;
    466  	r.max.x = c->r.max.x;
    467  	colresize(c, r);
    468 @@ -223,7 +224,7 @@
    469  	memmove(row->col+i, row->col+i+1, (row->ncol-i)*sizeof(Column*));
    470  	row->col = realloc(row->col, row->ncol*sizeof(Column*));
    471  	if(row->ncol == 0){
    472 -		draw(screen, r, display->white, nil, ZP);
    473 +		draw(screen, r, framecols[BACK], nil, ZP);
    474  		return;
    475  	}
    476  	if(i == row->ncol){		/* extend last column right */
    477 @@ -234,7 +235,7 @@
    478  		c = row->col[i];
    479  		r.max.x = c->r.max.x;
    480  	}
    481 -	draw(screen, r, display->white, nil, ZP);
    482 +	draw(screen, r, framecols[BACK], nil, ZP);
    483  	colresize(c, r);
    484  }
    485  
    486 @@ -601,12 +602,12 @@
    487  			r2.min.x = x;
    488  			if(Dx(r1) < 50 || Dx(r2) < 50)
    489  				continue;
    490 -			draw(screen, Rpt(r1.min, r2.max), display->white, nil, ZP);
    491 +			draw(screen, Rpt(r1.min, r2.max), framecols[BACK], nil, ZP);
    492  			colresize(c1, r1);
    493  			colresize(c2, r2);
    494  			r2.min.x = x-Border;
    495  			r2.max.x = x;
    496 -			draw(screen, r2, display->black, nil, ZP);
    497 +			draw(screen, r2, framecols[BORD], nil, ZP);
    498  		}
    499  		if(i >= row->ncol)
    500  			rowadd(row, nil, x);
    501 @@ -782,7 +783,7 @@
    502  			}
    503  			Bterm(bout);
    504  			free(bout);
    505 -			textload(&w->body, 0, buf, 1);
    506 +			textload(&w->body, 0, buf, 1, Hidedotfiles);
    507  			remove(buf);
    508  			close(fd);
    509  			w->body.file->mod = TRUE;
    510 diff -u a/src/cmd/acme/text.c b/src/cmd/acme/text.c
    511 --- a/src/cmd/acme/text.c	Sun Jan 12 22:18:49 2025
    512 +++ b/src/cmd/acme/text.c	Sun Jan 12 22:18:57 2025
    513 @@ -12,6 +12,7 @@
    514  #include <complete.h>
    515  #include "dat.h"
    516  #include "fns.h"
    517 +#include "config.h"
    518  
    519  Image	*tagcols[NCOL];
    520  Image	*textcols[NCOL];
    521 @@ -190,7 +191,7 @@
    522  }
    523  
    524  int
    525 -textload(Text *t, uint q0, char *file, int setqid)
    526 +textload(Text *t, uint q0, char *file, int setqid, int hidedotfiles)
    527  {
    528  	Rune *rp;
    529  	Dirlist *dl, **dlp;
    530 @@ -243,6 +244,8 @@
    531  		dbuf = nil;
    532  		while((n=dirread(fd, &dbuf)) > 0){
    533  			for(i=0; i<n; i++){
    534 +				if (hidedotfiles==TRUE && dbuf[i].name[0]=='.')
    535 +					continue;
    536  				dl = emalloc(sizeof(Dirlist));
    537  				j = strlen(dbuf[i].name);
    538  				tmp = emalloc(j+1+1);
    539 @@ -667,7 +670,7 @@
    540  void
    541  texttype(Text *t, Rune r)
    542  {
    543 -	uint q0, q1;
    544 +	uint q0, q1, qd;
    545  	int nnb, nb, n, i;
    546  	int nr;
    547  	Rune *rp;
    548 @@ -694,8 +697,21 @@
    549  	case Kdown:
    550  		if(t->what == Tag)
    551  			goto Tagdown;
    552 -		n = t->fr.maxlines/3;
    553 -		goto case_Down;
    554 +		typecommit(t);
    555 +
    556 +		nb = n = 0;
    557 +		if ((nb = textbswidth(t, 0x15)) == 1) /* beginning of line */
    558 +			nb = 0;
    559 +		for (q0 = t->q0; q0 < t->file->b.nc && textreadc(t, q0) != '\n'; q0++)
    560 +			;
    561 +		while (++q0 < t->file->b.nc && textreadc(t, q0) != '\n')
    562 +			if (n++ == nb)
    563 +				break;
    564 +		q0 = q0 > t->file->b.nc ? t->file->b.nc : q0;
    565 +
    566 +		textshow(t, q0, q0, TRUE);
    567 +		return;
    568 +
    569  	case Kscrollonedown:
    570  		if(t->what == Tag)
    571  			goto Tagdown;
    572 @@ -712,8 +728,18 @@
    573  	case Kup:
    574  		if(t->what == Tag)
    575  			goto Tagup;
    576 -		n = t->fr.maxlines/3;
    577 -		goto case_Up;
    578 +		typecommit(t);
    579 +
    580 +		nb = nnb = 0;
    581 +		for (q0 = t->q0; q0 > 0 && textreadc(t, q0-1) != '\n'; q0--)
    582 +			nb++;
    583 +		if (q0 > 0)
    584 +			for (--q0; q0 > 0 && textreadc(t, q0-1) != '\n'; q0--)
    585 +				nnb++;
    586 +		nb = nb > nnb ? nnb : nb;
    587 +		textshow(t, q0 + nb, q0 + nb, TRUE);
    588 +
    589 +		return;
    590  	case Kscrolloneup:
    591  		if(t->what == Tag)
    592  			goto Tagup;
    593 @@ -840,6 +866,12 @@
    594  			else
    595  				textsetselect(t, t->q0, t->eq0);
    596  		}
    597 +
    598 +		qd = 0;
    599 +		if (t->eq0 <= t->iq1)
    600 +			qd = (int) (t->iq1 - t->eq0) / 2;
    601 +		moveto(mousectl, addpt(frptofchar(&t->fr, t->fr.p0 + qd), Pt(4, t->fr.font->height-4)));
    602 +
    603  		if(t->ncache > 0)
    604  			typecommit(t);
    605  		t->iq1 = t->q0;
    606 @@ -1258,7 +1290,7 @@
    607  };
    608  
    609  uint
    610 -xselect(Frame *f, Mousectl *mc, Image *col, uint *p1p)	/* when called, button is down */
    611 +xselect(Frame *f, Mousectl *mc, Image *bgcol, Image *fgcol, uint *p1p)	/* when called, button is down */
    612  {
    613  	uint p0, p1, q, tmp;
    614  	ulong msec;
    615 @@ -1291,12 +1323,12 @@
    616  				pt1 = pt0;
    617  				reg = region(q, p0);
    618  				if(reg == 0)
    619 -					frdrawsel0(f, pt0, p0, p1, col, display->white);
    620 +					frdrawsel0(f, pt0, p0, p1, bgcol, fgcol);
    621  			}
    622  			qt = frptofchar(f, q);
    623  			if(reg > 0){
    624  				if(q > p1)
    625 -					frdrawsel0(f, pt1, p1, q, col, display->white);
    626 +					frdrawsel0(f, pt1, p1, q, bgcol, fgcol);
    627  
    628  				else if(q < p1)
    629  					selrestore(f, qt, q, p1);
    630 @@ -1304,7 +1336,7 @@
    631  				if(q > p1)
    632  					selrestore(f, pt1, p1, q);
    633  				else
    634 -					frdrawsel0(f, qt, q, p1, col, display->white);
    635 +					frdrawsel0(f, qt, q, p1, bgcol, fgcol);
    636  			}
    637  			p1 = q;
    638  			pt1 = qt;
    639 @@ -1341,12 +1373,12 @@
    640  }
    641  
    642  int
    643 -textselect23(Text *t, uint *q0, uint *q1, Image *high, int mask)
    644 +textselect23(Text *t, uint *q0, uint *q1, Image *bgcol, Image *fgcol, int mask)
    645  {
    646  	uint p0, p1;
    647  	int buts;
    648  
    649 -	p0 = xselect(&t->fr, mousectl, high, &p1);
    650 +	p0 = xselect(&t->fr, mousectl, bgcol, fgcol, &p1);
    651  	buts = mousectl->m.buttons;
    652  	if((buts & mask) == 0){
    653  		*q0 = p0+t->org;
    654 @@ -1364,7 +1396,7 @@
    655  	int buts;
    656  
    657  	*tp = nil;
    658 -	buts = textselect23(t, q0, q1, but2col, 4);
    659 +	buts = textselect23(t, q0, q1, button2cols[BACK], button2cols[TEXT], 4);
    660  	if(buts & 4)
    661  		return 0;
    662  	if(buts & 1){	/* pick up argument */
    663 @@ -1379,7 +1411,7 @@
    664  {
    665  	int h;
    666  
    667 -	h = (textselect23(t, q0, q1, but3col, 1|2) == 0);
    668 +	h = (textselect23(t, q0, q1, button3cols[BACK], button3cols[TEXT], 1|2) == 0);
    669  	return h;
    670  }
    671  
    672 Only in b/src/cmd/acme: tfile
    673 diff -u a/src/cmd/acme/wind.c b/src/cmd/acme/wind.c
    674 --- a/src/cmd/acme/wind.c	Sun Jan 12 22:18:49 2025
    675 +++ b/src/cmd/acme/wind.c	Sun Jan 12 22:18:57 2025
    676 @@ -235,7 +235,6 @@
    677  			r1.min.y = min(y, r.max.y);
    678  			r1.max.y = r.max.y;
    679  		}else{
    680 -			draw(screen, r1, textcols[BACK], nil, ZP);
    681  			r1.min.y = y;
    682  			r1.max.y = y;
    683  		}