home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
e20313in.zip
/
emacs
/
20.3.1
/
emx
/
patches.emx
< prev
next >
Wrap
Text File
|
1996-08-19
|
139KB
|
4,716 lines
diff -c emacs-19\lib-src\etags.c:1.1.1.33 emacs-19\lib-src\etags.c:1.45
*** emacs-19\lib-src\etags.c:1.1.1.33 Sun Aug 18 23:21:48 1996
--- emacs-19\lib-src\etags.c Sun Aug 18 23:21:48 1996
***************
*** 18,23 ****
--- 18,25 ----
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
+
/*
* Authors:
* Ctags originally by Ken Arnold.
***************
*** 70,75 ****
--- 72,81 ----
#include <sys/types.h>
#include <sys/stat.h>
+ #ifdef EMX
+ #include <string.h>
+ #endif /* EMX */
+
#if !defined (S_ISREG) && defined (S_IFREG)
# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#endif
***************
*** 114,120 ****
#define intoken(arg) (_itk[arg]) /* T if char can be in token */
#define endtoken(arg) (_etk[arg]) /* T if char ends tokens */
! #ifdef DOS_NT
# define absolutefn(fn) (fn[0] == '/' \
|| (fn[1] == ':' && fn[2] == '/'))
#else
--- 120,126 ----
#define intoken(arg) (_itk[arg]) /* T if char can be in token */
#define endtoken(arg) (_etk[arg]) /* T if char ends tokens */
! #if defined (DOS_NT) || defined (EMX)
# define absolutefn(fn) (fn[0] == '/' \
|| (fn[1] == ':' && fn[2] == '/'))
#else
***************
*** 715,720 ****
--- 721,730 ----
progname = argv[0];
+ #ifdef EMX
+ _wildcard (&argc, &argv);
+ #endif /* EMX */
+
/* Allocate enough no matter what happens. Overkill, but each one
is small. */
argbuffer = xnew (argc, argument);
***************
*** 4332,4337 ****
--- 4342,4357 ----
char *
etags_getcwd ()
{
+ #ifdef EMX
+ char cwd[270];
+ int i;
+
+ getcwd (cwd, sizeof (cwd));
+ i = strlen (cwd);
+ if (i > 0 && cwd[i-1] == '/')
+ cwd[i-1] = 0;
+ return strdup (cwd);
+ #else /* not EMX */
#ifdef MSDOS
char *p, path[MAXPATHLEN + 1]; /* Fixed size is safe on MSDOS. */
***************
*** 4370,4375 ****
--- 4390,4396 ----
return path.buffer;
#endif /* not HAVE_GETCWD */
#endif /* not MSDOS */
+ #endif /* not EMX */
}
/* Return a newly allocated string containing the filename
diff -c emacs-19\lib-src\hexl.c:1.1.1.7 emacs-19\lib-src\hexl.c:1.22
*** emacs-19\lib-src\hexl.c:1.1.1.7 Sun Aug 18 23:21:48 1996
--- emacs-19\lib-src\hexl.c Sun Aug 18 23:21:48 1996
***************
*** 1,3 ****
--- 1,5 ----
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
+
#include <stdio.h>
#include <ctype.h>
#ifdef DOS_NT
***************
*** 35,40 ****
--- 37,47 ----
progname = *argv++; --argc;
+ #ifdef EMX
+ setvbuf (stdin, NULL, _IOFBF, BUFSIZ);
+ setvbuf (stdout, NULL, _IOFBF, BUFSIZ);
+ #endif /* EMX */
+
/*
** -hex hex dump
** -oct Octal dump
***************
*** 148,153 ****
--- 155,163 ----
_setmode (fileno (stdout), O_BINARY);
#endif
#endif
+ #ifdef EMX
+ _fsetmode (stdout, "b");
+ #endif /* EMX */
for (;;)
{
register int i, c, d;
***************
*** 197,202 ****
--- 207,215 ----
_setmode (fileno (fp), O_BINARY);
#endif
#endif
+ #ifdef EMX
+ _fsetmode (fp, "b");
+ #endif /* EMX */
address = 0;
string[0] = ' ';
string[17] = '\0';
diff -c emacs-19\lib-src\make-docfile.c:1.1.1.16 emacs-19\lib-src\make-docfile.c:1.32
*** emacs-19\lib-src\make-docfile.c:1.1.1.16 Sun Aug 18 23:21:48 1996
--- emacs-19\lib-src\make-docfile.c Sun Aug 18 23:21:50 1996
***************
*** 18,23 ****
--- 18,25 ----
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
+
/* The arguments given to this program are all the C and Lisp source files
of GNU Emacs. .elc and .el and .c files are allowed.
A .o file can also be specified; the .c file it was made from is used.
***************
*** 45,50 ****
--- 47,56 ----
#include <direct.h>
#endif /* WINDOWSNT */
+ #ifdef EMX
+ #define READ_TEXT "rt"
+ #define READ_BINARY "rb"
+ #else /* not EMX */
#ifdef DOS_NT
#define READ_TEXT "rt"
#define READ_BINARY "rb"
***************
*** 52,57 ****
--- 58,64 ----
#define READ_TEXT "r"
#define READ_BINARY "r"
#endif /* not DOS_NT */
+ #endif /* not EMX */
int scan_file ();
int scan_lisp_file ();
***************
*** 131,136 ****
--- 138,146 ----
_fmode = O_BINARY;
_setmode (fileno (stdout), O_BINARY);
#endif /* WINDOWSNT */
+ #ifdef EMX
+ _wildcard (&argc, &argv);
+ #endif /* EMX */
/* If first two args are -o FILE, output to FILE. */
i = 1;
***************
*** 152,157 ****
--- 162,171 ----
if (outfile == 0)
fatal ("No output file specified", "");
+
+ #ifdef EMX
+ _fsetmode (outfile, "b");
+ #endif /* EMX */
first_infile = i;
for (; i < argc; i++)
diff -c emacs-19\lib-src\profile.c:1.1.1.7 emacs-19\lib-src\profile.c:1.17
*** emacs-19\lib-src\profile.c:1.1.1.7 Sun Aug 18 23:21:50 1996
--- emacs-19\lib-src\profile.c Sun Aug 18 23:21:50 1996
***************
*** 20,25 ****
--- 20,26 ----
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
/**
** To be run as an emacs process. Input string that starts with:
***************
*** 83,88 ****
--- 84,92 ----
main ()
{
int c;
+ #ifdef EMX
+ setvbuf (stdout, NULL, _IOLBF, BUFSIZ);
+ #endif
while ((c = getchar ()) != EOF)
{
switch (c)
diff -c emacs-19\lisp\ange-ftp.el:1.1.1.33 emacs-19\lisp\ange-ftp.el:1.13
*** emacs-19\lisp\ange-ftp.el:1.1.1.33 Sun Aug 18 23:22:10 1996
--- emacs-19\lisp\ange-ftp.el Sun Aug 18 23:22:10 1996
***************
*** 1,5 ****
--- 1,7 ----
;;; ange-ftp.el --- transparent FTP support for GNU Emacs
+ ;;; Modified for emx by Eberhard Mattes, Aug 1996
+
;; Copyright (C) 1989,90,91,92,93,94,95,96 Free Software Foundation, Inc.
;; Author: Andy Norman (ange@hplb.hpl.hp.com)
***************
*** 2854,2860 ****
;; If name starts with //, preserve that, for apollo system.
(if (not (string-match "^//" name))
(progn
! (setq name (ange-ftp-real-expand-file-name name))
(if (string-match "^//" name)
(setq name (substring name 1)))))
--- 2856,2862 ----
;; If name starts with //, preserve that, for apollo system.
(if (not (string-match "^//" name))
(progn
! (setq name (ange-ftp-remote-expand-file-name name))
(if (string-match "^//" name)
(setq name (substring name 1)))))
***************
*** 2863,2871 ****
(ange-ftp-replace-name-component n name))
;; non-ange-ftp name. Just expand normally.
! (if (eq (string-to-char n) ?/)
(ange-ftp-real-expand-file-name n)
! (ange-ftp-real-expand-file-name
(ange-ftp-real-file-name-nondirectory n)
(ange-ftp-real-file-name-directory n))))))
--- 2865,2873 ----
(ange-ftp-replace-name-component n name))
;; non-ange-ftp name. Just expand normally.
! (if (file-name-absolute-p n)
(ange-ftp-real-expand-file-name n)
! (ange-ftp-remote-expand-file-name
(ange-ftp-real-file-name-nondirectory n)
(ange-ftp-real-file-name-directory n))))))
***************
*** 2879,2885 ****
(setq name (substring name (1- (match-end 0))))))))
(cond ((eq (string-to-char name) ?~)
(ange-ftp-real-expand-file-name name))
! ((eq (string-to-char name) ?/)
(ange-ftp-canonize-filename name))
((zerop (length name))
(ange-ftp-canonize-filename (or default default-directory)))
--- 2881,2887 ----
(setq name (substring name (1- (match-end 0))))))))
(cond ((eq (string-to-char name) ?~)
(ange-ftp-real-expand-file-name name))
! ((file-name-absolute-p name)
(ange-ftp-canonize-filename name))
((zerop (length name))
(ange-ftp-canonize-filename (or default default-directory)))
***************
*** 3957,3962 ****
--- 3959,3968 ----
inhibit-file-name-handlers))))
(inhibit-file-name-operation operation))
(apply operation args)))
+
+ (defun ange-ftp-remote-expand-file-name (name &optional default)
+ (let ((remote-expand-file-name t))
+ (ange-ftp-real-expand-file-name name default)))
(defun ange-ftp-real-file-name-directory (&rest args)
(ange-ftp-run-real-handler 'file-name-directory args))
diff -c emacs-19\lisp\compile.el:1.1.1.33 emacs-19\lisp\compile.el:1.41
*** emacs-19\lisp\compile.el:1.1.1.33 Sun Aug 18 23:22:12 1996
--- emacs-19\lisp\compile.el Sun Aug 18 23:22:12 1996
***************
*** 1,5 ****
--- 1,7 ----
;;; compile.el --- run compiler as inferior of Emacs, parse error messages.
+ ;;; Modified for emx by Eberhard Mattes, Aug 1996
+
;; Copyright (C) 1985, 86, 87, 93, 94, 1995, 1996 Free Software Foundation, Inc.
;; Author: Roland McGrath <roland@prep.ai.mit.edu>
***************
*** 442,447 ****
--- 444,450 ----
;; Start the compilation.
(if (fboundp 'start-process)
(let* ((process-environment (cons "EMACS=t" process-environment))
+ (process-connection-type nil) ; emx
(proc (start-process-shell-command (downcase mode-name)
outbuf
command)))
diff -c emacs-19\lisp\dired-aux.el:1.1.1.24 emacs-19\lisp\dired-aux.el:1.14
*** emacs-19\lisp\dired-aux.el:1.1.1.24 Sun Aug 18 23:22:12 1996
--- emacs-19\lisp\dired-aux.el Sun Aug 18 23:22:12 1996
***************
*** 1,5 ****
--- 1,7 ----
;;; dired-aux.el --- less commonly used parts of dired -*-byte-compile-dynamic: t;-*-
+ ;; Modified for emx by Eberhard Mattes, Aug 1996
+
;; Copyright (C) 1985, 1986, 1992, 1994 Free Software Foundation, Inc.
;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>.
***************
*** 117,123 ****
(defun dired-do-chgrp (&optional arg)
"Change the group of the marked (or next ARG) files."
(interactive "P")
! (if (memq system-type '(ms-dos windows-nt))
(error "chgrp not supported on this system."))
(dired-do-chxxx "Group" "chgrp" 'chgrp arg))
--- 119,125 ----
(defun dired-do-chgrp (&optional arg)
"Change the group of the marked (or next ARG) files."
(interactive "P")
! (if (memq system-type '(ms-dos windows-nt emx))
(error "chgrp not supported on this system."))
(dired-do-chxxx "Group" "chgrp" 'chgrp arg))
***************
*** 125,131 ****
(defun dired-do-chown (&optional arg)
"Change the owner of the marked (or next ARG) files."
(interactive "P")
! (if (memq system-type '(ms-dos windows-nt))
(error "chown not supported on this system."))
(dired-do-chxxx "Owner" dired-chown-program 'chown arg))
--- 127,133 ----
(defun dired-do-chown (&optional arg)
"Change the owner of the marked (or next ARG) files."
(interactive "P")
! (if (memq system-type '(ms-dos windows-nt emx))
(error "chown not supported on this system."))
(dired-do-chxxx "Owner" dired-chown-program 'chown arg))
diff -c emacs-19\lisp\facemenu.el:1.1.1.13 emacs-19\lisp\facemenu.el:1.17
*** emacs-19\lisp\facemenu.el:1.1.1.13 Sun Aug 18 23:22:14 1996
--- emacs-19\lisp\facemenu.el Sun Aug 18 23:22:14 1996
***************
*** 1,6 ****
--- 1,7 ----
;;; facemenu.el --- create a face menu for interactively adding fonts to text
;; Copyright (c) 1994, 1995, 1996 Free Software Foundation, Inc.
+ ;; Modified for emx by Eberhard Mattes, Aug 1996
;; Author: Boris Goldowsky <boris@gnu.ai.mit.edu>
;; Keywords: faces
***************
*** 491,497 ****
color names mean. It returns nil if the colors differ or if it can't
determine the correct answer."
(cond ((equal a b) t)
! ((and (or (eq window-system 'x) (eq window-system 'win32))
(equal (x-color-values a) (x-color-values b))))
((eq window-system 'pc)
(and (x-color-defined-p a) (x-color-defined-p b)
--- 492,498 ----
color names mean. It returns nil if the colors differ or if it can't
determine the correct answer."
(cond ((equal a b) t)
! ((and (memq window-system '(x win32 pm))
(equal (x-color-values a) (x-color-values b))))
((eq window-system 'pc)
(and (x-color-defined-p a) (x-color-defined-p b)
diff -c emacs-19\lisp\faces.el:1.1.1.31 emacs-19\lisp\faces.el:1.47
*** emacs-19\lisp\faces.el:1.1.1.31 Sun Aug 18 23:22:14 1996
--- emacs-19\lisp\faces.el Sun Aug 18 23:22:14 1996
***************
*** 1,6 ****
--- 1,7 ----
;;; faces.el --- Lisp interface to the c "face" structure
;; Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+ ;; Modified for emx by Eberhard Mattes, Aug 1996
;; This file is part of GNU Emacs.
***************
*** 365,371 ****
(setq frames (cdr frames)))
(setq global-face-data (cons (cons name face) global-face-data)))
;; when making a face after frames already exist
! (if (or (eq window-system 'x) (eq window-system 'win32))
(make-face-x-resource-internal face))
;; add to menu
(if (fboundp 'facemenu-add-new-face)
--- 366,372 ----
(setq frames (cdr frames)))
(setq global-face-data (cons (cons name face) global-face-data)))
;; when making a face after frames already exist
! (if (memq window-system '(x win32 pm))
(make-face-x-resource-internal face))
;; add to menu
(if (fboundp 'facemenu-add-new-face)
***************
*** 379,385 ****
(cond ((null frame)
(let ((frames (frame-list)))
(while frames
! (if (or (eq (framep (car frames)) 'x) (eq (framep (car frames)) 'win32))
(make-face-x-resource-internal (face-name face)
(car frames) set-anyway))
(setq frames (cdr frames)))))
--- 380,386 ----
(cond ((null frame)
(let ((frames (frame-list)))
(while frames
! (if (memq (framep (car frames)) '(x win32 pm))
(make-face-x-resource-internal (face-name face)
(car frames) set-anyway))
(setq frames (cdr frames)))))
***************
*** 1259,1265 ****
(setq colors (cdr colors)))))))
;; If we are already using x-window frames, initialize faces for them.
! (if (or (eq (framep (selected-frame)) 'x) (eq (framep (selected-frame)) 'win32))
(face-initialize))
(provide 'faces)
--- 1260,1266 ----
(setq colors (cdr colors)))))))
;; If we are already using x-window frames, initialize faces for them.
! (if (memq (framep (selected-frame)) '(x win32 pm))
(face-initialize))
(provide 'faces)
diff -c emacs-19\lisp\files.el:1.1.1.40 emacs-19\lisp\files.el:1.52
*** emacs-19\lisp\files.el:1.1.1.40 Sun Aug 18 23:22:16 1996
--- emacs-19\lisp\files.el Sun Aug 18 23:22:16 1996
***************
*** 1,5 ****
--- 1,7 ----
;;; files.el --- file input and output commands for Emacs
+ ;; Modified for emx by Eberhard Mattes, Aug 1996
+
;; Copyright (C) 1985, 86, 87, 92, 93,
;; 94, 95, 1996 Free Software Foundation, Inc.
***************
*** 659,666 ****
(= (aref filename 0) ?/)))
;; MS-DOS root directories can come with a drive letter;
;; Novell Netware allows drive letters beyond `Z:'.
! (not (and (or (eq system-type 'ms-dos)
! (eq system-type 'windows-nt))
(save-match-data
(string-match "^[a-zA-`]:/$" filename)))))
(setq filename
--- 661,667 ----
(= (aref filename 0) ?/)))
;; MS-DOS root directories can come with a drive letter;
;; Novell Netware allows drive letters beyond `Z:'.
! (not (and (memq system-type '(ms-dos windows-nt emx))
(save-match-data
(string-match "^[a-zA-`]:/$" filename)))))
(setq filename
***************
*** 821,826 ****
--- 822,833 ----
0 (match-beginning 0))))
(not (member logical find-file-not-true-dirname-list)))
(setq buffer-file-name buffer-file-truename))
+ ;; On OS/2, we want to store the file's extended attributes in
+ ;; `extended-attributes'.
+ (and (eq system-type 'emx)
+ (condition-case ()
+ (setq extended-attributes (get-ea-list filename))
+ (error nil)))
(if find-file-visit-truename
(setq buffer-file-name
(setq filename
***************
*** 1896,1901 ****
--- 1903,1913 ----
;; If the auto-save file was recent before this command,
;; delete it now.
(delete-auto-save-file-if-necessary recent-save)
+ ;; Write extended attributes
+ (and (eq system-type 'emx)
+ (condition-case ()
+ (put-ea-list buffer-file-name extended-attributes t t)
+ (error nil)))
;; Support VC `implicit' locking.
(vc-after-save)
(run-hooks 'after-save-hook))
diff -c emacs-19\lisp\hexl.el:1.1.1.21 emacs-19\lisp\hexl.el:1.24
*** emacs-19\lisp\hexl.el:1.1.1.21 Sun Aug 18 23:22:18 1996
--- emacs-19\lisp\hexl.el Sun Aug 18 23:22:18 1996
***************
*** 1,5 ****
--- 1,7 ----
;;; hexl.el --- edit a file in a hex dump format using the hexl filter.
+ ;; Modified for emx by Eberhard Mattes, Aug 1996
+
;; Copyright (C) 1989, 1994 Free Software Foundation, Inc.
;; Author: Keith Gabryelski <ag@wheaties.ai.mit.edu>
***************
*** 256,262 ****
"Edit file FILENAME in hexl-mode.
Switch to a buffer visiting file FILENAME, creating one in none exists."
(interactive "fFilename: ")
! (if (or (eq system-type 'ms-dos) (eq system-type 'windows-nt))
(find-file-binary filename)
(find-file filename))
(if (not (eq major-mode 'hexl-mode))
--- 258,264 ----
"Edit file FILENAME in hexl-mode.
Switch to a buffer visiting file FILENAME, creating one in none exists."
(interactive "fFilename: ")
! (if (memq system-type '(ms-dos windows-nt emx))
(find-file-binary filename)
(find-file filename))
(if (not (eq major-mode 'hexl-mode))
diff -c emacs-19\lisp\hippie-exp.el:1.1.1.7 emacs-19\lisp\hippie-exp.el:1.2
*** emacs-19\lisp\hippie-exp.el:1.1.1.7 Sun Aug 18 23:22:18 1996
--- emacs-19\lisp\hippie-exp.el Sun Aug 18 23:22:18 1996
***************
*** 1,5 ****
--- 1,7 ----
;;; hippie-exp.el --- expand text trying various ways to find its expansion.
+ ;; Modified for emx by Eberhard Mattes, Aug 1996
+
;; Copyright (C) 1992 Free Software Foundation, Inc.
;; Author: Anders Holst <aho@sans.kth.se>
***************
*** 445,451 ****
(defvar he-file-name-chars
(cond ((memq system-type '(vax-vms axp-vms))
"-a-zA-Z0-9_/.,~^#$+=:\\[\\]")
! ((memq system-type '(ms-dos windows-nt))
"-a-zA-Z0-9_/.,~^#$+=:\\\\")
(t ;; More strange file formats ?
"-a-zA-Z0-9_/.,~^#$+="))
--- 447,453 ----
(defvar he-file-name-chars
(cond ((memq system-type '(vax-vms axp-vms))
"-a-zA-Z0-9_/.,~^#$+=:\\[\\]")
! ((memq system-type '(ms-dos windows-nt emx))
"-a-zA-Z0-9_/.,~^#$+=:\\\\")
(t ;; More strange file formats ?
"-a-zA-Z0-9_/.,~^#$+="))
***************
*** 493,499 ****
(string= (substring name-part 0 2) "[."))
(concat (substring dir-part 0 -1) (substring name-part 1))
(concat dir-part name-part)))
! ((memq system-type '(ms-dos ms-windows))
(if (and (string-match "\\\\" dir-part)
(not (string-match "/" dir-part))
(= (aref name-part (1- (length name-part))) ?/))
--- 495,501 ----
(string= (substring name-part 0 2) "[."))
(concat (substring dir-part 0 -1) (substring name-part 1))
(concat dir-part name-part)))
! ((memq system-type '(ms-dos ms-windows emx))
(if (and (string-match "\\\\" dir-part)
(not (string-match "/" dir-part))
(= (aref name-part (1- (length name-part))) ?/))
diff -c emacs-19\lisp\info.el:1.1.1.35 emacs-19\lisp\info.el:1.47
*** emacs-19\lisp\info.el:1.1.1.35 Sun Aug 18 23:22:18 1996
--- emacs-19\lisp\info.el Sun Aug 18 23:22:18 1996
***************
*** 1,5 ****
--- 1,7 ----
;;; info.el --- info package for Emacs.
+ ;; Modified for emx by Eberhard Mattes, Aug 1996
+
;; Copyright (C) 1985, 1986, 1992, 1993, 1994 Free Software Foundation, Inc.
;; Maintainer: FSF
***************
*** 76,82 ****
(not (file-exists-p alternative))
;; On DOS/NT, we use movable executables always,
;; and we must always find the Info dir at run time.
! (if (or (eq system-type 'ms-dos) (eq system-type 'windows-nt))
nil
;; Use invocation-directory for Info only if we used it for
;; exec-directory also.
--- 78,84 ----
(not (file-exists-p alternative))
;; On DOS/NT, we use movable executables always,
;; and we must always find the Info dir at run time.
! (if (memq system-type '(ms-dos windows-nt emx))
nil
;; Use invocation-directory for Info only if we used it for
;; exec-directory also.
***************
*** 128,148 ****
"Non-nil if Emacs was started solely as an Info browser.")
(defvar Info-suffix-list
! (if (eq system-type 'ms-dos)
! '( (".gz" . "gunzip")
! (".z" . "gunzip")
! (".inf" . nil)
! ("" . nil))
! '( (".info.Z" . "uncompress")
! (".info.Y" . "unyabba")
! (".info.gz" . "gunzip")
! (".info.z" . "gunzip")
! (".info" . nil)
! (".Z" . "uncompress")
! (".Y" . "unyabba")
! (".gz" . "gunzip")
! (".z" . "gunzip")
! ("" . nil)))
"List of file name suffixes and associated decoding commands.
Each entry should be (SUFFIX . STRING); the file is given to
the command as standard input. If STRING is nil, no decoding is done.
--- 130,164 ----
"Non-nil if Emacs was started solely as an Info browser.")
(defvar Info-suffix-list
! (cond ((eq system-type 'ms-dos)
! '( (".gz" . "gunzip")
! (".z" . "gunzip")
! (".inf" . nil)
! ("" . nil)))
! ((eq system-type 'emx)
! '( (".info.Z" . "gunzip")
! (".info.gz" . "gunzip")
! (".info.z" . "gunzip")
! (".info" . nil)
! (".inf.Z" . "gunzip")
! (".inf.gz" . "gunzip")
! (".inf.z" . "gunzip")
! (".inf" . nil)
! (".Z" . "gunzip")
! (".z" . "gunzip")
! (".gz" . "gunzip")
! ("" . nil)))
! (t
! '( (".info.Z" . "uncompress")
! (".info.Y" . "unyabba")
! (".info.gz" . "gunzip")
! (".info.z" . "gunzip")
! (".info" . nil)
! (".Z" . "uncompress")
! (".Y" . "unyabba")
! (".gz" . "gunzip")
! (".z" . "gunzip")
! ("" . nil))))
"List of file name suffixes and associated decoding commands.
Each entry should be (SUFFIX . STRING); the file is given to
the command as standard input. If STRING is nil, no decoding is done.
***************
*** 1615,1621 ****
(make-local-variable 'Info-tag-table-marker)
(make-local-variable 'Info-history)
(make-local-variable 'Info-index-alternatives)
! (if (memq (framep (selected-frame)) '(x pc))
(progn
(make-face 'info-node)
(make-face 'info-menu-5)
--- 1631,1637 ----
(make-local-variable 'Info-tag-table-marker)
(make-local-variable 'Info-history)
(make-local-variable 'Info-index-alternatives)
! (if (memq (framep (selected-frame)) '(x pc pm))
(progn
(make-face 'info-node)
(make-face 'info-menu-5)
diff -c emacs-19\lisp\jka-compr.el:1.1.1.13 emacs-19\lisp\jka-compr.el:1.8
*** emacs-19\lisp\jka-compr.el:1.1.1.13 Sun Aug 18 23:22:18 1996
--- emacs-19\lisp\jka-compr.el Sun Aug 18 23:22:18 1996
***************
*** 1,6 ****
--- 1,7 ----
;;; jka-compr.el --- reading/writing/loading compressed files
;; Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+ ;; Modified for emx by Eberhard Mattes, Aug 1996
;; Author: jka@ece.cmu.edu (Jay K. Adams)
;; Keywords: data
***************
*** 467,472 ****
--- 468,474 ----
(notfound nil)
(local-copy
(jka-compr-run-real-handler 'file-local-copy (list filename)))
+ (binary-process-output binary-process-output)
local-file
size start)
***************
*** 475,480 ****
--- 477,494 ----
(and
visit
(setq buffer-file-name filename))
+
+ (and (eq system-type 'emx)
+ visit
+ (emx-binary-mode-p
+ (if (jka-compr-info-strip-extension info)
+ (save-match-data
+ (substring filename 0
+ (string-match (jka-compr-info-regexp info)
+ filename)))
+ filename))
+ (setq binary-process-output t
+ emx-binary-mode t))
(unwind-protect ; to make sure local-copy gets deleted
diff -c emacs-19\lisp\loadup.el:1.1.1.16 emacs-19\lisp\loadup.el:1.34
*** emacs-19\lisp\loadup.el:1.1.1.16 Sun Aug 18 23:22:24 1996
--- emacs-19\lisp\loadup.el Sun Aug 18 23:22:24 1996
***************
*** 1,5 ****
--- 1,7 ----
;;; loadup.el --- load up standardly loaded Lisp files for Emacs.
+ ;; Modified for emx by Eberhard Mattes, Aug 1996
+
;; Copyright (C) 1985, 1986, 1992, 1994 Free Software Foundation, Inc.
;; Maintainer: FSF
***************
*** 124,129 ****
--- 126,135 ----
(garbage-collect)
(load "disp-table") ; needed to setup ibm-pc char set, see internal.el
(garbage-collect)))
+ (if (eq system-type 'emx)
+ (progn
+ (garbage-collect)
+ (load "emx-patch")))
(if (fboundp 'atan) ; preload some constants and
(progn ; floating pt. functions if
(garbage-collect) ; we have float support.
***************
*** 152,157 ****
--- 158,166 ----
;; based on the executables that now exist.
(if (and (or (equal (nth 3 command-line-args) "dump")
(equal (nth 4 command-line-args) "dump"))
+ (not (and (eq system-type 'emx)
+ (setq emacs-version (concat emacs-version "."
+ emx-emacs-version))))
(not (eq system-type 'ms-dos)))
(let* ((base (concat "emacs-" emacs-version "."))
(files (file-name-all-completions base default-directory))
***************
*** 177,183 ****
(setq name (concat (downcase (substring name 0 (match-beginning 0)))
"-"
(substring name (match-end 0)))))
! (if (memq system-type '(ms-dos windows-nt))
(setq name (expand-file-name
(if (fboundp 'x-create-frame) "DOC-X" "DOC") "../etc"))
(setq name (concat (expand-file-name "../etc/DOC-") name))
--- 186,192 ----
(setq name (concat (downcase (substring name 0 (match-beginning 0)))
"-"
(substring name (match-end 0)))))
! (if (memq system-type '(ms-dos windows-nt emx))
(setq name (expand-file-name
(if (fboundp 'x-create-frame) "DOC-X" "DOC") "../etc"))
(setq name (concat (expand-file-name "../etc/DOC-") name))
***************
*** 212,218 ****
(substring name (match-end 0)))))
(if (eq system-type 'ms-dos)
(message "Dumping under the name emacs")
! (message "Dumping under names emacs and %s" name)))
(condition-case ()
(delete-file "emacs")
(file-error nil))
--- 221,231 ----
(substring name (match-end 0)))))
(if (eq system-type 'ms-dos)
(message "Dumping under the name emacs")
! (if (eq system-type 'emx)
! (message "Dumping under the name %s"
! (if (fboundp 'x-create-frame)
! "emacsx" "emacs"))
! (message "Dumping under names emacs and %s" name))))
(condition-case ()
(delete-file "emacs")
(file-error nil))
***************
*** 220,229 ****
;; confused people installing Emacs (they'd install the file
;; under the name `xemacs'), and it's inconsistent with every
;; other GNU product's build process.
! (dump-emacs "emacs" "temacs")
(message "%d pure bytes used" pure-bytes-used)
;; Recompute NAME now, so that it isn't set when we dump.
! (if (not (memq system-type '(ms-dos windows-nt)))
(let ((name (concat "emacs-" emacs-version)))
(while (string-match "[^-+_.a-zA-Z0-9]+" name)
(setq name (concat (downcase (substring name 0 (match-beginning 0)))
--- 233,245 ----
;; confused people installing Emacs (they'd install the file
;; under the name `xemacs'), and it's inconsistent with every
;; other GNU product's build process.
! (if (and (eq system-type 'emx)
! (fboundp 'x-create-frame))
! (dump-emacs "emacsx" "temacsx")
! (dump-emacs "emacs" "temacs"))
(message "%d pure bytes used" pure-bytes-used)
;; Recompute NAME now, so that it isn't set when we dump.
! (if (not (memq system-type '(ms-dos windows-nt emx)))
(let ((name (concat "emacs-" emacs-version)))
(while (string-match "[^-+_.a-zA-Z0-9]+" name)
(setq name (concat (downcase (substring name 0 (match-beginning 0)))
diff -c emacs-19\lisp\menu-bar.el:1.1.1.38 emacs-19\lisp\menu-bar.el:1.49
*** emacs-19\lisp\menu-bar.el:1.1.1.38 Sun Aug 18 23:22:24 1996
--- emacs-19\lisp\menu-bar.el Sun Aug 18 23:22:24 1996
***************
*** 1,6 ****
--- 1,7 ----
;;; menu-bar.el --- define a default menu bar.
;; Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
+ ;; Modified for emx by Eberhard Mattes, Aug 1996
;; Author: RMS
;; Keywords: internal
***************
*** 449,455 ****
(defun menu-bar-update-buffers-1 (elt)
(cons (format
! (format "%%%ds %%s%%s %%s" menu-bar-update-buffers-maxbuf)
(cdr elt)
(if (buffer-modified-p (car elt))
"*" " ")
--- 450,458 ----
(defun menu-bar-update-buffers-1 (elt)
(cons (format
! (if (eq window-system 'pm)
! "%s\t%s%s %s"
! (format "%%%ds %%s%%s %%s" menu-bar-update-buffers-maxbuf))
(cdr elt)
(if (buffer-modified-p (car elt))
"*" " ")
***************
*** 528,533 ****
--- 531,538 ----
(setq maxlen (length (car (car alist))))))
(setq tail (cdr tail)))
(setq alist (nreverse alist))
+ (if (eq window-system 'pm)
+ (setq maxlen 0))
;; Make the menu item for list-buffers
;; or reuse the one we already have.
;; The advantage in reusing one
diff -c emacs-19\lisp\mouse.el:1.1.1.37 emacs-19\lisp\mouse.el:1.20
*** emacs-19\lisp\mouse.el:1.1.1.37 Sun Aug 18 23:22:24 1996
--- emacs-19\lisp\mouse.el Sun Aug 18 23:22:24 1996
***************
*** 2,7 ****
--- 2,9 ----
;; Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
+ ;; Modified for emx by Eberhard Mattes, Aug 1996
+
;; Maintainer: FSF
;; Keywords: hardware
***************
*** 402,410 ****
;; If mark is highlighted, no need to bounce the cursor.
;; On X, we highlight while dragging, thus once again no need to bounce.
(or transient-mark-mode
! (eq (framep (selected-frame)) 'x)
! (eq (framep (selected-frame)) 'pc)
! (eq (framep (selected-frame)) 'win32)
(sit-for 1))
(push-mark)
(set-mark (point))
--- 404,410 ----
;; If mark is highlighted, no need to bounce the cursor.
;; On X, we highlight while dragging, thus once again no need to bounce.
(or transient-mark-mode
! (memq (framep (selected-frame)) '(x pc win32 pm))
(sit-for 1))
(push-mark)
(set-mark (point))
diff -c emacs-19\lisp\server.el:1.1.1.20 emacs-19\lisp\server.el:1.30
*** emacs-19\lisp\server.el:1.1.1.20 Sun Aug 18 23:22:26 1996
--- emacs-19\lisp\server.el Sun Aug 18 23:22:26 1996
***************
*** 2,7 ****
--- 2,9 ----
;; Copyright (C) 1986, 1987, 1992, 1994, 1995 Free Software Foundation, Inc.
+ ;; Modified for emx by Eberhard Mattes, Aug 1996
+
;; Author: William Sommerfeld <wesommer@athena.mit.edu>
;; Keywords: processes
***************
*** 77,82 ****
--- 79,87 ----
(defvar server-program (expand-file-name "emacsserver" exec-directory)
"*The program to use as the edit server.")
+ (defvar server-request-hook nil
+ "*List of hooks to call when processing a request for the Emacs server.")
+
(defvar server-visit-hook nil
"*List of hooks to call when visiting a file for the Emacs server.")
***************
*** 211,223 ****
(cons (list arg lineno)
files))
(setq lineno 1))))
! (server-visit-files files client)
! ;; CLIENT is now a list (CLIENTNUM BUFFERS...)
! (setq server-clients (cons client server-clients))
! (server-switch-buffer (nth 1 client))
! (run-hooks 'server-switch-hook)
! (message (substitute-command-keys
! "When done with a buffer, type \\[server-edit]")))))))
;; Save for later any partial line that remains.
(setq server-previous-string string))
--- 216,231 ----
(cons (list arg lineno)
files))
(setq lineno 1))))
! (run-hooks 'server-request-hook)
! (if (null files)
! nil
! (server-visit-files files client)
! ;; CLIENT is now a list (CLIENTNUM BUFFERS...)
! (setq server-clients (cons client server-clients))
! (server-switch-buffer (nth 1 client))
! (run-hooks 'server-switch-hook)
! (message (substitute-command-keys
! "When done with a buffer, type \\[server-edit]."))))))))
;; Save for later any partial line that remains.
(setq server-previous-string string))
diff -c emacs-19\lisp\startup.el:1.1.1.32 emacs-19\lisp\startup.el:1.28
*** emacs-19\lisp\startup.el:1.1.1.32 Sun Aug 18 23:22:26 1996
--- emacs-19\lisp\startup.el Sun Aug 18 23:22:26 1996
***************
*** 1,5 ****
--- 1,7 ----
;;; startup.el --- process Emacs shell arguments
+ ;; Modified for emx by Eberhard Mattes, Aug 1996
+
;; Copyright (C) 1985, 86, 92, 94, 95, 1996 Free Software Foundation, Inc.
;; Maintainer: FSF
***************
*** 378,384 ****
(and window-setup-hook
(run-hooks 'window-setup-hook))
(or menubar-bindings-done
! (if (or (eq window-system 'x) (eq window-system 'win32))
(precompute-menubar-bindings)))))))
;; Precompute the keyboard equivalents in the menu bar items.
--- 380,386 ----
(and window-setup-hook
(run-hooks 'window-setup-hook))
(or menubar-bindings-done
! (if (memq window-system '(x win32 pm))
(precompute-menubar-bindings)))))))
;; Precompute the keyboard equivalents in the menu bar items.
***************
*** 535,541 ****
(if (fboundp 'frame-initialize)
(frame-initialize))
;; If frame was created with a menu bar, set menu-bar-mode on.
! (if (or (not (or (eq window-system 'x) (eq window-system 'win32)))
(> (cdr (assq 'menu-bar-lines (frame-parameters))) 0))
(menu-bar-mode t))
--- 537,543 ----
(if (fboundp 'frame-initialize)
(frame-initialize))
;; If frame was created with a menu bar, set menu-bar-mode on.
! (if (or (not (memq window-system '(x win32 pm)))
(> (cdr (assq 'menu-bar-lines (frame-parameters))) 0))
(menu-bar-mode t))
***************
*** 687,693 ****
(setq window-setup-hook nil)
;; Do this now to avoid an annoying delay if the user
;; clicks the menu bar during the sit-for.
! (if (or (eq window-system 'x) (eq window-system 'win32))
(precompute-menubar-bindings))
(setq menubar-bindings-done t)
(unwind-protect
--- 689,695 ----
(setq window-setup-hook nil)
;; Do this now to avoid an annoying delay if the user
;; clicks the menu bar during the sit-for.
! (if (memq window-system '(x win32 pm))
(precompute-menubar-bindings))
(setq menubar-bindings-done t)
(unwind-protect
diff -c emacs-19\lisp\subr.el:1.1.1.33 emacs-19\lisp\subr.el:1.12
*** emacs-19\lisp\subr.el:1.1.1.33 Sun Aug 18 23:22:28 1996
--- emacs-19\lisp\subr.el Sun Aug 18 23:22:28 1996
***************
*** 1,6 ****
--- 1,7 ----
;;; subr.el --- basic lisp subroutines for Emacs
;; Copyright (C) 1985, 1986, 1992, 1994, 1995 Free Software Foundation, Inc.
+ ;; Modified for emx by Eberhard Mattes, Aug 1996
;; This file is part of GNU Emacs.
***************
*** 771,777 ****
(if (eq system-type 'ms-dos)
;; MS-DOS shells don't have quoting, so don't do any.
argument
! (if (eq system-type 'windows-nt)
(concat "\"" argument "\"")
;; Quote everything except POSIX filename characters.
;; This should be safe enough even for really weird shells.
--- 772,778 ----
(if (eq system-type 'ms-dos)
;; MS-DOS shells don't have quoting, so don't do any.
argument
! (if (memq system-type '(windows-nt emx))
(concat "\"" argument "\"")
;; Quote everything except POSIX filename characters.
;; This should be safe enough even for really weird shells.
diff -c emacs-19\lisp\tar-mode.el:1.1.1.22 emacs-19\lisp\tar-mode.el:1.11
*** emacs-19\lisp\tar-mode.el:1.1.1.22 Sun Aug 18 23:22:28 1996
--- emacs-19\lisp\tar-mode.el Sun Aug 18 23:22:28 1996
***************
*** 1,6 ****
--- 1,7 ----
;;; tar-mode.el --- simple editing of tar files from GNU emacs
;; Copyright (C) 1990, 1991, 1993, 1994, 1995 Free Software Foundation, Inc.
+ ;; Modified for emx by Eberhard Mattes, Aug 1996
;; Author: Jamie Zawinski <jwz@lucid.com>
;; Created: 04 Apr 1990
***************
*** 725,730 ****
--- 726,741 ----
(set-buffer buffer)
(insert-buffer-substring tar-buffer start end)
(goto-char 0)
+ (if (eq system-type 'emx)
+ (progn
+ (setq emx-binary-mode (emx-binary-mode-p name))
+ (or emx-binary-mode
+ (save-excursion
+ (if (not (search-forward "\r\n" nil t))
+ (setq emx-binary-mode t)
+ (replace-match "\n" t t)
+ (while (search-forward "\r\n" nil t)
+ (replace-match "\n" t t)))))))
(setq buffer-file-name
(expand-file-name (concat tarname ":" name)))
(setq buffer-file-truename
***************
*** 1071,1077 ****
(save-excursion
(let ((subfile (current-buffer))
(subfile-size (buffer-size))
! (descriptor tar-superior-descriptor))
(set-buffer tar-superior-buffer)
(let* ((tokens (tar-desc-tokens descriptor))
(start (tar-desc-data-start descriptor))
--- 1082,1091 ----
(save-excursion
(let ((subfile (current-buffer))
(subfile-size (buffer-size))
! (descriptor tar-superior-descriptor)
! binary)
! (if (eq system-type 'emx)
! (setq binary emx-binary-mode))
(set-buffer tar-superior-buffer)
(let* ((tokens (tar-desc-tokens descriptor))
(start (tar-desc-data-start descriptor))
***************
*** 1092,1097 ****
--- 1106,1120 ----
;; insert the new data...
(goto-char data-start)
(insert-buffer subfile)
+ (and (eq system-type 'emx)
+ (not binary)
+ (not (emx-binary-mode-p name))
+ (save-excursion
+ (let ((end (make-marker)))
+ (set-marker end (+ data-start subfile-size))
+ (while (search-forward "\n" end t)
+ (replace-match "\r\n" t t))
+ (setq subfile-size (- end data-start)))))
;;
;; pad the new data out to a multiple of 512...
(let ((subfile-size-pad (ash (ash (+ subfile-size 511) -9) 9)))
diff -c emacs-19\lisp\vc.el:1.1.1.34 emacs-19\lisp\vc.el:1.33
*** emacs-19\lisp\vc.el:1.1.1.34 Sun Aug 18 23:22:30 1996
--- emacs-19\lisp\vc.el Sun Aug 18 23:22:30 1996
***************
*** 1,5 ****
--- 1,7 ----
;;; vc.el --- drive a version-control system from within Emacs
+ ;; Modified for emx by Eberhard Mattes, Aug 1996
+
;; Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
***************
*** 194,199 ****
--- 196,203 ----
(defvar vc-comment-ring-index nil)
(defvar vc-last-comment-match nil)
+ (defvar vc-exec-suffix (if (eq system-type 'emx) ".exe"))
+
;; Back-portability to Emacs 18
(defun file-executable-p-18 (f)
***************
*** 369,375 ****
(function
(lambda (s)
(if s
! (let ((full (concat s "/" name)))
(if (file-executable-p full)
(progn
(setq vc-binary-assoc
--- 373,379 ----
(function
(lambda (s)
(if s
! (let ((full (concat s "/" name vc-exec-suffix)))
(if (file-executable-p full)
(progn
(setq vc-binary-assoc
diff -c emacs-19\src\Makefile.in:1.1.1.9 emacs-19\src\Makefile.in:1.16
*** emacs-19\src\Makefile.in:1.1.1.9 Sun Aug 18 23:22:42 1996
--- emacs-19\src\Makefile.in Sun Aug 18 23:22:42 1996
***************
*** 18,23 ****
--- 18,25 ----
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
+ # Modified for emx by Eberhard Mattes, Aug 1996
+
# Here are the things that we expect ../configure to edit.
srcdir=@srcdir@
VPATH=@srcdir@
***************
*** 289,295 ****
--- 291,301 ----
#ifdef HAVE_MENUS
/* Include xmenu.o in the list of X object files. */
+ #ifdef HAVE_PM
+ XOBJ= pmterm.o pmfns.o pmselect.o pmfaces.o xfaces.o
+ #else
XOBJ= xterm.o xfns.o xfaces.o xselect.o xrdb.o
+ #endif
/* The X Menu stuff is present in the X10 distribution, but missing
from X11. If we have X10, just use the installed library;
***************
*** 488,493 ****
--- 494,505 ----
#define MSDOS_OBJ
#endif
+ #ifdef EMX
+ #define EMX_OBJ emxdep.o
+ #else
+ #define EMX_OBJ
+ #endif
+
/* lastfile must follow all files
whose initialized data areas should be dumped as pure by dump-emacs. */
***************
*** 502,514 ****
abbrev.o syntax.o UNEXEC mocklisp.o bytecode.o \
process.o callproc.o \
region-cache.o \
! doprnt.o strftime.o MKTIME_OBJ GETLOADAVG_OBJ MSDOS_OBJ
/* Object files used on some machine or other.
These go in the DOC file on all machines
in case they are needed there. */
SOME_MACHINE_OBJECTS = sunfns.o dosfns.o msdos.o intervals.o textprop.o \
xterm.o xfns.o xfaces.o xmenu.o xselect.o xrdb.o
#ifdef TERMINFO
--- 514,536 ----
abbrev.o syntax.o UNEXEC mocklisp.o bytecode.o \
process.o callproc.o \
region-cache.o \
! doprnt.o strftime.o MKTIME_OBJ GETLOADAVG_OBJ MSDOS_OBJ EMX_OBJ
/* Object files used on some machine or other.
These go in the DOC file on all machines
in case they are needed there. */
+ #ifdef EMX
+ #ifdef HAVE_PM
+ SOME_MACHINE_OBJECTS = emxdep.o intervals.o textprop.o \
+ pmfaces.o pmfns.o pmselect.o pmterm.o xfaces.o xmenu.o
+ #else
+ SOME_MACHINE_OBJECTS = emxdep.o intervals.o textprop.o \
+ xterm.o xfns.o xfaces.o xmenu.o xselect.o xrdb.o
+ #endif
+ #else
SOME_MACHINE_OBJECTS = sunfns.o dosfns.o msdos.o intervals.o textprop.o \
xterm.o xfns.o xfaces.o xmenu.o xselect.o xrdb.o
+ #endif
#ifdef TERMINFO
***************
*** 597,602 ****
--- 619,630 ----
#define VMS_SUPPORT
#endif
+ #ifdef EMX
+ #define EMX_SUPPORT ${lispsource}emx-patch.elc ${lispsource}emx-funcs.elc ${lispsource}emx-keys.el
+ #else /* not EMX */
+ #define EMX_SUPPORT
+ #endif /* not EMX */
+
#ifdef MSDOS
#define MSDOS_SUPPORT ${lispsource}ls-lisp.elc ${lispsource}disp-table.elc ${lispsource}dos-fns.elc
#else
***************
*** 651,656 ****
--- 679,685 ----
${lispsource}vc-hooks.elc \
${lispsource}ediff-hook.elc \
VMS_SUPPORT \
+ EMX_SUPPORT \
MSDOS_SUPPORT \
WINNT_SUPPORT \
${lispsource}window.elc \
diff -c emacs-19\src\buffer.c:1.1.1.36 emacs-19\src\buffer.c:1.49
*** emacs-19\src\buffer.c:1.1.1.36 Sun Aug 18 23:22:44 1996
--- emacs-19\src\buffer.c Sun Aug 18 23:22:44 1996
***************
*** 19,24 ****
--- 19,25 ----
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
#include <sys/types.h>
#include <sys/stat.h>
***************
*** 454,459 ****
--- 455,464 ----
reset_buffer (b)
register struct buffer *b;
{
+ #ifdef EMX
+ b->emx_binary_mode = Qnil;
+ b->extended_attributes = Qnil;
+ #endif /* EMX */
b->filename = Qnil;
b->file_truename = Qnil;
b->directory = (current_buffer) ? current_buffer->directory : Qnil;
***************
*** 3385,3390 ****
--- 3390,3399 ----
#ifdef DOS_NT
buffer_defaults.buffer_file_type = Qnil; /* TEXT */
#endif
+ #ifdef EMX
+ buffer_defaults.emx_binary_mode = Qnil;
+ buffer_defaults.extended_attributes = Qnil;
+ #endif /* EMX */
XSETFASTINT (buffer_defaults.fill_column, 70);
XSETFASTINT (buffer_defaults.left_margin, 0);
buffer_defaults.cache_long_line_scans = Qnil;
***************
*** 3414,3419 ****
--- 3423,3432 ----
XSETINT (buffer_local_flags.file_truename, -1);
XSETINT (buffer_local_flags.invisibility_spec, -1);
XSETINT (buffer_local_flags.file_format, -1);
+ #ifdef EMX
+ XSETINT (buffer_local_flags.emx_binary_mode, -1);
+ XSETINT (buffer_local_flags.extended_attributes, -1);
+ #endif /* EMX */
XSETFASTINT (buffer_local_flags.mode_line_format, 1);
XSETFASTINT (buffer_local_flags.abbrev_mode, 2);
***************
*** 3474,3479 ****
--- 3487,3493 ----
Fset_buffer (Fget_buffer_create (build_string ("*scratch*")));
+ #ifndef EMX
/* If PWD is accurate, use it instead of calling getwd. This is faster
when PWD is right, and may avoid a fatal error. */
if ((pwd = getenv ("PWD")) != 0 && IS_DIRECTORY_SEP (*pwd)
***************
*** 3485,3490 ****
--- 3499,3509 ----
strcpy (buf, pwd);
else if (getwd (buf) == 0)
fatal ("`getwd' failed: %s\n", buf);
+ #else /* EMX */
+ if (_getcwd2 (buf, MAXPATHLEN) == 0)
+ fatal ("`_getcwd2' failed\n");
+ _nls_strlwr (buf);
+ #endif /* EMX */
#ifndef VMS
/* Maybe this should really use some standard subroutine
***************
*** 3985,3990 ****
--- 4004,4022 ----
DEFVAR_LISP ("kill-buffer-query-functions", &Vkill_buffer_query_functions,
"List of functions called with no args to query before killing a buffer.");
Vkill_buffer_query_functions = Qnil;
+
+ #ifdef EMX
+ DEFVAR_PER_BUFFER ("emx-binary-mode", ¤t_buffer->emx_binary_mode, Qnil,
+ "*Non-nil means read and write files in `binary mode'.\n\
+ nil means use `text mode'. This variable is emx-specific.\n\
+ Automatically becomes buffer-local when set in any fashion.");
+
+ DEFVAR_PER_BUFFER ("extended-attributes",
+ ¤t_buffer->extended_attributes, Qnil,
+ "Extended attributes of buffer visited by current buffer.\n\
+ This variable is emx-specific. Automatically becomes buffer-local\n\
+ when set in any fashion.");
+ #endif /* EMX */
defsubr (&Sbuffer_live_p);
defsubr (&Sbuffer_list);
diff -c emacs-19\src\buffer.h:1.1.1.12 emacs-19\src\buffer.h:1.18
*** emacs-19\src\buffer.h:1.1.1.12 Sun Aug 18 23:22:44 1996
--- emacs-19\src\buffer.h Sun Aug 18 23:22:44 1996
***************
*** 18,23 ****
--- 18,25 ----
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
+
#ifdef USE_TEXT_PROPERTIES
#define SET_PT(position) (set_point ((position), current_buffer))
***************
*** 308,313 ****
--- 310,321 ----
/* nil: text, t: binary.
This value is meaningful only on certain operating systems. */
Lisp_Object buffer_file_type;
+ #ifdef EMX
+ /* nil: text mode, t: binary mode. */
+ Lisp_Object emx_binary_mode;
+ /* Extended attributes. */
+ Lisp_Object extended_attributes;
+ #endif /* EMX */
/* Case table for case-conversion in this buffer.
This char-table maps each char into its lower-case version. */
diff -c emacs-19\src\callproc.c:1.1.1.27 emacs-19\src\callproc.c:1.52
*** emacs-19\src\callproc.c:1.1.1.27 Sun Aug 18 23:22:46 1996
--- emacs-19\src\callproc.c Sun Aug 18 23:22:46 1996
***************
*** 18,23 ****
--- 18,24 ----
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
#include <signal.h>
#include <errno.h>
***************
*** 84,89 ****
--- 85,97 ----
#define max(a, b) ((a) > (b) ? (a) : (b))
+ #ifdef EMX
+ extern Lisp_Object find_program_name_handler ();
+ extern Lisp_Object Qprogram_name_handler_alist;
+ extern Lisp_Object Vprogram_name_handler_alist;
+ static Lisp_Object Qcall_process;
+ #endif /* EMX */
+
#ifdef DOS_NT
/* When we are starting external processes we need to know whether they
take binary input (no conversion) or text input (\n is converted to
***************
*** 220,225 ****
--- 228,247 ----
#endif
CHECK_STRING (args[0], 0);
+ #ifdef EMX
+ {
+ Lisp_Object handler;
+
+ handler = find_program_name_handler (args[0]);
+ if (!NILP (handler))
+ return call3 (handler,
+ Fcons (Qcall_process, Flist (3, args + 1)),
+ args[0],
+ nargs >= 5 ? Flist (nargs - 4, args + 4) : Qnil);
+ }
+ check_process_priority ();
+ #endif /* EMX */
+
error_file = Qt;
#ifndef subprocesses
***************
*** 363,368 ****
--- 385,393 ----
{
#ifndef MSDOS
pipe (fd);
+ #ifdef EMX
+ emx_proc_output_pipe (fd[0]);
+ #endif /* EMX */
#endif
#if 0
/* Replaced by close_process_descs */
***************
*** 450,455 ****
--- 475,485 ----
#ifdef WINDOWSNT
pid = child_setup (filefd, fd1, fd_error, new_argv, 0, current_dir);
#else /* not WINDOWSNT */
+ #ifdef EMX
+ if (fd[0] >= 0)
+ fcntl (fd[0], F_SETFD, 1);
+ pid = emx_child_setup (filefd, fd1, fd_error, new_argv, 0, current_dir);
+ #else /* not EMX */
pid = vfork ();
if (pid == 0)
***************
*** 463,468 ****
--- 493,499 ----
#endif /* USG */
child_setup (filefd, fd1, fd_error, new_argv, 0, current_dir);
}
+ #endif /* not EMX */
#endif /* not WINDOWSNT */
/* The MSDOS case did this already. */
***************
*** 483,489 ****
--- 514,524 ----
{
if (fd[0] >= 0)
close (fd[0]);
+ #ifndef EMX
report_file_error ("Doing vfork", Qnil);
+ #else /* EMX */
+ report_file_error ("Running process", Qnil);
+ #endif
}
if (INTEGERP (buffer))
***************
*** 600,608 ****
--- 635,649 ----
delete_temp_file (name)
Lisp_Object name;
{
+ #ifndef EMX
/* Use Fdelete_file (indirectly) because that runs a file name handler.
We did that when writing the file, so we should do so when deleting. */
internal_delete_file (name);
+ #else /* EMX */
+ /* TODO: call file name handler, see above. */
+ if (unlink (XSTRING (name)->data) != 0 && errno == EACCES)
+ emx_async_delete_add (XSTRING (name)->data);
+ #endif /* EMX */
}
DEFUN ("call-process-region", Fcall_process_region, Scall_process_region,
***************
*** 635,641 ****
--- 676,686 ----
#ifdef DOS_NT
char *tempfile;
#else
+ #ifndef EMX
char tempfile[20];
+ #else /* EMX */
+ char tempfile[260];
+ #endif /* EMX */
#endif
int count = specpdl_ptr - specpdl;
#ifdef DOS_NT
***************
*** 661,671 ****
--- 706,728 ----
#endif
#else /* not DOS_NT */
+ #ifdef EMX
+ extern char *tempnam ();
+ char *t = tempnam ("/tmp", "em");
+ if (t)
+ {
+ strcpy (tempfile, t);
+ free (t);
+ }
+ else
+ strcpy (tempfile, "/tmp/emXXXXXX");
+ #else /* not EMX */
#ifdef VMS
strcpy (tempfile, "tmp:emacsXXXXXX.");
#else
strcpy (tempfile, "/tmp/emacsXXXXXX");
#endif
+ #endif /* not EMX */
#endif /* not DOS_NT */
mktemp (tempfile);
***************
*** 693,698 ****
--- 750,756 ----
}
#ifndef VMS /* VMS version is in vmsproc.c. */
+ #ifndef EMX /* emx version is in emxdep.c */
/* This is the last thing run in a newly forked inferior
either synchronous or asynchronous.
***************
*** 934,939 ****
--- 992,999 ----
}
}
+ #endif /* not EMX */
+
static int
getenv_internal (var, varlen, value, valuelen)
char *var;
***************
*** 1037,1044 ****
--- 1097,1109 ----
{
/* Add to the path the lib-src subdir of the installation dir. */
Lisp_Object tem;
+ #ifdef EMX
+ tem = Fexpand_file_name (build_string ("bin"),
+ Vinstallation_directory);
+ #else /* not EMX */
tem = Fexpand_file_name (build_string ("lib-src"),
Vinstallation_directory);
+ #endif /* not EMX */
if (NILP (Fmember (tem, Vexec_path)))
{
#ifndef DOS_NT
***************
*** 1051,1059 ****
--- 1116,1132 ----
/* Maybe use ../etc as well as ../lib-src. */
if (data_dir == 0)
{
+ #ifdef EMX
+ tem = Fexpand_file_name (build_string ("data"),
+ Vinstallation_directory);
+ #else /* not EMX */
tem = Fexpand_file_name (build_string ("etc"),
Vinstallation_directory);
+ #endif /* not EMX */
Vdoc_directory = Ffile_name_as_directory (tem);
+ #ifdef EMX
+ Vdata_directory = Vdoc_directory;
+ #endif /* EMX */
}
}
***************
*** 1122,1127 ****
--- 1195,1204 ----
syms_of_callproc ()
{
+ #ifdef EMX
+ Qcall_process = intern ("call-process");
+ staticpro (&Qcall_process);
+ #endif /* EMX */
#ifdef DOS_NT
Qbuffer_file_type = intern ("buffer-file-type");
staticpro (&Qbuffer_file_type);
diff -c emacs-19\src\cmds.c:1.1.1.22 emacs-19\src\cmds.c:1.19
*** emacs-19\src\cmds.c:1.1.1.22 Sun Aug 18 23:22:46 1996
--- emacs-19\src\cmds.c Sun Aug 18 23:22:46 1996
***************
*** 18,23 ****
--- 18,24 ----
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
#include <config.h>
#include "lisp.h"
***************
*** 422,427 ****
--- 423,432 ----
for (n = 0200; n < 0240; n++)
initial_define_key (global_map, n, "self-insert-command");
#endif
+ #ifdef EMX
+ for (n = 0200; n < 0240; n++)
+ initial_define_key (global_map, n, "self-insert-command");
+ #endif /* EMX */
for (n = 0240; n < 0400; n++)
initial_define_key (global_map, n, "self-insert-command");
diff -c emacs-19\src\dired.c:1.1.1.19 emacs-19\src\dired.c:1.30
*** emacs-19\src\dired.c:1.1.1.19 Sun Aug 18 23:22:46 1996
--- emacs-19\src\dired.c Sun Aug 18 23:22:46 1996
***************
*** 18,23 ****
--- 18,24 ----
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
#include <config.h>
***************
*** 368,377 ****
--- 369,383 ----
XSTRING (file)->size))
continue;
+ #ifdef EMX
+ /* Speed hack. */
+ directoryp = (dp->d_attr & 0x10);
+ #else /* not EMX */
if (file_name_completion_stat (dirname, dp, &st) < 0)
continue;
directoryp = ((st.st_mode & S_IFMT) == S_IFDIR);
+ #endif /* not EMX */
tem = Qnil;
if (directoryp)
{
***************
*** 646,651 ****
--- 652,660 ----
if (lstat (XSTRING (filename)->data, &s) < 0)
return Qnil;
+ #ifdef EMX
+ s.st_uid = getuid ();
+ #endif /* not EMX */
switch (s.st_mode & S_IFMT)
{
default:
diff -c emacs-19\src\dispextern.h:1.1.1.10 emacs-19\src\dispextern.h:1.27
*** emacs-19\src\dispextern.h:1.1.1.10 Sun Aug 18 23:22:46 1996
--- emacs-19\src\dispextern.h Sun Aug 18 23:22:46 1996
***************
*** 18,23 ****
--- 18,25 ----
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
+
#ifndef _DISPEXTERN_H_
#define _DISPEXTERN_H_
***************
*** 26,32 ****
--- 28,39 ----
extern int display_completed;
#ifdef HAVE_X_WINDOWS
+ #ifndef HAVE_PM
#include <X11/Xlib.h>
+ #else /* HAVE_PM */
+ #include "pmlib.h"
+ #endif /* HAVE_PM */
+
#endif
#ifdef MSDOS
diff -c emacs-19\src\dispnew.c:1.1.1.35 emacs-19\src\dispnew.c:1.51
*** emacs-19\src\dispnew.c:1.1.1.35 Sun Aug 18 23:22:46 1996
--- emacs-19\src\dispnew.c Sun Aug 18 23:22:46 1996
***************
*** 18,23 ****
--- 18,24 ----
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
#include <signal.h>
***************
*** 46,54 ****
--- 47,63 ----
#include "syssignal.h"
#ifdef HAVE_X_WINDOWS
+ #ifndef HAVE_PM
#include "xterm.h"
+ #else /* HAVE_PM */
+ #include "pmterm.h"
+ #endif /* HAVE_PM */
#endif /* HAVE_X_WINDOWS */
+ #ifdef EMX
+ extern void emx_resize_vio (int *pheight, int *pwidth);
+ #endif /* EMX */
+
#ifdef HAVE_NTGUI
#include "w32term.h"
#endif /* HAVE_NTGUI */
***************
*** 104,109 ****
--- 113,122 ----
int baud_rate;
+ /* Minimum length of a run of matching characters to be skipped in output. */
+
+ int min_skip_run = 1;
+
/* nil or a symbol naming the window system under which emacs is
running ('x is the only current possibility). */
***************
*** 562,567 ****
--- 575,589 ----
/* Like bcopy except never gets confused by overlap. */
+ #ifdef EMX
+ void
+ safe_bcopy (from, to, size)
+ char *from, *to;
+ int size;
+ {
+ bcopy (from, to, size);
+ }
+ #else /* not EMX */
void
safe_bcopy (from, to, size)
char *from, *to;
***************
*** 614,619 ****
--- 636,642 ----
}
}
}
+ #endif /* not EMX */
/* Rotate a vector of SIZE bytes right, by DISTANCE bytes.
DISTANCE may be negative. */
***************
*** 1672,1678 ****
/* If there's no i/d char, quickly do the best we can without it. */
if (!char_ins_del_ok)
{
! int i,j;
#if 0
if (FRAME_X_P (frame))
--- 1695,1701 ----
/* If there's no i/d char, quickly do the best we can without it. */
if (!char_ins_del_ok)
{
! int i,j,k,more;
#if 0
if (FRAME_X_P (frame))
***************
*** 1698,1706 ****
if (i >= olen || nbody[i] != obody[i]) /* A non-matching char. */
{
cursor_to (vpos, i);
! for (j = 1; (i + j < nlen &&
! (i + j >= olen || nbody[i+j] != obody[i+j]));
! j++);
/* Output this run of non-matching chars. */
write_glyphs (nbody + i, j);
--- 1721,1745 ----
if (i >= olen || nbody[i] != obody[i]) /* A non-matching char. */
{
cursor_to (vpos, i);
! j = 1;
! do
! {
! more = 0;
! while (i + j < nlen
! && (i + j >= olen || nbody[i+j] != obody[i+j]))
! j++;
! /* Include matching chars in the run unless there
! are min_skip_run or more consecutive matching chars
! or no non-matching chars follow. */
! for (k = j; (i + k < nlen &&
! !(i + k >= olen || nbody[i+k] != obody[i+k]));
! k++);
! if (k != j && k - j < min_skip_run
! && (i + k >= olen || nbody[i+k] != obody[i+k]))
! {
! j = k; more = 1;
! }
! } while (more);
/* Output this run of non-matching chars. */
write_glyphs (nbody + i, j);
***************
*** 2140,2145 ****
--- 2179,2190 ----
/* Round up to the smallest acceptable size. */
check_frame_size (frame, &newheight, &newwidth);
+ #ifdef EMX
+ /* Try to resize the VIO window. */
+ if (FRAME_TERMCAP_P (frame) && !pretend)
+ emx_resize_vio (&newheight, &newwidth);
+ #endif /* EMX */
+
/* If we're not changing the frame size, quit now. */
if (newheight == FRAME_HEIGHT (frame)
&& newwidth == FRAME_WIDTH (frame))
***************
*** 2490,2495 ****
--- 2535,2547 ----
try to use X, and die with an error message if that doesn't work. */
#ifdef HAVE_X_WINDOWS
+ #ifdef HAVE_PM
+ if (!inhibit_window_system && display_arg)
+ {
+ Vwindow_system = intern ("pm");
+ return;
+ }
+ #else /* not HAVE_PM */
if (! display_arg)
{
char *display;
***************
*** 2501,2506 ****
--- 2553,2559 ----
display_arg = (display != 0 && *display != 0);
}
+ #endif /* not HAVE_PM */
if (!inhibit_window_system && display_arg)
{
***************
*** 2640,2645 ****
--- 2693,2702 ----
"Display table to use for buffers that specify none.\n\
See `buffer-display-table' for more information.");
Vstandard_display_table = Qnil;
+
+ DEFVAR_INT ("min-skip-run", &min_skip_run,
+ "Minimum run length required for skipping matching characters in output.\n\
+ This is used for tuning output.");
/* Initialize `window-system', unless init_display already decided it. */
#ifdef CANNOT_DUMP
diff -c emacs-19\src\doc.c:1.1.1.18 emacs-19\src\doc.c:1.28
*** emacs-19\src\doc.c:1.1.1.18 Sun Aug 18 23:22:48 1996
--- emacs-19\src\doc.c Sun Aug 18 23:22:48 1996
***************
*** 18,23 ****
--- 18,24 ----
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
#include <config.h>
***************
*** 135,141 ****
--- 136,146 ----
name = (char *) XSTRING (file)->data;
}
+ #ifdef EMX
+ fd = open (name, O_RDONLY | O_BINARY, 0);
+ #else /* not EMX */
fd = open (name, O_RDONLY, 0);
+ #endif /* not EMX */
if (fd < 0)
{
#ifndef CANNOT_DUMP
***************
*** 456,462 ****
--- 461,471 ----
#endif /* VMS4_4 */
#endif /* VMS */
+ #ifdef EMX
+ fd = open (name, O_RDONLY | O_BINARY, 0);
+ #else /* not EMX */
fd = open (name, O_RDONLY, 0);
+ #endif /* not EMX */
if (fd < 0)
report_file_error ("Opening doc string file",
Fcons (build_string (name), Qnil));
diff -c emacs-19\src\editfns.c:1.1.1.36 emacs-19\src\editfns.c:1.39
*** emacs-19\src\editfns.c:1.1.1.36 Sun Aug 18 23:22:48 1996
--- emacs-19\src\editfns.c Sun Aug 18 23:22:48 1996
***************
*** 18,23 ****
--- 18,24 ----
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
#include <sys/types.h>
***************
*** 107,113 ****
--- 108,120 ----
if (NILP (tem))
pw = (struct passwd *) getpwnam (XSTRING (Vuser_login_name)->data);
+ #ifndef EMX
p = (unsigned char *) (pw ? USER_FULL_NAME : "unknown");
+ #else /* EMX */
+ p = (unsigned char *) getenv("USERFULLNAME");
+ if (!p)
+ p = (unsigned char *) (pw ? USER_FULL_NAME : "unknown");
+ #endif /* EMX */
q = (unsigned char *) index (p, ',');
Vuser_full_name = make_string (p, q ? q - p : strlen (p));
diff -c emacs-19\src\emacs.c:1.1.1.34 emacs-19\src\emacs.c:1.66
*** emacs-19\src\emacs.c:1.1.1.34 Sun Aug 18 23:22:48 1996
--- emacs-19\src\emacs.c Sun Aug 18 23:22:48 1996
***************
*** 18,23 ****
--- 18,24 ----
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
#include <signal.h>
#include <errno.h>
***************
*** 166,171 ****
--- 167,186 ----
shut_down_emacs (sig, 0, Qnil);
}
+ #ifdef EMX
+
+ /* Simply returning will cause a core dump for fatal signals; that's
+ what we want. If we called kill(), the core dump would not be
+ very helpful, because the stack backtrace would not work (we are
+ in a signal handler!). On the other hand, SIGKILL is sent by
+ another process and we don't want to continue after delivery of
+ SIGKILL. */
+ #ifndef POSIX_SIGNALS
+ signal (fatal_error_code, SIG_ACK);
+ #endif
+ if (fatal_error_code != SIGKILL && fatal_error_code != SIGTERM)
+ return;
+ #endif /* EMX */
#ifdef VMS
LIB$STOP (SS$_ABORT);
#else
***************
*** 180,185 ****
--- 195,213 ----
#endif /* not VMS */
}
+ #ifdef EMX
+ SIGTYPE
+ break_signal (sig)
+ int sig;
+ {
+ #ifndef POSIX_SIGNALS
+ signal (sig, SIG_ACK);
+ #endif
+ Vquit_flag = Qt;
+ raise (SIGINT);
+ }
+ #endif /* EMX */
+
#ifdef SIGDANGER
/* Handler for SIGDANGER. */
***************
*** 244,249 ****
--- 272,284 ----
not including lisp and info. */
tem = Fexpand_file_name (build_string ("lib-src"), dir);
lib_src_exists = Ffile_exists_p (tem);
+ #ifdef EMX
+ if (NILP (lib_src_exists))
+ {
+ tem = Fexpand_file_name (build_string ("bin"), dir);
+ lib_src_exists = Ffile_exists_p (tem);
+ }
+ #endif /* EMX */
if (!NILP (lib_src_exists))
{
tem = Fexpand_file_name (build_string ("etc"), dir);
***************
*** 259,264 ****
--- 294,306 ----
/* See if dir's parent contains those subdirs. */
tem = Fexpand_file_name (build_string ("../lib-src"), dir);
lib_src_exists = Ffile_exists_p (tem);
+ #ifdef EMX
+ if (NILP (lib_src_exists))
+ {
+ tem = Fexpand_file_name (build_string ("../bin"), dir);
+ lib_src_exists = Ffile_exists_p (tem);
+ }
+ #endif /* EMX */
if (!NILP (lib_src_exists))
{
tem = Fexpand_file_name (build_string ("../etc"), dir);
***************
*** 430,435 ****
--- 472,482 ----
extern int errno;
extern sys_nerr;
+ #ifdef EMX
+ /* Expand wildcards on the command line. */
+ _wildcard (&argc, &argv);
+ #endif /* EMX */
+
#ifdef LINUX_SBRK_BUG
__sbrk (1);
#endif
***************
*** 478,483 ****
--- 525,535 ----
}
#endif /* NeXT */
+ #ifdef EMX
+ emx_setup ();
+ _nls_init (); /* Call before emx_exec_name! */
+ emx_exec_name (&argv[0]);
+ #endif /* EMX */
#ifdef VMS
/* If -map specified, map the data file in */
{
***************
*** 607,612 ****
--- 659,669 ----
exit (0);
}
+ #ifdef HAVE_PM
+ if (argmatch (argv, argc, "-pm", "--pm", 4, NULL, &skip_args))
+ display_arg = 1;
+ #endif /* HAVE_PM */
+
#ifdef HAVE_X_WINDOWS
/* Stupid kludge to catch command-line display spec. We can't
handle this argument entirely in window system dependent code
***************
*** 649,654 ****
--- 706,721 ----
}
#endif
+ #ifdef EMX
+ if (!display_arg || inhibit_window_system)
+ {
+ static char pid[40];
+
+ sprintf (pid, "EMACS_PID=%d", getpid ());
+ putenv (pid);
+ }
+ #endif /* EMX */
+
if (! noninteractive)
{
#ifdef BSD_PGRPS
***************
*** 758,763 ****
--- 825,833 ----
signal (SIGSOUND, fatal_error_signal);
signal (SIGMSG, fatal_error_signal);
#endif /* AIX */
+ #ifdef EMX
+ signal (SIGBREAK, break_signal);
+ #endif /* EMX */
}
noninteractive1 = noninteractive;
***************
*** 1027,1032 ****
--- 1097,1105 ----
{ "-t", "--terminal", 90, 1 },
{ "-d", "--display", 80, 1 },
{ "-display", 0, 80, 1 },
+ #ifdef HAVE_PM
+ { "-pm", "--pm", 80, 0 },
+ #endif /* HAVE_PM */
{ "-nw", "--no-windows", 70, 0 },
{ "-batch", "--batch", 60, 0 },
{ "-q", "--no-init-file", 50, 0 },
***************
*** 1310,1315 ****
--- 1383,1402 ----
#endif /* HAVE_X_WINDOWS */
#endif
+ #ifdef HAVE_PM
+ /* Under OS/2, however, pmemacs.exe is better than the Presentation
+ Manager at closing multiple windows at once. */
+ #ifdef HAVE_X_WINDOWS
+ /* It's not safe to call intern here. Maybe we are crashing. */
+ if (!noninteractive && SYMBOLP (Vwindow_system)
+ && XSYMBOL (Vwindow_system)->name->size == 2
+ && XSYMBOL (Vwindow_system)->name->data[0] == 'p'
+ && XSYMBOL (Vwindow_system)->name->data[1] == 'm'
+ && ! no_x)
+ pm_shutdown ();
+ #endif /* HAVE_X_WINDOWS */
+ #endif /* HAVE_PM */
+
#ifdef SIGIO
/* There is a tendency for a SIGIO signal to arrive within exit,
and cause a SIGHUP because the input descriptor is already closed. */
***************
*** 1437,1442 ****
--- 1524,1540 ----
path = (char *) getenv (evarname);
else
path = 0;
+ #ifdef EMX
+ if (path)
+ {
+ char *p = path;
+ path = alloca (strlen (p) + 1);
+ strcpy (path, p);
+ for (p = path; *p != 0; ++p)
+ if (*p == '\\')
+ *p = '/';
+ }
+ #endif /* EMX */
if (!path)
path = defalt;
lpath = Qnil;
diff -c emacs-19\src\fileio.c:1.1.1.35 emacs-19\src\fileio.c:1.72
*** emacs-19\src\fileio.c:1.1.1.35 Sun Aug 18 23:22:50 1996
--- emacs-19\src\fileio.c Sun Aug 18 23:22:50 1996
***************
*** 18,23 ****
--- 18,25 ----
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
+
#include <config.h>
#include <sys/types.h>
***************
*** 130,135 ****
--- 132,156 ----
#endif
#endif
+ #ifdef EMX
+ #include <stdlib.h>
+ #include <fcntl.h>
+ #include <sys/ead.h>
+ extern Lisp_Object Femx_binary_mode_p ();
+ extern Lisp_Object emx_expand_file_name ();
+ extern Lisp_Object emx_get_original_case_string ();
+ static unsigned long emx_size (Lisp_Object, Lisp_Object, Lisp_Object, int);
+ void emx_fix_longname (const char *fname);
+ void emx_fix_ead_longname (_ead ead, const char *fname);
+ extern int fb_start (int fd, off_t *size);
+ extern int fb_close ();
+ extern long fb_lseek ();
+ extern int fb_read ();
+ #define close(a) fb_close (a)
+ #define lseek(a,b,c) fb_lseek (a, b, c)
+ #define read(a,b,c) fb_read (a, b, c)
+ #endif /* EMX */
+
#ifndef O_WRONLY
#define O_WRONLY 1
#endif
***************
*** 687,693 ****
#else
if (slen > 1
&& IS_DIRECTORY_SEP (dst[slen - 1])
! #ifdef DOS_NT
&& !IS_ANY_SEP (dst[slen - 2])
#endif
)
--- 708,714 ----
#else
if (slen > 1
&& IS_DIRECTORY_SEP (dst[slen - 1])
! #if defined (DOS_NT) || defined (EMX)
&& !IS_ANY_SEP (dst[slen - 2])
#endif
)
***************
*** 745,750 ****
--- 766,805 ----
Lisp_Object prefix;
{
Lisp_Object val;
+ #ifdef EMX
+ char drv_name[3], fsname[64], *p, *q;
+ int i, drive;
+
+ /* Check if PREFIX is on an HPFS drive. */
+
+ CHECK_STRING (prefix, 0);
+ p = XSTRING (prefix)->data;
+ drive = _fngetdrive (p);
+ if (drive == 0)
+ drive = _getdrive ();
+ drv_name[0] = (char)drive;
+ drv_name[1] = ':';
+ drv_name[2] = 0;
+ if (_filesys (drv_name, fsname, sizeof (fsname)) != 0
+ || strcmp (fsname, "HPFS") != 0)
+ {
+ /* It's not on an HPFS drive. Keep only the first two
+ characters of the last component of PREFIX to restrict the
+ length of the last component to 8 characters. */
+
+ q = p;
+ while (*p != 0)
+ {
+ if (IS_DIRECTORY_SEP (*p) || *p == ':')
+ q = p + 1;
+ ++p;
+ }
+ p = XSTRING (prefix)->data;
+ i = q - p;
+ if (XSTRING (prefix)->size - i > 2)
+ prefix = make_string (XSTRING (prefix)->data, i + 2);
+ }
+ #endif /* EMX */
#ifdef MSDOS
/* Don't use too many characters of the restricted 8+3 DOS
filename space. */
***************
*** 860,865 ****
--- 915,931 ----
name = FILE_SYSTEM_CASE (name);
#endif
+ #ifdef EMX
+ {
+ Lisp_Object tem;
+ tem = emx_expand_file_name (name,
+ (!NILP (default_directory) ? default_directory
+ : current_buffer->directory));
+ if (!NILP (tem))
+ return tem;
+ }
+ #endif /* EMX */
+
nm = XSTRING (name)->data;
#ifdef DOS_NT
***************
*** 1782,1787 ****
--- 1848,1859 ----
for (p = nm; p != endp; p++)
{
+ #ifdef EMX
+ if (p != nm && IS_DIRECTORY_SEP (p[-1])
+ && (p[0] == '~'
+ || _fngetdrive (p)
+ || (IS_DIRECTORY_SEP (p[0]) && p - 1 != nm)))
+ #else /* not EMX */
if ((p[0] == '~'
#if defined (APOLLO) || defined (WINDOWSNT)
/* // at start of file name is meaningful in Apollo and
***************
*** 1797,1802 ****
--- 1869,1875 ----
|| p[-1] == ':' || p[-1] == ']' || p[-1] == '>'
#endif /* VMS */
|| IS_DIRECTORY_SEP (p[-1])))
+ #endif /* not EMX */
{
nm = p;
substituted = 1;
***************
*** 1922,1927 ****
--- 1995,2006 ----
/* If /~ or // appears, discard everything through first slash. */
for (p = xnm; p != x; p++)
+ #ifdef EMX
+ if (p != xnm && IS_DIRECTORY_SEP (p[-1])
+ && (p[0] == '~'
+ || _fngetdrive (p)
+ || (IS_DIRECTORY_SEP (p[0]) && p - 1 != xnm)))
+ #else /* not EMX */
if ((p[0] == '~'
#if defined (APOLLO) || defined (WINDOWSNT)
|| (IS_DIRECTORY_SEP (p[0]) && p - 1 != xnm)
***************
*** 1930,1935 ****
--- 2009,2015 ----
#endif /* not (APOLLO || WINDOWSNT) */
)
&& p != nm && IS_DIRECTORY_SEP (p[-1]))
+ #endif /* not EMX */
xnm = p;
#ifdef DOS_NT
else if (IS_DRIVE (p[0]) && p[1] == ':'
***************
*** 2061,2066 ****
--- 2141,2151 ----
RETURN_UNGCPRO (call5 (handler, Qcopy_file, file, newname,
ok_if_already_exists, keep_date));
+ #ifdef EMX
+ file = emx_get_original_case_string (file);
+ newname = emx_get_original_case_string (newname);
+ #endif /* EMX */
+
if (NILP (ok_if_already_exists)
|| INTEGERP (ok_if_already_exists))
barf_or_query_if_file_exists (newname, "copy to it",
***************
*** 2071,2076 ****
--- 2156,2164 ----
ifd = open (XSTRING (file)->data, O_RDONLY);
if (ifd < 0)
report_file_error ("Opening input file", Fcons (file, Qnil));
+ #ifdef EMX
+ setmode (ifd, O_BINARY);
+ #endif /* EMX */
record_unwind_protect (close_file_unwind, make_number (ifd));
***************
*** 2106,2117 ****
--- 2194,2211 ----
/* Create the copy file with the same record format as the input file */
ofd = sys_creat (XSTRING (newname)->data, 0666, ifd);
#else
+ #ifdef EMX
+ ofd = open (XSTRING (newname)->data,
+ O_WRONLY | O_TRUNC | O_CREAT | O_BINARY | O_SIZE, 0666,
+ (unsigned long)(input_file_statable_p ? st.st_size : 0));
+ #else /* not EMX */
#ifdef MSDOS
/* System's default file type was set to binary by _fmode in emacs.c. */
ofd = creat (XSTRING (newname)->data, S_IREAD | S_IWRITE);
#else /* not MSDOS */
ofd = creat (XSTRING (newname)->data, 0666);
#endif /* not MSDOS */
+ #endif /* not EMX */
#endif /* VMS */
if (ofd < 0)
report_file_error ("Opening output file", Fcons (newname, Qnil));
***************
*** 2153,2158 ****
--- 2247,2269 ----
#endif /* MSDOS */
}
+ #ifdef EMX
+ /* Copy extended attributes. */
+ if (_osmode == OS2_MODE)
+ {
+ _ead ead = _ead_create ();
+ if (ead != NULL)
+ {
+ if (_ead_read (ead, NULL, ifd, 0) == 0)
+ {
+ emx_fix_ead_longname (ead, XSTRING (newname)->data);
+ _ead_write (ead, XSTRING (newname)->data, -1, 0);
+ }
+ _ead_destroy (ead);
+ }
+ }
+ #endif /* EMX */
+
close (ifd);
/* Discard the unwind protects. */
***************
*** 2264,2269 ****
--- 2375,2384 ----
#endif
Lisp_Object handler;
struct gcpro gcpro1, gcpro2;
+ #ifdef EMX
+ Lisp_Object file1, newname1;
+ int rc;
+ #endif /* EMX */
GCPRO2 (file, newname);
CHECK_STRING (file, 0);
***************
*** 2282,2295 ****
--- 2397,2427 ----
if (NILP (ok_if_already_exists)
|| INTEGERP (ok_if_already_exists))
+ #ifdef EMX
+ if (NILP (Fstring_equal (file, newname)))
+ #endif /* EMX */
barf_or_query_if_file_exists (newname, "rename to it",
INTEGERP (ok_if_already_exists), 0);
+ #ifdef EMX
+ file1 = file; newname1 = newname;
+ file = emx_get_original_case_string (file);
+ newname = emx_get_original_case_string (newname);
+ rc = rename (XSTRING (file)->data, XSTRING (newname)->data);
+ if (rc < 0 && (errno == EEXIST || errno == EACCES)
+ && NILP (Fstring_equal (file1, newname1)))
+ {
+ remove (XSTRING (newname)->data);
+ rc = rename (XSTRING (file)->data, XSTRING (newname)->data);
+ }
+ if (rc < 0)
+ #else /* not EMX */
#ifndef BSD4_1
if (0 > rename (XSTRING (file)->data, XSTRING (newname)->data))
#else
if (0 > link (XSTRING (file)->data, XSTRING (newname)->data)
|| 0 > unlink (XSTRING (file)->data))
#endif
+ #endif /* not EMX */
{
if (errno == EXDEV)
{
***************
*** 2310,2315 ****
--- 2442,2451 ----
report_file_error ("Renaming", Flist (2, &file));
#endif
}
+ #ifdef EMX
+ else if (_osmode == OS2_MODE)
+ emx_fix_longname (XSTRING (newname)->data);
+ #endif /* EMX */
UNGCPRO;
return Qnil;
}
***************
*** 2516,2521 ****
--- 2652,2661 ----
#ifdef DOS_NT
|| (IS_DRIVE (*ptr) && ptr[1] == ':' && IS_DIRECTORY_SEP (ptr[2]))
#endif
+ #ifdef EMX
+ || *ptr == '\\'
+ || (_fngetdrive (ptr) && IS_DIRECTORY_SEP (ptr[2]))
+ #endif /* EMX */
)
return Qt;
else
***************
*** 2528,2533 ****
--- 2668,2679 ----
check_executable (filename)
char *filename;
{
+ #ifdef EMX
+ struct stat st;
+ if (stat (filename, &st) < 0)
+ return 0;
+ return (st.st_mode & S_IXUSR) ? 1 : 0;
+ #else /* not EMX */
#ifdef DOS_NT
int len = strlen (filename);
char *suffix;
***************
*** 2554,2559 ****
--- 2700,2706 ----
return (access (filename, 1) >= 0);
#endif
#endif /* not DOS_NT */
+ #endif /* not EMX */
}
/* Return nonzero if file FILENAME exists and can be written. */
***************
*** 2644,2649 ****
--- 2791,2800 ----
if (!NILP (handler))
return call2 (handler, Qfile_readable_p, absname);
+ #ifdef EMX
+ /* Cannot open directories with open(). */
+ return (access (XSTRING (absname)->data, 4) >= 0) ? Qt : Qnil;
+ #else /* not EMX */
#ifdef DOS_NT
/* Under MS-DOS and Windows, open does not work for directories. */
if (access (XSTRING (absname)->data, 0) == 0)
***************
*** 2656,2661 ****
--- 2807,2813 ----
close (desc);
return Qt;
#endif /* not DOS_NT */
+ #endif /* not EMX */
}
/* Having this before file-symlink-p mysteriously caused it to be forgotten
***************
*** 3050,3055 ****
--- 3202,3214 ----
if ((fd = open (XSTRING (filename)->data, O_RDONLY)) < 0)
goto badopen;
+ #ifdef EMX
+ if (NILP (current_buffer->emx_binary_mode))
+ current_buffer->emx_binary_mode = Femx_binary_mode_p (filename);
+ if (!NILP (current_buffer->emx_binary_mode))
+ setmode (fd, O_BINARY);
+ #endif /* EMX */
+
/* Replacement should preserve point as it preserves markers. */
if (!NILP (replace))
record_unwind_protect (restore_point_unwind, Fpoint_marker ());
***************
*** 3093,3098 ****
--- 3252,3263 ----
del_range_1 (BEGV, ZV, 0);
}
#else /* not DOS_NT */
+ #ifdef EMX
+ if (!NILP (replace) && NILP (current_buffer->emx_binary_mode)
+ && fb_start (fd, &st.st_size) != 0)
+ error ("IO error reading %s: %s",
+ XSTRING (filename)->data, strerror (errno));
+ #endif /* EMX */
if (!NILP (replace))
{
unsigned char buffer[1 << 14];
***************
*** 3416,3421 ****
--- 3581,3590 ----
int visiting, quietly;
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
struct buffer *given_buffer;
+ #ifdef EMX
+ int binary;
+ unsigned long size;
+ #endif /* EMX */
#ifdef DOS_NT
int buffer_file_type
= NILP (current_buffer->buffer_file_type) ? O_TEXT : O_BINARY;
***************
*** 3491,3496 ****
--- 3660,3671 ----
lock_file (lockname);
#endif /* CLASH_DETECTION */
+ #ifdef EMX
+ binary = ((!STRINGP (start) && !NILP (current_buffer->emx_binary_mode))
+ || !NILP (Femx_binary_mode_p (filename)));
+ filename = emx_get_original_case_string (filename);
+ #endif /* EMX */
+
fn = XSTRING (filename)->data;
desc = -1;
if (!NILP (append))
***************
*** 3547,3552 ****
--- 3722,3736 ----
desc = creat (fn, 0666);
}
#else /* not VMS */
+ #ifdef EMX
+ {
+ /* Set initial file size to avoid fragmentation. */
+ size = emx_size (start, end, annotations, binary);
+ desc = open (fn, O_WRONLY | O_TRUNC | O_CREAT | O_SIZE,
+ auto_saving ? auto_save_mode_bits : 0666, size);
+ append = Qnil;
+ }
+ #else /* not EMX */
#ifdef DOS_NT
desc = open (fn,
O_WRONLY | O_TRUNC | O_CREAT | buffer_file_type,
***************
*** 3554,3559 ****
--- 3738,3744 ----
#else /* not DOS_NT */
desc = creat (fn, auto_saving ? auto_save_mode_bits : 0666);
#endif /* not DOS_NT */
+ #endif /* not EMX */
#endif /* not VMS */
UNGCPRO;
***************
*** 3567,3572 ****
--- 3752,3761 ----
#endif /* CLASH_DETECTION */
report_file_error ("Opening output file", Fcons (filename, Qnil));
}
+ #ifdef EMX
+ if (binary)
+ setmode (desc, O_BINARY);
+ #endif /* EMX */
record_unwind_protect (close_file_unwind, make_number (desc));
***************
*** 3877,3882 ****
--- 4066,4140 ----
return 0;
}
+ #ifdef EMX
+ static unsigned long
+ a_size (addr, len, pos, annot, binary)
+ register char *addr;
+ register int len;
+ int pos;
+ Lisp_Object *annot;
+ int binary;
+ {
+ unsigned long size;
+ int i;
+
+ size = len;
+ if (!binary)
+ {
+ if (!EQ (current_buffer->selective_display, Qt))
+ {
+ for (i = 0; i < len; ++i)
+ if (addr[i] == '\n')
+ ++size;
+ }
+ else
+ for (i = 0; i < len; ++i)
+ if (addr[i] == '\n' || addr[i] == '\015')
+ ++size;
+ }
+ /* TODO: annotations */
+ return size;
+ }
+
+
+ static unsigned long
+ emx_size (start, end, annotations, binary)
+ Lisp_Object start, end, annotations;
+ int binary;
+ {
+ unsigned long size;
+ struct gcpro gcpro1;
+ int start1, end1, tem;
+
+ /* START and END are already protected. */
+ GCPRO1 (annotations);
+
+ if (STRINGP (start))
+ size = a_size (XSTRING (start)->data, XSTRING (start)->size, 0,
+ &annotations, binary);
+ else if (XINT (start) != XINT (end))
+ {
+ start1 = XINT (start);
+ end1 = XINT (end);
+ size = 0;
+ if (XINT (start) < GPT)
+ size += a_size (&FETCH_CHAR (start1), min (GPT, end1) - start1, start1,
+ &annotations, binary);
+ if (XINT (end) > GPT)
+ {
+ tem = max (start1, GPT);
+ size += a_size (&FETCH_CHAR (tem), end1 - tem, tem,
+ &annotations, binary);
+ }
+ }
+ else
+ size = a_size ("", 0, XINT (start), &annotations, binary);
+
+ UNGCPRO;
+ return size;
+ }
+ #endif /* EMX */
+
DEFUN ("verify-visited-file-modtime", Fverify_visited_file_modtime,
Sverify_visited_file_modtime, 1, 1, 0,
"Return t if last mod time of BUF's visited file matches what BUF records.\n\
***************
*** 3999,4008 ****
--- 4257,4273 ----
else
auto_save_mode_bits = 0666;
+ #ifndef EMX
return
+ #endif /* EMX */
Fwrite_region (Qnil, Qnil,
current_buffer->auto_save_file_name,
Qnil, Qlambda, Qnil);
+ #ifdef EMX
+ Fput_ea_list (Fexpand_file_name (current_buffer->auto_save_file_name, Qnil),
+ current_buffer->extended_attributes, Qt);
+ return Qnil;
+ #endif /* EMX */
}
static Lisp_Object
***************
*** 4058,4063 ****
--- 4323,4331 ----
{
Lisp_Object listfile;
listfile = Fexpand_file_name (Vauto_save_list_file_name, Qnil);
+ #ifdef EMX
+ listfile = emx_get_original_case_string (listfile);
+ #endif /* EMX */
#ifdef DOS_NT
listdesc = open (XSTRING (listfile)->data,
O_WRONLY | O_TRUNC | O_CREAT | O_TEXT,
diff -c emacs-19\src\frame.c:1.1.1.33 emacs-19\src\frame.c:1.42
*** emacs-19\src\frame.c:1.1.1.33 Sun Aug 18 23:22:50 1996
--- emacs-19\src\frame.c Sun Aug 18 23:22:50 1996
***************
*** 18,23 ****
--- 18,25 ----
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
+
#include <config.h>
#include <stdio.h>
***************
*** 83,88 ****
--- 85,94 ----
Lisp_Object Qbuffer_predicate;
Lisp_Object Qtitle;
+ #ifdef HAVE_PM
+ Lisp_Object Qpm;
+ #endif /* HAVE_PM */
+
Lisp_Object Vterminal_frame;
Lisp_Object Vdefault_frame_alist;
***************
*** 125,130 ****
--- 131,141 ----
Qtitle = intern ("title");
staticpro (&Qtitle);
+ #ifdef HAVE_PM
+ Qpm = intern ("pm");
+ staticpro (&Qpm);
+ #endif /* HAVE_PM */
+
DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist,
"Alist of default values for frame creation.\n\
These may be set in your init file, like this:\n\
***************
*** 212,217 ****
--- 223,229 ----
"Return non-nil if OBJECT is a frame.\n\
Value is t for a termcap frame (a character-only terminal),\n\
`x' for an Emacs frame that is really an X window,\n\
+ `pm' for an Emacs frame that is really a Presentation Manager window,\n\
`pc' for a direct-write MS-DOS frame.\n\
See also `frame-live-p'.")
(object)
***************
*** 224,230 ****
--- 236,246 ----
case output_termcap:
return Qt;
case output_x_window:
+ #ifdef HAVE_PM
+ return Qpm;
+ #else /* not HAVE_PM */
return Qx;
+ #endif /* not HAVE_PM */
case output_win32:
return Qwin32;
case output_msdos_raw:
diff -c emacs-19\src\keyboard.c:1.1.1.48 emacs-19\src\keyboard.c:1.85
*** emacs-19\src\keyboard.c:1.1.1.48 Sun Aug 18 23:22:54 1996
--- emacs-19\src\keyboard.c Sun Aug 18 23:22:54 1996
***************
*** 18,23 ****
--- 18,25 ----
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
+
/* Allow config.h to undefine symbols found here. */
#include <signal.h>
***************
*** 54,60 ****
--- 56,66 ----
/* This is to get the definitions of the XK_ symbols. */
#ifdef HAVE_X_WINDOWS
+ #ifdef HAVE_PM
+ #include "pmterm.h"
+ #else /* not HAVE_PM */
#include "xterm.h"
+ #endif /* not HAVE_PM */
#endif
#ifdef HAVE_NTGUI
***************
*** 519,525 ****
--- 525,535 ----
/* If we support a window system, turn on the code to poll periodically
to detect C-g. It isn't actually used when doing interrupt input. */
#ifdef HAVE_WINDOW_SYSTEM
+ /* pmemacs sends SIGINT to Emacs when C-g is hit. We don't have to
+ poll. */
+ #ifndef HAVE_PM
#define POLL_FOR_INPUT
+ #endif /* not HAVE_PM */
#endif
/* Non-nil enables Column Number mode. */
***************
*** 2305,2310 ****
--- 2315,2323 ----
do_mouse_tracking = old_value;
if (NILP (old_value))
{
+ #ifdef HAVE_PM
+ pm_mouse_tracking (0);
+ #endif /* HAVE_PM */
/* Redisplay may have been preempted because there was input
available, and it assumes it will be called again after the
input has been processed. If the only input available was
***************
*** 2331,2338 ****
--- 2344,2365 ----
record_unwind_protect (tracking_off, do_mouse_tracking);
+ #ifdef HAVE_PM
+ if (NILP (do_mouse_tracking))
+ {
+ Lisp_Object tail, frame;
+
+ FOR_EACH_FRAME (tail, frame)
+ XFRAME (frame)->mouse_moved = 0;
+ }
+ #endif /* HAVE_PM */
+
do_mouse_tracking = Qt;
+ #ifdef HAVE_PM
+ pm_mouse_tracking (1);
+ #endif /* HAVE_PM */
+
val = Fprogn (args);
return unbind_to (count, val);
}
***************
*** 3548,3553 ****
--- 3575,3583 ----
static char *lispy_mouse_names[] =
{
"mouse-1", "mouse-2", "mouse-3", "mouse-4", "mouse-5"
+ #ifdef HAVE_PM
+ , "drop-file", "drop-color"
+ #endif /* HAVE_PM */
};
/* Scroll bar parts. */
***************
*** 3805,3810 ****
--- 3835,3857 ----
start_pos_ptr = &XVECTOR (button_down_location)->contents[button];
+ #ifdef HAVE_PM
+ if (event->modifiers == 0)
+ {
+ Lisp_Object head;
+
+ head = modify_event_symbol (button,
+ event->modifiers,
+ Qmouse_click, Qnil,
+ lispy_mouse_names, &mouse_syms,
+ (sizeof (lispy_mouse_names)
+ / sizeof (lispy_mouse_names[0])));
+ return Fcons (head,
+ Fcons (position,
+ Qnil));
+ }
+ #endif /* HAVE_PM */
+
start_pos = *start_pos_ptr;
*start_pos_ptr = Qnil;
***************
*** 4971,4976 ****
--- 5018,5027 ----
void
reinvoke_input_signal ()
{
+ #ifdef HAVE_PM
+ while (read_avail_input (1) > 0)
+ ;
+ #endif /* HAVE_PM */
#ifdef SIGIO
kill (getpid (), SIGIO);
#endif
***************
*** 7365,7370 ****
--- 7416,7428 ----
/* Must preserve main program's value of errno. */
int old_errno = errno;
+ #ifdef EMX
+ /* Under emx with non-POSIX signals, a signal is blocked until
+ acknowledged. */
+ #ifndef POSIX_SIGNALS
+ signal (SIGINT, SIG_ACK);
+ #endif
+ #else /* not EMX */
#ifdef USG
if (!read_socket_hook && NILP (Vwindow_system))
{
***************
*** 7374,7379 ****
--- 7432,7438 ----
signal (SIGQUIT, interrupt_signal);
}
#endif /* USG */
+ #endif /* not EMX */
cancel_echoing ();
***************
*** 7406,7411 ****
--- 7465,7474 ----
printf ("you can continue or abort.\n");
#endif /* not VMS */
#endif /* not SIGTSTP */
+ #ifdef EMX
+ /* Still required??? */
+ Vquit_flag = Qnil;
+ #endif */ EMX */
#ifdef MSDOS
/* We must remain inside the screen area when the internal terminal
is used. Note that [Enter] is not echoed by dos. */
***************
*** 7705,7711 ****
--- 7768,7781 ----
kbd_buffer_frame_or_window
= Fmake_vector (make_number (KBD_BUFFER_SIZE), Qnil);
+
+ #ifdef HAVE_PM
+ /* Use SIGINT even if window-system is non-nil; pmemacs sends SIGINT
+ when C-g is typed. */
+ if (!noninteractive && !read_socket_hook)
+ #else /* not HAVE_PM */
if (!noninteractive && !read_socket_hook && NILP (Vwindow_system))
+ #endif /* not HAVE_PM */
{
signal (SIGINT, interrupt_signal);
#if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS)
diff -c emacs-19\src\lread.c:1.1.1.32 emacs-19\src\lread.c:1.46
*** emacs-19\src\lread.c:1.1.1.32 Sun Aug 18 23:22:56 1996
--- emacs-19\src\lread.c Sun Aug 18 23:22:56 1996
***************
*** 19,24 ****
--- 19,25 ----
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
#include <config.h>
#include <stdio.h>
***************
*** 92,97 ****
--- 93,103 ----
/* This is used to build the load history. */
Lisp_Object Vcurrent_load_list;
+ #ifdef EMX
+ /* Try replacing `-' with `_' in `load' if this is non-zero. */
+ int emx_cdrom_load;
+ #endif /* EMX */
+
/* Name of file actually being read by `load'. */
Lisp_Object Vload_file_name;
***************
*** 412,417 ****
--- 418,444 ----
GCPRO1 (file);
fd = openp (Vload_path, file, !NILP (nosuffix) ? "" : ".elc:.el:",
&found, 0);
+ #ifdef EMX
+ /* If the file was not found and emx-cdrom-load is non-nil, try
+ again, replacing `-' with `_'. */
+ if (fd < 0 && emx_cdrom_load)
+ {
+ int len = XSTRING (file)->size;
+ char *new_file = alloca (len + 1);
+ int i, ok = 0;
+
+ memcpy (new_file, XSTRING (file)->data, len);
+ new_file[len] = 0;
+ for (i = 0; i < len; ++i)
+ if (new_file[i] == '-')
+ {
+ new_file[i] = '_'; ok = 1;
+ }
+ if (ok)
+ fd = openp (Vload_path, build_string (new_file),
+ !NILP (nosuffix) ? "" : ".elc:.el:", &found, 0);
+ }
+ #endif /* EMX */
UNGCPRO;
}
***************
*** 2426,2431 ****
--- 2453,2464 ----
DEFVAR_LISP ("current-load-list", &Vcurrent_load_list,
"Used for internal purposes by `load'.");
Vcurrent_load_list = Qnil;
+
+ #ifdef EMX
+ DEFVAR_BOOL ("emx-cdrom-load", &emx_cdrom_load,
+ "*Non-nil if `load' should try again if the file is not found,\n\
+ replacing `-' with `_' in the file name.");
+ #endif /* EMX */
DEFVAR_LISP ("load-read-function", &Vload_read_function,
"Function used by `load' and `eval-region' for reading expressions.\n\
diff -c emacs-19\src\process.c:1.1.1.41 emacs-19\src\process.c:1.70
*** emacs-19\src\process.c:1.1.1.41 Sun Aug 18 23:22:58 1996
--- emacs-19\src\process.c Sun Aug 18 23:22:58 1996
***************
*** 19,24 ****
--- 19,25 ----
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
#include <signal.h>
***************
*** 44,49 ****
--- 45,54 ----
#include <unistd.h>
#endif
+ #ifdef EMX
+ #include <stdlib.h>
+ #endif /* EMX */
+
#ifdef WINDOWSNT
#include <stdlib.h>
#include <fcntl.h>
***************
*** 104,109 ****
--- 109,121 ----
#include "commands.h"
#include "frame.h"
+ #ifdef EMX
+ extern Lisp_Object find_program_name_handler ();
+ extern Lisp_Object Qprogram_name_handler_alist;
+ extern Lisp_Object Vprogram_name_handler_alist;
+ static Lisp_Object Qstart_process;
+ #endif /* EMX */
+
Lisp_Object Qprocessp;
Lisp_Object Qrun, Qstop, Qsignal, Qopen, Qclosed;
Lisp_Object Qlast_nonmenu_event;
***************
*** 213,219 ****
--- 225,233 ----
/* If we support a window system, turn on the code to poll periodically
to detect C-g. It isn't actually used when doing interrupt input. */
#ifdef HAVE_WINDOW_SYSTEM
+ #ifndef HAVE_PM
#define POLL_FOR_INPUT
+ #endif /* not HAVE_PM */
#endif
/* Mask of bits indicating the descriptors that we wait for input on. */
***************
*** 389,394 ****
--- 403,413 ----
end of the ptys. */
int failed_count = 0;
+ #ifdef EMX
+ if (_osmode != OS2_MODE || _emx_rev < 37)
+ return -1;
+ #endif /* EMX */
+
#ifdef PTY_ITERATION
PTY_ITERATION
#else
***************
*** 413,418 ****
--- 432,438 ----
if (fstat (fd, &stb) < 0)
return -1;
#else /* not IRIS */
+ #ifndef EMX
if (stat (pty_name, &stb) < 0)
{
failed_count++;
***************
*** 421,426 ****
--- 441,447 ----
}
else
failed_count = 0;
+ #endif /* not EMX */
#ifdef O_NONBLOCK
fd = open (pty_name, O_RDWR | O_NONBLOCK, 0);
#else
***************
*** 438,443 ****
--- 459,465 ----
#else
sprintf (pty_name, "/dev/tty%c%x", c, i);
#endif /* no PTY_TTY_NAME_SPRINTF */
+ #ifndef EMX
#ifndef UNIPLUS
if (access (pty_name, 6) != 0)
{
***************
*** 449,454 ****
--- 471,477 ----
#endif /* IRIS */
}
#endif /* not UNIPLUS */
+ #endif /* not EMX */
setup_pty (fd);
return fd;
}
***************
*** 1026,1031 ****
--- 1049,1072 ----
register int i;
int count = specpdl_ptr - specpdl;
+ #ifdef EMX
+ {
+ Lisp_Object handler;
+
+ emx_setup_start_process (); /* Calls specbind() */
+ handler = find_program_name_handler (args[2]);
+ if (!NILP (handler))
+ return unbind_to (count,
+ call3 (handler,
+ Fcons (Qstart_process, Flist (2, args + 0)),
+ args[2],
+ Flist (nargs - 3, args + 3)));
+ }
+ if (_osmode == DOS_MODE)
+ error ("start-process not supported under MS-DOS");
+ check_process_priority ();
+ #endif /* EMX */
+
buffer = args[1];
if (!NILP (buffer))
buffer = Fget_buffer_create (buffer);
***************
*** 1046,1051 ****
--- 1087,1096 ----
GCPRO2 (buffer, current_dir);
+ #ifdef EMX
+ current_dir = Fexpand_file_name (current_dir, Qnil);
+ #endif /* EMX */
+
current_dir
= expand_and_dir_to_file (Funhandled_file_name_directory (current_dir),
Qnil);
***************
*** 1088,1096 ****
--- 1133,1145 ----
new_argv = (unsigned char **) alloca ((nargs - 1) * sizeof (char *));
/* If program file name is not absolute, search our path for it */
+ #ifdef EMX
+ if (!_fnisabs (XSTRING (program)->data))
+ #else /* not EMX */
if (!IS_DIRECTORY_SEP (XSTRING (program)->data[0])
&& !(XSTRING (program)->size > 1
&& IS_DEVICE_SEP (XSTRING (program)->data[1])))
+ #endif /* not EMX */
{
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
***************
*** 1227,1232 ****
--- 1276,1286 ----
if (inchannel >= 0)
{
+ #ifdef EMX
+ /* Make another descriptor for the pty, to be able to use
+ different O_BINARY settings for reading and writing. */
+ outchannel = dup (inchannel);
+ #endif
#ifndef USG
/* On USG systems it does not work to open the pty's tty here
and then close and reopen it in the child. */
***************
*** 1264,1269 ****
--- 1318,1328 ----
}
#endif /* not SKTPAIR */
+ #ifdef EMX
+ emx_proc_output_pipe (inchannel);
+ emx_proc_input_pipe (outchannel);
+ #endif /* EMX */
+
#if 0
/* Replaced by close_process_descs */
set_exclusive_use (inchannel);
***************
*** 1481,1486 ****
--- 1540,1549 ----
#endif
#endif /* HAVE_PTYS */
+ #ifdef EMX
+ pid = emx_child_setup (xforkin, xforkout, xforkout,
+ new_argv, 1, current_dir);
+ #else /* not EMX */
signal (SIGINT, SIG_DFL);
signal (SIGQUIT, SIG_DFL);
***************
*** 1512,1517 ****
--- 1575,1581 ----
child_setup (xforkin, xforkout, xforkout,
new_argv, 1, current_dir);
#endif /* not WINDOWSNT */
+ #endif /* not EMX */
}
environ = save_environ;
}
***************
*** 1590,1596 ****
--- 1654,1664 ----
/* Now generate the error if vfork failed. */
if (pid < 0)
+ #ifndef EMX
report_file_error ("Doing vfork", Qnil);
+ #else /* EMX */
+ report_file_error ("Starting process", Qnil);
+ #endif /* EMX */
}
#endif /* not VMS */
***************
*** 1862,1867 ****
--- 1930,1936 ----
{
#ifndef WINDOWSNT
int i;
+ #ifndef EMX
for (i = 0; i < MAXDESC; i++)
{
Lisp_Object process;
***************
*** 1876,1881 ****
--- 1945,1954 ----
close (out);
}
}
+ #else /* EMX */
+ for (i = 3; i < MAXDESC; i++)
+ fcntl (i, F_SETFD, 1);
+ #endif /* EMX */
#endif
}
***************
*** 2475,2480 ****
--- 2548,2557 ----
}
#else /* not VMS */
+ #ifdef EMX
+ fcntl (channel, F_SETFL, O_NDELAY);
+ #endif /* EMX */
+
if (proc_buffered_char[channel] < 0)
nchars = read (channel, chars, sizeof (chars));
else
***************
*** 3454,3468 ****
--- 3531,3552 ----
EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0);
}
+ #ifdef EMX
+ emx_async_delete_now ();
+ #endif /* EMX */
/* On some systems, we must return right away.
If any more processes want to signal us, we will
get another signal.
Otherwise (on systems that have WNOHANG), loop around
to use up all the processes that have something to tell us. */
+ #if defined (EMX) && !defined (POSIX_SIGNALS)
+ signal (signo, SIG_ACK);
+ #else /* not EMX, or POSIX_SIGNALS */
#if defined (USG) && ! (defined (HPUX) && defined (WNOHANG)) || defined (WINDOWSNT)
#ifdef USG
signal (signo, sigchld_handler);
#endif
+ #endif /* not EMX, or POSIX_SIGNALS*/
errno = old_errno;
return;
#endif /* USG, but not HPUX with WNOHANG */
***************
*** 3728,3733 ****
--- 3812,3821 ----
syms_of_process ()
{
+ #ifdef EMX
+ Qstart_process = intern ("start-process");
+ staticpro (&Qstart_process);
+ #endif /* EMX */
#ifdef HAVE_SOCKETS
stream_process = intern ("stream");
#endif
diff -c emacs-19\src\sysdep.c:1.1.1.35 emacs-19\src\sysdep.c:1.49
*** emacs-19\src\sysdep.c:1.1.1.35 Sun Aug 18 23:23:00 1996
--- emacs-19\src\sysdep.c Sun Aug 18 23:23:00 1996
***************
*** 18,23 ****
--- 18,24 ----
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
#include <signal.h>
#include <setjmp.h>
***************
*** 545,550 ****
--- 546,554 ----
s.main.c_cc[VTIME] = 0; /* wait forever for at least 1 character */
#endif
+ #ifdef EMX
+ s.main.c_lflag |= IDEFAULT; /* Disable termio */
+ #endif /* EMX */
s.main.c_lflag |= ICANON; /* Enable erase/kill and eof processing */
s.main.c_cc[VEOF] = 04; /* insure that EOF is Control-D */
s.main.c_cc[VERASE] = CDISABLE; /* disable erase processing */
***************
*** 678,688 ****
--- 682,696 ----
#else /* No SIGTSTP or USG_JOBCTRL */
+ #ifdef EMX
+ system ("");
+ #else /* not EMX */
/* On a system where suspending is not implemented,
instead fork a subshell and let it talk directly to the terminal
while we wait. */
sys_subshell ();
+ #endif /* not EMX */
#endif /* no USG_JOBCTRL */
#endif /* no SIGTSTP */
#endif /* not VMS */
***************
*** 1277,1282 ****
--- 1285,1294 ----
tty.main.c_iflag &= ~ISTRIP; /* don't strip 8th bit on input */
#endif
tty.main.c_lflag &= ~ECHO; /* Disable echo */
+ #ifdef EMX
+ tty.main.c_iflag |= IDELETE; /* Backspace key should send DEL */
+ tty.main.c_lflag &= ~IDEFAULT; /* Enable termio */
+ #endif /* EMX */
tty.main.c_lflag &= ~ICANON; /* Disable erase/kill processing */
#ifdef IEXTEN
tty.main.c_lflag &= ~IEXTEN; /* Disable other editing characters. */
***************
*** 1497,1502 ****
--- 1509,1519 ----
#else
setbuf (stdout, _sobuf);
#endif
+
+ #ifdef EMX
+ _fsetmode (stdout, "b");
+ #endif /* EMX */
+
#ifdef HAVE_WINDOW_SYSTEM
/* Emacs' window system on MSDOG uses the `internal terminal' and therefore
needs the initialization code below. */
***************
*** 1581,1589 ****
--- 1598,1613 ----
#ifdef MSDOS
*widthp = ScreenCols ();
*heightp = ScreenRows ();
+
+ #else
+ #ifdef EMX
+ int sz[2];
+ _scrsize (sz);
+ *widthp = sz[0]; *heightp = sz[1];
#else /* system doesn't know size */
*widthp = 0;
*heightp = 0;
+ #endif /* not EMX */
#endif
#endif /* not VMS */
***************
*** 2181,2186 ****
--- 2205,2211 ----
hostname = (char *) alloca (hostname_size);
}
#ifdef HAVE_SOCKETS
+ #ifndef EMX
/* Turn the hostname into the official, fully-qualified hostname.
Don't do this if we're going to dump; this can confuse system
libraries on some machines and make the dumped emacs core dump. */
***************
*** 2232,2237 ****
--- 2257,2263 ----
#endif
}
}
+ #endif /* not EMX */
#endif /* HAVE_SOCKETS */
Vsystem_name = build_string (hostname);
#endif /* HAVE_GETHOSTNAME */
diff -c emacs-19\src\syssignal.h:1.1.1.14 emacs-19\src\syssignal.h:1.9
*** emacs-19\src\syssignal.h:1.1.1.14 Sun Aug 18 23:23:00 1996
--- emacs-19\src\syssignal.h Sun Aug 18 23:23:00 1996
***************
*** 18,23 ****
--- 18,25 ----
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
+
#ifdef POSIX_SIGNALS
/* Don't #include <signal.h>. That header should always be #included
***************
*** 142,148 ****
--- 144,154 ----
#ifdef WINDOWSNT
#define EMACS_KILLPG(gid, signo) (kill (gid, signo))
#else
+ #ifdef EMX
+ #define EMACS_KILLPG(gid, signo) emx_killpg ((gid), (signo))
+ #else /* not EMX */
#define EMACS_KILLPG(gid, signo) (kill (-(gid), (signo)))
+ #endif /* not EMX */
#endif
#endif
diff -c emacs-19\src\term.c:1.1.1.20 emacs-19\src\term.c:1.28
*** emacs-19\src\term.c:1.1.1.20 Sun Aug 18 23:23:00 1996
--- emacs-19\src\term.c Sun Aug 18 23:23:00 1996
***************
*** 18,23 ****
--- 18,24 ----
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
#include <config.h>
#include <stdio.h>
***************
*** 344,349 ****
--- 345,353 ----
OUTPUT_IF (TS_end_keypad_mode);
OUTPUT_IF (TS_end_visual_mode);
OUTPUT_IF (TS_end_termcap_modes);
+ #ifdef EMX
+ _fsetmode (stdout, "t");
+ #endif /* EMX */
/* Output raw CR so kernel can track the cursor hpos. */
/* But on magic-cookie terminals this can erase an end-standout marker and
cause the rest of the frame to be in standout, so move down first. */
diff -c emacs-19\src\termcap.c:1.1.1.13 emacs-19\src\termcap.c:1.27
*** emacs-19\src\termcap.c:1.1.1.13 Sun Aug 18 23:23:02 1996
--- emacs-19\src\termcap.c Sun Aug 18 23:23:02 1996
***************
*** 16,21 ****
--- 16,23 ----
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
+
/* Emacs config.h may rename various library functions such as malloc. */
#ifdef HAVE_CONFIG_H
#include <config.h>
***************
*** 365,370 ****
--- 367,377 ----
static int compare_contin ();
static int name_match ();
+ #ifdef EMX
+
+ #define valid_filename_p(fn) (IS_DIRECTORY_SEP (*(fn)) || _fngetdrive (fn))
+
+ #else /* not EMX */
#ifdef VMS
#include <rmsdef.h>
***************
*** 404,409 ****
--- 411,417 ----
#endif
#endif /* !VMS */
+ #endif /* not EMX */
/* Find the termcap entry data for terminal type NAME
and store it in the block that BP points to.
diff -c emacs-19\src\termhooks.h:1.1.1.16 emacs-19\src\termhooks.h:1.30
*** emacs-19\src\termhooks.h:1.1.1.16 Sun Aug 18 23:23:02 1996
--- emacs-19\src\termhooks.h Sun Aug 18 23:23:02 1996
***************
*** 19,24 ****
--- 19,26 ----
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
+
/* Miscellanea. */
***************
*** 307,313 ****
--- 309,319 ----
/* This is used in keyboard.c, to tell how many buttons we will need
to track the positions of. */
+ #ifdef HAVE_PM
+ #define NUM_MOUSE_BUTTONS (5+2)
+ #else /* not HAVE_PM */
#define NUM_MOUSE_BUTTONS (5)
+ #endif /* not HAVE_PM */
/* Bits in the modifiers member of the input_event structure.
Note that reorder_modifiers assumes that the bits are in canonical
diff -c emacs-19\src\xfaces.c:1.1.1.30 emacs-19\src\xfaces.c:1.60
*** emacs-19\src\xfaces.c:1.1.1.30 Sun Aug 18 23:23:04 1996
--- emacs-19\src\xfaces.c Sun Aug 18 23:23:04 1996
***************
*** 20,25 ****
--- 20,27 ----
/* This is derived from work by Lucid (some parts very loosely so). */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
+
#include <sys/types.h>
#include <sys/stat.h>
***************
*** 29,35 ****
--- 31,42 ----
#ifdef HAVE_FACES
#ifdef HAVE_X_WINDOWS
+ #ifdef HAVE_PM
+ #include "pmterm.h"
+ #include "pmemacs.h"
+ #else /* not HAVE_PM */
#include "xterm.h"
+ #endif /* not HAVE_PM */
#endif
#ifdef MSDOS
#include "dosfns.h"
***************
*** 56,62 ****
--- 63,71 ----
#else
+ #ifndef HAVE_PM
#include <X11/Xos.h>
+ #endif /* not HAVE_PM */
#endif
#endif /* HAVE_X_WINDOWS */
***************
*** 218,223 ****
--- 227,234 ----
#ifdef HAVE_X_WINDOWS
/* Given a computed face, construct its graphics context if necessary. */
+ #ifndef HAVE_PM
+
struct face *
intern_face (f, face)
struct frame *f;
***************
*** 267,272 ****
--- 278,328 ----
return face;
}
+ #else /* HAVE_PM */
+
+ struct face *
+ intern_face (f, face)
+ struct frame *f;
+ struct face *face;
+ {
+ pm_request pmr;
+ char *name;
+
+ if (face->gc)
+ return face;
+
+ BLOCK_INPUT;
+
+ if (face->foreground != FACE_DEFAULT)
+ pmr.face.foreground = face->foreground;
+ else
+ pmr.face.foreground = f->output_data.x->foreground_color;
+
+ if (face->background != FACE_DEFAULT)
+ pmr.face.background = face->background;
+ else
+ pmr.face.background = f->output_data.x->background_color;
+
+ if (face->font && (int)face->font != FACE_DEFAULT)
+ name = face->font->name;
+ else
+ name = f->output_data.x->font->name;
+
+ pmr.face.name_length = strlen (name);
+ pmr.face.underline = face->underline;
+ pmr.face.serial = pm_serial++;
+ pmr.face.header.type = PMR_FACE;
+ pmr.face.header.frame = (unsigned long)f;
+ pm_send (&pmr, sizeof (pmr));
+ pm_send (name, pmr.face.name_length);
+ if (pm_receive (pmr.face.serial, &face->gc, 0, 0) == 0)
+ face->gc = 0;
+ UNBLOCK_INPUT;
+ return face;
+ }
+
+ #endif /* HAVE_PM */
+
/* Clear out all graphics contexts for all computed faces
except for the default and mode line faces.
This should be done from time to time just to avoid
***************
*** 384,389 ****
--- 440,446 ----
struct frame *f;
unsigned long pixel;
{
+ #ifndef HAVE_PM
Colormap cmap;
Display *dpy = FRAME_X_DISPLAY (f);
int class = FRAME_X_DISPLAY_INFO (f)->visual->class;
***************
*** 422,427 ****
--- 479,485 ----
XFreeColors (dpy, cmap, &pixel, 1, (unsigned long)0);
UNBLOCK_INPUT;
}
+ #endif /* not HAVE_PM */
}
DEFUN ("pixmap-spec-p", Fpixmap_spec_p, Spixmap_spec_p, 1, 1, 0,
***************
*** 460,465 ****
--- 518,526 ----
Lisp_Object name;
unsigned int *w_ptr, *h_ptr;
{
+ #ifdef HAVE_PM
+ return FACE_DEFAULT;
+ #else /* not HAVE_PM */
int bitmap_id;
Lisp_Object tem;
***************
*** 501,506 ****
--- 562,568 ----
*h_ptr = x_bitmap_height (f, bitmap_id);
return bitmap_id;
+ #endif /* not HAVE_PM */
}
#else /* !HAVE_X_WINDOWS */
***************
*** 740,749 ****
--- 802,815 ----
same_size_fonts (font1, font2)
XFontStruct *font1, *font2;
{
+ #ifndef HAVE_PM
XCharStruct *bounds1 = &font1->min_bounds;
XCharStruct *bounds2 = &font2->min_bounds;
return (bounds1->width == bounds2->width);
+ #else /* HAVE_PM */
+ return 1;
+ #endif /* HAVE_PM */
}
/* Update the line_height of frame F according to the biggest font in
***************
*** 1162,1169 ****
--- 1228,1237 ----
face->font = (XFontStruct *)1 ;
#else
XFontStruct *font = load_font (f, attr_value);
+ #ifndef HAVE_PM
if (face->font != f->output_data.x->font)
unload_font (f, face->font);
+ #endif /* not HAVE_PM */
face->font = font;
if (frame_update_line_height (f))
x_set_window_size (f, 0, f->width, f->height);
diff -c emacs-19\src\xmenu.c:1.1.1.35 emacs-19\src\xmenu.c:1.86
*** emacs-19\src\xmenu.c:1.1.1.35 Sun Aug 18 23:23:06 1996
--- emacs-19\src\xmenu.c Sun Aug 18 23:23:06 1996
***************
*** 30,35 ****
--- 30,37 ----
/* Rewritten for clarity and GC protection by rms in Feb 94. */
+ /* Modified for emx by Eberhard Mattes, Aug 1996 */
+
/* On 4.3 this loses if it comes after xterm.h. */
#include <signal.h>
#include <config.h>
***************
*** 44,49 ****
--- 46,55 ----
#include "puresize.h"
#include "buffer.h"
+ #ifdef HAVE_PM
+ #include "pmterm.h"
+ #include "pmemacs.h"
+ #else /* not HAVE_PM */
#ifdef MSDOS
#include "msdos.h"
#endif
***************
*** 53,58 ****
--- 59,65 ----
if this is not done before the other system files. */
#include "xterm.h"
#endif
+ #endif /* not HAVE_PM */
/* Load sys/types.h if not already loaded.
In some systems loading it twice is suicidal. */
***************
*** 62,67 ****
--- 69,75 ----
#include "dispextern.h"
+ #ifndef HAVE_PM
#ifdef HAVE_X_WINDOWS
#ifdef USE_X_TOOLKIT
#include <X11/Xlib.h>
***************
*** 77,82 ****
--- 85,91 ----
#include "../oldXMenu/XMenu.h"
#endif /* not USE_X_TOOLKIT */
#endif /* HAVE_X_WINDOWS */
+ #endif /* not HAVE_PM */
#define min(x,y) (((x) < (y)) ? (x) : (y))
#define max(x,y) (((x) > (y)) ? (x) : (y))
***************
*** 96,101 ****
--- 105,116 ----
extern Lisp_Object Vdefine_key_rebound_commands;
+ #ifdef HAVE_PM
+ static int pm_menu_button;
+ static int pm_align_menu_key_descriptions;
+ static int pm_popup_menu_align_top;
+ #endif /* HAVE_PM */
+
extern Lisp_Object Voverriding_local_map;
extern Lisp_Object Voverriding_local_map_menu_flag;
***************
*** 105,112 ****
--- 120,129 ----
#ifdef USE_X_TOOLKIT
extern void set_frame_menubar ();
+ #ifndef HAVE_PM
extern void process_expose_from_menu ();
extern XtAppContext Xt_app_con;
+ #endif /* not HAVE_PM */
static Lisp_Object xdialog_show ();
void popup_get_selection ();
***************
*** 182,187 ****
--- 199,205 ----
int pending_menu_activation;
#ifdef USE_X_TOOLKIT
+ #ifndef HAVE_PM
/* Return the frame whose ->output_data.x->id equals ID, or 0 if none. */
***************
*** 206,211 ****
--- 224,230 ----
return 0;
}
+ #endif /* not HAVE_PM */
#endif
/* Initialize the menu_items structure if we haven't already done so.
***************
*** 419,426 ****
--- 438,455 ----
if (!NILP (savedkey))
{
descrip = Fkey_description (savedkey);
+ #ifndef HAVE_PM
descrip = concat2 (make_string (" (", 3), descrip);
descrip = concat2 (descrip, make_string (")", 1));
+ #else /* HAVE_PM */
+ if (pm_align_menu_key_descriptions)
+ descrip = concat2 (make_string ("\t", 1), descrip);
+ else
+ {
+ descrip = concat2 (make_string (" (", 3), descrip);
+ descrip = concat2 (descrip, make_string (")", 1));
+ }
+ #endif /* HAVE_PM */
}
}
***************
*** 784,789 ****
--- 813,821 ----
struct gcpro gcpro1;
#ifdef HAVE_MENUS
+ #ifdef HAVE_PM
+ pm_menu_button = 0;
+ #endif /* HAVE_PM */
if (! NILP (position))
{
check_x ();
***************
*** 827,832 ****
--- 859,867 ----
tem = Fcar (Fcdr (Fcdr (tem))); /* POSN_WINDOW_POSN (tem) */
x = Fcar (tem);
y = Fcdr (tem);
+ #ifdef HAVE_PM
+ pm_menu_button = pm_event_button (position);
+ #endif /* HAVE_PM */
}
}
***************
*** 1071,1076 ****
--- 1106,1112 ----
#ifdef USE_X_TOOLKIT
+ #ifndef HAVE_PM
/* Loop in Xt until the menu pulldown or dialog popup has been
popped down (deactivated). This is used for x-popup-menu
and x-popup-dialog; it is not used for the menu bar any more.
***************
*** 1211,1216 ****
--- 1247,1253 ----
/* Ignore this if we get it a second time. */
f->output_data.x->saved_menu_event->type = 0;
}
+ #endif /* not HAVE_PM */
/* Detect if a dialog or menu has been posted. */
***************
*** 1220,1226 ****
return popup_activated_flag;
}
!
/* This callback is invoked when the user selects a menubar cascade
pushbutton, but before the pulldown menu is posted. */
--- 1257,1263 ----
return popup_activated_flag;
}
! #ifndef HAVE_PM
/* This callback is invoked when the user selects a menubar cascade
pushbutton, but before the pulldown menu is posted. */
***************
*** 1232,1237 ****
--- 1269,1275 ----
{
popup_activated_flag = 1;
}
+ #endif /* not HAVE_PM */
/* This callback is called from the menu bar pulldown menu
when the user makes a selection.
***************
*** 1245,1251 ****
--- 1283,1293 ----
XtPointer client_data;
{
Lisp_Object prefix, entry;
+ #ifdef HAVE_PM
+ FRAME_PTR f = (FRAME_PTR) id;
+ #else /* not HAVE_PM */
FRAME_PTR f = menubar_id_to_frame (id);
+ #endif /* not HAVE_PM */
Lisp_Object vector;
Lisp_Object *subprefix_stack;
int submenu_depth = 0;
***************
*** 1317,1322 ****
--- 1359,1365 ----
}
}
+ #ifndef HAVE_PM
/* This callback is invoked when a dialog or menu is finished being
used and has been unposted. */
***************
*** 1833,1838 ****
--- 1876,1882 ----
UNBLOCK_INPUT;
}
+ #endif /* not HAVE_PM */
/* Called from Fx_create_frame to create the initial menubar of a frame
before it is mapped, so that the window is mapped with the menubar already
***************
*** 1852,1857 ****
--- 1896,1902 ----
/* Get rid of the menu bar of frame F, and free its storage.
This is used when deleting a frame, and when turning off the menu bar. */
+ #ifndef HAVE_PM
void
free_frame_menubar (f)
FRAME_PTR f;
***************
*** 1869,1874 ****
--- 1914,1920 ----
}
}
+ #endif /* not HAVE_PM */
#endif /* USE_X_TOOLKIT */
/* xmenu_show actually displays a menu using the panes and items in menu_items
***************
*** 1887,1892 ****
--- 1933,1939 ----
ERROR is a place to store an error message string in case of failure.
(We return nil on failure, but the value doesn't actually matter.) */
+ #ifndef HAVE_PM
#ifdef USE_X_TOOLKIT
/* We need a unique id for each widget handled by the Lucid Widget
***************
*** 2690,2695 ****
--- 2737,3315 ----
#endif /* not USE_X_TOOLKIT */
+ #else /* HAVE_PM */
+
+ static int pmmenu_count;
+ static int pmmenu_alloc;
+ static pm_menu *pmmenu_menu;
+ static int pmmenu_str_size;
+ static int pmmenu_str_alloc;
+ static char *pmmenu_str;
+
+ static void pmmenu_add (const pm_menu *pmm)
+ {
+ if (pmmenu_count >= pmmenu_alloc)
+ {
+ pmmenu_alloc += 512;
+ pmmenu_menu = (pm_menu *)xrealloc (pmmenu_menu,
+ pmmenu_alloc * sizeof (pm_menu));
+ }
+ pmmenu_menu[pmmenu_count++] = *pmm;
+ }
+
+
+ /* Copy S to D, replacing ~ characters with ~~. */
+
+ static void tilde_expand (char *d, const char *s)
+ {
+ while (*s != 0)
+ {
+ if (*s == '~')
+ *d++ = *s;
+ *d++ = *s++;
+ }
+ *d = 0;
+ }
+
+
+ /* Compute the length of string S. If TILDE is true, count ~
+ characters twice. Store the length to *LEN. Return true if TILDE
+ is true and there are any ~ characters. */
+
+ static int tilde_len (int *len, const char *s, int tilde)
+ {
+ int nc = 0, nt = 0;
+
+ if (tilde)
+ while (*s != 0)
+ {
+ if (*s == '~')
+ ++nt;
+ ++nc; ++s;
+ }
+ else
+ nc = strlen (s);
+ *len = nc + nt;
+ return nt != 0;
+ }
+
+
+ /* Add the concatenation of S1 and S2 to the string pool for sending
+ it to pmemacs.exe. Replace ~ with ~~ if TILDE is true. Return the
+ offset of the string. */
+
+ static int pmmenu_add_str (const char *s1, const char *s2, int tilde)
+ {
+ int len1, len2;
+ int result = pmmenu_str_size;
+
+ if (tilde_len (&len1, s1, tilde))
+ {
+ char *tem = alloca (len1 + 1);
+ tilde_expand (tem, s1);
+ s1 = tem;
+ }
+ if (tilde_len (&len2, s2, tilde))
+ {
+ char *tem = alloca (len2 + 1);
+ tilde_expand (tem, s2);
+ s2 = tem;
+ }
+ ++len2; /* Include the terminating null character */
+ while (pmmenu_str_size + len1 + len2 > pmmenu_str_alloc)
+ {
+ pmmenu_str_alloc += 4096;
+ pmmenu_str = (char *)xrealloc (pmmenu_str, pmmenu_str_alloc);
+ }
+ bcopy (s1, pmmenu_str + pmmenu_str_size, len1);
+ bcopy (s2, pmmenu_str + pmmenu_str_size + len1, len2);
+ pmmenu_str_size += len1 + len2;
+ return result;
+ }
+
+
+ /* Return true if NAME looks like a menu separator string. */
+
+ static int menu_sep_p (Lisp_Object name)
+ {
+ const char *p;
+
+ if (!STRINGP (name))
+ return 0;
+ for (p = XSTRING (name)->data; *p != 0; ++p)
+ if (*p != ' ' && *p != '-')
+ return 0;
+ return 1;
+ }
+
+
+ static void
+ make_pmmenu (int i, int menubarp, int keymaps)
+ {
+ pm_menu pmm;
+ int submenu_depth = 0;
+ int sel = 0;
+
+ while (i < menu_items_used)
+ {
+ if (EQ (XVECTOR (menu_items)->contents[i], Qnil))
+ {
+ pmm.type = PMMENU_PUSH;
+ pmmenu_add (&pmm);
+ submenu_depth++;
+ i++;
+ }
+ else if (EQ (XVECTOR (menu_items)->contents[i], Qlambda))
+ {
+ pmm.type = PMMENU_POP;
+ pmmenu_add (&pmm);
+ --submenu_depth;
+ i++;
+ }
+ else if (EQ (XVECTOR (menu_items)->contents[i], Qt)
+ && submenu_depth != 0)
+ i += MENU_ITEMS_PANE_LENGTH;
+ /* Ignore a nil in the item list.
+ It's meaningful only for dialog boxes. */
+ else if (EQ (XVECTOR (menu_items)->contents[i], Qquote))
+ i += 1;
+ else if (EQ (XVECTOR (menu_items)->contents[i], Qt))
+ {
+ /* Create a new pane. */
+ Lisp_Object pane_name, prefix;
+ char *pane_string;
+ pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME];
+ prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX];
+ pane_string = (NILP (pane_name)
+ ? "" : (char *) XSTRING (pane_name)->data);
+ /* If there is just one top-level pane, put all its items directly
+ under the top-level menu. */
+ if (menu_items_n_panes == 1)
+ pane_string = "";
+
+ /* If the pane has a meaningful name,
+ make the pane a top-level menu item
+ with its items as a submenu beneath it. */
+ if (!keymaps && strcmp (pane_string, ""))
+ {
+ if (keymaps && !NILP (prefix))
+ pane_string++;
+ pmm.type = PMMENU_SUB;
+ pmm.item = 0;
+ pmm.str_offset = pmmenu_add_str (pane_string, "", 1);
+ pmm.enable = 1;
+ pmmenu_add (&pmm);
+ }
+ i += MENU_ITEMS_PANE_LENGTH;
+ }
+ else
+ {
+ /* Create a new item within current pane. */
+ Lisp_Object item_name, enable, descrip, value, def;
+ item_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_NAME];
+ value = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_VALUE];
+ enable = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_ENABLE];
+ descrip
+ = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY];
+ def = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_DEFINITION];
+
+ /* Check for separator lines. */
+
+ if (menu_sep_p (item_name) && NILP (def))
+ {
+ /* The code processing the value returned by pmemacs
+ does not check for separators, therefore we must
+ update `sel' even for separators. */
+ ++sel;
+ pmm.type = PMMENU_SEP;
+ }
+ else
+ {
+ pmm.type = PMMENU_ITEM;
+ pmm.item = (menubarp ? i : ++sel);
+ pmm.str_offset
+ = pmmenu_add_str (XSTRING (item_name)->data,
+ (NILP (descrip) ? ""
+ : (char*)XSTRING (descrip)->data),
+ 1);
+ pmm.enable = !NILP (enable);
+ }
+ pmmenu_add (&pmm);
+ i += MENU_ITEMS_ITEM_LENGTH;
+ }
+ }
+
+ pmm.type = PMMENU_END;
+ pmmenu_add (&pmm);
+ }
+
+
+ static Lisp_Object
+ xmenu_show (f, x, y, for_click, keymaps, title, error)
+ FRAME_PTR f;
+ int x, y;
+ int for_click;
+ int keymaps;
+ Lisp_Object title;
+ char **error;
+ {
+ int i, sel, serial;
+ Lisp_Object *subprefix_stack
+ = (Lisp_Object *) alloca (menu_items_used * sizeof (Lisp_Object));
+ int submenu_depth = 0;
+ pm_request pmr;
+ pm_menu pmm;
+
+ *error = 0;
+ if (menu_items_n_panes == 0)
+ return Qnil;
+
+ if (menu_items_used <= MENU_ITEMS_PANE_LENGTH)
+ {
+ *error = "Empty menu";
+ return Qnil;
+ }
+
+ pmmenu_count = 0; pmmenu_str_size = 0;
+ make_pmmenu (0, 0, keymaps);
+
+ BLOCK_INPUT;
+ pmr.popupmenu.header.type = PMR_POPUPMENU;
+ pmr.popupmenu.header.frame = (unsigned long)f;
+ pmr.popupmenu.serial = serial = pm_serial++;
+ pmr.popupmenu.x = x;
+ pmr.popupmenu.y = y;
+ pmr.popupmenu.align_top = pm_popup_menu_align_top;
+ pmr.popupmenu.button = pm_menu_button;
+ pmr.popupmenu.count = pmmenu_count;
+ pmr.popupmenu.size = pmmenu_count * sizeof (pm_menu) + pmmenu_str_size;
+ pm_send (&pmr, sizeof (pmr));
+ pm_send (pmmenu_menu, pmmenu_count * sizeof (pm_menu));
+ pm_send (pmmenu_str, pmmenu_str_size);
+ if (pm_receive (serial, &sel, NULL, 1) == NULL)
+ sel = 0;
+ UNBLOCK_INPUT;
+
+ /* Find the selected item, and its pane, to return the proper value. */
+
+ if (sel != 0)
+ {
+ Lisp_Object prefix, entry;
+
+ prefix = Qnil;
+ i = 0;
+ while (i < menu_items_used)
+ {
+ if (EQ (XVECTOR (menu_items)->contents[i], Qnil))
+ {
+ subprefix_stack[submenu_depth++] = prefix;
+ prefix = entry;
+ i++;
+ }
+ else if (EQ (XVECTOR (menu_items)->contents[i], Qlambda))
+ {
+ prefix = subprefix_stack[--submenu_depth];
+ i++;
+ }
+ else if (EQ (XVECTOR (menu_items)->contents[i], Qt))
+ {
+ prefix
+ = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX];
+ i += MENU_ITEMS_PANE_LENGTH;
+ }
+ /* Ignore a quote in the item list.
+ It's meaningful only for dialog boxes. */
+ else if (EQ (XVECTOR (menu_items)->contents[i], Qquote))
+ i += 1;
+ else
+ {
+ entry
+ = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_VALUE];
+ if (--sel == 0)
+ {
+ if (keymaps != 0)
+ {
+ int j;
+
+ entry = Fcons (entry, Qnil);
+ if (!NILP (prefix))
+ entry = Fcons (prefix, entry);
+ for (j = submenu_depth - 1; j >= 0; j--)
+ if (!NILP (subprefix_stack[j]))
+ entry = Fcons (subprefix_stack[j], entry);
+ }
+ return entry;
+ }
+ i += MENU_ITEMS_ITEM_LENGTH;
+ }
+ }
+ }
+ return Qnil;
+ }
+
+ static Lisp_Object
+ xdialog_show (f, keymaps, title, error)
+ FRAME_PTR f;
+ int keymaps;
+ Lisp_Object title;
+ char **error;
+ {
+ int nb_buttons = 0;
+ int i, sel;
+ pm_request pmr;
+ pm_menu pmm;
+
+ *error = NULL;
+
+ if (menu_items_n_panes > 1)
+ {
+ *error = "Multiple panes in dialog box";
+ return Qnil;
+ }
+
+ pmmenu_count = 0; pmmenu_str_size = 0;
+
+ if (XSTRING (title)->size != 0)
+ {
+ pmm.type = PMMENU_TITLE;
+ pmm.item = 0;
+ pmm.str_offset = pmmenu_add_str (XSTRING (title)->data, "", 0);
+ pmm.enable = 0;
+ pmmenu_add (&pmm);
+ }
+
+ /* Loop over all panes and items, filling in the tree. */
+ i = MENU_ITEMS_PANE_LENGTH;
+ while (i < menu_items_used)
+ {
+
+ /* Create a new item within current pane. */
+ Lisp_Object item_name, enable;
+ item_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_NAME];
+ enable = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_ENABLE];
+
+ if (NILP (item_name))
+ {
+ *error = "Submenu in dialog items";
+ return Qnil;
+ }
+ if (EQ (item_name, Qquote))
+ {
+ /* This is the boundary between left-side elts
+ and right-side elts. */
+ i++;
+ continue;
+ }
+ if (nb_buttons >= 10)
+ {
+ *error = "Too many dialog items";
+ return Qnil;
+ }
+
+ pmm.type = PMMENU_ITEM;
+ pmm.item = i + 1;
+ pmm.str_offset = pmmenu_add_str (XSTRING (item_name)->data, "", 0);
+ pmm.enable = !NILP (enable);
+ pmmenu_add (&pmm);
+
+ nb_buttons++;
+ i += MENU_ITEMS_ITEM_LENGTH;
+ }
+
+ pmm.type = PMMENU_END;
+ pmmenu_add (&pmm);
+
+ BLOCK_INPUT;
+ pmr.dialog.header.type = PMR_DIALOG;
+ pmr.dialog.header.frame = (unsigned long)f;
+ pmr.dialog.serial = pm_serial++;
+ pmr.dialog.buttons = nb_buttons;
+ pmr.dialog.count = pmmenu_count;
+ pmr.dialog.size = pmmenu_count * sizeof (pm_menu) + pmmenu_str_size;
+ pm_send (&pmr, sizeof (pmr));
+ pm_send (pmmenu_menu, pmmenu_count * sizeof (pm_menu));
+ pm_send (pmmenu_str, pmmenu_str_size);
+ if (pm_receive (pmr.dialog.serial, &sel, NULL, 1) == NULL)
+ sel = 0;
+ UNBLOCK_INPUT;
+ if (sel == 0)
+ return Qnil;
+ return XVECTOR (menu_items)->contents[sel - 1 + MENU_ITEMS_ITEM_VALUE];
+ }
+
+
+ static void
+ single_submenu (item_key, item_name, maps)
+ Lisp_Object item_key, item_name, maps;
+ {
+ int i;
+ int submenu_depth = 0;
+ Lisp_Object length;
+ int len;
+ Lisp_Object *mapvec;
+ int previous_items = menu_items_used;
+ pm_menu pmm;
+ char *name;
+
+ length = Flength (maps);
+ len = XINT (length);
+
+ /* Convert the list MAPS into a vector MAPVEC. */
+ mapvec = (Lisp_Object *) alloca (len * sizeof (Lisp_Object));
+ for (i = 0; i < len; i++)
+ {
+ mapvec[i] = Fcar (maps);
+ maps = Fcdr (maps);
+ }
+
+ menu_items_n_panes = 0;
+
+ /* Loop over the given keymaps, making a pane for each map.
+ But don't make a pane that is empty--ignore that map instead. */
+ for (i = 0; i < len; i++)
+ single_keymap_panes (mapvec[i], item_name, item_key, 0);
+
+ name = STRINGP (item_name) ? (char *) XSTRING (item_name)->data : "???";
+ pmm.type = PMMENU_TOP;
+ pmm.item = 0;
+ pmm.str_offset = pmmenu_add_str (name, "", 1);
+ pmm.enable = 1;
+ pmmenu_add (&pmm);
+
+ make_pmmenu (previous_items, 1, 0);
+ }
+
+
+ static void
+ update_frame_menubar (f)
+ FRAME_PTR f;
+ {
+ }
+
+
+ void
+ set_frame_menubar (f, first_time, deep_p)
+ FRAME_PTR f;
+ int first_time;
+ int deep_p;
+ {
+ pm_request pmr;
+ pm_menu pmm;
+ Lisp_Object tail, items;
+ int i;
+ struct buffer *prev = current_buffer;
+ Lisp_Object buffer;
+ int specpdl_count = specpdl_ptr - specpdl;
+ int previous_menu_items_used = f->menu_bar_items_used;
+ Lisp_Object *previous_items
+ = (Lisp_Object *) alloca (previous_menu_items_used
+ * sizeof (Lisp_Object));
+
+ buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer;
+ specbind (Qinhibit_quit, Qt);
+ /* Don't let the debugger step into this code because it is not
+ reentrant. */
+ specbind (Qdebug_on_next_call, Qnil);
+
+ record_unwind_protect (Fstore_match_data, Fmatch_data ());
+ if (NILP (Voverriding_local_map_menu_flag))
+ {
+ specbind (Qoverriding_terminal_local_map, Qnil);
+ specbind (Qoverriding_local_map, Qnil);
+ }
+
+ set_buffer_internal_1 (XBUFFER (buffer));
+
+ /* Run the Lucid hook. */
+ call1 (Vrun_hooks, Qactivate_menubar_hook);
+ /* If it has changed current-menubar from previous value, really
+ recompute the menubar from the value. */
+ if (! NILP (Vlucid_menu_bar_dirty_flag))
+ call0 (Qrecompute_lucid_menubar);
+ safe_run_hooks (Qmenu_bar_update_hook);
+ FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f));
+
+ items = FRAME_MENU_BAR_ITEMS (f);
+
+ inhibit_garbage_collection ();
+
+ /* Save the frame's previous menu bar contents data. */
+ bcopy (XVECTOR (f->menu_bar_vector)->contents, previous_items,
+ previous_menu_items_used * sizeof (Lisp_Object));
+
+ /* Fill in the current menu bar contents. */
+ menu_items = f->menu_bar_vector;
+ menu_items_allocated = XVECTOR (menu_items)->size;
+ init_menu_items ();
+
+ pmmenu_count = 0; pmmenu_str_size = 0;
+
+ for (i = 0; i < XVECTOR (items)->size; i += 4)
+ {
+ Lisp_Object key, string, maps;
+
+ key = XVECTOR (items)->contents[i];
+ string = XVECTOR (items)->contents[i + 1];
+ maps = XVECTOR (items)->contents[i + 2];
+ if (NILP (string))
+ break;
+
+ single_submenu (key, string, maps);
+ }
+
+ finish_menu_items ();
+
+ set_buffer_internal_1 (prev);
+ unbind_to (specpdl_count, Qnil);
+
+ /* If there has been no change in the Lisp-level contents of the
+ menu bar, skip redisplaying it. Just exit. */
+
+ for (i = 0; i < previous_menu_items_used; i++)
+ if (menu_items_used == i
+ || (previous_items[i] != XVECTOR (menu_items)->contents[i]))
+ break;
+
+ if (i == menu_items_used && i == previous_menu_items_used)
+ {
+ menu_items = Qnil;
+ return;
+ }
+
+ f->menu_bar_vector = menu_items;
+ f->menu_bar_items_used = menu_items_used;
+ menu_items = Qnil;
+
+ BLOCK_INPUT;
+
+ pmm.type = PMMENU_END;
+ pmmenu_add (&pmm);
+
+ pmr.menubar.header.type = PMR_MENUBAR;
+ pmr.menubar.header.frame = (unsigned long)f;
+ pmr.menubar.entries = pmmenu_count;
+ pmr.menubar.size = pmmenu_count * sizeof (pm_menu) + pmmenu_str_size;
+ pm_send (&pmr, sizeof (pmr));
+ pm_send (pmmenu_menu, pmmenu_count * sizeof (pm_menu));
+ pm_send (pmmenu_str, pmmenu_str_size);
+
+ update_frame_menubar (f);
+
+ UNBLOCK_INPUT;
+ }
+
+
+ void pm_menubar_selection (FRAME_PTR f, int sel)
+ {
+ menubar_selection_callback (0, (LWLIB_ID)f, sel);
+ }
+
+ x_activate_menubar (f)
+ FRAME_PTR f;
+ {
+ }
+ #endif /* HAVE_PM */
+
#endif /* HAVE_MENUS */
syms_of_xmenu ()
***************
*** 2697,2702 ****
--- 3317,3338 ----
staticpro (&menu_items);
menu_items = Qnil;
+ #ifdef HAVE_PM
+ DEFVAR_BOOL ("pm-align-menu-key-descriptions",
+ &pm_align_menu_key_descriptions,
+ "*Non-nil means align key descriptions in menus.\n\
+ nil means put key descriptions directly after the title of a\n\
+ menu item, in parentheses. You should set this variable\n\
+ in your startup file because it is ignored after computing\n\
+ the keyboard equivalents for menus.");
+ pm_align_menu_key_descriptions = 1;
+
+ DEFVAR_BOOL ("pm-popup-menu-align-top", &pm_popup_menu_align_top,
+ "*Non-nil means put the top item of a popup menu at the mouse position.\n\
+ nil means put the bottom item of a popup menu at the mouse position.");
+ pm_popup_menu_align_top = 1;
+ #endif /* HAVE_PM */
+
Qmenu_alias = intern ("menu-alias");
staticpro (&Qmenu_alias);
***************
*** 2704,2710 ****
--- 3340,3348 ----
staticpro (&Qdebug_on_next_call);
#ifdef USE_X_TOOLKIT
+ #ifndef HAVE_PM
widget_id_tick = (1<<16);
+ #endif /* not HAVE_PM */
next_menubar_widget_id = 1;
#endif