qemacs-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemacs-commit] qemacs qeconfig.h qe.h qe.c TODO.org Makefile c...


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs qeconfig.h qe.h qe.c TODO.org Makefile c...
Date: Sat, 25 Mar 2017 14:00:52 -0400 (EDT)

CVSROOT:        /sources/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        17/03/25 14:00:52

Modified files:
        .              : qeconfig.h qe.h qe.c TODO.org Makefile clang.c 

Log message:
        modes: add less mode for .less files
        - rename all popup related mode functions from less_* to popup_*
        - add less-mode for .less files (preprocessor for css files)
        - add FILE to list of C types

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/qeconfig.h?cvsroot=qemacs&r1=1.64&r2=1.65
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.h?cvsroot=qemacs&r1=1.240&r2=1.241
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.c?cvsroot=qemacs&r1=1.255&r2=1.256
http://cvs.savannah.gnu.org/viewcvs/qemacs/TODO.org?cvsroot=qemacs&r1=1.28&r2=1.29
http://cvs.savannah.gnu.org/viewcvs/qemacs/Makefile?cvsroot=qemacs&r1=1.94&r2=1.95
http://cvs.savannah.gnu.org/viewcvs/qemacs/clang.c?cvsroot=qemacs&r1=1.115&r2=1.116

Patches:
Index: qeconfig.h
===================================================================
RCS file: /sources/qemacs/qemacs/qeconfig.h,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -b -r1.64 -r1.65
--- qeconfig.h  2 Jan 2017 11:39:07 -0000       1.64
+++ qeconfig.h  25 Mar 2017 18:00:52 -0000      1.65
@@ -437,11 +437,11 @@
     CMD_DEF_END,
 };
 
-CmdDef less_commands[] = {
+CmdDef popup_commands[] = {
     CMD0( 'q', KEY_CTRL('g'),
-          "less-exit", do_less_exit)
+          "popup-exit", do_popup_exit)
     CMD3( '/', KEY_NONE,
-          "less-isearch", do_isearch, ESii, 1, "vui" )
+          "popup-isearch", do_isearch, ESii, 1, "vui" )
     CMD_DEF_END,
 };
 

Index: qe.h
===================================================================
RCS file: /sources/qemacs/qemacs/qe.h,v
retrieving revision 1.240
retrieving revision 1.241
diff -u -b -r1.240 -r1.241
--- qe.h        19 Mar 2017 13:20:34 -0000      1.240
+++ qe.h        25 Mar 2017 18:00:52 -0000      1.241
@@ -1789,7 +1789,7 @@
 void minibuffer_init(void);
 
 extern CmdDef minibuffer_commands[];
-extern CmdDef less_commands[];
+extern CmdDef popup_commands[];
 
 typedef void (*CompletionFunc)(CompleteState *cp);
 
@@ -2053,7 +2053,7 @@
 void do_history(EditState *s, int dir);
 void do_minibuffer_get_binary(EditState *s);
 void do_minibuffer_exit(EditState *s, int fabort);
-void do_less_exit(EditState *s);
+void do_popup_exit(EditState *s);
 void do_toggle_read_only(EditState *s);
 void do_not_modified(EditState *s, int argval);
 void do_find_alternate_file(EditState *s, const char *filename, int bflags);

Index: qe.c
===================================================================
RCS file: /sources/qemacs/qemacs/qe.c,v
retrieving revision 1.255
retrieving revision 1.256
diff -u -b -r1.255 -r1.256
--- qe.c        20 Mar 2017 18:43:33 -0000      1.255
+++ qe.c        25 Mar 2017 18:00:52 -0000      1.256
@@ -5549,7 +5549,7 @@
             if (*ep == e)
                 break;
         }
-        s->next_window = e;
+        s->next_window = *ep;
         *ep = s;
         qs->active_window = active_window ? active_window : s;
     }
@@ -6122,11 +6122,11 @@
     qe_register_cmd_table(minibuffer_commands, &minibuffer_mode);
 }
 
-/* less mode */
+/* popup paging mode */
 
-static ModeDef less_mode;
+static ModeDef popup_mode;
 
