unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Codepages and shell function on w32
@ 2006-12-31 13:22 Lennart Borgman (gmail)
  2006-12-31 22:04 ` Eli Zaretskii
  2007-01-02 21:53 ` Benjamin Riefenstahl
  0 siblings, 2 replies; 14+ messages in thread
From: Lennart Borgman (gmail) @ 2006-12-31 13:22 UTC (permalink / raw)


I do not know how to solve the problem with the code pages and the shell 
function on w32, but played a bit with it. There are actually functions 
to get the code pages and I tested this at the end of the shell function:

      (shell-mode)
      (when (eq system-type 'windows-nt)
        (let ((shell-file-name prog)
              (proc (get-buffer-process (current-buffer)))
              (fullprog (executable-find prog))
              (cp-out (read (format "cp%s" 
(w32-get-console-output-codepage))))
              (cp-in  (read (format "cp%s" (w32-get-console-codepage)))))
          (cond
           ((w32-shell-dos-semantics)
            (set-process-coding-system proc cp-out cp-in))
           ((string-match "/msys/" fullprog)
            (message "think it is MSYS...")
            ;; MSYS: fix-me, does not work
            (set-process-coding-system proc 'windows-1252 'windows-1252))
           ((string-match "/cygwin/" fullprog)
            (message "think it is Cygwin...")
            ;; Cygwin: fix-me, does not work
            (set-process-coding-system proc 'windows-1252 'windows-1252))
           (t
            (message "unrecognized shell program: %s" fullprog))
           )))))
  buffer)

It seems to work for cmdproxy, but I do not know how the code should 
look. I do not know what code pages to use for MSYS and Cygwin, the code 
above is just a test.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2007-01-06  1:55 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-31 13:22 Codepages and shell function on w32 Lennart Borgman (gmail)
2006-12-31 22:04 ` Eli Zaretskii
2007-01-01  3:05   ` Lennart Borgman (gmail)
2007-01-01  5:49     ` Eli Zaretskii
2007-01-01 13:46       ` Lennart Borgman (gmail)
2007-01-01  6:08     ` Jason Rumney
2007-01-01  7:27       ` Eli Zaretskii
2007-01-01 14:20         ` Lennart Borgman (gmail)
2007-01-02  4:26           ` Eli Zaretskii
2007-01-02 15:39             ` Lennart Borgman (gmail)
2007-01-02 21:53 ` Benjamin Riefenstahl
2007-01-02 22:49   ` Lennart Borgman (gmail)
2007-01-06  0:47     ` Benjamin Riefenstahl
2007-01-06  1:55       ` Lennart Borgman (gmail)

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).