qemacs-commit
[Top][All Lists]
Advanced

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

[Qemacs-commit] qemacs clang.c


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs clang.c
Date: Thu, 14 May 2015 07:21:37 +0000

CVSROOT:        /sources/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        15/05/14 07:21:37

Modified files:
        .              : clang.c 

Log message:
        customized enscript scoring for *.st files

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/clang.c?cvsroot=qemacs&r1=1.82&r2=1.83

Patches:
Index: clang.c
===================================================================
RCS file: /sources/qemacs/qemacs/clang.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -b -r1.82 -r1.83
--- clang.c     14 Apr 2015 20:25:38 -0000      1.82
+++ clang.c     14 May 2015 07:21:36 -0000      1.83
@@ -1837,9 +1837,21 @@
     .fallback = &c_mode,
 };
 
+static int enscript_mode_probe(ModeDef *mode, ModeProbeData *pd)
+{
+    if (match_extension(pd->filename, mode->extensions)) {
+        if (*cs8(pd->buf) == '/')
+            return 80;
+        else
+            return 50;
+    }
+    return 1;
+}
+
 ModeDef enscript_mode = {
     .name = "Enscript", /* GNU Enscript */
     .extensions = "st", /* syntax files */
+    .mode_probe = enscript_mode_probe,
     .colorize_func = c_colorize_line,
     .colorize_flags = CLANG_ENSCRIPT | CLANG_REGEX,
     .keywords = enscript_keywords,



reply via email to

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