From a15252fdfb18b102d25c3c90e866036073a1c3de Mon Sep 17 00:00:00 2001 From: Steven Tamm Date: Thu, 20 Jan 2005 18:13:48 +0000 Subject: [PATCH] * 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. --- lisp/ChangeLog | 5 +++++ lisp/term/mac-win.el | 8 +++----- src/ChangeLog | 15 +++++++++++++++ src/editfns.c | 9 +++++++++ src/s/darwin.h | 16 ++++++++++++++++ 5 files changed, 48 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5abd6512e46..6db1db5f854 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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 --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el index 519e8a5f076..a7ded41103e 100644 --- a/lisp/term/mac-win.el +++ b/lisp/term/mac-win.el @@ -1694,11 +1694,9 @@ Switch to a buffer editing the last file dropped." (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 --git a/src/ChangeLog b/src/ChangeLog index d69409965f1..4b33af4bc4a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -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 --git a/src/editfns.c b/src/editfns.c index 6641c990a4f..a6cd2c0e16b 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -1364,6 +1364,15 @@ get_system_name () 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 --git a/src/s/darwin.h b/src/s/darwin.h index 9f78405a43c..d8da3e3174c 100644 --- a/src/s/darwin.h +++ b/src/s/darwin.h @@ -107,6 +107,22 @@ Boston, MA 02111-1307, USA. */ #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. -- 2.39.2