[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemacs-commit] qemacs TODO.org hex.c mpeg.c qe.c qe.h unihex.c
From: |
Charlie Gordon |
Subject: |
[Qemacs-commit] qemacs TODO.org hex.c mpeg.c qe.c qe.h unihex.c |
Date: |
Fri, 23 Dec 2016 10:51:51 -0500 (EST) |
CVSROOT: /sources/qemacs
Module name: qemacs
Changes by: Charlie Gordon <chqrlie> 16/12/23 10:51:51
Modified files:
. : TODO.org hex.c mpeg.c qe.c qe.h unihex.c
Log message:
display: small improvements
- rename method dispatcher `text_display` as `display_line`
rename corresponding mode based handlers as `xxx_display_name`
- rename method dispatcher `text_backward_offset` as `backward_offset`
- add default text handlers for `move_bof` and `move_eof` in
hex, binary and unihex modes
- handle utf-8 in window prompt (ex: default buffer name for C-x b)
- add various TODOs
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/TODO.org?cvsroot=qemacs&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/qemacs/hex.c?cvsroot=qemacs&r1=1.47&r2=1.48
http://cvs.savannah.gnu.org/viewcvs/qemacs/mpeg.c?cvsroot=qemacs&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.c?cvsroot=qemacs&r1=1.232&r2=1.233
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.h?cvsroot=qemacs&r1=1.225&r2=1.226
http://cvs.savannah.gnu.org/viewcvs/qemacs/unihex.c?cvsroot=qemacs&r1=1.32&r2=1.33
Patches:
Index: TODO.org
===================================================================
RCS file: /sources/qemacs/qemacs/TODO.org,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- TODO.org 26 Nov 2016 11:10:12 -0000 1.16
+++ TODO.org 23 Dec 2016 15:51:51 -0000 1.17
@@ -1,24 +1,39 @@
; TODO list for qemacs
;
; Author: Charles Gordon
-; Updated: 2016-07-29
+; Updated: 2016-12-23
* Needed for release version 5
* Priority 0
-** markdown: a_bb_c should not detect bb as underlined
** basic: reset last command when executing macro
-** clang: indentation bug on {\nputchar(expr ? 'a' : 'b');\n}
** completion: fix electric behavior
-** files: track file modifications and reload upon change
** files: check file date to detect asynchronous modifications on disk
+** files: reload modified file upon change if untouched since load
+** layout: kill buffer should delete popup and popleft window
** shell: turn on interactive mode on commands that move the cursor to EOB
** shell: asynchronous input buffer
** shell: give commands a chance to execute for macros to behave correctly
+** shell: A-y at process prompt
+** shell: fix very long lines in shell buffer
+** undo: saving the file kills the redo stack!
* Priority 1
+** API: use style cache in DisplayState
+** API: remove implicit e->default_style references
+** API: remove screen argument in release_font
+** API: remove screen argument in glyph_width
+** API: add create-style(name, properties)
+** API: pass EditState to get_line_height(screen, s, style)
+** API: add get_glyph_width(screen, s, style, c)
+
+** php: improve coloring
+** basic: A-m in dired left window should apply to right pane
+** basic: goto-byte 10%, 10k, 10m...
+** clang: indentation bug on {\nputchar(expr ? 'a' : 'b');\n}
+** markdown: a_bb_c should not detect bb as underlined
** basic: improve speed: C-x C-f ~/x2m RET A-r 20140101 RET 20140101 RET -> 96s
** basic: improve speed: C-x C-f ~/x2m RET C-u 1000 C-n -> 4s
** basic: check abort during long operations: bufferize input and check for ^G
@@ -28,7 +43,7 @@
** basic: fix default wrap setting mess
** basic: fix fuzzy completion when single unanchored match
** basic: make styles and log buffers read-only and display as binary
-** basic: optional 64 bit offsets on 64 bit systems
+** basic: optional 64-bit offsets on 64-bit systems, use typedef for buffer
offsets
** basic: use rune and u8 types
** basic: auto/mixed eol mode
** basic: fix behaviour on overlong lines
@@ -69,11 +84,13 @@
** search: hex-mode search strings should mix hex ut8 strings and ASCII
control char names
** search: delete-matching-lines
** search: make isearch bindings for minibuffer
+** search: query replace word/case/hex toggles
** session: register session store functions
** session: save previous answers, ...
** session: save preview mode, buffer modes and properties
** session: save process buffers? non file-based buffers? dired buffers?
** shell: handle long shell lines
+** shell: fix screen size notifications, SIGWINCH signals and ioctl
** shell: fix crash bug when invoking qemacs recursively in the terminal
** shell: set current directory of new shell buffer to that of current window
** shell: use auxiliary buffer to make process input asynchronous
@@ -87,6 +104,7 @@
cp="200E" na="LEFT-TO-RIGHT MARK" alias="LRM"
cp="200F" na="RIGHT-TO-LEFT MARK" alias="RLM"
** tiny: remove extra features
+** undo: store cursor movements in undo records
** undo: kill redo list when forking after undo
** undo: undo should handle sequence of undo records upto tagged start.
** undo: add disable-undo for tests and benchmarking
@@ -106,8 +124,8 @@
** charset: handle euc-kr
** charset: autodetect sjis, euc-jp...
** clang: align multi line comments leading * one space to the right
-** clang: fix c indentation inside comments
-** clang: fix c indentation inside struct, array and enum initializers
+** clang: fix C indentation inside comments
+** clang: fix C indentation inside struct, array and enum initializers
** dired: keep dired current file upon: RET C-x C-k RET
** dired: fork for directory scan, background inode tracking, dir size scan
** extra: add function to add entry in TODO.org
Index: hex.c
===================================================================
RCS file: /sources/qemacs/qemacs/hex.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -b -r1.47 -r1.48
--- hex.c 9 Jun 2016 16:24:10 -0000 1.47
+++ hex.c 23 Dec 2016 15:51:51 -0000 1.48
@@ -44,7 +44,7 @@
return align(offset, s->dump_width);
}
-static int hex_display(EditState *s, DisplayState *ds, int offset)
+static int hex_display_line(EditState *s, DisplayState *ds, int offset)
{
int j, len, ateof;
int offset1, offset2;
@@ -118,7 +118,7 @@
{
if (w >= 1) {
s->dump_width = w;
- s->offset_top = s->mode->text_backward_offset(s, s->offset_top);
+ s->offset_top = s->mode->backward_offset(s, s->offset_top);
}
}
@@ -332,12 +332,14 @@
.name = "binary",
.mode_probe = binary_mode_probe,
.mode_init = binary_mode_init,
- .text_display = hex_display,
- .text_backward_offset = hex_backward_offset,
+ .display_line = hex_display_line,
+ .backward_offset = hex_backward_offset,
.move_up_down = hex_move_up_down,
.move_left_right = hex_move_left_right,
.move_bol = hex_move_bol,
.move_eol = hex_move_eol,
+ .move_bof = text_move_bof,
+ .move_eof = text_move_eof,
.scroll_up_down = text_scroll_up_down,
.mouse_goto = text_mouse_goto,
.write_char = text_write_char,
@@ -348,12 +350,14 @@
.name = "hex",
.mode_probe = hex_mode_probe,
.mode_init = hex_mode_init,
- .text_display = hex_display,
- .text_backward_offset = hex_backward_offset,
+ .display_line = hex_display_line,
+ .backward_offset = hex_backward_offset,
.move_up_down = hex_move_up_down,
.move_left_right = hex_move_left_right,
.move_bol = hex_move_bol,
.move_eol = hex_move_eol,
+ .move_bof = text_move_bof,
+ .move_eof = text_move_eof,
.scroll_up_down = text_scroll_up_down,
.mouse_goto = text_mouse_goto,
.write_char = hex_write_char,
Index: mpeg.c
===================================================================
RCS file: /sources/qemacs/qemacs/mpeg.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- mpeg.c 1 Jun 2014 13:54:59 -0000 1.10
+++ mpeg.c 23 Dec 2016 15:51:51 -0000 1.11
@@ -33,7 +33,7 @@
#define SYSTEM_HEADER_START_CODE 0x000001bb
#define ISO_11172_END_CODE 0x000001b9
-static int mpeg_display(EditState *s, DisplayState *ds, int offset)
+static int mpeg_display_line(EditState *s, DisplayState *ds, int offset)
{
unsigned int startcode;
int ret, badchars, offset_start;
@@ -164,8 +164,8 @@
.name = "mpeg",
.mode_probe = mpeg_mode_probe,
.mode_init = mpeg_mode_init,
- .text_display = mpeg_display,
- .text_backward_offset = mpeg_backward_offset,
+ .display_line = mpeg_display_line,
+ .backward_offset = mpeg_backward_offset,
.write_char = hex_write_char,
};
Index: qe.c
===================================================================
RCS file: /sources/qemacs/qemacs/qe.c,v
retrieving revision 1.232
retrieving revision 1.233
diff -u -b -r1.232 -r1.233
--- qe.c 23 Dec 2016 13:00:55 -0000 1.232
+++ qe.c 23 Dec 2016 15:51:51 -0000 1.233
@@ -135,10 +135,10 @@
m->mode_probe = generic_mode_probe;
/* default to text handling */
- if (!m->text_display)
- m->text_display = text_display;
- if (!m->text_backward_offset)
- m->text_backward_offset = text_backward_offset;
+ if (!m->display_line)
+ m->display_line = text_display_line;
+ if (!m->backward_offset)
+ m->backward_offset = text_backward_offset;
if (!m->move_up_down)
m->move_up_down = text_move_up_down;
if (!m->move_left_right)
@@ -1020,7 +1020,7 @@
if (offset_top <= 0)
return;
eb_prevc(s->b, offset_top, &offset_top);
- s->offset_top = s->mode->text_backward_offset(s, offset_top);
+ s->offset_top = s->mode->backward_offset(s, offset_top);
/* adjust y_disp so that the cursor is at the same position */
s->y_disp += cm.yc;
@@ -1152,9 +1152,9 @@
s->y_disp = 0;
} else {
eb_prevc(s->b, offset_top, &offset_top);
- s->offset_top = s->mode->text_backward_offset(s, offset_top);
+ s->offset_top = s->mode->backward_offset(s, offset_top);
ds->y = 0;
- s->mode->text_display(s, ds, s->offset_top);
+ s->mode->display_line(s, ds, s->offset_top);
s->y_disp -= ds->y;
}
} while (s->y_disp > 0);
@@ -1199,7 +1199,7 @@
CursorContext cm;
/* only apply to text modes */
- if (!s->mode->text_display)
+ if (!s->mode->display_line)
return;
if (s->offset < s->offset_top
@@ -1211,7 +1211,7 @@
*/
int offset_top = s->offset;
eb_prevc(s->b, offset_top, &offset_top);
- s->offset_top = s->mode->text_backward_offset(s, offset_top);
+ s->offset_top = s->mode->backward_offset(s, offset_top);
} else {
if (!force)
return;
@@ -1311,7 +1311,7 @@
if (offset_top <= 0)
break;
eb_prevc(s->b, offset_top, &offset_top);
- s->offset_top = s->mode->text_backward_offset(s,
offset_top);
+ s->offset_top = s->mode->backward_offset(s, offset_top);
/* adjust y_disp so that the cursor is at the same
position */
s->y_disp += cm.yc;
get_cursor_pos(s, &cm);
@@ -2166,8 +2166,8 @@
if (m->colorize_func)
set_colorize_func(s, m->colorize_func);
/* modify offset_top so that its value is correct */
- if (s->mode->text_backward_offset)
- s->offset_top = s->mode->text_backward_offset(s, s->offset_top);
+ if (s->mode->backward_offset)
+ s->offset_top = s->mode->backward_offset(s, s->offset_top);
/* keep saved data in sync with last mode used for buffer */
generic_save_window_data(s);
}
@@ -3557,7 +3557,7 @@
s->eod = 0;
offset = e->offset_top;
for (;;) {
- offset = e->mode->text_display(e, s, offset);
+ offset = e->mode->display_line(e, s, offset);
e->offset_bottom = offset;
/* EOF reached ? */
if (offset < 0)
@@ -3844,7 +3844,8 @@
#define RLE_EMBEDDINGS_SIZE 128
-int text_display(EditState *s, DisplayState *ds, int offset)
+/* Display one line in the window */
+int text_display_line(EditState *s, DisplayState *ds, int offset)
{
int c;
int offset0, offset1, line_num, col_num;
@@ -3897,7 +3898,7 @@
const char *p = s->prompt;
while (*p) {
- display_char(ds, -1, -1, *p++);
+ display_char(ds, -1, -1, utf8_decode(&p));
}
}
@@ -4005,7 +4006,7 @@
/* if the cursor is before the top of the display zone, we must
resync backward */
if (s->offset < s->offset_top) {
- s->offset_top = s->mode->text_backward_offset(s, s->offset);
+ s->offset_top = s->mode->backward_offset(s, s->offset);
}
if (s->display_invalid) {
@@ -4029,7 +4030,7 @@
s->offset_top = offset;
s->y_disp = ds->y;
}
- offset = s->mode->text_display(s, ds, offset);
+ offset = s->mode->display_line(s, ds, offset);
s->offset_bottom = offset;
if (offset < 0 || ds->y >= s->height || m->xc != NO_CURSOR)
break;
@@ -4042,8 +4043,8 @@
ds->cursor_opaque = m;
ds->cursor_func = cursor_func;
ds->y = 0;
- offset = s->mode->text_backward_offset(s, s->offset);
- bottom = s->mode->text_display(s, ds, offset);
+ offset = s->mode->backward_offset(s, s->offset);
+ bottom = s->mode->display_line(s, ds, offset);
if (m->xc == NO_CURSOR) {
/* XXX: should not happen */
put_error(NULL, "ERROR: cursor not found");
@@ -4054,8 +4055,8 @@
while (ds->y < s->height && offset > 0) {
eb_prevc(s->b, offset, &offset);
- offset = s->mode->text_backward_offset(s, offset);
- bottom = s->mode->text_display(s, ds, offset);
+ offset = s->mode->backward_offset(s, offset);
+ bottom = s->mode->display_line(s, ds, offset);
}
s->offset_top = offset;
s->offset_bottom = bottom;
@@ -5901,6 +5902,7 @@
s = edit_new(b, 0, qs->screen->height - qs->status_height,
qs->screen->width, qs->status_height, 0);
/* Should insert at end of window list */
+ /* XXX: should qe_free previous value? */
s->prompt = qe_strdup(prompt);
s->minibuf = 1;
s->bidir = 0;
@@ -7520,7 +7522,7 @@
int line_height;
/* only apply to text modes */
- if (!s->mode->text_display)
+ if (!s->mode->display_line)
return;
line_height = get_line_height(s->screen, s->default_style);
@@ -7791,8 +7793,8 @@
.name = "text",
.mode_probe = text_mode_probe,
- .text_display = text_display,
- .text_backward_offset = text_backward_offset,
+ .display_line = text_display_line,
+ .backward_offset = text_backward_offset,
.move_up_down = text_move_up_down,
.move_left_right = text_move_left_right_visual,
Index: qe.h
===================================================================
RCS file: /sources/qemacs/qemacs/qe.h,v
retrieving revision 1.225
retrieving revision 1.226
diff -u -b -r1.225 -r1.226
--- qe.h 23 Dec 2016 13:00:55 -0000 1.225
+++ qe.h 23 Dec 2016 15:51:51 -0000 1.226
@@ -1298,8 +1298,8 @@
void (*display)(EditState *);
/* text related functions */
- int (*text_display)(EditState *, DisplayState *, int);
- int (*text_backward_offset)(EditState *, int);
+ int (*display_line)(EditState *, DisplayState *, int);
+ int (*backward_offset)(EditState *, int);
ColorizeFunc colorize_func;
int colorize_flags;
@@ -1648,6 +1648,7 @@
int nb_fragments;
int last_word_space; /* true if last word was a space */
int word_index; /* fragment index of the start of the current word */
+
/* line char (in fact glyph) buffer */
unsigned int line_chars[MAX_SCREEN_WIDTH];
short line_char_widths[MAX_SCREEN_WIDTH];
@@ -1866,7 +1867,7 @@
extern ModeDef text_mode;
int text_backward_offset(EditState *s, int offset);
-int text_display(EditState *s, DisplayState *ds, int offset);
+int text_display_line(EditState *s, DisplayState *ds, int offset);
void set_colorize_func(EditState *s, ColorizeFunc colorize_func);
int generic_get_colorized_line(EditState *s, unsigned int *buf, int buf_size,
Index: unihex.c
===================================================================
RCS file: /sources/qemacs/qemacs/unihex.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- unihex.c 9 Jun 2016 16:24:10 -0000 1.32
+++ unihex.c 23 Dec 2016 15:51:51 -0000 1.33
@@ -72,7 +72,7 @@
return eb_goto_char(s->b, pos);
}
-static int unihex_display(EditState *s, DisplayState *ds, int offset)
+static int unihex_display_line(EditState *s, DisplayState *ds, int offset)
{
int j, len, ateof, dump_width;
int offset1, offset2;
@@ -221,12 +221,14 @@
.name = "unihex",
.mode_probe = unihex_mode_probe,
.mode_init = unihex_mode_init,
- .text_display = unihex_display,
- .text_backward_offset = unihex_backward_offset,
+ .display_line = unihex_display_line,
+ .backward_offset = unihex_backward_offset,
.move_up_down = unihex_move_up_down,
.move_left_right = unihex_move_left_right,
.move_bol = unihex_move_bol,
.move_eol = unihex_move_eol,
+ .move_bof = text_move_bof,
+ .move_eof = text_move_eof,
.scroll_up_down = text_scroll_up_down,
.mouse_goto = text_mouse_goto,
.write_char = hex_write_char,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemacs-commit] qemacs TODO.org hex.c mpeg.c qe.c qe.h unihex.c,
Charlie Gordon <=