+2005-01-20 Steven Tamm <steventamm@mac.com>
+
+ * term/mac-win.el (process-connection-type): Removed.
+ Controlled now by s/darwin.h:PTY_ITERATION.
+
2005-01-20 Stefan Monnier <monnier@iro.umontreal.ca>
* window.el (handle-select-window): Don't switch window when we're
(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,
+2005-01-20 Steven Tamm <steventamm@mac.com>
+
+ * 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 <storm@cua.dk>
* alloc.c (STRING_MARKED_P, VECTOR_MARKED_P): Return boolean.
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. */)
()
#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.