# HG changeset patch # User Steven Tamm # Date 1106244828 0 # Node ID 45074d913d23925cfc8c0a054b8e49207c7d833b # Parent f3aa25eacdb3f88019c0a5394eac6044b3a92f1e * editfns.c (Voperating_system_release): Added. (init_editfns): Assign new variable operating-system-release based on call to uname if available. (get_operating_system_release): Added function to allow c-level access to operating system release. * config.h: Regenerated. * s/darwin.h (PTY_ITERATION): Don't allow PTYs on darwin 6 or less. (MIN_PTY_KERNEL_VERSION): Defined minimum kernel version for using ptys as '7'. * term/mac-win.el (process-connection-type): Removed. Controlled now by s/darwin.h:PTY_ITERATION. diff -r f3aa25eacdb3 -r 45074d913d23 lisp/ChangeLog --- a/lisp/ChangeLog Thu Jan 20 15:37:41 2005 +0000 +++ b/lisp/ChangeLog Thu Jan 20 18:13:48 2005 +0000 @@ -1,3 +1,8 @@ +2005-01-20 Steven Tamm + + * term/mac-win.el (process-connection-type): Removed. + Controlled now by s/darwin.h:PTY_ITERATION. + 2005-01-20 Stefan Monnier * window.el (handle-select-window): Don't switch window when we're diff -r f3aa25eacdb3 -r 45074d913d23 lisp/term/mac-win.el --- a/lisp/term/mac-win.el Thu Jan 20 15:37:41 2005 +0000 +++ b/lisp/term/mac-win.el Thu Jan 20 18:13:48 2005 +0000 @@ -1694,11 +1694,9 @@ (if (string= default-directory "/") (cd "~")) -;; Tell Emacs to use pipes instead of pty's for processes because the -;; latter sometimes lose characters. Pty support is compiled in since -;; ange-ftp will not work without it. Fixed with darwin 7 (OS X 10.3). -(setq process-connection-type - (not (string-match "^[0-6]\\." operating-system-release))) +;; Darwin 6- pty breakage is now controlled from the C code so that +;; it applies to all builds on darwin. See s/darwin.h PTY_ITERATION. +;; (setq process-connection-type t) ;; Assume that fonts are always scalable on the Mac. This sometimes ;; results in characters with jagged edges. However, without it, diff -r f3aa25eacdb3 -r 45074d913d23 src/ChangeLog --- a/src/ChangeLog Thu Jan 20 15:37:41 2005 +0000 +++ b/src/ChangeLog Thu Jan 20 18:13:48 2005 +0000 @@ -1,3 +1,18 @@ +2005-01-20 Steven Tamm + + * editfns.c (Voperating_system_release): Added. + (init_editfns): Assign new variable operating-system-release + based on call to uname if available. + (get_operating_system_release): Added function to + allow c-level access to operating system release. + + * config.h: Regenerated. + + * s/darwin.h (PTY_ITERATION): Don't allow PTYs on darwin 6 or + less. + (MIN_PTY_KERNEL_VERSION): Defined minimum kernel version for + using ptys as '7'. + 2005-01-20 Kim F. Storm * alloc.c (STRING_MARKED_P, VECTOR_MARKED_P): Return boolean. diff -r f3aa25eacdb3 -r 45074d913d23 src/editfns.c --- a/src/editfns.c Thu Jan 20 15:37:41 2005 +0000 +++ b/src/editfns.c Thu Jan 20 18:13:48 2005 +0000 @@ -1364,6 +1364,15 @@ return ""; } +char * +get_operating_system_release() +{ + if (STRINGP (Voperating_system_release)) + return (char *) SDATA (Voperating_system_release); + else + return ""; +} + DEFUN ("emacs-pid", Femacs_pid, Semacs_pid, 0, 0, 0, doc: /* Return the process ID of Emacs, as an integer. */) () diff -r f3aa25eacdb3 -r 45074d913d23 src/s/darwin.h --- a/src/s/darwin.h Thu Jan 20 15:37:41 2005 +0000 +++ b/src/s/darwin.h Thu Jan 20 18:13:48 2005 +0000 @@ -107,6 +107,22 @@ #define HAVE_PTYS + +/* + * PTYs only work correctly on Darwin 7 or higher. So make PTY_ITERATION + * Test the operating system release and only allow PTYs if it is greater + * than 7. + */ +#define MIN_PTY_KERNEL_VERSION '7' +#define PTY_ITERATION \ + char *release = get_operating_system_release(); \ + if (!release || !release[0] || (release[0] < MIN_PTY_KERNEL_VERSION \ + && release[1] == '.')) \ + return -1; \ + for (c = FIRST_PTY_LETTER; c <= 'z'; c++) \ + for (i = 0; i < 16; i++) + + /* * Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate * The 4.2 opendir, etc., library functions.