qemacs-commit
[Top][All Lists]
Advanced

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

[Qemacs-commit] qemacs haiku.cpp qe.c qe.h variables.c x11.c


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs haiku.cpp qe.c qe.h variables.c x11.c
Date: Mon, 07 Mar 2016 10:35:23 +0000

CVSROOT:        /sources/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        16/03/07 10:35:23

Modified files:
        .              : haiku.cpp qe.c qe.h variables.c x11.c 

Log message:
        basic: made force-tty a global setting and user accessible variable

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/haiku.cpp?cvsroot=qemacs&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.c?cvsroot=qemacs&r1=1.220&r2=1.221
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.h?cvsroot=qemacs&r1=1.213&r2=1.214
http://cvs.savannah.gnu.org/viewcvs/qemacs/variables.c?cvsroot=qemacs&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/qemacs/x11.c?cvsroot=qemacs&r1=1.39&r2=1.40

Patches:
Index: haiku.cpp
===================================================================
RCS file: /sources/qemacs/qemacs/haiku.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- haiku.cpp   16 Sep 2015 22:18:24 -0000      1.12
+++ haiku.cpp   7 Mar 2016 10:35:22 -0000       1.13
@@ -1,6 +1,8 @@
 /*
  * Haiku driver for QEmacs
+ *
  * Copyright (c) 2013 Francois Revol.
+ * Copyright (c) 2015-2016 Charlie Gordon.
  * Copyright (c) 2002 Fabrice Bellard.
  *
  * This library is free software; you can redistribute it and/or
@@ -33,8 +35,6 @@
 #include <View.h>
 #include <Window.h>
 
-static int force_tty = 0;
-
 static int font_xsize;
 
 class QEWindow;
@@ -889,12 +889,6 @@
     NULL, /* next */
 };
 
-static CmdOptionDef cmd_options[] = {
-    { "no-windows", "nw", NULL, CMD_OPT_BOOL, "force tty terminal usage",
-       { int_ptr: &force_tty }},
-    { NULL, NULL, NULL, 0, NULL, { NULL }},
-};
-
 static int haiku_init(void)
 {
     QEmacsState *qs = &qe_state;
@@ -910,7 +904,9 @@
     }
     pstrcat(qs->res_path, sizeof(qs->res_path), old.String());
 
-    qe_register_cmd_line_options(cmd_options);
+    if (force_tty)
+        return 0;
+
     return qe_register_display(&haiku_dpy);
 }
 

Index: qe.c
===================================================================
RCS file: /sources/qemacs/qemacs/qe.c,v
retrieving revision 1.220
retrieving revision 1.221
diff -u -b -r1.220 -r1.221
--- qe.c        6 Mar 2016 19:53:06 -0000       1.220
+++ qe.c        7 Mar 2016 10:35:23 -0000       1.221
@@ -74,6 +74,7 @@
 static int screen_width = 0;
 static int screen_height = 0;
 static int no_init_file;
+int force_tty;
 int use_session_file;
 #ifndef CONFIG_TINY
 static int free_everything;
@@ -7749,20 +7750,10 @@
     exit(1);
 }
 
-static int force_tty;
-
-static CmdOptionDef null_cmd_options[] = {
-    { "no-windows", "nw", NULL, CMD_OPT_BOOL, "force tty terminal usage",
-       { .int_ptr = &force_tty }},
-    { NULL, NULL, NULL, 0, NULL, { NULL }},
-};
-
 static int parse_command_line(int argc, char **argv)
 {
     int _optind;
 
-    qe_register_cmd_line_options(null_cmd_options);
-
     _optind = 1;
     for (;;) {
         const char *r, *r1, *r2, *_optarg;
@@ -7819,6 +7810,7 @@
         put_status(NULL, "unknown cmdline option '%s'", r);
     next_cmd: ;
     }
+
     return _optind;
 }
 
@@ -7878,10 +7870,12 @@
       { .func_noarg = show_usage }},
     { "no-init-file", "q", NULL, CMD_OPT_BOOL, "do not load config files",
       { .int_ptr = &no_init_file }},