-/* XXX: incorrect to save it. Should use a safer method */
+/* XXX: incorrect to save it. Should use window target member */
 static EditState *popup_saved_active;
 
 /* Verify that window still exists, return argument or NULL,
@@ -6144,8 +6144,7 @@
     return *sp = NULL;
 }
 
-/* less like mode */
-void do_less_exit(EditState *s)
+void do_popup_exit(EditState *s)
 {
     QEmacsState *qs = s->qe_state;
 
@@ -6177,7 +6176,7 @@
     h = (h1 * 3) / 4;
 
     s = edit_new(b, (w1 - w) / 2, (h1 - h) / 2, w, h, WF_POPUP);
-    edit_set_mode(s, &less_mode);
+    edit_set_mode(s, &popup_mode);
     s->wrap = WRAP_TRUNCATE;
 
     popup_saved_active = qs->active_window;
@@ -6186,15 +6185,15 @@
     return s;
 }
 
-static void less_init(void)
+static void popup_init(void)
 {
-    /* less mode inherits from text mode */
-    memcpy(&less_mode, &text_mode, sizeof(ModeDef));
-    less_mode.name = "less";
-    less_mode.mode_name = NULL;
-    less_mode.mode_probe = NULL;
-    qe_register_mode(&less_mode, MODEF_VIEW);
-    qe_register_cmd_table(less_commands, &less_mode);
+    /* popup mode inherits from text mode */
+    memcpy(&popup_mode, &text_mode, sizeof(ModeDef));
+    popup_mode.name = "popup";
+    popup_mode.mode_name = NULL;
+    popup_mode.mode_probe = NULL;
+    qe_register_mode(&popup_mode, MODEF_VIEW);
+    qe_register_cmd_table(popup_commands, &popup_mode);
 }
 
 #ifndef CONFIG_TINY
@@ -8489,7 +8488,7 @@
     register_completion("color", color_completion);
 
     minibuffer_init();
-    less_init();
+    popup_init();
 
     /* init all external modules in link order */
     init_all_modules();

Index: TODO.org
===================================================================
RCS file: /sources/qemacs/qemacs/TODO.org,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- TODO.org    18 Mar 2017 14:24:47 -0000      1.28
+++ TODO.org    25 Mar 2017 18:00:52 -0000      1.29
@@ -1,18 +1,18 @@
 ; TODO list for qemacs
 ;
 ; Author: Charles Gordon
-; Updated: 2017-03-16
+; Updated: 2017-03-25
 
 * Needed for release version 5
 
 * Priority 0
 
-** archive: issue with current directory
 ** basic: fix current position when changing buffer attached to window
 ** basic: enter should optionally remove whitespace at end of line
 ** basic: reset last command when executing macro
 ** basic: make `do_word_right`, `do_word_left`, `do_bol`, `do_eol`... return 
new offset
 ** basic: use visual movement for left, right, up, down and character based 
for C-b C-f C-n C-p
+** basic: share mmapped pages correctly
 ** completion: fix electric behavior
 ** files: check file date to detect asynchronous modifications on disk
 ** files: reload modified file upon change if untouched since load
@@ -31,11 +31,11 @@
 
 * Priority 1
 
+** archive: issue with current directory
 ** archive: add API to register new file formats
 ** 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
-** basic: share mmapped pages correctly
 ** basic: show memory stats in describe-buffer and about-qemacs
 ** basic: fix mode setting mess
 ** basic: fix default wrap setting mess
@@ -44,6 +44,7 @@
 ** basic: optional 64-bit offsets on 64-bit systems, use typedef for buffer 
offsets
 ** basic: fix behaviour on overlong lines
 ** basic: fix offset when exiting s->hex_mode
+** charset: detect bad encoding and use errno to tell caller
 ** charset: use rune and u8 types
 ** charset: auto/mixed eol mode
 ** charset: display ^L as horizontal line and consider as linebreak character
@@ -78,7 +79,7 @@
 ** files: qe_load_file should split screen evenly for LF_SPLIT_SCREEN flag
 ** help: info-mode
 ** help: qemacs-faq on C-h C-f
