qemacs-commit
[Top][All Lists]
Advanced

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

[Qemacs-commit] qemacs shell.c


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs shell.c
Date: Thu, 02 Jan 2014 10:22:49 +0000

CVSROOT:        /sources/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        14/01/02 10:22:48

Modified files:
        .              : shell.c 

Log message:
        improved utf8 charset selection for shell buffer

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/shell.c?cvsroot=qemacs&r1=1.71&r2=1.72

Patches:
Index: shell.c
===================================================================
RCS file: /sources/qemacs/qemacs/shell.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -b -r1.71 -r1.72
--- shell.c     27 Dec 2013 01:54:12 -0000      1.71
+++ shell.c     2 Jan 2014 10:22:48 -0000       1.72
@@ -1,8 +1,8 @@
 /*
  * Shell mode for QEmacs.
  *
- * Copyright (c) 2001, 2002 Fabrice Bellard.
- * Copyright (c) 2002-2013 Charlie Gordon.
+ * Copyright (c) 2001-2002 Fabrice Bellard.
+ * Copyright (c) 2002-2014 Charlie Gordon.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -1394,6 +1394,7 @@
                              const char *caption, const char *cmd,
                              int shell_flags)
 {
+    QEmacsState *qs = &qe_state;
     ShellState *s;
     EditBuffer *b, *b_color;
     const char *lang;
@@ -1407,10 +1408,12 @@
     eb_set_buffer_name(b, bufname); /* ensure that the name is unique */
 
     /* Select shell output buffer encoding from LANG setting */
-    if ((lang = getenv("LANG")) != NULL && strstr(lang, "UTF-8"))
+    if (((lang = getenv("LANG")) != NULL && strstr(lang, "UTF-8")) ||
+          qs->screen->charset == &charset_utf8) {
         eb_set_charset(b, &charset_utf8);
-    else
+    } else {
         eb_set_charset(b, &charset_vt100);
+    }
 
     s = qe_mallocz(ShellState);
     if (!s) {
@@ -1424,7 +1427,7 @@
     s->b = b;
     s->pty_fd = -1;
     s->pid = -1;
-    s->qe_state = &qe_state;
+    s->qe_state = qs;
     s->caption = caption;
     s->shell_flags = shell_flags;
     tty_init(s);



reply via email to

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