-    { "use-session", "s", NULL, CMD_OPT_BOOL, "load and save session files",
-      { .int_ptr = &use_session_file }},
+    { "no-windows", "nw", NULL, CMD_OPT_BOOL, "force tty terminal usage",
+       { .int_ptr = &force_tty }},
     { "ttycharset", "c", "CHARSET", CMD_OPT_ARG, "specify tty charset",
       { .func_arg = set_tty_charset }},
+    { "use-session", "s", NULL, CMD_OPT_BOOL, "load and save session files",
+      { .int_ptr = &use_session_file }},
     { "user", "u", "USER", CMD_OPT_ARG, "load ~USER/.qe/config instead of your 
own",
       { .func_arg = set_user_option }},
     { "version", "V", NULL, 0, "display version information and exit",

Index: qe.h
===================================================================
RCS file: /sources/qemacs/qemacs/qe.h,v
retrieving revision 1.213
retrieving revision 1.214
diff -u -b -r1.213 -r1.214
--- qe.h        6 Mar 2016 19:53:06 -0000       1.213
+++ qe.h        7 Mar 2016 10:35:23 -0000       1.214
@@ -1335,6 +1335,8 @@
 int qe_free_mode_data(QEModeData *md);
 
 /* from tty.c */
+/* set from command line option to prevent GUI such as X11 */
+extern int force_tty;
 extern unsigned int const *tty_bg_colors;
 extern int tty_bg_colors_count;
 extern unsigned int const *tty_fg_colors;

Index: variables.c
===================================================================
RCS file: /sources/qemacs/qemacs/variables.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- variables.c 10 Sep 2015 00:25:24 -0000      1.20
+++ variables.c 7 Mar 2016 10:35:23 -0000       1.21
@@ -1,7 +1,7 @@
 /*
  * Module for handling variables in QEmacs
  *
- * Copyright (c) 2000-2014 Charlie Gordon.
+ * Copyright (c) 2000-2016 Charlie Gordon.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -76,6 +76,7 @@
     M_VAR( "auto-indent", auto_indent, VAR_NUMBER, VAR_RW )
 
     G_VAR( "use-session-file", use_session_file, VAR_NUMBER, VAR_RW )
+    G_VAR( "force-tty", force_tty, VAR_NUMBER, VAR_RW )
 
     /* more buffer fields: modified, readonly, binary, charset */
 

Index: x11.c
===================================================================
RCS file: /sources/qemacs/qemacs/x11.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -b -r1.39 -r1.40
--- x11.c       14 Oct 2015 09:31:21 -0000      1.39
+++ x11.c       7 Mar 2016 10:35:23 -0000       1.40
@@ -1,8 +1,8 @@
 /*
  * X11 handling for QEmacs
  *
- * Copyright (c) 2000, 2001, 2002, 2003 Fabrice Bellard.
- * Copyright (c) 2002-2013 Charlie Gordon.
+ * Copyright (c) 2000-2003 Fabrice Bellard.
+ * Copyright (c) 2002-2016 Charlie Gordon.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -89,7 +89,6 @@
 
 static int visual_depth;
 
-static int force_tty;
 static const char *display_str;
 static const char *geometry_str;
 static int font_ptsize;
@@ -1857,8 +1856,6 @@
 };
 
 static CmdOptionDef cmd_options[] = {
-    { "no-windows", "nw", NULL, CMD_OPT_BOOL, "force tty terminal usage",
-      { .int_ptr = &force_tty }},
     { "display", "d", "display", CMD_OPT_STRING | CMD_OPT_ARG, "set X11 
display",
       { .string_ptr = &display_str }},
     { "geometry", "g", "WxH", CMD_OPT_STRING | CMD_OPT_ARG, "set X11 display 
size",
@@ -1871,6 +1868,8 @@
 static int x11_init(void)
 {
     qe_register_cmd_line_options(cmd_options);
+    if (force_tty)
+        return 0;
     return qe_register_display(&x11_dpy);
 }
 



reply via email to

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