-** help: qemacs-manual on C-h C-f
+** help: qemacs-manual on C-h m
 ** help: add inline documentation for commands on C-h C-f
 ** help: data-directory, data-path...
 ** basic: frame-title-format and mode-line-format
@@ -148,6 +149,7 @@
 ** charset: update cp directory from more recent unicode tables
 ** charset: UTF-8 variants: CESU-8, Modified UTF-8, UTF-16
 ** charset: UTF-1 obsolete standard encoding for Unicode
+** charset: handle tty-width to compute alignement in dired, bufed...
 ** 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
@@ -270,7 +272,7 @@
 do_delete_window(s)
   bufed_select(s) if vertical split
   dired_select(s) if vertical split
-do_less_quit(s)
+do_popup_exit(s)
 do_delete_other_windows(s) deletes other windows (!)
 do_minibuffer_exit(s) also deletes completion_popup
 insert_window_left()  deletes some left-most windows
@@ -539,6 +541,7 @@
 ** find-file: gist:snippet
 ** new flavor for GoogleClosureCompiler
 
+** use Unicode file hierarchy for code page files
 ** handle or remove extra code page files:
 
 APL-ISO-IR-68.TXT GSM0338.TXT SGML.TXT
@@ -551,3 +554,9 @@
 MAC-CYRILLIC.TXT MAC-GREEK.TXT MAC-ICELAND.TXT MAC-TURKISH.TXT 
 cpdata.txt
 koi8_ru.cp
+
+emacs-22 bindings:
+C-x ` for next-error
+M-g M-g goto-line (with prefix argument)
+M-g M-p previous-error
+M-g M-n next-error

Index: Makefile
===================================================================
RCS file: /sources/qemacs/qemacs/Makefile,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -b -r1.94 -r1.95
--- Makefile    16 Mar 2017 09:16:31 -0000      1.94
+++ Makefile    25 Mar 2017 18:00:52 -0000      1.95
@@ -1,7 +1,7 @@
 # QEmacs, tiny but powerful multimode editor
 #
 # Copyright (c) 2000-2002 Fabrice Bellard.
-# Copyright (c) 2000-2016 Charlie Gordon.
+# Copyright (c) 2000-2017 Charlie Gordon.
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public

Index: clang.c
===================================================================
RCS file: /sources/qemacs/qemacs/clang.c,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -b -r1.115 -r1.116
--- clang.c     18 Mar 2017 14:24:47 -0000      1.115
+++ clang.c     25 Mar 2017 18:00:52 -0000      1.116
@@ -89,7 +89,7 @@
 
 static const char c_types[] = {
     "char|double|float|int|long|unsigned|short|signed|void|va_list|"
-    "_Bool|_Complex|_Imaginary|"
+    "_Bool|_Complex|_Imaginary|FILE|"
 };
 
 static const char c_extensions[] = {
@@ -1458,6 +1458,27 @@
     .fallback = &c_mode,
 };
 
+/*---------------- less css preprocessor ----------------*/
+
+static const char less_keywords[] = {
+    "|"
+};
+
+static const char less_types[] = {
+    "|"
+};
+
+ModeDef less_mode = {
+    .name = "less",
+    .extensions = "less",
+    .colorize_func = c_colorize_line,
+    .colorize_flags = CLANG_CSS,
+    .keywords = less_keywords,
+    .types = less_types,
+    .indent_func = c_indent_line,
+    .fallback = &c_mode,
+};
+
 /*---------------- Javascript programming language ----------------*/
 
 static const char js_keywords[] = {
@@ -2762,6 +2783,7 @@
     qe_register_mode(&csharp_mode, MODEF_SYNTAX);
     qe_register_mode(&awk_mode, MODEF_SYNTAX);
     qe_register_mode(&css_mode, MODEF_SYNTAX);
+    qe_register_mode(&less_mode, MODEF_SYNTAX);
     qe_register_mode(&json_mode, MODEF_SYNTAX);
     qe_register_mode(&js_mode, MODEF_SYNTAX);
     qe_register_mode(&as_mode, MODEF_SYNTAX);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]