which included commits to RCS files with non-trunk default branches.
To bytecompile both of these files the command is:
xemacs-21.0 -vanilla -batch -f batch-byte-compile \
- lisp-utils/auto-autoloads.el lisp-utils/custom-laod.el
+ lisp-utils/auto-autoloads.el lisp-utils/custom-load.el
** Building XEmacs and XEmacs packages from scratch
===================================================
* Changes in XEmacs 21.2
========================
-** `delete-key-deletes-forward' now defaults to t.
+** The delete key now deletes forward by default.
-`delete-key-deletes-forward' is the variable that regulates the
-behaviour of the delete key on the systems that offer both a backspace
-and a delete key. If set to nil, the key labeled "Delete" will delete
-backward. If set to non-nil, the "Delete" key will delete forward,
-except on keyboards where a "Backspace" key is not provided.
+This is regulated by the variable `delete-key-deletes-forward', which
+now defaults to t. `delete-key-deletes-forward' takes effect only on
+the systems that offer both a backspace and a delete key. If set to
+nil, the key labeled "Delete" will always delete backward. If set to
+non-nil, the "Delete" key will delete forward, except on keyboards
+where a "Backspace" key is not provided (e.g. old DEC keyboards.)
Unless our implementation has bugs, the only reason why you would want
to set `delete-key-deletes-forward' to nil is if you want to use the
searches, like `zap-to-char', `list-matching-lines', `tags-search'
etc. The incremental search facility has always behaved that way.
+** Incremental search will now highlight all visible matches, making
+it easier to anticipate where consecutive C-s or C-r will place the
+point. If you want to disable the feature, set
+`isearch-highlight-all-matches' to nil.
+
+** You can now use the buffer tabs to switch between buffers. The
+tabs are located between the toolbar and the uppermost window, in a
+location called "gutter". If you dislike the buffer tabs, you can
+disable them by specifying:
+
+ (set-specifier default-gutter-visible-p nil)
+
+in your `.emacs'. You can change the location of the gutter with
+`set-default-gutter-position', however currently only MS-Windows
+supports tab widgets with orientations other than vertical..
+
+** When you press RET at a minibuffer prompt that provides a default
+value, the value is stored in history instead of an empty line. Also,
+you can now edit the default value by pressing the down arrow,
+accessing the logical "future" value. Not all minibuffer prompts have
+yet been converted to support this feature.
+
** The rectangle functions have been almost completely rewritten in
order to avoid inserting undesirable spaces, notably at the end of
lines. Two typical examples of the old behavior were
understands the special value `coerce', which means that the line
should not be filled if it is too short to reach the desired column.
-** Incremental search will now highlight all visible matches, making
-it easier to anticipate where consecutive C-s or C-r will place the
-point. If you want to disable the feature, set
-`isearch-highlight-all-matches' to nil.
-
-** You can now customize and save comments for faces and variables.
-In Custom buffers, a new menu entry allows you to add and edit a
-comment. Comments for variables can also be assigned by calling
-`customize-set-(value|variable)' with a prefix argument.
+** Customize now supports adding comments about your face and variable
+settings using a new menu entry. Comments for variables can also be
+assigned by calling `customize-set-(value|variable)' with a prefix
+argument.
** XEmacs now locates the early package hierarchies at
~/.xemacs/mule-packages/ and ~/.xemacs/xemacs-packages/. Previously,
If you set this variable to nil then pressing the Alt key under
MS-Windows will no longer activate the menubar. The default is t.
+** Pixel-based scrolling has been implemented.
+By default this will attempt to scroll in increments equal to the
+height of the default face. Set `window-pixel-scroll-increment' to
+modify this behaviour.
+
** Etags changes.
*** In DOS, etags looks for file.cgz if it cannot find file.c.
*** New option --ignore-case-regex is an alternative to --regex. It is now
possible to bind a regexp to a language, by prepending the regexp with
-{lang}, where lang is one of the languages that `etags --help' prints out.
-This feature is useful especially for regex files, where each line contains
-a regular expression. The manual contains details.
+{lang}, where lang is one of the languages that `etags --help' prints
+out. This feature is useful especially for regex files, where each
+line contains a regular expression. The manual contains details.
*** In C and derived languages, etags creates tags for function
declarations when given the --declarations option.
* Lisp and internal changes in XEmacs 21.2
==========================================
-** A new portable dumper is available.
+** A new portable dumper is available for beta testing.
Olivier Galibert has written a portable dumper for XEmacs, based on
initial work by Kyle Jones. Normally, XEmacs C sources link into an
can try it out by simply running `src/temacs'. If it starts without
failure, the portable dumping worked.
+#### NOTE: the portable dumper is not really usable yet, because the
+state of built-in variables is not yet saved. Olivier promised to fix
+it. Nag, nag.
+
** Much effort has been invested to make XEmacs Lisp faster:
*** Many basic lisp operations are now faster.
buttons, scrollbars, combo boxes, edit fields and progress gauges in a
buffer. As a side effect subwindow support now works once again.
-All of this is still very experimental. This feature is currently
-more complete under MS-Windows.
+All of this is still fairly experimental and there is no
+documentation. The current APIs might change in a future version of
+XEmacs. Some widgets are only available under MS-Windows. See the
+file glyphs-test.el in the XEmacs src distribution for examples of
+usage.
-** user-init-directory is now an absolute, unexpanded path.
-Previously, `user-init-directory' used to be relative to
-(concat "~" init-file-user). This turned out to be too complicated
-for most packages (and some core Lisp files) to use correctly.
+The buffers-tab functionality and progress gauge have been implemented
+using this feature.
-Also, `init-file-user' has been obsoleted in the process.
+** `user-init-file' and `user-init-directory' are now absolute
+file/directory names. Previously, both variables used to be relative
+to (concat "~" init-file-user). This turned out to be too complicated
+for most packages (and some core Lisp files) to use correctly. Also,
+the `init-file-user' variable has been obsoleted in the process.
+
+The user-visible options like `-u' have not changed their behaviour.
** XEmacs finally has an automated test suite!
Although this is not yet very sophisticated, it is already responsible
`base64-encode-region', `base64-encode-string', `base64-decode-region'
and `base64-decode-string'.
+** The functions `read-string', `read-expression', `eval-minibuffer',
+`read-variable', `read-command', `read-function', `read-number',
+`read-shell-command', `read-from-minibuffer', and `completing-read'
+now take an additional argument which specifies the default value. If
+this argument is non-nil, it should be a string; that string is used
+in two ways:
+
+ It is returned if the user enters empty input.
+ It is available through the history command M-n.
+
+** LDAP changes.
+
+*** The LDAP interface now consists of two layers, a low-level layer
+that closely matches the LDAP C API, and a more convenient
+higher-level set of functions.
+
+*** The low-level functions that used to be named *-internal are now
+named more simply: `ldap-open', `ldap-close', `ldap-search-basic',
+`ldap-add', and `ldap-modify'. They should be used directly for very
+specific purposes (such as multiple operations on a connection) only.
+
+*** The higher-level functions provide a more convenient way to access
+LDAP directories hiding the subtleties of handling the connection,
+translating arguments and ensuring compliance with LDAP
+internationalization rules and formats (currently partly implemented
+only.) This layer provides atomic operations for searches,
+modification, addition and deletion of multiple entries at once:
+`ldap-search-entries', `ldap-add-entries', `ldap-delete-entries', and
+`ldap-modify-entries'.
+
+*** To maintain compatibility with previous code, the now obsolete
+function `ldap-search' is now merely a wrapper that calls either
+`ldap-search-basic' or `ldap-search-entries'. Please don't use the
+`ldap-search' function in your new programs -- a direct call to one of
+the two replacements is more efficient and unambiguous.
+
** The arguments to `locate-file' are now more Lisp-like. As before,
the usage is:
+2000-02-07 Martin Buchholz <martin@xemacs.org>
+
+ * XEmacs 21.2.28 is released.
+
+2000-02-06 Martin Buchholz <martin@xemacs.org>
+
+ * getopt.h:
+ * fakemail.c:
+ * gnuslib.c:
+ * sorted-doc.c:
+ * yow.c:
+ * cvtmail.c:
+ * movemail.c:
+ * gnuclient.c:
+ ANSIfy. Use coding standards for function definitions.
+ Make C++-compilable. Modified from patch by Zack Weinberg.
+
+2000-01-26 Kirill 'Big K' Katsnelson <kkm@dtmx.com>
+
+ * hexl.c: Removed MSDOS code; set binary I/O flags for NT.
+
2000-01-18 Martin Buchholz <martin@xemacs.org>
* XEmacs 21.2.27 is released.
#include <string.h>
#include <stdlib.h>
-static void *xmalloc (unsigned int);
-static void *xrealloc (char *ptr, unsigned int);
+static void *xmalloc (size_t);
+static void *xrealloc (void *, size_t);
static void skip_to_lf (FILE *stream);
static void fatal (CONST char *s1, CONST char *s2);
static void error (CONST char *s1, CONST char *s2);
}
static void
-skip_to_lf (stream)
- FILE *stream;
+skip_to_lf (FILE *stream)
{
register int c;
while ((c = getc(stream)) != '\n')
}
static void *
-xmalloc (size)
- unsigned size;
+xmalloc (size_t size)
{
- char *result = (char *) malloc (size);
+ void *result = malloc (size);
if (!result)
fatal ("virtual memory exhausted", 0);
return result;
}
static void *
-xrealloc (ptr, size)
- char *ptr;
- unsigned size;
+xrealloc (void *ptr, size_t size)
{
- char *result = (char *) realloc (ptr, size);
+ void *result = realloc (ptr, size);
if (!result)
fatal ("virtual memory exhausted", 0);
return result;
switch (sm)
{
case 0: /* Start of case - string leading whitespace */
- if (isspace (*str))
+ if (isspace ((unsigned char) *str))
str++;
else
{
break;
case 1: /* Non-whitespace character. Mark the start */
- if (isspace (*str))
+ if (isspace ((unsigned char) *str))
{
/* Reached the end of the argument. Add it. */
int l = str-s;
struct linebuffer
{
- long size;
+ size_t size;
char *buffer;
};
/* Like malloc but get fatal error if memory is exhausted. */
-static char *
+static void *
xmalloc (size_t size)
{
- char *result = (char *) malloc (size);
- if (result == ((char *) NULL))
+ void *result = malloc (size);
+ if (result == NULL)
fatal ("virtual memory exhausted", (char *) 0);
return result;
}
-static char *
-xrealloc (char *ptr, size_t size)
+static void *
+xrealloc (void *ptr, size_t size)
{
- char *result = realloc (ptr, ((unsigned) size));
- if (result == ((char *) NULL))
+ void *result = realloc (ptr, size);
+ if (result == NULL)
fatal ("virtual memory exhausted", (char *) 0);
return result;
}
init_linebuffer (struct linebuffer *linebuffer)
{
linebuffer->size = INITIAL_LINE_SIZE;
- linebuffer->buffer = ((char *) xmalloc (INITIAL_LINE_SIZE));
+ linebuffer->buffer = (char *) xmalloc (INITIAL_LINE_SIZE);
}
/* Read a line of text from `stream' into `linebuffer'.
if (p == end)
{
linebuffer->size *= 2;
- buffer = ((char *) xrealloc ((char *) buffer,
- (size_t) (linebuffer->size)));
+ buffer = (char *) xrealloc (buffer, linebuffer->size);
p = buffer + (p - linebuffer->buffer);
end = buffer + linebuffer->size;
linebuffer->buffer = buffer;
has_keyword (char *field)
{
char *ignored;
- return (get_keyword (field, &ignored) != ((char *) NULL));
+ return (get_keyword (field, &ignored) != (char *) NULL);
}
static char *
if (the_stream != ((FILE *) NULL))
{
add_a_stream (the_stream, my_fclose);
- if (the_user == ((char *) NULL))
+ if (the_user == (char *) NULL)
file_preface = make_file_preface ();
write_line_list (file_preface, the_stream);
return true;
my_name = MY_NAME;
the_streams = ((stream_list) NULL);
- the_date = ((char *) NULL);
- the_user = ((char *) NULL);
+ the_date = (char *) NULL;
+ the_user = (char *) NULL;
the_header = read_header ();
command_line = alloc_string ((size_t) (name_length +
the_pipe = popen (command_line, "w");
if (the_pipe == ((FILE *) NULL))
- fatal ("cannot open pipe to real mailer", (char *) 0);
+ fatal ("cannot open pipe to real mailer", (char *) NULL);
add_a_stream (the_pipe, pclose);
#define required_argument 1
#define optional_argument 2
-#if defined (__STDC__) && __STDC__
-#ifdef __GNU_LIBRARY__
+#if defined (__GNU_LIBRARY__) || defined (__cplusplus)
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation
errors, only prototype getopt for the GNU C library. */
extern int getopt (int argc, char *const *argv, const char *shortopts);
-#else /* not __GNU_LIBRARY__ */
+#else /* not __GNU_LIBRARY__ || C++ */
extern int getopt ();
-#endif /* __GNU_LIBRARY__ */
+#endif /* __GNU_LIBRARY__ || C++ */
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
const struct option *longopts, int *longind);
extern int getopt_long_only (int argc, char *const *argv,
const char *shortopts,
const struct option *longopts, int *longind,
int long_only);
-#else /* not __STDC__ */
-extern int getopt ();
-extern int getopt_long ();
-extern int getopt_long_only ();
-
-extern int _getopt_internal ();
-#endif /* __STDC__ */
#ifdef __cplusplus
}
over = 1; \
} while (0)
-/* A strdup immitation. */
+/* A strdup imitation. */
static char *
my_strdup (CONST char *s)
{
- char *new = malloc (strlen (s) + 1);
- if (new)
- strcpy (new, s);
- return new;
+ char *new_s = (char *) malloc (strlen (s) + 1);
+ if (new_s)
+ strcpy (new_s, s);
+ return new_s;
}
int
}
filename_expand (fullpath, argv[i]);
#ifdef INTERNET_DOMAIN_SOCKETS
- path = malloc (strlen (remotepath) + strlen (fullpath) + 1);
+ path = (char *) malloc (strlen (remotepath) + strlen (fullpath) + 1);
sprintf (path, "%s%s", remotepath, fullpath);
#else
path = my_strdup (fullpath);
memset((char *)&peer,0,sizeof(struct sockaddr_in));
- if ((s = accept(ls,(struct sockaddr *)&peer, (void *) &addrlen)) == -1)
+ if ((s = accept(ls,(struct sockaddr *)&peer, &addrlen)) == -1)
{
perror(progname);
fprintf(stderr,"%s: unable to accept\n",progname);
server.sun_family = AF_UNIX;
- if ((s = accept(ls,(struct sockaddr *)&server, (void *)&len)) < 0)
+ if ((s = accept(ls,(struct sockaddr *)&server, &len)) < 0)
{
perror(progname);
fprintf(stderr,"%s: unable to accept\n",progname);
char *progname = NULL;
-int make_connection(hostarg, portarg, s)
- char *hostarg;
- int portarg;
- int *s;
+int
+make_connection (char *hostarg, int portarg, int *s)
{
#ifdef INTERNET_DOMAIN_SOCKETS
char *ptr;
connect_to_ipc_server -- establish connection with server process via SYSV IPC
Returns msqid for server if successful.
*/
-static int connect_to_ipc_server (void)
+static int
+connect_to_ipc_server (void)
{
int s; /* connected msqid */
key_t key; /* message key */
disconnect_from_ipc_server -- inform the server that sending has finished,
and wait for its reply.
*/
-void disconnect_from_ipc_server(s,msgp,echo)
- int s;
- struct msgbuf *msgp;
- int echo;
+void
+disconnect_from_ipc_server (int s, struct msgbuf *msgp, int echo)
{
int len; /* length of received message */
/*
send_string -- send string to socket.
*/
-void send_string(s,msg)
- int s;
- CONST char *msg;
+void
+send_string (int s, CONST char *msg)
{
#if 0
if (send(s,msg,strlen(msg),0) < 0) {
/*
read_line -- read a \n terminated line from a socket
*/
-int read_line(int s, char *dest)
+int
+read_line (int s, char *dest)
{
int length;
int offset=0;
domain socket. Returns socket descriptor for server
if successful.
*/
-static int connect_to_unix_server (void)
+static int
+connect_to_unix_server (void)
{
int s; /* connected socket descriptor */
struct sockaddr_un server; /* for unix connections */
internet_addr -- return the internet addr of the hostname or
internet address passed. Return -1 on error.
*/
-int internet_addr(host)
- char *host;
+int
+internet_addr (char *host)
{
struct hostent *hp; /* pointer to host info for remote host */
IN_ADDR numeric_addr; /* host address */
an internet domain socket. Returns socket
descriptor for server if successful.
*/
-static int connect_to_internet_server (char *serverhost, u_short port)
+static int
+connect_to_internet_server (char *serverhost, u_short port)
{
int s; /* connected socket descriptor */
struct servent *sp; /* pointer to service information */
disconnect_from_server -- inform the server that sending has finished, and wait for
its reply.
*/
-void disconnect_from_server(s,echo)
- int s;
- int echo;
+void
+disconnect_from_server (int s, int echo)
{
#if 0
char buffer[REPLYSIZ+1];
#include <stdio.h>
#include <ctype.h>
-#ifdef MSDOS
+#ifdef WINDOWSNT
+#include <io.h>
#include <fcntl.h>
#endif
{
char buf[18];
-#ifdef MSDOS
- (stdout)->_flag &= ~_IOTEXT; /* print binary */
- _setmode (fileno (stdout), O_BINARY);
+#ifdef WINDOWSNT
+ _setmode (_fileno (stdout), O_BINARY);
#endif
for (;;)
{
}
else
{
-#ifdef MSDOS
- (fp)->_flag &= ~_IOTEXT; /* read binary */
- _setmode (fileno (fp), O_BINARY);
+#ifdef WINDOWSNT
+ _setmode (_fileno (fp), O_BINARY);
#endif
address = 0;
string[0] = ' ';
/* Skip until the first newline; remember the two previous chars. */
while (c != '\n' && c >= 0)
{
- /* ### Kludge -- Ignore any ESC x x ISO2022 sequences */
+ /* #### Kludge -- Ignore any ESC x x ISO2022 sequences */
if (c == 27)
{
getc (infile);
"string" ... ;###translate
where the magic token ";###translate" on a line means that the string
- constant on this line should go into the message catalog. This is analagous
+ constant on this line should go into the message catalog. This is analogous
to the magic ";###autoload" comments, and to the magic comments used in the
EPSF structuring conventions.
#ifdef MAIL_USE_POP
static int popmail (char *, char *, char *);
static int pop_retr (popserver server, int msgno,
- int (*action)(char *, FILE *), void *arg);
+ int (*action)(char *, FILE *), FILE *arg);
static int mbx_write (char *, FILE *);
static int mbx_delimit_begin (FILE *);
static int mbx_delimit_end (FILE *);
return (1);
}
#if !defined(__CYGWIN32__) && !defined(WINDOWSNT)
- fchown (mbfi, getuid (), -1);
+ fchown (mbfi, getuid (), (gid_t) -1);
#endif
if ((mbf = fdopen (mbfi, "wb")) == NULL)
}
static int
-pop_retr (popserver server, int msgno, int (*action)(char *, FILE *), void *arg)
+pop_retr (popserver server, int msgno, int (*action)(char *, FILE *), FILE *arg)
{
char *line;
int ret;
#include <stdio.h>
#include <ctype.h>
-#if __STDC__ || defined(STDC_HEADERS)
-# include <stdlib.h> /* for qsort() and malloc() */
-# include <string.h>
-static void *xmalloc (int);
-# ifndef CONST
-# define CONST const
-# endif
-#else
-extern char *malloc ();
-static void *xmalloc ();
-# ifndef CONST
-# define CONST
-# endif
+#include <stdlib.h> /* for qsort() and malloc() */
+#include <string.h>
+static void *xmalloc (size_t);
+#ifndef CONST
+# define CONST const
#endif
#define NUL '\0'
#define DEBUG 0
-typedef struct line LINE;
+typedef struct LINE LINE;
-struct line
+struct LINE
{
LINE *next; /* ptr to next or NULL */
char *line; /* text of the line */
/* Like malloc but get fatal error if memory is exhausted. */
static void *
-xmalloc (int size)
+xmalloc (size_t size)
{
- char *result = malloc ((unsigned)size);
+ void *result = malloc (size);
if (result == NULL)
fatal ("%s", "virtual memory exhausted");
return result;
static char *
strsav (char *str)
{
- char *buf = xmalloc (strlen (str) + 1);
- (void) strcpy (buf, str);
- return (buf);
+ char *buf = (char *) xmalloc (strlen (str) + 1);
+ strcpy (buf, str);
+ return buf;
}
/* Comparison function for qsort to call. */
/* Sets len and header_len */
void
-setup_yow(fp)
- FILE *fp;
+setup_yow (FILE *fp)
{
int c;
/* go to a random place in the file and print the quotation there */
void
-yow (fp)
- FILE *fp;
+yow (FILE *fp)
{
long offset;
int c, i = 0;
(print-short "ChangGil Han" "cghan@phys401.phys.pusan.ac.kr")
(print-short "Derek Harding" "dharding@lssec.bt.co.uk")
(print-short "Michael Harnois" "mharnois@sbt.net")
+ (print-short "Yoshiki Hayashi" "yoshiki@xemacs.org")
(print-short "John Haxby" "J.Haxby@isode.com")
(print-short "Karl M. Hegbloom" "karlheg@inetarena.com")
(print-short "Benedikt Heinen" "beh@icemark.thenet.ch")
;; save file in the same directory as FILENAME. But if this
;; directory is not writable, use auto-save-directory-fallback.
;; FILENAME is assumed to be in non-directory form (no trailing slash).
- ;; It may be a name without a directory part (pesumably it really
+ ;; It may be a name without a directory part (presumably it really
;; comes from a buffer name then), the fallback is used then.
;; Optional PREFIX is string to use instead of "#" to prefix name.
(let ((directory (file-name-directory filename)))
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with XEmacs; see the file COPYING. If not, write to the
+;; along with XEmacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;; You can, however, make a faster pig."
;;
;; Or, to put it another way, the emacs byte compiler is a VW Bug. This code
-;; makes it be a VW Bug with fuel injection and a turbocharger... You're
+;; makes it be a VW Bug with fuel injection and a turbocharger... You're
;; still not going to make it go faster than 70 mph, but it might be easier
;; to get it there.
;;
;; Simple defsubsts often produce forms like
;; (let ((v1 (f1)) (v2 (f2)) ...)
;; (FN v1 v2 ...))
-;; It would be nice if we could optimize this to
+;; It would be nice if we could optimize this to
;; (FN (f1) (f2) ...)
;; but we can't unless FN is dynamically-safe (it might be dynamically
;; referring to the bindings that the lambda arglist established.)
;; One of the uncountable lossages introduced by dynamic scope...
;;
-;; Maybe there should be a control-structure that says "turn on
+;; Maybe there should be a control-structure that says "turn on
;; fast-and-loose type-assumptive optimizations here." Then when
;; we see a form like (car foo) we can from then on assume that
;; the variable foo is of type cons, and optimize based on that.
-;; But, this won't win much because of (you guessed it) dynamic
+;; But, this won't win much because of (you guessed it) dynamic
;; scope. Anything down the stack could change the value.
;; (Another reason it doesn't work is that it is perfectly valid
;; to call car with a null argument.) A better approach might
;;
;; However, if there was even a single let-binding around the COND,
;; it could not be byte-compiled, because there would be an "unbind"
-;; byte-op between the final "call" and "return." Adding a
+;; byte-op between the final "call" and "return." Adding a
;; Bunbind_all byteop would fix this.
;;
;; (defun foo (x y z) ... (foo a b c))
;;
;; Wouldn't it be nice if Emacs Lisp had lexical scope.
;;
-;; Idea: the form (lexical-scope) in a file means that the file may be
-;; compiled lexically. This proclamation is file-local. Then, within
+;; Idea: the form (lexical-scope) in a file means that the file may be
+;; compiled lexically. This proclamation is file-local. Then, within
;; that file, "let" would establish lexical bindings, and "let-dynamic"
;; would do things the old way. (Or we could use CL "declare" forms.)
;; We'd have to notice defvars and defconsts, since those variables should
;; in the file being compiled (doing a boundp check isn't good enough.)
;; Fdefvar() would have to be modified to add something to the plist.
;;
-;; A major disadvantage of this scheme is that the interpreter and compiler
-;; would have different semantics for files compiled with (dynamic-scope).
+;; A major disadvantage of this scheme is that the interpreter and compiler
+;; would have different semantics for files compiled with (dynamic-scope).
;; Since this would be a file-local optimization, there would be no way to
-;; modify the interpreter to obey this (unless the loader was hacked
+;; modify the interpreter to obey this (unless the loader was hacked
;; in some grody way, but that's a really bad idea.)
;;
;; HA! RMS removed the following paragraph from his version of
;; byte-optimize.el.
;;
;; Really the Right Thing is to make lexical scope the default across
-;; the board, in the interpreter and compiler, and just FIX all of
+;; the board, in the interpreter and compiler, and just FIX all of
;; the code that relies on dynamic scope of non-defvarred variables.
;; Other things to consider:
;; error free also they may act as true-constants.
;;(disassemble #'(lambda (x) (and (point) (foo))))
-;; When
+;; When
;; - all but one arguments to a function are constant
;; - the non-constant argument is an if-expression (cond-expression?)
;; then the outer function can be distributed. If the guarding
(cons fn (cdr form)))))))
;;; ((lambda ...) ...)
-;;;
+;;;
(defun byte-compile-unfold-lambda (form &optional name)
(or name (setq name "anonymous lambda"))
(let ((lambda (car form))
(byte-compile-warn
"attempt to open-code %s with too many arguments" name))
form)
- (let ((newform
+ (let ((newform
(if bindings
(cons 'let (cons (nreverse bindings) body))
(cons 'progn body))))
(cons (byte-optimize-form (nth 1 form) t)
(cons (byte-optimize-form (nth 2 form) for-effect)
(byte-optimize-body (cdr (cdr (cdr form))) t)))))
-
+
((memq fn '(save-excursion save-restriction save-current-buffer))
;; those subrs which have an implicit progn; it's not quite good
;; enough to treat these like normal function calls.
;; This can turn (save-excursion ...) into (save-excursion) which
;; will be optimized away in the lap-optimize pass.
(cons fn (byte-optimize-body (cdr form) for-effect)))
-
+
((eq fn 'with-output-to-temp-buffer)
;; this is just like the above, except for the first argument.
(cons fn
(cons
(byte-optimize-form (nth 1 form) nil)
(byte-optimize-body (cdr (cdr form)) for-effect))))
-
+
((eq fn 'if)
(cons fn
(cons (byte-optimize-form (nth 1 form) nil)
(cons
(byte-optimize-form (nth 2 form) for-effect)
(byte-optimize-body (nthcdr 3 form) for-effect)))))
-
+
((memq fn '(and or)) ; remember, and/or are control structures.
;; take forms off the back until we can't any more.
;; In the future it could conceivably be a problem that the
(byte-compile-warn "misplaced interactive spec: %s"
(prin1-to-string form))
nil)
-
+
((memq fn '(defun defmacro function
condition-case save-window-excursion))
;; These forms are compiled as constants or by breaking out
(cons fn
(cons (byte-optimize-form (nth 1 form) for-effect)
(cdr (cdr form)))))
-
+
((eq fn 'catch)
;; the body of a catch is compiled (and thus optimized) as a
;; top-level form, so don't do it here. The tag is never
(setq form (macroexpand form
byte-compile-macro-environment))))
(byte-optimize-form form for-effect))
-
+
((not (symbolp fn))
(or (eq 'mocklisp (car-safe fn)) ; ha!
(byte-compile-warn "%s is a malformed function"
;; appending a nil here might not be necessary, but it can't hurt.
(byte-optimize-form
(cons 'progn (append (cdr form) '(nil))) t))
-
+
(t
;; Otherwise, no args can be considered to be for-effect,
;; even if the called function is for-effect, because we
((keywordp ,form))))
;; If the function is being called with constant numeric args,
-;; evaluate as much as possible at compile-time. This optimizer
+;; evaluate as much as possible at compile-time. This optimizer
;; assumes that the function is associative, like + or *.
(defun byte-optimize-associative-math (form)
(let ((args nil)
(cons (/ (nth 1 form) last)
(butlast (cdr (cdr form)))))
last nil))))
- (cond
+ (cond
;;; ((null (cdr (cdr form)))
;;; (nth 1 form))
((eq (nth 1 form) 0)
(put 'stringp 'byte-optimizer 'byte-optimize-predicate)
(put 'string< 'byte-optimizer 'byte-optimize-predicate)
(put 'string-lessp 'byte-optimizer 'byte-optimize-predicate)
+(put 'length 'byte-optimizer 'byte-optimize-predicate)
(put 'logand 'byte-optimizer 'byte-optimize-logmumble)
(put 'logior 'byte-optimizer 'byte-optimize-logmumble)
(put 'cdr-safe 'byte-optimizer 'byte-optimize-predicate)
-;; I'm not convinced that this is necessary. Doesn't the optimizer loop
+;; I'm not convinced that this is necessary. Doesn't the optimizer loop
;; take care of this? - Jamie
;; I think this may some times be necessary to reduce eg. (quote 5) to 5,
;; so arithmetic optimizers recognize the numeric constant. - Hallvard
;; Remove any reason for avoiding `char-before'.
(defun byte-optimize-char-before (form)
`(char-after (1- ,(or (nth 1 form) '(point))) ,@(cdr (cdr form))))
-
+
(put 'char-before 'byte-optimizer 'byte-optimize-char-before)
;; byte-compile-negation-optimizer lives in bytecomp.el
(setq form (list 'cdr form)))
form)))
\f
-;;; enumerating those functions which need not be called if the returned
+;;; enumerating those functions which need not be called if the returned
;;; value is not used. That is, something like
;;; (progn (list (something-with-side-effects) (yow))
;;; (foo))
length log log10 logand logb logior lognot logxor lsh
marker-buffer max member memq min mod
next-window nth nthcdr number-to-string
- parse-colon-path previous-window
+ parse-colon-path plist-get previous-window
radians-to-degrees rassq regexp-quote reverse round
sin sqrt string< string= string-equal string-lessp string-to-char
string-to-int string-to-number substring symbol-plist
abs expt signum last butlast ldiff
pairlis gcd lcm
isqrt floor* ceiling* truncate* round* mod* rem* subseq
- list-length get* getf
+ list-length getf
))
(side-effect-and-error-free-fns
'(arrayp atom
byte-current-buffer byte-interactive-p))
(defconst byte-compile-side-effect-free-ops
- (nconc
+ (nconc
'(byte-varref byte-nth byte-memq byte-car byte-cdr byte-length byte-aref
byte-symbol-value byte-get byte-concat2 byte-concat3 byte-sub1 byte-add1
byte-eqlsign byte-gtr byte-lss byte-leq byte-geq byte-diff byte-negate
;;; varbind pop-up-windows
;;; not
;;;
-;;; we break the program, because it will appear that pop-up-windows and
+;;; we break the program, because it will appear that pop-up-windows and
;;; old-pop-ups are not EQ when really they are. So we have to know what
;;; the BOOL variables are, and not perform this optimization on them.
;;;
;; goto-X-if-non-nil goto-Y X: --> goto-Y-if-nil X:
;;
;; it is wrong to do the same thing for the -else-pop variants.
- ;;
+ ;;
((and (or (eq 'byte-goto-if-nil (car lap0))
(eq 'byte-goto-if-not-nil (car lap0))) ; gotoX
(eq 'byte-goto (car lap1)) ; gotoY
str (concat str " %s")
i (1+ i))))
(if opt-p
- (let ((tagstr
+ (let ((tagstr
(if (eq 'TAG (car (car tmp)))
(format "%d:" (car (cdr (car tmp))))
(or (car tmp) ""))))
(byte-goto-if-not-nil-else-pop .
byte-goto-if-nil-else-pop))))
newtag)
-
+
(nth 1 newtag)
)
(setcdr tmp (cons (setcdr lap0 newtag) (cdr tmp)))
;; XEmacs: our `get' groks DEFAULT.
(defalias 'get* 'get)
-(defun getf (plist tag &optional def)
- "Search PROPLIST for property PROPNAME; return its value or DEFAULT.
-PROPLIST is a list of the sort returned by `symbol-plist'."
+(defun getf (plist property &optional default)
+ "Search PLIST for property PROPERTY; return its value or DEFAULT.
+PLIST is a list of the sort returned by `symbol-plist'."
(setplist '--cl-getf-symbol-- plist)
- (or (get '--cl-getf-symbol-- tag)
- (and def (get* '--cl-getf-symbol-- tag def))))
+ (get '--cl-getf-symbol-- property default))
(defun cl-set-getf (plist tag val)
(let ((p plist))
(setq form (list 'cons (car args) form)))
form))
-(define-compiler-macro get* (sym prop &optional def)
- (if def
- (list 'getf (list 'symbol-plist sym) prop def)
- (list 'get sym prop)))
+(define-compiler-macro get* (sym prop &optional default)
+ (list 'get sym prop default))
(define-compiler-macro typep (&whole form val type)
(if (cl-const-expr-p type)
; abs expt signum last butlast ldiff
; pairlis gcd lcm
; isqrt floor* ceiling* truncate* round* mod* rem* subseq
-; list-length get* getf))
+; list-length getf))
; (put fun 'side-effect-free t))
;;; Things that are side-effect-and-error-free. Moved to byte-optimize.el
;;; Code:
-(eval-when-compile
- (defvar buffer-file-type)
- (defvar binary-process-output))
-
(defvar process-coding-system-alist nil
"Alist to decide a coding system to use for a process I/O operation.
The format is ((PATTERN . VAL) ...),
you quit again before the process exits."
(let ((temp
(make-temp-name
- (concat (file-name-as-directory (temp-directory))
- (if (memq system-type '(ms-dos windows-nt)) "em" "emacs")))))
+ (concat (file-name-as-directory (temp-directory)) "emacs"))))
(unwind-protect
(let (cs-r cs-w)
(let (ret)
(or coding-system-for-read cs-r))
(coding-system-for-write
(or coding-system-for-write cs-w)))
- (if (memq system-type '(ms-dos windows-nt))
- (let ((buffer-file-type binary-process-output))
- (write-region start end temp nil 'silent))
- (write-region start end temp nil 'silent))
+ (write-region start end temp nil 'silent)
(if deletep (delete-region start end))
(apply #'call-process program temp buffer displayp args)))
(ignore-file-errors (delete-file temp)))))
(or coding-system-for-write cs-w)))
(open-network-stream-internal name buffer host service protocol))))
-;;; mule-process.el ends here
+;;; code-process.el ends here
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with XEmacs; see the file COPYING. If not, write to the
+;; along with XEmacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
"Return the base coding system of CODING-SYSTEM."
(if (not (coding-system-eol-type coding-system))
coding-system
- (find-coding-system
+ (find-coding-system
(intern
- (substring
+ (substring
(symbol-name (coding-system-name coding-system))
0
(string-match "-unix$\\|-dos$\\|-mac$"
"Automatic conversion."
'(mnemonic "Auto"))
-;; these are so that gnus and friends work when not mule
-(or (featurep 'mule)
- (progn
- (copy-coding-system 'undecided 'iso-8859-1)
- (copy-coding-system 'undecided 'iso-8859-2)))
+;;; Make certain variables equivalent to coding-system aliases
+(defun dontusethis-set-value-file-name-coding-system-handler (sym args fun harg handlers)
+ (define-coding-system-alias 'file-name (or (car args) 'binary)))
+
+(dontusethis-set-symbol-value-handler
+ 'file-name-coding-system
+ 'set-value
+ 'dontusethis-set-value-file-name-coding-system-handler)
+
+(defun dontusethis-set-value-terminal-coding-system-handler (sym args fun harg handlers)
+ (define-coding-system-alias 'terminal (or (car args) 'binary)))
+
+(dontusethis-set-symbol-value-handler
+ 'terminal-coding-system
+ 'set-value
+ 'dontusethis-set-value-terminal-coding-system-handler)
+
+(defun dontusethis-set-value-keyboard-coding-system-handler (sym args fun harg handlers)
+ (define-coding-system-alias 'keyboard (or (car args) 'binary)))
+
+(dontusethis-set-symbol-value-handler
+ 'keyboard-coding-system
+ 'set-value
+ 'dontusethis-set-value-keyboard-coding-system-handler)
+
+(unless (boundp 'file-name-coding-system)
+ (setq file-name-coding-system nil))
+
+(when (not (featurep 'mule))
+ ;; these are so that gnus and friends work when not mule
+ (copy-coding-system 'undecided 'iso-8859-1)
+ (copy-coding-system 'undecided 'iso-8859-2)
+
+ (define-coding-system-alias 'ctext 'binary))
+
;; compatibility for old XEmacsen (don't use it)
(copy-coding-system 'undecided 'automatic-conversion)
(custom-unlispify-menu-entry symbol t)))
(defun custom-prefix-add (symbol prefixes)
- ;; Addd SYMBOL to list of ignored PREFIXES.
+ ;; Add SYMBOL to list of ignored PREFIXES.
(cons (or (get symbol 'custom-prefix)
(concat (symbol-name symbol) "-"))
prefixes))
(defun custom-browse-insert-prefix (prefix)
"Insert PREFIX. On XEmacs convert it to line graphics."
- ;; ### Unfinished.
+ ;; #### Unfinished.
(if nil ; (string-match "XEmacs" emacs-version)
(progn
(insert "*")
(widget-put widget :custom-magic magic)
(push magic buttons))
;; Insert documentation.
- ;; ### NOTE: this is ugly!!!! I need to do update the :buttons property
+ ;; #### NOTE: this is ugly!!!! I need to do update the :buttons property
;; before the call to `widget-default-format-handler'. Otherwise, I
;; loose my current `buttons'. This function shouldn't be called like
;; this anyway. The doc string widget should be added like the others.
pm)
(const :format "MSWindows "
:sibling-args (:help-echo "\
-Windows NT/95/97")
+Microsoft Windows, displays")
mswindows)
- (const :format "DOS "
+ (const :format "MSPrinter "
:sibling-args (:help-echo "\
-Plain MS-DOS")
- pc)
+Microsoft Windows, printers")
+ msprinter)
(const :format "TTY%n"
:sibling-args (:help-echo "\
Plain text terminals")
tty)))
(group :sibling-args (:help-echo "\
+Only match display or printer devices")
+ (const :format "Output: "
+ class)
+ (checklist :inline t
+ :offset 0
+ (const :format "Display "
+ :sibling-args (:help-echo "\
+Match display devices")
+ display)
+ (const :format "Printer%n"
+ :sibling-args (:help-echo "\
+Match printer devices")
+ printer)))
+ (group :sibling-args (:help-echo "\
Only match the frames with the specified color support")
- (const :format "Class: "
+ (const :format "Color support: "
class)
(checklist :inline t
:offset 0
(princ "\n '(")
(prin1 symbol)
(princ " ")
- ;; This comment stuf is in the way ####
+ ;; This comment stuff is in the way ####
;; Is (eq (third spec) (car saved-value)) ????
;; (prin1 (third spec))
(prin1 (car (get symbol 'saved-value)))
(defun custom-theme-value (theme theme-spec-list)
"Determine the value for THEME defined by THEME-SPEC-LIST.
Returns (list value) if found. Nil otherwise."
- ;; Note we do _NOT_ singal an error if the theme is unkown
+ ;; Note we do _NOT_ signal an error if the theme is unknown
;; it might have gone away without the user knowing.
(let ((theme-or-lower (memq theme (cons 'user custom-loaded-themes)))
value)
;;; Code:
+;;; Initialization
+
+; Specifier tag 'printer which matches printers
+(define-specifier-tag 'printer (function device-printer-p))
+
+; Specifier tag 'display which matches displays
+(define-specifier-tag 'display (function
+ (lambda (device)
+ (not (device-printer-p device)))))
+
+;;; Functions
+
(defun device-list ()
"Return a list of all devices."
(apply 'nconc (mapcar 'console-device-list (console-list))))
Value is `tty' for a tty device (a character-only terminal),
`x' for a device that is a screen on an X display,
`ns' for a device that is a NeXTstep connection (not yet implemented),
-`mswindows' for a device that is a Windows or Windows NT connection,
-`pc' for a device that is a direct-write MS-DOS screen (not yet implemented),
+`mswindows' for a device that is a MS Windows workstation,
+`msprinter' for a device that is a MS Windows printer connection,
`stream' for a stream device (which acts like a stdio stream), and
`dead' for a deleted device."
(or device (setq device (selected-device)))
(defun call-device-method (name device &rest args)
"Call a DEVICE-specific function with the generic name NAME.
-If DEVICE is not provide the selected device is used."
+If DEVICE is not provided then the selected device is used."
(or device (setq device (selected-device)))
(or (symbolp name) (error "function name must be a symbol"))
(let ((devmeth (intern (concat (symbol-name
;; 02111-1307, USA.
;;; Synched up with: Not synched with FSF but coordinated with the FSF
-;;; easymenu maintor for compatability with FSF 20.4.
+;;; easymenu maintor for compatibility with FSF 20.4.
;;; Please: Coordinate changes with Inge Frick <inge@nada.kth.se>
;; Commentary:
(format "%s(default %s) " prompt default)
prompt)
tag-completion-table 'tag-completion-predicate nil nil
- 'find-tag-history))
- (if (string-equal tag-name "")
- ;; #### - This is a really LAME way of doing it! --Stig
- default ;indicate exact symbol match
- tag-name)))
+ 'find-tag-history default))
+ tag-name))
(defvar last-tag-data nil
"Information for continuing a tag search.
(get-custom-frame-properties frame))
(initialize-custom-faces frame)))
+(defun startup-initialize-custom-faces ()
+ "Reset faces created by defface. Only called at startup.
+Don't use this function in your program."
+ (when default-custom-frame-properties
+ ;; Reset default value to the actual frame, not stream.
+ (setq default-custom-frame-properties
+ (extract-custom-frame-properties (selected-frame)))
+ ;; like initialize-custom-faces but removes property first.
+ (mapc (lambda (symbol)
+ (let ((spec (or (get symbol 'saved-face)
+ (get symbol 'face-defface-spec))))
+ (when spec
+ ;; Reset faces created during auto-autoloads loading.
+ (reset-face symbol)
+ ;; And set it according to the spec.
+ (face-display-set symbol spec nil))))
+ (face-list))))
+
\f
(defun make-empty-face (name &optional doc-string temporary)
"Like `make-face', but doesn't query the resource database."
;; It's unreasonable to expect to be able to make a font italic all
;; the time. For many languages, italic is an alien concept.
;; Basically, because italic is not a globally meaningful concept,
- ;; the use of the italic face should really be oboleted.
+ ;; the use of the italic face should really be obsoleted.
;; I disagree with above. In many languages, the concept of capital
;; letters is just as alien, and yet we use them. Italic is here to
(skip-chars-forward " \t")
;; Then change all newlines to spaces.
;;; 97/3/14 jhod: Kinsoku change
- ;; Spacing is not necessary for charcters of no word-separater.
+ ;; Spacing is not necessary for characters of no word-separator.
;; The regexp word-across-newline is used for this check.
(defvar word-across-newline)
(if (not (and (featurep 'mule)
Value is `tty' for a tty frame (a character-only terminal),
`x' for a frame that is an X window,
`ns' for a frame that is a NeXTstep window (not yet implemented),
-`mswindows' for a frame that is a Windows NT or Windows 95/97 window,
-`pc' for a frame that is a direct-write MS-DOS frame (not yet implemented),
+`mswindows' for a frame that is a MS Windows desktop window,
+`msprinter' for a frame that is a MS Windows print job,
`stream' for a stream frame (which acts like a stdio stream), and
`dead' for a deleted frame."
(or frame (setq frame (selected-frame)))
This function is used by `describe-function-1' to list function
arguments in the standard Lisp style."
- (let* ((fndef (indirect-function function))
+ (let* ((fnc (indirect-function function))
+ (fndef (if (eq (car-safe fnc) 'macro)
+ (cdr fnc)
+ fnc))
(arglist
- (cond ((compiled-function-p fndef)
- (compiled-function-arglist fndef))
- ((eq (car-safe fndef) 'lambda)
- (nth 1 fndef))
- ((subrp fndef)
- (let* ((doc (documentation function))
- (args (and (string-match
- "[\n\t ]*\narguments: ?(\\(.*\\))\n?\\'"
- doc)
- (match-string 1 doc))))
- ;; If there are no arguments documented for the
- ;; subr, rather don't print anything.
- (cond ((null args) t)
- ((equal args "") nil)
- (args))))
- (t t))))
+ (cond ((compiled-function-p fndef)
+ (compiled-function-arglist fndef))
+ ((eq (car-safe fndef) 'lambda)
+ (nth 1 fndef))
+ ((subrp fndef)
+ (let* ((doc (documentation function))
+ (args (and (string-match
+ "[\n\t ]*\narguments: ?(\\(.*\\))\n?\\'"
+ doc)
+ (match-string 1 doc))))
+ ;; If there are no arguments documented for the
+ ;; subr, rather don't print anything.
+ (cond ((null args) t)
+ ((equal args "") nil)
+ (args))))
+ (t t))))
(cond ((listp arglist)
(prin1-to-string
(cons function (mapcar (lambda (arg)
(if cmd (princ " ")))))
(terpri))))))
-;; Stop gap for 21.0 untill we do help-char etc properly.
+;; Stop gap for 21.0 until we do help-char etc properly.
(defun help-keymap-with-help-key (keymap form)
"Return a copy of KEYMAP with an help-key binding according to help-char
invoking FORM like help-form. An existing binding is not overridden.
;; Massive changes by Christoph Wedler <wedler@fmi.uni-passau.de>
;; Some changes for XEmacs 20.3 by hniksic
-;; ### The maintainer is supposed to be stig, but I haven't seen him
+;; #### The maintainer is supposed to be stig, but I haven't seen him
;; around for ages. The real maintainer for the moment is Hrvoje
;; Niksic <hniksic@xemacs.org>.
;; Return the node name in the buffer following point.
;; ALLOWEDCHARS, if non-nil, goes within [...] to make a regexp
-;; saying which chas may appear in the node name.
+;; saying which chars may appear in the node name.
(defun Info-following-node-name (&optional allowedchars)
(skip-chars-forward " \t")
(buffer-substring
isearch-opoint (point)
search-ring-yank-pointer nil
regexp-search-ring-yank-pointer nil
- isearch-opened-extents nil
+ isearch-unhidden-extents nil
isearch-window-configuration (current-window-configuration)
;; #### What we really need is a buffer-local
(defun isearch-top-state ()
(let ((cmd (car isearch-cmds)))
;; #### Grr, this is so error-prone. If you add something to
- ;; isearch-push-state, don't forget to update this. I thout I'd
+ ;; isearch-push-state, don't forget to update this. I thought I'd
;; make a list of variables, and just do (mapcar* #'set vars
;; values), but the (point) thing would spoil it, leaving to more
;; complication.
(defun isearch-make-extent (begin end)
(let ((x (make-extent begin end (current-buffer))))
- ;; make the isearch extent always take prescedence over any mouse-
+ ;; make the isearch extent always take precedence over any mouse-
;; highlighted extents we may be passing through, since isearch, being
;; modal, is more interesting (there's nothing they could do with a
;; mouse-highlighted extent while in the midst of a search anyway).
;; It would be nice if we didn't have to do this; however,
;; window-start doesn't support a GUARANTEE flag, so we must
- ;; force redisplay to get the correct valye for start and end
+ ;; force redisplay to get the correct value for start and end
;; of window.
(sit-for 0)
;;
;; See the doc strings of these functions for more information.
\f
-(defvar itimer-version "1.08"
+(defvar itimer-version "1.09"
"Version number of the itimer package.")
(defvar itimer-list nil
(inhibit-quit t))
(setq next-wakeup 600)
(cond ((and (boundp 'last-command-event-time)
- (consp 'last-command-event-time))
+ (consp last-command-event-time))
(setq last-event-time last-command-event-time
idle-time (itimer-time-difference (current-time)
last-event-time)))
(call-with-condition-handler 'really-early-error-handler
#'(lambda ()
- ;; Initializa Installation-string. We do it before loading
+ ;; Initialize Installation-string. We do it before loading
;; anything so that dumped code can make use of its value.
(setq Installation-string
(save-current-buffer
["Update Package Index" package-get-update-base]
["List & Install" pui-list-packages]
["Update Installed Packages" package-get-update-all]
- ;; hack-o-matic, we can't force a laod of package-base here
+ ;; hack-o-matic, we can't force a load of package-base here
;; since it triggers dialog box interactions which we can't
- ;; deal while using a menu
+ ;; deal with while using a menu
("Using Custom"
:filter (lambda (&rest junk)
(if package-get-base
["Color Printing"
(cond (ps-print-color-p
(customize-set-variable 'ps-print-color-p nil)
- ;; I'm wondering whether all this muck is usefull.
+ ;; I'm wondering whether all this muck is useful.
(and (boundp 'original-face-background)
original-face-background
(set-face-background 'default original-face-background)))
(add-menu-button nil
["Load .emacs"
(progn (delete-menu-item '("Load .emacs"))
- (load-user-init-file (user-login-name)))
+ (load-user-init-file))
]
"Help"))
(t nil)))
(list 'buffer-menu-write-file name) t)
(vector "Delete Buffer" (list 'kill-buffer name)
t)))
- ;; ### We don't want buffer names to be translated,
- ;; ### so we put the buffer name in the suffix.
- ;; ### Also, avoid losing with non-ASCII buffer names.
- ;; ### We still lose, however, if complex-buffers-menu-p. --mrb
+ ;; #### We don't want buffer names to be translated,
+ ;; #### so we put the buffer name in the suffix.
+ ;; #### Also, avoid losing with non-ASCII buffer names.
+ ;; #### We still lose, however, if complex-buffers-menu-p. --mrb
(vector ""
(list buffers-menu-switch-to-buffer-function
(buffer-name buffer))
(make-variable-buffer-local 'mode-popup-menu)
;; In an effort to avoid massive menu clutter, this mostly worthless menu is
-;; superceded by any local popup menu...
+;; superseded by any local popup menu...
(setq-default mode-popup-menu default-popup-menu)
(defvar activate-popup-menu-hook nil
(let ((narg (- minibuffer-history-position n))
(minimum (if minibuffer-default -1 0)))
(cond ((< narg minimum)
- (error "No following item in %s" minibuffer-history-variable))
+ (error (if minibuffer-default
+ "No following item in %s"
+ "No following item in %s; no default available")
+ minibuffer-history-variable))
((> narg (length (symbol-value minibuffer-history-variable)))
(error "No preceding item in %s" minibuffer-history-variable)))
(erase-buffer)
;;;; reading various things from a minibuffer ;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(defun read-expression (prompt &optional initial-contents history)
- "Return a Lisp object read using the minibuffer.
-Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS
-is a string to insert in the minibuffer before reading.
-Third arg HISTORY, if non-nil, specifies a history list."
+(defun read-expression (prompt &optional initial-contents history default-value)
+ "Return a Lisp object read using the minibuffer, prompting with PROMPT.
+If non-nil, optional second arg INITIAL-CONTENTS is a string to insert
+ in the minibuffer before reading.
+Third arg HISTORY, if non-nil, specifies a history list.
+Fourth arg DEFAULT-VALUE is the default value. If non-nil, it is used
+ for history command, and as the value to return if the user enters the
+ empty string."
(let ((minibuffer-history-sexp-flag t)
;; Semi-kludge to get around M-x C-x o M-ESC trying to do completion.
(minibuffer-completion-table nil))
read-expression-map
t
(or history 'read-expression-history)
- lisp-mode-abbrev-table)))
+ lisp-mode-abbrev-table
+ default-value)))
-(defun read-string (prompt &optional initial-contents history)
+(defun read-string (prompt &optional initial-contents history default-value)
"Return a string from the minibuffer, prompting with string PROMPT.
If non-nil, optional second arg INITIAL-CONTENTS is a string to insert
-in the minibuffer before reading.
-Third arg HISTORY, if non-nil, specifies a history list."
+ in the minibuffer before reading.
+Third arg HISTORY, if non-nil, specifies a history list.
+Fourth arg DEFAULT-VALUE is the default value. If non-nil, it is used
+ for history command, and as the value to return if the user enters the
+ empty string."
(let ((minibuffer-completion-table nil))
(read-from-minibuffer prompt
initial-contents
minibuffer-local-map
- nil history)))
+ nil history nil default-value)))
-(defun eval-minibuffer (prompt &optional initial-contents history)
+(defun eval-minibuffer (prompt &optional initial-contents history default-value)
"Return value of Lisp expression read using the minibuffer.
Prompt with PROMPT. If non-nil, optional second arg INITIAL-CONTENTS
is a string to insert in the minibuffer before reading.
-Third arg HISTORY, if non-nil, specifies a history list."
- (eval (read-expression prompt initial-contents history)))
+Third arg HISTORY, if non-nil, specifies a history list.
+Fourth arg DEFAULT-VALUE is the default value. If non-nil, it is used
+ for history command, and as the value to return if the user enters the
+ empty string."
+ (eval (read-expression prompt initial-contents history default-value)))
;; The name `command-history' is already taken
(defvar read-command-history '())
-(defun read-command (prompt)
+(defun read-command (prompt &optional default-value)
"Read the name of a command and return as a symbol.
-Prompts with PROMPT."
+Prompts with PROMPT. By default, return DEFAULT-VALUE."
(intern (completing-read prompt obarray 'commandp t nil
;; 'command-history is not right here: that's a
;; list of evalable forms, not a history list.
'read-command-history
- )))
+ default-value)))
-(defun read-function (prompt)
+(defun read-function (prompt &optional default-value)
"Read the name of a function and return as a symbol.
-Prompts with PROMPT."
+Prompts with PROMPT. By default, return DEFAULT-VALUE."
(intern (completing-read prompt obarray 'fboundp t nil
- 'function-history)))
+ 'function-history default-value)))
-(defun read-variable (prompt)
+(defun read-variable (prompt &optional default-value)
"Read the name of a user variable and return it as a symbol.
-Prompts with PROMPT.
+Prompts with PROMPT. By default, return DEFAULT-VALUE.
A user variable is one whose documentation starts with a `*' character."
(intern (completing-read prompt obarray 'user-variable-p t nil
- 'variable-history)))
+ 'variable-history default-value)))
(defun read-buffer (prompt &optional default require-match)
"Read the name of a buffer and return as a string.
(buffer-name result)
result)))
-(defun read-number (prompt &optional integers-only)
- "Read a number from the minibuffer."
+(defun read-number (prompt &optional integers-only default-value)
+ "Read a number from the minibuffer, prompting with PROMPT.
+If optional second argument INTEGERS-ONLY is non-nil, accept
+ only integer input.
+If DEFAULT-VALUE is non-nil, return that if user enters an empty
+ line."
(let ((pred (if integers-only 'integerp 'numberp))
num)
(while (not (funcall pred num))
(let ((minibuffer-completion-table nil))
(read-from-minibuffer
prompt (if num (prin1-to-string num)) nil t
- t)) ;no history
+ nil nil default-value))
(input-error nil)
(invalid-read-syntax nil)
(end-of-file nil)))
(or (funcall pred num) (beep)))
num))
-(defun read-shell-command (prompt &optional initial-input history)
+(defun read-shell-command (prompt &optional initial-input history default-value)
"Just like read-string, but uses read-shell-command-map:
\\{read-shell-command-map}"
(let ((minibuffer-completion-table nil))
(read-from-minibuffer prompt initial-input read-shell-command-map
- nil (or history 'shell-command-history))))
+ nil (or history 'shell-command-history)
+ nil default-value)))
\f
;;; This read-file-name stuff probably belongs in files.el
used.)
Fourth arg MUST-MATCH non-nil means require existing file's name.
Non-nil and non-t means also require confirmation after completion.
-Fifth arg INITIAL-CONTENTS specifies text to start with.
+Fifth arg INITIAL-CONTENTS specifies text to start with. If this is not
+ specified, and `insert-default-directory' is non-nil, DIR or the current
+ directory will be used.
Sixth arg HISTORY specifies the history list to use. Default is
`file-name-history'.
DIR defaults to current buffer's directory default."
(read-file-name-1
(or history 'file-name-history)
prompt dir (or default
- (if initial-contents (expand-file-name initial-contents dir)
- buffer-file-name))
+ (and initial-contents
+ (abbreviate-file-name (expand-file-name
+ initial-contents dir) t))
+ (and buffer-file-truename
+ (abbreviate-file-name buffer-file-name t)))
must-match initial-contents
;; A separate function (not an anonymous lambda-expression)
;; and passed as a symbol because of disgusting kludges in various
(make-face 'modeline-mousable "Face for mousable portions of the modeline.")
(set-face-parent 'modeline-mousable 'modeline nil '(default))
(when (featurep 'window-system)
- (set-face-foreground 'modeline-mousable
- '(((default color x) . "firebrick")
- ((default color mswindows) . "firebrick"))
- 'global))
-(when (featurep 'x)
- (set-face-font 'modeline-mousable [bold] nil '(default mono x))
- (set-face-font 'modeline-mousable [bold] nil '(default grayscale x)))
+ (set-face-foreground 'modeline-mousable "firebrick" nil '(default color win))
+ (set-face-font 'modeline-mousable [bold] nil '(default mono win))
+ (set-face-font 'modeline-mousable [bold] nil '(default grayscale win)))
(defmacro make-modeline-command-wrapper (command)
`#'(lambda (event)
(set-face-parent 'modeline-mousable-minor-mode 'modeline-mousable nil
'(default))
(when (featurep 'window-system)
- (set-face-foreground 'modeline-mousable-minor-mode
- '(((default color x) . "green4")
- ((default color x) . "forestgreen")
- ((default color mswindows) . "green4")
- ((default color mswindows) . "forestgreen"))
- 'global))
+ (set-face-foreground 'modeline-mousable-minor-mode '("green4" "forestgreen")
+ nil '(default color win)))
(defvar modeline-mousable-minor-mode-extent (make-extent nil nil)
;; alliteration at its finest.
"Face for the buffer ID string in the modeline.")
(set-face-parent 'modeline-buffer-id 'modeline nil '(default))
(when (featurep 'window-system)
- (set-face-foreground 'modeline-buffer-id
- '(((default color x) . "blue4")
- ((default color mswindows) . "blue4"))
- 'global))
-(when (featurep 'x)
- (set-face-font 'modeline-buffer-id [bold-italic] nil '(default mono x))
- (set-face-font 'modeline-buffer-id [bold-italic] nil '(default grayscale x)))
+ (set-face-foreground 'modeline-buffer-id "blue4" nil '(default color win))
+ (set-face-font 'modeline-buffer-id [bold-italic] nil '(default mono win))
+ (set-face-font 'modeline-buffer-id [bold-italic] nil '(default grayscale win)))
(when (featurep 'tty)
(set-face-font 'modeline-buffer-id [bold-italic] nil '(default tty)))
;; vars is a list of glyph variables to check for a pointer
;; value.
(vars (cond
- ;; Checking if button is non-nil is not sufficent
+ ;; Checking if button is non-nil is not sufficient
;; since the pointer could be over a blank portion
;; of the toolbar.
((event-over-toolbar-p event)
(setq last-timestamp (event-timestamp event))
;; Enlarge the window, calculating change in characters
;; of default font. Do not let the window to become
- ;; less than alolwed minimum (not because that's critical
+ ;; less than allowed minimum (not because that's critical
;; for the code performance, just the visual effect is
;; better: when cursor goes to the left of the next left
- ;; divider, the vindow being resized shrinks to minimal
+ ;; divider, the window being resized shrinks to minimal
;; size.
(enlarge-window (max (- window-min-width (window-width window))
(/ (- (event-x-pixel event) old-right)
;; if the change caused more than two windows to resize
;; (shifting the whole stack right is ugly), or if the
;; left window side has slipped (right side cannot be
- ;; moved any funrther to the right, so enlarge-window
+ ;; moved any further to the right, so enlarge-window
;; plays bad games with the left edge.
(if (or (/= (count-windows) (length old-edges-all-windows))
(/= old-left (car (window-pixel-edges window)))
;;; Commentary:
-;; This file contains temporary definitions for 'mswindows glyphs.
-;; Since there currently is no image support, the glyps are defined
-;; TTY-style. This file has to be removed or reworked completely
-;; when we have images.
+;; Initialization code for MS Windows glyphs.
-;; This file is dumped with XEmacs.
+;; This file is dumped with XEmacs (when MS Windows support is
+;; compiled in).
;;; Code:
;; We need nothing special to support English on Emacs. Selecting
;; English as a language environment is one of the ways to reset
-;; various multilingual environment to the original settting.
+;; various multilingual environment to the original setting.
;;; Code
;; For Europeans, five character sets ISO8859-1,2,3,4,9 are supported.
+;; #### latin.el would be a better name for this file.
+
;;; Code:
;; For syntax of Latin-1 characters.
(modify-syntax-entry ?\e,BW\e(B ".")
(modify-syntax-entry ?\e,Bw\e(B ".")
+;; For syntax of Latin-3
+(loop for c in '(?\e,C!\e(B ?\e,C&\e(B ?\e,C)\e(B ?\e,C*\e(B ?\e,C+\e(B ?\e,C,\e(B ?\e,C/\e(B ?\e,C1\e(B ?\e,C5\e(B ?\e,C6\e(B ?\e,C:\e(B ?\e,C;\e(B ?\e,C<\e(B ?\e,C?\e(B)
+ do (modify-syntax-entry c "w"))
+
+(loop for c from 64 to 126
+ do (modify-syntax-entry (make-char 'latin-iso8859-3 c) "w"))
+
+(modify-syntax-entry (make-char 'latin-iso8859-3 32) "w") ; no-break space
+(modify-syntax-entry ?\e,CW\e(B ".")
+(modify-syntax-entry ?\e,Cw\e(B ".")
+
+;; For syntax of Latin-4
+(loop for c in '(?\e,D!\e(B ?\e,D"\e(B ?\e,D#\e(B ?\e,D%\e(B ?\e,D&\e(B ?\e,D)\e(B ?\e,D*\e(B ?\e,D+\e(B ?\e,D,\e(B ?\e,D.\e(B ?\e,D1\e(B ?\e,D3\e(B ?\e,D5\e(B ?\e,D6\e(B ?\e,D9\e(B ?\e,D:\e(B ?\e,D;\e(B ?\e,D<\e(B ?\e,D=\e(B ?\e,D>\e(B ?\e,D?\e(B)
+ do (modify-syntax-entry c "w"))
+
+(loop for c from 64 to 126
+ do (modify-syntax-entry (make-char 'latin-iso8859-4 c) "w"))
+
+(modify-syntax-entry (make-char 'latin-iso8859-4 32) "w") ; no-break space
+(modify-syntax-entry ?\e,DW\e(B ".")
+(modify-syntax-entry ?\e,Dw\e(B ".")
+
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; EUROPEANS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setenv "LC_MESSAGES" "C")
(setenv "LC_TIME" "C"))))
- ;; Register avairable input methods by loading LEIM list file.
+ ;; Register available input methods by loading LEIM list file.
(load "leim-list.el" 'noerror 'nomessage 'nosuffix)
)
(setq autoload-dir (feature-file package-feature))
(setq autoload-dir (file-name-directory autoload-dir))
(member autoload-dir late-package-load-path))
- ;; Find the corresonding entry in late-package
+ ;; Find the corresponding entry in late-package
(setq pkg-dir
(car-safe (member-if (lambda (h)
(string-match (concat "^" (regexp-quote h))
;; Retrieve a package and any other required packages from an archive
;;
;;
-;; Note (JV): Most of this no longer aplies!
+;; Note (JV): Most of this no longer applies!
;;
;; The idea:
;; A new XEmacs lisp-only release is generated with the following steps:
"package-get DB verification? ")))))
(t nil)))))
(error "Package-get PGP signature failed to verify"))
- ;; ToDo: We shoud call package-get-maybe-save-index on the region
+ ;; ToDo: We should call package-get-maybe-save-index on the region
(package-get-update-base-entries content-beg content-end)
(message "Updated package-get database"))))
(set-buffer (event-buffer event))
(goto-char (event-point event))
(popup-menu pui-menu event)
- ;; I agreee with dired.el this is seriously bogus.
+ ;; I agree with dired.el - this is seriously bogus.
(while (popup-menu-up-p)
(dispatch-event (next-event)))))
;;; Code:
\f
-(defvar binary-process-output)
-(defvar buffer-file-type)
-
(defgroup processes nil
"Process, subshell, compilation, and job control support."
:group 'external
you quit again before the process exits."
(let ((temp
(make-temp-name
- (concat (file-name-as-directory (temp-directory))
- (if (memq system-type '(ms-dos windows-nt)) "em" "emacs")))))
+ (concat (file-name-as-directory (temp-directory)) "emacs"))))
(unwind-protect
(progn
- (if (memq system-type '(ms-dos windows-nt))
- (let ((buffer-file-type binary-process-output))
- (write-region start end temp nil 'silent))
- (write-region start end temp nil 'silent))
+ (write-region start end temp nil 'silent)
(if deletep (delete-region start end))
(apply #'call-process program temp buffer displayp args))
(ignore-file-errors (delete-file temp)))))
(defun shell-quote-argument (argument)
"Quote an argument for passing as argument to an inferior shell."
- (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.
- (let ((result "") (start 0) end)
- (while (string-match "[^-0-9a-zA-Z_./]" argument start)
- (setq end (match-beginning 0)
- result (concat result (substring argument start end)
- "\\" (substring argument end (1+ end)))
- start (1+ end)))
- (concat result (substring argument start))))))
+ (if (eq system-type 'windows-nt)
+ (nt-quote-process-args (list shell-file-name argument))
+ ;; Quote everything except POSIX filename characters.
+ ;; This should be safe enough even for really weird shells.
+ (let ((result "") (start 0) end)
+ (while (string-match "[^-0-9a-zA-Z_./]" argument start)
+ (setq end (match-beginning 0)
+ result (concat result (substring argument start end)
+ "\\" (substring argument end (1+ end)))
+ start (1+ end)))
+ (concat result (substring argument start)))))
(defun shell-command-to-string (command)
"Execute shell command COMMAND and return its output as a string."
;; This package provides the operations on rectangles that are documented
;; in the XEmacs Reference Manual.
-;; ### NOTE: this file has been almost completely rewritten by Didier Verna
+;; #### NOTE: this file has been almost completely rewritten by Didier Verna
;; <verna@inf.enst.fr>, Jul 99. The purpose of this rewrite is to be less
;; intrusive and fill lines with whitespaces only when needed. A few functions
;; are untouched though, as noted above their definition.
;;; Code:
-;; ### NOTE: this function is untouched, but not used anymore.
+;; #### NOTE: this function is untouched, but not used anymore.
;; `apply-on-rectangle' is used instead. It's still there because it's
;; documented so people might use it in their code, so I've decided not to
;; touch it. --dv
(apply-on-rectangle 'extract-rectangle-line start end lines)
(nreverse (cdr lines))))
-;; ### NOTE: this is actually the only function that needs to do complicated
+;; #### NOTE: this is actually the only function that needs to do complicated
;; stuff like what's happening in `operate-on-rectangle', because the buffer
;; might be read-only. --dv
(defun extract-rectangle-line (startcol endcol lines)
;; vertical scrollbar functions
;;
-;;; ### Move functions from C into Lisp here!
+;;; #### Move functions from C into Lisp here!
;;
;; horizontal scrollbar functions
;; --hniksic
(defcustom log-message-ignore-regexps
'(;; Note: adding entries to this list slows down messaging
- ;; significantly. Wherever possible, use message lables.
+ ;; significantly. Wherever possible, use message labels.
;; Often-seen messages
"\\`\\'" ; empty message
;; We have only one font, so...
(add-hook 'before-init-hook 'msdos-face-setup)
;; ---------------------------------------------------------------------------
-;; More or less useful immitations of certain X-functions. A lot of the
+;; More or less useful imitations of certain X-functions. A lot of the
;; values returned are questionable, but usually only the form of the
;; returned value matters. Also, by the way, recall that `ignore' is
;; a useful function for returning 'nil regardless of argument.
;; HISTORY
;; jkj - Jan 18, 1993: Created.
-;; jkj - Nov 18, 1993: Mdified to work with Emacs 19.21
+;; jkj - Nov 18, 1993: Modified to work with Emacs 19.21
;;
;; First of all, the normal cursor movement keys. Some of these, if not
;;; wid-edit.el --- Functions for creating and using widgets.
;;
-;; Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
;;
;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
;; Maintainer: Hrvoje Niksic <hniksic@xemacs.org>
;; In WIDGET, match the start of VALS.
(cond ((widget-get widget :inline)
(widget-apply widget :match-inline vals))
- ((and vals
+ ((and (listp vals)
(widget-apply widget :match (car vals)))
(cons (list (car vals)) (cdr vals)))
(t nil)))
found))
(defun widget-checklist-match-up (args vals)
- ;; Rerturn the first type from ARGS that matches VALS.
+ ;; Return the first type from ARGS that matches VALS.
(let (current found)
(while (and args (null found))
(setq current (car args)
result))
(defun widget-checklist-validate (widget)
- ;; Ticked chilren must be valid.
+ ;; Ticked children must be valid.
(let ((children (widget-get widget :children))
child button found)
(while (and children (not found))
(select-frame frame))))
;; check to make sure that the window is the full width
;; of the frame
- (eq (nth 2 edges)
- (frame-pixel-width))
+ (window-leftmost-p window)
+ (window-rightmost-p window)
(zerop (nth 0 edges))
;; The whole buffer must be visible.
(pos-visible-in-window-p (point-min) window)
+2000-02-07 Martin Buchholz <martin@xemacs.org>
+
+ * XEmacs 21.2.28 is released.
+
+2000-01-25 Andy Piper <andy@xemacs.org>
+
+ * xlwtabs.c (TabsChangeManaged): Make sure we unmanage the hilight
+ widget as well.
+
+2000-01-28 Martin Buchholz <martin@xemacs.org>
+
+ * xlwgauge.c (GaugeConvert): bcopy ==> memcpy
+
+2000-01-24 Andy Piper <andy@xemacs.org>
+
+ * xlwtabs.c (XawTabsSetTop): Unhighlight before changing the
+ stacking order.
+ (XawTabsSetHighlight): Don't unhighlight here.
+
+2000-01-22 Martin Buchholz <martin@xemacs.org>
+
+ * *.h: Use consistent C-standards-approved guard macro names.
+
2000-01-18 Martin Buchholz <martin@xemacs.org>
* XEmacs 21.2.27 is released.
-#ifndef LWLIB_XAW_H
-#define LWLIB_XAW_H
+#ifndef INCLUDED_lwlib_Xaw_h_
+#define INCLUDED_lwlib_Xaw_h_
#include "lwlib-internal.h"
void
xaw_pop_instance (widget_instance* instance, Boolean up);
-#endif /* LWLIB_XAW_H */
+#endif /* INCLUDED_lwlib_Xaw_h_ */
-#ifndef LWLIB_XM_H
-#define LWLIB_XM_H
+#ifndef INCLUDED_lwlib_Xm_h_
+#define INCLUDED_lwlib_Xm_h_
#include "lwlib-internal.h"
extern Widget first_child (Widget); /* garbage */
-#endif /* LWLIB_XM_H */
+#endif /* INCLUDED_lwlib_Xm_h_ */
-#ifndef LWLIB_INTERNAL_H
-#define LWLIB_INTERNAL_H
+#ifndef INCLUDED_lwlib_internal_h_
+#define INCLUDED_lwlib_internal_h_
#include "lwlib.h"
widget_info *lw_get_widget_info (LWLIB_ID id);
-#endif /* LWLIB_INTERNAL_H */
-
+#endif /* INCLUDED_lwlib_internal_h_ */
-#ifndef _LWLIB_UTILS_H_
-#define _LWLIB_UTILS_H_
+#ifndef INCLUDED_lwlib_utils_h_
+#define INCLUDED_lwlib_utils_h_
void destroy_all_children (Widget widget);
void XtNoClearRefreshWidget (Widget);
#ifdef USE_DEBUG_MALLOC
#include <dmalloc.h>
#endif
-#endif /* _LWLIB_UTILS_H_ */
+
+#endif /* INCLUDED_lwlib_utils_h_ */
-#ifndef LWLIB_H
-#define LWLIB_H
+#ifndef INCLUDED_lwlib_h_
+#define INCLUDED_lwlib_h_
#undef CONST
/* Silly Energize hack to invert the "sheet" button */
void lw_show_busy (Widget w, Boolean busy);
-#endif /* LWLIB_H */
+#endif /* INCLUDED_lwlib_h_ */
-#ifndef _XlwMenu_h
-#define _XlwMenu_h
+#ifndef INCLUDED_xlwmenu_h_
+#define INCLUDED_xlwmenu_h_
/***********************************************************************
*
widget_value *xlw_get_entries (int allp);
int xlw_menu_level (void);
-#endif /* _XlwMenu_h */
+#endif /* INCLUDED_xlwmenu_h_ */
-#ifndef _XlwMenuP_h
-#define _XlwMenuP_h
+#ifndef INCLUDED_xlwmenuP_h_
+#define INCLUDED_xlwmenuP_h_
#include "xlwmenu.h"
#include <X11/CoreP.h>
/* Class pointer. */
extern XlwMenuClassRec xlwMenuClassRec;
-#endif /* _XlwMenuP_h */
+#endif /* INCLUDED_xlwmenuP_h_ */
/* Created by Douglas Keller <dkeller@vnet.ibm.com> */
-#ifndef _XlwScrollbar_h
-#define _XlwScrollbar_h
+#ifndef INCLUDED_xlwscrollbar_h_
+#define INCLUDED_xlwscrollbar_h_
#include <X11/Core.h>
void XlwScrollBarSetValues(Widget widget, int value, int sliderSize,
int increment, int pageIncrement, Boolean notify);
-#endif
+#endif /* INCLUDED_xlwscrollbar_h_ */
+2000-02-07 Martin Buchholz <martin@xemacs.org>
+
+ * XEmacs 21.2.28 is released.
+
+2000-02-07 Martin Buchholz <martin@xemacs.org>
+
+ * cl.texi: Remove (or replace by `get') references to `get*'.
+
+2000-01-25 Yoshiki Hayashi <yoshiki@xemacs.org>
+
+ * widget.texi:
+ * internals/internals.texi:
+ * lispref/commands.texi:
+ * lispref/consoles-devices.texi:
+ * lispref/customize.texi:
+ * lispref/dialog.texi:
+ * lispref/extents.texi:
+ * lispref/faces.texi:
+ * lispref/glyphs.texi:
+ * lispref/keymaps.texi:
+ * lispref/lists.texi:
+ * lispref/markers.texi:
+ * lispref/menus.texi:
+ * lispref/mule.texi:
+ * lispref/objects.texi:
+ * lispref/specifiers.texi:
+ * lispref/toolbar.texi:
+ * lispref/tooltalk.texi:
+ * lispref/x-windows.texi:
+ * new-users-guide/custom2.texi:
+ * new-users-guide/help.texi:
+ * new-users-guide/modes.texi:
+ * xemacs/abbrevs.texi:
+ * xemacs/buffers.texi:
+ * xemacs/custom.texi:
+ * xemacs/help.texi:
+ * xemacs/keystrokes.texi:
+ * xemacs/mini.texi:
+ * xemacs/new.texi:
+ * xemacs/packages.texi:
+ * xemacs/programs.texi:
+ * xemacs/sending.texi:
+ Change ' -- ' to '---' since Texinfo formats --- to --.
+ Untabify. TeX doesn't like TAB.
+
+2000-01-27 Sandra Wambold <wambold@xemacs.org>
+
+ * xemacs-faq.texi (Q6.2.2): updated font instructions to include
+ 21.2.*
+
+2000-01-25 Yoshiki Hayashi <yoshiki@xemacs.org>
+
+ * xemacs-faq.texi: Untabify.
+
+2000-01-22 Martin Buchholz <martin@xemacs.org>
+
+ * internals/internals.texi (General Coding Rules): Document why we
+ #include <config.h>
+
+2000-01-21 Yoshiki Hayashi <yoshiki@xemacs.org>
+
+ * xemacs-faq.texi: Change ' -- ' to '---'.
+
+2000-01-19 Yoshiki Hayashi <yoshiki@xemacs.org>
+
+ * lispref/faces.texi (Face Properties): Document
+ remove-face-property.
+
2000-01-18 Martin Buchholz <martin@xemacs.org>
* XEmacs 21.2.27 is released.
@example
defun* defsubst* defmacro* function*
-member* assoc* rassoc* get*
-remove* delete* mapcar* sort*
-floor* ceiling* truncate* round*
-mod* rem* random*
+member* assoc* rassoc* remove*
+delete* mapcar* sort* floor*
+ceiling* truncate* round* mod*
+rem* random*
@end example
Internal function and variable names in the package are prefixed
nth rest first .. tenth
aref elt nthcdr
symbol-function symbol-value symbol-plist
-get get* getf
-gethash subseq
+get getf gethash
+subseq
@end smallexample
@noindent
missing from Emacs Lisp.
@menu
-* Property Lists:: `get*', `remprop', `getf', `remf'
+* Property Lists:: `remprop', `getf', `remf'
* Creating Symbols:: `gensym', `gentemp'
@end menu
There are also functions for working with property lists as
first-class data structures not attached to particular symbols.
-@defun get* symbol property &optional default
-This function is like @code{get}, except that if the property is
-not found, the @var{default} argument provides the return value.
-(The Emacs Lisp @code{get} function always uses @code{nil} as
-the default; this package's @code{get*} is equivalent to Common
-Lisp's @code{get}.)
-
-The @code{get*} function is @code{setf}-able; when used in this
-fashion, the @var{default} argument is allowed but ignored.
-@end defun
-
@defun remprop symbol property
This function removes the entry for @var{property} from the property
list of @var{symbol}. It returns a true value if the property was
(put sym prop val) @equiv{} (setf (getf (symbol-plist sym) prop) val)
@end example
-The @code{get} and @code{get*} functions are also @code{setf}-able.
-The fact that @code{default} is ignored can sometimes be useful:
+The @code{get} function is also @code{setf}-able. The fact that
+@code{default} is ignored can sometimes be useful:
@example
-(incf (get* 'foo 'usage-count 0))
+(incf (get 'foo 'usage-count 0))
@end example
Here, symbol @code{foo}'s @code{usage-count} property is incremented
does not already exist, a new entry is added to the table and the
table is reallocated to a larger size if necessary. The @var{default}
argument is allowed but ignored in this case. The situation is
-exactly analogous to that of @code{get*}; @pxref{Property Lists}.
+exactly analogous to that of @code{get}; @pxref{Property Lists}.
@end defun
@defun remhash key table
Firstly, Elisp is an interpreted language, and this has serious speed
implications. Like all other interpreted languages (like Java), Elisp
is often suitable only for certain types of application or extension.
-So although Elisp is a general purpose language, and very ligh level,
+So although Elisp is a general purpose language, and very high level,
there are times when it is desirable to descend to a lower level compiled
language for speed purposes.
@ifinfo
@dircategory XEmacs Editor
@direntry
-* Internals: (internals). XEmacs Internals Manual.
+* Internals: (internals). XEmacs Internals Manual.
@end direntry
Copyright @copyright{} 1992 - 1996 Ben Wing.
displayable representations, and XEmacs provides a function
@code{redisplay()} that ensures that the display of all such objects
matches their internal state. Most of the time, a standard Lisp
-environment is in a @dfn{read-eval-print} loop -- i.e. ``read some Lisp
+environment is in a @dfn{read-eval-print} loop---i.e. ``read some Lisp
code, execute it, and print the results''. XEmacs has a similar loop:
@itemize @bullet
executed; this prints out the error and continues.) Routines can also
specify cleanup code (called an @dfn{unwind-protect}) that will be
called when control exits from a block of code, no matter how that exit
-occurs -- i.e. even if a function deeply nested below it causes a
+occurs---i.e. even if a function deeply nested below it causes a
non-local exit back to the top level.
Note that this facility has appeared in some recent vintages of C, in
you declared. This is actually considered a bug in Emacs Lisp and in
all other early dialects of Lisp, and was corrected in Common Lisp. (In
Common Lisp, you can still declare dynamically scoped variables if you
-want to -- they are sometimes useful -- but variables by default are
+want to---they are sometimes useful---but variables by default are
@dfn{lexically scoped} as in C.)
@end enumerate
An object representing a single character of text; chars behave like
integers in many ways but are logically considered text rather than
numbers and have a different read syntax. (the read syntax for a char
-contains the char itself or some textual encoding of it -- for example,
+contains the char itself or some textual encoding of it---for example,
a Japanese Kanji character might be encoded as @samp{^[$(B#&^[(B} using the
-ISO-2022 encoding standard -- rather than the numerical representation
+ISO-2022 encoding standard---rather than the numerical representation
of the char; this way, if the mapping between chars and integers
changes, which is quite possible for Kanji characters and other extended
characters, the same character will still be created. Note that some
others, the lower 28 bits contain a pointer. The mark bit is used
during garbage-collection, and is always 0 when garbage collection is
not happening. (The way that garbage collection works, basically, is that it
-loops over all places where Lisp objects could exist -- this includes
+loops over all places where Lisp objects could exist---this includes
all global variables in C that contain Lisp objects [including
@code{Vobarray}, the C equivalent of @code{obarray}; through this, all
-Lisp variables will get marked], plus various other places -- and
+Lisp variables will get marked], plus various other places---and
recursively scans through the Lisp objects, marking each object it finds
by setting the mark bit. Then it goes through the lists of all objects
allocated, freeing the ones that are not marked and turning off the mark
@code{EXPLICIT_SIGN_EXTEND}.
Note that when @code{ERROR_CHECK_TYPECHECK} is defined, the extractor
-macros become more complicated -- they check the tag bits and/or the
+macros become more complicated---they check the tag bits and/or the
type field in the first four bytes of a record type to ensure that the
object is really of the correct type. This is great for catching places
-where an incorrect type is being dereferenced -- this typically results
+where an incorrect type is being dereferenced---this typically results
in a pointer being dereferenced as the wrong type of structure, with
unpredictable (and sometimes not easily traceable) results.
system header files) to ensure that certain tricks played by various
@file{s/} and @file{m/} files work out correctly.
+When including header files, always use angle brackets, not double
+quotes, except when the file to be included is in the same directory as
+the including file. If either file is a generated file, then that is
+not likely to be the case. In order to understand why we have this
+rule, imagine what happens when you do a build in the source directory
+using @samp{./configure} and another build in another directory using
+@samp{../work/configure}. There will be two different @file{config.h}
+files. Which one will be used if you @samp{#include "config.h"}?
+
@strong{All global and static variables that are to be modifiable must
be declared uninitialized.} This means that you may not use the
``declare with initializer'' form for these variables, such as @code{int
segment in the dumped executable. This allows this memory to be shared
among multiple running XEmacs processes. XEmacs is careful to place as
much constant data as possible into initialized variables (in
-particular, into what's called the @dfn{pure space} -- see below) during
+particular, into what's called the @dfn{pure space}---see below) during
the @file{temacs} phase.
@cindex copy-on-write
macro style is:
@example
-#define FOO(var, value) do @{ \
- Lisp_Object FOO_value = (value); \
- ... /* compute using FOO_value */ \
- (var) = bar; \
+#define FOO(var, value) do @{ \
+ Lisp_Object FOO_value = (value); \
+ ... /* compute using FOO_value */ \
+ (var) = bar; \
@} while (0)
@end example
typedefs section as necessary.
@file{lrecord.h} contains the basic structures and macros that implement
-all record-type Lisp objects -- i.e. all objects whose type is a field
+all record-type Lisp objects---i.e. all objects whose type is a field
in their C structure, which includes all objects except the few most
basic ones.
type-specific methods. This scheme is a fundamental principle of
object-oriented programming and is heavily used throughout XEmacs. The
great advantage of this is that it allows for a clean separation of
-functionality into different modules -- new classes of Lisp objects, new
+functionality into different modules---new classes of Lisp objects, new
event interfaces, new device types, new stream interfaces, etc. can be
added transparently without affecting code anywhere else in XEmacs.
Because the different subsystems are divided into general and specific
@file{symbols.c} implements the handling of symbols, obarrays, and
retrieving the values of symbols. Much of the code is devoted to
handling the special @dfn{symbol-value-magic} objects that define
-special types of variables -- this includes buffer-local variables,
+special types of variables---this includes buffer-local variables,
variable aliases, variables that forward into C variables, etc. This
module is initialized extremely early (right after @file{alloc.c}),
because it is here that the basic symbols @code{t} and @code{nil} are
@end example
@file{keyboard.c} contains functions that implement the actual editor
-command loop -- i.e. the event loop that cyclically retrieves and
+command loop---i.e. the event loop that cyclically retrieves and
dispatches events. This code is also rather tricky, just like
@file{event-stream.c}.
font-lock.c
@end example
-This file provides C support for syntax highlighting -- i.e.
+This file provides C support for syntax highlighting---i.e.
highlighting different syntactic constructs of a source file in
different colors, for easy reading. The C support is provided so that
this is fast.
with them, in case the block of memory contains other Lisp objects that
need to be marked for garbage-collection purposes. (If you need other
object methods, such as a finalize method, you should just go ahead and
-create a new Lisp object type -- it's not hard.)
+create a new Lisp object type---it's not hard.)
@dfn{frob blocks}, i.e. large blocks of memory that are subdivided into
individual objects. This saves a lot on malloc overhead, since there
are typically quite a lot of these objects around, and the objects are
-small. (A cons, for example, occupies 8 bytes on 32-bit machines -- 4
+small. (A cons, for example, occupies 8 bytes on 32-bit machines---4
bytes for each of the two objects it contains.) Vectors are individually
@code{malloc()}ed since they are of variable size. (It would be
possible, and desirable, to allocate vectors of certain small sizes out
in the next enclosing stack frame. Each @code{GCPRO}ed thing is an
lvalue, and the @code{struct gcpro} local variable contains a pointer to
this lvalue. This is why things will mess up badly if you don't pair up
-the @code{GCPRO}s and @code{UNGCPRO}s -- you will end up with
+the @code{GCPRO}s and @code{UNGCPRO}s---you will end up with
@code{gcprolist}s containing pointers to @code{struct gcpro}s or local
@code{Lisp_Object} variables in no-longer-active stack frames.
strings}, are all @code{malloc()}ed as their own block. (#### Although it
would make more sense for the threshold for big strings to be somewhat
lower, e.g. 1/2 or 1/4 the size of a string-chars block. It seems that
-this was indeed the case formerly -- indeed, the threshold was set at
-1/8 -- but Mly forgot about this when rewriting things for 19.8.)
+this was indeed the case formerly---indeed, the threshold was set at
+1/8---but Mly forgot about this when rewriting things for 19.8.)
Note also that the string data in string-chars blocks is padded as
necessary so that proper alignment constraints on the @code{struct
nature of the most basic events that are received. Part of the
complex nature of the XEmacs event collection process involves
converting from the operating-system events into the proper
-Emacs events -- there may not be a one-to-one correspondence.
+Emacs events---there may not be a one-to-one correspondence.
Emacs events are documented in @file{events.h}; I'll discuss them
later.
This is documented elsewhere.
The guts of the command loop are in @code{command_loop_1()}. This
-function doesn't catch errors, though -- that's the job of
+function doesn't catch errors, though---that's the job of
@code{command_loop_2()}, which is a condition-case (i.e. error-trapping)
wrapper around @code{command_loop_1()}. @code{command_loop_1()} never
returns, but may get thrown out of.
@deftypefn Macro void Lstream_ungetc (Lstream *@var{stream}, int @var{c})
Push one byte back onto the input queue. This will be the next byte
read from the stream. Any number of bytes can be pushed back and will
-be read in the reverse order they were pushed back -- most recent
-first. (This is necessary for consistency -- if there are a number of
+be read in the reverse order they were pushed back---most recent
+first. (This is necessary for consistency---if there are a number of
bytes that have been unread and I read and unread a byte, it needs to be
the first to be read again.) This is a macro and so it is very
efficient. The @var{c} argument is only evaluated once but the @var{stream}
@deftypefun void Lstream_reopen (Lstream *@var{stream})
Reopen a closed stream. This enables I/O on it again. This is not
meant to be called except from a wrapper routine that reinitializes
-variables and such -- the close routine may well have freed some
+variables and such---the close routine may well have freed some
necessary storage structures, for example.
@end deftypefun
@end deftypefn
@deftypefn {Lstream Method} int seekable_p (Lstream *@var{stream})
-Indicate whether this stream is seekable -- i.e. it can be rewound.
+Indicate whether this stream is seekable---i.e. it can be rewound.
This method is ignored if the stream does not have a rewind method. If
this method is not present, the result is determined by whether a rewind
method is present.
@item
Leaf windows also have markers in their @code{start} (the
first buffer position displayed in the window) and @code{pointm}
-(the window's stashed value of @code{point} -- see above) fields,
+(the window's stashed value of @code{point}---see above) fields,
while combination windows have nil in these fields.
@item
GC purposes.
@item
-Most frames actually have two top-level windows -- one for the
+Most frames actually have two top-level windows---one for the
minibuffer and one (the @dfn{root}) for everything else. The modeline
(if present) separates these two. The @code{next} field of the root
points to the minibuffer, and the @code{prev} field of the minibuffer
is sufficient to always provide the needed information. The second
thing we can do is be smart about invalidating the cache.
- TODO -- Be smart about invalidating the cache. Potential places:
+ TODO---Be smart about invalidating the cache. Potential places:
@itemize @bullet
@item
An extent-info structure consists of a list of the buffer or string's
extents and a @dfn{stack of extents} that lists all of the extents over
a particular position. The stack-of-extents info is used for
-optimization purposes -- it basically caches some info that might
+optimization purposes---it basically caches some info that might
be expensive to compute. Certain otherwise hard computations are easy
given the stack of extents over a particular position, and if the
stack of extents over a nearby position is known (because it was
An extent fragment is a structure that holds data about the run that
contains a particular buffer position (if the buffer position is at the
-junction of two runs, the run after the position is used) -- the
+junction of two runs, the run after the position is used)---the
beginning and end of the run, a list of all of the extents in that run,
the @dfn{merged face} that results from merging all of the faces
corresponding to those extents, the begin and end glyphs at the
Any action on a glyph first consults the cache before actually
instantiating a widget.
-@section Widget-Glyphs in the MS-WIndows Environment
+@section Widget-Glyphs in the MS-Windows Environment
To Do
This function converts a numeric @sc{ascii} value to an event structure,
replete with modifier bits. @var{ch} is the character to convert, and
@var{event} is the event object to fill in. This function contains
-knowledge about what the codes ``mean'' -- for example, the number 9 is
+knowledge about what the codes ``mean''---for example, the number 9 is
converted to the character @key{Tab}, not the distinct character
@key{Control-I}.
@lisp
@group
- (while (progn
- (next-event event)
- (not (or (key-press-event-p event)
- (button-press-event-p event)
- (button-release-event-p event)
- (menu-event-p event))))
- (dispatch-event event))
+ (while (progn
+ (next-event event)
+ (not (or (key-press-event-p event)
+ (button-press-event-p event)
+ (button-release-event-p event)
+ (menu-event-p event))))
+ (dispatch-event event))
@end group
@end lisp
A @dfn{console} is an object representing a single input connection
to XEmacs, such as an X display or a TTY connection. It is possible
for XEmacs to have frames on multiple consoles at once (even on
-heterogeneous types -- you can simultaneously have a frame on an
+heterogeneous types---you can simultaneously have a frame on an
X display and a TTY connection). Normally, there is only one
console in existence.
(defcustom show-paren-mode nil
"Toggle Show Paren mode@enddots{}"
:set (lambda (symbol value)
- (show-paren-mode (or value 0)))
+ (show-paren-mode (or value 0)))
:initialize 'custom-initialize-default
:type 'boolean
:group 'paren-showing
The syntax, more precisely:
@example
- form := <something to pass to `eval'>
- command := <a symbol or string, to pass to `call-interactively'>
- callback := command | form
- active-p := <t, nil, or a form to evaluate to decide whether this
- button should be selectable>
- name := <string>
- partition := 'nil'
- button := '[' name callback active-p ']'
- dialog := '(' name [ button ]+ [ partition [ button ]+ ] ')'
+ form := <something to pass to `eval'>
+ command := <a symbol or string, to pass to `call-interactively'>
+ callback := command | form
+ active-p := <t, nil, or a form to evaluate to decide whether this
+ button should be selectable>
+ name := <string>
+ partition := 'nil'
+ button := '[' name callback active-p ']'
+ dialog := '(' name [ button ]+ [ partition [ button ]+ ] ')'
@end example
@node Dialog Box Functions
The following low-level functions are provided for explicitly
traversing the extents in a buffer according to the display order.
-These functions are mostly intended for debugging -- in normal
+These functions are mostly intended for debugging---in normal
operation, you should probably use @code{mapcar-extents} or
@code{map-extents}, or loop using the @var{before} argument to
@code{extent-at}, rather than creating a loop using @code{next-extent}.
It is possible for an extent's parent to itself have a parent,
and so on. Through this, a whole tree of extents can be created,
all deriving their properties from one root extent. Note, however,
-that you cannot create an inheritance loop -- this is explicitly
+that you cannot create an inheritance loop---this is explicitly
disallowed.
Parent extents are used to implement the extents over the modeline.
specifier.
@end defun
+@defun remove-face-property face property &optional local tag-set exact-p
+This function removes a property of a @var{face}.
+
+For built-in properties, this is analogous to @code{remove-specifier}.
+For more information, @xref{Other Specification Functions}.
+
+When @var{property} is not a built-in property, this function will just
+remove its value if @var{locale} is @code{nil} or @code{all}. However,
+if @var{locale} is other than that, this function will attempt to remove
+@var{value} as the instantiator for the given @var{locale} with
+@code{remove-specifier}. If the value of the property is not a
+specifier, it will be converted into a @code{generic} specifier
+automatically.
+@end defun
+
@defun face-property face property &optional locale
This function returns @var{face}'s value of the given @var{property}.
Image instantiators come in many formats: @code{xbm}, @code{xpm},
@code{gif}, @code{jpeg}, etc. This describes the format of the data
describing the image. The resulting image instances also come in many
-types -- @code{mono-pixmap}, @code{color-pixmap}, @code{text},
+types---@code{mono-pixmap}, @code{color-pixmap}, @code{text},
@code{pointer}, etc. This refers to the behavior of the image and the
sorts of places it can appear. (For example, a color-pixmap image has
fixed colors specified for it, while a mono-pixmap image comes in two
That is, the @kbd{A} keystroke is represented by all of these forms:
@example
- A ?A 65 (A) (?A) (65)
- [A] [?A] [65] [(A)] [(?A)] [(65)]
+ A ?A 65 (A) (?A) (65)
+ [A] [?A] [65] [(A)] [(?A)] [(65)]
@end example
-
+
the @kbd{control-a} keystroke is represented by these forms:
@example
- (control A) (control ?A) (control 65)
- [(control A)] [(control ?A)] [(control 65)]
+ (control A) (control ?A) (control 65)
+ [(control A)] [(control ?A)] [(control 65)]
@end example
the key sequence @kbd{control-c control-a} is represented by these
forms:
@example
- [(control c) (control a)] [(control ?c) (control ?a)]
- [(control 99) (control 65)] etc.
+ [(control c) (control a)] [(control ?c) (control ?a)]
+ [(control 99) (control 65)] etc.
@end example
Mouse button clicks work just like keypresses: @code{(control
pairs:
@example
- control h backspace
- control i tab
- control m return
- control j linefeed
- control [ escape
- control @@ control space
+ control h backspace
+ control i tab
+ control m return
+ control j linefeed
+ control [ escape
+ control @@ control space
@end example
After binding a command to two key sequences with a form like
@example
- (define-key global-map "\^X\^I" 'command-1)
+ (define-key global-map "\^X\^I" 'command-1)
@end example
@noindent
it is possible to redefine only one of those sequences like so:
@example
- (define-key global-map [(control x) (control i)] 'command-2)
- (define-key global-map [(control x) tab] 'command-3)
+ (define-key global-map [(control x) (control i)] 'command-2)
+ (define-key global-map [(control x) tab] 'command-3)
@end example
Of course, all of this applies only when running under a window
@result{} #<keymap lisp-interaction-mode-map 5 entries 0x558>
(describe-bindings-internal (current-local-map))
@result{} ; @r{Inserted into the buffer:}
-backspace backward-delete-char-untabify
-linefeed eval-print-last-sexp
-delete delete-char
-C-j eval-print-last-sexp
-C-x << Prefix Command >>
-M-tab lisp-complete-symbol
-M-; lisp-indent-for-comment
-M-C-i lisp-complete-symbol
-M-C-q indent-sexp
-M-C-x eval-defun
-Alt-backspace backward-kill-sexp
-Alt-delete kill-sexp
+backspace backward-delete-char-untabify
+linefeed eval-print-last-sexp
+delete delete-char
+C-j eval-print-last-sexp
+C-x << Prefix Command >>
+M-tab lisp-complete-symbol
+M-; lisp-indent-for-comment
+M-C-i lisp-complete-symbol
+M-C-q indent-sexp
+M-C-x eval-defun
+Alt-backspace backward-kill-sexp
+Alt-delete kill-sexp
@end group
@group
-C-x x edebug-defun
+C-x x edebug-defun
@end group
@end example
@end defun
* Buffer Type:: The basic object of editing.
* Window Type:: What makes buffers visible.
-* Window Configuration Type::Save what the screen looks like.
+* Window Configuration Type:: Save what the screen looks like.
* Marker Type:: A position in a buffer.
* Process Type:: A process running on the underlying OS.
* Stream Type:: Receive or send characters.
Strings and Characters
-* Basics: String Basics. Basic properties of strings and characters.
+* String Basics:: Basic properties of strings and characters.
* Predicates for Strings:: Testing whether an object is a string or char.
* Creating Strings:: Functions to allocate new strings.
* Predicates for Characters:: Testing whether an object is a character.
@defun remassoc key alist
This function deletes by side effect any associations with key @var{key}
-in @var{alist} -- i.e. it removes any elements from @var{alist} whose
+in @var{alist}---i.e. it removes any elements from @var{alist} whose
@code{car} is @code{equal} to @var{key}. The modified @var{alist} is
returned.
@defun remassq key alist
This function deletes by side effect any associations with key @var{key}
-in @var{alist} -- i.e. it removes any elements from @var{alist} whose
+in @var{alist}---i.e. it removes any elements from @var{alist} whose
@code{car} is @code{eq} to @var{key}. The modified @var{alist} is
returned.
@defun remrassoc value alist
This function deletes by side effect any associations with value @var{value}
-in @var{alist} -- i.e. it removes any elements from @var{alist} whose
+in @var{alist}---i.e. it removes any elements from @var{alist} whose
@code{cdr} is @code{equal} to @var{value}. The modified @var{alist} is
returned.
@defun remrassq value alist
This function deletes by side effect any associations with value @var{value}
-in @var{alist} -- i.e. it removes any elements from @var{alist} whose
+in @var{alist}---i.e. it removes any elements from @var{alist} whose
@code{cdr} is @code{eq} to @var{value}. The modified @var{alist} is
returned.
done with the elements, they will automatically disappear from the list.
Weak lists are used internally, for example, to manage the list holding
-the children of an extent -- an extent that is unused but has a parent
+the children of an extent---an extent that is unused but has a parent
will still be reclaimed, and will automatically be removed from its
parent's list of children.
When @code{zmacs-regions} is non-@code{nil} (this is the default), the
concept of an @dfn{active region} exists. The region is active when the
corresponding mark is active. Note that only one active region at a
-time can exist -- i.e. only one buffer's region is active at a time.
+time can exist---i.e. only one buffer's region is active at a time.
@xref{The Mark}, for more information about active regions.
@defopt zmacs-regions
@cindex menu
@menu
-* Menu Format:: Format of a menu description.
-* Menubar Format:: How to specify a menubar.
-* Menubar:: Functions for controlling the menubar.
-* Modifying Menus:: Modifying a menu description.
-* Pop-Up Menus:: Functions for specifying pop-up menus.
-* Menu Filters:: Filter functions for the default menubar.
-* Menu Accelerators:: Using and controlling menu accelerator keys
-* Buffers Menu:: The menu that displays the list of buffers.
+* Menu Format:: Format of a menu description.
+* Menubar Format:: How to specify a menubar.
+* Menubar:: Functions for controlling the menubar.
+* Modifying Menus:: Modifying a menu description.
+* Pop-Up Menus:: Functions for specifying pop-up menus.
+* Menu Filters:: Filter functions for the default menubar.
+* Menu Accelerators:: Using and controlling menu accelerator keys
+* Buffers Menu:: The menu that displays the list of buffers.
@end menu
@node Menu Format
@example
("File"
- :filter file-menu-filter ; file-menu-filter is a function that takes
- ; one argument (a list of menu items) and
- ; returns a list of menu items
+ :filter file-menu-filter ; file-menu-filter is a function that takes
+ ; one argument (a list of menu items) and
+ ; returns a list of menu items
[ "Save As..." write-file]
[ "Revert Buffer" revert-buffer :active (buffer-modified-p) ]
[ "Read Only" toggle-read-only :style toggle :selected buffer-read-only ]
activate that item.
@menu
-* Creating Menu Accelerators:: How to add accelerator keys to a menu.
-* Keyboard Menu Traversal:: How to use and modify the keys which are used
- to traverse the menu structure.
-* Menu Accelerator Functions:: Functions for working with menu accelerators.
+* Creating Menu Accelerators:: How to add accelerator keys to a menu.
+* Keyboard Menu Traversal:: How to use and modify the keys which are used
+ to traverse the menu structure.
+* Menu Accelerator Functions:: Functions for working with menu accelerators.
@end menu
@node Creating Menu Accelerators
@example
(add-submenu nil '("%_Test"
- ["One" (insert "1") :accelerator ?1 :active t]
- ["%_Two" (insert "2")]
- ["%_3" (insert "3")]))
+ ["One" (insert "1") :accelerator ?1 :active t]
+ ["%_Two" (insert "2")]
+ ["%_3" (insert "3")]))
@end example
will add a new menu to the top level menubar. The new menu can be reached
(setq menu-accelerator-modifiers '(meta control))
(setq menu-accelerator-enabled 'menu-force)
(add-submenu nil '("%_Test"
- ["One" (insert "1") :accelerator ?1 :active t]
- ["%_Two" (insert "2")]
- ["%_3" (insert "3")]))
+ ["One" (insert "1") :accelerator ?1 :active t]
+ ["%_Two" (insert "2")]
+ ["%_3" (insert "3")]))
@end example
will add the menu "Test" to the top level menubar. Pressing C-x followed by
In some cases, the differences will be significant enough that it is
actually possible to identify two or more distinct shapes that both
represent the same character. For example, the lowercase letters
-@samp{a} and @samp{g} each have two distinct possible shapes -- the
+@samp{a} and @samp{g} each have two distinct possible shapes---the
@samp{a} can optionally have a curved tail projecting off the top, and
the @samp{g} can be formed either of two loops, or of one loop and a
tail hanging off the bottom. Such distinct possible shapes of a
glyphs making up the same character is that the choice between one or
the other is purely stylistic and has no linguistic effect on a word
(this is the reason why a capital @samp{A} and lowercase @samp{a}
-are different characters rather than different glyphs -- e.g.
+are different characters rather than different glyphs---e.g.
@samp{Aspen} is a city while @samp{aspen} is a kind of tree).
Note that @dfn{character} and @dfn{glyph} are used differently
numbers before letters, etc. Note that for many of the Asian character
sets, there is no natural ordering of the characters. The actual
orderings are based on one or more salient characteristic, of which
-there are many to choose from -- e.g. number of strokes, common
+there are many to choose from---e.g. number of strokes, common
radicals, phonetic ordering, etc.
The set of numbers assigned to any particular character are called
not understand the difference between a character set and an encoding.)
This is not possible, however, if more than one character set is to be
used in the encoding. For example, printed Japanese text typically
-requires characters from multiple character sets -- ASCII, JISX0208, and
+requires characters from multiple character sets---ASCII, JISX0208, and
JISX0212, to be specific. Each of these is indexed using one or more
position codes in the range 33 through 126, so the position codes could
not be used directly or there would be no way to tell which character
-was meant. Different Japanese encodings handle this differently -- JIS
+was meant. Different Japanese encodings handle this differently---JIS
uses special escape characters to denote different character sets; EUC
sets the high bit of the position codes for JISX0208 and JISX0212, and
puts a special extra byte before each JISX0212 character; etc. (JIS,
@end defun
@defun charset-direction charset
-This function returns the display direction of @var{charset} -- either
+This function returns the display direction of @var{charset}---either
@code{l2r} or @code{r2l}.
@end defun
@example
@group
- C0: 0x00 - 0x1F
- GL: 0x20 - 0x7F
- C1: 0x80 - 0x9F
- GR: 0xA0 - 0xFF
+ C0: 0x00 - 0x1F
+ GL: 0x20 - 0x7F
+ C1: 0x80 - 0x9F
+ GR: 0xA0 - 0xFF
@end group
@end example
Charset designation is done by escape sequences of the form:
@example
- ESC [@var{I}] @var{I} @var{F}
+ ESC [@var{I}] @var{I} @var{F}
@end example
where @var{I} is an intermediate character in the range 0x20 - 0x2F, and
@example
@group
- $ [0x24]: indicate charset of dimension 2 (94x94 or 96x96).
- ( [0x28]: designate to G0 a 94-charset whose final byte is @var{F}.
- ) [0x29]: designate to G1 a 94-charset whose final byte is @var{F}.
- * [0x2A]: designate to G2 a 94-charset whose final byte is @var{F}.
- + [0x2B]: designate to G3 a 94-charset whose final byte is @var{F}.
- - [0x2D]: designate to G1 a 96-charset whose final byte is @var{F}.
- . [0x2E]: designate to G2 a 96-charset whose final byte is @var{F}.
- / [0x2F]: designate to G3 a 96-charset whose final byte is @var{F}.
+ $ [0x24]: indicate charset of dimension 2 (94x94 or 96x96).
+ ( [0x28]: designate to G0 a 94-charset whose final byte is @var{F}.
+ ) [0x29]: designate to G1 a 94-charset whose final byte is @var{F}.
+ * [0x2A]: designate to G2 a 94-charset whose final byte is @var{F}.
+ + [0x2B]: designate to G3 a 94-charset whose final byte is @var{F}.
+ - [0x2D]: designate to G1 a 96-charset whose final byte is @var{F}.
+ . [0x2E]: designate to G2 a 96-charset whose final byte is @var{F}.
+ / [0x2F]: designate to G3 a 96-charset whose final byte is @var{F}.
@end group
@end example
The following rule is not allowed in ISO 2022 but can be used in Mule.
@example
- , [0x2C]: designate to G0 a 96-charset whose final byte is @var{F}.
+ , [0x2C]: designate to G0 a 96-charset whose final byte is @var{F}.
@end example
Here are examples of designations:
@example
@group
- ESC ( B : designate to G0 ASCII
- ESC - A : designate to G1 Latin-1
- ESC $ ( A or ESC $ A : designate to G0 GB2312
- ESC $ ( B or ESC $ B : designate to G0 JISX0208
- ESC $ ) C : designate to G1 KSC5601
+ ESC ( B : designate to G0 ASCII
+ ESC - A : designate to G1 Latin-1
+ ESC $ ( A or ESC $ A : designate to G0 GB2312
+ ESC $ ( B or ESC $ B : designate to G0 JISX0208
+ ESC $ ) C : designate to G1 KSC5601
@end group
@end example
Locking Shift is done as follows:
@example
- LS0 or SI (0x0F): invoke G0 into GL
- LS1 or SO (0x0E): invoke G1 into GL
- LS2: invoke G2 into GL
- LS3: invoke G3 into GL
- LS1R: invoke G1 into GR
- LS2R: invoke G2 into GR
- LS3R: invoke G3 into GR
+ LS0 or SI (0x0F): invoke G0 into GL
+ LS1 or SO (0x0E): invoke G1 into GL
+ LS2: invoke G2 into GL
+ LS3: invoke G3 into GL
+ LS1R: invoke G1 into GR
+ LS2R: invoke G2 into GR
+ LS3R: invoke G3 into GR
@end example
Single Shift is done as follows:
@example
@group
- SS2 or ESC N: invoke G2 into GL
- SS3 or ESC O: invoke G3 into GL
+ SS2 or ESC N: invoke G2 into GL
+ SS3 or ESC O: invoke G3 into GL
@end group
@end example
@example
@group
junet -- Coding system used in JUNET.
- 1. G0 <- ASCII, G1..3 <- never used
- 2. Yes.
- 3. Yes.
- 4. Yes.
- 5. 7-bit environment
- 6. No.
- 7. Use ASCII
- 8. Use JISX0208-1983
+ 1. G0 <- ASCII, G1..3 <- never used
+ 2. Yes.
+ 3. Yes.
+ 4. Yes.
+ 5. 7-bit environment
+ 6. No.
+ 7. Use ASCII
+ 8. Use JISX0208-1983
@end group
@group
ctext -- Compound Text
- 1. G0 <- ASCII, G1 <- Latin-1, G2,3 <- never used
- 2. No.
- 3. No.
- 4. Yes.
- 5. 8-bit environment
- 6. No.
- 7. Use ASCII
- 8. Use JISX0208-1983
+ 1. G0 <- ASCII, G1 <- Latin-1, G2,3 <- never used
+ 2. No.
+ 3. No.
+ 4. Yes.
+ 5. 8-bit environment
+ 6. No.
+ 7. Use ASCII
+ 8. Use JISX0208-1983
@end group
@group
euc-china -- Chinese EUC. Although many people call this
as "GB encoding", the name may cause misunderstanding.
- 1. G0 <- ASCII, G1 <- GB2312, G2,3 <- never used
- 2. No.
- 3. Yes.
- 4. Yes.
- 5. 8-bit environment
- 6. No.
- 7. Use ASCII
- 8. Use JISX0208-1983
+ 1. G0 <- ASCII, G1 <- GB2312, G2,3 <- never used
+ 2. No.
+ 3. Yes.
+ 4. Yes.
+ 5. 8-bit environment
+ 6. No.
+ 7. Use ASCII
+ 8. Use JISX0208-1983
@end group
@group
korean-mail -- Coding system used in Korean network.
- 1. G0 <- ASCII, G1 <- KSC5601, G2,3 <- never used
- 2. No.
- 3. Yes.
- 4. Yes.
- 5. 7-bit environment
- 6. Yes.
- 7. No.
- 8. No.
+ 1. G0 <- ASCII, G1 <- KSC5601, G2,3 <- never used
+ 2. No.
+ 3. Yes.
+ 4. Yes.
+ 5. 7-bit environment
+ 6. Yes.
+ 7. No.
+ 8. No.
@end group
@end example
For example, many ISO-2022-compliant coding systems (such as Compound
Text, which is used for inter-client data under the X Window System) use
-escape sequences to switch between different charsets -- Japanese Kanji,
+escape sequences to switch between different charsets---Japanese Kanji,
for example, is invoked with @samp{ESC $ ( B}; ASCII is invoked with
@samp{ESC ( B}; and Cyrillic is invoked with @samp{ESC - L}. See
@code{make-coding-system} for more information.
A category table is a type of char table used for keeping track of
categories. Categories are used for classifying characters for use in
-regexps -- you can refer to a category rather than having to use a
+regexps---you can refer to a category rather than having to use a
complicated [] expression (and category lookups are significantly
faster).
are integers are the same. Byte code compiled under any version 19
Emacs will have all such functions mapped to their @code{old-} equivalents
when the byte code is read into XEmacs 20. This is to preserve
-compatibility -- Emacs 19 converts all constant characters to the equivalent
+compatibility---Emacs 19 converts all constant characters to the equivalent
integer during byte-compilation, and thus there is no other way to preserve
byte-code compatibility even if the code has specifically been written
with the distinction between characters and integers in mind.
code}. For example, the character @kbd{A} is represented as the
@w{integer 65}, following the standard @sc{ascii} representation of
characters. If XEmacs was not compiled with @sc{mule} support, the
-range of this integer will always be 0 to 255 -- eight bits, or one
+range of this integer will always be 0 to 255---eight bits, or one
byte. (Integers outside this range are accepted but silently truncated;
however, you should most decidedly @emph{not} rely on this, because it
will not work under XEmacs with @sc{mule} support.) When @sc{mule}
@end defun
@menu
-* Introduction to Specifiers:: Specifiers provide a clean way for
- display and other properties to vary
- (under user control) in a wide variety
- of contexts.
-* Specifiers In-Depth:: Gory details about specifier innards.
-* Specifier Instancing:: Instancing means obtaining the ``value'' of
- a specifier in a particular context.
-* Specifier Types:: Specifiers come in different flavors.
-* Adding Specifications:: Specifications control a specifier's ``value''
- by giving conditions under which a
- particular value is valid.
-* Retrieving Specifications:: Querying a specifier's specifications.
-* Specifier Tag Functions:: Working with specifier tags.
+* Introduction to Specifiers:: Specifiers provide a clean way for
+ display and other properties to vary
+ (under user control) in a wide variety
+ of contexts.
+* Specifiers In-Depth:: Gory details about specifier innards.
+* Specifier Instancing:: Instancing means obtaining the ``value'' of
+ a specifier in a particular context.
+* Specifier Types:: Specifiers come in different flavors.
+* Adding Specifications:: Specifications control a specifier's ``value''
+ by giving conditions under which a
+ particular value is valid.
+* Retrieving Specifications:: Querying a specifier's specifications.
+* Specifier Tag Functions:: Working with specifier tags.
* Specifier Instancing Functions::
- Functions to instance a specifier.
-* Specifier Example:: Making all this stuff clearer.
-* Creating Specifiers:: Creating specifiers for your own use.
+ Functions to instance a specifier.
+* Specifier Example:: Making all this stuff clearer.
+* Creating Specifiers:: Creating specifiers for your own use.
* Specifier Validation Functions::
- Validating the components of a specifier.
+ Validating the components of a specifier.
* Other Specification Functions::
- Other ways of working with specifications.
+ Other ways of working with specifications.
@end menu
@node Introduction to Specifiers
User-defined tags may be defined, with an optional predicate specified.
An application can create its own tag, use it to mark all its
instantiators, and be fairly confident that it will not interfere with
-other applications that modify the same specifier -- Functions that add
+other applications that modify the same specifier---Functions that add
a specification to a specifier usually only overwrite existing
inst-pairs with the same tag set as was given, and a particular tag or
tag set can be specified when removing instantiators.
different font names, with possibly different foundries, widths, etc.,
on different devices), the extra properties of that font on that
device, etc. Furthermore, this conversion (called @dfn{instantiation})
-might fail -- a font or color might not exist on a particular device,
+might fail---a font or color might not exist on a particular device,
for example.
@node Specifier Instancing
@result{} ((#<buffer "device.c"> (nil . "forest green"))
(#<window on "Makefile" 0x8a2b> (nil . "hot pink"))
(#<x-frame "emacs" 0x4ac> (nil . "puke orange")
- (nil . "moccasin"))
+ (nil . "moccasin"))
(#<x-frame "VM" 0x4ac> (nil . "magenta"))
- (global ((tty) . "cyan") (nil . "white"))
+ (global ((tty) . "cyan") (nil . "white"))
)
@end example
@enumerate
@item
First, we look for a specification matching the buffer displayed in the
-window, i.e. @samp{*scratch}. There are none, so we proceed.
+window, i.e. @samp{*scratch*}. There are none, so we proceed.
@item
Then, we look for a specification matching the window itself. Again, there
are none.
Lisp programs use strings more often than individual characters.
@menu
-* Basics: String Basics. Basic properties of strings and characters.
+* String Basics:: Basic properties of strings and characters.
* Predicates for Strings:: Testing whether an object is a string or char.
* Creating Strings:: Functions to allocate new strings.
* Predicates for Characters:: Testing whether an object is a character.
@section Toolbar Intro
A @dfn{toolbar} is a bar of icons displayed along one edge of a frame.
-You can view a toolbar as a series of menu shortcuts -- the most
+You can view a toolbar as a series of menu shortcuts---the most
common menu options can be accessed with a single click rather than
a series of clicks and/or drags to select the option from a menu.
Consistent with this, a help string (called the @dfn{help-echo})
buffer does not specify a left toolbar or has a nil value specified for
@code{left-toolbar-visible-p}), you will find that, when that buffer is
displayed in the selected window, the window will have a width of 86 or
-87 characters -- the frame is sized for a 68-pixel left toolbar but the
+87 characters---the frame is sized for a 68-pixel left toolbar but the
selected window specifies that the left toolbar is not visible, so it is
expanded to take up the slack.
Send a reply to this message. The second argument can be @code{reply},
@code{reject} or @code{fail}; the default is @code{reply}. Before
sending a reply, all message arguments whose mode is @code{TT_INOUT} or
-@code{TT_OUT} should have been filled in -- see
+@code{TT_OUT} should have been filled in---see
@code{set-tooltalk-message-attribute}.
@refill
@end defun
generalize well, and they are covered specially here.
@menu
-* X Selections:: Transferring text to and from other X clients.
-* X Server:: Information about the X server connected to
- a particular device.
+* X Selections:: Transferring text to and from other X clients.
+* X Server:: Information about the X server connected to
+ a particular device.
* X Miscellaneous:: Other X-specific functions and variables.
@end menu
the X server XEmacs is using.
@menu
-* Resources:: Getting resource values from the server.
-* Server Data:: Getting info about the X server.
-* Grabs:: Restricting access to the server by other apps.
+* Resources:: Getting resource values from the server.
+* Server Data:: Getting info about the X server.
+* Grabs:: Restricting access to the server by other apps.
@end menu
@node Resources
@example
@code{XrmGetResource (db, "xemacs.buffer.@var{buffer-name}.foreground",
- "Emacs.EmacsLocaleType.EmacsBuffer.Foreground",
- "String");}
+ "Emacs.EmacsLocaleType.EmacsBuffer.Foreground",
+ "String");}
@end example
@item
@example
@code{XrmGetResource (db, "xemacs.frame.@var{frame-name}.foreground",
- "Emacs.EmacsLocaleType.EmacsFrame.Foreground",
- "String");}
+ "Emacs.EmacsLocaleType.EmacsFrame.Foreground",
+ "String");}
@end example
@item
@example
@code{XrmGetResource (db, "xemacs.device.@var{device-name}.foreground",
- "Emacs.EmacsLocaleType.EmacsDevice.Foreground",
- "String");}
+ "Emacs.EmacsLocaleType.EmacsDevice.Foreground",
+ "String");}
@end example
@item
@example
@code{XrmGetResource (db, "xemacs.foreground",
- "Emacs.Foreground",
- "String");}
+ "Emacs.Foreground",
+ "String");}
@end example
@end enumerate
@defun x-grab-keyboard &optional device
This function grabs the keyboard on the given device (defaulting to the
selected one). So long as the keyboard is grabbed, all keyboard events
-will be delivered to XEmacs -- it is not possible for other X clients to
+will be delivered to XEmacs---it is not possible for other X clients to
eavesdrop on them. Ungrab the keyboard with @code{x-ungrab-keyboard}
(use an @code{unwind-protect}). Returns @code{t} if the grab was
successful; @code{nil} otherwise.
(add-hook 'texinfo-mode-hook 'turn-on-font-lock)
;;; enables the font-lock mode in C Mode
-(add-hook 'c-mode-hook 'turn-on-font-lock)
+(add-hook 'c-mode-hook 'turn-on-font-lock)
@end example
To turn on the font-lock mode in other Major Modes like emacs-lisp, just
of your list will contain:
@example
-C-c C-c n texinfo-insert-@@node
-C-c C-c o texinfo-insert-@@noindent
-C-c C-c s texinfo-insert-@@samp
-C-c C-c t texinfo-insert-@@table
-C-c C-c v texinfo-insert-@@var
-C-c C-c x texinfo-insert-@@example
-C-c C-c @{ texinfo-insert-braces
+C-c C-c n texinfo-insert-@@node
+C-c C-c o texinfo-insert-@@noindent
+C-c C-c s texinfo-insert-@@samp
+C-c C-c t texinfo-insert-@@table
+C-c C-c v texinfo-insert-@@var
+C-c C-c x texinfo-insert-@@example
+C-c C-c @{ texinfo-insert-braces
@end example
@noindent
These keybindings apply only to "Texinfo" mode. @xref{Modes}, for more
the major mode is c-mode.
@example
-(add-hook 'c-mode-hook 'turn-on-font-lock)
+(add-hook 'c-mode-hook 'turn-on-font-lock)
@end example
@noindent
@ifinfo
@dircategory XEmacs Editor
@direntry
-* Widgets: (widget). The Emacs Widget Library.
+* Widgets: (widget). The Emacs Widget Library.
@end direntry
@end ifinfo
(make-local-variable 'widget-example-repeat)
(widget-insert "Here is some documentation.\n\nName: ")
(widget-create 'editable-field
- :size 13
- "My Name")
+ :size 13
+ "My Name")
(widget-create 'menu-choice
- :tag "Choose"
- :value "This"
- :help-echo "Choose me, please!"
- :notify (lambda (widget &rest ignore)
- (message "%s is a good choice!"
- (widget-value widget)))
- '(item :tag "This option" :value "This")
- '(choice-item "That option")
- '(editable-field :menu-tag "No option" "Thus option"))
+ :tag "Choose"
+ :value "This"
+ :help-echo "Choose me, please!"
+ :notify (lambda (widget &rest ignore)
+ (message "%s is a good choice!"
+ (widget-value widget)))
+ '(item :tag "This option" :value "This")
+ '(choice-item "That option")
+ '(editable-field :menu-tag "No option" "Thus option"))
(widget-insert "Address: ")
(widget-create 'editable-field
- "Some Place\nIn some City\nSome country.")
+ "Some Place\nIn some City\nSome country.")
(widget-insert "\nSee also ")
(widget-create 'link
- :notify (lambda (&rest ignore)
- (widget-value-set widget-example-repeat
- '("En" "To" "Tre"))
- (widget-setup))
- "other work")
+ :notify (lambda (&rest ignore)
+ (widget-value-set widget-example-repeat
+ '("En" "To" "Tre"))
+ (widget-setup))
+ "other work")
(widget-insert " for more information.\n\nNumbers: count to three below\n")
(setq widget-example-repeat
- (widget-create 'editable-list
- :entry-format "%i %d %v"
- :notify (lambda (widget &rest ignore)
- (let ((old (widget-get widget
- ':example-length))
- (new (length (widget-value widget))))
- (unless (eq old new)
- (widget-put widget ':example-length new)
- (message "You can count to %d." new))))
- :value '("One" "Eh, two?" "Five!")
- '(editable-field :value "three")))
+ (widget-create 'editable-list
+ :entry-format "%i %d %v"
+ :notify (lambda (widget &rest ignore)
+ (let ((old (widget-get widget
+ ':example-length))
+ (new (length (widget-value widget))))
+ (unless (eq old new)
+ (widget-put widget ':example-length new)
+ (message "You can count to %d." new))))
+ :value '("One" "Eh, two?" "Five!")
+ '(editable-field :value "three")))
(widget-insert "\n\nSelect multiple:\n\n")
(widget-create 'checkbox t)
(widget-insert " This\n")
(widget-create 'checkbox nil)
(widget-insert " That\n")
(widget-create 'checkbox
- :notify (lambda (&rest ignore) (message "Tickle"))
- t)
+ :notify (lambda (&rest ignore) (message "Tickle"))
+ t)
(widget-insert " Thus\n\nSelect one:\n\n")
(widget-create 'radio-button-choice
- :value "One"
- :notify (lambda (widget &rest ignore)
- (message "You selected %s"
- (widget-value widget)))
- '(item "One") '(item "Another One.") '(item "A Final One."))
+ :value "One"
+ :notify (lambda (widget &rest ignore)
+ (message "You selected %s"
+ (widget-value widget)))
+ '(item "One") '(item "Another One.") '(item "A Final One."))
(widget-insert "\n")
(widget-create 'push-button
- :notify (lambda (&rest ignore)
- (if (= (length (widget-value widget-example-repeat))
- 3)
- (message "Congratulation!")
- (error "Three was the count!")))
- "Apply Form")
+ :notify (lambda (&rest ignore)
+ (if (= (length (widget-value widget-example-repeat))
+ 3)
+ (message "Congratulation!")
+ (error "Three was the count!")))
+ "Apply Form")
(widget-insert " ")
(widget-create 'push-button
- :notify (lambda (&rest ignore)
- (widget-example))
- "Reset Form")
+ :notify (lambda (&rest ignore)
+ (widget-example))
+ "Reset Form")
(widget-insert "\n")
(use-local-map widget-keymap)
(widget-setup))
@finalout
@titlepage
@title XEmacs FAQ
-@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2000/01/16 13:41:45 $
+@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2000/01/27 17:11:28 $
@sp 1
@author Tony Rossini <rossini@@biostat.washington.edu>
@author Ben Wing <ben@@xemacs.org>
@ifinfo
@dircategory XEmacs Editor
@direntry
-* FAQ: (xemacs-faq). XEmacs FAQ.
+* FAQ: (xemacs-faq). XEmacs FAQ.
@end direntry
@end ifinfo
XEmacs on MS Windows
General Info:
-* Q6.0.1:: What is the status of the XEmacs port to Windows?
-* Q6.0.2:: What flavors of MS Windows are supported?
-* Q6.0.3:: Are binary kits available?
-* Q6.0.4:: Does XEmacs on MS Windows require an X server to run?
+* Q6.0.1:: What is the status of the XEmacs port to Windows?
+* Q6.0.2:: What flavors of MS Windows are supported?
+* Q6.0.3:: Are binary kits available?
+* Q6.0.4:: Does XEmacs on MS Windows require an X server to run?
Building XEmacs on MS Windows:
-* Q6.1.1:: I decided to run with X. Where do I get an X server?
-* Q6.1.2:: What compiler do I need to compile XEmacs?
-* Q6.1.3:: How do I compile for the native port?
-* Q6.1.4:: How do I compile for the X port?
-* Q6.1.5:: How do I compile for Cygnus' Cygwin?
-* Q6.1.6:: What do I need for Cygwin?
+* Q6.1.1:: I decided to run with X. Where do I get an X server?
+* Q6.1.2:: What compiler do I need to compile XEmacs?
+* Q6.1.3:: How do I compile for the native port?
+* Q6.1.4:: How do I compile for the X port?
+* Q6.1.5:: How do I compile for Cygnus' Cygwin?
+* Q6.1.6:: What do I need for Cygwin?
Customization and User Interface:
-* Q6.2.1:: How will the port cope with differences in the Windows user interface?
-* Q6.2.2:: How do I change fonts in XEmacs on MS Windows?
-* Q6.2.3:: Where do I put my @file{.emacs} file?
+* Q6.2.1:: How will the port cope with differences in the Windows user interface?
+* Q6.2.2:: How do I change fonts in XEmacs on MS Windows?
+* Q6.2.3:: Where do I put my @file{.emacs} file?
Miscellaneous:
-* Q6.3.1:: Will XEmacs rename all the win32-* symbols to w32-*?
-* Q6.3.2:: What are the differences between the various MS Windows emacsen?
-* Q6.3.3:: What is the porting team doing at the moment?
+* Q6.3.1:: Will XEmacs rename all the win32-* symbols to w32-*?
+* Q6.3.2:: What are the differences between the various MS Windows emacsen?
+* Q6.3.3:: What is the porting team doing at the moment?
Current Events:
are integers are the same. Byte code compiled under any version 19
Emacs will have all such functions mapped to their @code{old-} equivalents
when the byte code is read into XEmacs 20. This is to preserve
-compatibility -- Emacs 19 converts all constant characters to the equivalent
+compatibility---Emacs 19 converts all constant characters to the equivalent
integer during byte-compilation, and thus there is no other way to preserve
byte-code compatibility even if the code has specifically been written
with the distinction between characters and integers in mind.
code}. For example, the character @kbd{A} is represented as the
@w{integer 65}, following the standard @sc{ascii} representation of
characters. If XEmacs was not compiled with @sc{mule} support, the
-range of this integer will always be 0 to 255 -- eight bits, or one
+range of this integer will always be 0 to 255---eight bits, or one
byte. (Integers outside this range are accepted but silently truncated;
however, you should most decidedly @emph{not} rely on this, because it
will not work under XEmacs with @sc{mule} support.) When @sc{mule}
enable it, add to your @file{Emacs} file entries like this:
@example
-Emacs*XlwMenu.resourceLabels: True
-Emacs*XlwMenu.file.labelString: Fichier
-Emacs*XlwMenu.openInOtherWindow.labelString: In anderem Fenster offnen
+Emacs*XlwMenu.resourceLabels: True
+Emacs*XlwMenu.file.labelString: Fichier
+Emacs*XlwMenu.openInOtherWindow.labelString: In anderem Fenster offnen
@end example
The name of the resource is derived from the non-localized entry by
(cond ((boundp 'MULE)
;; for original Mule
)
- ((string-match "XEmacs" emacs-version)
- ;; for XEmacs with Mule
- )
- (t
- ;; for next version of Emacs
- ))
+ ((string-match "XEmacs" emacs-version)
+ ;; for XEmacs with Mule
+ )
+ (t
+ ;; for next version of Emacs
+ ))
;; for old emacs variants
)
@end lisp
Now examine the space used by directory:
@format
-0 /usr/local/bin/xemacs
-2048 /usr/local/bin/xemacs-19.13
+0 /usr/local/bin/xemacs
+2048 /usr/local/bin/xemacs-19.13
-1546 /usr/local/lib/xemacs-19.13/i486-miranova-sco3.2v4.2
-1158 /usr/local/lib/xemacs-19.13/i486-unknown-linux1.2.13
+1546 /usr/local/lib/xemacs-19.13/i486-miranova-sco3.2v4.2
+1158 /usr/local/lib/xemacs-19.13/i486-unknown-linux1.2.13
@end format
You need to keep these. XEmacs isn't stripped by default in
5MB right there.
@format
-207 /usr/local/lib/xemacs-19.13/etc/w3
-122 /usr/local/lib/xemacs-19.13/etc/sounds
-18 /usr/local/lib/xemacs-19.13/etc/sparcworks
-159 /usr/local/lib/xemacs-19.13/etc/vm
-6 /usr/local/lib/xemacs-19.13/etc/e
-21 /usr/local/lib/xemacs-19.13/etc/eos
-172 /usr/local/lib/xemacs-19.13/etc/toolbar
-61 /usr/local/lib/xemacs-19.13/etc/ns
-43 /usr/local/lib/xemacs-19.13/etc/gnus
+207 /usr/local/lib/xemacs-19.13/etc/w3
+122 /usr/local/lib/xemacs-19.13/etc/sounds
+18 /usr/local/lib/xemacs-19.13/etc/sparcworks
+159 /usr/local/lib/xemacs-19.13/etc/vm
+6 /usr/local/lib/xemacs-19.13/etc/e
+21 /usr/local/lib/xemacs-19.13/etc/eos
+172 /usr/local/lib/xemacs-19.13/etc/toolbar
+61 /usr/local/lib/xemacs-19.13/etc/ns
+43 /usr/local/lib/xemacs-19.13/etc/gnus
@end format
These are support directories for various packages. In general they
do not require the package, you may delete or gzip the support too.
@format
-1959 /usr/local/lib/xemacs-19.13/etc
-175 /usr/local/lib/xemacs-19.13/lisp/bytecomp
-340 /usr/local/lib/xemacs-19.13/lisp/calendar
-342 /usr/local/lib/xemacs-19.13/lisp/comint
-517 /usr/local/lib/xemacs-19.13/lisp/dired
-42 /usr/local/lib/xemacs-19.13/lisp/electric
-212 /usr/local/lib/xemacs-19.13/lisp/emulators
-238 /usr/local/lib/xemacs-19.13/lisp/energize
-289 /usr/local/lib/xemacs-19.13/lisp/gnus
-457 /usr/local/lib/xemacs-19.13/lisp/ilisp
-1439 /usr/local/lib/xemacs-19.13/lisp/modes
-2276 /usr/local/lib/xemacs-19.13/lisp/packages
-1040 /usr/local/lib/xemacs-19.13/lisp/prim
-176 /usr/local/lib/xemacs-19.13/lisp/pcl-cvs
-154 /usr/local/lib/xemacs-19.13/lisp/rmail
-3 /usr/local/lib/xemacs-19.13/lisp/epoch
-45 /usr/local/lib/xemacs-19.13/lisp/term
-860 /usr/local/lib/xemacs-19.13/lisp/utils
-851 /usr/local/lib/xemacs-19.13/lisp/vm
-13 /usr/local/lib/xemacs-19.13/lisp/vms
-157 /usr/local/lib/xemacs-19.13/lisp/x11
-19 /usr/local/lib/xemacs-19.13/lisp/tooltalk
-14 /usr/local/lib/xemacs-19.13/lisp/sunpro
-291 /usr/local/lib/xemacs-19.13/lisp/games
-198 /usr/local/lib/xemacs-19.13/lisp/edebug
-619 /usr/local/lib/xemacs-19.13/lisp/w3
-229 /usr/local/lib/xemacs-19.13/lisp/eos
-55 /usr/local/lib/xemacs-19.13/lisp/iso
-59 /usr/local/lib/xemacs-19.13/lisp/mailcrypt
-187 /usr/local/lib/xemacs-19.13/lisp/eterm
-356 /usr/local/lib/xemacs-19.13/lisp/ediff
-408 /usr/local/lib/xemacs-19.13/lisp/hyperbole/kotl
-1262 /usr/local/lib/xemacs-19.13/lisp/hyperbole
-247 /usr/local/lib/xemacs-19.13/lisp/hm--html-menus
-161 /usr/local/lib/xemacs-19.13/lisp/mh-e
-299 /usr/local/lib/xemacs-19.13/lisp/viper
-53 /usr/local/lib/xemacs-19.13/lisp/oobr/tree-x
-4 /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj/DocWindow.nib
-3 /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj/InfoPanel.nib
-3 /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj/TreeView.nib
-11 /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj
-53 /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx
-466 /usr/local/lib/xemacs-19.13/lisp/oobr
-14142 /usr/local/lib/xemacs-19.13/lisp
+1959 /usr/local/lib/xemacs-19.13/etc
+175 /usr/local/lib/xemacs-19.13/lisp/bytecomp
+340 /usr/local/lib/xemacs-19.13/lisp/calendar
+342 /usr/local/lib/xemacs-19.13/lisp/comint
+517 /usr/local/lib/xemacs-19.13/lisp/dired
+42 /usr/local/lib/xemacs-19.13/lisp/electric
+212 /usr/local/lib/xemacs-19.13/lisp/emulators
+238 /usr/local/lib/xemacs-19.13/lisp/energize
+289 /usr/local/lib/xemacs-19.13/lisp/gnus
+457 /usr/local/lib/xemacs-19.13/lisp/ilisp
+1439 /usr/local/lib/xemacs-19.13/lisp/modes
+2276 /usr/local/lib/xemacs-19.13/lisp/packages
+1040 /usr/local/lib/xemacs-19.13/lisp/prim
+176 /usr/local/lib/xemacs-19.13/lisp/pcl-cvs
+154 /usr/local/lib/xemacs-19.13/lisp/rmail
+3 /usr/local/lib/xemacs-19.13/lisp/epoch
+45 /usr/local/lib/xemacs-19.13/lisp/term
+860 /usr/local/lib/xemacs-19.13/lisp/utils
+851 /usr/local/lib/xemacs-19.13/lisp/vm
+13 /usr/local/lib/xemacs-19.13/lisp/vms
+157 /usr/local/lib/xemacs-19.13/lisp/x11
+19 /usr/local/lib/xemacs-19.13/lisp/tooltalk
+14 /usr/local/lib/xemacs-19.13/lisp/sunpro
+291 /usr/local/lib/xemacs-19.13/lisp/games
+198 /usr/local/lib/xemacs-19.13/lisp/edebug
+619 /usr/local/lib/xemacs-19.13/lisp/w3
+229 /usr/local/lib/xemacs-19.13/lisp/eos
+55 /usr/local/lib/xemacs-19.13/lisp/iso
+59 /usr/local/lib/xemacs-19.13/lisp/mailcrypt
+187 /usr/local/lib/xemacs-19.13/lisp/eterm
+356 /usr/local/lib/xemacs-19.13/lisp/ediff
+408 /usr/local/lib/xemacs-19.13/lisp/hyperbole/kotl
+1262 /usr/local/lib/xemacs-19.13/lisp/hyperbole
+247 /usr/local/lib/xemacs-19.13/lisp/hm--html-menus
+161 /usr/local/lib/xemacs-19.13/lisp/mh-e
+299 /usr/local/lib/xemacs-19.13/lisp/viper
+53 /usr/local/lib/xemacs-19.13/lisp/oobr/tree-x
+4 /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj/DocWindow.nib
+3 /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj/InfoPanel.nib
+3 /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj/TreeView.nib
+11 /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj
+53 /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx
+466 /usr/local/lib/xemacs-19.13/lisp/oobr
+14142 /usr/local/lib/xemacs-19.13/lisp
@end format
These are all Emacs Lisp source code and bytecompiled object code. You
certain packages can be removed from them if you do not use them.
@example
-1972 /usr/local/lib/xemacs-19.13/info
+1972 /usr/local/lib/xemacs-19.13/info
@end example
These are online texinfo sources. You may either gzip them or remove
them. In either case, @kbd{C-h i} (info mode) will no longer work.
@example
-20778 /usr/local/lib/xemacs-19.13
+20778 /usr/local/lib/xemacs-19.13
@end example
The 20MB achieved is less than half of what the full distribution takes up,
suffice. If you don't understand how to do this, don't do it.
@item
-Rebuild XEmacs yourself -- any working ELF version of libc should be
+Rebuild XEmacs yourself---any working ELF version of libc should be
O.K.
@end enumerate
like:
@example
-*Foreground: Black ;everything will be of black on grey95,
-*Background: Grey95 ;unless otherwise specified.
-*cursorColor: Red3 ;red3 cursor with grey95 border.
-*pointerColor: Red3 ;red3 pointer with grey95 border.
+*Foreground: Black ;everything will be of black on grey95,
+*Background: Grey95 ;unless otherwise specified.
+*cursorColor: Red3 ;red3 cursor with grey95 border.
+*pointerColor: Red3 ;red3 pointer with grey95 border.
@end example
@end quotation
(setq default-minibuffer-frame
(make-frame
'(minibuffer only
- width 86
- height 1
- menubar-visible-p nil
- default-toolbar-visible-p nil
- name "minibuffer"
- top -2
- left -2
- has-modeline-p nil)))
+ width 86
+ height 1
+ menubar-visible-p nil
+ default-toolbar-visible-p nil
+ name "minibuffer"
+ top -2
+ left -2
+ has-modeline-p nil)))
(frame-notice-user-settings)
@end lisp
@lisp
(setq frame-title-format
'("%S: " (buffer-file-name "%f"
- (dired-directory dired-directory "%b"))))
+ (dired-directory dired-directory "%b"))))
@end lisp
That is, use the file name, or the dired-directory, or the buffer name.
(set-face-background 'default "bisque") ; frame background
(set-face-foreground 'default "black") ; normal text
(set-face-background 'zmacs-region "red") ; When selecting w/
- ; mouse
+ ; mouse
(set-face-foreground 'zmacs-region "yellow")
(set-face-font 'default "*courier-bold-r*120-100-100*")
(set-face-background 'highlight "blue") ; Ie when selecting
- ; buffers
+ ; buffers
(set-face-foreground 'highlight "yellow")
(set-face-background 'modeline "blue") ; Line at bottom
- ; of buffer
+ ; of buffer
(set-face-foreground 'modeline "white")
(set-face-font 'modeline "*bold-r-normal*140-100-100*")
(set-face-background 'isearch "yellow") ; When highlighting
- ; while searching
+ ; while searching
(set-face-foreground 'isearch "red")
(setq x-pointer-foreground-color "black") ; Adds to bg color,
- ; so keep black
+ ; so keep black
(setq x-pointer-background-color "blue") ; This is color
- ; you really
- ; want ptr/crsr
+ ; you really
+ ; want ptr/crsr
@end lisp
@node Q3.2.2, Q3.2.3, Q3.2.1, Customization
@lisp
(add-hook 'TeX-mode-hook
- '(lambda () (setq fume-display-in-modeline-p nil)))
+ '(lambda () (setq fume-display-in-modeline-p nil)))
@end lisp
@email{dhughes@@origin-at.co.uk, David Hughes} writes:
@lisp
(global-set-key [(control ?.)]
(lambda () (interactive) (scroll-up 1)))
-(global-set-key [(control ? ;)]
- (lambda () (interactive) (scroll-up -1)))
+(global-set-key [(control ?;)]
+ (lambda () (interactive) (scroll-up -1)))
@end lisp
This is fine if you only need a few functions within the lambda body.
(scroll-down 1))
(global-set-key [(control ?.)] 'scroll-up-one-line) ; C-.
-(global-set-key [(control ? ;)] 'scroll-down-one-line) ; C-;
+(global-set-key [(control ?;)] 'scroll-down-one-line) ; C-;
@end lisp
The key point is that you can only bind simple functions to keys; you
@c hey, show some respect, willya -- there's xkeycaps, isn't there? --
@c chr ;)
@example
- xmodmap -e 'keycode 0xff20 = Multi_key'
+ xmodmap -e 'keycode 0xff20 = Multi_key'
@end example
You will need to pick an appropriate keycode. Use xev to find out the
Once you have Multi_key defined, you can use e.g.
@example
- Multi a ' => á
- Multi e " => ë
- Multi c , => ç
+ Multi a ' => á
+ Multi e " => ë
+ Multi c , => ç
@end example
etc.
Also, recent versions of XFree86 define various AltGr-<key>
combinations as dead keys, i.e.
@example
- AltGr [ => dead_diaeresis
- AltGr ] => dead_tilde
- AltGr ; => dead_acute
+ AltGr [ => dead_diaeresis
+ AltGr ] => dead_tilde
+ AltGr ; => dead_acute
@end example
etc.
You can use a color to make it stand out better:
@example
-Emacs*cursorColor: Red
+Emacs*cursorColor: Red
@end example
@node Q3.6.2, Q3.6.3, Q3.6.1, Customization
(interactive "_P")
(let ((zmacs-region-stays t))
(if (interactive-p)
- (condition-case nil
- ad-do-it
- (end-of-buffer (goto-char (point-max))))
+ (condition-case nil
+ ad-do-it
+ (end-of-buffer (goto-char (point-max))))
ad-do-it)))
(defadvice scroll-down (around scroll-down freeze)
(interactive "_P")
(let ((zmacs-region-stays t))
(if (interactive-p)
- (condition-case nil
- ad-do-it
- (beginning-of-buffer (goto-char (point-min))))
+ (condition-case nil
+ ad-do-it
+ (beginning-of-buffer (goto-char (point-min))))
ad-do-it)))
@end lisp
@lisp
(setq vm-reply-ignored-addresses
'("wing@@nuspl@@nvwls.cc.purdue.edu,netcom[0-9]*.netcom.com"
- "wing@@netcom.com" "wing@@xemacs.org"))
+ "wing@@netcom.com" "wing@@xemacs.org"))
@end lisp
Note that each string is a regular expression.
@quotation
@lisp
- ; Don't use multiple frames
+ ; Don't use multiple frames
(setq vm-frame-per-composition nil)
(setq vm-frame-per-folder nil)
(setq vm-frame-per-edit nil)
@lisp
(add-hook 'mh-show-mode-hook '(lambda ()
- (smiley-region (point-min)
+ (smiley-region (point-min)
(point-max))))
@end lisp
Each package bundled with XEmacs means more work for the maintainers,
whether they want it or not. If you are ready to take over the
maintenance responsibilities for the package you port, be sure to say
-so -- we will more likely include it.
+so---we will more likely include it.
@item
The package simply hasn't been noted by the XEmacs development. If
automatically start it by adding lines like:
@lisp
-(add-hook 'emacs-lisp-mode-hook 'turn-on-font-lock)
-(add-hook 'dired-mode-hook 'turn-on-font-lock)
+(add-hook 'emacs-lisp-mode-hook 'turn-on-font-lock)
+(add-hook 'dired-mode-hook 'turn-on-font-lock)
@end lisp
to your @file{.emacs}. See the file @file{etc/sample.emacs} for more
@lisp
(let ((case-fold-search nil))
- ... ; code with searches that must be case-sensitive
+ ... ; code with searches that must be case-sensitive
...)
@end lisp
@lisp
(defun my-function (whatever)
- (let (a) ; default initialization is to nil
+ (let (a) ; default initialization is to nil
... build a large list ...
... and exit, unbinding `a' in the process ...)
@end lisp
The reason for the warning is the following:
@lisp
-(defun flurgoze nil) ; ok, global internal variable
+(defun flurgoze nil) ; ok, global internal variable
...
-(setq flurghoze t) ; ops! a typo, but semantically correct.
- ; however, the byte-compiler warns.
+(setq flurghoze t) ; ops! a typo, but semantically correct.
+ ; however, the byte-compiler warns.
While compiling toplevel forms:
** assignment to free variable flurghoze
(setq sound-alist nil)
@end lisp
-That will make your XEmacs totally silent -- even the default ding sound
+That will make your XEmacs totally silent---even the default ding sound
(TTY beep on TTY-s) will be gone.
Starting with XEmacs-20.2 you can also change these with Customize.
like:
@lisp
-(add-hook 'postscript-mode-hook 'turn-on-font-lock)
+(add-hook 'postscript-mode-hook 'turn-on-font-lock)
@end lisp
Take it out, restart XEmacs, and it won't try to fontify your postscript
@lisp
(setq Info-directory-list (cons
- (expand-file-name "~/info")
- Info-default-directory-list))
+ (expand-file-name "~/info")
+ Info-default-directory-list))
@end lisp
@email{davidm@@prism.kla.com, David Masterson} writes:
@menu
General Info
-* Q6.0.1:: What is the status of the XEmacs port to Windows?
-* Q6.0.2:: What flavors of MS Windows are supported?
+* Q6.0.1:: What is the status of the XEmacs port to Windows?
+* Q6.0.2:: What flavors of MS Windows are supported?
* Q6.0.3:: Where are the XEmacs on MS Windows binaries?
-* Q6.0.4:: Does XEmacs on MS Windows require an X server to run?
+* Q6.0.4:: Does XEmacs on MS Windows require an X server to run?
Building XEmacs on MS Windows
-* Q6.1.1:: I decided to run with X. Where do I get an X server?
-* Q6.1.2:: What compiler do I need to compile XEmacs?
-* Q6.1.3:: How do I compile for the native port?
-* Q6.1.4:: How do I compile for the X port?
-* Q6.1.5:: How do I compile for Cygnus' Cygwin?
-* Q6.1.6:: What do I need for Cygwin?
+* Q6.1.1:: I decided to run with X. Where do I get an X server?
+* Q6.1.2:: What compiler do I need to compile XEmacs?
+* Q6.1.3:: How do I compile for the native port?
+* Q6.1.4:: How do I compile for the X port?
+* Q6.1.5:: How do I compile for Cygnus' Cygwin?
+* Q6.1.6:: What do I need for Cygwin?
Customization and User Interface
-* Q6.2.1:: How will the port cope with differences in the Windows user interface?
-* Q6.2.2:: How do I change fonts in XEmacs on MS Windows?
-* Q6.2.3:: Where do I put my @file{.emacs} file?
+* Q6.2.1:: How will the port cope with differences in the Windows user interface?
+* Q6.2.2:: How do I change fonts in XEmacs on MS Windows?
+* Q6.2.3:: Where do I put my @file{.emacs} file?
Miscellaneous
-* Q6.3.1:: Will XEmacs rename all the win32-* symbols to w32-*?
-* Q6.3.2:: What are the differences between the various MS Windows emacsen?
-* Q6.3.3:: What is the porting team doing at the moment?
+* Q6.3.1:: Will XEmacs rename all the win32-* symbols to w32-*?
+* Q6.3.2:: What are the differences between the various MS Windows emacsen?
+* Q6.3.3:: What is the porting team doing at the moment?
@end menu
Long answer: XEmacs can be built in several ways in the MS Windows
environment, some of them requiring an X server and some not.
-One is what we call the "X" port -- it requires X libraries to build
+One is what we call the "X" port---it requires X libraries to build
and an X server to run. Internally it uses the Xt event loop and
makes use of X toolkits. Its look is quite un-Windowsy, but it works
reliably and supports all of the graphical features of Unix XEmacs.
reuse much of the Unix XEmacs code base, such as processes and network
support, or internal select() mechanisms.
-Cygwin port supports all display types -- TTY, X & MS gui, and can be
+Cygwin port supports all display types---TTY, X & MS gui, and can be
built with support for all three. If you build with ms gui support
then the Cygwin version uses the majority of the msw code, which is
mostly related to display. If you want to build with X support you
@node Q6.2.2, Q6.2.3, Q6.2.1, MS Windows
@unnumberedsubsec Q6.2.2: How do I change fonts in XEmacs on MS Windows?
-You can change font manually, but not from the menubar, yet. For
-example:
+In 21.2.*, use the font menu. In 21.1.*, you can change font
+manually. For example:
@display
(set-face-font 'default "Lucida Console:Regular:10")
The XEmacs/Mule support has been only seriously tested in a Japanese
locale, and no doubt many problems still remain. The support for
ISO-Latin-1 and Japanese is fairly strong. MULE support comes at a
-price -- about a 30% slowdown from 19.16. We're making progress on
+price---about a 30% slowdown from 19.16. We're making progress on
improving performance and XEmacs 20.3 compiled without Mule (which is
the default) is definitely faster than XEmacs 19.16.
@example
(lisp-mode-abbrev-table)
-"dk" 0 "define-key"
+"dk" 0 "define-key"
(global-abbrev-table)
-"dfn" 0 "definition"
+"dfn" 0 "definition"
@end example
@noindent
MR Buffer Size Mode File
-- ------ ---- ---- ----
.* emacs.tex 383402 Texinfo /u2/emacs/man/emacs.tex
- *Help* 1287 Fundamental
+ *Help* 1287 Fundamental
files.el 23076 Emacs-Lisp /u2/emacs/lisp/files.el
% RMAIL 64042 RMAIL /u/rms/RMAIL
- *% man 747 Dired /u2/emacs/man/
+ *% man 747 Dired /u2/emacs/man/
net.emacs 343885 Fundamental /u/rms/net.emacs
fileio.c 27691 C /u2/emacs/src/fileio.c
NEWS 67340 Text /u2/emacs/etc/NEWS
- *scratch* 0 Lisp Interaction
+ *scratch* 0 Lisp Interaction
@end smallexample
@noindent
file.
* Audible Bell:: Changing how Emacs sounds the bell.
* Faces:: Changing the fonts and colors of a region of text.
-* X Resources:: X resources controlling various aspects of the
+* X Resources:: X resources controlling various aspects of the
behavior of XEmacs.
@end menu
mode and variable settings should be. For example, these are all legal:
@example
- ;;; -*- mode: emacs-lisp -*-
- ;;; -*- mode: postscript; version-control: never -*-
- ;;; -*- tags-file-name: "/foo/bar/TAGS" -*-
+ ;;; -*- mode: emacs-lisp -*-
+ ;;; -*- mode: postscript; version-control: never -*-
+ ;;; -*- tags-file-name: "/foo/bar/TAGS" -*-
@end example
For historical reasons, the syntax @code{`-*- modename -*-'} is allowed
as well; for example, you can use:
@example
- ;;; -*- emacs-lisp -*-
+ ;;; -*- emacs-lisp -*-
@end example
@vindex enable-local-variables
@example
;;; Bind @code{my-command} to @key{f1}
-(global-set-key 'f1 'my-command)
+(global-set-key 'f1 'my-command)
;;; Bind @code{my-command} to @kbd{Shift-f1}
(global-set-key '(shift f1) 'my-command)
;;; Bind @code{my-command} to @kbd{C-c Shift-f1}
-(global-set-key '[(control c) (shift f1)] 'my-command)
+(global-set-key '[(control c) (shift f1)] 'my-command)
;;; Bind @code{my-command} to the middle mouse button.
(global-set-key 'button2 'my-command)
After binding a command to two key sequences with a form like:
@example
- (define-key global-map "\^X\^I" 'command-1)
+ (define-key global-map "\^X\^I" 'command-1)
@end example
it is possible to redefine only one of those sequences like so:
@example
- (define-key global-map [(control x) (control i)] 'command-2)
- (define-key global-map [(control x) tab] 'command-3)
+ (define-key global-map [(control x) (control i)] 'command-2)
+ (define-key global-map [(control x) tab] 'command-3)
@end example
This applies only when running under a window system. If you are
@item undefined-key
You type a key that is undefined
-@item undefined-click
+@item undefined-click
You use an undefined mouse-click combination
-@item no-completion
+@item no-completion
Completion was not possible
-@item y-or-n-p
+@item y-or-n-p
You type something other than the required @code{y} or @code{n}
-@item yes-or-no-p
+@item yes-or-no-p
You type something other than @code{yes} or @code{no}
@end table
Starting with XEmacs 21, XEmacs uses the class @samp{XEmacs} if it finds
any XEmacs resources in the resource database when the X connection is
initialized. Otherwise, it will use the class @samp{Emacs} for
-backwards compatability. The variable @var{x-emacs-application-class}
+backwards compatibility. The variable @var{x-emacs-application-class}
may be consulted to determine the application class being used.
The examples in this section assume the application class is @samp{Emacs}.
@menu
* Geometry Resources:: Controlling the size and position of frames.
-* Iconic Resources:: Controlling whether frames come up iconic.
-* Resource List:: List of resources settable on a frame or device.
-* Face Resources:: Controlling faces using resources.
-* Widgets:: The widget hierarchy for XEmacs.
-* Menubar Resources:: Specifying resources for the menubar.
+* Iconic Resources:: Controlling whether frames come up iconic.
+* Resource List:: List of resources settable on a frame or device.
+* Face Resources:: Controlling faces using resources.
+* Widgets:: The widget hierarchy for XEmacs.
+* Menubar Resources:: Specifying resources for the menubar.
@end menu
@node Geometry Resources
Here are some examples of complete key sequences:
@table @kbd
-@item [(control c) (control a)]
+@item [(control c) (control a)]
Typing @kbd{C-c} followed by @kbd{C-a}
-@item [(control c) (control 65)]
+@item [(control c) (control 65)]
Typing @kbd{C-c} followed by @kbd{C-a}. (Using the ASCII code
for the character `a')@refill
@item [(control c) (break)]
Create a file called @code{~/.xmodmap}. In this file, place the lines
@example
- remove Lock = Caps_Lock
- keysym Caps_Lock = Super_L
- add Mod2 = Super_L
+ remove Lock = Caps_Lock
+ keysym Caps_Lock = Super_L
+ add Mod2 = Super_L
@end example
The first line says that the key that is currently called @code{Caps_Lock}
))
(cond ((and (string-match "XEmacs" emacs-version)
- (or (> emacs-major-version 19)
- (>= emacs-minor-version 12)))
+ (or (> emacs-major-version 19)
+ (>= emacs-minor-version 12)))
;;
;; Code which requires XEmacs version 19.12 or newer goes here
;;
))
(cond ((and (not (string-match "Lucid" emacs-version))
- (= emacs-major-version 19))
+ (= emacs-major-version 19))
;;
;; Code specific to FSF Emacs 19 (not XEmacs) goes here
;;
XEmacs has the following new default function keybindings:
@table @kbd
-@item @key{HELP}
+@item @key{HELP}
Same as @kbd{C-h}.
-@item @key{UNDO}
+@item @key{UNDO}
Same as @kbd{M-x undo}.
-@item @key{CUT}
+@item @key{CUT}
Same as the Cut menu item; that is, it copies the selected text to
the X Clipboard selection.
-@item @key{COPY}
+@item @key{COPY}
Same as the Copy menu item.
-@item @key{PASTE}
+@item @key{PASTE}
Same as the Paste menu item.
@item @key{PGUP}
@item @key{LEFT-ARROW}
Same as the function @code{backward-char}.
-@item @key{RIGHT-ARROW}
+@item @key{RIGHT-ARROW}
Same as the function @code{forward-char}.
@item @key{UP-ARROW}
also listed on the @code{Options} menu under:
@example
- Options->Customize->Emacs->Packages
+ Options->Customize->Emacs->Packages
@end example
However, don't select any of these menu picks unless you actually want
access it via the menus:
@example
- Options->Manage Packages->List & Install
+ Options->Manage Packages->List & Install
@end example
Or, you can get to it via the keyboard:
add these directory names to @code{package-get-remote} using:
@example
- M-x pui-add-install-directory
+ M-x pui-add-install-directory
@end example
Note, however, that any directories added using this function are not
browser and installer, using the menu pick:
@example
- Options->Manage Packages->List & Install
+ Options->Manage Packages->List & Install
@end example
or
@example
- Options->Manage Packages->Using Custom->Select-> ...
+ Options->Manage Packages->Using Custom->Select-> ...
@end example
You can also access it using the keyboard:
customize menus, under:
@example
- Options->Customize->Emacs->Packages-> ...
+ Options->Customize->Emacs->Packages-> ...
@end example
or
@example
- Options->Manage Packages->Using Custom->Select-> ...
+ Options->Manage Packages->Using Custom->Select-> ...
@end example
Set their state to on, and then do:
@example
- Options->Manage Packages->Using Custom->Update Packages
+ Options->Manage Packages->Using Custom->Update Packages
@end example
This will automatically retrieve the packages you have selected from the
typically do this using the commands:
@example
- gunzip < package.tar.gz | tar xvf -
+ gunzip < package.tar.gz | tar xvf -
@end example
Above, replace @file{package.tar.gz} with the filename of the
Of course, if you use GNU @code{tar}, you could also use:
@example
- tar xvzf package.tar.gz
+ tar xvzf package.tar.gz
@end example
@comment What about native MS Windows users???
@example
(setq tag-table-alist
- '(("/usr/src/public/perl/" . "/usr/src/public/perl/perl-3.0/")
- ("\\.el$" . "/usr/local/emacs/src/")
- ("/jbw/gnu/" . "/usr15/degree/stud/jbw/gnu/")
- ("" . "/usr/local/emacs/src/")
- ))
+ '(("/usr/src/public/perl/" . "/usr/src/public/perl/perl-3.0/")
+ ("\\.el$" . "/usr/local/emacs/src/")
+ ("/jbw/gnu/" . "/usr15/degree/stud/jbw/gnu/")
+ ("" . "/usr/local/emacs/src/")
+ ))
@end example
The example defines the tags table alist in the following way:
@table @kbd
@item tag-table-alist
Controls which tables apply to which buffers.
-@item tags-file-name
+@item tags-file-name
Stores a default tags table.
-@item tags-build-completion-table
+@item tags-build-completion-table
Controls completion behavior.
-@item buffer-tag-table
+@item buffer-tag-table
Specifies a buffer-local table.
-@item make-tags-files-invisible
+@item make-tags-files-invisible
Sets whether tags tables should be very hidden.
-@item tag-mark-stack-max
+@item tag-mark-stack-max
Specifies how many tags-based hops to remember.
@end table
In this version of Emacs, what you see is what you get: in contrast to
some other versions, no abbreviations are expanded after you have sent the
mail. This means you don't suffer the annoyance of having the system do
-things behind your back --- if the system rewrites an address you typed,
+things behind your back---if the system rewrites an address you typed,
you know it immediately, instead of after the mail has been sent and
it's too late to do anything about it. For example, you will never
again be in trouble because you forgot to delete an old alias from your
+2000-02-07 Martin Buchholz <martin@xemacs.org>
+
+ * XEmacs 21.2.28 is released.
+
+2000-02-03 Kirill 'Big K' Katsnelson <kkm@dtmx.com>
+
+ * Xpm.def: New file, required to build Xpm.dll.
+
+ * Xpm.mak: Use DEBUG instead of DEBUG_XEMACS - this library is not
+ xemacs-specific. Initialize to DEBUG_XEMACS if specified for
+ compatibility.
+ Build DLL instead of static LIB when USE_CRTDLL=1 is given to
+ make.
+
+ * xemacs.mak: Introduced USE_SYSTEM_MALLOC and USE_CRTDLL.
+ Do not build lastfile.lib when neither unexec not gmalloc are
+ used.
+
+ * config.h: Deleted GNU_MALLOC and SYSTEM_MALLOC, as they are set
+ in makefile.
+
+2000-01-26 Kirill 'Big K' Katsnelson <kkm@dtmx.com>
+
+ * xemacs.mak (DOC_SRC9): Added tests.c ...
+ (TEMACS_DEBUG_OBJS): ... and tests.obj
+ ($(DOC)): Tweaked a bit, for `nmake docfile' unconditionally
+ rebuild the docfile.
+
+2000-01-22 Kirill 'Big K' Katsnelson <kkm@dtmx.com>
+
+ * xemacs.mak (docfile): Added shortcut target.
+
+2000-01-19 Kirill 'Big K' Katsnelson <kkm@dtmx.com>
+
+ * xemacs.mak (TEMACS_LIBS): Added winspool.lib
+
+2000-01-20 Martin Buchholz <martin@xemacs.org>
+
+ * xemacs.mak (dump-xemacs): Remove redundant EMACSBOOTSTRAPMODULEPATH.
+
+2000-01-18 Kirill 'Big K' Katsnelson <kkm@dtmx.com>
+
+ * xemacs.mak: Patch of 01/13 got in corrupted, fixed.
+
2000-01-18 Martin Buchholz <martin@xemacs.org>
* XEmacs 21.2.27 is released.
* xemacs.mak: Add rules to build & install minitar.
+2000-01-03 Michael Sperber [Mr. Preprocessor] <sperber@informatik.uni-tuebingen.de>
+
+ * config.h: Fix stuff related to mail locking.
+
1999-12-31 Martin Buchholz <martin@xemacs.org>
* XEmacs 21.2.26 is released.
numbers. */
#undef LISP_FLOAT_TYPE
-/* Define GNU_MALLOC if you want to use the *new* GNU memory allocator. */
-#define GNU_MALLOC
-
-/* Define USE_SYSTEM_MALLOC if you forcing the use of it. */
-#undef USE_SYSTEM_MALLOC
-
/* Define HAVE_TTY if you want TTY support compiled in. */
#undef HAVE_TTY
#endif /* DEBUG_XEMACS */
+/* Define convenient conditionally defined assertion macros. */
+#ifdef ERROR_CHECK_TYPECHECK
+#define type_checking_assert(assertion) assert (assertion)
+#else
+#define type_checking_assert(assertion)
+#endif
+
+#ifdef ERROR_CHECK_BUFPOS
+#define bufpos_checking_assert(assertion) assert (assertion)
+#else
+#define bufpos_checking_assert(assertion)
+#endif
+
+
/* Define MEMORY_USAGE_STATS if you want extra code compiled in to
determine where XEmacs's memory is going. */
#undef MEMORY_USAGE_STATS
GUNG_HO=0
!endif
+# A little bit of adhockery. Default to use system malloc and
+# DLL version of the C runtime library when using portable
+# dumping. These are the optimal settings.
+!if !defined(USE_SYSTEM_MALLOC)
+USE_SYSTEM_MALLOC=$(USE_PORTABLE_DUMPER)
+!endif
+!if !defined(USE_CRTDLL)
+USE_CRTDLL=$(USE_PORTABLE_DUMPER)
+!endif
+
#
# System configuration
#
!message Cannot build InfoDock without InfoDock sources
CONFIG_ERROR=1
!endif
+!if !$(USE_PORTABLE_DUMPER) && $(USE_SYSTEM_MALLOC)
+!message Cannot use system allocator when dumping old way, use portable dumper.
+CONFIG_ERROR=1
+!endif
+!if !$(USE_PORTABLE_DUMPER) && $(USE_CRTDLL)
+!message Cannot use C runtime DLL when dumping old way, use portable dumper.
+CONFIG_ERROR=1
+!endif
+!if !$(USE_SYSTEM_MALLOC) && $(USE_CRTDLL)
+!message GNU malloc currently cannot be used with CRT DLL.
+!message [[[Developer note: If you want to fix it, read Q112297 first]]] ####
+CONFIG_ERROR=1
+!endif
!if !$(HAVE_MSW) && !$(HAVE_X)
!message Please specify at least one HAVE_MSW=1 and/or HAVE_X=1
CONFIG_ERROR=1
OPT=-O2 -G5
!endif
-CFLAGS=-nologo -W3 $(OPT)
+!if $(USE_CRTDLL)
+!if $(DEBUG_XEMACS)
+C_LIBFLAG=-MDd
+LIBC_LIB=msvcrtd.lib
+!else
+C_LIBFLAG=-MD
+LIBC_LIB=msvcrt.lib
+!endif
+!else
+C_LIBFLAG=-ML
+LIBC_LIB=libc.lib
+!endif
+
+CFLAGS=-nologo -W3 $(OPT) $(C_LIBFLAG)
!if $(HAVE_X)
X_DEFINES=-DHAVE_X_WINDOWS
LRECORD_DEFINES=-DUSE_INDEXED_LRECORD_IMPLEMENTATION
!endif
!if $(USE_UNION_TYPE)
+UNION_DEFINES=-DUSE_UNION_TYPE
+!endif
+
!if $(USE_PORTABLE_DUMPER)
DUMPER_DEFINES=-DPDUMP
!endif
-UNION_DEFINES=-DUSE_UNION_TYPE
+!if $(USE_SYSTEM_MALLOC)
+MALLOC_DEFINES=-DSYSTEM_MALLOC
+!else
+MALLOC_DEFINES=-DGNU_MALLOC
!endif
# Hard-coded paths
INCLUDES=$(X_INCLUDES) $(MSW_INCLUDES) -I$(XEMACS)\nt\inc -I$(XEMACS)\src -I$(XEMACS)\lwlib
DEFINES=$(X_DEFINES) $(MSW_DEFINES) $(MULE_DEFINES) \
- $(TAGBITS_DEFINES) $(LRECORD_DEFINES) $(UNION_DEFINES) $(DUMPER_DEFINES)\
+ $(TAGBITS_DEFINES) $(LRECORD_DEFINES) $(UNION_DEFINES) \
+ $(DUMPER_DEFINES) $(MALLOC_DEFINES) \
-DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -DWINDOWSNT -Demacs \
-DHAVE_CONFIG_H $(PROGRAM_DEFINES) $(PATH_DEFINES)
# LASTFILE Library
+!if !$(USE_SYSTEM_MALLOC) || !$(USE_PORTABLE_DUMPER)
+
LASTFILE=$(OUTDIR)\lastfile.lib
LASTFILE_SRC=$(XEMACS)\src
LASTFILE_FLAGS=$(CFLAGS) $(INCLUDES) -Fo$@ -Fd$* -c
$(OUTDIR)\lastfile.obj: $(LASTFILE_SRC)\lastfile.c
$(CCV) $(LASTFILE_FLAGS) $**
+!endif
+
#------------------------------------------------------------------------------
!if $(HAVE_X)
DOC_SRC3=\
$(XEMACS)\src\font-lock.c \
$(XEMACS)\src\frame.c \
- $(XEMACS)\src\free-hook.c \
$(XEMACS)\src\general.c \
$(XEMACS)\src\glyphs.c \
$(XEMACS)\src\glyphs-eimage.c \
$(XEMACS)\src\glyphs-widget.c \
- $(XEMACS)\src\gmalloc.c \
$(XEMACS)\src\gui.c \
$(XEMACS)\src\gutter.c \
$(XEMACS)\src\hash.c \
$(XEMACS)\src\menubar.c \
$(XEMACS)\src\minibuf.c \
$(XEMACS)\src\nt.c \
- $(XEMACS)\src\ntheap.c \
$(XEMACS)\src\ntplay.c \
$(XEMACS)\src\ntproc.c \
$(XEMACS)\src\objects.c \
$(XEMACS)\src\termcap.c \
$(XEMACS)\src\tparam.c \
$(XEMACS)\src\undo.c \
- $(XEMACS)\src\unexnt.c \
- $(XEMACS)\src\vm-limit.c \
$(XEMACS)\src\window.c \
$(XEMACS)\src\widget.c
!if $(DEBUG_XEMACS)
DOC_SRC9=\
- $(XEMACS)\src\debug.c
+ $(XEMACS)\src\debug.c \
+ $(XEMACS)\src\tests.c
+!endif
+
+!if !$(USE_SYSTEM_MALLOC)
+DOC_SRC10=\
+ $(XEMACS)\src\free-hook.c \
+ $(XEMACS)\src\gmalloc.c \
+ $(XEMACS)\src\ntheap.c \
+ $(XEMACS)\src\vm-limit.c
+!endif
+
+!if !$(USE_PORTABLE_DUMPER)
+DOC_SRC11=\
+ $(XEMACS)\src\unexnt.c
!endif
#------------------------------------------------------------------------------
EMACS_BETA_VERSION=-DEMACS_BETA_VERSION=$(emacs_beta_version)
!ENDIF
+!if !$(USE_PORTABLE_DUMPER)
+TEMACS_ENTRYPOINT=-entry:_start
+!endif
+
TEMACS_DIR=$(XEMACS)\src
TEMACS=$(TEMACS_DIR)\temacs.exe
TEMACS_BROWSE=$(TEMACS_DIR)\temacs.bsc
TEMACS_SRC=$(XEMACS)\src
TEMACS_LIBS=$(LASTFILE) $(LWLIB) $(X_LIBS) $(MSW_LIBS) \
- kernel32.lib user32.lib gdi32.lib advapi32.lib \
- shell32.lib wsock32.lib winmm.lib libc.lib
+ oldnames.lib kernel32.lib user32.lib gdi32.lib advapi32.lib \
+ shell32.lib wsock32.lib winmm.lib winspool.lib $(LIBC_LIB)
TEMACS_LFLAGS=-nologo $(LIBRARIES) $(DEBUG_FLAGS) -base:0x1000000\
- -stack:0x800000 -entry:_start -subsystem:console\
+ -stack:0x800000 $(TEMACS_ENTRYPOINT) -subsystem:console\
-pdb:$(TEMACS_DIR)\temacs.pdb -map:$(TEMACS_DIR)\temacs.map \
- -heap:0x00100000 -out:$@
-TEMACS_CPP_FLAGS=-ML -c \
+ -heap:0x00100000 -out:$@ -nodefaultlib
+TEMACS_CPP_FLAGS=-c \
$(CFLAGS) $(INCLUDES) $(DEFINES) $(DEBUG_DEFINES) \
-DEMACS_MAJOR_VERSION=$(emacs_major_version) \
-DEMACS_MINOR_VERSION=$(emacs_minor_version) \
!if $(DEBUG_XEMACS)
TEMACS_DEBUG_OBJS=\
- $(OUTDIR)\debug.obj
+ $(OUTDIR)\debug.obj \
+ $(OUTDIR)\tests.obj
+!endif
+
+!if !$(USE_SYSTEM_MALLOC)
+TEMACS_ALLOC_OBJS=\
+ $(OUTDIR)\free-hook.obj \
+ $(OUTDIR)\gmalloc.obj \
+ $(OUTDIR)\ntheap.obj \
+ $(OUTDIR)\vm-limit.obj
+!endif
+
+!if !$(USE_PORTABLE_DUMPER)
+TEMACS_DUMP_OBJS=\
+ $(OUTDIR)\unexnt.obj
!endif
TEMACS_OBJS= \
$(TEMACS_CODING_OBJS)\
$(TEMACS_MULE_OBJS)\
$(TEMACS_DEBUG_OBJS)\
+ $(TEMACS_ALLOC_OBJS)\
+ $(TEMACS_DUMP_OBJS)\
$(OUTDIR)\abbrev.obj \
$(OUTDIR)\alloc.obj \
$(OUTDIR)\alloca.obj \
$(OUTDIR)\fns.obj \
$(OUTDIR)\font-lock.obj \
$(OUTDIR)\frame.obj \
- $(OUTDIR)\free-hook.obj \
$(OUTDIR)\general.obj \
$(OUTDIR)\glyphs.obj \
$(OUTDIR)\glyphs-eimage.obj \
$(OUTDIR)\glyphs-widget.obj \
- $(OUTDIR)\gmalloc.obj \
$(OUTDIR)\gui.obj \
$(OUTDIR)\gutter.obj \
$(OUTDIR)\hash.obj \
$(OUTDIR)\md5.obj \
$(OUTDIR)\minibuf.obj \
$(OUTDIR)\nt.obj \
- $(OUTDIR)\ntheap.obj \
$(OUTDIR)\ntplay.obj \
$(OUTDIR)\ntproc.obj \
$(OUTDIR)\objects.obj \
$(OUTDIR)\sysdep.obj \
$(OUTDIR)\tparam.obj \
$(OUTDIR)\undo.obj \
- $(OUTDIR)\unexnt.obj \
- $(OUTDIR)\vm-limit.obj \
$(OUTDIR)\widget.obj \
$(OUTDIR)\window.obj \
$(OUTDIR)\xemacs.res
bscmake -nologo -o$(TEMACS_BROWSE) @bscmake.tmp
@$(DEL) bscmake.tmp
!endif
+!if $(USE_PORTABLE_DUMPER)
+ @if exist $(TEMACS_DIR)\xemacs.dmp del $(TEMACS_DIR)\xemacs.dmp
+!endif
link.exe @<<
$(TEMACS_LFLAGS) $(TEMACS_OBJS) $(TEMACS_LIBS)
<<
LOADPATH=$(LISP)
+# Rebuild docfile target
+docfile ::
+ if exist $(DOC) del $(DOC)
+docfile :: $(DOC)
+
$(DOC): $(LIB_SRC)\make-docfile.exe
- $(DEL) $(DOC)
+ if exist $(DOC) del $(DOC)
+ set EMACSBOOTSTRAPLOADPATH=$(LISP);$(PACKAGE_PATH)
+ set EMACSBOOTSTRAPMODULEPATH=$(MODULES)
$(TEMACS) -batch -l $(TEMACS_DIR)\..\lisp\make-docfile.el -- -o $(DOC) -i $(XEMACS)\site-packages
$(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC1)
$(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC2)
$(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC7)
$(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC8)
$(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC9)
+ $(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC10)
+ $(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC11)
update-elc:
- set EMACSBOOTSTRAPMODULEPATH=$(MODULES)
set EMACSBOOTSTRAPLOADPATH=$(LISP);$(PACKAGE_PATH)
set EMACSBOOTSTRAPMODULEPATH=$(MODULES)
$(TEMACS) -batch -l $(TEMACS_DIR)\..\lisp\update-elc.el
# This rule dumps xemacs and then possibly spawns sub-make if PURESPACE
# requirements have changed.
-dump-xemacs: $(TEMACS)
+dump-xemacs: temacs
@echo >$(TEMACS_DIR)\SATISFIED
cd $(TEMACS_DIR)
set EMACSBOOTSTRAPLOADPATH=$(LISP);$(PACKAGE_PATH)
+ set EMACSBOOTSTRAPMODULEPATH=$(MODULES)
-1 $(TEMACS) -batch -l $(TEMACS_DIR)\..\lisp\loadup.el dump
+!if $(USE_PORTABLE_DUMPER)
+ copy temacs.exe xemacs.exe
+!endif
cd $(NT)
@if not exist $(TEMACS_DIR)\SATISFIED nmake -nologo -f xemacs.mak $@
-
#------------------------------------------------------------------------------
# use this rule to build the complete system
perl ./make-src-depend > depend.tmp
perl -MFile::Compare -e "compare('depend.tmp', 'depend') && rename('depend.tmp', 'depend') or unlink('depend.tmp')"
+installation::
+ @if exist $(XEMACS)\Installation del $(XEMACS)\Installation
+
+installation:: $(XEMACS)\Installation
+
$(XEMACS)\Installation:
@type > $(XEMACS)\Installation <<
!if defined(OS)
!if $(USE_PORTABLE_DUMPER)
Using portable dumper.
!endif
+!if $(USE_SYSTEM_MALLOC)
+ Using system malloc.
+!endif
+!if $(USE_CRTDLL)
+ Using DLL version of C runtime library
+!endif
!if $(DEBUG_XEMACS)
Compiling in extra debug checks. XEmacs will be slow!
!endif
#
# XPM Makefile for Microsoft NMAKE without X libraries
#
+!if !defined(DEBUG)
+!if defined(DEBUG_XEMACS)
+DEBUG=$(DEBUG_XEMACS)
+!else
+DEBUG=0
+!endif
+!endif
-!if !defined(DEBUG_XEMACS)
-DEBUG_XEMACS=0
+!if !defined(USE_CRTDLL)
+USE_CRTDLL=0
!endif
-!if $(DEBUG_XEMACS)
+!if $(DEBUG)
OPT=-Od -Zi
+LINK_DEBUG=-debug
+!else
+OPT=-Ox
+!endif
+
+!if $(USE_CRTDLL)
+!if $(DEBUG)
+C_LIBFLAG=-MDd
!else
-OPT=-O2 -G5 -Zi
+C_LIBFLAG=-MD
+!endif
+!else
+!if $(DEBUG)
+C_LIBFLAG=-MLd
+!else
+C_LIBFLAG=-ML
+!endif
!endif
WARN_CPP_FLAGS = -W3
CC=cl
-CFLAGS=-nologo -DFOR_MSW $(WARN_CPP_FLAGS) $(OPT) $(INCLUDES) -Fo$@ -c
+CFLAGS=-nologo -DFOR_MSW $(C_LIBFLAG) $(WARN_CPP_FLAGS) \
+ $(OPT) $(INCLUDES) -c
OBJS= data.obj create.obj misc.obj rgb.obj scan.obj parse.obj hashtab.obj \
WrFFrI.obj RdFToI.obj CrIFrDat.obj CrDatFrI.obj \
.SUFFIXES:
.SUFFIXES: .c
-.c.obj:
- $(CC) $(CFLAGS) $< -Fo$@
+.c.obj::
+ $(CC) $(CFLAGS) $<
# targets
mkdir ..\X11
Xpm.lib: $(OBJS)
- link.exe -lib -nologo -out:$@ $(OBJS)
+!if $(USE_CRTDLL)
+# Target is ok, link builds lib as a side effect.
+ link -nologo -dll -def:xpm.def -out:Xpm.dll gdi32.lib $(OBJS)
+!else
+ lib -nologo -out:$@ $(OBJS)
+!endif
#undef XtOffset
#define XtOffset(p_type,field) \
((Cardinal) (((char *) (&(((p_type)0)->field))) - ((char *)0)))
-#define offset(field) XtOffset(EmacsFrame, emacs_frame.field)
+#define offset(field) XtOffset (EmacsFrame, emacs_frame.field)
static XtResource resources[] = {
- {XtNgeometry, XtCGeometry, XtRString, sizeof(String),
- offset (geometry), XtRString, (XtPointer) 0},
- {XtNiconic, XtCIconic, XtRBoolean, sizeof(Boolean),
- offset (iconic), XtRImmediate, (XtPointer) False},
-
- {XtNemacsFrame, XtCEmacsFrame, XtRPointer, sizeof (XtPointer),
- offset (frame), XtRImmediate, 0},
- {XtNmenubar, XtCMenubar, XtRBoolean, sizeof (Boolean),
- offset (menubar_p), XtRImmediate, (XtPointer) True},
- {XtNinitiallyUnmapped, XtCInitiallyUnmapped, XtRBoolean, sizeof (Boolean),
- offset (initially_unmapped), XtRImmediate, (XtPointer) False},
- {XtNminibuffer, XtCMinibuffer, XtRBoolean, sizeof (Boolean),
- offset (minibuffer), XtRImmediate, (XtPointer) True},
- {XtNunsplittable, XtCUnsplittable, XtRBoolean, sizeof (Boolean),
- offset (unsplittable), XtRImmediate, (XtPointer) False},
- {XtNinternalBorderWidth, XtCInternalBorderWidth, XtRInt, sizeof (int),
- offset (internal_border_width), XtRImmediate, (XtPointer)4},
+ { XtNgeometry, XtCGeometry,
+ XtRString, sizeof (String),
+ offset (geometry), XtRString, (XtPointer) 0 },
+ { XtNiconic, XtCIconic,
+ XtRBoolean, sizeof (Boolean),
+ offset (iconic), XtRImmediate, (XtPointer) False },
+
+ { XtNemacsFrame, XtCEmacsFrame,
+ XtRPointer, sizeof (XtPointer),
+ offset (frame), XtRImmediate, 0 },
+ { XtNmenubar, XtCMenubar,
+ XtRBoolean, sizeof (Boolean),
+ offset (menubar_p), XtRImmediate, (XtPointer) True },
+ { XtNinitiallyUnmapped, XtCInitiallyUnmapped,
+ XtRBoolean, sizeof (Boolean),
+ offset (initially_unmapped), XtRImmediate, (XtPointer) False },
+ { XtNminibuffer, XtCMinibuffer,
+ XtRBoolean, sizeof (Boolean),
+ offset (minibuffer), XtRImmediate, (XtPointer) True },
+ { XtNunsplittable, XtCUnsplittable,
+ XtRBoolean, sizeof (Boolean),
+ offset (unsplittable), XtRImmediate, (XtPointer) False },
+ { XtNinternalBorderWidth, XtCInternalBorderWidth,
+ XtRInt, sizeof (int),
+ offset (internal_border_width), XtRImmediate, (XtPointer)4 },
#ifdef HAVE_SCROLLBARS
- {XtNscrollBarWidth, XtCScrollBarWidth, XtRInt, sizeof (int),
- offset (scrollbar_width), XtRImmediate, (XtPointer)-1},
- {XtNscrollBarHeight, XtCScrollBarHeight, XtRInt, sizeof (int),
- offset (scrollbar_height), XtRImmediate, (XtPointer)-1},
- {XtNscrollBarPlacement, XtCScrollBarPlacement, XtRScrollBarPlacement,
- sizeof(unsigned char), offset(scrollbar_placement), XtRImmediate,
+ { XtNscrollBarWidth, XtCScrollBarWidth,
+ XtRInt, sizeof (int),
+ offset (scrollbar_width), XtRImmediate, (XtPointer)-1 },
+ { XtNscrollBarHeight, XtCScrollBarHeight,
+ XtRInt, sizeof (int),
+ offset (scrollbar_height), XtRImmediate, (XtPointer)-1 },
+ { XtNscrollBarPlacement, XtCScrollBarPlacement,
+ XtRScrollBarPlacement, sizeof (unsigned char),
+ offset (scrollbar_placement), XtRImmediate,
#if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \
defined (LWLIB_SCROLLBARS_ATHENA3D)
- (XtPointer) XtBOTTOM_RIGHT
+ (XtPointer) XtBOTTOM_RIGHT
#else
- (XtPointer) XtBOTTOM_LEFT
+ (XtPointer) XtBOTTOM_LEFT
#endif
},
#endif /* HAVE_SCROLLBARS */
+
#ifdef HAVE_TOOLBARS
- {XtNtopToolBarHeight, XtCTopToolBarHeight, XtRInt, sizeof (int),
- offset (top_toolbar_height), XtRImmediate, (XtPointer)-1},
- {XtNbottomToolBarHeight, XtCBottomToolBarHeight, XtRInt, sizeof (int),
- offset (bottom_toolbar_height), XtRImmediate, (XtPointer)-1},
- {XtNleftToolBarWidth, XtCLeftToolBarWidth, XtRInt, sizeof (int),
- offset (left_toolbar_width), XtRImmediate, (XtPointer)-1},
- {XtNrightToolBarWidth, XtCRightToolBarWidth, XtRInt, sizeof (int),
- offset (right_toolbar_width), XtRImmediate, (XtPointer)-1},
- {XtNtopToolBarBorderWidth, XtCTopToolBarBorderWidth, XtRInt,
- sizeof (int),
- offset (top_toolbar_border_width), XtRImmediate, (XtPointer)-1},
- {XtNbottomToolBarBorderWidth, XtCBottomToolBarBorderWidth, XtRInt,
- sizeof (int),
- offset (bottom_toolbar_border_width), XtRImmediate, (XtPointer)-1},
- {XtNleftToolBarBorderWidth, XtCLeftToolBarBorderWidth, XtRInt,
- sizeof (int),
- offset (left_toolbar_border_width), XtRImmediate, (XtPointer)-1},
- {XtNrightToolBarBorderWidth, XtCRightToolBarBorderWidth, XtRInt,
- sizeof (int),
- offset (right_toolbar_border_width), XtRImmediate, (XtPointer)-1},
- {XtNtopToolBarShadowColor, XtCTopToolBarShadowColor, XtRPixel, sizeof(Pixel),
- offset(top_toolbar_shadow_pixel), XtRString, (XtPointer) "#000000"},
- {XtNbottomToolBarShadowColor, XtCBottomToolBarShadowColor, XtRPixel,
- sizeof(Pixel), offset(bottom_toolbar_shadow_pixel), XtRString, (XtPointer) "#000000"},
- {XtNbackgroundToolBarColor, XtCBackgroundToolBarColor, XtRPixel,
- sizeof(Pixel), offset(background_toolbar_pixel), XtRImmediate,
- (XtPointer)-1},
- {XtNforegroundToolBarColor, XtCForegroundToolBarColor, XtRPixel,
- sizeof(Pixel), offset(foreground_toolbar_pixel), XtRImmediate,
- (XtPointer)-1},
- {XtNtopToolBarShadowPixmap, XtCTopToolBarShadowPixmap, XtRPixmap,
- sizeof (Pixmap), offset(top_toolbar_shadow_pixmap), XtRImmediate,
- (XtPointer)None},
- {XtNbottomToolBarShadowPixmap, XtCBottomToolBarShadowPixmap, XtRPixmap,
- sizeof (Pixmap), offset(bottom_toolbar_shadow_pixmap), XtRImmediate,
- (XtPointer)None},
- {XtNtoolBarShadowThickness, XtCToolBarShadowThickness, XtRDimension,
- sizeof (Dimension), offset (toolbar_shadow_thickness), XtRImmediate,
- (XtPointer)2},
+ { XtNtopToolBarHeight, XtCTopToolBarHeight,
+ XtRInt, sizeof (int),
+ offset (top_toolbar_height), XtRImmediate, (XtPointer)-1 },
+ { XtNbottomToolBarHeight, XtCBottomToolBarHeight,
+ XtRInt, sizeof (int),
+ offset (bottom_toolbar_height), XtRImmediate, (XtPointer)-1 },
+ { XtNleftToolBarWidth, XtCLeftToolBarWidth,
+ XtRInt, sizeof (int),
+ offset (left_toolbar_width), XtRImmediate, (XtPointer)-1 },
+ { XtNrightToolBarWidth, XtCRightToolBarWidth,
+ XtRInt, sizeof (int),
+ offset (right_toolbar_width), XtRImmediate, (XtPointer)-1 },
+ { XtNtopToolBarBorderWidth, XtCTopToolBarBorderWidth,
+ XtRInt, sizeof (int),
+ offset (top_toolbar_border_width), XtRImmediate, (XtPointer)-1 },
+ { XtNbottomToolBarBorderWidth, XtCBottomToolBarBorderWidth,
+ XtRInt, sizeof (int),
+ offset (bottom_toolbar_border_width), XtRImmediate, (XtPointer)-1 },
+ { XtNleftToolBarBorderWidth, XtCLeftToolBarBorderWidth,
+ XtRInt, sizeof (int),
+ offset (left_toolbar_border_width), XtRImmediate, (XtPointer)-1 },
+ { XtNrightToolBarBorderWidth, XtCRightToolBarBorderWidth,
+ XtRInt, sizeof (int),
+ offset (right_toolbar_border_width), XtRImmediate, (XtPointer)-1 },
+ { XtNtopToolBarShadowColor, XtCTopToolBarShadowColor,
+ XtRPixel, sizeof (Pixel),
+ offset(top_toolbar_shadow_pixel), XtRString, (XtPointer) "#000000" },
+ { XtNbottomToolBarShadowColor, XtCBottomToolBarShadowColor,
+ XtRPixel, sizeof (Pixel),
+ offset (bottom_toolbar_shadow_pixel), XtRString, (XtPointer) "#000000" },
+ { XtNbackgroundToolBarColor, XtCBackgroundToolBarColor,
+ XtRPixel, sizeof (Pixel),
+ offset (background_toolbar_pixel), XtRImmediate, (XtPointer)-1 },
+ { XtNforegroundToolBarColor, XtCForegroundToolBarColor,
+ XtRPixel, sizeof (Pixel),
+ offset (foreground_toolbar_pixel), XtRImmediate, (XtPointer)-1 },
+ { XtNtopToolBarShadowPixmap, XtCTopToolBarShadowPixmap,
+ XtRPixmap, sizeof (Pixmap),
+ offset (top_toolbar_shadow_pixmap), XtRImmediate, (XtPointer)None },
+ { XtNbottomToolBarShadowPixmap, XtCBottomToolBarShadowPixmap,
+ XtRPixmap, sizeof (Pixmap),
+ offset (bottom_toolbar_shadow_pixmap), XtRImmediate, (XtPointer)None },
+ { XtNtoolBarShadowThickness, XtCToolBarShadowThickness,
+ XtRDimension, sizeof (Dimension),
+ offset (toolbar_shadow_thickness), XtRImmediate, (XtPointer)2 },
#endif /* HAVE_TOOLBARS */
- {XtNinterline, XtCInterline, XtRInt, sizeof (int),
- offset (interline), XtRImmediate, (XtPointer)0},
+
+ { XtNinterline, XtCInterline,
+ XtRInt, sizeof (int),
+ offset (interline), XtRImmediate, (XtPointer)0 },
{
#ifdef I18N4
- XtNfontSet, XtCFontSet, XtRFontSet, sizeof(XFontSet),
+ XtNfontSet, XtCFontSet,
+ XtRFontSet, sizeof (XFontSet),
#else
- XtNfont, XtCFont, XtRFontStruct, sizeof(XFontStruct *),
+ XtNfont, XtCFont,
+ XtRFontStruct, sizeof (XFontStruct *),
#endif
offset(font), XtRImmediate, (XtPointer)0
},
- {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
- offset(foreground_pixel), XtRString, (XtPointer) "Black"},
- {XtNbackground, XtCBackground, XtRPixel, sizeof(Pixel),
- offset(background_pixel), XtRString, (XtPointer) "Gray80"},
- {XtNcursorColor, XtCForeground, XtRPixel, sizeof(Pixel),
- offset(cursor_color), XtRString, (XtPointer) "XtDefaultForeground"},
- {XtNbarCursor, XtCBarCursor, XtRBoolean, sizeof (Boolean),
- offset (bar_cursor), XtRImmediate, (XtPointer)0},
- {XtNvisualBell, XtCVisualBell, XtRBoolean, sizeof (Boolean),
- offset (visual_bell), XtRImmediate, (XtPointer)0},
- {XtNbellVolume, XtCBellVolume, XtRInt, sizeof (int),
- offset (bell_volume), XtRImmediate, (XtPointer)0},
- {XtNuseBackingStore, XtCUseBackingStore, XtRBoolean, sizeof (Boolean),
- offset (use_backing_store), XtRImmediate, (XtPointer)0},
- {XtNpreferredWidth, XtCPreferredWidth, XtRDimension, sizeof (Dimension),
- offset (preferred_width), XtRImmediate, (XtPointer)0},
- {XtNpreferredHeight, XtCPreferredHeight, XtRDimension, sizeof (Dimension),
- offset (preferred_height), XtRImmediate, (XtPointer)0},
+ { XtNforeground, XtCForeground,
+ XtRPixel, sizeof (Pixel),
+ offset(foreground_pixel), XtRString, (XtPointer) "Black" },
+ { XtNbackground, XtCBackground,
+ XtRPixel, sizeof (Pixel),
+ offset(background_pixel), XtRString, (XtPointer) "Gray80" },
+ { XtNcursorColor, XtCForeground,
+ XtRPixel, sizeof (Pixel),
+ offset(cursor_color), XtRString, (XtPointer) "XtDefaultForeground" },
+ { XtNbarCursor, XtCBarCursor,
+ XtRBoolean, sizeof (Boolean),
+ offset (bar_cursor), XtRImmediate, (XtPointer)0 },
+ { XtNvisualBell, XtCVisualBell,
+ XtRBoolean, sizeof (Boolean),
+ offset (visual_bell), XtRImmediate, (XtPointer)0 },
+ { XtNbellVolume, XtCBellVolume,
+ XtRInt, sizeof (int),
+ offset (bell_volume), XtRImmediate, (XtPointer)0 },
+ { XtNuseBackingStore, XtCUseBackingStore,
+ XtRBoolean, sizeof (Boolean),
+ offset (use_backing_store), XtRImmediate, (XtPointer)0 },
+ { XtNpreferredWidth, XtCPreferredWidth,
+ XtRDimension, sizeof (Dimension),
+ offset (preferred_width), XtRImmediate, (XtPointer)0 },
+ { XtNpreferredHeight, XtCPreferredHeight,
+ XtRDimension, sizeof (Dimension),
+ offset (preferred_height), XtRImmediate, (XtPointer)0 },
};
#undef offset
/* superclass */ &widgetClassRec,
#endif
/* class_name */ "EmacsFrame",
- /* widget_size */ sizeof(EmacsFrameRec),
+ /* widget_size */ sizeof (EmacsFrameRec),
/* class_initialize */ EmacsFrameClassInitialize,
/* class_part_initialize */ 0,
/* class_inited */ FALSE,
/* actions */ emacsFrameActionsTable,
/* num_actions */ XtNumber (emacsFrameActionsTable),
/* resources */ resources,
- /* resource_count */ XtNumber(resources),
+ /* resource_count */ XtNumber (resources),
/* xrm_class */ NULLQUARK,
/* compress_motion */ TRUE,
/* compress_exposure */ TRUE,
}
/* Xt string-to-scrollbar-placement converter */
-/* ### Convert this to a `new-style' converter (See XtAddTypeConverter) */
+/* #### Convert this to a `new-style' converter (See XtAddTypeConverter) */
/* This variable cannot be a stack variable. */
static unsigned char cvt_string_scrollbar_placement;
/* Synched up with: Not in FSF. */
-#ifndef _EmacsFrame_h
-#define _EmacsFrame_h
+#ifndef INCLUDED_EmacsFrame_h_
+#define INCLUDED_EmacsFrame_h_
#ifndef XtNminibuffer
#define XtNminibuffer "minibuffer"
void EmacsFrameRecomputeCellSize (Widget widget);
void EmacsFrameSetCharSize (Widget widget, int rows, int cols);
-#endif /* _EmacsFrame_h */
+#endif /* INCLUDED_EmacsFrame_h_ */
/* Synched up with: Not in FSF. */
-#ifndef _EmacsFrameP_h
-#define _EmacsFrameP_h
+#ifndef INCLUDED_EmacsFrameP_h_
+#define INCLUDED_EmacsFrameP_h_
#include "xintrinsicp.h"
#include <X11/CoreP.h>
extern EmacsFrameClassRec emacsFrameClassRec; /* class pointer */
-
-
-#endif /* _EmacsFrameP_h */
+#endif /* INCLUDED_EmacsFrameP_h_ */
static XtResource resources[] = {
#define offset(field) XtOffset(EmacsManagerWidget, emacs_manager.field)
- { XtNresizeCallback, XtCCallback, XtRCallback, sizeof(XtCallbackList),
- offset(resize_callback), XtRImmediate, (XtPointer) 0 },
- { XtNqueryGeometryCallback, XtCCallback, XtRCallback, sizeof(XtCallbackList),
- offset(query_geometry_callback), XtRImmediate, (XtPointer) 0 },
- { XtNuserData, XtCUserData, XtRPointer, sizeof(XtPointer),
- offset(user_data), XtRImmediate, (XtPointer) 0 },
+ { XtNresizeCallback, XtCCallback,
+ XtRCallback, sizeof (XtCallbackList),
+ offset(resize_callback), XtRImmediate, (XtPointer) 0 },
+ { XtNqueryGeometryCallback, XtCCallback,
+ XtRCallback, sizeof (XtCallbackList),
+ offset(query_geometry_callback), XtRImmediate, (XtPointer) 0 },
+ { XtNuserData, XtCUserData,
+ XtRPointer, sizeof (XtPointer),
+ offset(user_data), XtRImmediate, (XtPointer) 0 },
};
/****************************************************************
/* superclass */ (WidgetClass) &compositeClassRec,
#endif
/* class_name */ "EmacsManager",
- /* widget_size */ sizeof(EmacsManagerRec),
+ /* widget_size */ sizeof (EmacsManagerRec),
/* class_initialize */ ClassInitialize,
/* class_part_init */ NULL,
/* class_inited */ FALSE,
{
EmacsManagerWidget emw = (EmacsManagerWidget) w;
EmacsManagerQueryGeometryStruct struc;
- int mask = request->request_mode & (CWWidth | CWHeight);
+ int request_mode = request->request_mode;
- struc.request_mode = mask;
- if (mask & CWWidth) struc.proposed_width = request->width;
- if (mask & CWHeight) struc.proposed_height = request->height;
+ struc.request_mode = request_mode;
+ struc.proposed_width = (request_mode & CWWidth) ? request->width : 0;
+ struc.proposed_height = (request_mode & CWHeight) ? request->height : 0;
XtCallCallbackList (w, emw->emacs_manager.query_geometry_callback, &struc);
reply->request_mode = CWWidth | CWHeight;
reply->width = struc.proposed_width;
reply->height = struc.proposed_height;
- if (((mask & CWWidth) && (request->width != reply->width)) ||
- ((mask & CWHeight) && (request->height != reply->height)))
+ if (((request_mode & CWWidth) && (request->width != reply->width)) ||
+ ((request_mode & CWHeight) && (request->height != reply->height)))
return XtGeometryAlmost;
return XtGeometryYes;
}
GeometryManager (Widget w, XtWidgetGeometry *request, XtWidgetGeometry *reply)
{
/* Sure, any changes are fine. */
-#define COPY(field, mask) \
- if (request->request_mode & mask) w->core.field = request->field
+#ifdef LWLIB_MENUBARS_MOTIF
/* The Motif menubar will merrily request a new size every time a
child is added or deleted. Blow it off because it doesn't know
what it's talking about. */
-#ifdef LWLIB_MENUBARS_MOTIF
- if (!(XtClass (w) == xmRowColumnWidgetClass))
+ if (XtClass (w) != xmRowColumnWidgetClass)
#endif /* LWLIB_MENUBARS_MOTIF */
{
- COPY (width, CWWidth);
- COPY (height, CWHeight);
+ if (request->request_mode & CWWidth) w->core.width = request->width;
+ if (request->request_mode & CWHeight) w->core.height = request->height;
}
- COPY (border_width, CWBorderWidth);
- COPY (x, CWX);
- COPY (y, CWY);
-#undef COPY
+ if (request->request_mode & CWBorderWidth)
+ w->core.border_width = request->border_width;
+ if (request->request_mode & CWX) w->core.x = request->x;
+ if (request->request_mode & CWY) w->core.y = request->y;
return XtGeometryYes;
}
{
if (!XtIsRealized (w))
{
- XtWidgetGeometry req, repl;
+ XtWidgetGeometry request, reply;
/* find out how big we'd like to be ... */
- req.request_mode = 0;
- XtQueryGeometry (w, &req, &repl);
- EmacsManagerChangeSize (w, repl.width, repl.height);
+ request.request_mode = 0;
+ XtQueryGeometry (w, &request, &reply);
+ EmacsManagerChangeSize (w, reply.width, reply.height);
}
}
/* Written by Ben Wing. */
-#ifndef _EmacsManager_h
-#define _EmacsManager_h
+#ifndef INCLUDED_EmacsManager_h_
+#define INCLUDED_EmacsManager_h_
#ifndef XtNresizeCallback
#define XtNresizeCallback "resizeCallback"
void EmacsManagerChangeSize (Widget w, Dimension width, Dimension height);
-#endif /* _EmacsManager_h */
+#endif /* INCLUDED_EmacsManager_h_ */
/* Written by Ben Wing. */
-#ifndef _EmacsManagerP_h
-#define _EmacsManagerP_h
+#ifndef INCLUDED_EmacsManagerP_h_
+#define INCLUDED_EmacsManagerP_h_
#include "xintrinsicp.h"
extern EmacsManagerClassRec emacsManagerClassRec; /* class pointer */
-#endif /* _EmacsManagerP_h */
+#endif /* INCLUDED_EmacsManagerP_h_ */
the default values for X and Y, for no obvious reason. This
causes Shell to indicate that the defaults of (0,0) were
program-specified, instead of letting the WM do what it wants. */
- {XtNx, XtCPosition, XtRPosition, sizeof(Position),
- coreoffset (x), XtRImmediate, (XtPointer)BIGSIZE},
- {XtNy, XtCPosition, XtRPosition, sizeof(Position),
- coreoffset (y), XtRImmediate, (XtPointer)BIGSIZE},
+ { XtNx, XtCPosition,
+ XtRPosition, sizeof (Position),
+ coreoffset (x), XtRImmediate, (XtPointer)BIGSIZE },
+ { XtNy, XtCPosition,
+ XtRPosition, sizeof (Position),
+ coreoffset (y), XtRImmediate, (XtPointer)BIGSIZE },
#endif
- { XtNwidthCells, XtCWidthCells, XtRInt, sizeof(int),
- offset (width_cells), XtRImmediate, (XtPointer)0},
- { XtNheightCells, XtCHeightCells, XtRInt, sizeof(int),
- offset (height_cells), XtRImmediate, (XtPointer)0},
- { XtNminWidthCells, XtCMinWidthCells, XtRInt, sizeof(int),
- offset (min_width_cells), XtRImmediate, (XtPointer)0},
- { XtNminHeightCells, XtCMinHeightCells, XtRInt, sizeof(int),
- offset (min_height_cells), XtRImmediate, (XtPointer)0},
+ { XtNwidthCells, XtCWidthCells,
+ XtRInt, sizeof (int),
+ offset (width_cells), XtRImmediate, (XtPointer)0 },
+ { XtNheightCells, XtCHeightCells,
+ XtRInt, sizeof (int),
+ offset (height_cells), XtRImmediate, (XtPointer)0 },
+ { XtNminWidthCells, XtCMinWidthCells,
+ XtRInt, sizeof (int),
+ offset (min_width_cells), XtRImmediate, (XtPointer)0 },
+ { XtNminHeightCells, XtCMinHeightCells,
+ XtRInt, sizeof (int),
+ offset (min_height_cells), XtRImmediate, (XtPointer)0 },
};
static CompositeClassExtensionRec compositeClassExtRec = {
NULL,
NULLQUARK,
XtCompositeExtensionVersion,
- sizeof(CompositeClassExtensionRec),
+ sizeof (CompositeClassExtensionRec),
TRUE,
};
NULL,
NULLQUARK,
XtShellExtensionVersion,
- sizeof(ShellClassExtensionRec),
+ sizeof (ShellClassExtensionRec),
RootGeometryManager
};
*/
/* superclass */ (WidgetClass) &SUPERCLASS_CLASS_REC,
/* class_name */ (String) EMACS_SHELL_CLASS_NAME,
- /* size */ sizeof(EMACS_SHELL_REC),
+ /* size */ sizeof (EMACS_SHELL_REC),
/* Class Initializer */ NULL,
/* class_part_initialize*/ NULL, /* XtInheritClassPartInitialize, */
/* Class init'ed ? */ FALSE,
/* Written by Ben Wing, May, 1994. */
-#ifndef _EmacsShell_h
-#define _EmacsShell_h
+#ifndef INCLUDED_EmacsShell_h_
+#define INCLUDED_EmacsShell_h_
#ifndef XtNwidthCells
#define XtNwidthCells "widthCells"
void EmacsShellSetPositionUserSpecified (Widget gw);
void EmacsShellSmashIconicHint (Widget shell, int iconic_p);
-#endif /* _EmacsShell_h */
+#endif /* INCLUDED_EmacsShell_h_ */
/* Written by Ben Wing, May, 1994. */
-#ifndef _EmacsShellP_h
-#define _EmacsShellP_h
+#ifndef INCLUDED_EmacsShellP_h_
+#define INCLUDED_EmacsShellP_h_
#include "xintrinsic.h"
#include <X11/ShellP.h>
/* class pointer */
extern TransientEmacsShellClassRec transientEmacsShellClassRec;
-#endif /* _EmacsShellP_h */
+#endif /* INCLUDED_EmacsShellP_h_ */
static XtResource resources[] = {
#define offset(field) XtOffset(ExternalClientWidget, externalClient.field)
- { XtNshellTimeout, XtCShellTimeout, XtRInt, sizeof(int),
- offset(shell_timeout), XtRImmediate,(XtPointer)DEFAULT_WM_TIMEOUT},
- { XtNdeadShell, XtCDeadShell, XtRBoolean, sizeof(Boolean),
- offset(dead_shell), XtRImmediate, (XtPointer)False},
+ { XtNshellTimeout, XtCShellTimeout,
+ XtRInt, sizeof (int),
+ offset(shell_timeout), XtRImmediate,(XtPointer)DEFAULT_WM_TIMEOUT },
+ { XtNdeadShell, XtCDeadShell,
+ XtRBoolean, sizeof (Boolean),
+ offset(dead_shell), XtRImmediate, (XtPointer)False },
#ifdef EXTW_USES_MOTIF
- { XmNnavigationType, XmCNavigationType, XmRNavigationType,
- sizeof(XmNavigationType), XtOffset(ExternalClientWidget,
- primitive.navigation_type), XtRImmediate,
- (XtPointer)XmTAB_GROUP},
+ { XmNnavigationType, XmCNavigationType,
+ XmRNavigationType, sizeof (XmNavigationType),
+ XtOffset (ExternalClientWidget, primitive.navigation_type),
+ XtRImmediate, (XtPointer)XmTAB_GROUP },
#endif
- { XtNemacsProcID, XtCEmacsProcID, XtRString, sizeof(String),
- offset(emacs_procid), XtRImmediate, (XtPointer)NULL},
- { XtNshellReadyCallback, XtCCallback, XtRCallback, sizeof(XtCallbackList),
- offset(shell_ready_callback), XtRImmediate, (XtPointer)NULL},
- { XtNshellName, XtCShellName, XtRString, sizeof(String),
- offset(shell_name), XtRImmediate, (XtPointer)NULL},
- { XtNuseToolTalk, XtCUseToolTalk, XtRBoolean, sizeof(Boolean),
- offset(use_tooltalk), XtRImmediate, (XtPointer)False}
+ { XtNemacsProcID, XtCEmacsProcID,
+ XtRString, sizeof (String),
+ offset(emacs_procid), XtRImmediate, (XtPointer)NULL },
+ { XtNshellReadyCallback, XtCCallback,
+ XtRCallback, sizeof (XtCallbackList),
+ offset(shell_ready_callback), XtRImmediate, (XtPointer)NULL },
+ { XtNshellName, XtCShellName,
+ XtRString, sizeof (String),
+ offset(shell_name), XtRImmediate, (XtPointer)NULL },
+ { XtNuseToolTalk, XtCUseToolTalk,
+ XtRBoolean, sizeof (Boolean),
+ offset(use_tooltalk), XtRImmediate, (XtPointer)False }
};
static XtActionsRec actions[] = {
/* superclass */ (WidgetClass) &coreClassRec,
#endif
/* class_name */ "ExternalClient",
- /* size */ sizeof(ExternalClientRec),
+ /* size */ sizeof (ExternalClientRec),
/* Class Initializer */ NULL,
/* class_part_initialize*/ NULL, /* XtInheritClassPartInitialize, */
/* Class init'ed ? */ FALSE,
/* initialize */ externalClientInitialize,
/* initialize_notify */ NULL,
- /* realize */ externalClientRealize,
+ /* realize */ externalClientRealize,
/* actions */ actions,
/* num_actions */ XtNumber (actions),
/* resources */ resources,
/* resize */ XtInheritResize,
/* expose */ NULL,
/* set_values */ NULL, /* XtInheritSetValues, */
- /* set_values_hook */ NULL,
- /* set_values_almost */ XtInheritSetValuesAlmost,
- /* get_values_hook */ NULL,
+ /* set_values_hook */ NULL,
+ /* set_values_almost */ XtInheritSetValuesAlmost,
+ /* get_values_hook */ NULL,
/* accept_focus */ NULL,
/* intrinsics version */ XtVersion,
/* callback offsets */ NULL,
-- BPW
*/
-
+
XtOverrideTranslations (new,
XtParseTranslationTable ("None<Key>Tab:\n"
"<FocusIn>:focusIn()\n"
"<Leave>:leave()\n"));
#endif
-
+
XtAddEventHandler (new, 0, TRUE, EventHandler, (XtPointer) NULL);
ecw->externalClient.shell_ready = False;
tt_callback(Tt_message m, Tt_pattern p)
{
ExternalClientWidget ecw = (ExternalClientWidget)tt_message_user (m, 0);
-
+
switch (tt_message_state(m))
{
case TT_FAILED:
ecw->externalClient.shell_ready_callback, NULL);
break;
}
-
+
tt_message_destroy (m);
return TT_CALLBACK_PROCESSED;
}
tt_message_class_set (m, TT_REQUEST);
tt_message_arg_add (m, TT_IN, "string", name);
tt_message_iarg_add (m, TT_IN, "int", win);
- tt_message_arg_add (m, TT_OUT, "string", NULL);
+ tt_message_arg_add (m, TT_OUT, "string", NULL);
tt_message_user_set (m, 0, (void *)ecw);
tt_message_callback_add (m, tt_callback);
if (ecw->externalClient.emacs_procid)
externalClientRealize (Widget w, XtValueMask *vm, XSetWindowAttributes *attrs)
{
ExternalClientWidget ecw = (ExternalClientWidget)w;
-
-#ifdef EXTW_USES_MOTIF
+
+#ifdef EXTW_USES_MOTIF
(*xmPrimitiveWidgetClass->core_class.realize) (w, vm, attrs);
#else
(*coreWidgetClass->core_class.realize) (w, vm, attrs);
XSync (XtDisplay (w), False);
send_tooltalk_handshake (ecw, XtWindow (w), XtName (w));
}
-#endif
+#endif
}
{
struct ww_list *w1, *w2;
Widget wid = 0;
-
+
for (w1=ww_list, w2=w1->next; w2; w1=w2, w2=w2->next)
if (w2->win == win)
{
XSetWindowAttributes xswa;
XtValueMask mask;
Widget wid = (Widget) w;
-
+
w->externalClient.shell_ready = False;
XtRemoveEventHandler (wid, w->externalClient.event_mask,
FALSE, MaskableEventHandler, (XtPointer) NULL);
my_error_handler (Display *display, XErrorEvent *xev)
{
Widget wid;
-
+
if (xev->error_code != BadWindow)
goto call_old;
wid = remove_ww (xev->resourceid);
end_connection ((ExternalClientWidget) wid);
return 0;
}
-
+
call_old:
return error_old_handler (display, xev);
}
/* closure and continue_to_dispatch unused */
{
ExternalClientWidget w = (ExternalClientWidget) wid;
-
+
if (w->externalClient.shell_ready)
{
if (event->type == KeyPress || event->type == KeyRelease ||
XSync (XtDisplay (wid), 0); /* make sure that any BadWindow errors
(meaning the server died) get handled
before XSendEvent is called again. */
-
+
}
}
/* closure and continue_to_dispatch unused */
{
ExternalClientWidget w = (ExternalClientWidget) wid;
-
+
if (w->core.window != event->xany.window)
{
XtAppErrorMsg (XtWidgetToApplicationContext (wid),
(String *)NULL, (Cardinal *)NULL);
return;
}
-
+
if (event->type == ClientMessage &&
event->xclient.message_type == a_EXTW_NOTIFY &&
event->xclient.data.l[0] == extw_shell_send)
switch (event->xclient.data.l[1])
{
-
+
case extw_notify_qg:
/* shell is alive again. */
-
+
w->externalClient.dead_shell = False;
break;
-
+
case extw_notify_gm:
{
XtWidgetGeometry xwg, xwg_return;
XtGeometryResult result;
-
+
extw_get_geometry_value (XtDisplay (wid), XtWindow (wid),
a_EXTW_GEOMETRY_MANAGER, &xwg);
result = XtMakeGeometryRequest (wid, &xwg, &xwg_return);
-
+
extw_send_geometry_value (XtDisplay (wid), XtWindow (wid),
a_EXTW_GEOMETRY_MANAGER, extw_notify_gm,
result == XtGeometryAlmost ? &xwg_return :
NULL, result);
break;
}
-
+
case extw_notify_init:
w->externalClient.shell_ready = True;
w->externalClient.event_window = event->xclient.data.l[2];
w->externalClient.event_mask = event->xclient.data.l[3];
add_ww (w->externalClient.event_window, (Widget) w);
-
+
XtAddEventHandler (wid, w->externalClient.event_mask,
FALSE, MaskableEventHandler, (XtPointer) NULL);
#ifdef EXTW_USES_MOTIF
0, 0);
#endif
break;
-
+
case extw_notify_end:
end_connection (w);
remove_ww (w->externalClient.event_window);
break;
-
+
case extw_notify_set_focus:
#ifdef EXTW_USES_MOTIF
XmProcessTraversal (wid, XmTRAVERSE_CURRENT);
XtSetKeyboardFocus (wid, None);
#endif
break;
-
+
}
}
Widget wid;
{
ExternalClientWidget w = (ExternalClientWidget)wid;
-
+
NOTIFY(w, extw_notify_end, 0, 0, 0);
}
unsigned long request_num;
Display *display = XtDisplay(gw);
XtWidgetGeometry req = *request; /* don't modify caller's structure */
-
+
if (!XtIsRealized((Widget)w) || !w->externalClient.shell_ready)
return XtGeometryYes;
-
+
if (w->externalClient.dead_shell == TRUE)
/* The shell is sick. */
return XtGeometryNo;
-
+
req.sibling = None;
req.request_mode &= ~CWSibling;
request_num = NextRequest(display);
Cardinal *num_params)
{
ExternalClientWidget ecw = (ExternalClientWidget) w;
-
+
if (event->xfocus.send_event && !ecw->externalClient.has_focus) {
ecw->externalClient.has_focus = True;
NOTIFY(ecw, extw_notify_focus_in, 0, 0, 0);
Cardinal *num_params)
{
ExternalClientWidget ecw = (ExternalClientWidget) w;
-
+
if (event->xfocus.send_event && ecw->externalClient.has_focus) {
ecw->externalClient.has_focus = False;
NOTIFY(ecw, extw_notify_focus_out, 0, 0, 0);
Cardinal *num_params)
{
ExternalClientWidget ecw = (ExternalClientWidget) w;
-
+
if (
#ifdef EXTW_USES_MOTIF
_XmGetFocusPolicy (w) != XmEXPLICIT &&
Cardinal *num_params)
{
ExternalClientWidget ecw = (ExternalClientWidget) w;
-
+
if (
#ifdef EXTW_USES_MOTIF
_XmGetFocusPolicy (w) != XmEXPLICIT &&
/* Written by Ben Wing. */
-#ifndef _ExternalClient_h
-#define _ExternalClient_h
+#ifndef INCLUDED_ExternalClient_h_
+#define INCLUDED_ExternalClient_h_
#ifndef XtNshellTimeout
#define XtNshellTimeout "shellTimeout"
void ExternalClientInitialize (Display *display, Window win);
void ExternalClientEventHandler (Display *display, Window win, XEvent *event);
-#endif /* _ExternalClient_h */
+#endif /* INCLUDED_ExternalClient_h_ */
/* Written by Ben Wing. */
-#ifndef _ExternalClientP_h
-#define _ExternalClientP_h
+#ifndef INCLUDED_ExternalClientP_h_
+#define INCLUDED_ExternalClientP_h_
#include "ExternalClient.h"
#ifdef EXTW_USES_MOTIF
extern ExternalClientClassRec externalClientClassRec; /* class pointer */
-#endif /* _ExternalClientP_h */
+#endif /* INCLUDED_ExternalClientP_h_ */
static XtResource resources[] = {
#define offset(field) XtOffset(ExternalShellWidget, externalShell.field)
- { XtNwindow, XtCWindow, XtRWindow, sizeof (Window),
- offset (external_window), XtRImmediate, (XtPointer)0},
- { XtNclientTimeout, XtCClientTimeout, XtRInt, sizeof(int),
- offset(client_timeout), XtRImmediate,(XtPointer)DEFAULT_WM_TIMEOUT},
- { XtNdeadClient, XtCDeadClient, XtRBoolean, sizeof(Boolean),
- offset(dead_client), XtRImmediate, (XtPointer)False},
+ { XtNwindow, XtCWindow,
+ XtRWindow, sizeof (Window),
+ offset (external_window), XtRImmediate, (XtPointer)0 },
+ { XtNclientTimeout, XtCClientTimeout,
+ XtRInt, sizeof (int),
+ offset(client_timeout), XtRImmediate,(XtPointer)DEFAULT_WM_TIMEOUT },
+ { XtNdeadClient, XtCDeadClient,
+ XtRBoolean, sizeof (Boolean),
+ offset(dead_client), XtRImmediate, (XtPointer)False },
};
static CompositeClassExtensionRec compositeClassExtRec = {
NULL,
NULLQUARK,
XtCompositeExtensionVersion,
- sizeof(CompositeClassExtensionRec),
+ sizeof (CompositeClassExtensionRec),
TRUE,
};
NULL,
NULLQUARK,
XtShellExtensionVersion,
- sizeof(ShellClassExtensionRec),
+ sizeof (ShellClassExtensionRec),
ExternalShellRootGeometryManager
};
*/
/* superclass */ (WidgetClass) &shellClassRec,
/* class_name */ "ExternalShell",
- /* size */ sizeof(ExternalShellRec),
+ /* size */ sizeof (ExternalShellRec),
/* Class Initializer */ NULL,
/* class_part_initialize*/ NULL, /* XtInheritClassPartInitialize, */
/* Class init'ed ? */ FALSE,
/* resize */ XtInheritResize,
/* expose */ NULL,
/* set_values */ NULL, /* XtInheritSetValues, */
- /* set_values_hook */ NULL,
- /* set_values_almost */ XtInheritSetValuesAlmost,
- /* get_values_hook */ NULL,
+ /* set_values_hook */ NULL,
+ /* set_values_almost */ XtInheritSetValuesAlmost,
+ /* get_values_hook */ NULL,
/* accept_focus */ NULL,
/* intrinsics version */ XtVersion,
/* callback offsets */ NULL,
case extw_notify_focus_in: {
XFocusChangeEvent evnt;
-
+
evnt.type = FocusIn;
evnt.serial = LastKnownRequestProcessed (XtDisplay (wid));
evnt.send_event = True;
#endif
break;
}
-
+
case extw_notify_focus_out: {
XFocusChangeEvent evnt;
-
+
evnt.type = FocusOut;
evnt.serial = LastKnownRequestProcessed (XtDisplay (wid));
evnt.send_event = True;
int x, y, win_gravity = -1, flag;
XSizeHints hints;
Window win = w->externalShell.external_window;
-
+
{
Window dummy_root;
unsigned int dummy_bd_width, dummy_depth, width, height;
-
+
/* determine the existing size of the window. */
XGetGeometry(XtDisplay(W), win, &dummy_root, &x, &y, &width,
&height, &dummy_bd_width, &dummy_depth);
w->core.background_pixmap =
(*childP)->core.background_pixmap;
} else {
- attr->background_pixel =
- w->core.background_pixel =
+ attr->background_pixel =
+ w->core.background_pixel =
(*childP)->core.background_pixel;
}
break;
/* Written by Ben Wing, September 1993. */
-#ifndef _ExternalShell_h
-#define _ExternalShell_h
+#ifndef INCLUDED_ExternalShell_h_
+#define INCLUDED_ExternalShell_h_
#ifndef XtNwindow
#define XtNwindow "window"
#define is_external_shell(w) (XtClass (w) == externalShellWidgetClass)
-#endif /* _ExternalShell_h */
+#endif /* INCLUDED_ExternalShell_h_ */
/* Written by Ben Wing, September 1993. */
-#ifndef _ExternalShellP_h
-#define _ExternalShellP_h
+#ifndef INCLUDED_ExternalShellP_h_
+#define INCLUDED_ExternalShellP_h_
#include "xintrinsic.h"
#include <X11/ShellP.h>
extern ExternalShellClassRec externalShellClassRec; /* class pointer */
-#endif /* _ExternalShellP_h */
+#endif /* INCLUDED_ExternalShellP_h_ */
cd ../lwlib && $(RECURSIVE_MAKE)
x_objs=balloon_help.o balloon-x.o console-x.o device-x.o event-Xt.o frame-x.o\
- glyphs-x.o objects-x.o redisplay-x.o select-x.o xgccache.o
+ glyphs-x.o objects-x.o redisplay-x.o select-x.o xgccache.o
#ifdef AIX4
LIBI18N = -li18n
# define EXTW_LINK(objs, output) $(CC) -shared objs -Xlinker -z -Xlinker text -o output
extw_link_beg = $(CC) -shared
extw_link_mid = -Xlinker -z -Xlinker text -o
-extw_link_end =
+extw_link_end =
## I cannot figure out how to do shared a.out libraries, so just punt.
# elif !defined (LINUX) || defined (__ELF__)
# define EXTW_LINK(objs, output) $(CC) -shared objs -o output
extw_link_beg = $(CC) -shared
extw_link_mid = -o
-extw_link_end =
+extw_link_end =
# endif
# elif defined (USG5)
# if defined (IRIX)
# define EXTW_LINK(objs, output) $(LD) -shared -g -check_registry ${TOOLROOT}/usr/lib/so_locations objs -o output
-extw_link_beg = $(LD) -shared -g -check_registry ${TOOLROOT}/usr/lib/so_locations
-extw_link_mid = -o
-extw_link_end =
+extw_link_beg = $(LD) -shared -g -check_registry ${TOOLROOT}/usr/lib/so_locations
+extw_link_mid = -o
+extw_link_end =
# else /* not IRIX */
# define EXTW_LINK(objs, output) $(CC) -G objs -z text -o output
extw_link_beg = $(CC) -G
extw_link_mid = -z text -o
-extw_link_end =
+extw_link_end =
# endif /* not IRIX */
# else /* not USG5 */
# if defined (DEC_ALPHA) && defined (OSF1)
# define EXTW_LINK(objs, output) $(LD) $(ldflags) $(ld_switch_shared) -d objs -o output $(LIBES)
-extw_link_beg = $(LD) $(ldflags) $(ld_switch_shared) -d
-extw_link_mid = -o
+extw_link_beg = $(LD) $(ldflags) $(ld_switch_shared) -d
+extw_link_mid = -o
extw_link_end = $(LIBES)
# else /* !(DEC_ALPHA && OSF1) */
# define EXTW_LINK(objs, output) $(LD) -dc objs -assert pure-text -o output
extw_link_beg = $(LD) -dc
extw_link_mid = -assert pure-text -o
-extw_link_end =
+extw_link_end =
# endif /* !(DEC_ALPHA && OSF1) */
# endif /* not USG5 */
if test -f SATISFIED; then $(RM) SATISFIED; exit 1; fi; \
$(RECURSIVE_MAKE) $@;
#else
- @$(RM) $@
- -${dump_temacs}
+ @$(RM) $@ xemacs.dmp
+ ${dump_temacs}
+#ifdef PDUMP
+ @mv temacs $@
+#endif
@echo "Testing for Lisp shadows ..."
@./${PROGNAME} -batch -vanilla -f list-load-path-shadows
#endif
-fastdump: temacs
+fastdump: temacs
@$(RM) ${PROGNAME} && touch SATISFIED
-${dump_temacs}
@./${PROGNAME} -batch -vanilla -f list-load-path-shadows
temacs: $(temacs_deps)
$(LD) $(temacs_link_args)
+#ifdef PDUMP
+ @$(RM) xemacs.dmp
+#endif
.PHONY : run-temacs
##
## Purify
PURIFY_PROG = purify
-PURIFY_FLAGS = -chain-length=32 -ignore-signals=SIGPOLL -threads=yes \
+PURIFY_FLAGS =\
+#ifdef PDUMP
+ -search-mmaps=yes\
+#endif
+ -chain-length=32 -ignore-signals=SIGPOLL -threads=yes\
-cache-dir=./purecache -always-use-cache-dir=yes
+
PURIFY_LIBS = -lpthread
puremacs: $(temacs_deps)
$(PURIFY_PROG) $(PURIFY_FLAGS) $(LD) $(temacs_link_args) $(PURIFY_LIBS)
Mly (probably) or JWZ: Some changes.
*/
-#ifndef _XEMACS_BACKTRACE_H_
-#define _XEMACS_BACKTRACE_H_
+#ifndef INCLUDED_backtrace_h_
+#define INCLUDED_backtrace_h_
#include <setjmp.h>
Lisp_Object SB_symbol = (symbol_object); \
Lisp_Object SB_newval = (value_object); \
Lisp_Object SB_oldval; \
- struct Lisp_Symbol *SB_sym; \
+ Lisp_Symbol *SB_sym; \
\
SPECPDL_RESERVE (1); \
\
\
if (!SYMBOL_VALUE_MAGIC_P (SB_oldval) || UNBOUNDP (SB_oldval)) \
{ \
- /* ### the following test will go away when we have a constant \
+ /* #### the following test will go away when we have a constant \
symbol magic object */ \
if (EQ (SB_symbol, Qnil) || \
EQ (SB_symbol, Qt) || \
#define SPECBIND_FAST_UNSAFE(symbol_object, value_object) do { \
Lisp_Object SFU_symbol = (symbol_object); \
Lisp_Object SFU_newval = (value_object); \
- struct Lisp_Symbol *SFU_sym = XSYMBOL (SFU_symbol); \
+ Lisp_Symbol *SFU_sym = XSYMBOL (SFU_symbol); \
Lisp_Object SFU_oldval = SFU_sym->value; \
if (!SYMBOL_VALUE_MAGIC_P (SFU_oldval) || UNBOUNDP (SFU_oldval)) \
{ \
int UNBIND_TO_count = (count); \
while (specpdl_depth_counter != UNBIND_TO_count) \
{ \
- struct Lisp_Symbol *sym; \
+ Lisp_Symbol *sym; \
--specpdl_ptr; \
--specpdl_depth_counter; \
\
int UNBIND_TO_count = (count); \
while (specpdl_depth_counter != UNBIND_TO_count) \
{ \
- struct Lisp_Symbol *sym; \
+ Lisp_Symbol *sym; \
--specpdl_ptr; \
--specpdl_depth_counter; \
\
int UNBIND_TO_count = (count); \
while (specpdl_depth_counter != UNBIND_TO_count) \
{ \
- struct Lisp_Symbol *sym; \
+ Lisp_Symbol *sym; \
--specpdl_ptr; \
--specpdl_depth_counter; \
\
#define FSET_FAST_UNSAFE(sym, newval) do { \
Lisp_Object FFU_sym = (sym); \
Lisp_Object FFU_newval = (newval); \
- struct Lisp_Symbol *FFU_symbol = XSYMBOL (FFU_sym); \
+ Lisp_Symbol *FFU_symbol = XSYMBOL (FFU_sym); \
Lisp_Object FFU_oldval = FFU_symbol->value; \
if (!SYMBOL_VALUE_MAGIC_P (FFU_oldval) || UNBOUNDP (FFU_oldval)) \
FFU_symbol->value = FFU_newval; \
Fset (FFU_sym, FFU_newval); \
} while (0)
-#endif /* _XEMACS_BACKTRACE_H_ */
+#endif /* INCLUDED_backtrace_h_ */
#include "balloon_help.h"
-/* ### start of hack */
+/* #### start of hack */
static unsigned long
alloc_color (Display* dpy, CONST char* colorname, int light)
}
}
-/* ### end of hack */
+/* #### end of hack */
DEFUN ("show-balloon-help", Fshow_balloon_help, 1, 1, 0, /*
Show balloon help.
/* Synched up with: Not in FSF. */
-#ifndef BALLOON_HELP_H
-#define BALLOON_HELP_H
+#ifndef INCLUDED_balloon_help_h_
+#define INCLUDED_balloon_help_h_
#include "xintrinsic.h"
void balloon_help_hide (void);
void balloon_help_move_to_pointer (void);
-#endif /* BALLOON_HELP_H */
+#endif /* INCLUDED_balloon_help_h_ */
JWZ (?): 1992?.
*/
-#ifndef _XEMACS_BITMAPS_H_
-#define _XEMACS_BITMAPS_H_
+#ifndef INCLUDED_bitmaps_h_
+#define INCLUDED_bitmaps_h_
#if 0
/* A gnu, like on the back of the emacs manual, for icons. */
0x00, 0x00, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00};
#endif
-#endif /* _XEMACS_BITMAPS_H_ */
+#endif /* INCLUDED_bitmaps_h_ */
Ben Wing: December 1994, for 19.12.
*/
-#ifndef _XEMACS_BLOCKTYPE_H_
-#define _XEMACS_BLOCKTYPE_H_
+#ifndef INCLUDED_blocktype_h_
+#define INCLUDED_blocktype_h_
#define Blocktype_declare(type) \
type *free; \
(structype *) Blocktype_newf (sizeof(*(((structype *) NULL)->free)))
#define Blocktype_alloc(b) (Blocktype_allocf (b), (b)->tempel)
-#endif /* _XEMACS_BLOCKTYPE_H_ */
+#endif /* INCLUDED_blocktype_h_ */
/* Sun's standard and GCC's header files leave out prototypes for
all sorts of functions. */
-#ifndef _XEMACS_BROKEN_SUN_H_
-#define _XEMACS_BROKEN_SUN_H_
+#ifndef INCLUDED_broken_sun_h_
+#define INCLUDED_broken_sun_h_
#ifdef __GNUC__
#include <stdlib.h>
#endif /* __GNUC__ */
-#endif /* _XEMACS_BROKEN_SUN_H_ */
+#endif /* INCLUDED_broken_sun_h_ */
do_varset:
{
Lisp_Object symbol = constants_data[n];
- struct Lisp_Symbol *symbol_ptr = XSYMBOL (symbol);
+ Lisp_Symbol *symbol_ptr = XSYMBOL (symbol);
Lisp_Object old_value = symbol_ptr->value;
Lisp_Object new_value = POP;
if (!SYMBOL_VALUE_MAGIC_P (old_value) || UNBOUNDP (old_value))
do_varbind:
{
Lisp_Object symbol = constants_data[n];
- struct Lisp_Symbol *symbol_ptr = XSYMBOL (symbol);
+ Lisp_Symbol *symbol_ptr = XSYMBOL (symbol);
Lisp_Object old_value = symbol_ptr->value;
Lisp_Object new_value = POP;
if (!SYMBOL_VALUE_MAGIC_P (old_value) || UNBOUNDP (old_value))
program, &program_length, &varbind_count);
f->specpdl_depth = XINT (Flength (f->arglist)) + varbind_count;
f->instructions =
- make_opaque (program_length * sizeof (Opbyte),
- (CONST void *) program);
+ make_opaque (program, program_length * sizeof (Opbyte));
}
assert (OPAQUEP (f->instructions));
}
static const struct lrecord_description compiled_function_description[] = {
- { XD_LISP_OBJECT, offsetof(struct Lisp_Compiled_Function, instructions), 4 },
+ { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, instructions) },
+ { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, constants) },
+ { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, arglist) },
+ { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, doc_and_interactive) },
#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
- { XD_LISP_OBJECT, offsetof(struct Lisp_Compiled_Function, annotated), 1 },
+ { XD_LISP_OBJECT, offsetof (Lisp_Compiled_Function, annotated) },
#endif
{ XD_END }
};
Jon Reid: some changes for I18N3 (domain, etc), for 19.8.
*/
-#ifndef _XEMACS_BYTECODE_H_
-#define _XEMACS_BYTECODE_H_
+#ifndef INCLUDED_bytecode_h_
+#define INCLUDED_bytecode_h_
/* Meanings of slots in a Lisp_Compiled_Function.
Don't use these! For backward compatibility only. */
neither - : (* 559 0) = 0 = 3530
*/
-#endif /* _XEMACS_BYTECODE_H_ */
+#endif /* INCLUDED_bytecode_h_ */
static Lisp_Object
quotify_args (Lisp_Object expr)
{
- REGISTER Lisp_Object tail;
- REGISTER struct Lisp_Cons *ptr;
+ Lisp_Object tail;
+ Lisp_Cons *ptr;
for (tail = expr; CONSP (tail); tail = ptr->cdr)
{
ptr = XCONS (tail);
#ifdef WINDOWSNT
#define _P_NOWAIT 1 /* from process.h */
-#include <windows.h>
#include "nt.h"
#endif
static Lisp_Object
call_process_cleanup (Lisp_Object fdpid)
{
- int fd = XINT (Fcar (fdpid));
+ int fd = XINT (Fcar (fdpid));
int pid = XINT (Fcdr (fdpid));
-#ifdef WINDOWSNT
- HANDLE pHandle;
-#endif
if (!call_process_exited &&
EMACS_KILLPG (pid, SIGINT) == 0)
message ("Waiting for process to die...(type C-g again to kill it instantly)");
#ifdef WINDOWSNT
- pHandle = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
- if (pHandle == NULL)
- {
+ {
+ HANDLE pHandle = OpenProcess (PROCESS_ALL_ACCESS, 0, pid);
+ if (pHandle == NULL)
warn_when_safe (Qprocess, Qwarning,
"cannot open process (PID %d) for cleanup", pid);
- }
- wait_for_termination (pHandle);
+ else
+ wait_for_termination (pHandle);
+ }
#else
wait_for_termination (pid);
#endif
if (nread == 0)
break;
+#if 0
#ifdef DOS_NT
/* Until we pull out of MULE things like
make_decoding_input_stream(), we do the following which is
less elegant. --marcpa */
+ /* We did. -- kkm */
{
int lf_count = 0;
if (NILP (Vbinary_process_output)) {
}
}
#endif
+#endif
total_read += nread;
{
char **ep = env;
char *envvar_external;
- Bufbyte *envvar_internal = XSTRING_DATA (XCAR (tail));
- GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA (envvar_internal, envvar_external);
+ TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (tail),
+ C_STRING_ALLOCA, envvar_external,
+ Qfile_name);
/* See if envvar_external duplicates any string already in the env.
If so, don't put it in.
char **envp;
Vprocess_environment = Qnil;
for (envp = environ; envp && *envp; envp++)
- {
- Vprocess_environment = Fcons (build_ext_string (*envp, FORMAT_OS),
- Vprocess_environment);
- }
+ Vprocess_environment =
+ Fcons (build_ext_string (*envp, Qfile_name), Vprocess_environment);
}
{
/* #### Chuck -- This file should be deleted. I'm not deleting it yet
because there might be something you want out of it. */
-#ifndef _XEMACS_CM_H_
-#define _XEMACS_CM_H_
+#ifndef INCLUDED_cm_h_
+#define INCLUDED_cm_h_
/* Holds the minimum and maximum costs for the parametrized capabilities. */
struct parmcap
void Wcm_clear (void);
int Wcm_init (void);
-#endif /* _XEMACS_CM_H_ */
+#endif /* INCLUDED_cm_h_ */
/* Synched up with: FSF 19.30. */
-#ifndef _XEMACS_COMMANDS_H_
-#define _XEMACS_COMMANDS_H_
+#ifndef INCLUDED_commands_h_
+#define INCLUDED_commands_h_
#if 0 /* FSFmacs */
#define Ctl(c) ((c)&037)
extern Lisp_Object Vthis_command_keys; /* event-stream.c */
-#endif /* _XEMACS_COMMANDS_H_ */
+#endif /* INCLUDED_commands_h_ */
#include "console-msw.h"
-
DEFINE_CONSOLE_TYPE (mswindows);
+DEFINE_CONSOLE_TYPE (msprinter);
+/************************************************************************/
+/* mswindows console methods */
+/************************************************************************/
static int
mswindows_initially_selected_for_input (struct console *con)
return 1;
}
+static Lisp_Object
+mswindows_canonicalize_console_connection (Lisp_Object connection,
+ Error_behavior errb)
+{
+ /* Do not allow more than one mswindows device, by explicitly
+ requiring that CONNECTION is nil, the only allowed connection in
+ Windows. */
+ if (!NILP (connection))
+ {
+ if (ERRB_EQ (errb, ERROR_ME))
+ signal_simple_error
+ ("Invalid (non-nil) connection for mswindows device/console",
+ connection);
+ else
+ return Qunbound;
+ }
+
+ return Qnil;
+}
+static Lisp_Object
+mswindows_canonicalize_device_connection (Lisp_Object connection,
+ Error_behavior errb)
+{
+ return mswindows_canonicalize_console_connection (connection, errb);
+}
\f
/************************************************************************/
/* CONSOLE_HAS_METHOD (mswindows, mark_console); */
CONSOLE_HAS_METHOD (mswindows, initially_selected_for_input);
/* CONSOLE_HAS_METHOD (mswindows, delete_console); */
-/* CONSOLE_HAS_METHOD (mswindows, canonicalize_console_connection); */
-/* CONSOLE_HAS_METHOD (mswindows, canonicalize_device_connection); */
+ CONSOLE_HAS_METHOD (mswindows, canonicalize_console_connection);
+ CONSOLE_HAS_METHOD (mswindows, canonicalize_device_connection);
/* CONSOLE_HAS_METHOD (mswindows, semi_canonicalize_console_connection); */
/* CONSOLE_HAS_METHOD (mswindows, semi_canonicalize_device_connection); */
+
+ INITIALIZE_CONSOLE_TYPE (msprinter, "msprinter", "console-msprinter-p");
}
void
reinit_console_type_create_mswindows (void)
{
REINITIALIZE_CONSOLE_TYPE (mswindows);
+ REINITIALIZE_CONSOLE_TYPE (msprinter);
}
void
return OPAQUEP (obj) ? OPAQUE_DATA (XOPAQUE (obj)) : NULL;
}
-struct Lisp_Event *
+Lisp_Event *
DEVENT (Lisp_Object obj)
{
return EVENTP (obj) ? XEVENT (obj) : NULL;
}
-struct Lisp_Cons *
+Lisp_Cons *
DCONS (Lisp_Object obj)
{
return CONSP (obj) ? XCONS (obj) : NULL;
}
-struct Lisp_Cons *
+Lisp_Cons *
DCONSCDR (Lisp_Object obj)
{
return (CONSP (obj) && CONSP (XCDR (obj))) ? XCONS (XCDR (obj)) : 0;
return STRINGP (obj) ? XSTRING_DATA (obj) : NULL;
}
-struct Lisp_Vector *
+Lisp_Vector *
DVECTOR (Lisp_Object obj)
{
return VECTORP (obj) ? XVECTOR (obj) : NULL;
}
-struct Lisp_Symbol *
+Lisp_Symbol *
DSYMBOL (Lisp_Object obj)
{
return SYMBOLP (obj) ? XSYMBOL (obj) : NULL;
return SYMBOLP (obj) ? string_data (XSYMBOL (obj)->name) : NULL;
}
-#endif
+#endif /* DEBUG_XEMACS */
Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0.
*/
-#ifndef _XEMACS_CONSOLE_MSW_H_
-#define _XEMACS_CONSOLE_MSW_H_
+#ifndef INCLUDED_console_msw_h_
+#define INCLUDED_console_msw_h_
#include "console.h"
#ifdef CONST /* I suspect this is safe */
int infd, outfd;
};
+DECLARE_CONSOLE_TYPE (msprinter);
/*
* Device
#define MSW_FONTSIZE (LF_FACESIZE*4+12)
-struct mswindows_font_enum
-{
- char fontname[MSW_FONTSIZE];
- struct mswindows_font_enum *next;
-};
-
struct mswindows_device
{
int logpixelsx, logpixelsy;
int horzres, vertres; /* Size in pixels */
int horzsize, vertsize; /* Size in mm */
int bitspixel;
- struct mswindows_font_enum *fontlist;
+ Lisp_Object fontlist; /* List of strings, device fonts */
};
#define DEVICE_MSWINDOWS_DATA(d) DEVICE_TYPE_DATA (d, mswindows)
#define DEVICE_MSWINDOWS_BITSPIXEL(d) (DEVICE_MSWINDOWS_DATA (d)->bitspixel)
#define DEVICE_MSWINDOWS_FONTLIST(d) (DEVICE_MSWINDOWS_DATA (d)->fontlist)
+struct msprinter_device
+{
+ HDC hdc;
+ HANDLE hprinter;
+ Lisp_Object fontlist;
+ char* name;
+ DEVMODE *devmode, *devmode_mirror;
+ size_t devmode_size;
+};
+
+#define DEVICE_MSPRINTER_DATA(d) DEVICE_TYPE_DATA (d, msprinter)
+#define DEVICE_MSPRINTER_HDC(d) (DEVICE_MSPRINTER_DATA (d)->hdc)
+#define DEVICE_MSPRINTER_HPRINTER(d) (DEVICE_MSPRINTER_DATA (d)->hprinter)
+#define DEVICE_MSPRINTER_FONTLIST(d) (DEVICE_MSPRINTER_DATA (d)->fontlist)
+#define DEVICE_MSPRINTER_NAME(d) (DEVICE_MSPRINTER_DATA (d)->name)
+#define DEVICE_MSPRINTER_DEVMODE(d) (DEVICE_MSPRINTER_DATA (d)->devmode)
+#define DEVICE_MSPRINTER_DEVMODE_MIRROR(d) \
+ (DEVICE_MSPRINTER_DATA (d)->devmode_mirror)
+#define DEVICE_MSPRINTER_DEVMODE_SIZE(d) \
+ (DEVICE_MSPRINTER_DATA (d)->devmode_size)
+
+#define CONSOLE_TYPESYM_MSPRINTER_P(typesym) EQ (typesym, Qmsprinter)
+#define DEVICE_MSPRINTER_P(dev) CONSOLE_TYPESYM_MSPRINTER_P (DEVICE_TYPE (dev))
+#define CHECK_MSPRINTER_DEVICE(z) CHECK_DEVICE_TYPE (z, msprinter)
+#define CONCHECK_MSPRINTER_DEVICE(z) CONCHECK_DEVICE_TYPE (z, msprinter)
+
+/* Printer functions */
+DEVMODE* msprinter_get_devmode_copy (struct device *d);
+void msprinter_apply_devmode (struct device *d, DEVMODE *devmode);
/*
* Frame
#define XWL_COUNT 1 /* Number of LONGs that we use */
#define MSWINDOWS_WINDOW_EXTRA_BYTES (XWL_COUNT*4)
+/*
+ * Printer frame, aka printer job
+ */
+
+struct msprinter_frame
+{
+ HDC hcdc; /* Compatoble DC */
+ int left_margin, top_margin, /* All in twips */
+ right_margin, bottom_margin;
+ int charheight, charwidth; /* As per proplist or -1 if not gven */
+ Lisp_Object orientation, duplex; /* nil for printer's default */
+ int job_started : 1;
+};
+
+#define FRAME_MSPRINTER_DATA(f) FRAME_TYPE_DATA (f, msprinter)
+#define FRAME_MSPRINTER_LEFT_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->left_margin)
+#define FRAME_MSPRINTER_RIGHT_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->top_margin)
+#define FRAME_MSPRINTER_TOP_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->right_margin)
+#define FRAME_MSPRINTER_BOTTOM_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->bottom_margin)
+#define FRAME_MSPRINTER_CDC(f) (FRAME_MSPRINTER_DATA (f)->hcdc)
+#define FRAME_MSPRINTER_JOB_STARTED(f) (FRAME_MSPRINTER_DATA (f)->job_started)
+#define FRAME_MSPRINTER_ORIENTATION(f) (FRAME_MSPRINTER_DATA (f)->orientation)
+#define FRAME_MSPRINTER_DUPLEX(f) (FRAME_MSPRINTER_DATA (f)->duplex)
+#define FRAME_MSPRINTER_CHARWIDTH(f) (FRAME_MSPRINTER_DATA (f)->charheight)
+#define FRAME_MSPRINTER_CHARHEIGHT(f) (FRAME_MSPRINTER_DATA (f)->charwidth)
/*
* Events
void mswindows_redraw_exposed_area (struct frame *f, int x, int y,
int width, int height);
void mswindows_size_frame_internal (struct frame* f, XEMACS_RECT_WH* dest);
-void mswindows_enqueue_magic_event (HWND hwnd, UINT message);
+void mswindows_enqueue_magic_event (HWND hwnd, UINT msg);
/* win32 DDE management library */
#define MSWINDOWS_DDE_ITEM_OPEN "Open"
void mswindows_enqueue_misc_user_event (Lisp_Object channel,
Lisp_Object function,
Lisp_Object object);
-Lisp_Object mswindows_cancel_dispatch_event (struct Lisp_Event* event);
+Lisp_Object mswindows_cancel_dispatch_event (Lisp_Event* event);
Lisp_Object mswindows_pump_outstanding_events (void);
Lisp_Object mswindows_protect_modal_loop (Lisp_Object (*bfun) (Lisp_Object barg),
Lisp_Object barg);
void mswindows_unmodalize_signal_maybe (void);
+#ifdef HAVE_TOOLBARS
+Lisp_Object
+mswindows_get_toolbar_button_text ( struct frame* f, int command_id );
+Lisp_Object
+mswindows_handle_toolbar_wm_command (struct frame* f, HWND ctrl, WORD id);
+#endif
+Lisp_Object
+mswindows_handle_gui_wm_command (struct frame* f, HWND ctrl, DWORD id);
+COLORREF mswindows_string_to_color (CONST char *name);
+USID emacs_mswindows_create_stream_pair (void* inhandle, void* outhandle,
+ Lisp_Object* instream,
+ Lisp_Object* outstream,
+ int flags);
+USID emacs_mswindows_delete_stream_pair (Lisp_Object instream,
+ Lisp_Object outstream);
+
#ifdef HAVE_WIN32_PROCESSES
-HANDLE get_nt_process_handle (struct Lisp_Process *p);
+HANDLE get_nt_process_handle (Lisp_Process *p);
#endif
extern Lisp_Object Vmswindows_frame_being_created;
extern Lisp_Object mswindows_frame_being_created;
-void mswindows_enumerate_fonts (struct device *d);
+Lisp_Object mswindows_enumerate_fonts (HDC hdc);
+
+Lisp_Object mswindows_get_toolbar_button_text (struct frame* f,
+ int command_id);
+Lisp_Object mswindows_handle_toolbar_wm_command (struct frame* f,
+ HWND ctrl, WORD id);
+Lisp_Object mswindows_handle_gui_wm_command (struct frame* f,
+ HWND ctrl, DWORD id);
-#endif /* _XEMACS_CONSOLE_MSW_H_ */
+#endif /* INCLUDED_console_msw_h_ */
/* Written by Ben Wing. */
-#ifndef _XEMACS_CONSOLE_STREAM_H_
-#define _XEMACS_CONSOLE_STREAM_H_
+#ifndef INCLUDED_console_stream_h_
+#define INCLUDED_console_stream_h_
#include "console.h"
Error_behavior);
Lisp_Object stream_canonicalize_device_connection(Lisp_Object,
Error_behavior);
-#endif /* _XEMACS_CONSOLE_STREAM_H_ */
+#endif /* INCLUDED_console_stream_h_ */
return Qnil;
}
-/* ### Move this function to lisp */
+/* #### Move this function to lisp */
DEFUN ("set-console-tty-coding-system", Fset_console_tty_coding_system,
0, 2, 0, /*
Set the input and output coding systems of tty console CONSOLE to CODESYS.
have more than one device on a TTY console, the output stuff
will have to get separated out. */
-#ifndef _XEMACS_CONSOLE_TTY_H_
-#define _XEMACS_CONSOLE_TTY_H_
+#ifndef INCLUDED_console_tty_h_
+#define INCLUDED_console_tty_h_
#include "console.h"
#include "syssignal.h" /* Always include before systty.h */
Error_behavior errb);
struct console * tty_find_console_from_fd (int fd);
-#endif /* _XEMACS_CONSOLE_TTY_H_ */
+#endif /* INCLUDED_console_tty_h_ */
/* assert: display_arg is only set if we found the display
arg earlier so we can't fail to find it now. */
assert (disp_name != NULL);
- conn = build_ext_string (disp_name, FORMAT_CTEXT);
+ conn = build_ext_string (disp_name, Qctext);
free_argc_argv (argv);
return conn;
}
else
- return build_ext_string (XDisplayName (0), FORMAT_CTEXT);
+ return build_ext_string (XDisplayName (0), Qctext);
}
/* "semi-canonicalize" means convert to a nicer form for printing, but
sprintf (buf, "#<%s-console", !CONSOLE_LIVE_P (con) ? "dead" :
CONSOLE_TYPE_NAME (con));
write_c_string (buf, printcharfun);
- if (CONSOLE_LIVE_P (con))
+ if (CONSOLE_LIVE_P (con) && !NILP (CONSOLE_CONNECTION (con)))
{
write_c_string (" on ", printcharfun);
print_internal (CONSOLE_CONNECTION (con), printcharfun, 1);
semi_canonicalize_console_connection (struct console_methods *meths,
Lisp_Object name, Error_behavior errb)
{
- return CONTYPE_METH_OR_GIVEN (meths, semi_canonicalize_console_connection,
- (name, errb), name);
+ if (HAS_CONTYPE_METH_P (meths, semi_canonicalize_console_connection))
+ return CONTYPE_METH (meths, semi_canonicalize_console_connection,
+ (name, errb));
+ else
+ return CONTYPE_METH_OR_GIVEN (meths, canonicalize_console_connection,
+ (name, errb), name);
}
static Lisp_Object
canonicalize_console_connection (struct console_methods *meths,
Lisp_Object name, Error_behavior errb)
{
- return CONTYPE_METH_OR_GIVEN (meths, canonicalize_console_connection,
- (name, errb), name);
+ if (HAS_CONTYPE_METH_P (meths, canonicalize_console_connection))
+ return CONTYPE_METH (meths, canonicalize_console_connection,
+ (name, errb));
+ else
+ return CONTYPE_METH_OR_GIVEN (meths, semi_canonicalize_console_connection,
+ (name, errb), name);
}
static Lisp_Object
/* Do it this way so that the console list is in order of creation */
Vconsole_list = nconc2 (Vconsole_list, Fcons (console, Qnil));
- if (CONMETH (con, initially_selected_for_input, (con)))
+ if (CONMETH_OR_GIVEN (con, initially_selected_for_input, (con), 0))
event_stream_select_console (con);
UNGCPRO;
Extcount count;
Extbyte *p;
- GET_STRING_EXT_DATA_ALLOCA (stuffstring, FORMAT_KEYBOARD, p, count);
+ TO_EXTERNAL_FORMAT (LISP_STRING, stuffstring,
+ ALLOCA, (p, count),
+ Qkeyboard);
while (count-- > 0)
stuff_char (XCONSOLE (Vcontrolling_terminal), *p++);
stuff_char (XCONSOLE (Vcontrolling_terminal), '\n');
}
static const struct lrecord_description cte_description_1[] = {
- { XD_LISP_OBJECT, offsetof(console_type_entry, symbol), 1 },
- { XD_STRUCT_PTR, offsetof(console_type_entry, meths), 1, &console_methods_description },
+ { XD_LISP_OBJECT, offsetof (console_type_entry, symbol) },
+ { XD_STRUCT_PTR, offsetof (console_type_entry, meths), 1, &console_methods_description },
{ XD_END }
};
static const struct struct_description cte_description = {
- sizeof(console_type_entry),
+ sizeof (console_type_entry),
cte_description_1
};
static const struct lrecord_description cted_description_1[] = {
- XD_DYNARR_DESC(console_type_entry_dynarr, &cte_description),
+ XD_DYNARR_DESC (console_type_entry_dynarr, &cte_description),
{ XD_END }
};
const struct struct_description cted_description = {
- sizeof(console_type_entry_dynarr),
+ sizeof (console_type_entry_dynarr),
cted_description_1
};
static const struct lrecord_description console_methods_description_1[] = {
- { XD_LISP_OBJECT, offsetof(struct console_methods, symbol), 2 },
- { XD_LISP_OBJECT, offsetof(struct console_methods, image_conversion_list), 1 },
+ { XD_LISP_OBJECT, offsetof (struct console_methods, symbol) },
+ { XD_LISP_OBJECT, offsetof (struct console_methods, predicate_symbol) },
+ { XD_LISP_OBJECT, offsetof (struct console_methods, image_conversion_list) },
{ XD_END }
};
const struct struct_description console_methods_description = {
- sizeof(struct console_methods),
+ sizeof (struct console_methods),
console_methods_description_1
};
static const struct lrecord_description console_slots_description_1[] = {
- { XD_LISP_OBJECT, 0, CONSOLE_SLOTS_COUNT },
+ { XD_LISP_OBJECT_ARRAY, 0, CONSOLE_SLOTS_COUNT },
{ XD_END }
};
*/ );
#ifdef HAVE_TTY
- /* ### Should this somehow go to TTY data? How do we make it
+ /* #### Should this somehow go to TTY data? How do we make it
accessible from Lisp, then? */
DEFVAR_CONSOLE_LOCAL ("tty-erase-char", tty_erase_char /*
The ERASE character as set by the user with stty.
/* Written by Chuck Thompson */
-#ifndef _XEMACS_DEBUG_H_
-#define _XEMACS_DEBUG_H_
+#ifndef INCLUDED_debug_h_
+#define INCLUDED_debug_h_
#define DEBUG_STDERR 1
#define DEBUG_ABORT 2
#endif /* !DEBUG_XEMACS */
-#endif /* _XEMACS_DEBUG_H_ */
+#endif /* INCLUDED_debug_h_ */
#include "frame.h"
#include "sysdep.h"
+#include <winspool.h>
+
/* win32 DDE management library globals */
#ifdef HAVE_DRAGNDROP
DWORD mswindows_dde_mlid;
/************************************************************************/
static Lisp_Object
-build_syscolor_string (int index)
+build_syscolor_string (int idx)
{
DWORD clr;
char buf[16];
- if (index < 0)
+ if (idx < 0)
return Qnil;
- clr = GetSysColor (index);
+ clr = GetSysColor (idx);
sprintf (buf, "#%02X%02X%02X",
GetRValue (clr),
GetGValue (clr),
index2 < 0 ? Qnil : make_int (GetSystemMetrics (index2)));
}
+static Lisp_Object
+build_devicecaps_cons (HDC hdc, int index1, int index2)
+{
+ return Fcons (index1 < 0 ? Qnil : make_int (GetDeviceCaps (hdc, index1)),
+ index2 < 0 ? Qnil : make_int (GetDeviceCaps (hdc, index2)));
+}
+
\f
/************************************************************************/
-/* methods */
+/* display methods */
/************************************************************************/
static void
DEVICE_MSWINDOWS_HORZSIZE(d) = GetDeviceCaps(hdc, HORZSIZE);
DEVICE_MSWINDOWS_VERTSIZE(d) = GetDeviceCaps(hdc, VERTSIZE);
DEVICE_MSWINDOWS_BITSPIXEL(d) = GetDeviceCaps(hdc, BITSPIXEL);
- DeleteDC (hdc);
+ DEVICE_MSWINDOWS_FONTLIST (d) = mswindows_enumerate_fonts (hdc);
- mswindows_enumerate_fonts (d);
+ DeleteDC (hdc);
/* Register the main window class */
wc.cbSize = sizeof (WNDCLASSEX);
RegisterClassEx (&wc);
#endif
-#ifdef HAVE_TOOLBARS
+#if defined (HAVE_TOOLBARS) || defined (HAVE_WIDGETS)
InitCommonControls ();
#endif
}
static void
mswindows_delete_device (struct device *d)
{
- struct mswindows_font_enum *fontlist, *next;
-
- fontlist = DEVICE_MSWINDOWS_FONTLIST (d);
- while (fontlist)
- {
- next = fontlist->next;
- free (fontlist);
- fontlist = next;
- }
-
#ifdef HAVE_DRAGNDROP
DdeNameService (mswindows_dde_mlid, 0L, 0L, DNS_REGISTER);
DdeUninitialize (mswindows_dde_mlid);
free (d->device_data);
}
+static void
+mswindows_mark_device (struct device *d)
+{
+ mark_object (DEVICE_MSWINDOWS_FONTLIST (d));
+}
+
static Lisp_Object
mswindows_device_system_metrics (struct device *d,
enum device_metrics m)
return Fcons (make_int (DEVICE_MSWINDOWS_HORZRES(d)),
make_int (DEVICE_MSWINDOWS_VERTRES(d)));
break;
+ case DM_device_dpi:
+ return Fcons (make_int (DEVICE_MSWINDOWS_LOGPIXELSX(d)),
+ make_int (DEVICE_MSWINDOWS_LOGPIXELSY(d)));
+ break;
case DM_size_device_mm:
return Fcons (make_int (DEVICE_MSWINDOWS_HORZSIZE(d)),
make_int (DEVICE_MSWINDOWS_VERTSIZE(d)));
\f
/************************************************************************/
+/* printer methods */
+/************************************************************************/
+
+static void
+signal_open_printer_error (struct device *d)
+{
+ signal_simple_error ("Failed to open printer", DEVICE_CONNECTION (d));
+}
+
+static void
+msprinter_init_device (struct device *d, Lisp_Object props)
+{
+ char* printer_name;
+
+ DEVICE_INFD (d) = DEVICE_OUTFD (d) = -1;
+
+ CHECK_STRING (DEVICE_CONNECTION (d));
+
+ TO_EXTERNAL_FORMAT (LISP_STRING, DEVICE_CONNECTION (d),
+ C_STRING_ALLOCA, printer_name,
+ Qctext);
+
+ d->device_data = xnew_and_zero (struct msprinter_device);
+
+ DEVICE_MSPRINTER_NAME(d) = xstrdup (printer_name);
+
+ if (!OpenPrinter (printer_name, &DEVICE_MSPRINTER_HPRINTER (d), NULL))
+ {
+ DEVICE_MSPRINTER_HPRINTER (d) = NULL;
+ signal_open_printer_error (d);
+ }
+
+ DEVICE_MSPRINTER_HDC (d) = CreateDC ("WINSPOOL", printer_name,
+ NULL, NULL);
+ if (DEVICE_MSPRINTER_HDC (d) == NULL)
+ signal_open_printer_error (d);
+
+ /* Determinie DEVMODE size and store the default DEVMODE */
+ DEVICE_MSPRINTER_DEVMODE_SIZE(d) =
+ DocumentProperties (NULL, DEVICE_MSPRINTER_HPRINTER(d),
+ printer_name, NULL, NULL, 0);
+ if (DEVICE_MSPRINTER_DEVMODE_SIZE(d) <= 0)
+ signal_open_printer_error (d);
+
+ DEVICE_MSPRINTER_DEVMODE(d) = xmalloc (DEVICE_MSPRINTER_DEVMODE_SIZE(d));
+ DocumentProperties (NULL, DEVICE_MSPRINTER_HPRINTER(d),
+ printer_name, DEVICE_MSPRINTER_DEVMODE(d),
+ NULL, DM_OUT_BUFFER);
+
+ /* We do not use printer fon list as we do with the display
+ device. Rather, we allow GDI to pick the closest match to the
+ display font. */
+ DEVICE_MSPRINTER_FONTLIST (d) = Qnil;
+
+ DEVICE_CLASS (d) = (GetDeviceCaps (DEVICE_MSPRINTER_HDC (d), BITSPIXEL)
+ * GetDeviceCaps (DEVICE_MSPRINTER_HDC (d), PLANES)
+ > 1) ? Qcolor : Qmono;
+}
+
+static Lisp_Object
+msprinter_device_system_metrics (struct device *d,
+ enum device_metrics m)
+{
+ switch (m)
+ {
+ /* Device sizes - pixel and mm */
+#define FROB(met, index1, index2) \
+ case DM_##met: \
+ return build_devicecaps_cons \
+ (DEVICE_MSPRINTER_HDC(d), index1, index2);
+
+ FROB (size_device, PHYSICALWIDTH, PHYSICALHEIGHT);
+ FROB (size_device_mm, HORZSIZE, VERTSIZE);
+ FROB (size_workspace, HORZRES, VERTRES);
+ FROB (offset_workspace, PHYSICALOFFSETX, PHYSICALOFFSETY);
+ FROB (device_dpi, LOGPIXELSX, LOGPIXELSY);
+#undef FROB
+
+ case DM_num_bit_planes:
+ /* this is what X means by bitplanes therefore we ought to be
+ consistent. num planes is always 1 under mswindows and
+ therefore useless */
+ return make_int (GetDeviceCaps (DEVICE_MSPRINTER_HDC(d), BITSPIXEL));
+
+ case DM_num_color_cells: /* Prnters are non-palette devices */
+ case DM_slow_device: /* Animation would be a really bad idea */
+ case DM_security: /* Not provided by windows */
+ return Qzero;
+ }
+
+ /* Do not know such property */
+ return Qunbound;
+}
+
+static void
+msprinter_delete_device (struct device *d)
+{
+ if (d->device_data)
+ {
+ if (DEVICE_MSPRINTER_HPRINTER (d))
+ ClosePrinter (DEVICE_MSPRINTER_HPRINTER (d));
+ if (DEVICE_MSPRINTER_HDC (d))
+ DeleteDC (DEVICE_MSPRINTER_HDC (d));
+ if (DEVICE_MSPRINTER_NAME (d))
+ free (DEVICE_MSPRINTER_NAME (d));
+ if (DEVICE_MSPRINTER_DEVMODE (d))
+ free (DEVICE_MSPRINTER_DEVMODE (d));
+ if (DEVICE_MSPRINTER_DEVMODE_MIRROR (d))
+ free (DEVICE_MSPRINTER_DEVMODE_MIRROR (d));
+
+ free (d->device_data);
+ }
+}
+
+static void
+msprinter_mark_device (struct device *d)
+{
+ mark_object (DEVICE_MSPRINTER_FONTLIST (d));
+}
+
+static unsigned int
+msprinter_device_implementation_flags (void)
+{
+ return ( XDEVIMPF_PIXEL_GEOMETRY
+ | XDEVIMPF_IS_A_PRINTER
+ | XDEVIMPF_NO_AUTO_REDISPLAY
+ | XDEVIMPF_FRAMELESS_OK );
+}
+
+\f
+/************************************************************************/
+/* printer external functions */
+/************************************************************************/
+
+/*
+ * Return a copy of default DEVMODE. The copy returned is in
+ * a static buffer which will be overwritten by next call.
+ */
+DEVMODE*
+msprinter_get_devmode_copy (struct device *d)
+{
+ assert (DEVICE_MSPRINTER_P (d));
+
+ if (DEVICE_MSPRINTER_DEVMODE_MIRROR(d) == NULL)
+ DEVICE_MSPRINTER_DEVMODE_MIRROR(d) =
+ xmalloc (DEVICE_MSPRINTER_DEVMODE_SIZE(d));
+
+ memcpy (DEVICE_MSPRINTER_DEVMODE_MIRROR(d),
+ DEVICE_MSPRINTER_DEVMODE(d),
+ DEVICE_MSPRINTER_DEVMODE_SIZE(d));
+
+ return DEVICE_MSPRINTER_DEVMODE_MIRROR(d);
+}
+
+/*
+ * Apply settings from the DEVMODE. The settings are considered
+ * incremental to the default DEVMODE, so that changes in the
+ * passed structure supercede parameters of the printer.
+ *
+ * The passed structure is overwritten by the fuction call;
+ * complete printer settings are returned.
+ */
+void
+msprinter_apply_devmode (struct device *d, DEVMODE *devmode)
+{
+ assert (DEVICE_MSPRINTER_P (d));
+
+ DocumentProperties (NULL,
+ DEVICE_MSPRINTER_HPRINTER(d),
+ DEVICE_MSPRINTER_NAME(d),
+ devmode, devmode,
+ DM_IN_BUFFER | DM_OUT_BUFFER);
+
+ ResetDC (DEVICE_MSPRINTER_HDC (d), devmode);
+}
+
+\f
+/************************************************************************/
/* initialization */
/************************************************************************/
{
CONSOLE_HAS_METHOD (mswindows, init_device);
CONSOLE_HAS_METHOD (mswindows, finish_init_device);
-/* CONSOLE_HAS_METHOD (mswindows, mark_device); */
+ CONSOLE_HAS_METHOD (mswindows, mark_device);
CONSOLE_HAS_METHOD (mswindows, delete_device);
CONSOLE_HAS_METHOD (mswindows, device_system_metrics);
CONSOLE_HAS_METHOD (mswindows, device_implementation_flags);
+
+ CONSOLE_HAS_METHOD (msprinter, init_device);
+ CONSOLE_HAS_METHOD (msprinter, mark_device);
+ CONSOLE_HAS_METHOD (msprinter, delete_device);
+ CONSOLE_HAS_METHOD (msprinter, device_system_metrics);
+ CONSOLE_HAS_METHOD (msprinter, device_implementation_flags);
}
+
void
vars_of_device_mswindows (void)
{
#include "sysfile.h"
#include "systime.h"
+#if defined(HAVE_DLOPEN) && defined(LWLIB_USES_ATHENA) && !defined(HAVE_ATHENA_3D)
+#include "sysdll.h"
+#endif /* HAVE_DLOPEN and LWLIB_USES_ATHENA and not HAVE_ATHENA_3D */
+
#ifdef HAVE_OFFIX_DND
#include "offix.h"
#endif
/* */
int best_visual_found = 0;
+#if defined(HAVE_DLOPEN) && defined(LWLIB_USES_ATHENA) && !defined(HAVE_ATHENA_3D)
+ /*
+ * In order to avoid the lossage with flat Athena widgets dynamically
+ * linking to one of the ThreeD variants, using the dynamic symbol helpers
+ * to look for symbols that shouldn't be there and refusing to run if they
+ * are seems a less toxic idea than having XEmacs crash when we try and
+ * use a subclass of a widget that has changed size.
+ *
+ * It's ugly, I know, and not going to work everywhere. It seems better to
+ * do our damnedest to try and tell the user what to expect rather than
+ * simply blow up though.
+ *
+ * All the ThreeD variants I have access to define the following function
+ * symbols in the shared library. The flat Xaw library does not define them:
+ *
+ * Xaw3dComputeBottomShadowRGB
+ * Xaw3dComputeTopShadowRGB
+ *
+ * So far only Linux has shown this problem. This seems to be portable to
+ * all the distributions (certainly all the ones I checked - Debian and
+ * Redhat)
+ *
+ * This will only work, sadly, with dlopen() -- the other dynamic linkers
+ * are simply not capable of doing what is needed. :/
+ */
+
+ {
+ /* Get a dll handle to the main process. */
+ dll_handle xaw_dll_handle = dll_open (NULL);
+
+ /* Did that fail? If so, continue without error.
+ * We could die here but, well, that's unfriendly and all -- plus I feel
+ * better about some crashing somewhere rather than preventing a perfectly
+ * good configuration working just because dll_open failed.
+ */
+ if (xaw_dll_handle != NULL)
+ {
+ /* Look for the Xaw3d function */
+ dll_func xaw_function_handle =
+ dll_function (xaw_dll_handle, "Xaw3dComputeTopShadowRGB");
+
+ /* If we found it, warn the user in big, nasty, unfriendly letters */
+ if (xaw_function_handle != NULL)
+ {
+ warn_when_safe (Qdevice, Qerror, "\n"
+"It seems that XEmacs is built dynamically linked to the flat Athena widget\n"
+"library but it finds a 3D Athena variant with the same name at runtime.\n"
+"\n"
+"This WILL cause your XEmacs process to dump core at some point.\n"
+"You should not continue to use this binary without resolving this issue.\n"
+"\n"
+"This can be solved with the xaw-wrappers package under Debian\n"
+"(register XEmacs as incompatible with all 3d widget sets, see\n"
+"update-xaw-wrappers(8) and .../doc/xaw-wrappers/README.packagers). It\n"
+"can be verified by checking the runtime path in /etc/ld.so.conf and by\n"
+"using `ldd /path/to/xemacs' under other Linux distributions. One\n"
+"solution is to use LD_PRELOAD or LD_LIBRARY_PATH to force ld.so to\n"
+"load the flat Athena widget library instead of the aliased 3D widget\n"
+"library (see ld.so(8) for use of these environment variables).\n\n"
+ );
+
+ }
+
+ /* Otherwise release the handle to the library
+ * No error catch here; I can't think of a way to recover anyhow.
+ */
+ dll_close (xaw_dll_handle);
+ }
+ }
+#endif /* HAVE_DLOPEN and LWLIB_USES_ATHENA and not HAVE_ATHENA_3D */
+
+
XSETDEVICE (device, d);
display = DEVICE_CONNECTION (d);
make_argc_argv (Vx_initial_argv_list, &argc, &argv);
- GET_C_STRING_CTEXT_DATA_ALLOCA (display, disp_name);
+ TO_EXTERNAL_FORMAT (LISP_STRING, display,
+ C_STRING_ALLOCA, disp_name,
+ Qctext);
/*
* Break apart the old XtOpenDisplay call into XOpenDisplay and
if (STRINGP (Vx_emacs_application_class) &&
XSTRING_LENGTH (Vx_emacs_application_class) > 0)
- GET_C_STRING_CTEXT_DATA_ALLOCA (Vx_emacs_application_class, app_class);
+ TO_EXTERNAL_FORMAT (LISP_STRING, Vx_emacs_application_class,
+ C_STRING_ALLOCA, app_class,
+ Qctext);
else
{
app_class = (NILP (Vx_emacs_application_class) &&
if (STRINGP (Vx_app_defaults_directory) &&
XSTRING_LENGTH (Vx_app_defaults_directory) > 0)
{
- GET_C_STRING_FILENAME_DATA_ALLOCA(Vx_app_defaults_directory, data_dir);
+ TO_EXTERNAL_FORMAT (LISP_STRING, Vx_app_defaults_directory,
+ C_STRING_ALLOCA, data_dir,
+ Qfile_name);
path = (char *)alloca (strlen (data_dir) + strlen (locale) + 7);
sprintf (path, "%s%s/Emacs", data_dir, locale);
if (!access (path, R_OK))
}
else if (STRINGP (Vdata_directory) && XSTRING_LENGTH (Vdata_directory) > 0)
{
- GET_C_STRING_FILENAME_DATA_ALLOCA (Vdata_directory, data_dir);
+ TO_EXTERNAL_FORMAT (LISP_STRING, Vdata_directory,
+ C_STRING_ALLOCA, data_dir,
+ Qfile_name);
path = (char *)alloca (strlen (data_dir) + 13 + strlen (locale) + 7);
sprintf (path, "%sapp-defaults/%s/Emacs", data_dir, locale);
if (!access (path, R_OK))
else
{
/* We have to create a matching colormap anyway...
- ### think about using standard colormaps (need the Xmu libs?) */
+ #### think about using standard colormaps (need the Xmu libs?) */
cmap = XCreateColormap(dpy, RootWindow(dpy, screen), visual, AllocNone);
XInstallColormap(dpy, cmap);
}
DEVICE_X_GC_CACHE (d) = make_gc_cache (dpy, XtWindow(app_shell));
DEVICE_X_GRAY_PIXMAP (d) = None;
Xatoms_of_device_x (d);
- Xatoms_of_xselect (d);
+ Xatoms_of_select_x (d);
Xatoms_of_objects_x (d);
x_init_device_class (d);
CONST char *keysym_ext;
CHECK_STRING (keysym);
- GET_C_STRING_CTEXT_DATA_ALLOCA (keysym, keysym_ext);
+ TO_EXTERNAL_FORMAT (LISP_STRING, keysym,
+ C_STRING_ALLOCA, keysym_ext,
+ Qctext);
return XStringToKeysym (keysym_ext) ? Qt : Qnil;
}
DEFUN ("x-keysym-hash-table", Fx_keysym_hash_table, 0, 1, 0, /*
-Return a hash table which contains a hash key for all keysyms which
-name keys on the keyboard. See `x-keysym-on-keyboard-p'.
+Return a hash table containing a key for all keysyms on DEVICE.
+DEVICE must be an X11 display device. See `x-keysym-on-keyboard-p'.
*/
(device))
{
while (ndirs_return--)
font_path = Fcons (build_ext_string (directories[ndirs_return],
- FORMAT_FILENAME), font_path);
+ Qfile_name),
+ font_path);
return font_path;
}
EXTERNAL_LIST_LOOP (path_entry, font_path)
{
- GET_C_STRING_FILENAME_DATA_ALLOCA (XCAR (path_entry), directories[i++]);
+ TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (path_entry),
+ C_STRING_ALLOCA, directories[i++],
+ Qfile_name);
}
expect_x_error (dpy);
Qfont_menubar, Qfont_dialog, Qsize_cursor, Qsize_scrollbar,
Qsize_menu, Qsize_toolbar, Qsize_toolbar_button,
Qsize_toolbar_border, Qsize_icon, Qsize_icon_small, Qsize_device,
- Qsize_workspace, Qsize_device_mm, Qdevice_dpi, Qnum_bit_planes,
- Qnum_color_cells, Qmouse_buttons, Qswap_buttons, Qshow_sounds,
- Qslow_device, Qsecurity;
+ Qsize_workspace, Qoffset_workspace, Qsize_device_mm, Qdevice_dpi,
+ Qnum_bit_planes, Qnum_color_cells, Qmouse_buttons, Qswap_buttons,
+ Qshow_sounds, Qslow_device, Qsecurity;
Lisp_Object Qdevicep, Qdevice_live_p;
Lisp_Object Qcreate_device_hook;
sprintf (buf, "#<%s-device", !DEVICE_LIVE_P (d) ? "dead" :
DEVICE_TYPE_NAME (d));
write_c_string (buf, printcharfun);
- if (DEVICE_LIVE_P (d))
+ if (DEVICE_LIVE_P (d) && !NILP (DEVICE_CONNECTION (d)))
{
write_c_string (" on ", printcharfun);
print_internal (DEVICE_CONNECTION (d), printcharfun, 1);
semi_canonicalize_device_connection (struct console_methods *meths,
Lisp_Object name, Error_behavior errb)
{
- return CONTYPE_METH_OR_GIVEN (meths, semi_canonicalize_device_connection,
- (name, errb), name);
+ if (HAS_CONTYPE_METH_P (meths, semi_canonicalize_device_connection))
+ return CONTYPE_METH (meths, semi_canonicalize_device_connection,
+ (name, errb));
+ else
+ return CONTYPE_METH_OR_GIVEN (meths, canonicalize_device_connection,
+ (name, errb), name);
}
static Lisp_Object
canonicalize_device_connection (struct console_methods *meths,
Lisp_Object name, Error_behavior errb)
{
- return CONTYPE_METH_OR_GIVEN (meths, canonicalize_device_connection,
- (name, errb), name);
+ if (HAS_CONTYPE_METH_P (meths, canonicalize_device_connection))
+ return CONTYPE_METH (meths, canonicalize_device_connection,
+ (name, errb));
+ else
+ return CONTYPE_METH_OR_GIVEN (meths, semi_canonicalize_device_connection,
+ (name, errb), name);
}
static Lisp_Object
return make_int (DEVICE_BAUD_RATE (decode_device (device)));
}
+DEFUN ("device-printer-p", Fdevice_printer_p, 0, 1, 0, /*
+Return t if DEVICE is a printer, nil if it is a display. DEVICE defaults
+to selected device if omitted, and must be live if specified.
+*/
+ (device))
+{
+ return (MAYBE_INT_DEVMETH (decode_device (device),
+ device_implementation_flags, ())
+ & XDEVIMPF_IS_A_PRINTER) ? Qt : Qnil;
+}
+
DEFUN ("device-system-metric", Fdevice_system_metric, 1, 3, 0, /*
Get a metric for DEVICE as provided by the system.
size-toolbar-border Toolbar border width and height.
size-icon Icon dimensions.
size-icon-small Small icon dimensions.
-size-device Device screen size in pixels.
-size-workspace Workspace size in pixels. This can be less than the
- above if window manager has decorations which
- effectively shrink the area remaining for application
- windows.
+size-device Device screen or paper size in pixels.
+size-workspace Workspace size in pixels. This can be less than or
+ equal to the above. For diplays, this is the area
+ available to applications less window manager
+ decorations. For printers, this is the size of
+ printable area.
+offset-workspace Offset of workspace area from the top left corner
+ of screen or paper.
size-device-mm Device screen size in millimeters.
device-dpi Device resolution, in dots per inch.
num-bit-planes Integer, number of device bit planes.
FROB (size_icon_small);
FROB (size_device);
FROB (size_workspace);
+ FROB (offset_workspace);
FROB (size_device_mm);
FROB (device_dpi);
FROB (num_bit_planes);
FROB (size_icon_small);
FROB (size_device);
FROB (size_workspace);
+ FROB (offset_workspace);
FROB (size_device_mm);
FROB (device_dpi);
FROB (num_bit_planes);
DEFSUBR (Fset_device_baud_rate);
DEFSUBR (Fdevice_baud_rate);
DEFSUBR (Fdomain_device_type);
+ DEFSUBR (Fdevice_printer_p);
defsymbol (&Qdevicep, "devicep");
defsymbol (&Qdevice_live_p, "device-live-p");
defsymbol (&Qsize_icon_small, "size-icon-small");
defsymbol (&Qsize_device, "size-device");
defsymbol (&Qsize_workspace, "size-workspace");
+ defsymbol (&Qoffset_workspace, "offset-workspace");
defsymbol (&Qsize_device_mm, "size-device-mm");
defsymbol (&Qnum_bit_planes, "num-bit-planes");
defsymbol (&Qnum_color_cells, "num-color-cells");
/* Written by Chuck Thompson and Ben Wing. */
-#ifndef _XEMACS_DEVICE_H_
-#define _XEMACS_DEVICE_H_
+#ifndef INCLUDED_device_h_
+#define INCLUDED_device_h_
#include "console.h"
Lisp_Object domain_device_type (Lisp_Object domain);
int window_system_pixelated_geometry (Lisp_Object domain);
-#endif /* _XEMACS_DEVICE_H_ */
+#endif /* INCLUDED_device_h_ */
Charcount length = XSTRING_CHAR_LENGTH (string);
LPWSTR uni_string;
- GET_C_CHARPTR_EXT_DATA_ALLOCA (XSTRING_DATA (string),
- FORMAT_OS, mbcs_string);
+ TO_EXTERNAL_FORMAT (LISP_STRING, string,
+ C_STRING_ALLOCA, mbcs_string,
+ Qnative);
uni_string = alloca_array (WCHAR, length + 1);
length = MultiByteToWideChar (CP_ACP, 0, mbcs_string, -1,
uni_string, sizeof(WCHAR) * (length + 1));
for (i = 0; i < Dynarr_length (dialog_items); ++i)
{
Lisp_Object* gui_item = Dynarr_atp (dialog_items, i);
- struct Lisp_Gui_Item *pgui_item = XGUI_ITEM (*gui_item);
+ Lisp_Gui_Item *pgui_item = XGUI_ITEM (*gui_item);
item_tem.style = (WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON
| (gui_item_active_p (*gui_item) ? 0 : WS_DISABLED));
#include "buffer.h"
#include "regex.h"
-#include "sysdir.h"
#include "sysfile.h"
+#include "sysdir.h"
#include "sysproc.h"
-#include <windows.h>
#include <limits.h>
#include <time.h>
(user))
{
int uniq;
- Lisp_Object completed;
-
- completed = user_name_completion (user, 0, &uniq);
+ Lisp_Object completed = user_name_completion (user, 0, &uniq);
return Fcons (completed, uniq ? Qt : Qnil);
}
return user_name_completion (user, 1, NULL);
}
-struct user_cache {
- Bufbyte **data;
+struct user_name
+{
+ Bufbyte *ptr;
+ size_t len;
+};
+
+struct user_cache
+{
+ struct user_name *user_names;
int length;
int size;
EMACS_TIME last_rebuild_time;
{
int i;
for (i = 0; i < cache->length; i++)
- xfree (cache->data[i]);
- xfree (cache->data);
+ xfree (cache->user_names[i].ptr);
+ xfree (cache->user_names);
+ xzero (*cache);
}
static Lisp_Object
-user_name_completion_unwind (Lisp_Object locative)
+user_name_completion_unwind (Lisp_Object cache_incomplete_p)
{
- int interrupted = !NILP (XCAR (locative));
+ endpwent ();
+ speed_up_interrupts ();
- if (interrupted)
- {
- endpwent ();
- speed_up_interrupts ();
- free_user_cache (&user_cache);
- }
- free_cons (XCONS (locative));
+ if (! NILP (XCAR (cache_incomplete_p)))
+ free_user_cache (&user_cache);
+
+ free_cons (XCONS (cache_incomplete_p));
return Qnil;
}
-#define USER_CACHE_REBUILD (24*60*60) /* 1 day, in seconds */
+#define USER_CACHE_TTL (24*60*60) /* Time to live: 1 day, in seconds */
static Lisp_Object
user_name_completion (Lisp_Object user, int all_flag, int *uniq)
int matchcount = 0;
Lisp_Object bestmatch = Qnil;
Charcount bestmatchsize = 0;
- int speccount = specpdl_depth ();
Charcount user_name_length;
EMACS_TIME t;
int i;
/* Cache user name lookups because it tends to be quite slow.
* Rebuild the cache occasionally to catch changes */
EMACS_GET_TIME (t);
- if (user_cache.data &&
+ if (user_cache.user_names &&
(EMACS_SECS (t) - EMACS_SECS (user_cache.last_rebuild_time)
- > USER_CACHE_REBUILD))
- {
- free_user_cache (&user_cache);
- xzero (user_cache);
- }
+ > USER_CACHE_TTL))
+ free_user_cache (&user_cache);
- if (!user_cache.data)
+ if (!user_cache.user_names)
{
struct passwd *pwd;
- Lisp_Object locative = noseeum_cons (Qt, Qnil);
+ Lisp_Object cache_incomplete_p = noseeum_cons (Qt, Qnil);
+ int speccount = specpdl_depth ();
+
slow_down_interrupts ();
setpwent ();
- record_unwind_protect (user_name_completion_unwind, locative);
+ record_unwind_protect (user_name_completion_unwind, cache_incomplete_p);
while ((pwd = getpwent ()))
{
- Bufbyte *pwuser;
QUIT;
- DO_REALLOC (user_cache.data, user_cache.size,
- user_cache.length + 1, Bufbyte *);
- GET_C_CHARPTR_INT_DATA_ALLOCA (pwd->pw_name, FORMAT_OS, pwuser);
- user_cache.data[user_cache.length++] =
- (Bufbyte *) xstrdup ((char *) pwuser);
+ DO_REALLOC (user_cache.user_names, user_cache.size,
+ user_cache.length + 1, struct user_name);
+ TO_INTERNAL_FORMAT (C_STRING, pwd->pw_name,
+ MALLOC,
+ (user_cache.user_names[user_cache.length].ptr,
+ user_cache.user_names[user_cache.length].len),
+ Qnative);
+ user_cache.length++;
}
- endpwent ();
- speed_up_interrupts ();
- XCAR (locative) = Qnil;
- unbind_to (speccount, Qnil); /* free locative cons */
+ XCAR (cache_incomplete_p) = Qnil;
+ unbind_to (speccount, Qnil);
+
EMACS_GET_TIME (user_cache.last_rebuild_time);
}
for (i = 0; i < user_cache.length; i++)
{
- Bufbyte *u_name = user_cache.data[i];
- Bytecount len = strlen ((char *) u_name);
+ Bufbyte *u_name = user_cache.user_names[i].ptr;
+ Bytecount len = user_cache.user_names[i].len;
/* scmp() works in chars, not bytes, so we have to compute this: */
Charcount cclen = bytecount_to_charcount (u_name, len);
}
/* #### mrb: following STILL completely broken */
- return_me = make_ext_string ((Bufbyte *) buffer, to - buffer, FORMAT_BINARY);
+ return_me = make_ext_string ((Bufbyte *) buffer, to - buffer, Qbinary);
done:
if (buffer != buf) /* We must have allocated buffer above */
else if (COMPILED_FUNCTIONP (fun))
{
Lisp_Object tem;
- struct Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
+ Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
if (! (f->flags.documentationp))
return Qnil;
tem = compiled_function_documentation (f);
{
/* Compiled-Function objects sometimes have
slots for it. */
- struct Lisp_Compiled_Function *f =
- XCOMPILED_FUNCTION (fun);
+ Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
/* This compiled-function object must have a
slot for the docstring, since we've found a
kludgily_ignore_lost_doc_p (Lisp_Object sym)
{
# define kludge_prefix "ad-Orig-"
- struct Lisp_String *name = XSYMBOL (sym)->name;
+ Lisp_String *name = XSYMBOL (sym)->name;
return (string_length (name) > (Bytecount) (sizeof (kludge_prefix)) &&
!strncmp ((char *) string_data (name), kludge_prefix,
sizeof (kludge_prefix) - 1));
}
else if (COMPILED_FUNCTIONP (fun))
{
- struct Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
+ Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
if (! (f->flags.documentationp))
doc = -1;
else
case '{':
case '<':
{
- /* ### jump to label `subst_string|subst' crosses
+ /* #### jump to label `subst_string|subst' crosses
initialization of `buffer|_buf' */
Lisp_Object buffer;
struct buffer *buf_;
/* Synched up with: Not in FSF. */
-#ifndef _XEMACS_DRAGDROP_H_
-#define _XEMACS_DRAGDROP_H_
+#ifndef INCLUDED_dragdrop_h_
+#define INCLUDED_dragdrop_h_
/* Drag'n'Drop data types known by XEmacs */
extern Lisp_Object Qdragdrop_MIME;
/* emacs interface */
void syms_of_dragdrop (void);
-#endif /* _XEMACS_DRAGDROP_H_ */
+#endif /* INCLUDED_dragdrop_h_ */
Use the following global variable:
Dynarr_min_size
- Minimum allowable size for a dynamic array when it is resized. The
- default is 32 and does not normally need to be changed.
+ Minimum allowable size for a dynamic array when it is resized.
*/
#include <config.h>
#include "lisp.h"
-int Dynarr_min_size = 1;
+static int Dynarr_min_size = 8;
static void
Dynarr_realloc (Dynarr *dy, int new_size)
if ((p = getenv ("NAME")))
/* I don't think it's the right thing to do the ampersand
modification on NAME. Not that it matters anymore... -hniksic */
- Vuser_full_name = build_ext_string (p, FORMAT_OS);
+ Vuser_full_name = build_ext_string (p, Qnative);
else
Vuser_full_name = Fuser_full_name (Qnil);
}
*/
(str))
{
- struct Lisp_String *p;
+ Lisp_String *p;
CHECK_STRING (str);
p = XSTRING (str);
tmpdir = "/tmp";
#endif
- return build_ext_string (tmpdir, FORMAT_FILENAME);
+ return build_ext_string (tmpdir, Qfile_name);
}
DEFUN ("user-login-name", Fuser_login_name, 0, 1, 0, /*
/* Fuck me. getpwnam() can call select() and (under IRIX at least)
things get wedged if a SIGIO arrives during this time. */
- GET_C_STRING_OS_DATA_ALLOCA (user_name, user_name_ext);
+ TO_EXTERNAL_FORMAT (LISP_STRING, user_name,
+ C_STRING_ALLOCA, user_name_ext,
+ Qnative);
slow_down_interrupts ();
pw = (struct passwd *) getpwnam (user_name_ext);
speed_up_interrupts ();
tem = ((!NILP (user) && !pw)
? Qnil
: make_ext_string ((Extbyte *) p, (q ? q - p : strlen (p)),
- FORMAT_OS));
+ Qnative));
#ifdef AMPERSAND_FULL_NAME
if (!NILP (tem))
return tem;
}
-static char *cached_home_directory;
+static Extbyte *cached_home_directory;
void
uncache_home_directory (void)
}
/* Returns the home directory, in external format */
-char *
+Extbyte *
get_home_directory (void)
{
int output_home_warning = 0;
if (cached_home_directory == NULL)
{
- if ((cached_home_directory = getenv("HOME")) == NULL)
+ if ((cached_home_directory = (Extbyte *) getenv("HOME")) == NULL)
{
#if defined(WINDOWSNT) && !defined(__CYGWIN32__)
- char *homedrive, *homepath;
+ char *homedrive, *homepath;
if ((homedrive = getenv("HOMEDRIVE")) != NULL &&
(homepath = getenv("HOMEPATH")) != NULL)
{
cached_home_directory =
- (char *) xmalloc(strlen(homedrive) + strlen(homepath) + 1);
- sprintf(cached_home_directory, "%s%s", homedrive, homepath);
+ (Extbyte *) xmalloc (strlen (homedrive) +
+ strlen (homepath) + 1);
+ sprintf((char *) cached_home_directory, "%s%s",
+ homedrive,
+ homepath);
}
else
{
/*
* This is NT Emacs behavior
*/
- cached_home_directory = "C:\\";
+ cached_home_directory = (Extbyte *) "C:\\";
output_home_warning = 1;
# endif
}
* We probably should try to extract pw_dir from /etc/passwd,
* before falling back to this.
*/
- cached_home_directory = "/";
+ cached_home_directory = (Extbyte *) "/";
output_home_warning = 1;
#endif /* !WINDOWSNT */
}
*/
())
{
- char *path = get_home_directory ();
+ Extbyte *path = get_home_directory ();
return path == NULL ? Qnil :
Fexpand_file_name (Fsubstitute_in_file_name
- (build_ext_string (path, FORMAT_FILENAME)),
+ (build_ext_string ((char *) path, Qfile_name)),
Qnil);
}
(CONST char *) XSTRING_DATA (format_string),
localtime (&value))
|| !*buf)
- return build_ext_string (buf, FORMAT_BINARY);
+ return build_ext_string (buf, Qbinary);
/* If buffer was too small, make it bigger. */
size *= 2;
}
strncpy (buf, tem, 24);
buf[24] = 0;
- return build_ext_string (buf, FORMAT_BINARY);
+ return build_ext_string (buf, Qbinary);
}
#define TM_YEAR_ORIGIN 1900
mc_count = begin_multiple_change (buf, pos, stop);
if (STRINGP (table))
{
- struct Lisp_String *stable = XSTRING (table);
+ Lisp_String *stable = XSTRING (table);
Charcount size = string_char_length (stable);
#ifdef MULE
/* Under Mule, string_char(n) is O(n), so for large tables or
&& (XCHAR_TABLE_TYPE (table) == CHAR_TABLE_TYPE_GENERIC
|| XCHAR_TABLE_TYPE (table) == CHAR_TABLE_TYPE_CHAR))
{
- struct Lisp_Char_Table *ctable = XCHAR_TABLE (table);
+ Lisp_Char_Table *ctable = XCHAR_TABLE (table);
for (; pos < stop && (oc = BUF_FETCH_CHAR (buf, pos), 1); pos++)
{
/************************************************************************/
static Lisp_Object
-make_ldap (struct Lisp_LDAP *ldap)
+make_ldap (Lisp_LDAP *ldap)
{
Lisp_Object lisp_ldap;
XSETLDAP (lisp_ldap, ldap);
{
char buf[32];
- struct Lisp_LDAP *ldap = XLDAP (obj);
+ Lisp_LDAP *ldap = XLDAP (obj);
if (print_readably)
error ("printing unreadable object #<ldap %s>",
write_c_string (buf, printcharfun);
}
-static struct Lisp_LDAP *
+static Lisp_LDAP *
allocate_ldap (void)
{
- struct Lisp_LDAP *ldap =
- alloc_lcrecord_type (struct Lisp_LDAP, &lrecord_ldap);
+ Lisp_LDAP *ldap = alloc_lcrecord_type (Lisp_LDAP, &lrecord_ldap);
ldap->ld = NULL;
ldap->host = Qnil;
static void
finalize_ldap (void *header, int for_disksave)
{
- struct Lisp_LDAP *ldap = (struct Lisp_LDAP *) header;
+ Lisp_LDAP *ldap = (Lisp_LDAP *) header;
if (for_disksave)
signal_simple_error ("Can't dump an emacs containing LDAP objects",
DEFINE_LRECORD_IMPLEMENTATION ("ldap", ldap,
mark_ldap, print_ldap, finalize_ldap,
- NULL, NULL, 0, struct Lisp_LDAP);
+ NULL, NULL, 0, Lisp_LDAP);
(host, plist))
{
/* This function can GC */
- struct Lisp_LDAP *ldap;
+ Lisp_LDAP *ldap;
LDAP *ld;
int ldap_port = 0;
int ldap_auth = LDAP_AUTH_SIMPLE;
else if (EQ (keyword, Qbinddn))
{
CHECK_STRING (value);
- GET_C_STRING_OS_DATA_ALLOCA (value, ldap_binddn);
+ TO_EXTERNAL_FORMAT (LISP_STRING, value,
+ C_STRING_ALLOCA, ldap_binddn,
+ Qnative);
}
/* Password */
else if (EQ (keyword, Qpasswd))
{
CHECK_STRING (value);
- GET_C_STRING_OS_DATA_ALLOCA (value, ldap_passwd);
+ TO_EXTERNAL_FORMAT (LISP_STRING, value,
+ C_STRING_ALLOCA, ldap_passwd,
+ Qnative);
}
/* Deref */
else if (EQ (keyword, Qderef))
*/
(ldap))
{
- struct Lisp_LDAP *lldap;
+ Lisp_LDAP *lldap;
CHECK_LIVE_LDAP (ldap);
lldap = XLDAP (ldap);
ldap_unbind (lldap->ld);
{
Lisp_Object current = XCAR (attrs);
CHECK_STRING (current);
- GET_C_STRING_OS_DATA_ALLOCA (current, ldap_attributes[i]);
+ TO_EXTERNAL_FORMAT (LISP_STRING, current,
+ C_STRING_ALLOCA, ldap_attributes[i],
+ Qnative);
++i;
}
ldap_attributes[i] = NULL;
dn = ldap_get_dn (ld, e);
if (dn == NULL)
signal_ldap_error (ld, e, 0);
- entry = Fcons (build_ext_string (dn, FORMAT_OS), Qnil);
+ entry = Fcons (build_ext_string (dn, Qnative), Qnil);
}
for (a= ldap_first_attribute (ld, e, &ptr);
a != NULL;
a = ldap_next_attribute (ld, e, ptr) )
{
- list = Fcons (build_ext_string (a, FORMAT_OS), Qnil);
+ list = Fcons (build_ext_string (a, Qnative), Qnil);
unwind.vals = ldap_get_values_len (ld, e, a);
if (unwind.vals != NULL)
{
{
list = Fcons (make_ext_string (unwind.vals[i]->bv_val,
unwind.vals[i]->bv_len,
- FORMAT_OS),
+ Qnative),
list);
}
}
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#ifndef _XEMACS_ELDAP_H_
-#define _XEMACS_ELDAP_H_
+#ifndef INCLUDED_eldap_h_
+#define INCLUDED_eldap_h_
#include <lber.h>
#include <ldap.h>
/* Name of the host we connected to */
Lisp_Object host;
};
+typedef struct Lisp_LDAP Lisp_LDAP;
-DECLARE_LRECORD (ldap, struct Lisp_LDAP);
-#define XLDAP(x) XRECORD (x, ldap, struct Lisp_LDAP)
+DECLARE_LRECORD (ldap, Lisp_LDAP);
+#define XLDAP(x) XRECORD (x, ldap, Lisp_LDAP)
#define XSETLDAP(x, p) XSETRECORD (x, p, ldap)
#define LDAPP(x) RECORDP (x, ldap)
#define CHECK_LDAP(x) CHECK_RECORD (x, ldap)
Lisp_Object attrsonly,
Lisp_Object withdn);
-#endif /* _XEMACS_ELDAP_H_ */
+#endif /* INCLUDED_eldap_h_ */
Lisp_Object next_weak; /* Used to chain together all of the weak
hash tables. Don't mark through this. */
};
-typedef struct Lisp_Hash_Table Lisp_Hash_Table;
#define HENTRY_CLEAR_P(hentry) ((*(EMACS_UINT*)(&((hentry)->key))) == 0)
#define CLEAR_HENTRY(hentry) \
}
static const struct lrecord_description hentry_description_1[] = {
- { XD_LISP_OBJECT, offsetof(hentry, key), 2 },
+ { XD_LISP_OBJECT, offsetof (hentry, key) },
+ { XD_LISP_OBJECT, offsetof (hentry, value) },
{ XD_END }
};
static const struct struct_description hentry_description = {
- sizeof(hentry),
+ sizeof (hentry),
hentry_description_1
};
const struct lrecord_description hash_table_description[] = {
- { XD_SIZE_T, offsetof(Lisp_Hash_Table, size) },
- { XD_STRUCT_PTR, offsetof(Lisp_Hash_Table, hentries), XD_INDIRECT(0, 1), &hentry_description },
- { XD_LO_LINK, offsetof(Lisp_Hash_Table, next_weak) },
+ { XD_SIZE_T, offsetof (Lisp_Hash_Table, size) },
+ { XD_STRUCT_PTR, offsetof (Lisp_Hash_Table, hentries), XD_INDIRECT(0, 1), &hentry_description },
+ { XD_LO_LINK, offsetof (Lisp_Hash_Table, next_weak) },
{ XD_END }
};
static void
resize_hash_table (Lisp_Hash_Table *ht, size_t new_size)
{
- hentry *old_entries, *new_entries, *old_sentinel, *new_sentinel, *e;
+ hentry *old_entries, *new_entries, *sentinel, *e;
size_t old_size;
old_size = ht->size;
old_entries = ht->hentries;
- ht->hentries = xnew_array (hentry, new_size + 1);
+ ht->hentries = xnew_array_and_zero (hentry, new_size + 1);
new_entries = ht->hentries;
- old_sentinel = old_entries + old_size;
- new_sentinel = new_entries + new_size;
-
- for (e = new_entries; e <= new_sentinel; e++)
- CLEAR_HENTRY (e);
-
compute_hash_table_derived_values (ht);
- for (e = old_entries; e < old_sentinel; e++)
+ for (e = old_entries, sentinel = e + old_size; e < sentinel; e++)
if (!HENTRY_CLEAR_P (e))
{
hentry *probe = new_entries + HASH_CODE (e->key, ht);
xfree (old_entries);
}
+/* After a hash table has been saved to disk and later restored by the
+ portable dumper, it contains the same objects, but their addresses
+ and thus their HASH_CODEs have changed. */
void
-reorganize_hash_table (Lisp_Hash_Table *ht)
+pdump_reorganize_hash_table (Lisp_Object hash_table)
{
- resize_hash_table (ht, ht->size);
+ CONST Lisp_Hash_Table *ht = xhash_table (hash_table);
+ hentry *new_entries = xnew_array_and_zero (hentry, ht->size + 1);
+ hentry *e, *sentinel;
+
+ for (e = ht->hentries, sentinel = e + ht->size; e < sentinel; e++)
+ if (!HENTRY_CLEAR_P (e))
+ {
+ hentry *probe = new_entries + HASH_CODE (e->key, ht);
+ LINEAR_PROBING_LOOP (probe, new_entries, ht->size)
+ ;
+ *probe = *e;
+ }
+
+ memcpy (ht->hentries, new_entries, ht->size * sizeof (hentry));
+
+ xfree (new_entries);
}
static void
/* Synched up with: Not in FSF. */
-#ifndef _XEMACS_ELHASH_H_
-#define _XEMACS_ELHASH_H_
+#ifndef INCLUDED_elhash_h_
+#define INCLUDED_elhash_h_
-DECLARE_LRECORD (hash_table, struct Lisp_Hash_Table);
+typedef struct Lisp_Hash_Table Lisp_Hash_Table;
-#define XHASH_TABLE(x) XRECORD (x, hash_table, struct Lisp_Hash_Table)
+DECLARE_LRECORD (hash_table, Lisp_Hash_Table);
+
+#define XHASH_TABLE(x) XRECORD (x, hash_table, Lisp_Hash_Table)
#define XSETHASH_TABLE(x, p) XSETRECORD (x, p, hash_table)
#define HASH_TABLEP(x) RECORDP (x, hash_table)
#define CHECK_HASH_TABLE(x) CHECK_RECORD (x, hash_table)
typedef int (*maphash_function_t) (Lisp_Object key, Lisp_Object value,
void* extra_arg);
-struct Lisp_Hash_Table;
-
Lisp_Object make_general_lisp_hash_table (enum hash_table_test test,
size_t size,
double rehash_size,
int finish_marking_weak_hash_tables (void);
void prune_weak_hash_tables (void);
-void reorganize_hash_table (struct Lisp_Hash_Table *ht);
+void pdump_reorganize_hash_table (Lisp_Object);
-#endif /* _XEMACS_ELHASH_H_ */
+#endif /* INCLUDED_elhash_h_ */
* not previously loaded.
*/
if (modules == (emodules_list *)0)
- modules = (emodules_list *)xmalloc (sizeof(emodules_list));
+ modules = (emodules_list *) xmalloc (sizeof (emodules_list));
modnum++;
- modules = (emodules_list *) xrealloc (modules, modnum * sizeof(emodules_list));
+ modules = (emodules_list *) xrealloc (modules, modnum * sizeof (emodules_list));
fs = modnum - 1;
memset (&modules[fs], 0, sizeof(emodules_list));
{
Bytecount len = strlen (symname);
Lisp_Object sym = oblookup (Vobarray, (CONST Bufbyte *)symname, len);
- struct Lisp_Subr *subr;
+ Lisp_Subr *subr;
if (SYMBOLP(sym))
{
#endif /* EMODULES_GATHER_VERSION */
#endif /* EMODULES_HDR */
-
}
static const struct lrecord_description subr_description[] = {
- { XD_DOC_STRING, offsetof(Lisp_Subr, doc) },
+ { XD_DOC_STRING, offsetof (Lisp_Subr, doc) },
{ XD_END }
};
static Lisp_Object
condition_bind_unwind (Lisp_Object loser)
{
- struct Lisp_Cons *victim;
+ Lisp_Cons *victim;
/* ((handler-fun . handler-args) ... other handlers) */
Lisp_Object tem = XCAR (loser);
static Lisp_Object
condition_case_unwind (Lisp_Object loser)
{
- struct Lisp_Cons *victim;
+ Lisp_Cons *victim;
/* ((<unbound> . clauses) ... other handlers */
victim = XCONS (XCAR (loser));
/* Attempt to avoid consing identical (string=) pure strings. */
file = Fsymbol_name (Fintern (file, Qnil));
}
-
+
return Ffset (function, Fcons (Qautoload, list4 (file,
docstring,
interactive,
else
{
wrong_number_of_arguments:
- val = signal_wrong_number_of_arguments_error (fun, nargs);
+ val = signal_wrong_number_of_arguments_error (original_fun, nargs);
}
}
else if (COMPILED_FUNCTIONP (fun))
{
Lisp_Object current = Fcurrent_buffer ();
Lisp_Object symbol = specpdl_ptr->symbol;
- struct Lisp_Cons *victim = XCONS (ovalue);
+ Lisp_Cons *victim = XCONS (ovalue);
Lisp_Object buf = get_buffer (victim->car, 0);
ovalue = victim->cdr;
{
/* We checked symbol for validity when we specbound it,
so only need to call Fset if symbol has magic value. */
- struct Lisp_Symbol *sym = XSYMBOL (specpdl_ptr->symbol);
+ Lisp_Symbol *sym = XSYMBOL (specpdl_ptr->symbol);
if (!SYMBOL_VALUE_MAGIC_P (sym->value))
sym->value = specpdl_ptr->old_value;
else
static Lisp_Object x_keysym_to_emacs_keysym (KeySym keysym, int simple_p);
void emacs_Xt_mapping_action (Widget w, XEvent *event);
-void debug_process_finalization (struct Lisp_Process *p);
+void debug_process_finalization (Lisp_Process *p);
void emacs_Xt_event_handler (Widget wid, XtPointer closure, XEvent *event,
Boolean *continue_to_dispatch);
use a pop-up-window instead.)
*/
+/* For every key on the keyboard that has a known character correspondence,
+ we define the ascii-character property of the keysym, and make the
+ default binding for the key be self-insert-command.
+
+ The following magic is basically intimate knowledge of X11/keysymdef.h.
+ The keysym mappings defined by X11 are based on the iso8859 standards,
+ except for Cyrillic and Greek.
+
+ In a non-Mule world, a user can still have a multi-lingual editor, by doing
+ (set-face-font "...-iso8859-2" (current-buffer))
+ for all their Latin-2 buffers, etc. */
+
+static Lisp_Object
+x_keysym_to_character (KeySym keysym)
+{
+#ifdef MULE
+ Lisp_Object charset = Qzero;
+#define USE_CHARSET(var,cs) \
+ ((var) = CHARSET_BY_LEADING_BYTE (LEADING_BYTE_##cs))
+#else
+#define USE_CHARSET(var,lb)
+#endif /* MULE */
+ int code = 0;
+
+ if ((keysym & 0xff) < 0xa0)
+ return Qnil;
+
+ switch (keysym >> 8)
+ {
+ case 0: /* ASCII + Latin1 */
+ USE_CHARSET (charset, LATIN_ISO8859_1);
+ code = keysym & 0x7f;
+ break;
+ case 1: /* Latin2 */
+ USE_CHARSET (charset, LATIN_ISO8859_2);
+ code = keysym & 0x7f;
+ break;
+ case 2: /* Latin3 */
+ USE_CHARSET (charset, LATIN_ISO8859_3);
+ code = keysym & 0x7f;
+ break;
+ case 3: /* Latin4 */
+ USE_CHARSET (charset, LATIN_ISO8859_4);
+ code = keysym & 0x7f;
+ break;
+ case 4: /* Katakana */
+ USE_CHARSET (charset, KATAKANA_JISX0201);
+ if ((keysym & 0xff) > 0xa0)
+ code = keysym & 0x7f;
+ break;
+ case 5: /* Arabic */
+ USE_CHARSET (charset, ARABIC_ISO8859_6);
+ code = keysym & 0x7f;
+ break;
+ case 6: /* Cyrillic */
+ {
+ static unsigned char const cyrillic[] = /* 0x20 - 0x7f */
+ {0x00, 0x72, 0x73, 0x71, 0x74, 0x75, 0x76, 0x77,
+ 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x00, 0x7e, 0x7f,
+ 0x70, 0x22, 0x23, 0x21, 0x24, 0x25, 0x26, 0x27,
+ 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x00, 0x2e, 0x2f,
+ 0x6e, 0x50, 0x51, 0x66, 0x54, 0x55, 0x64, 0x53,
+ 0x65, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e,
+ 0x5f, 0x6f, 0x60, 0x61, 0x62, 0x63, 0x56, 0x52,
+ 0x6c, 0x6b, 0x57, 0x68, 0x6d, 0x69, 0x67, 0x6a,
+ 0x4e, 0x30, 0x31, 0x46, 0x34, 0x35, 0x44, 0x33,
+ 0x45, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e,
+ 0x3f, 0x4f, 0x40, 0x41, 0x42, 0x43, 0x36, 0x32,
+ 0x4c, 0x4b, 0x37, 0x48, 0x4d, 0x49, 0x47, 0x4a};
+ USE_CHARSET (charset, CYRILLIC_ISO8859_5);
+ code = cyrillic[(keysym & 0x7f) - 0x20];
+ break;
+ }
+ case 7: /* Greek */
+ {
+ static unsigned char const greek[] = /* 0x20 - 0x7f */
+ {0x00, 0x36, 0x38, 0x39, 0x3a, 0x5a, 0x00, 0x3c,
+ 0x3e, 0x5b, 0x00, 0x3f, 0x00, 0x00, 0x35, 0x2f,
+ 0x00, 0x5c, 0x5d, 0x5e, 0x5f, 0x7a, 0x40, 0x7c,
+ 0x7d, 0x7b, 0x60, 0x7e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+ 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
+ 0x50, 0x51, 0x53, 0x00, 0x54, 0x55, 0x56, 0x57,
+ 0x58, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
+ 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
+ 0x70, 0x71, 0x73, 0x72, 0x74, 0x75, 0x76, 0x77,
+ 0x78, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+ USE_CHARSET (charset, GREEK_ISO8859_7);
+ code = greek[(keysym & 0x7f) - 0x20];
+ break;
+ }
+ case 8: /* Technical */
+ break;
+ case 9: /* Special */
+ break;
+ case 10: /* Publishing */
+ break;
+ case 11: /* APL */
+ break;
+ case 12: /* Hebrew */
+ USE_CHARSET (charset, HEBREW_ISO8859_8);
+ code = keysym & 0x7f;
+ break;
+ case 13: /* Thai */
+ /* #### This needs to deal with character composition. */
+ USE_CHARSET (charset, THAI_TIS620);
+ code = keysym & 0x7f;
+ break;
+ case 14: /* Korean Hangul */
+ break;
+ case 19: /* Latin 9 - ISO8859-15 - unsupported charset. */
+ break;
+ case 32: /* Currency */
+ break;
+ default:
+ break;
+ }
+
+ if (code == 0)
+ return Qnil;
+
+#ifdef MULE
+ return make_char (MAKE_CHAR (charset, code, 0));
+#else
+ return make_char (code + 0x80);
+#endif
+}
+
+/* #### The way that keysym correspondence to characters should work:
+ - a Lisp_Event should contain a keysym AND a character slot.
+ - keybindings are tried with the keysym. If no binding can be found,
+ and there is a corresponding character, call self-insert-command.
+
+ #### Nuke x-iso8859-1.el.
+ #### Nuke the Qascii_character property.
+ #### Nuke Vcharacter_set_property.
+*/
+static void
+maybe_define_x_key_as_self_inserting_character (KeySym keysym, Lisp_Object symbol)
+{
+ Lisp_Object character = x_keysym_to_character (keysym);
+
+ if (CHARP (character))
+ {
+ extern Lisp_Object Vcurrent_global_map;
+ extern Lisp_Object Qascii_character;
+ Fput (symbol, Qascii_character, character);
+ if (NILP (Flookup_key (Vcurrent_global_map, symbol, Qnil)))
+ Fdefine_key (Vcurrent_global_map, symbol, Qself_insert_command);
+ }
+}
+
+static void
+x_has_keysym (KeySym keysym, Lisp_Object hash_table, int with_modifiers)
+{
+ KeySym upper_lower[2];
+ int j;
+
+ if (keysym < 0x80) /* Optimize for ASCII keysyms */
+ return;
+ /* If you do: xmodmap -e 'keysym NN = scaron'
+ and then press (Shift scaron), X11 will return the different
+ keysym Scaron, but xmodmap -pke might not even mention Scaron.
+ So we `register' both scaron and Scaron. */
+ XConvertCase (keysym, &upper_lower[0], &upper_lower[1]);
+
+ for (j = 0; j < (upper_lower[0] == upper_lower[1] ? 1 : 2); j++)
+ {
+ char *name;
+ keysym = upper_lower[j];
+
+ name = XKeysymToString (keysym);
+ if (name)
+ {
+ /* X guarantees NAME to be in the Host Portable Character Encoding */
+ Lisp_Object sym = x_keysym_to_emacs_keysym (keysym, 0);
+ Lisp_Object new_value = with_modifiers ? Qt : Qsans_modifiers;
+ Lisp_Object old_value = Fgethash (sym, hash_table, Qnil);
+
+ if (! EQ (old_value, new_value)
+ && ! (EQ (old_value, Qsans_modifiers) &&
+ EQ (new_value, Qt)))
+ {
+ maybe_define_x_key_as_self_inserting_character (keysym, sym);
+ Fputhash (build_ext_string (name, Qbinary), new_value, hash_table);
+ Fputhash (sym, new_value, hash_table);
+ }
+ }
+ }
+}
+
static void
x_reset_key_mapping (struct device *d)
{
if (keysym[0] == NoSymbol)
continue;
- {
- char *name = XKeysymToString (keysym[0]);
- Lisp_Object sym = x_keysym_to_emacs_keysym (keysym[0], 0);
- if (name)
- {
- Fputhash (build_string (name), Qsans_modifiers, hash_table);
- Fputhash (sym, Qsans_modifiers, hash_table);
- }
- }
+ x_has_keysym (keysym[0], hash_table, 0);
for (j = 1; j < keysyms_per_code; j++)
{
if (keysym[j] != keysym[0] &&
keysym[j] != NoSymbol)
- {
- char *name = XKeysymToString (keysym[j]);
- Lisp_Object sym = x_keysym_to_emacs_keysym (keysym[j], 0);
- if (name && NILP (Fgethash (sym, hash_table, Qnil)))
- {
- Fputhash (build_string (name), Qt, hash_table);
- Fputhash (sym, Qt, hash_table);
- }
- }
+ x_has_keysym (keysym[j], hash_table, 1);
}
}
}
Lstream *istr;
struct gcpro gcpro1, gcpro2;
- fb_instream =
- make_fixed_buffer_input_stream ((unsigned char *) bufptr, len);
+ fb_instream = make_fixed_buffer_input_stream (bufptr, len);
- /* ### Use Fget_coding_system (Vcomposed_input_coding_system) */
+ /* #### Use Fget_coding_system (Vcomposed_input_coding_system) */
instream =
make_decoding_input_stream (XLSTREAM (fb_instream),
Fget_coding_system (Qundecided));
while ((ch = Lstream_get_emchar (istr)) != EOF)
{
Lisp_Object emacs_event = Fmake_event (Qnil, Qnil);
- struct Lisp_Event *ev = XEVENT (emacs_event);
+ Lisp_Event *ev = XEVENT (emacs_event);
ev->channel = DEVICE_CONSOLE (d);
ev->event_type = key_press_event;
ev->timestamp = event->time;
}
static int
-x_event_to_emacs_event (XEvent *x_event, struct Lisp_Event *emacs_event)
+x_event_to_emacs_event (XEvent *x_event, Lisp_Event *emacs_event)
{
Display *display = x_event->xany.display;
struct device *d = get_device_from_display (display);
make_string ((Bufbyte *)"8bit", 4),
make_ext_string ((Extbyte *)data,
strlen((char *)data),
- FORMAT_CTEXT) ) );
+ Qctext) ) );
break;
case DndMIME:
/* we have to parse this in some way to extract
l_type = Qdragdrop_MIME;
l_dndlist = list1 ( make_ext_string ((Extbyte *)data,
strlen((char *)data),
- FORMAT_BINARY) );
+ Qbinary) );
break;
case DndFile:
case DndDir:
and escaping again will break them (cause % is unsave) */
l_dndlist = list1 ( make_ext_string ((Extbyte *)data,
strlen ((char *)data),
- FORMAT_FILENAME) );
+ Qfile_name) );
l_type = Qdragdrop_URL;
break;
default: /* Unknown, RawData and any other type */
make_string ((Bufbyte *)"8bit", 4),
make_ext_string ((Extbyte *)data,
size,
- FORMAT_BINARY) ) );
+ Qbinary) ) );
l_type = Qdragdrop_MIME;
break;
}
}
static void
-emacs_Xt_handle_magic_event (struct Lisp_Event *emacs_event)
+emacs_Xt_handle_magic_event (Lisp_Event *emacs_event)
{
/* This function can GC */
XEvent *event = &emacs_event->event.magic.underlying_x_event;
}
static void
-Xt_timeout_to_emacs_event (struct Lisp_Event *emacs_event)
+Xt_timeout_to_emacs_event (Lisp_Event *emacs_event)
{
struct Xt_timeout *timeout = completed_timeouts;
assert (timeout);
}
static void
-emacs_Xt_select_process (struct Lisp_Process *p)
+emacs_Xt_select_process (Lisp_Process *p)
{
Lisp_Object process;
int infd = event_stream_unixoid_select_process (p);
}
static void
-emacs_Xt_unselect_process (struct Lisp_Process *p)
+emacs_Xt_unselect_process (Lisp_Process *p)
{
int infd = event_stream_unixoid_unselect_process (p);
If we've still got pointers to it in this file, we're gonna lose hard.
*/
void
-debug_process_finalization (struct Lisp_Process *p)
+debug_process_finalization (Lisp_Process *p)
{
#if 0 /* #### */
int i;
}
static void
-Xt_process_to_emacs_event (struct Lisp_Event *emacs_event)
+Xt_process_to_emacs_event (Lisp_Event *emacs_event)
{
int i;
to be deleted.) */
static int
-Xt_tty_to_emacs_event (struct Lisp_Event *emacs_event)
+Xt_tty_to_emacs_event (Lisp_Event *emacs_event)
{
int i;
char *buf = alloca_array (char, XSTRING_LENGTH (f->name) + 4);
sprintf (buf, " \"%s\"", XSTRING_DATA (f->name));
write_string_to_stdio_stream (stderr, 0, (Bufbyte *) buf, 0,
- strlen (buf), FORMAT_TERMINAL);
+ strlen (buf), Qterminal);
}
stderr_out ("\n");
}
}
static void
-emacs_Xt_next_event (struct Lisp_Event *emacs_event)
+emacs_Xt_next_event (Lisp_Event *emacs_event)
{
we_didnt_get_an_event:
the '#if 0'. Note, however, that I got "unknown structure"
errors when I tried this. */
XtConvertArgRec Const colorConvertArgs[] = {
- {XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.screen),
- sizeof(Screen *)},
- {XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.colormap),
- sizeof(Colormap)}
+ { XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.screen),
+ sizeof (Screen *) },
+ { XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.colormap),
+ sizeof (Colormap) }
};
#endif
{
defsymbol (&Qkey_mapping, "key-mapping");
defsymbol (&Qsans_modifiers, "sans-modifiers");
+ defsymbol (&Qself_insert_command, "self-insert-command");
}
void
/* Timer ID used for button2 emulation */
#define BUTTON_2_TIMER_ID 1
-extern Lisp_Object
-mswindows_get_toolbar_button_text (struct frame* f, int command_id);
-extern Lisp_Object
-mswindows_handle_toolbar_wm_command (struct frame* f, HWND ctrl, WORD id);
-extern Lisp_Object
-mswindows_handle_gui_wm_command (struct frame* f, HWND ctrl, WORD id);
-
static Lisp_Object mswindows_find_frame (HWND hwnd);
static Lisp_Object mswindows_find_console (HWND hwnd);
static Lisp_Object mswindows_key_to_emacs_keysym (int mswindows_key, int mods,
/************************************************************************/
static int
-mswindows_user_event_p (struct Lisp_Event* sevt)
+mswindows_user_event_p (Lisp_Event* sevt)
{
return (sevt->event_type == key_press_event
|| sevt->event_type == button_press_event
Lisp_Object object)
{
Lisp_Object event = Fmake_event (Qnil, Qnil);
- struct Lisp_Event* e = XEVENT (event);
+ Lisp_Event* e = XEVENT (event);
e->event_type = misc_user_event;
e->channel = channel;
+ e->timestamp = GetTickCount ();
e->event.misc.function = function;
e->event.misc.object = object;
}
void
-mswindows_enqueue_magic_event (HWND hwnd, UINT message)
+mswindows_enqueue_magic_event (HWND hwnd, UINT msg)
{
Lisp_Object emacs_event = Fmake_event (Qnil, Qnil);
- struct Lisp_Event* event = XEVENT (emacs_event);
+ Lisp_Event* event = XEVENT (emacs_event);
event->channel = hwnd ? mswindows_find_frame (hwnd) : Qnil;
event->timestamp = GetMessageTime();
event->event_type = magic_event;
- EVENT_MSWINDOWS_MAGIC_TYPE (event) = message;
+ EVENT_MSWINDOWS_MAGIC_TYPE (event) = msg;
mswindows_enqueue_dispatch_event (emacs_event);
}
static void
-mswindows_enqueue_process_event (struct Lisp_Process* p)
+mswindows_enqueue_process_event (Lisp_Process* p)
{
Lisp_Object emacs_event = Fmake_event (Qnil, Qnil);
- struct Lisp_Event* event = XEVENT (emacs_event);
+ Lisp_Event* event = XEVENT (emacs_event);
Lisp_Object process;
XSETPROCESS (process, p);
}
static void
-mswindows_enqueue_mouse_button_event (HWND hwnd, UINT message, POINTS where, DWORD when)
+mswindows_enqueue_mouse_button_event (HWND hwnd, UINT msg, POINTS where, DWORD when)
{
/* We always use last message time, because mouse button
recognition will fail */
Lisp_Object emacs_event = Fmake_event (Qnil, Qnil);
- struct Lisp_Event* event = XEVENT(emacs_event);
+ Lisp_Event* event = XEVENT(emacs_event);
event->channel = mswindows_find_frame(hwnd);
event->timestamp = when;
event->event.button.button =
- (message==WM_LBUTTONDOWN || message==WM_LBUTTONUP) ? 1 :
- ((message==WM_RBUTTONDOWN || message==WM_RBUTTONUP) ? 3 : 2);
+ (msg==WM_LBUTTONDOWN || msg==WM_LBUTTONUP) ? 1 :
+ ((msg==WM_RBUTTONDOWN || msg==WM_RBUTTONUP) ? 3 : 2);
event->event.button.x = where.x;
event->event.button.y = where.y;
event->event.button.modifiers = mswindows_modifier_state (NULL, 0);
- if (message==WM_LBUTTONDOWN || message==WM_MBUTTONDOWN ||
- message==WM_RBUTTONDOWN)
+ if (msg==WM_LBUTTONDOWN || msg==WM_MBUTTONDOWN ||
+ msg==WM_RBUTTONDOWN)
{
event->event_type = button_press_event;
SetCapture (hwnd);
mswindows_enqueue_keypress_event (HWND hwnd, Lisp_Object keysym, int mods)
{
Lisp_Object emacs_event = Fmake_event (Qnil, Qnil);
- struct Lisp_Event* event = XEVENT(emacs_event);
+ Lisp_Event* event = XEVENT(emacs_event);
event->channel = mswindows_find_console(hwnd);
event->timestamp = GetMessageTime();
mswindows_dequeue_dispatch_event ()
{
Lisp_Object event;
- struct Lisp_Event* sevt;
+ Lisp_Event* sevt;
assert (!NILP(mswindows_u_dispatch_event_queue) ||
!NILP(mswindows_s_dispatch_event_queue));
*/
Lisp_Object
-mswindows_cancel_dispatch_event (struct Lisp_Event *match)
+mswindows_cancel_dispatch_event (Lisp_Event *match)
{
Lisp_Object event;
Lisp_Object previous_event = Qnil;
EVENT_CHAIN_LOOP (event, *head)
{
- struct Lisp_Event *e = XEVENT (event);
+ Lisp_Event *e = XEVENT (event);
if ((e->event_type == match->event_type) &&
((e->event_type == timeout_event) ?
(e->event.timeout.interval_id == match->event.timeout.interval_id) :
return result;
}
+/*
+ * KEYBOARD_ONLY_P is set to non-zero when we are called from
+ * QUITP, and are interesting in keyboard messages only.
+ */
static void
-mswindows_drain_windows_queue ()
+mswindows_drain_windows_queue (int keyboard_only_till_quit_char_p)
{
MSG msg;
- while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
+
+ /* Minimize the hassle of misordered events by not fetching
+ past quit char if called from QUITP; */
+ while (!(keyboard_only_till_quit_char_p &&
+ mswindows_quit_chars_count > 0) &&
+ PeekMessage (&msg, NULL,
+ keyboard_only_till_quit_char_p ? WM_KEYFIRST : 0,
+ keyboard_only_till_quit_char_p ? WM_KEYLAST : 0,
+ PM_REMOVE))
{
- /* we have to translate messages that are not sent to the main
- window. this is so that key presses work ok in things like
- edit fields. however, we *musn't* translate message for the
+ /* We have to translate messages that are not sent to the main
+ window. This is so that key presses work ok in things like
+ edit fields. However, we *musn't* translate message for the
main window as this is handled in the wnd proc. */
- if ( GetWindowLong (msg.hwnd, GWL_STYLE) & WS_CHILD )
+ if (GetWindowLong (msg.hwnd, GWL_STYLE) & WS_CHILD)
{
TranslateMessage (&msg);
}
return;
}
+#if 0
/* Have to drain Windows message queue first, otherwise, we may miss
quit char when called from quit_p */
+ /* #### This is, ehm, not quite true -- this function is not
+ called from quit_p. --kkm */
mswindows_drain_windows_queue ();
+#endif
while (NILP (mswindows_u_dispatch_event_queue)
&& NILP (mswindows_s_dispatch_event_queue))
{
if (FD_ISSET (windows_fd, &temp_mask))
{
- mswindows_drain_windows_queue ();
+ mswindows_drain_windows_queue (0);
}
#ifdef HAVE_TTY
/* Look for a TTY event */
{
struct console *c = tty_find_console_from_fd (i);
Lisp_Object emacs_event = Fmake_event (Qnil, Qnil);
- struct Lisp_Event* event = XEVENT (emacs_event);
+ Lisp_Event* event = XEVENT (emacs_event);
assert (c);
if (read_event_from_tty_or_stream_desc (event, c, i))
{
if (FD_ISSET (i, &process_only_mask))
{
- struct Lisp_Process *p =
+ Lisp_Process *p =
get_process_from_usid (FD_TO_USID(i));
mswindows_enqueue_process_event (p);
else if (active == WAIT_OBJECT_0 + mswindows_waitable_count)
{
/* Got your message, thanks */
- mswindows_drain_windows_queue ();
+ mswindows_drain_windows_queue (0);
}
else
{
int ix = active - WAIT_OBJECT_0;
/* First, try to find which process' output has signaled */
- struct Lisp_Process *p =
+ Lisp_Process *p =
get_process_from_usid (HANDLE_TO_USID (mswindows_waitable_handles[ix]));
if (p != NULL)
{
mswindows_wm_timer_callback (HWND hwnd, UINT umsg, UINT id_timer, DWORD dwtime)
{
Lisp_Object emacs_event = Fmake_event (Qnil, Qnil);
- struct Lisp_Event *event = XEVENT (emacs_event);
+ Lisp_Event *event = XEVENT (emacs_event);
if (KillTimer (NULL, id_timer))
--mswindows_pending_timers_count;
Lisp_Object l_dndlist = Qnil;
Lisp_Object emacs_event = Fmake_event (Qnil, Qnil);
Lisp_Object frmcons, devcons, concons;
- struct Lisp_Event *event = XEVENT (emacs_event);
+ Lisp_Event *event = XEVENT (emacs_event);
DdeGetData (hdata, cmd, len, 0);
cmd[len] = '\0';
#endif
/*
+ * Returns 1 if a key is a real modifier or special key, which
+ * is better handled by DefWindowProc
+ */
+static int
+key_needs_default_processing_p (UINT vkey)
+{
+ if (mswindows_meta_activates_menu && vkey == VK_MENU)
+ return 1;
+
+ return 0;
+}
+
+/*
* The windows procedure for the window class XEMACS_CLASS
*/
LRESULT WINAPI
Lisp_Object emacs_event = Qnil;
Lisp_Object fobj = Qnil;
- struct Lisp_Event *event;
+ Lisp_Event *event;
struct frame *frame;
struct mswindows_frame* msframe;
SetKeyboardState (keymap);
}
};
- goto defproc;
+ if (key_needs_default_processing_p (wParam))
+ goto defproc;
+ else
+ break;
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
/* Clear control and alt modifiers unless AltGr is pressed */
keymap [VK_RCONTROL] = 0;
keymap [VK_LMENU] = 0;
- if (!has_AltGr || !(keymap [VK_LCONTROL] & 0x80) || !(keymap [VK_RMENU] & 0x80))
+ if (!has_AltGr || !(keymap [VK_LCONTROL] & 0x80)
+ || !(keymap [VK_RMENU] & 0x80))
{
keymap [VK_LCONTROL] = 0;
keymap [VK_CONTROL] = 0;
SetKeyboardState (keymap_orig);
} /* else */
}
- /* F10 causes menu activation by default. We do not want this */
- if (wParam != VK_F10 && (mswindows_meta_activates_menu || wParam != VK_MENU))
+ if (key_needs_default_processing_p (wParam))
goto defproc;
- break;
+ else
+ break;
case WM_MBUTTONDOWN:
case WM_MBUTTONUP:
{
/* I think this is safe since the text will only go away
when the toolbar does...*/
- GET_C_STRING_EXT_DATA_ALLOCA (btext, FORMAT_OS,
- tttext->lpszText);
+ TO_EXTERNAL_FORMAT (LISP_STRING, btext,
+ C_STRING_ALLOCA, tttext->lpszText,
+ Qnative);
}
#endif
}
else if (nmhdr->code == TCN_SELCHANGE)
{
TC_ITEM item;
- int index = SendMessage (nmhdr->hwndFrom, TCM_GETCURSEL, 0, 0);
+ int idx = SendMessage (nmhdr->hwndFrom, TCM_GETCURSEL, 0, 0);
frame = XFRAME (mswindows_find_frame (hwnd));
item.mask = TCIF_PARAM;
- SendMessage (nmhdr->hwndFrom, TCM_GETITEM, (WPARAM)index,
+ SendMessage (nmhdr->hwndFrom, TCM_GETITEM, (WPARAM)idx,
(LPARAM)&item);
mswindows_handle_gui_wm_command (frame, 0, item.lParam);
static void
emacs_mswindows_remove_timeout (int id)
{
- struct Lisp_Event match_against;
+ Lisp_Event match_against;
Lisp_Object emacs_event;
if (KillTimer (NULL, id))
* Return the next event
*/
static void
-emacs_mswindows_next_event (struct Lisp_Event *emacs_event)
+emacs_mswindows_next_event (Lisp_Event *emacs_event)
{
Lisp_Object event, event2;
* Handle a magic event off the dispatch queue.
*/
static void
-emacs_mswindows_handle_magic_event (struct Lisp_Event *emacs_event)
+emacs_mswindows_handle_magic_event (Lisp_Event *emacs_event)
{
switch (EVENT_MSWINDOWS_MAGIC_TYPE(emacs_event))
{
#ifndef HAVE_MSG_SELECT
static HANDLE
-get_process_input_waitable (struct Lisp_Process *process)
+get_process_input_waitable (Lisp_Process *process)
{
Lisp_Object instr, outstr, p;
XSETPROCESS (p, process);
}
static void
-emacs_mswindows_select_process (struct Lisp_Process *process)
+emacs_mswindows_select_process (Lisp_Process *process)
{
HANDLE hev = get_process_input_waitable (process);
}
static void
-emacs_mswindows_unselect_process (struct Lisp_Process *process)
+emacs_mswindows_unselect_process (Lisp_Process *process)
{
/* Process handle is removed in the event loop as soon
as it is signaled, so don't bother here about it */
static void
emacs_mswindows_quit_p (void)
{
- MSG msg;
-
/* Quit cannot happen in modal loop: all program
input is dedicated to Windows. */
if (mswindows_in_modal_loop)
return;
- /* Drain windows queue. This sets up number of quit characters in the queue
- * (and also processes wm focus change, move, resize, etc messages).
- * We don't want to process WM_PAINT messages because this function can be
- * called from almost anywhere and the windows' states may be changing. */
- while (PeekMessage (&msg, NULL, 0, WM_PAINT-1, PM_REMOVE) ||
- PeekMessage (&msg, NULL, WM_PAINT+1, WM_USER-1, PM_REMOVE))
- DispatchMessage (&msg);
+ /* Drain windows queue. This sets up number of quit characters in
+ the queue */
+ mswindows_drain_windows_queue (1);
if (mswindows_quit_chars_count > 0)
{
/* Yes there's a hidden one... Throw it away */
- struct Lisp_Event match_against;
+ Lisp_Event match_against;
Lisp_Object emacs_event;
+ int critical_p = 0;
match_against.event_type = key_press_event;
match_against.event.key.modifiers = FAKE_MOD_QUIT;
- emacs_event = mswindows_cancel_dispatch_event (&match_against);
- assert (!NILP (emacs_event));
+ while (mswindows_quit_chars_count-- > 0)
+ {
+ emacs_event = mswindows_cancel_dispatch_event (&match_against);
+ assert (!NILP (emacs_event));
+
+ if (XEVENT(emacs_event)->event.key.modifiers & MOD_SHIFT)
+ critical_p = 1;
- Vquit_flag = (XEVENT(emacs_event)->event.key.modifiers & MOD_SHIFT
- ? Qcritical : Qt);
+ Fdeallocate_event(emacs_event);
+ }
- Fdeallocate_event(emacs_event);
- --mswindows_quit_chars_count;
+ Vquit_flag = critical_p ? Qcritical : Qt;
}
}
If we've still got pointers to it in this file, we're gonna lose hard.
*/
void
-debug_process_finalization (struct Lisp_Process *p)
+debug_process_finalization (Lisp_Process *p)
{
#if 0 /* #### */
Lisp_Object instr, outstr;
mswindows_event_stream->unselect_console_cb = emacs_mswindows_unselect_console;
#ifdef HAVE_MSG_SELECT
mswindows_event_stream->select_process_cb =
- (void (*)(struct Lisp_Process*))event_stream_unixoid_select_process;
+ (void (*)(Lisp_Process*))event_stream_unixoid_select_process;
mswindows_event_stream->unselect_process_cb =
- (void (*)(struct Lisp_Process*))event_stream_unixoid_unselect_process;
+ (void (*)(Lisp_Process*))event_stream_unixoid_unselect_process;
mswindows_event_stream->create_stream_pair_cb = event_stream_unixoid_create_stream_pair;
mswindows_event_stream->delete_stream_pair_cb = event_stream_unixoid_delete_stream_pair;
#else
}
static int
-maybe_read_quit_event (struct Lisp_Event *event)
+maybe_read_quit_event (Lisp_Event *event)
{
/* A C-g that came from `sigint_happened' will always come from the
controlling terminal. If that doesn't exist, however, then the
}
void
-event_stream_next_event (struct Lisp_Event *event)
+event_stream_next_event (Lisp_Event *event)
{
Lisp_Object event_obj;
}
void
-event_stream_handle_magic_event (struct Lisp_Event *event)
+event_stream_handle_magic_event (Lisp_Event *event)
{
check_event_stream_ok (EVENT_STREAM_READ);
event_stream->handle_magic_event_cb (event);
}
void
-event_stream_select_process (struct Lisp_Process *proc)
+event_stream_select_process (Lisp_Process *proc)
{
check_event_stream_ok (EVENT_STREAM_PROCESS);
if (!get_process_selected_p (proc))
}
void
-event_stream_unselect_process (struct Lisp_Process *proc)
+event_stream_unselect_process (Lisp_Process *proc)
{
check_event_stream_ok (EVENT_STREAM_PROCESS);
if (get_process_selected_p (proc))
}
else if (CHARP (traduit))
{
- struct Lisp_Event ev2;
+ Lisp_Event ev2;
/* This used to call Fcharacter_to_event() directly into EVENT,
but that can eradicate timestamps and other such stuff.
static Lisp_Object
mark_timeout (Lisp_Object obj)
{
- struct Lisp_Timeout *tm = XTIMEOUT (obj);
+ Lisp_Timeout *tm = XTIMEOUT (obj);
mark_object (tm->function);
return tm->object;
}
static void
print_timeout (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
- CONST struct Lisp_Timeout *t = XTIMEOUT (obj);
+ CONST Lisp_Timeout *t = XTIMEOUT (obj);
char buf[64];
sprintf (buf, "#<INTERNAL OBJECT (XEmacs bug?) (timeout) 0x%lx>",
}
static const struct lrecord_description timeout_description[] = {
- { XD_LISP_OBJECT, offsetof(struct Lisp_Timeout, function), 2 },
+ { XD_LISP_OBJECT, offsetof (Lisp_Timeout, function) },
+ { XD_LISP_OBJECT, offsetof (Lisp_Timeout, object) },
{ XD_END }
};
DEFINE_LRECORD_IMPLEMENTATION ("timeout", timeout,
mark_timeout, print_timeout,
- 0, 0, 0, timeout_description, struct Lisp_Timeout);
+ 0, 0, 0, timeout_description, Lisp_Timeout);
/* Generate a timeout and return its ID. */
int async_p)
{
Lisp_Object op = allocate_managed_lcrecord (Vtimeout_free_list);
- struct Lisp_Timeout *timeout = XTIMEOUT (op);
+ Lisp_Timeout *timeout = XTIMEOUT (op);
EMACS_TIME current_time;
EMACS_TIME interval;
Lisp_Object *function, Lisp_Object *object)
{
Lisp_Object op = Qnil, rest;
- struct Lisp_Timeout *timeout;
+ Lisp_Timeout *timeout;
Lisp_Object *timeout_list;
struct gcpro gcpro1;
int id;
void
event_stream_disable_wakeup (int id, int async_p)
{
- struct Lisp_Timeout *timeout = 0;
+ Lisp_Timeout *timeout = 0;
Lisp_Object rest;
Lisp_Object *timeout_list;
static int
event_stream_wakeup_pending_p (int id, int async_p)
{
- struct Lisp_Timeout *timeout;
+ Lisp_Timeout *timeout;
Lisp_Object rest;
Lisp_Object timeout_list;
int found = 0;
}
else
{
- struct Lisp_Event *e = XEVENT (target_event);
+ Lisp_Event *e = XEVENT (target_event);
/* The command_event_queue was empty. Wait for an event. */
event_stream_next_event (e);
case timeout_event:
{
- struct Lisp_Event *e = XEVENT (event);
+ Lisp_Event *e = XEVENT (event);
if (!NILP (e->event.timeout.function))
call1 (e->event.timeout.function,
e->event.timeout.object);
|| (CHAR_OR_CHAR_INTP (key->keysym)
&& ((c = XCHAR_OR_CHAR_INT (key->keysym)), c >= 'A' && c <= 'Z')))
{
- struct Lisp_Event terminal_copy = *XEVENT (terminal);
+ Lisp_Event terminal_copy = *XEVENT (terminal);
if (key->modifiers & MOD_SHIFT)
key->modifiers &= (~ MOD_SHIFT);
if (EVENTP (recent)
&& event_matches_key_specifier_p (XEVENT (recent), Vmeta_prefix_char))
{
- struct Lisp_Event *e;
+ Lisp_Event *e;
/* When we see a sequence like "ESC x", pretend we really saw "M-x".
DoubleThink the recent-keys and this-command-keys as well. */
}
else if (!NILP (Vquit_flag)) {
Lisp_Object quit_event = Fmake_event(Qnil, Qnil);
- struct Lisp_Event *e = XEVENT (quit_event);
+ Lisp_Event *e = XEVENT (quit_event);
/* if quit happened during menu acceleration, pretend we read it */
struct console *con = XCONSOLE (Fselected_console ());
int ch = CONSOLE_QUIT_CHAR (con);
#if 0
/* If the last command deleted the frame, `win' might be nil.
It seems safest to do nothing in this case. */
- /* ### This doesn't really fix the problem,
+ /* #### This doesn't really fix the problem,
if delete-frame is called by some hook */
if (NILP (win))
return;
{
/* This function can GC */
struct command_builder *command_builder;
- struct Lisp_Event *ev;
+ Lisp_Event *ev;
Lisp_Object console;
Lisp_Object channel;
recent_keys_ring_index = 0;
recent_keys_ring_size = 100;
num_input_chars = 0;
- Vtimeout_free_list = make_lcrecord_list (sizeof (struct Lisp_Timeout),
+ Vtimeout_free_list = make_lcrecord_list (sizeof (Lisp_Timeout),
&lrecord_timeout);
staticpro_nodump (&Vtimeout_free_list);
the_low_level_timeout_blocktype =
}
static void
-tty_timeout_to_emacs_event (struct Lisp_Event *emacs_event)
+tty_timeout_to_emacs_event (Lisp_Event *emacs_event)
{
emacs_event->event_type = timeout_event;
/* timeout events have nil as channel */
}
static void
-emacs_tty_next_event (struct Lisp_Event *emacs_event)
+emacs_tty_next_event (Lisp_Event *emacs_event)
{
while (1)
{
if (FD_ISSET (i, &temp_mask) && FD_ISSET (i, &process_only_mask))
{
Lisp_Object process;
- struct Lisp_Process *p =
- get_process_from_usid (FD_TO_USID(i));
+ Lisp_Process *p = get_process_from_usid (FD_TO_USID(i));
assert (p);
XSETPROCESS (process, p);
}
static void
-emacs_tty_handle_magic_event (struct Lisp_Event *emacs_event)
+emacs_tty_handle_magic_event (Lisp_Event *emacs_event)
{
/* Nothing to do currently */
}
\f
static void
-emacs_tty_select_process (struct Lisp_Process *process)
+emacs_tty_select_process (Lisp_Process *process)
{
event_stream_unixoid_select_process (process);
}
static void
-emacs_tty_unselect_process (struct Lisp_Process *process)
+emacs_tty_unselect_process (Lisp_Process *process)
{
event_stream_unixoid_unselect_process (process);
}
int fake_event_occurred;
int
-read_event_from_tty_or_stream_desc (struct Lisp_Event *event,
+read_event_from_tty_or_stream_desc (Lisp_Event *event,
struct console *con, int fd)
{
unsigned char ch;
}
static int
-get_process_infd (struct Lisp_Process *p)
+get_process_infd (Lisp_Process *p)
{
Lisp_Object instr, outstr;
get_process_streams (p, &instr, &outstr);
}
int
-event_stream_unixoid_select_process (struct Lisp_Process *proc)
+event_stream_unixoid_select_process (Lisp_Process *proc)
{
int infd = get_process_infd (proc);
}
int
-event_stream_unixoid_unselect_process (struct Lisp_Process *proc)
+event_stream_unixoid_unselect_process (Lisp_Process *proc)
{
int infd = get_process_infd (proc);
deinitialize_event (Lisp_Object ev)
{
int i;
- struct Lisp_Event *event = XEVENT (ev);
+ Lisp_Event *event = XEVENT (ev);
- for (i = 0; i < (int) (sizeof (struct Lisp_Event) / sizeof (int)); i++)
+ for (i = 0; i < (int) (sizeof (Lisp_Event) / sizeof (int)); i++)
((int *) event) [i] = 0xdeadbeef;
event->event_type = dead_event;
event->channel = Qnil;
/* Set everything to zero or nil so that it's predictable. */
void
-zero_event (struct Lisp_Event *e)
+zero_event (Lisp_Event *e)
{
xzero (*e);
set_lheader_implementation (&(e->lheader), &lrecord_event);
static Lisp_Object
mark_event (Lisp_Object obj)
{
- struct Lisp_Event *event = XEVENT (obj);
+ Lisp_Event *event = XEVENT (obj);
switch (event->event_type)
{
static int
event_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
{
- struct Lisp_Event *e1 = XEVENT (obj1);
- struct Lisp_Event *e2 = XEVENT (obj2);
+ Lisp_Event *e1 = XEVENT (obj1);
+ Lisp_Event *e2 = XEVENT (obj2);
if (e1->event_type != e2->event_type) return 0;
if (!EQ (e1->channel, e2->channel)) return 0;
if (CONSOLE_MSWINDOWS_P (con))
return (!memcmp(&e1->event.magic.underlying_mswindows_event,
&e2->event.magic.underlying_mswindows_event,
- sizeof(union magic_data)));
+ sizeof (union magic_data)));
#endif
+ abort ();
return 1; /* not reached */
}
static unsigned long
event_hash (Lisp_Object obj, int depth)
{
- struct Lisp_Event *e = XEVENT (obj);
+ Lisp_Event *e = XEVENT (obj);
unsigned long hash;
hash = HASH2 (e->event_type, LISP_HASH (e->channel));
if (CONSOLE_MSWINDOWS_P (con))
return HASH2 (hash, e->event.magic.underlying_mswindows_event);
#endif
+ abort ();
+ return 0;
}
case empty_event:
DEFINE_BASIC_LRECORD_IMPLEMENTATION ("event", event,
mark_event, print_event, 0, event_equal,
- event_hash, 0, struct Lisp_Event);
+ event_hash, 0, Lisp_Event);
\f
DEFUN ("make-event", Fmake_event, 0, 2, 0, /*
{
Lisp_Object tail, keyword, value;
Lisp_Object event = Qnil;
- struct Lisp_Event *e;
+ Lisp_Event *e;
EMACS_INT coord_x = 0, coord_y = 0;
struct gcpro gcpro1;
void
-character_to_event (Emchar c, struct Lisp_Event *event, struct console *con,
+character_to_event (Emchar c, Lisp_Event *event, struct console *con,
int use_console_meta_flag, int do_backspace_mapping)
{
Lisp_Object k = Qnil;
event->event.key.modifiers = m;
}
-
/* This variable controls what character name -> character code mapping
we are using. Window-system-specific code sets this to some symbol,
and we use that symbol as the plist key to convert keysyms into 8-bit
codes. In this way one can have several character sets predefined and
switch them by changing this.
+
+ #### This is utterly bogus and should be removed.
*/
Lisp_Object Vcharacter_set_property;
Emchar
-event_to_character (struct Lisp_Event *event,
+event_to_character (Lisp_Event *event,
int allow_extra_modifiers,
int allow_meta,
int allow_non_ascii)
}
void
-format_event_object (char *buf, struct Lisp_Event *event, int brief)
+format_event_object (char *buf, Lisp_Event *event, int brief)
{
int mouse_p = 0;
int mod = 0;
}
else
{
- struct Lisp_String *name = XSYMBOL (key)->name;
+ Lisp_String *name = XSYMBOL (key)->name;
memcpy (buf, string_data (name), string_length (name) + 1);
str += string_length (name);
}
*/
(event))
{
- struct Lisp_Event *e;
+ Lisp_Event *e;
CHECK_LIVE_EVENT (event);
return XEVENT_NEXT (event);
(event))
{
Lisp_Object props = Qnil;
- struct Lisp_Event *e;
+ Lisp_Event *e;
struct gcpro gcpro1;
CHECK_LIVE_EVENT (event);
/* Synched up with: Not in FSF. */
-#ifndef _XEMACS_EVENTS_H_
-#define _XEMACS_EVENTS_H_
+#ifndef INCLUDED_events_h_
+#define INCLUDED_events_h_
#include "systime.h"
multiple heterogeneous machines, X11 and SunView, or X11 and NeXT, for
example, then it will be necessary to construct an event_stream structure
that can cope with the given types. Currently, the only implemented
- event_streams are for dumb-ttys, and for X11 plus dumb-ttys.
+ event_streams are for dumb-ttys, and for X11 plus dumb-ttys,
+ and for mswindows.
To implement this for one window system is relatively simple.
To implement this for multiple window systems is trickier and may
The Create stream pair function is passed two void* values, which identify
process-dependent 'handles'. The process implementation uses these handles
to communicate with child processes. The function must be prepared to receive
- handle types of any process implementation. Since there only one process
+ handle types of any process implementation. Since only one process
implementation exists in a particular XEmacs configuration, preprocessing
- is a mean of compiling in the support for the code which deals with particular
+ is a means of compiling in the support for the code which deals with particular
handle types.
For example, a unixoid type loop, which relies on file descriptors, may be
#define USID_DONTHASH ((USID)0)
\f
-struct Lisp_Event;
-struct Lisp_Process;
-
struct event_stream
{
int (*event_pending_p) (int);
- void (*next_event_cb) (struct Lisp_Event *);
- void (*handle_magic_event_cb) (struct Lisp_Event *);
+ void (*next_event_cb) (Lisp_Event *);
+ void (*handle_magic_event_cb) (Lisp_Event *);
int (*add_timeout_cb) (EMACS_TIME);
void (*remove_timeout_cb) (int);
void (*select_console_cb) (struct console *);
void (*unselect_console_cb) (struct console *);
- void (*select_process_cb) (struct Lisp_Process *);
- void (*unselect_process_cb) (struct Lisp_Process *);
+ void (*select_process_cb) (Lisp_Process *);
+ void (*unselect_process_cb) (Lisp_Process *);
void (*quit_p_cb) (void);
USID (*create_stream_pair_cb) (void* /* inhandle*/, void* /*outhandle*/ ,
Lisp_Object* /* instream */,
should the one after that
occur? */
};
+typedef struct Lisp_Timeout Lisp_Timeout;
-DECLARE_LRECORD (timeout, struct Lisp_Timeout);
-#define XTIMEOUT(x) XRECORD (x, timeout, struct Lisp_Timeout)
+DECLARE_LRECORD (timeout, Lisp_Timeout);
+#define XTIMEOUT(x) XRECORD (x, timeout, Lisp_Timeout)
#define XSETTIMEOUT(x, p) XSETRECORD (x, p, timeout)
#define TIMEOUTP(x) RECORDP (x, timeout)
#define CHECK_TIMEOUT(x) CHECK_RECORD (x, timeout)
} event;
};
-DECLARE_LRECORD (event, struct Lisp_Event);
-#define XEVENT(x) XRECORD (x, event, struct Lisp_Event)
+DECLARE_LRECORD (event, Lisp_Event);
+#define XEVENT(x) XRECORD (x, event, Lisp_Event)
#define XSETEVENT(x, p) XSETRECORD (x, p, event)
#define EVENTP(x) RECORDP (x, event)
#define CHECK_EVENT(x) CHECK_RECORD (x, event)
#define KEYSYM(x) (intern (x))
/* from events.c */
-void format_event_object (char *buf, struct Lisp_Event *e, int brief);
-void character_to_event (Emchar c, struct Lisp_Event *event,
+void format_event_object (char *buf, Lisp_Event *e, int brief);
+void character_to_event (Emchar c, Lisp_Event *event,
struct console *con,
int use_console_meta_flag,
int do_backspace_mapping);
-void zero_event (struct Lisp_Event *e);
+void zero_event (Lisp_Event *e);
void deallocate_event_chain (Lisp_Object event);
Lisp_Object event_chain_tail (Lisp_Object event);
void enqueue_event (Lisp_Object event, Lisp_Object *head, Lisp_Object *tail);
/* True if this is a non-internal event
(keyboard press, menu, scrollbar, mouse button) */
int command_event_p (Lisp_Object event);
+void define_self_inserting_symbol (Lisp_Object, Lisp_Object);
+Emchar event_to_character (Lisp_Event *, int, int, int);
struct console *event_console_or_selected (Lisp_Object event);
/* from event-stream.c */
Lisp_Object allocate_command_builder (Lisp_Object console);
void enqueue_magic_eval_event (void (*fun) (Lisp_Object), Lisp_Object object);
-void event_stream_next_event (struct Lisp_Event *event);
-void event_stream_handle_magic_event (struct Lisp_Event *event);
+void event_stream_next_event (Lisp_Event *event);
+void event_stream_handle_magic_event (Lisp_Event *event);
void event_stream_select_console (struct console *con);
void event_stream_unselect_console (struct console *con);
-void event_stream_select_process (struct Lisp_Process *proc);
-void event_stream_unselect_process (struct Lisp_Process *proc);
+void event_stream_select_process (Lisp_Process *proc);
+void event_stream_unselect_process (Lisp_Process *proc);
USID event_stream_create_stream_pair (void* inhandle, void* outhandle,
Lisp_Object* instream, Lisp_Object* outstream, int flags);
USID event_stream_delete_stream_pair (Lisp_Object instream, Lisp_Object outstream);
int event_stream_unixoid_select_console (struct console *con);
int event_stream_unixoid_unselect_console (struct console *con);
-int event_stream_unixoid_select_process (struct Lisp_Process *proc);
-int event_stream_unixoid_unselect_process (struct Lisp_Process *proc);
-int read_event_from_tty_or_stream_desc (struct Lisp_Event *event,
+int event_stream_unixoid_select_process (Lisp_Process *proc);
+int event_stream_unixoid_unselect_process (Lisp_Process *proc);
+int read_event_from_tty_or_stream_desc (Lisp_Event *event,
struct console *con, int fd);
USID event_stream_unixoid_create_stream_pair (void* inhandle, void* outhandle,
Lisp_Object* instream,
#endif /* emacs */
-#endif /* _XEMACS_EVENTS_H_ */
+#endif /* INCLUDED_events_h_ */
allocate_extent_list (void)
{
Extent_List *el = xnew (Extent_List);
- el->start = make_gap_array (sizeof(EXTENT));
- el->end = make_gap_array (sizeof(EXTENT));
+ el->start = make_gap_array (sizeof (EXTENT));
+ el->end = make_gap_array (sizeof (EXTENT));
el->markers = 0;
return el;
}
static Lisp_Object extent_plist (Lisp_Object obj);
static const struct lrecord_description extent_description[] = {
- { XD_LISP_OBJECT, offsetof(struct extent, object), 2 },
- { XD_LISP_OBJECT, offsetof(struct extent, plist), 1 },
+ { XD_LISP_OBJECT, offsetof (struct extent, object) },
+ { XD_LISP_OBJECT, offsetof (struct extent, flags.face) },
+ { XD_LISP_OBJECT, offsetof (struct extent, plist) },
{ XD_END }
};
/* Synched up with: Not in FSF. */
-#ifndef _XEMACS_EXTENTS_H_
-#define _XEMACS_EXTENTS_H_
+#ifndef INCLUDED_extents_h_
+#define INCLUDED_extents_h_
DECLARE_LRECORD (extent, struct extent);
#define XEXTENT(x) XRECORD (x, extent, struct extent)
#endif /* emacs */
-#endif /* _XEMACS_EXTENTS_H_ */
+#endif /* INCLUDED_extents_h_ */
/* Synched up with: Not in FSF. */
-#ifndef _EXTW_XLIB_H_
-#define _EXTW_XLIB_H_
+#ifndef INCLUDED_extw_Xlib_h_
+#define INCLUDED_extw_Xlib_h_
#define extw_shell_send 0
#define extw_client_send 1
void extw_send_notify_3(Display *display, Window win, en_extw_notify type,
long data0, long data1, long data2);
-#endif /* _EXTW_XLIB_H_ */
+#endif /* INCLUDED_extw_Xlib_h_ */
/* Synched up with: Not in FSF. */
-#ifndef _EXTW_XT_H_
-#define _EXTW_XT_H_
+#ifndef INCLUDED_extw_Xt_h_
+#define INCLUDED_extw_Xt_h_
#include "extw-Xlib.h"
en_extw_notify type, unsigned long timeout);
-#endif /* _EXTW_XT_H_ */
+#endif /* INCLUDED_extw_Xt_h_ */
#ifdef WINDOWSNT
#define NOMINMAX 1
-#include <windows.h>
#include <direct.h>
#include <fcntl.h>
#include <stdlib.h>
Lisp_Object
lisp_strerror (int errnum)
{
- return build_ext_string (strerror (errnum), FORMAT_NATIVE);
+ return build_ext_string (strerror (errnum), Qnative);
}
static Lisp_Object
static int
directory_file_name (CONST char *src, char *dst)
{
- long slen;
-
- slen = strlen (src);
+ long slen = strlen (src);
/* Process as Unix format: just remove any final slash.
But leave "/" unchanged; do not change it to "". */
strcpy (dst, src);
-#ifdef APOLLO
- /* Handle // as root for apollo's. */
- if ((slen > 2 && dst[slen - 1] == '/')
- || (slen > 1 && dst[0] != '/' && dst[slen - 1] == '/'))
- dst[slen - 1] = 0;
-#else
if (slen > 1
&& IS_DIRECTORY_SEP (dst[slen - 1])
#ifdef WINDOWSNT
#endif /* WINDOWSNT */
)
dst[slen - 1] = 0;
-#endif /* APOLLO */
return 1;
}
if (IS_DIRECTORY_SEP (nm[1])
|| nm[1] == 0) /* ~ by itself */
{
- char * newdir_external = get_home_directory ();
+ Extbyte *newdir_external = get_home_directory ();
if (newdir_external == NULL)
newdir = (Bufbyte *) "";
else
- GET_C_CHARPTR_INT_FILENAME_DATA_ALLOCA (newdir_external, newdir);
+ TO_INTERNAL_FORMAT (C_STRING, newdir_external,
+ C_STRING_ALLOCA, (* ((char **) &newdir)),
+ Qfile_name);
nm++;
#ifdef WINDOWSNT
char resolved_path[MAXPATHLEN];
Extbyte *path;
Extbyte *p;
- Extcount elen = XSTRING_LENGTH (expanded_name);
+ Extcount elen;
- GET_STRING_FILENAME_DATA_ALLOCA (expanded_name,path,elen);
+ TO_EXTERNAL_FORMAT (LISP_STRING, expanded_name,
+ ALLOCA, (path, elen),
+ Qfile_name);
p = path;
if (elen > MAXPATHLEN)
goto toolong;
resolved_path[rlen + 1] = 0;
rlen = rlen + 1;
}
- return make_ext_string ((Bufbyte *) resolved_path, rlen, FORMAT_BINARY);
+ return make_ext_string ((Bufbyte *) resolved_path, rlen, Qbinary);
}
toolong:
for (p = nm; p != endp; p++)
{
if ((p[0] == '~'
-#if defined (APOLLO) || defined (WINDOWSNT) || defined (__CYGWIN32__)
- /* // at start of file name is meaningful in Apollo and
- WindowsNT systems */
+#if defined (WINDOWSNT) || defined (__CYGWIN32__)
+ /* // at start of file name is meaningful in WindowsNT systems */
|| (IS_DIRECTORY_SEP (p[0]) && p - 1 != nm)
-#else /* not (APOLLO || WINDOWSNT || __CYGWIN32__) */
+#else /* not (WINDOWSNT || __CYGWIN32__) */
|| IS_DIRECTORY_SEP (p[0])
-#endif /* not (APOLLO || WINDOWSNT || __CYGWIN32__) */
+#endif /* not (WINDOWSNT || __CYGWIN32__) */
)
&& p != nm
&& (IS_DIRECTORY_SEP (p[-1])))
for (p = xnm; p != x; p++)
if ((p[0] == '~'
-#if defined (APOLLO) || defined (WINDOWSNT)
+#if defined (WINDOWSNT)
|| (IS_DIRECTORY_SEP (p[0]) && p - 1 != xnm)
-#else /* not (APOLLO || WINDOWSNT) */
+#else /* not WINDOWSNT */
|| IS_DIRECTORY_SEP (p[0])
-#endif /* APOLLO || WINDOWSNT */
+#endif /* not WINDOWSNT */
)
/* don't do p[-1] if that would go off the beginning --jwz */
&& p != nm && p > xnm && IS_DIRECTORY_SEP (p[-1]))
(path, login))
{
int netresult;
+ const char *path_ext;
+ const char *login_ext;
CHECK_STRING (path);
CHECK_STRING (login);
/* netunam, being a strange-o system call only used once, is not
encapsulated. */
- {
- char *path_ext;
- char *login_ext;
- GET_C_STRING_FILENAME_DATA_ALLOCA (path, path_ext);
- GET_C_STRING_EXT_DATA_ALLOCA (login, FORMAT_OS, login_ext);
+ TO_EXTERNAL_FORMAT (LISP_STRING, path, C_STRING_ALLOCA, path_ext, Qfile_name);
+ TO_EXTERNAL_FORMAT (LISP_STRING, login, C_STRING_ALLOCA, login_ext, Qnative);
- netresult = netunam (path_ext, login_ext);
- }
+ netresult = netunam (path_ext, login_ext);
- if (netresult == -1)
- return Qnil;
- else
- return Qt;
+ return netresult == -1 ? Qnil : Qt;
}
#endif /* HPUX_NET */
\f
fd = -1;
- if (
-#ifndef APOLLO
- (stat ((char *) XSTRING_DATA (filename), &st) < 0)
-#else /* APOLLO */
- /* Don't even bother with interruptible_open. APOLLO sucks. */
- ((fd = open ((char *) XSTRING_DATA (filename), O_RDONLY | OPEN_BINARY, 0)) < 0
- || fstat (fd, &st) < 0)
-#endif /* APOLLO */
- )
+ if (stat ((char *) XSTRING_DATA (filename), &st) < 0)
{
if (fd >= 0) close (fd);
badopen:
{
if (!EQ (buf->undo_list, Qt))
buf->undo_list = Qnil;
-#ifdef APOLLO
- stat ((char *) XSTRING_DATA (filename), &st);
-#endif
if (NILP (handler))
{
buf->modtime = st.st_mtime;
}
#endif /* HAVE_FSYNC */
- /* Spurious "file has changed on disk" warnings have been
- observed on Suns as well.
- It seems that `close' can change the modtime, under nfs.
-
- (This has supposedly been fixed in Sunos 4,
- but who knows about all the other machines with NFS?) */
- /* On VMS and APOLLO, must do the stat after the close
- since closing changes the modtime. */
- /* As it does on Windows too - kkm */
- /* The spurious warnings appear on Linux too. Rather than handling
- this on a per-system basis, unconditionally do the stat after the close - cgw */
-
-#if 0 /* !defined (WINDOWSNT) */ /* !defined (VMS) && !defined (APOLLO) */
- fstat (desc, &st);
-#endif
+ /* Spurious "file has changed on disk" warnings used to be seen on
+ systems where close() can change the modtime. This is known to
+ happen on various NFS file systems, on Windows, and on Linux.
+ Rather than handling this on a per-system basis, we
+ unconditionally do the stat() after the close(). */
/* NFS can report a write failure now. */
if (close (desc) < 0)
unbind_to (speccount, Qnil);
}
- /* # if defined (WINDOWSNT) */ /* defined (VMS) || defined (APOLLO) */
stat ((char *) XSTRING_DATA (fn), &st);
- /* #endif */
#ifdef CLASH_DETECTION
if (!auto_saving)
CONST Extbyte *auto_save_file_name_ext;
Extcount auto_save_file_name_ext_len;
- GET_STRING_FILENAME_DATA_ALLOCA
- (b->auto_save_file_name,
- auto_save_file_name_ext,
- auto_save_file_name_ext_len);
+ TO_EXTERNAL_FORMAT (LISP_STRING, b->auto_save_file_name,
+ ALLOCA, (auto_save_file_name_ext,
+ auto_save_file_name_ext_len),
+ Qfile_name);
if (!NILP (b->filename))
{
CONST Extbyte *filename_ext;
Extcount filename_ext_len;
- GET_STRING_FILENAME_DATA_ALLOCA (b->filename,
- filename_ext,
- filename_ext_len);
+ TO_EXTERNAL_FORMAT (LISP_STRING, b->filename,
+ ALLOCA, (filename_ext,
+ filename_ext_len),
+ Qfile_name);
write (listdesc, filename_ext, filename_ext_len);
}
write (listdesc, "\n", 1);
DEFINE_BASIC_LRECORD_IMPLEMENTATION ("float", float,
mark_float, print_float, 0, float_equal,
float_hash, float_description,
- struct Lisp_Float);
+ Lisp_Float);
\f
/* Extract a Lisp number as a `double', or signal an error. */
/* Default properties to use when creating frames. */
Lisp_Object Vdefault_mswindows_frame_plist;
+Lisp_Object Vdefault_msprinter_frame_plist;
Lisp_Object Vmswindows_use_system_frame_size_defaults;
/* This does not need to be GC protected, as it holds a
frame Lisp_Object already protected by Fmake_frame */
Lisp_Object Vmswindows_frame_being_created;
+/*---------------------------------------------------------------------*/
+/*----- DISPLAY FRAME -----*/
+/*---------------------------------------------------------------------*/
+
static void
mswindows_init_frame_1 (struct frame *f, Lisp_Object props)
{
bugs (and is more consistent with X) so I am going to reenable it.
--andyp */
if ( FRAME_PIXWIDTH (f) && FRAME_PIXHEIGHT (f)
- && (width_specified_p || height_specified_p || x_specified_p || y_specified_p))
+ && (width_specified_p || height_specified_p
+ || x_specified_p || y_specified_p))
{
XEMACS_RECT_WH dest = { x, y, width, height };
return IsZoomed (FRAME_MSWINDOWS_HANDLE (f));
}
+/*---------------------------------------------------------------------*/
+/*----- PRINTER FRAME -----*/
+/*---------------------------------------------------------------------*/
+
+EXFUN (Fset_frame_properties, 2);
+
+static void
+error_frame_unsizable (struct frame *f)
+{
+ Lisp_Object frame;
+ XSETFRAME (frame, f);
+ signal_simple_error ("Cannot resize frame (margins)"
+ " after print job has started.", frame);
+}
+
+static void
+maybe_error_if_job_active (struct frame *f)
+{
+ if (FRAME_MSPRINTER_JOB_STARTED (f))
+ error_frame_unsizable (f);
+}
+
+static void
+msprinter_init_frame_1 (struct frame *f, Lisp_Object props)
+{
+ HDC hdc = DEVICE_MSPRINTER_HDC (XDEVICE (FRAME_DEVICE (f)));
+ Lisp_Object frame_obj = Qnil;
+
+ /* Make sure this is the only frame on device. Windows printer can
+ handle only one job at a time. */
+ if (!NILP (DEVICE_FRAME_LIST (XDEVICE (FRAME_DEVICE (f)))))
+ error ("Only one frame (print job) at a time is allowed on "
+ "this printer device.");
+
+ f->frame_data = xnew_and_zero (struct msprinter_frame);
+
+ /* Default margin size is 1" = 1440 twips */
+ FRAME_MSPRINTER_TOP_MARGIN(f) = 1440;
+ FRAME_MSPRINTER_BOTTOM_MARGIN(f) = 1440;
+ FRAME_MSPRINTER_LEFT_MARGIN(f) = 1440;
+ FRAME_MSPRINTER_RIGHT_MARGIN(f) = 1440;
+
+ /* Negative for "uinspecified" */
+ FRAME_MSPRINTER_CHARWIDTH(f) = -1;
+ FRAME_MSPRINTER_CHARHEIGHT(f) = -1;
+
+ /* nil is for "system default" for these properties. */
+ FRAME_MSPRINTER_ORIENTATION(f) = Qnil;
+ FRAME_MSPRINTER_DUPLEX(f) = Qnil;
+}
+
+static void
+msprinter_init_frame_3 (struct frame *f)
+{
+ DOCINFO di;
+ struct device *device = XDEVICE (FRAME_DEVICE (f));
+ HDC hdc = DEVICE_MSPRINTER_HDC (device);
+ int frame_left, frame_top, frame_width, frame_height;
+
+ /* Change printer parameters */
+ {
+ DEVMODE* devmode = msprinter_get_devmode_copy (device);
+ devmode->dmFields = 0;
+
+ if (!NILP (FRAME_MSPRINTER_ORIENTATION(f)))
+ {
+ devmode->dmFields = DM_ORIENTATION;
+ if (EQ (FRAME_MSPRINTER_ORIENTATION(f), Qportrait))
+ devmode->dmOrientation = DMORIENT_PORTRAIT;
+ else if (EQ (FRAME_MSPRINTER_ORIENTATION(f), Qlandscape))
+ devmode->dmOrientation = DMORIENT_LANDSCAPE;
+ else
+ abort();
+ }
+
+ if (!NILP (FRAME_MSPRINTER_DUPLEX(f)))
+ {
+ devmode->dmFields = DM_DUPLEX;
+ if (EQ (FRAME_MSPRINTER_DUPLEX(f), Qnone))
+ devmode->dmDuplex = DMDUP_SIMPLEX;
+ if (EQ (FRAME_MSPRINTER_DUPLEX(f), Qvertical))
+ devmode->dmDuplex = DMDUP_VERTICAL;
+ if (EQ (FRAME_MSPRINTER_DUPLEX(f), Qhorizontal))
+ devmode->dmDuplex = DMDUP_HORIZONTAL;
+ else
+ abort();
+ }
+
+ msprinter_apply_devmode (device, devmode);
+ }
+
+ /* Compute geometry properties */
+ frame_left = (MulDiv (GetDeviceCaps (hdc, LOGPIXELSX),
+ FRAME_MSPRINTER_LEFT_MARGIN(f), 1440)
+ - GetDeviceCaps (hdc, PHYSICALOFFSETX));
+
+ if (FRAME_MSPRINTER_CHARWIDTH(f) > 0)
+ {
+ char_to_real_pixel_size (f, FRAME_MSPRINTER_CHARWIDTH(f), 0,
+ &frame_width, NULL);
+ FRAME_MSPRINTER_RIGHT_MARGIN(f) =
+ MulDiv (GetDeviceCaps (hdc, PHYSICALWIDTH)
+ - (frame_left + frame_width), 1440,
+ GetDeviceCaps (hdc, LOGPIXELSX));
+ }
+ else
+ frame_width = (GetDeviceCaps (hdc, PHYSICALWIDTH)
+ - frame_left
+ - MulDiv (GetDeviceCaps (hdc, LOGPIXELSX),
+ FRAME_MSPRINTER_RIGHT_MARGIN(f), 1440));
+
+ frame_top = (MulDiv (GetDeviceCaps (hdc, LOGPIXELSY),
+ FRAME_MSPRINTER_TOP_MARGIN(f), 1440)
+ - GetDeviceCaps (hdc, PHYSICALOFFSETY));
+
+ if (FRAME_MSPRINTER_CHARHEIGHT(f) > 0)
+ {
+ char_to_real_pixel_size (f, 0, FRAME_MSPRINTER_CHARHEIGHT(f),
+ NULL, &frame_height);
+
+ FRAME_MSPRINTER_BOTTOM_MARGIN(f) =
+ MulDiv (GetDeviceCaps (hdc, PHYSICALHEIGHT)
+ - (frame_top + frame_height), 1440,
+ GetDeviceCaps (hdc, LOGPIXELSY));
+ }
+ else
+ frame_height = (GetDeviceCaps (hdc, PHYSICALHEIGHT)
+ - frame_top
+ - MulDiv (GetDeviceCaps (hdc, LOGPIXELSY),
+ FRAME_MSPRINTER_BOTTOM_MARGIN(f), 1440));
+
+ /* Geometry sanity checks */
+ if (!frame_pixsize_valid_p (f, frame_width, frame_height))
+ error ("Area inside print margins has shrunk to naught.");
+
+ if (frame_left < 0
+ || frame_top < 0
+ || frame_left + frame_width > GetDeviceCaps (hdc, HORZRES)
+ || frame_top + frame_height > GetDeviceCaps (hdc, VERTRES))
+ error ("Print area is ouside of the printer's hardware printable area.");
+
+ /* Apply XEmacs frame geometry and layout windows */
+ {
+ int rows, columns;
+ FRAME_PIXWIDTH(f) = frame_width;
+ FRAME_PIXHEIGHT(f) = frame_height;
+ pixel_to_char_size (f, frame_width, frame_height, &columns, &rows);
+ change_frame_size (f, rows, columns, 0);
+ }
+
+ /* Apply DC geometry */
+ SetTextAlign (hdc, TA_BASELINE | TA_LEFT | TA_NOUPDATECP);
+ SetViewportOrgEx (hdc, frame_left, frame_top, NULL);
+ SetWindowOrgEx (hdc, 0, 0, NULL);
+
+ /* Start print job */
+ di.cbSize = sizeof (di);
+ di.lpszDocName = (STRINGP(f->name)
+ ? (char*) XSTRING_DATA(f->name)
+ : "XEmacs print document");
+ di.lpszOutput = NULL;
+ di.lpszDatatype = NULL;
+ di.fwType = 0;
+
+ if (StartDoc (hdc, &di) <= 0)
+ error ("Cannot start print job");
+
+ /* Finish frame setup */
+ FRAME_MSPRINTER_CDC(f) = CreateCompatibleDC (hdc);
+ FRAME_MSPRINTER_JOB_STARTED (f) = 1;
+ FRAME_VISIBLE_P(f) = 0;
+}
+
+static void
+msprinter_mark_frame (struct frame *f)
+{
+ /* NOTE: These need not be marked as long as we allow only c-defined
+ symbols for their values. Although, marking these is safer than
+ expensive. [I know a proof to the theorem postulating that a
+ gator is longer than greener. Ask me. -- kkm] */
+ mark_object (FRAME_MSPRINTER_ORIENTATION (f));
+ mark_object (FRAME_MSPRINTER_DUPLEX (f));
+}
+
+static void
+msprinter_delete_frame (struct frame *f)
+{
+ if (f->frame_data)
+ {
+ if (FRAME_MSPRINTER_JOB_STARTED (f))
+ EndDoc (DEVICE_MSPRINTER_HDC (XDEVICE (FRAME_DEVICE (f))));
+ if (FRAME_MSPRINTER_CDC(f))
+ DeleteDC(FRAME_MSPRINTER_CDC(f));
+ xfree (f->frame_data);
+ }
+
+ f->frame_data = 0;
+}
+
+static Lisp_Object
+msprinter_frame_property (struct frame *f, Lisp_Object property)
+{
+ if (EQ (Qleft_margin, property))
+ return make_int (FRAME_MSPRINTER_LEFT_MARGIN(f));
+ else if (EQ (Qtop_margin, property))
+ return make_int (FRAME_MSPRINTER_TOP_MARGIN(f));
+ if (EQ (Qright_margin, property))
+ return make_int (FRAME_MSPRINTER_RIGHT_MARGIN(f));
+ else if (EQ (Qbottom_margin, property))
+ return make_int (FRAME_MSPRINTER_BOTTOM_MARGIN(f));
+ else if (EQ (Qorientation, property))
+ return FRAME_MSPRINTER_ORIENTATION(f);
+ else if (EQ (Qduplex, property))
+ return FRAME_MSPRINTER_DUPLEX(f);
+ else
+ return Qunbound;
+}
+
+static int
+msprinter_internal_frame_property_p (struct frame *f, Lisp_Object property)
+{
+ return (EQ (Qleft_margin, property) || EQ (Qtop_margin, property) ||
+ EQ (Qright_margin, property) || EQ (Qbottom_margin, property) ||
+ EQ (Qorientation, property) || EQ (Qduplex, property));
+}
+
+static Lisp_Object
+msprinter_frame_properties (struct frame *f)
+{
+ Lisp_Object props = Qnil;
+ props = cons3 (Qorientation, FRAME_MSPRINTER_ORIENTATION(f), props);
+ props = cons3 (Qduplex, FRAME_MSPRINTER_DUPLEX(f), props);
+ props = cons3 (Qbottom_margin,
+ make_int (FRAME_MSPRINTER_BOTTOM_MARGIN(f)), props);
+ props = cons3 (Qright_margin,
+ make_int (FRAME_MSPRINTER_RIGHT_MARGIN(f)), props);
+ props = cons3 (Qtop_margin,
+ make_int (FRAME_MSPRINTER_TOP_MARGIN(f)), props);
+ props = cons3 (Qleft_margin,
+ make_int (FRAME_MSPRINTER_LEFT_MARGIN(f)), props);
+ return props;
+}
+
+static void
+msprinter_set_frame_properties (struct frame *f, Lisp_Object plist)
+{
+ BOOL size_changed_p = FALSE;
+ Lisp_Object tail;
+
+ /* Extract the properties from plist */
+ for (tail = plist; !NILP (tail); tail = Fcdr (Fcdr (tail)))
+ {
+ Lisp_Object prop = Fcar (tail);
+ Lisp_Object val = Fcar (Fcdr (tail));
+
+ if (SYMBOLP (prop))
+ {
+ if (EQ (prop, Qwidth))
+ {
+ maybe_error_if_job_active (f);
+ if (!NILP (val))
+ {
+ CHECK_NATNUM (val);
+ FRAME_MSPRINTER_CHARWIDTH(f) = XINT (val);
+ }
+ }
+ if (EQ (prop, Qheight))
+ {
+ maybe_error_if_job_active (f);
+ if (!NILP (val))
+ {
+ CHECK_NATNUM (val);
+ FRAME_MSPRINTER_CHARHEIGHT(f) = XINT (val);
+ }
+ }
+ else if (EQ (prop, Qleft_margin))
+ {
+ maybe_error_if_job_active (f);
+ CHECK_NATNUM (val);
+ FRAME_MSPRINTER_LEFT_MARGIN(f) = XINT (val);
+ }
+ else if (EQ (prop, Qtop_margin))
+ {
+ maybe_error_if_job_active (f);
+ CHECK_NATNUM (val);
+ FRAME_MSPRINTER_TOP_MARGIN(f) = XINT (val);
+ }
+ else if (EQ (prop, Qright_margin))
+ {
+ maybe_error_if_job_active (f);
+ CHECK_NATNUM (val);
+ FRAME_MSPRINTER_RIGHT_MARGIN(f) = XINT (val);
+ }
+ else if (EQ (prop, Qbottom_margin))
+ {
+ maybe_error_if_job_active (f);
+ CHECK_NATNUM (val);
+ FRAME_MSPRINTER_BOTTOM_MARGIN(f) = XINT (val);
+ }
+ else if (EQ (prop, Qorientation))
+ {
+ maybe_error_if_job_active (f);
+ CHECK_SYMBOL (val);
+ if (!NILP(val) &&
+ !EQ (val, Qportrait) &&
+ !EQ (val, Qlandscape))
+ signal_simple_error ("Page orientation can only be "
+ "'portrait or 'landscape", val);
+ FRAME_MSPRINTER_ORIENTATION(f) = val;
+ }
+ else if (EQ (prop, Qduplex))
+ {
+ maybe_error_if_job_active (f);
+ CHECK_SYMBOL (val);
+ if (!NILP(val) &&
+ !EQ (val, Qnone) &&
+ !EQ (val, Qvertical) &&
+ !EQ (val, Qhorizontal))
+ signal_simple_error ("Duplex can only be 'none, "
+ "'vertical or 'horizontal", val);
+ FRAME_MSPRINTER_DUPLEX(f) = val;
+ }
+ }
+ }
+}
+
+static void
+msprinter_set_frame_size (struct frame *f, int width, int height)
+{
+ /* We're absolutely unsizeable */
+ error_frame_unsizable (f);
+}
+
void
console_type_create_frame_mswindows (void)
{
- /* frame methods */
+ /* Display frames */
CONSOLE_HAS_METHOD (mswindows, init_frame_1);
CONSOLE_HAS_METHOD (mswindows, init_frame_2);
CONSOLE_HAS_METHOD (mswindows, init_frame_3);
CONSOLE_HAS_METHOD (mswindows, get_frame_parent);
CONSOLE_HAS_METHOD (mswindows, update_frame_external_traits);
CONSOLE_HAS_METHOD (mswindows, frame_size_fixed_p);
+
+ /* Printer frames, aka print jobs */
+ CONSOLE_HAS_METHOD (msprinter, init_frame_1);
+ CONSOLE_HAS_METHOD (msprinter, init_frame_3);
+ CONSOLE_HAS_METHOD (msprinter, mark_frame);
+ CONSOLE_HAS_METHOD (msprinter, delete_frame);
+ CONSOLE_HAS_METHOD (msprinter, frame_property);
+ CONSOLE_HAS_METHOD (msprinter, internal_frame_property_p);
+ CONSOLE_HAS_METHOD (msprinter, frame_properties);
+ CONSOLE_HAS_METHOD (msprinter, set_frame_properties);
+ CONSOLE_HAS_METHOD (msprinter, set_frame_size);
}
void
mswindows_console_methods->device_specific_frame_props =
&Vdefault_mswindows_frame_plist;
+
+ DEFVAR_LISP ("default-msprinter-frame-plist", &Vdefault_msprinter_frame_plist /*
+Plist of default frame-creation properties for msprinter print job frames.
+These override what is specified in `default-frame-plist', but are
+overridden by the arguments to the particular call to `make-frame'.
+
+Note: In many cases, properties of a frame are available as specifiers
+instead of through the frame-properties mechanism.
+
+Here is a list of recognized frame properties, other than those
+documented in `set-frame-properties' (they can be queried and
+set at any time, except as otherwise noted):
+
+ left-margin Margin of the page, in twips. Twip is a
+ top-margin typographical unit of measurement,
+ right-margin equal to 1/1440 of an inch, or 1/20 of a
+ bottom-margin point, and roughly equal to 7/400 of a
+ millimeter. If not specifified, each margin
+ defaults to one inch (25.4 mm).
+
+ MARGINS NOTE. right-margin and bottom-margin are overridden by
+ the height and width properties. If you want to specify size
+ of the printable area in character, as with the rest of XEmacs,
+ use these properties. If height and/or width are nil, then
+ corresponding margin setting is taken into account. If you
+ specify height and/or width in `default-frame-plist', but still
+ want to specify right/bottom margins, set height/width in this
+ plist to nil, as in this example:
+
+ (setq default-frame-plist '(height 55 'width 80)
+ default-msprinter-frame-plist '(height nil 'width nil))
+
+
+ orientation Printer page orientation. Can be 'nil,
+ indicating system default, 'portrait
+ or 'landscape.
+
+ duplex Duplex printing mode, subject to printer
+ support. Can be 'nil for the device default,
+ 'none for simplex printing, 'vertical or
+ 'horizontal for duplex page bound along
+ the corresponding page direction.
+
+See also `default-frame-plist', which specifies properties which apply
+to all frames, not just mswindows frames.
+*/ );
+ Vdefault_msprinter_frame_plist = Qnil;
+
+ msprinter_console_methods->device_specific_frame_props =
+ &Vdefault_msprinter_frame_plist;
}
/* We used to map over all frames here and then map over all widgets
belonging to that frame. However it turns out that this was very fragile
- as it requires our display stuctures to be in sync _and_ that the
+ as it requires our display stuctures to be in sync _and_ that the
loop is told about every new widget somebody adds. Therefore we
now let Xt find it for us (which does a bottom-up search which
could even be faster) */
{
CONST char * tmp;
encoding = DEVICE_XATOM_COMPOUND_TEXT (XDEVICE (FRAME_DEVICE (f)));
- GET_C_CHARPTR_EXT_CTEXT_DATA_ALLOCA ((CONST char *) value, tmp);
+ TO_EXTERNAL_FORMAT (C_STRING, value,
+ C_STRING_ALLOCA, tmp,
+ Qctext);
new_XtValue = (String) tmp;
break;
}
#endif /* MULE */
- /* ### Caching is device-independent - belongs in update_frame_title. */
+ /* #### Caching is device-independent - belongs in update_frame_title. */
Xt_GET_VALUE (FRAME_X_SHELL_WIDGET (f), Xt_resource_name, &old_XtValue);
if (!old_XtValue || strcmp (new_XtValue, old_XtValue))
{
if (XSTRING_LENGTH (prop) == 0)
continue;
- GET_C_STRING_CTEXT_DATA_ALLOCA (prop, extprop);
+ TO_EXTERNAL_FORMAT (LISP_STRING, prop,
+ C_STRING_ALLOCA, extprop,
+ Qctext);
if (STRINGP (val))
{
CONST Extbyte *extval;
Extcount extvallen;
- GET_STRING_CTEXT_DATA_ALLOCA (val, extval, extvallen);
+ TO_EXTERNAL_FORMAT (LISP_STRING, val,
+ ALLOCA, (extval, extvallen),
+ Qctext);
XtVaSetValues (w, XtVaTypedArg, extprop,
XtRString, extval, extvallen + 1,
(XtArgVal) NULL);
unsigned int modifier = 0, state = 0;
char *Ctext;
int numItems = 0, textlen = 0, pos = 0;
- struct Lisp_Event *lisp_event = XEVENT(event);
+ Lisp_Event *lisp_event = XEVENT (event);
Lisp_Object item = Qnil;
struct gcpro gcpro1;
{
filePath = transferInfo->dropData->data.files[ii];
hurl = dnd_url_hexify_string ((char *)filePath, "file:");
- /* ### Mule-izing required */
+ /* #### Mule-izing required */
l_data = Fcons (make_string ((Bufbyte* )hurl,
strlen (hurl)),
l_data);
char *dnd_data = NULL;
unsigned long dnd_len = 0;
int dnd_typ = DndText, dnd_dealloc = 0;
- struct Lisp_Event *lisp_event = XEVENT(event);
+ Lisp_Event *lisp_event = XEVENT (event);
/* only drag if this is really a press */
if (EVENT_TYPE(lisp_event) != button_press_event)
#endif
if (STRINGP (f->name))
- GET_C_STRING_CTEXT_DATA_ALLOCA (f->name, name);
+ TO_EXTERNAL_FORMAT (LISP_STRING, f->name,
+ C_STRING_ALLOCA, name,
+ Qctext);
else
name = "emacs";
#else
XtDestroyWidget (FRAME_X_SHELL_WIDGET (f));
/* make sure the windows are really gone! */
- /* ### Is this REALLY necessary? */
+ /* #### Is this REALLY necessary? */
XFlush (dpy);
#endif /* EXTERNAL_WIDGET */
/* Synched up with: FSF 19.30. */
-#ifndef _XEMACS_FRAME_H_
-#define _XEMACS_FRAME_H_
+#ifndef INCLUDED_frame_h_
+#define INCLUDED_frame_h_
#ifdef HAVE_SCROLLBARS
#include "scrollbar.h"
void init_frame (void);
-#endif /* _XEMACS_FRAME_H_ */
+#endif /* INCLUDED_frame_h_ */
Lisp_Object Qbitmap;
Lisp_Object Qboolean;
Lisp_Object Qbottom;
+Lisp_Object Qbottom_margin;
Lisp_Object Qbuffer;
Lisp_Object Qbutton;
Lisp_Object Qcenter;
Lisp_Object Qcommand;
Lisp_Object Qconsole;
Lisp_Object Qcritical;
+Lisp_Object Qctext;
Lisp_Object Qcursor;
Lisp_Object Qdata;
Lisp_Object Qdead;
Lisp_Object Qdimension;
Lisp_Object Qdisplay;
Lisp_Object Qdoc_string;
+Lisp_Object Qduplex;
Lisp_Object Qdynarr_overhead;
Lisp_Object Qempty;
Lisp_Object Qeq;
Lisp_Object Qeval;
Lisp_Object Qextents;
Lisp_Object Qface;
+Lisp_Object Qfile_name;
Lisp_Object Qfont;
Lisp_Object Qframe;
Lisp_Object Qfunction;
Lisp_Object Qinternal;
Lisp_Object Qkey;
Lisp_Object Qkey_assoc;
+Lisp_Object Qkeyboard;
Lisp_Object Qkeymap;
+Lisp_Object Qlandscape;
Lisp_Object Qleft;
+Lisp_Object Qleft_margin;
Lisp_Object Qlist;
Lisp_Object Qmagic;
Lisp_Object Qmalloc_overhead;
Lisp_Object Qminus;
Lisp_Object Qmodifiers;
Lisp_Object Qmotion;
+Lisp_Object Qmsprinter;
Lisp_Object Qmswindows;
Lisp_Object Qname;
Lisp_Object Qnone;
Lisp_Object Qold_rassq;
Lisp_Object Qonly;
Lisp_Object Qor;
+Lisp_Object Qorientation;
Lisp_Object Qother;
Lisp_Object Qpointer;
Lisp_Object Qpopup;
+Lisp_Object Qportrait;
Lisp_Object Qprint;
Lisp_Object Qprocess;
Lisp_Object Qprovide;
Lisp_Object Qreturn;
Lisp_Object Qreverse;
Lisp_Object Qright;
+Lisp_Object Qright_margin;
Lisp_Object Qsearch;
Lisp_Object Qselected;
Lisp_Object Qsignal;
Lisp_Object Qstring;
Lisp_Object Qsymbol;
Lisp_Object Qsyntax;
+Lisp_Object Qterminal;
Lisp_Object Qtest;
Lisp_Object Qtext;
Lisp_Object Qtimeout;
Lisp_Object Qtimestamp;
Lisp_Object Qtoolbar;
Lisp_Object Qtop;
+Lisp_Object Qtop_margin;
Lisp_Object Qtty;
Lisp_Object Qtype;
Lisp_Object Qundecided;
defsymbol (&Qbitmap, "bitmap");
defsymbol (&Qboolean, "boolean");
defsymbol (&Qbottom, "bottom");
+ defsymbol (&Qbottom_margin, "bottom-margin");
defsymbol (&Qbuffer, "buffer");
defsymbol (&Qbutton, "button");
defsymbol (&Qcategory, "category");
defsymbol (&Qcommand, "command");
defsymbol (&Qconsole, "console");
defsymbol (&Qcritical, "critical");
+ defsymbol (&Qctext, "ctext");
defsymbol (&Qcursor, "cursor");
defsymbol (&Qdata, "data");
defsymbol (&Qdead, "dead");
defsymbol (&Qdimension, "dimension");
defsymbol (&Qdisplay, "display");
defsymbol (&Qdoc_string, "doc-string");
+ defsymbol (&Qduplex, "duplex");
defsymbol (&Qdynarr_overhead, "dynarr-overhead");
defsymbol (&Qempty, "empty");
defsymbol (&Qeq, "eq");
defsymbol (&Qeval, "eval");
defsymbol (&Qextents, "extents");
defsymbol (&Qface, "face");
+ defsymbol (&Qfile_name, "file-name");
defsymbol (&Qfont, "font");
defsymbol (&Qframe, "frame");
defsymbol (&Qfunction, "function");
defsymbol (&Qinternal, "internal");
defsymbol (&Qkey, "key");
defsymbol (&Qkey_assoc, "key-assoc");
+ defsymbol (&Qkeyboard, "keyboard");
defsymbol (&Qkeymap, "keymap");
+ defsymbol (&Qlandscape, "landscape");
defsymbol (&Qleft, "left");
+ defsymbol (&Qleft_margin, "left-margin");
defsymbol (&Qlist, "list");
defsymbol (&Qmagic, "magic");
defsymbol (&Qmalloc_overhead, "malloc-overhead");
defsymbol (&Qminus, "-");
defsymbol (&Qmodifiers, "modifiers");
defsymbol (&Qmotion, "motion");
+ defsymbol (&Qmsprinter, "msprinter");
defsymbol (&Qmswindows, "mswindows");
defsymbol (&Qname, "name");
defsymbol (&Qnone, "none");
defsymbol (&Qold_rassq, "old-rassq");
defsymbol (&Qonly, "only");
defsymbol (&Qor, "or");
+ defsymbol (&Qorientation, "orientation");
defsymbol (&Qother, "other");
defsymbol (&Qpointer, "pointer");
defsymbol (&Qpopup, "popup");
+ defsymbol (&Qportrait, "portrait");
defsymbol (&Qprint, "print");
defsymbol (&Qprocess, "process");
defsymbol (&Qprovide, "provide");
defsymbol (&Qreturn, "return");
defsymbol (&Qreverse, "reverse");
defsymbol (&Qright, "right");
+ defsymbol (&Qright_margin, "right-margin");
defsymbol (&Qsearch, "search");
defsymbol (&Qselected, "selected");
defsymbol (&Qsignal, "signal");
defsymbol (&Qstring, "string");
defsymbol (&Qsymbol, "symbol");
defsymbol (&Qsyntax, "syntax");
+ defsymbol (&Qterminal, "terminal");
defsymbol (&Qtest, "test");
defsymbol (&Qtext, "text");
defsymbol (&Qtimeout, "timeout");
defsymbol (&Qtimestamp, "timestamp");
defsymbol (&Qtoolbar, "toolbar");
defsymbol (&Qtop, "top");
+ defsymbol (&Qtop_margin, "top-margin");
defsymbol (&Qtty, "tty");
defsymbol (&Qtype, "type");
defsymbol (&Qundecided, "undecided");
loadavg[elem++] = load_info.fifteen_minute;
#endif /* DGUX */
-#if !defined (LDAV_DONE) && defined (apollo)
-#define LDAV_DONE
-/* Apollo code from lisch@mentorg.com (Ray Lischner).
-
- This system call is not documented. The load average is obtained as
- three long integers, for the load average over the past minute,
- five minutes, and fifteen minutes. Each value is a scaled integer,
- with 16 bits of integer part and 16 bits of fraction part.
-
- I'm not sure which operating system first supported this system call,
- but I know that SR10.2 supports it. */
-
- extern void proc1_$get_loadav ();
- unsigned long load_ave[3];
-
- proc1_$get_loadav (load_ave);
-
- if (nelem > 0)
- loadavg[elem++] = load_ave[0] / 65536.0;
- if (nelem > 1)
- loadavg[elem++] = load_ave[1] / 65536.0;
- if (nelem > 2)
- loadavg[elem++] = load_ave[2] / 65536.0;
-#endif /* apollo */
-
#if !defined (LDAV_DONE) && defined (OSF_MIPS)
#define LDAV_DONE
/* Synched up with: FSF 19.30. */
+#ifndef INCLUDED_getpagesize_h_
+#define INCLUDED_getpagesize_h_
+
/* Emulate getpagesize on systems that lack it. */
#if 0
#endif /* _SC_PAGESIZE */
#endif /* not HAVE_GETPAGESIZE */
+#endif /* INCLUDED_getpagesize_h_ */
* 19 Jan 98 - Version 3.1 by Jareth Hein (Support for user-defined I/O). *
******************************************************************************/
-#ifndef GIF_LIB_H
-#define GIF_LIB_H
+#ifndef INCLUDED_gifrlib_h_
+#define INCLUDED_gifrlib_h_
#define GIF_ERROR 0
#define GIF_OK 1
ColorMapObject *MakeMapObject(int ColorCount, GifColorType *ColorMap);
void FreeMapObject(ColorMapObject *Object);
-
-#endif /* GIF_LIB_H */
+#endif /* INCLUDED_gifrlib_h_ */
Lisp_Object Qmswindows_resource;
static void
-mswindows_initialize_dibitmap_image_instance (struct Lisp_Image_Instance *ii,
+mswindows_initialize_dibitmap_image_instance (Lisp_Image_Instance *ii,
int slices,
enum image_instance_type type);
static void
-mswindows_initialize_image_instance_mask (struct Lisp_Image_Instance* image,
+mswindows_initialize_image_instance_mask (Lisp_Image_Instance* image,
struct frame* f);
-COLORREF mswindows_string_to_color (CONST char *name);
-
#define BPLINE(width) ((int)(~3UL & (unsigned long)((width) +3)))
/************************************************************************/
(IS_DIRECTORY_SEP(XSTRING_BYTE (name, 2)))))))
{
if (!NILP (Ffile_readable_p (name)))
- return name;
+ return Fexpand_file_name (name, Qnil);
else
return Qnil;
}
in the error message. */
static void
-init_image_instance_from_dibitmap (struct Lisp_Image_Instance *ii,
+init_image_instance_from_dibitmap (Lisp_Image_Instance *ii,
BITMAPINFO *bmp_info,
int dest_mask,
void *bmp_data,
}
static void
-image_instance_add_dibitmap (struct Lisp_Image_Instance *ii,
+image_instance_add_dibitmap (Lisp_Image_Instance *ii,
BITMAPINFO *bmp_info,
void *bmp_data,
int bmp_bits,
}
static void
-mswindows_init_image_instance_from_eimage (struct Lisp_Image_Instance *ii,
+mswindows_init_image_instance_from_eimage (Lisp_Image_Instance *ii,
int width, int height,
int slices,
unsigned char *eimage,
}
static void
-mswindows_initialize_image_instance_mask (struct Lisp_Image_Instance* image,
+mswindows_initialize_image_instance_mask (Lisp_Image_Instance* image,
struct frame* f)
{
HBITMAP mask;
}
void
-mswindows_initialize_image_instance_icon (struct Lisp_Image_Instance* image,
+mswindows_initialize_image_instance_icon (Lisp_Image_Instance* image,
int cursor)
{
ICONINFO x_icon;
}
HBITMAP
-mswindows_create_resized_bitmap (struct Lisp_Image_Instance* ii,
+mswindows_create_resized_bitmap (Lisp_Image_Instance* ii,
struct frame* f,
int newx, int newy)
{
}
HBITMAP
-mswindows_create_resized_mask (struct Lisp_Image_Instance* ii,
+mswindows_create_resized_mask (Lisp_Image_Instance* ii,
struct frame* f,
int newx, int newy)
{
}
int
-mswindows_resize_dibitmap_instance (struct Lisp_Image_Instance* ii,
+mswindows_resize_dibitmap_instance (Lisp_Image_Instance* ii,
struct frame* f,
int newx, int newy)
{
colortbl[j].color =
COLOR_INSTANCE_MSWINDOWS_COLOR (XCOLOR_INSTANCE (XCDR (cons)));
- GET_C_STRING_OS_DATA_ALLOCA (XCAR (cons), colortbl[j].name);
+ TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (cons),
+ C_STRING_ALLOCA, colortbl[j].name,
+ Qnative);
colortbl[j].name = xstrdup (colortbl[j].name); /* mustn't lose this when we return */
free_cons (XCONS (cons));
cons = results;
Lisp_Object pointer_fg, Lisp_Object pointer_bg,
int dest_mask, Lisp_Object domain)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii);
CONST Extbyte *bytes;
Extcount len;
assert (!NILP (data));
- GET_STRING_BINARY_DATA_ALLOCA (data, bytes, len);
+ TO_EXTERNAL_FORMAT (LISP_STRING, data,
+ ALLOCA, (bytes, len),
+ Qbinary);
/* in case we have color symbols */
color_symbols = extract_xpm_color_names (device, domain,
Lisp_Object pointer_fg, Lisp_Object pointer_bg,
int dest_mask, Lisp_Object domain)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii);
CONST Extbyte *bytes;
Extcount len;
assert (!NILP (data));
- GET_STRING_BINARY_DATA_ALLOCA (data, bytes, len);
+ TO_EXTERNAL_FORMAT (LISP_STRING, data,
+ ALLOCA, (bytes, len),
+ Qbinary);
/* Then slurp the image into memory, decoding along the way.
The result is the image in a simple one-byte-per-pixel
do {
Extbyte* nm=0;
- GET_C_STRING_OS_DATA_ALLOCA (name, nm);
+ TO_EXTERNAL_FORMAT (LISP_STRING, name,
+ C_STRING_ALLOCA, nm,
+ Qnative);
if (!strcasecmp ((char*)res->name, nm))
return res->resource_id;
} while ((++res)->name);
Lisp_Object pointer_fg, Lisp_Object pointer_bg,
int dest_mask, Lisp_Object domain)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
unsigned int type = 0;
HANDLE himage = NULL;
LPCTSTR resid=0;
if (!NILP (file))
{
Extbyte* f=0;
- GET_C_STRING_FILENAME_DATA_ALLOCA (file, f);
+ TO_EXTERNAL_FORMAT (LISP_STRING, file,
+ C_STRING_ALLOCA, f,
+ Qfile_name);
#ifdef __CYGWIN32__
CYGWIN_WIN32_PATH (f, fname);
#else
type));
if (!resid)
- GET_C_STRING_OS_DATA_ALLOCA (resource_id, resid);
+ TO_EXTERNAL_FORMAT (LISP_STRING, resource_id,
+ C_STRING_ALLOCA, resid,
+ Qnative);
}
}
else if (!(resid = MAKEINTRESOURCE (resource_name_to_resource (resource_id,
image instance accordingly. */
static void
-init_image_instance_from_xbm_inline (struct Lisp_Image_Instance *ii,
+init_image_instance_from_xbm_inline (Lisp_Image_Instance *ii,
int width, int height,
/* Note that data is in ext-format! */
CONST char *bits,
{
Lisp_Object mask_data = find_keyword_in_vector (instantiator, Q_mask_data);
Lisp_Object mask_file = find_keyword_in_vector (instantiator, Q_mask_file);
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
struct frame* f = XFRAME (DEVICE_SELECTED_FRAME
(XDEVICE (IMAGE_INSTANCE_DEVICE (ii))));
HDC hdc = FRAME_MSWINDOWS_CDC (f);
HBITMAP mask = 0;
- CONST char *gcc_may_you_rot_in_hell;
if (!NILP (mask_data))
{
- GET_C_STRING_BINARY_DATA_ALLOCA (XCAR (XCDR (XCDR (mask_data))),
- gcc_may_you_rot_in_hell);
- mask =
- xbm_create_bitmap_from_data ( hdc,
- (unsigned char *)
- gcc_may_you_rot_in_hell,
- XINT (XCAR (mask_data)),
- XINT (XCAR (XCDR (mask_data))), FALSE,
- PALETTERGB (0,0,0),
- PALETTERGB (255,255,255));
+ CONST char *ext_data;
+
+ TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (XCDR (XCDR (mask_data))),
+ C_STRING_ALLOCA, ext_data,
+ Qbinary);
+ mask = xbm_create_bitmap_from_data (hdc,
+ (unsigned char *) ext_data,
+ XINT (XCAR (mask_data)),
+ XINT (XCAR (XCDR (mask_data))),
+ FALSE,
+ PALETTERGB (0,0,0),
+ PALETTERGB (255,255,255));
}
init_image_instance_from_xbm_inline (ii, width, height, bits,
int dest_mask, Lisp_Object domain)
{
Lisp_Object data = find_keyword_in_vector (instantiator, Q_data);
- CONST char *gcc_go_home;
+ CONST char *ext_data;
assert (!NILP (data));
- GET_C_STRING_BINARY_DATA_ALLOCA (XCAR (XCDR (XCDR (data))),
- gcc_go_home);
+ TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (XCDR (XCDR (data))),
+ C_STRING_ALLOCA, ext_data,
+ Qbinary);
xbm_instantiate_1 (image_instance, instantiator, pointer_fg,
pointer_bg, dest_mask, XINT (XCAR (data)),
- XINT (XCAR (XCDR (data))), gcc_go_home);
+ XINT (XCAR (XCDR (data))), ext_data);
}
#ifdef HAVE_XFACE
assert (!NILP (data));
- GET_C_STRING_BINARY_DATA_ALLOCA (data, dstring);
+ TO_EXTERNAL_FORMAT (LISP_STRING, data,
+ C_STRING_ALLOCA, dstring,
+ Qbinary);
if ((p = strchr (dstring, ':')))
{
/************************************************************************/
static void
-mswindows_print_image_instance (struct Lisp_Image_Instance *p,
+mswindows_print_image_instance (Lisp_Image_Instance *p,
Lisp_Object printcharfun,
int escapeflag)
{
#endif
static void
-mswindows_finalize_image_instance (struct Lisp_Image_Instance *p)
+mswindows_finalize_image_instance (Lisp_Image_Instance *p)
{
if (DEVICE_LIVE_P (XDEVICE (p->device)))
{
/* subwindow and widget support */
/************************************************************************/
+static HFONT
+mswindows_widget_hfont (Lisp_Image_Instance *p,
+ Lisp_Object domain)
+{
+ Lisp_Object face = IMAGE_INSTANCE_WIDGET_FACE (p);
+ int under = FACE_UNDERLINE_P (face, domain);
+ int strike = FACE_STRIKETHRU_P (face, domain);
+ Lisp_Object font = query_string_font (IMAGE_INSTANCE_WIDGET_TEXT (p),
+ face, domain);
+
+ return mswindows_get_hfont (XFONT_INSTANCE (font), under, strike);
+}
+
/* unmap the image if it is a widget. This is used by redisplay via
redisplay_unmap_subwindows */
static void
-mswindows_unmap_subwindow (struct Lisp_Image_Instance *p)
+mswindows_unmap_subwindow (Lisp_Image_Instance *p)
{
if (IMAGE_INSTANCE_SUBWINDOW_ID (p))
{
0, 0, 0, 0,
SWP_HIDEWINDOW | SWP_NOMOVE | SWP_NOSIZE
| SWP_NOSENDCHANGING);
+ if (GetFocus() == WIDGET_INSTANCE_MSWINDOWS_HANDLE (p))
+ SetFocus (GetParent (IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p)));
}
}
/* map the subwindow. This is used by redisplay via
redisplay_output_subwindow */
static void
-mswindows_map_subwindow (struct Lisp_Image_Instance *p, int x, int y,
+mswindows_map_subwindow (Lisp_Image_Instance *p, int x, int y,
struct display_glyph_area* dga)
{
- SetFocus (GetParent (IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p)));
/* move the window before mapping it ... */
SetWindowPos (IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p),
NULL,
/* resize the subwindow instance */
static void
-mswindows_resize_subwindow (struct Lisp_Image_Instance* ii, int w, int h)
+mswindows_resize_subwindow (Lisp_Image_Instance* ii, int w, int h)
{
/* Set the size of the control .... */
SetWindowPos (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii),
/* when you click on a widget you may activate another widget this
needs to be checked and all appropriate widgets updated */
static void
-mswindows_update_subwindow (struct Lisp_Image_Instance *p)
+mswindows_update_subwindow (Lisp_Image_Instance *p)
{
/* Now do widget specific updates. */
if (IMAGE_INSTANCE_TYPE (p) == IMAGE_WIDGET)
/* set the widget font from the widget face */
SendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p),
WM_SETFONT,
- (WPARAM)FONT_INSTANCE_MSWINDOWS_HFONT
- (XFONT_INSTANCE (query_string_font
- (IMAGE_INSTANCE_WIDGET_TEXT (p),
- IMAGE_INSTANCE_WIDGET_FACE (p),
- IMAGE_INSTANCE_SUBWINDOW_FRAME (p)))),
+ (WPARAM) mswindows_widget_hfont
+ (p, IMAGE_INSTANCE_SUBWINDOW_FRAME (p)),
MAKELPARAM (TRUE, 0));
}
}
Lisp_Object pointer_fg, Lisp_Object pointer_bg,
int dest_mask, Lisp_Object domain)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii);
struct device* d = XDEVICE (device);
Lisp_Object frame = FW_FRAME (domain);
}
static int
-mswindows_image_instance_equal (struct Lisp_Image_Instance *p1,
- struct Lisp_Image_Instance *p2, int depth)
+mswindows_image_instance_equal (Lisp_Image_Instance *p1,
+ Lisp_Image_Instance *p2, int depth)
{
switch (IMAGE_INSTANCE_TYPE (p1))
{
}
static unsigned long
-mswindows_image_instance_hash (struct Lisp_Image_Instance *p, int depth)
+mswindows_image_instance_hash (Lisp_Image_Instance *p, int depth)
{
switch (IMAGE_INSTANCE_TYPE (p))
{
methods are called. */
static void
-mswindows_initialize_dibitmap_image_instance (struct Lisp_Image_Instance *ii,
+mswindows_initialize_dibitmap_image_instance (Lisp_Image_Instance *ii,
int slices,
enum image_instance_type type)
{
CONST char* class, int flags, int exflags)
{
/* this function can call lisp */
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii), style;
struct device* d = XDEVICE (device);
Lisp_Object frame = FW_FRAME (domain);
HWND wnd;
int id = 0xffff;
Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii);
- struct Lisp_Gui_Item* pgui = XGUI_ITEM (gui);
+ Lisp_Gui_Item* pgui = XGUI_ITEM (gui);
if (!DEVICE_MSWINDOWS_P (d))
signal_simple_error ("Not an mswindows device", device);
}
if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii)))
- GET_C_STRING_OS_DATA_ALLOCA (IMAGE_INSTANCE_WIDGET_TEXT (ii), nm);
+ TO_EXTERNAL_FORMAT (LISP_STRING, IMAGE_INSTANCE_WIDGET_TEXT (ii),
+ C_STRING_ALLOCA, nm,
+ Qnative);
/* allocate space for the clip window and then allocate the clip window */
ii->data = xnew_and_zero (struct mswindows_subwindow_data);
SetWindowLong (wnd, GWL_USERDATA, (LONG)LISP_TO_VOID(image_instance));
/* set the widget font from the widget face */
SendMessage (wnd, WM_SETFONT,
- (WPARAM)FONT_INSTANCE_MSWINDOWS_HFONT
- (XFONT_INSTANCE (query_string_font
- (IMAGE_INSTANCE_WIDGET_TEXT (ii),
- IMAGE_INSTANCE_WIDGET_FACE (ii),
- domain))),
+ (WPARAM) mswindows_widget_hfont (ii, domain),
MAKELPARAM (TRUE, 0));
}
int dest_mask, Lisp_Object domain)
{
/* this function can call lisp */
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
HWND wnd;
int flags = WS_TABSTOP;/* BS_NOTIFY #### is needed to get exotic feedback
only. Since we seem to want nothing beyond BN_CLICK,
the style is perhaps not necessary -- kkm */
Lisp_Object style;
Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii);
- struct Lisp_Gui_Item* pgui = XGUI_ITEM (gui);
+ Lisp_Gui_Item* pgui = XGUI_ITEM (gui);
Lisp_Object glyph = find_keyword_in_vector (instantiator, Q_image);
if (!NILP (glyph))
}
mswindows_widget_instantiate (image_instance, instantiator, pointer_fg,
- pointer_bg, dest_mask, domain, "BUTTON",
+ pointer_bg, dest_mask, domain, "BUTTON",
flags, 0);
wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii);
else
SendMessage (wnd, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0);
/* add the image if one was given */
- if (!NILP (glyph) && IMAGE_INSTANCEP (glyph))
+ if (!NILP (glyph) && IMAGE_INSTANCEP (glyph)
+ &&
+ IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (glyph)))
{
SendMessage (wnd, BM_SETIMAGE,
(WPARAM) (XIMAGE_INSTANCE_MSWINDOWS_BITMAP (glyph) ?
int dest_mask, Lisp_Object domain)
{
HWND wnd;
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
mswindows_widget_instantiate (image_instance, instantiator, pointer_fg,
pointer_bg, dest_mask, domain, PROGRESS_CLASS,
WS_BORDER | PBS_SMOOTH, WS_EX_CLIENTEDGE);
{
tvitem.item.lParam = mswindows_register_gui_item (item, domain);
tvitem.item.mask |= TVIF_PARAM;
- GET_C_STRING_OS_DATA_ALLOCA (XGUI_ITEM (item)->name,
- tvitem.item.pszText);
+ TO_EXTERNAL_FORMAT (LISP_STRING, XGUI_ITEM (item)->name,
+ C_STRING_ALLOCA, tvitem.item.pszText,
+ Qnative);
}
else
- GET_C_STRING_OS_DATA_ALLOCA (item, tvitem.item.pszText);
+ TO_EXTERNAL_FORMAT (LISP_STRING, item,
+ C_STRING_ALLOCA, tvitem.item.pszText,
+ Qnative);
tvitem.item.cchTextMax = strlen (tvitem.item.pszText);
Lisp_Object rest;
HWND wnd;
HTREEITEM parent;
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
mswindows_widget_instantiate (image_instance, instantiator, pointer_fg,
pointer_bg, dest_mask, domain, WC_TREEVIEW,
WS_TABSTOP | WS_BORDER | PBS_SMOOTH
{
tvitem.lParam = mswindows_register_gui_item (item, domain);
tvitem.mask |= TCIF_PARAM;
- GET_C_STRING_OS_DATA_ALLOCA (XGUI_ITEM (item)->name,
- tvitem.pszText);
+ TO_EXTERNAL_FORMAT (LISP_STRING, XGUI_ITEM (item)->name,
+ C_STRING_ALLOCA, tvitem.pszText,
+ Qnative);
}
else
{
CHECK_STRING (item);
- GET_C_STRING_OS_DATA_ALLOCA (item, tvitem.pszText);
+ TO_EXTERNAL_FORMAT (LISP_STRING, item,
+ C_STRING_ALLOCA, tvitem.pszText,
+ Qnative);
}
tvitem.cchTextMax = strlen (tvitem.pszText);
Lisp_Object rest;
HWND wnd;
int i = 0;
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
Lisp_Object orient = find_keyword_in_vector (instantiator, Q_orientation);
unsigned int flags = WS_TABSTOP;
mswindows_tab_control_set_property (Lisp_Object image_instance, Lisp_Object prop,
Lisp_Object val)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
if (EQ (prop, Q_items))
{
Lisp_Object pointer_fg, Lisp_Object pointer_bg,
int dest_mask, Lisp_Object domain)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
HANDLE wnd;
Lisp_Object rest;
Lisp_Object data = Fplist_get (find_keyword_in_vector (instantiator, Q_properties),
height = (height + WIDGET_BORDER_HEIGHT * 2 ) * len;
IMAGE_INSTANCE_HEIGHT (ii) = height;
-
+
/* Now create the widget. */
mswindows_widget_instantiate (image_instance, instantiator, pointer_fg,
pointer_bg, dest_mask, domain, "COMBOBOX",
| CBS_HASSTRINGS | WS_VSCROLL,
WS_EX_CLIENTEDGE);
/* Reset the height. layout will probably do this safely, but better make sure. */
- image_instance_layout (image_instance,
+ image_instance_layout (image_instance,
IMAGE_UNSPECIFIED_GEOMETRY,
IMAGE_UNSPECIFIED_GEOMETRY,
domain);
LIST_LOOP (rest, Fplist_get (IMAGE_INSTANCE_WIDGET_PROPS (ii), Q_items, Qnil))
{
Extbyte* lparam;
- GET_C_STRING_OS_DATA_ALLOCA (XCAR (rest), lparam);
+ TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (rest),
+ C_STRING_ALLOCA, lparam,
+ Qnative);
if (SendMessage (wnd, CB_ADDSTRING, 0, (LPARAM)lparam) == CB_ERR)
signal_simple_error ("error adding combo entries", instantiator);
}
static Lisp_Object
mswindows_widget_property (Lisp_Object image_instance, Lisp_Object prop)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
HANDLE wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii);
/* get the text from a control */
if (EQ (prop, Q_text))
Extbyte* buf =alloca (len+1);
SendMessage (wnd, WM_GETTEXT, (WPARAM)len+1, (LPARAM) buf);
- return build_ext_string (buf, FORMAT_OS);
+ return build_ext_string (buf, Qnative);
}
return Qunbound;
}
static Lisp_Object
mswindows_button_property (Lisp_Object image_instance, Lisp_Object prop)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
HANDLE wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii);
/* check the state of a button */
if (EQ (prop, Q_selected))
static Lisp_Object
mswindows_combo_box_property (Lisp_Object image_instance, Lisp_Object prop)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
HANDLE wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii);
/* get the text from a control */
if (EQ (prop, Q_text))
Extcount len = SendMessage (wnd, CB_GETLBTEXTLEN, (WPARAM)item, 0);
Extbyte* buf = alloca (len+1);
SendMessage (wnd, CB_GETLBTEXT, (WPARAM)item, (LPARAM)buf);
- return build_ext_string (buf, FORMAT_OS);
+ return build_ext_string (buf, Qnative);
}
return Qunbound;
}
mswindows_widget_set_property (Lisp_Object image_instance, Lisp_Object prop,
Lisp_Object val)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
if (EQ (prop, Q_text))
{
Extbyte* lparam=0;
CHECK_STRING (val);
- GET_C_STRING_OS_DATA_ALLOCA (val, lparam);
+ TO_EXTERNAL_FORMAT (LISP_STRING, val,
+ C_STRING_ALLOCA, lparam,
+ Qnative);
SendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii),
WM_SETTEXT, 0, (LPARAM)lparam);
/* We don't return Qt here so that other widget methods can be
mswindows_progress_gauge_set_property (Lisp_Object image_instance, Lisp_Object prop,
Lisp_Object val)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
if (EQ (prop, Q_percent))
{
/* Synched up with: Not in FSF. */
-#ifndef _XEMACS_GLYPHS_MSW_H_
-#define _XEMACS_GLYPHS_MSW_H_
+#ifndef INCLUDED_glyphs_msw_h_
+#define INCLUDED_glyphs_msw_h_
#ifdef HAVE_MS_WINDOWS
IMAGE_INSTANCE_MSWINDOWS_ICON (XIMAGE_INSTANCE (i))
int
-mswindows_resize_dibitmap_instance (struct Lisp_Image_Instance* ii,
+mswindows_resize_dibitmap_instance (Lisp_Image_Instance* ii,
struct frame* f,
int newx, int newy);
HBITMAP
-mswindows_create_resized_bitmap (struct Lisp_Image_Instance* ii,
+mswindows_create_resized_bitmap (Lisp_Image_Instance* ii,
struct frame* f,
int newx, int newy);
HBITMAP
-mswindows_create_resized_mask (struct Lisp_Image_Instance* ii,
+mswindows_create_resized_mask (Lisp_Image_Instance* ii,
struct frame* f,
int newx, int newy);
void
-mswindows_initialize_image_instance_icon (struct Lisp_Image_Instance* image,
+mswindows_initialize_image_instance_icon (Lisp_Image_Instance* image,
int cursor);
#define WIDGET_INSTANCE_MSWINDOWS_HANDLE(i) \
IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (XIMAGE_INSTANCE (i))
#endif /* HAVE_MS_WINDOWS */
-#endif /* _XEMACS_GLYPHS_MSW_H_ */
+
+#endif /* INCLUDED_glyphs_msw_h_ */
#endif
/* TODO:
- - more complex controls.
- tooltips for controls, especially buttons.
+ - keyboard traversal.
+ - lisp configurable layout.
*/
/* In MS-Windows normal windows work in pixels, dialog boxes work in
static Lisp_Object
widget_property (Lisp_Object image_instance, Lisp_Object prop)
{
- struct Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance);
struct image_instantiator_methods* meths;
/* first see if its a general property ... */
static Lisp_Object
widget_set_property (Lisp_Object image_instance, Lisp_Object prop, Lisp_Object val)
{
- struct Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance);
struct image_instantiator_methods* meths;
Lisp_Object ret;
unsigned int* width, unsigned int* height,
enum image_instance_geometry disp, Lisp_Object domain)
{
- struct Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance);
struct image_instantiator_methods* meths;
/* First just set up what we already have. */
widget_layout (Lisp_Object image_instance,
unsigned int width, unsigned int height, Lisp_Object domain)
{
- struct Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance);
struct image_instantiator_methods* meths;
/* .. then try device specific methods ... */
}
static void
-initialize_widget_image_instance (struct Lisp_Image_Instance *ii, Lisp_Object type)
+initialize_widget_image_instance (Lisp_Image_Instance *ii, Lisp_Object type)
{
/* initialize_subwindow_image_instance (ii);*/
IMAGE_INSTANCE_WIDGET_TYPE (ii) = type;
Lisp_Object pointer_fg, Lisp_Object pointer_bg,
int dest_mask, Lisp_Object domain)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
Lisp_Object face = find_keyword_in_vector (instantiator, Q_face);
Lisp_Object height = find_keyword_in_vector (instantiator, Q_height);
Lisp_Object width = find_keyword_in_vector (instantiator, Q_width);
Lisp_Object desc = find_keyword_in_vector (instantiator, Q_descriptor);
Lisp_Object glyph = find_keyword_in_vector (instantiator, Q_image);
Lisp_Object props = find_keyword_in_vector (instantiator, Q_properties);
+ Lisp_Object items = find_keyword_in_vector (instantiator, Q_items);
Lisp_Object orient = find_keyword_in_vector (instantiator, Q_orientation);
int pw=0, ph=0, tw=0, th=0;
subwindow_instantiate (image_instance, instantiator, pointer_fg, pointer_bg,
dest_mask, domain);
- if (!(dest_mask & IMAGE_WIDGET_MASK))
- incompatible_image_types (instantiator, dest_mask, IMAGE_WIDGET_MASK);
+ if (!(dest_mask & (IMAGE_WIDGET_MASK | IMAGE_LAYOUT_MASK)))
+ incompatible_image_types (instantiator, dest_mask,
+ IMAGE_WIDGET_MASK | IMAGE_LAYOUT_MASK);
initialize_widget_image_instance (ii, XVECTOR_DATA (instantiator)[0]);
+ IMAGE_INSTANCE_TYPE (ii) = IMAGE_WIDGET;
+ IMAGE_INSTANCE_WIDGET_PROPS (ii) = props;
+
/* retrieve the fg and bg colors */
if (!NILP (face))
SET_IMAGE_INSTANCE_WIDGET_FACE (ii, Fget_face (face));
- /* data items for some widgets */
- IMAGE_INSTANCE_WIDGET_PROPS (ii) = props;
+ /* Do layout specific initialisation. This feels a bit tacky, but
+ the alternative is a myriad of different little functions. */
+ if (EQ (IMAGE_INSTANCE_WIDGET_TYPE (ii), Qlayout))
+ {
+ Lisp_Object rest, children = Qnil;
+ Lisp_Object border = find_keyword_in_vector (instantiator, Q_border);
- /* Pick up the orientation before we do our first layout. */
- if (EQ (orient, Qleft) || EQ (orient, Qright) || EQ (orient, Qvertical))
- IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) = 1;
+ if (NILP (orient))
+ {
+ IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) = LAYOUT_VERTICAL;
+ }
+ IMAGE_INSTANCE_TYPE (ii) = IMAGE_LAYOUT;
+
+ if (EQ (border, Qt))
+ {
+ IMAGE_INSTANCE_LAYOUT_BORDER (ii) = Qetched_in;
+ }
+ else if (GLYPHP (border))
+ {
+ /* We are going to be sneaky here and add the border text as
+ just another child, the layout and output routines don't know
+ this and will just display at the offsets we prescribe. */
+ children = Fcons (glyph_image_instance (border, domain, ERROR_ME, 1),
+ children);
+ IMAGE_INSTANCE_LAYOUT_BORDER (ii) = make_int (0);
+ }
+ else
+ {
+ IMAGE_INSTANCE_LAYOUT_BORDER (ii) = border;
+ }
+ /* Pick up the sub-widgets. */
+ LIST_LOOP (rest, items)
+ {
+ /* make sure the image is instantiated */
+ Lisp_Object gii = glyph_image_instance (XCAR (rest), domain, ERROR_ME, 1);
+ children = Fcons (gii, children);
+ /* Make sure elements in the layout are in the order the
+ user expected. */
+ children = Fnreverse (children);
+ }
+ IMAGE_INSTANCE_LAYOUT_CHILDREN (ii) = children;
+ }
/* retrieve the gui item information. This is easy if we have been
provided with a vector, more difficult if we have just been given
keywords */
- if (STRINGP (desc) || NILP (desc))
+ else if (STRINGP (desc) || NILP (desc))
{
/* big cheat - we rely on the fact that a gui item looks like an instantiator */
IMAGE_INSTANCE_WIDGET_ITEMS (ii) =
IMAGE_INSTANCE_WIDGET_ITEMS (ii) =
gui_parse_item_keywords_no_errors (desc);
+ /* Pick up the orientation before we do our first layout. */
+ if (EQ (orient, Qleft) || EQ (orient, Qright) || EQ (orient, Qvertical))
+ IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) = 1;
+
/* parse more gui items out of the properties */
- if (!NILP (props))
+ if (!NILP (props)
+ && !EQ (IMAGE_INSTANCE_WIDGET_TYPE (ii), Qlayout))
{
- Lisp_Object items = Fplist_get (props, Q_items, Qnil);
+ if (NILP (items))
+ {
+ items = Fplist_get (props, Q_items, Qnil);
+ }
if (!NILP (items))
- IMAGE_INSTANCE_WIDGET_ITEMS (ii) =
- Fcons (IMAGE_INSTANCE_WIDGET_ITEMS (ii),
- parse_gui_item_tree_children (items));
+ {
+ IMAGE_INSTANCE_WIDGET_ITEMS (ii) =
+ Fcons (IMAGE_INSTANCE_WIDGET_ITEMS (ii),
+ parse_gui_item_tree_children (items));
+ }
}
/* Normalize size information. We now only assign sizes if the user
IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 0;
}
- /* have to set the type this late in case there is no device
- instantiation for a widget */
- IMAGE_INSTANCE_TYPE (ii) = IMAGE_WIDGET;
-
/* When we create the widgets the window system expects a valid
size, so If we still don' t have sizes, call layout to pick them
up. If query_geometry or layout relies on the widget being in
unsigned int* width, unsigned int* height,
enum image_instance_geometry disp, Lisp_Object domain)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
Lisp_Object items = IMAGE_INSTANCE_WIDGET_ITEMS (ii);
unsigned int* width, unsigned int* height,
enum image_instance_geometry disp, Lisp_Object domain)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
Lisp_Object items = IMAGE_INSTANCE_WIDGET_ITEMS (ii);
Lisp_Object rest;
unsigned int tw = 0, th = 0;
return inst;
}
-/* Instantiate a layout widget. Sizing commentary: we have a number of
- problems that we would like to address. Some consider some of these
- more important than others. Currently size information is
- determined at instantiation time and is then fixed forever
+/* Layout widget. Sizing commentary: we have a number of problems that
+ we would like to address. Some consider some of these more
+ important than others. It used to be that size information was
+ determined at instantiation time and was then fixed forever
after. Generally this is not what we want. Users want size to be
"big enough" to accommodate whatever they are trying to show and
this is dependent on text length, lines, font metrics etc. Of
Text glyphs are particularly troublesome since their metrics depend
on the context in which they are being viewed. For instance they
can appear differently depending on the window face, frame face or
- glyph face. All other glyphs are essentially fixed in
- appearance. Perhaps the problem is that text glyphs are cached on a
- device basis like most other glyphs. Instead they should be cached
- per-window and then the instance would be fixed and we wouldn't
- have to mess around with font metrics and the rest. */
+ glyph face. In order to simplify this text glyphs can now only have
+ a glyph-face or image-instance face. All other glyphs are
+ essentially fixed in appearance. Perhaps the problem is that text
+ glyphs are cached on a device basis like most other glyphs. Instead
+ they should be cached per-window and then the instance would be
+ fixed and we wouldn't have to mess around with font metrics and the
+ rest. */
+
+/* Query the geometry of a layout widget. We assume that we can only
+ get here if the size is not already fixed. */
static void
-layout_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
- Lisp_Object pointer_fg, Lisp_Object pointer_bg,
- int dest_mask, Lisp_Object domain)
+layout_query_geometry (Lisp_Object image_instance, unsigned int* width,
+ unsigned int* height, enum image_instance_geometry disp,
+ Lisp_Object domain)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
- Lisp_Object rest, device = IMAGE_INSTANCE_DEVICE (ii);
- Lisp_Object frame = FW_FRAME (domain);
- Lisp_Object items = find_keyword_in_vector (instantiator, Q_items);
- Lisp_Object width = find_keyword_in_vector (instantiator, Q_pixel_width);
- Lisp_Object height = find_keyword_in_vector (instantiator, Q_pixel_height);
- Lisp_Object orient = find_keyword_in_vector (instantiator, Q_orientation);
- Lisp_Object justify = find_keyword_in_vector (instantiator, Q_justify);
- Lisp_Object border = find_keyword_in_vector (instantiator, Q_border);
- Lisp_Object children = Qnil;
- int pw = 0, ph = 0, x, y, maxph = 0, maxpw = 0, nitems = 0,
- horiz_spacing, vert_spacing, ph_adjust = 0;
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Object items = IMAGE_INSTANCE_LAYOUT_CHILDREN (ii), rest;
+ int maxph = 0, maxpw = 0, nitems = 0, ph_adjust = 0;
- if (NILP (frame))
- signal_simple_error ("No selected frame", device);
-
- if (!(dest_mask & IMAGE_LAYOUT_MASK))
- incompatible_image_types (instantiator, dest_mask, IMAGE_LAYOUT_MASK);
+ /* Flip through the items to work out how much stuff we have to display */
+ LIST_LOOP (rest, items)
+ {
+ Lisp_Object glyph = XCAR (rest);
+ unsigned int gheight, gwidth;
+
+ image_instance_query_geometry (glyph, &gwidth, &gheight, disp, domain);
- if (NILP (orient))
- orient = Qvertical;
+ /* Pick up the border text if we have one. */
+ if (INTP (IMAGE_INSTANCE_LAYOUT_BORDER (ii))
+ && NILP (XCDR (rest)))
+ {
+ ph_adjust = gheight / 2;
+ }
+ else
+ {
+
+ nitems ++;
+ if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii)
+ == LAYOUT_HORIZONTAL)
+ {
+ maxph = max (maxph, gheight);
+ maxpw += gwidth;
+ }
+ else
+ {
+ maxpw = max (maxpw, gwidth);
+ maxph += gheight;
+ }
+ }
+ }
- if (EQ (border, Qt))
- border = Qetched_in;
+ /* work out spacing between items and bounds of the layout. No user
+ provided width so we just do default spacing. */
+ if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii)
+ == LAYOUT_HORIZONTAL)
+ *width = maxpw + (nitems + 1) * WIDGET_BORDER_WIDTH * 2;
+ else
+ *width = maxpw + 2 * WIDGET_BORDER_WIDTH * 2;
- ii->data = 0;
- IMAGE_INSTANCE_TYPE (ii) = IMAGE_LAYOUT;
- IMAGE_INSTANCE_SUBWINDOW_ID (ii) = 0;
- IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii) = 0;
- IMAGE_INSTANCE_SUBWINDOW_FRAME (ii) = frame;
- IMAGE_INSTANCE_LAYOUT_BORDER (ii) = border;
+ /* Work out vertical spacings. */
+ if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii)
+ == LAYOUT_VERTICAL)
+ *height = maxph + (nitems + 1) * WIDGET_BORDER_HEIGHT * 2 + ph_adjust;
+ else
+ *height = maxph + 2 * WIDGET_BORDER_HEIGHT * 2 + ph_adjust;
+}
- /* normalize size information */
- if (!NILP (width))
- pw = XINT (width);
- if (!NILP (height))
- ph = XINT (height);
+
+static void
+layout_layout (Lisp_Object image_instance,
+ unsigned int width, unsigned int height, Lisp_Object domain)
+{
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Object rest;
+ Lisp_Object items = IMAGE_INSTANCE_LAYOUT_CHILDREN (ii);
+ int x, y, maxph = 0, maxpw = 0, nitems = 0,
+ horiz_spacing, vert_spacing, ph_adjust = 0;
+ unsigned int gheight, gwidth;
/* flip through the items to work out how much stuff we have to display */
LIST_LOOP (rest, items)
{
Lisp_Object glyph = XCAR (rest);
- int gheight = glyph_height (glyph, domain);
- int gwidth = glyph_width (glyph, domain);
- nitems ++;
- if (EQ (orient, Qhorizontal))
+
+ image_instance_query_geometry (glyph, &gwidth, &gheight,
+ IMAGE_DESIRED_GEOMETRY, domain);
+
+ /* Pick up the border text if we have one. */
+ if (INTP (IMAGE_INSTANCE_LAYOUT_BORDER (ii))
+ && NILP (XCDR (rest)))
{
- maxph = max (maxph, gheight);
- maxpw += gwidth;
+ XIMAGE_INSTANCE_XOFFSET (glyph) = 10; /* Really, what should this be? */
+ XIMAGE_INSTANCE_YOFFSET (glyph) = 0;
+ ph_adjust = gheight / 2;
+ IMAGE_INSTANCE_LAYOUT_BORDER (ii) = make_int (ph_adjust);
}
- else if (EQ (orient, Qvertical))
+ else
{
- maxpw = max (maxpw, gwidth);
- maxph += gheight;
+
+ nitems ++;
+ if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii)
+ == LAYOUT_HORIZONTAL)
+ {
+ maxph = max (maxph, gheight);
+ maxpw += gwidth;
+ }
+ else
+ {
+ maxpw = max (maxpw, gwidth);
+ maxph += gheight;
+ }
}
}
/* work out spacing between items and bounds of the layout */
- if (!pw)
- {
- /* No user provided width so we just do default spacing. */
- horiz_spacing = WIDGET_BORDER_WIDTH * 2;
- if (EQ (orient, Qhorizontal))
- pw = maxpw + (nitems + 1) * horiz_spacing;
- else
- pw = maxpw + 2 * horiz_spacing;
- }
- else if (pw < maxpw)
+ if (width < maxpw)
/* The user wants a smaller space than the largest item, so we
just provide default spacing and will let the output routines
clip.. */
horiz_spacing = WIDGET_BORDER_WIDTH * 2;
- else if (EQ (orient, Qhorizontal))
+ else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii)
+ == LAYOUT_HORIZONTAL)
/* We have a larger area to display in so distribute the space
evenly. */
- horiz_spacing = (pw - maxpw) / (nitems + 1);
+ horiz_spacing = (width - maxpw) / (nitems + 1);
else
- horiz_spacing = (pw - maxpw) / 2;
+ horiz_spacing = (width - maxpw) / 2;
- /* Do the border now so that we can adjust the layout. */
- if (GLYPHP (border))
- {
- /* We are going to be sneaky here and add the border text as
- just another child, the layout and output routines don't know
- this and will just display at the offsets we prescribe. */
- Lisp_Object bglyph = glyph_image_instance (border, domain, ERROR_ME, 1);
-
- children = Fcons (bglyph, children);
- XIMAGE_INSTANCE_XOFFSET (bglyph) = 10; /* Really, what should this be? */
- XIMAGE_INSTANCE_YOFFSET (bglyph) = 0;
-
- ph_adjust = (glyph_height (border, domain) / 2);
- IMAGE_INSTANCE_LAYOUT_BORDER (ii) = make_int (ph_adjust);
- }
-
- /* Work out vertical spacings. */
- if (!ph)
- {
- vert_spacing = WIDGET_BORDER_HEIGHT * 2;
- if (EQ (orient, Qvertical))
- ph = maxph + (nitems + 1) * vert_spacing + ph_adjust;
- else
- ph = maxph + 2 * vert_spacing + ph_adjust;
- }
- else if (ph < maxph)
+ if (height < maxph)
vert_spacing = WIDGET_BORDER_HEIGHT * 2;
- else if (EQ (orient, Qvertical))
- vert_spacing = (ph - (maxph + ph_adjust)) / (nitems + 1);
+ else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii)
+ == LAYOUT_VERTICAL)
+ vert_spacing = (height - (maxph + ph_adjust)) / (nitems + 1);
else
- vert_spacing = (ph - (maxph + ph_adjust)) / 2;
+ vert_spacing = (height - (maxph + ph_adjust)) / 2;
y = vert_spacing + ph_adjust;
x = horiz_spacing;
/* Now flip through putting items where we want them, paying
- attention to justification. */
+ attention to justification. Make sure we don't mess with the
+ border glyph. */
LIST_LOOP (rest, items)
{
- /* make sure the image is instantiated */
Lisp_Object glyph = XCAR (rest);
- Lisp_Object gii = glyph_image_instance (glyph, domain, ERROR_ME, 1);
- int gwidth = glyph_width (glyph, domain);
- int gheight = glyph_height (glyph, domain);
-
- children = Fcons (gii, children);
-
- if (EQ (orient, Qhorizontal))
- {
- if (EQ (justify, Qright))
- y = ph - (gheight + vert_spacing);
- else if (EQ (justify, Qcenter))
- y = (ph - gheight) / 2;
- }
- else if (EQ (orient, Qvertical))
- {
- if (EQ (justify, Qright))
- x = pw - (gwidth + horiz_spacing);
- else if (EQ (justify, Qcenter))
- x = (pw - gwidth) / 2;
- }
-
- XIMAGE_INSTANCE_XOFFSET (gii) = x;
- XIMAGE_INSTANCE_YOFFSET (gii) = y;
- if (EQ (orient, Qhorizontal))
- {
- x += (gwidth + horiz_spacing);
- }
- else if (EQ (orient, Qvertical))
- {
- y += (gheight + vert_spacing);
- }
+ image_instance_query_geometry (glyph, &gwidth, &gheight,
+ IMAGE_DESIRED_GEOMETRY, domain);
+
+ if (!INTP (IMAGE_INSTANCE_LAYOUT_BORDER (ii))
+ || !NILP (XCDR (rest)))
+ {
+ if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii)
+ == LAYOUT_HORIZONTAL)
+ {
+ if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii)
+ == LAYOUT_JUSTIFY_RIGHT)
+ y = height - (gheight + vert_spacing);
+ if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii)
+ == LAYOUT_JUSTIFY_CENTER)
+ y = (height - gheight) / 2;
+ }
+ else
+ {
+ if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii)
+ == LAYOUT_JUSTIFY_RIGHT)
+ x = width - (gwidth + horiz_spacing);
+ if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii)
+ == LAYOUT_JUSTIFY_CENTER)
+ x = (width - gwidth) / 2;
+ }
+
+ XIMAGE_INSTANCE_XOFFSET (glyph) = x;
+ XIMAGE_INSTANCE_YOFFSET (glyph) = y;
+
+ if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii)
+ == LAYOUT_HORIZONTAL)
+ {
+ x += (gwidth + horiz_spacing);
+ }
+ else
+ {
+ y += (gheight + vert_spacing);
+ }
+ }
+
+ /* Now layout subwidgets if they require it. */
+ image_instance_layout (glyph, gwidth, gheight, domain);
}
- IMAGE_INSTANCE_LAYOUT_CHILDREN (ii) = children;
- assert (pw && ph);
- IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii) = pw;
- IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii) = ph;
+ IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii) = width;
+ IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii) = height;
}
\f
defsymbol (&Qbevel_out, "bevel-out");
}
-void
-image_instantiator_format_create_glyphs_widget (void)
-{
-#define VALID_GUI_KEYWORDS(type) \
- IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_active, check_valid_anything); \
- IIFORMAT_VALID_KEYWORD (type, Q_suffix, check_valid_anything); \
- IIFORMAT_VALID_KEYWORD (type, Q_keys, check_valid_string); \
- IIFORMAT_VALID_KEYWORD (type, Q_style, check_valid_symbol); \
- IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_selected, check_valid_anything); \
- IIFORMAT_VALID_KEYWORD (type, Q_filter, check_valid_anything); \
- IIFORMAT_VALID_KEYWORD (type, Q_config, check_valid_symbol); \
- IIFORMAT_VALID_KEYWORD (type, Q_included, check_valid_anything); \
- IIFORMAT_VALID_KEYWORD (type, Q_key_sequence, check_valid_string); \
- IIFORMAT_VALID_KEYWORD (type, Q_accelerator, check_valid_string); \
- IIFORMAT_VALID_KEYWORD (type, Q_label, check_valid_anything); \
- IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_callback, check_valid_callback); \
- IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_descriptor, check_valid_string_or_vector)
-
-#define VALID_WIDGET_KEYWORDS(type) \
+#define VALID_GUI_KEYWORDS(type) do { \
+ IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_active, check_valid_anything); \
+ IIFORMAT_VALID_KEYWORD (type, Q_suffix, check_valid_anything); \
+ IIFORMAT_VALID_KEYWORD (type, Q_keys, check_valid_string); \
+ IIFORMAT_VALID_KEYWORD (type, Q_style, check_valid_symbol); \
+ IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_selected, check_valid_anything); \
+ IIFORMAT_VALID_KEYWORD (type, Q_filter, check_valid_anything); \
+ IIFORMAT_VALID_KEYWORD (type, Q_config, check_valid_symbol); \
+ IIFORMAT_VALID_KEYWORD (type, Q_included, check_valid_anything); \
+ IIFORMAT_VALID_KEYWORD (type, Q_key_sequence, check_valid_string); \
+ IIFORMAT_VALID_KEYWORD (type, Q_accelerator, check_valid_string); \
+ IIFORMAT_VALID_KEYWORD (type, Q_label, check_valid_anything); \
+ IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_callback, check_valid_callback); \
+ IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_descriptor, check_valid_string_or_vector); \
+} while (0)
+
+#define VALID_WIDGET_KEYWORDS(type) do { \
IIFORMAT_VALID_KEYWORD (type, Q_width, check_valid_int); \
IIFORMAT_VALID_KEYWORD (type, Q_height, check_valid_int); \
IIFORMAT_VALID_KEYWORD (type, Q_pixel_width, check_valid_int); \
IIFORMAT_VALID_KEYWORD (type, Q_pixel_height, check_valid_int); \
- IIFORMAT_VALID_KEYWORD (type, Q_face, check_valid_face)
+ IIFORMAT_VALID_KEYWORD (type, Q_face, check_valid_face); \
+} while (0)
- /* we only do this for properties */
+
+static void image_instantiator_widget (void)
+{ /* we only do this for properties */
INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM (widget, "widget");
IIFORMAT_HAS_METHOD (widget, property);
IIFORMAT_HAS_METHOD (widget, set_property);
IIFORMAT_HAS_METHOD (widget, query_geometry);
IIFORMAT_HAS_METHOD (widget, layout);
+}
- /* widget image-instantiator types - buttons */
+static void image_instantiator_buttons (void)
+{
INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (button, "button");
IIFORMAT_HAS_SHARED_METHOD (button, validate, widget);
IIFORMAT_HAS_SHARED_METHOD (button, possible_dest_types, widget);
IIFORMAT_HAS_SHARED_METHOD (button, instantiate, widget);
IIFORMAT_HAS_SHARED_METHOD (button, normalize, widget);
- IIFORMAT_VALID_KEYWORD (button,
+ IIFORMAT_VALID_KEYWORD (button,
Q_image, check_valid_glyph_or_instantiator);
VALID_WIDGET_KEYWORDS (button);
VALID_GUI_KEYWORDS (button);
+}
- /* edit fields */
+static void image_instantiator_edit_fields (void)
+{
INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (edit_field, "edit-field");
IIFORMAT_HAS_SHARED_METHOD (edit_field, validate, widget);
IIFORMAT_HAS_SHARED_METHOD (edit_field, possible_dest_types, widget);
IIFORMAT_HAS_SHARED_METHOD (edit_field, instantiate, widget);
VALID_WIDGET_KEYWORDS (edit_field);
VALID_GUI_KEYWORDS (edit_field);
+}
- /* combo box */
+static void image_instantiator_combo_box (void)
+{
INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (combo_box, "combo-box");
IIFORMAT_HAS_METHOD (combo_box, validate);
IIFORMAT_HAS_SHARED_METHOD (combo_box, possible_dest_types, widget);
IIFORMAT_VALID_KEYWORD (combo_box, Q_pixel_width, check_valid_int);
IIFORMAT_VALID_KEYWORD (combo_box, Q_face, check_valid_face);
IIFORMAT_VALID_KEYWORD (combo_box, Q_properties, check_valid_item_list);
+}
- /* scrollbar */
+static void image_instantiator_scrollbar (void)
+{
INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (scrollbar, "scrollbar");
IIFORMAT_HAS_SHARED_METHOD (scrollbar, validate, widget);
IIFORMAT_HAS_SHARED_METHOD (scrollbar, possible_dest_types, widget);
IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_width, check_valid_int);
IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_height, check_valid_int);
IIFORMAT_VALID_KEYWORD (scrollbar, Q_face, check_valid_face);
+}
- /* progress guage */
+static void image_instantiator_progress_guage (void)
+{
INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (progress_gauge, "progress-gauge");
IIFORMAT_HAS_SHARED_METHOD (progress_gauge, validate, widget);
IIFORMAT_HAS_SHARED_METHOD (progress_gauge, possible_dest_types, widget);
IIFORMAT_HAS_SHARED_METHOD (progress_gauge, instantiate, widget);
VALID_WIDGET_KEYWORDS (progress_gauge);
VALID_GUI_KEYWORDS (progress_gauge);
+}
- /* tree view */
+static void image_instantiator_tree_view (void)
+{
INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (tree_view, "tree-view");
IIFORMAT_HAS_SHARED_METHOD (tree_view, validate, combo_box);
IIFORMAT_HAS_SHARED_METHOD (tree_view, possible_dest_types, widget);
VALID_WIDGET_KEYWORDS (tree_view);
VALID_GUI_KEYWORDS (tree_view);
IIFORMAT_VALID_KEYWORD (tree_view, Q_properties, check_valid_item_list);
+}
- /* tab control */
+static void image_instantiator_tab_control (void)
+{
INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (tab_control, "tab-control");
IIFORMAT_HAS_SHARED_METHOD (tab_control, validate, combo_box);
IIFORMAT_HAS_SHARED_METHOD (tab_control, possible_dest_types, widget);
VALID_GUI_KEYWORDS (tab_control);
IIFORMAT_VALID_KEYWORD (tab_control, Q_orientation, check_valid_tab_orientation);
IIFORMAT_VALID_KEYWORD (tab_control, Q_properties, check_valid_item_list);
+}
- /* labels */
+static void image_instantiator_labels (void)
+{
INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (label, "label");
IIFORMAT_HAS_SHARED_METHOD (label, possible_dest_types, widget);
IIFORMAT_HAS_SHARED_METHOD (label, instantiate, widget);
VALID_WIDGET_KEYWORDS (label);
IIFORMAT_VALID_KEYWORD (label, Q_descriptor, check_valid_string);
+}
- /* layout */
+static void image_instantiator_layout (void)
+{
INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (layout, "layout");
IIFORMAT_HAS_METHOD (layout, possible_dest_types);
- IIFORMAT_HAS_METHOD (layout, instantiate);
+ IIFORMAT_HAS_SHARED_METHOD (layout, instantiate, widget);
IIFORMAT_HAS_METHOD (layout, normalize);
+ IIFORMAT_HAS_METHOD (layout, query_geometry);
+ IIFORMAT_HAS_METHOD (layout, layout);
IIFORMAT_VALID_KEYWORD (layout, Q_pixel_width, check_valid_int);
IIFORMAT_VALID_KEYWORD (layout, Q_pixel_height, check_valid_int);
IIFORMAT_VALID_KEYWORD (layout, Q_orientation, check_valid_orientation);
IIFORMAT_VALID_KEYWORD (layout, Q_justify, check_valid_justification);
IIFORMAT_VALID_KEYWORD (layout, Q_border, check_valid_border);
- IIFORMAT_VALID_KEYWORD (layout, Q_items,
+ IIFORMAT_VALID_KEYWORD (layout, Q_items,
check_valid_glyph_or_instantiator_list);
}
void
+image_instantiator_format_create_glyphs_widget (void)
+{
+ image_instantiator_widget();
+ image_instantiator_buttons();
+ image_instantiator_edit_fields();
+ image_instantiator_combo_box();
+ image_instantiator_scrollbar();
+ image_instantiator_progress_guage();
+ image_instantiator_tree_view();
+ image_instantiator_tab_control();
+ image_instantiator_labels();
+ image_instantiator_layout();
+}
+
+void
reinit_vars_of_glyphs_widget (void)
{
#ifdef DEBUG_WIDGETS
#ifdef HAVE_WIDGETS
static void
update_widget_face (widget_value* wv,
- struct Lisp_Image_Instance* ii, Lisp_Object domain);
+ Lisp_Image_Instance* ii, Lisp_Object domain);
static void
update_tab_widget_face (widget_value* wv,
- struct Lisp_Image_Instance* ii, Lisp_Object domain);
+ Lisp_Image_Instance* ii, Lisp_Object domain);
#endif
#include "bitmaps.h"
*pixtbl = xnew_array (unsigned long, pixcount);
*npixels = 0;
- /* ### should implement a sort by popularity to assure proper allocation */
+ /* #### should implement a sort by popularity to assure proper allocation */
n = *npixels;
for (i = 0; i < qtable->num_active_colors; i++)
{
static void
-x_print_image_instance (struct Lisp_Image_Instance *p,
+x_print_image_instance (Lisp_Image_Instance *p,
Lisp_Object printcharfun,
int escapeflag)
{
#endif
static void
-x_finalize_image_instance (struct Lisp_Image_Instance *p)
+x_finalize_image_instance (Lisp_Image_Instance *p)
{
if (!p->data)
return;
}
static int
-x_image_instance_equal (struct Lisp_Image_Instance *p1,
- struct Lisp_Image_Instance *p2, int depth)
+x_image_instance_equal (Lisp_Image_Instance *p1,
+ Lisp_Image_Instance *p2, int depth)
{
switch (IMAGE_INSTANCE_TYPE (p1))
{
}
static unsigned long
-x_image_instance_hash (struct Lisp_Image_Instance *p, int depth)
+x_image_instance_hash (Lisp_Image_Instance *p, int depth)
{
switch (IMAGE_INSTANCE_TYPE (p))
{
methods are called. */
static void
-x_initialize_pixmap_image_instance (struct Lisp_Image_Instance *ii,
+x_initialize_pixmap_image_instance (Lisp_Image_Instance *ii,
int slices,
enum image_instance_type type)
{
(XSTRING_BYTE (name, 2) == '/')))))
{
if (!NILP (Ffile_readable_p (name)))
- return name;
+ return Fexpand_file_name (name, Qnil);
else
return Qnil;
}
Use the same code as for `xpm'. */
static void
-init_image_instance_from_x_image (struct Lisp_Image_Instance *ii,
+init_image_instance_from_x_image (Lisp_Image_Instance *ii,
XImage *ximage,
int dest_mask,
Colormap cmap,
}
static void
-image_instance_add_x_image (struct Lisp_Image_Instance *ii,
+image_instance_add_x_image (Lisp_Image_Instance *ii,
XImage *ximage,
int slice,
Lisp_Object instantiator)
}
static void
-x_init_image_instance_from_eimage (struct Lisp_Image_Instance *ii,
+x_init_image_instance_from_eimage (Lisp_Image_Instance *ii,
int width, int height,
int slices,
unsigned char *eimage,
image instance accordingly. */
static void
-init_image_instance_from_xbm_inline (struct Lisp_Image_Instance *ii,
+init_image_instance_from_xbm_inline (Lisp_Image_Instance *ii,
int width, int height,
/* Note that data is in ext-format! */
CONST char *bits,
{
Lisp_Object mask_data = find_keyword_in_vector (instantiator, Q_mask_data);
Lisp_Object mask_file = find_keyword_in_vector (instantiator, Q_mask_file);
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
Pixmap mask = 0;
- CONST char *gcc_may_you_rot_in_hell;
if (!NILP (mask_data))
{
- GET_C_STRING_BINARY_DATA_ALLOCA (XCAR (XCDR (XCDR (mask_data))),
- gcc_may_you_rot_in_hell);
- mask =
- pixmap_from_xbm_inline (IMAGE_INSTANCE_DEVICE (ii),
- XINT (XCAR (mask_data)),
- XINT (XCAR (XCDR (mask_data))),
- (CONST unsigned char *)
- gcc_may_you_rot_in_hell);
+ CONST char *ext_data;
+
+ TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (XCDR (XCDR (mask_data))),
+ C_STRING_ALLOCA, ext_data,
+ Qbinary);
+ mask = pixmap_from_xbm_inline (IMAGE_INSTANCE_DEVICE (ii),
+ XINT (XCAR (mask_data)),
+ XINT (XCAR (XCDR (mask_data))),
+ (CONST unsigned char *) ext_data);
}
init_image_instance_from_xbm_inline (ii, width, height, bits,
int dest_mask, Lisp_Object domain)
{
Lisp_Object data = find_keyword_in_vector (instantiator, Q_data);
- CONST char *gcc_go_home;
+ CONST char *ext_data;
assert (!NILP (data));
- GET_C_STRING_BINARY_DATA_ALLOCA (XCAR (XCDR (XCDR (data))),
- gcc_go_home);
+ TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (XCDR (XCDR (data))),
+ C_STRING_ALLOCA, ext_data,
+ Qbinary);
xbm_instantiate_1 (image_instance, instantiator, pointer_fg,
pointer_bg, dest_mask, XINT (XCAR (data)),
- XINT (XCAR (XCDR (data))), gcc_go_home);
+ XINT (XCAR (XCDR (data))), ext_data);
}
\f
int dest_mask, Lisp_Object domain)
{
/* This function can GC */
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii);
Lisp_Object data = find_keyword_in_vector (instantiator, Q_data);
Display *dpy;
assert (!NILP (data));
- GET_C_STRING_BINARY_DATA_ALLOCA (data, dstring);
+ TO_EXTERNAL_FORMAT (LISP_STRING, data,
+ C_STRING_ALLOCA, dstring,
+ Qbinary);
if ((p = strchr (dstring, ':')))
{
if (dest_mask & IMAGE_POINTER_MASK)
{
CONST char *name_ext;
- GET_C_STRING_FILENAME_DATA_ALLOCA (data, name_ext);
+ TO_EXTERNAL_FORMAT (LISP_STRING, data,
+ C_STRING_ALLOCA, name_ext,
+ Qfile_name);
if (XmuCursorNameToIndex (name_ext) != -1)
{
result = alist_to_tagged_vector (Qcursor_font, alist);
{
/* This function can GC */
Lisp_Object data = find_keyword_in_vector (instantiator, Q_data);
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii);
Display *dpy;
XColor fg, bg;
{
/* This function can GC */
Lisp_Object data = find_keyword_in_vector (instantiator, Q_data);
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii);
Display *dpy;
int i;
if (!(dest_mask & IMAGE_POINTER_MASK))
incompatible_image_types (instantiator, dest_mask, IMAGE_POINTER_MASK);
- GET_C_STRING_FILENAME_DATA_ALLOCA (data, name_ext);
+ TO_EXTERNAL_FORMAT (LISP_STRING, data,
+ C_STRING_ALLOCA, name_ext,
+ Qfile_name);
if ((i = XmuCursorNameToIndex (name_ext)) == -1)
signal_simple_error ("Unrecognized cursor-font name", data);
x_colorize_image_instance (Lisp_Object image_instance,
Lisp_Object foreground, Lisp_Object background)
{
- struct Lisp_Image_Instance *p;
+ Lisp_Image_Instance *p;
p = XIMAGE_INSTANCE (image_instance);
/* unmap the image if it is a widget. This is used by redisplay via
redisplay_unmap_subwindows */
static void
-x_unmap_subwindow (struct Lisp_Image_Instance *p)
+x_unmap_subwindow (Lisp_Image_Instance *p)
{
if (IMAGE_INSTANCE_TYPE (p) == IMAGE_SUBWINDOW)
{
/* map the subwindow. This is used by redisplay via
redisplay_output_subwindow */
static void
-x_map_subwindow (struct Lisp_Image_Instance *p, int x, int y,
+x_map_subwindow (Lisp_Image_Instance *p, int x, int y,
struct display_glyph_area* dga)
{
if (IMAGE_INSTANCE_TYPE (p) == IMAGE_SUBWINDOW)
/* when you click on a widget you may activate another widget this
needs to be checked and all appropriate widgets updated */
static void
-x_update_subwindow (struct Lisp_Image_Instance *p)
+x_update_subwindow (Lisp_Image_Instance *p)
{
#ifdef HAVE_WIDGETS
if (IMAGE_INSTANCE_TYPE (p) == IMAGE_WIDGET)
int dest_mask, Lisp_Object domain)
{
/* This function can GC */
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii);
Lisp_Object frame = FW_FRAME (domain);
struct frame* f = XFRAME (frame);
(subwindow, property, data))
{
Atom property_atom;
- struct Lisp_Subwindow *sw;
+ Lisp_Subwindow *sw;
Display *dpy;
CHECK_SUBWINDOW (subwindow);
#endif
static void
-x_resize_subwindow (struct Lisp_Image_Instance* ii, int w, int h)
+x_resize_subwindow (Lisp_Image_Instance* ii, int w, int h)
{
if (IMAGE_INSTANCE_TYPE (ii) == IMAGE_SUBWINDOW)
{
{
Arg al[2];
- if (!XtIsRealized (IMAGE_INSTANCE_X_WIDGET_ID (ii)))
+ if ( !XtIsManaged(IMAGE_INSTANCE_X_WIDGET_ID (ii))
+ ||
+ IMAGE_INSTANCE_X_WIDGET_ID (ii)->core.being_destroyed )
{
Lisp_Object sw;
XSETIMAGE_INSTANCE (sw, ii);
- signal_simple_error ("XEmacs bug: subwindow is not realized", sw);
+ signal_simple_error ("XEmacs bug: subwindow is deleted", sw);
}
XtSetArg (al [0], XtNwidth, (Dimension)w);
/************************************************************************/
static void
-update_widget_face (widget_value* wv, struct Lisp_Image_Instance *ii,
+update_widget_face (widget_value* wv, Lisp_Image_Instance *ii,
Lisp_Object domain)
{
#ifdef LWLIB_WIDGETS_MOTIF
}
static void
-update_tab_widget_face (widget_value* wv, struct Lisp_Image_Instance *ii,
+update_tab_widget_face (widget_value* wv, Lisp_Image_Instance *ii,
Lisp_Object domain)
{
if (wv->contents)
int dest_mask, Lisp_Object domain,
CONST char* type, widget_value* wv)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
Lisp_Object device = IMAGE_INSTANCE_DEVICE (ii), pixel;
struct device* d = XDEVICE (device);
Lisp_Object frame = FW_FRAME (domain);
IMAGE_INSTANCE_TYPE (ii) = IMAGE_WIDGET;
if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii)))
- GET_C_STRING_OS_DATA_ALLOCA (IMAGE_INSTANCE_WIDGET_TEXT (ii), nm);
+ TO_EXTERNAL_FORMAT (LISP_STRING, IMAGE_INSTANCE_WIDGET_TEXT (ii),
+ C_STRING_ALLOCA, nm,
+ Qnative);
ii->data = xnew_and_zero (struct x_subwindow_data);
x_widget_set_property (Lisp_Object image_instance, Lisp_Object prop,
Lisp_Object val)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
/* Modify the text properties of the widget */
if (EQ (prop, Q_text))
char* str;
widget_value* wv = lw_get_all_values (IMAGE_INSTANCE_X_WIDGET_LWID (ii));
CHECK_STRING (val);
- GET_C_STRING_OS_DATA_ALLOCA (val, str);
+ TO_EXTERNAL_FORMAT (LISP_STRING, val,
+ C_STRING_ALLOCA, str,
+ Qnative);
wv->value = str;
lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (ii), wv, False);
}
static Lisp_Object
x_widget_property (Lisp_Object image_instance, Lisp_Object prop)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
/* get the text from a control */
if (EQ (prop, Q_text))
{
widget_value* wv = lw_get_all_values (IMAGE_INSTANCE_X_WIDGET_LWID (ii));
- return build_ext_string (wv->value, FORMAT_OS);
+ return build_ext_string (wv->value, Qnative);
}
return Qunbound;
}
Lisp_Object pointer_fg, Lisp_Object pointer_bg,
int dest_mask, Lisp_Object domain)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii);
Lisp_Object glyph = find_keyword_in_vector (instantiator, Q_image);
widget_value* wv = xmalloc_widget_value ();
pointer_bg, dest_mask, domain, "button", wv);
/* add the image if one was given */
- if (!NILP (glyph) && IMAGE_INSTANCEP (glyph))
+ if (!NILP (glyph) && IMAGE_INSTANCEP (glyph)
+ && IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (glyph)))
{
Arg al [2];
int ac =0;
static Lisp_Object
x_button_property (Lisp_Object image_instance, Lisp_Object prop)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
/* check the state of a button */
if (EQ (prop, Q_selected))
{
Lisp_Object pointer_fg, Lisp_Object pointer_bg,
int dest_mask, Lisp_Object domain)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii);
widget_value* wv = xmalloc_widget_value ();
x_progress_gauge_set_property (Lisp_Object image_instance, Lisp_Object prop,
Lisp_Object val)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
if (EQ (prop, Q_percent))
{
Lisp_Object pointer_fg, Lisp_Object pointer_bg,
int dest_mask, Lisp_Object domain)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii);
widget_value* wv = xmalloc_widget_value ();
Lisp_Object pointer_fg, Lisp_Object pointer_bg,
int dest_mask, Lisp_Object domain)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
widget_value * wv = 0;
/* This is not done generically because of sizing problems under
mswindows. */
Lisp_Object pointer_fg, Lisp_Object pointer_bg,
int dest_mask, Lisp_Object domain)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
widget_value * wv =
gui_items_to_widget_values (IMAGE_INSTANCE_WIDGET_ITEMS (ii));
x_tab_control_set_property (Lisp_Object image_instance, Lisp_Object prop,
Lisp_Object val)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
if (EQ (prop, Q_items))
{
Lisp_Object pointer_fg, Lisp_Object pointer_bg,
int dest_mask, Lisp_Object domain)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii);
widget_value* wv = xmalloc_widget_value ();
make_int (name##_height), \
make_ext_string (name##_bits, \
sizeof (name##_bits), \
- FORMAT_BINARY))), \
+ Qbinary))), \
Qglobal, Qx, Qnil)
BUILD_GLYPH_INST (Vtruncation_glyph, truncator);
/* Synched up with: Not in FSF. */
-#ifndef _XEMACS_GLYPHS_X_H_
-#define _XEMACS_GLYPHS_X_H_
+#ifndef INCLUDED_glyphs_x_h_
+#define INCLUDED_glyphs_x_h_
#include "glyphs.h"
((Widget) IMAGE_INSTANCE_SUBWINDOW_ID (i))
#endif /* HAVE_X_WINDOWS */
-#endif /* _XEMACS_GLYPHS_X_H_ */
+#endif /* INCLUDED_glyphs_x_h_ */
/* Synched up with: Not in FSF. */
-#ifndef _XEMACS_GLYPHS_H_
-#define _XEMACS_GLYPHS_H_
+#ifndef INCLUDED_glyphs_h_
+#define INCLUDED_glyphs_h_
#include "specifier.h"
#include "gui.h"
subwindow subwindow
inherit mono-pixmap
autodetect mono-pixmap, color-pixmap, pointer, text
- button widget
+ button widget
edit-field widget
combo -box widget
progress-gauge widget
tab-control widget
tree-view widget
scrollbar widget
- static widget
+ static widget
*/
/* These are methods specific to a particular format of image instantiator
IMAGE_GEOMETRY,
IMAGE_DESIRED_GEOMETRY,
IMAGE_MIN_GEOMETRY,
- IMAGE_MAX_GEOMETRY,
+ IMAGE_MAX_GEOMETRY,
IMAGE_UNSPECIFIED_GEOMETRY = ~0
};
image instance. */
void (*query_geometry_method) (Lisp_Object image_instance,
unsigned int* width, unsigned int* height,
- enum image_instance_geometry disp,
+ enum image_instance_geometry disp,
Lisp_Object domain);
-
+
/* Layout the instance and its children bounded by the provided
dimensions. */
void (*layout_method) (Lisp_Object image_instance,
FORMAT. VALIDATE_FUN if a function that returns whether the data
is valid. The keyword may not appear more than once. */
#define IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, copy, multi) \
- do { \
+ do { \
struct ii_keyword_entry entry; \
- \
- entry.keyword = keyw; \
+ \
+ entry.keyword = keyw; \
entry.validate = validate_fun; \
- entry.multiple_p = multi; \
+ entry.multiple_p = multi; \
entry.copy_p = copy; \
Dynarr_add (format##_image_instantiator_methods->keywords, \
entry); \
#define IIFORMAT_VALID_NONCOPY_KEYWORD(format, keyw, validate_fun) \
IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, 0, 0)
-/* Declare that image-instantiator format FORMAT is supported on
+/* Declare that image-instantiator format FORMAT is supported on
CONSOLE type. */
-#define IIFORMAT_VALID_CONSOLE(console, format) \
+#define IIFORMAT_VALID_CONSOLE(console, format) \
do { \
struct console_type_entry entry; \
\
entry); \
} while (0)
-#define DEFINE_DEVICE_IIFORMAT(type, format)\
-DECLARE_IMAGE_INSTANTIATOR_FORMAT(format); \
+#define DEFINE_DEVICE_IIFORMAT(type, format) \
+DECLARE_IMAGE_INSTANTIATOR_FORMAT(format); \
struct image_instantiator_methods *type##_##format##_image_instantiator_methods
#define INITIALIZE_DEVICE_IIFORMAT(type, format) \
void check_valid_vector (Lisp_Object data);
void check_valid_item_list_1 (Lisp_Object items);
-void initialize_subwindow_image_instance (struct Lisp_Image_Instance*);
+void initialize_subwindow_image_instance (Lisp_Image_Instance*);
void subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
Lisp_Object pointer_fg, Lisp_Object pointer_bg,
int dest_mask, Lisp_Object domain);
void widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
Lisp_Object pointer_fg, Lisp_Object pointer_bg,
int dest_mask, Lisp_Object domain);
-void image_instance_query_geometry (Lisp_Object image_instance,
- unsigned int* width, unsigned int* height,
+void image_instance_query_geometry (Lisp_Object image_instance,
+ unsigned int* width, unsigned int* height,
enum image_instance_geometry disp,
Lisp_Object domain);
-void image_instance_layout (Lisp_Object image_instance,
- unsigned int width, unsigned int height,
+void image_instance_layout (Lisp_Object image_instance,
+ unsigned int width, unsigned int height,
Lisp_Object domain);
+int invalidate_glyph_geometry_maybe (Lisp_Object glyph_or_ii, struct window* w);
DECLARE_DOESNT_RETURN (incompatible_image_types (Lisp_Object instantiator,
int given_dest_mask,
/* Image Instance Object */
/************************************************************************/
-DECLARE_LRECORD (image_instance, struct Lisp_Image_Instance);
-#define XIMAGE_INSTANCE(x) \
- XRECORD (x, image_instance, struct Lisp_Image_Instance)
+DECLARE_LRECORD (image_instance, Lisp_Image_Instance);
+#define XIMAGE_INSTANCE(x) XRECORD (x, image_instance, Lisp_Image_Instance)
#define XSETIMAGE_INSTANCE(x, p) XSETRECORD (x, p, image_instance)
#define IMAGE_INSTANCEP(x) RECORDP (x, image_instance)
#define CHECK_IMAGE_INSTANCE(x) CHECK_RECORD (x, image_instance)
#define LAYOUT_IMAGE_INSTANCEP(ii) \
IMAGE_INSTANCE_TYPE_P (ii, IMAGE_LAYOUT)
-#define CHECK_NOTHING_IMAGE_INSTANCE(x) do { \
- CHECK_IMAGE_INSTANCE (x); \
+#define CHECK_NOTHING_IMAGE_INSTANCE(x) do { \
+ CHECK_IMAGE_INSTANCE (x); \
if (!NOTHING_IMAGE_INSTANCEP (x)) \
x = wrong_type_argument (Qnothing_image_instance_p, (x)); \
} while (0)
-#define CHECK_TEXT_IMAGE_INSTANCE(x) do { \
- CHECK_IMAGE_INSTANCE (x); \
+#define CHECK_TEXT_IMAGE_INSTANCE(x) do { \
+ CHECK_IMAGE_INSTANCE (x); \
if (!TEXT_IMAGE_INSTANCEP (x)) \
x = wrong_type_argument (Qtext_image_instance_p, (x)); \
} while (0)
x = wrong_type_argument (Qmono_pixmap_image_instance_p, (x)); \
} while (0)
-#define CHECK_COLOR_PIXMAP_IMAGE_INSTANCE(x) do { \
- CHECK_IMAGE_INSTANCE (x); \
+#define CHECK_COLOR_PIXMAP_IMAGE_INSTANCE(x) do { \
+ CHECK_IMAGE_INSTANCE (x); \
if (!COLOR_PIXMAP_IMAGE_INSTANCEP (x)) \
x = wrong_type_argument (Qcolor_pixmap_image_instance_p, (x)); \
} while (0)
-#define CHECK_POINTER_IMAGE_INSTANCE(x) do { \
- CHECK_IMAGE_INSTANCE (x); \
+#define CHECK_POINTER_IMAGE_INSTANCE(x) do { \
+ CHECK_IMAGE_INSTANCE (x); \
if (!POINTER_IMAGE_INSTANCEP (x)) \
x = wrong_type_argument (Qpointer_image_instance_p, (x)); \
} while (0)
-#define CHECK_SUBWINDOW_IMAGE_INSTANCE(x) do { \
+#define CHECK_SUBWINDOW_IMAGE_INSTANCE(x) do { \
CHECK_IMAGE_INSTANCE (x); \
if (!SUBWINDOW_IMAGE_INSTANCEP (x) \
&& !WIDGET_IMAGE_INSTANCEP (x)) \
x = wrong_type_argument (Qsubwindow_image_instance_p, (x)); \
} while (0)
-#define CHECK_WIDGET_IMAGE_INSTANCE(x) do { \
- CHECK_IMAGE_INSTANCE (x); \
+#define CHECK_WIDGET_IMAGE_INSTANCE(x) do { \
+ CHECK_IMAGE_INSTANCE (x); \
if (!WIDGET_IMAGE_INSTANCEP (x)) \
x = wrong_type_argument (Qwidget_image_instance_p, (x)); \
} while (0)
-#define CHECK_LAYOUT_IMAGE_INSTANCE(x) do { \
- CHECK_IMAGE_INSTANCE (x); \
+#define CHECK_LAYOUT_IMAGE_INSTANCE(x) do { \
+ CHECK_IMAGE_INSTANCE (x); \
if (!LAYOUT_IMAGE_INSTANCEP (x)) \
x = wrong_type_argument (Qlayout_image_instance_p, (x)); \
} while (0)
unsigned int h_resize : 1; /* Whether the hsize is allowed to change. */
unsigned int orientation : 1; /* Vertical or horizontal. */
unsigned int justification : 2; /* Left, right or center. */
- union
- {
- struct
- {
- /* Face for colors and font. We specify this here becuase we
- want people to be able to put :face in the instantiator
- spec. Using gyph-face is more inconvenient, although more
- general. */
- Lisp_Object face;
- Lisp_Object type;
- Lisp_Object props; /* properties */
- Lisp_Object gui_item; /* a list of gui_items */
- } widget; /* widgets are subwindows */
- struct
- {
- Lisp_Object children; /* managed children */
- Lisp_Object border; /* Style of enclosing border or text. */
- } layout;
- } s;
+ /* Face for colors and font. We specify this here becuase we
+ want people to be able to put :face in the instantiator
+ spec. Using gyph-face is more inconvenient, although more
+ general. */
+ Lisp_Object face;
+ Lisp_Object type;
+ Lisp_Object props; /* properties or border*/
+ Lisp_Object items; /* a list of gui_items or children */
} subwindow;
} u;
#define IMAGE_INSTANCE_YOFFSET(i) ((i)->y_offset)
#define IMAGE_INSTANCE_WIDTH(i) ((i)->width)
#define IMAGE_INSTANCE_HEIGHT(i) ((i)->height)
-#define IMAGE_INSTANCE_PIXMAP_TYPE_P(i) \
- ((IMAGE_INSTANCE_TYPE (i) == IMAGE_MONO_PIXMAP) \
+#define IMAGE_INSTANCE_PIXMAP_TYPE_P(i) \
+ ((IMAGE_INSTANCE_TYPE (i) == IMAGE_MONO_PIXMAP) \
|| (IMAGE_INSTANCE_TYPE (i) == IMAGE_COLOR_PIXMAP))
#define IMAGE_INSTANCE_DIRTYP(i) ((i)->dirty)
#define IMAGE_INSTANCE_FACE(i) \
IMAGE_INSTANCE_WIDTH(i)
#define IMAGE_INSTANCE_WIDGET_HEIGHT(i) \
IMAGE_INSTANCE_HEIGHT(i)
-#define IMAGE_INSTANCE_WIDGET_TYPE(i) ((i)->u.subwindow.s.widget.type)
-#define IMAGE_INSTANCE_WIDGET_PROPS(i) ((i)->u.subwindow.s.widget.props)
+#define IMAGE_INSTANCE_WIDGET_TYPE(i) ((i)->u.subwindow.type)
+#define IMAGE_INSTANCE_WIDGET_PROPS(i) ((i)->u.subwindow.props)
#define SET_IMAGE_INSTANCE_WIDGET_FACE(i,f) \
- ((i)->u.subwindow.s.widget.face = f)
-#define IMAGE_INSTANCE_WIDGET_FACE(i) \
- (!NILP ((i)->u.subwindow.s.widget.face) ? (i)->u.subwindow.s.widget.face : \
- !NILP (IMAGE_INSTANCE_FACE (i)) ? IMAGE_INSTANCE_FACE (i) : \
+ ((i)->u.subwindow.face = f)
+#define IMAGE_INSTANCE_WIDGET_FACE(i) \
+ (!NILP ((i)->u.subwindow.face) ? (i)->u.subwindow.face : \
+ !NILP (IMAGE_INSTANCE_FACE (i)) ? IMAGE_INSTANCE_FACE (i) : \
Vwidget_face)
-#define IMAGE_INSTANCE_WIDGET_ITEMS(i) ((i)->u.subwindow.s.widget.gui_item)
-#define IMAGE_INSTANCE_WIDGET_ITEM(i) \
-(CONSP (IMAGE_INSTANCE_WIDGET_ITEMS (i)) ? \
-XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (i)) : \
+#define IMAGE_INSTANCE_WIDGET_ITEMS(i) ((i)->u.subwindow.items)
+#define IMAGE_INSTANCE_WIDGET_ITEM(i) \
+(CONSP (IMAGE_INSTANCE_WIDGET_ITEMS (i)) ? \
+XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (i)) : \
IMAGE_INSTANCE_WIDGET_ITEMS (i))
#define IMAGE_INSTANCE_WIDGET_TEXT(i) XGUI_ITEM (IMAGE_INSTANCE_WIDGET_ITEM (i))->name
-#define IMAGE_INSTANCE_LAYOUT_CHILDREN(i) ((i)->u.subwindow.s.layout.children)
-#define IMAGE_INSTANCE_LAYOUT_BORDER(i) ((i)->u.subwindow.s.layout.border)
+#define IMAGE_INSTANCE_LAYOUT_CHILDREN(i) ((i)->u.subwindow.items)
+#define IMAGE_INSTANCE_LAYOUT_BORDER(i) ((i)->u.subwindow.props)
#define XIMAGE_INSTANCE_DEVICE(i) \
IMAGE_INSTANCE_DEVICE (XIMAGE_INSTANCE (i))
Lisp_Object baseline; /* percent above baseline */
Lisp_Object face; /* if non-nil, face to use when displaying */
-
+
Lisp_Object plist;
void (*after_change) (Lisp_Object glyph, Lisp_Object property,
Lisp_Object locale);
unsigned int dirty : 1; /* So that we can selectively
redisplay changed glyphs. */
};
+typedef struct Lisp_Glyph Lisp_Glyph;
-DECLARE_LRECORD (glyph, struct Lisp_Glyph);
-#define XGLYPH(x) XRECORD (x, glyph, struct Lisp_Glyph)
+DECLARE_LRECORD (glyph, Lisp_Glyph);
+#define XGLYPH(x) XRECORD (x, glyph, Lisp_Glyph)
#define XSETGLYPH(x, p) XSETRECORD (x, p, glyph)
#define GLYPHP(x) RECORDP (x, glyph)
#define CHECK_GLYPH(x) CHECK_RECORD (x, glyph)
Lisp_Object property,
Lisp_Object locale));
void query_string_geometry ( Lisp_Object string, Lisp_Object face,
- unsigned int* width, unsigned int* height,
+ unsigned int* width, unsigned int* height,
unsigned int* descent, Lisp_Object domain);
-Lisp_Object query_string_font (Lisp_Object string,
+Lisp_Object query_string_font (Lisp_Object string,
Lisp_Object face, Lisp_Object domain);
Lisp_Object add_glyph_animated_timeout (EMACS_INT tickms, Lisp_Object device);
void disable_glyph_animated_timeout (int i);
int check_for_ignored_expose (struct frame* f, int x, int y, int width, int height);
extern int hold_ignored_expose_registration;
-#endif /* _XEMACS_GLYPHS_H_ */
+#endif /* INCLUDED_glyphs_h_ */
#include <malloc.h>
#endif
-#if 0 /* FSFmacs */
-/* XEmacs requires an ANSI compiler, and memmove() is part of the ANSI-
- mandated functions. For losing systems like SunOS 4, we provide
- our own memmove(). */
-
-#if (defined (MEMMOVE_MISSING) || \
- !defined(_LIBC) && !defined(STDC_HEADERS) && !defined(USG))
-
-/* Snarfed directly from Emacs src/dispnew.c:
- XXX Should use system bcopy if it handles overlap. */
-#ifndef emacs
-
-/* Like bcopy except never gets confused by overlap. */
-
-static void
-safe_bcopy (char *from, char *to, int size)
-{
- if (size <= 0 || from == to)
- return;
-
- /* If the source and destination don't overlap, then bcopy can
- handle it. If they do overlap, but the destination is lower in
- memory than the source, we'll assume bcopy can handle that. */
- if (to < from || from + size <= to)
- bcopy (from, to, size);
-
- /* Otherwise, we'll copy from the end. */
- else
- {
- char *endf = from + size;
- char *endt = to + size;
-
- /* If TO - FROM is large, then we should break the copy into
- nonoverlapping chunks of TO - FROM bytes each. However, if
- TO - FROM is small, then the bcopy function call overhead
- makes this not worth it. The crossover point could be about
- anywhere. Since I don't think the obvious copy loop is too
- bad, I'm trying to err in its favor. */
- if (to - from < 64)
- {
- do
- *--endt = *--endf;
- while (endf != from);
- }
- else
- {
- for (;;)
- {
- endt -= (to - from);
- endf -= (to - from);
-
- if (endt < to)
- break;
-
- bcopy (endf, endt, to - from);
- }
-
- /* If SIZE wasn't a multiple of TO - FROM, there will be a
- little left over. The amount left over is
- (endt + (to - from)) - to, which is endt - from. */
- bcopy (from, to, endt - from);
- }
- }
-}
-#endif /* Not emacs. */
-
-#define memmove(to, from, size) safe_bcopy ((from), (to), (size))
-
-#endif
-
-#endif /* FSFmacs */
-
-
#ifndef min
#define min(A, B) ((A) < (B) ? (A) : (B))
#endif
-/* GPM functions
+/* GPM (General purpose mouse) functions
Copyright (C) 1997 William M. Perry <wmperry@gnu.org>
Copyright (C) 1999 Free Software Foundation, Inc.
extern void *gpm_stack;
static int (*orig_event_pending_p) (int);
-static void (*orig_next_event_cb) (struct Lisp_Event *);
+static void (*orig_next_event_cb) (Lisp_Event *);
static Lisp_Object gpm_event_queue;
static Lisp_Object gpm_event_queue_tail;
}
static int
-get_process_infd (struct Lisp_Process *p)
+get_process_infd (Lisp_Process *p)
{
Lisp_Object instr, outstr;
get_process_streams (p, &instr, &outstr);
int modifiers = 0;
int button = 1;
Lisp_Object fake_event;
- struct Lisp_Event *event = NULL;
+ Lisp_Event *event = NULL;
struct gcpro gcpro1;
static int num_events;
static void
tty_set_mouse_position (struct window *w, int x, int y)
{
- /*
+ /*
#### I couldn't find any GPM functions that set the mouse position.
#### Mr. Perry had left this function empty; that must be why.
#### karlheg
return (orig_event_pending_p (user_p));
}
-static void gpm_next_event_cb (struct Lisp_Event *event)
+static void gpm_next_event_cb (Lisp_Event *event)
{
/* #### It would be nice to preserve some sort of ordering of the
** #### different types of events, but that would be quite a bit
** #### of work, and would more than likely break the abstraction
** #### between the other event loops and this one.
*/
-
+
if (!NILP (gpm_event_queue))
{
Lisp_Object queued_event = dequeue_event (&gpm_event_queue, &gpm_event_queue_tail);
** descriptor, or it can get the wrong terminal sizes, etc.
*/
gpm_consolefd = fd;
-
+
/* We have to pass the virtual console manually, otherwise if you
** use 'gnuclient -nw' to connect to an XEmacs that is running in
** X, Gpm_Open() tries to use ttyname(0 | 1 | 2) to find out which
-#ifndef _HAVE_GPM
-#define _HAVE_GPM
+/* GPM (General purpose mouse) support
+ Copyright (C) 1997 William M. Perry <wmperry@gnu.org>
+ Copyright (C) 1999 Free Software Foundation, Inc.
-int handle_gpm_read (struct Lisp_Event *event, struct console *con, int fd);
+This file is part of XEmacs.
+
+XEmacs is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+XEmacs is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with XEmacs; see the file COPYING. If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#ifndef INCLUDED_gpmevent_h_
+#define INCLUDED_gpmevent_h_
+
+int handle_gpm_read (Lisp_Event *event, struct console *con, int fd);
void connect_to_gpm (struct console *con);
-#endif
+#endif /* INCLUDED_gpmevent_h_ */
#include "frame.h"
#include "elhash.h"
#include "console-msw.h"
+#include "buffer.h"
/*
* Return value is Qt if we have dispatched the command,
* command if we return nil
*/
Lisp_Object
-mswindows_handle_gui_wm_command (struct frame* f, HWND ctrl, WORD id)
+mswindows_handle_gui_wm_command (struct frame* f, HWND ctrl, DWORD id)
{
/* Try to map the command id through the proper hash table */
Lisp_Object data, fn, arg, frame;
+ /* #### make_int should assert that --kkm */
+ assert (XINT (make_int (id)) == id);
+
data = Fgethash (make_int (id),
FRAME_MSWINDOWS_WIDGET_HASH_TABLE (f), Qnil);
return Qt;
}
+DEFUN ("mswindows-shell-execute", Fmswindows_shell_execute, 2, 4, 0, /*
+Get Windows to perform OPERATION on DOCUMENT.
+This is a wrapper around the ShellExecute system function, which
+invokes the application registered to handle OPERATION for DOCUMENT.
+OPERATION is typically \"open\", \"print\" or \"explore\" (but can be
+nil for the default action), and DOCUMENT is typically the name of a
+document file or URL, but can also be a program executable to run or
+a directory to open in the Windows Explorer.
+
+If DOCUMENT is a program executable, PARAMETERS can be a string
+containing command line parameters, but otherwise should be nil.
+
+SHOW-FLAG can be used to control whether the invoked application is hidden
+or minimized. If SHOW-FLAG is nil, the application is displayed normally,
+otherwise it is an integer representing a ShowWindow flag:
+
+ 0 - start hidden
+ 1 - start normally
+ 3 - start maximized
+ 6 - start minimized
+*/
+ (operation, document, parameters, show_flag))
+{
+ Lisp_Object current_dir;
+
+ CHECK_STRING (document);
+
+ /* Encode filename and current directory. */
+ current_dir = current_buffer->directory;
+ if ((int) ShellExecute (NULL,
+ (STRINGP (operation) ?
+ XSTRING (operation)->data : NULL),
+ XSTRING (document)->data,
+ (STRINGP (parameters) ?
+ XSTRING (parameters)->data : NULL),
+ XSTRING (current_dir)->data,
+ (INTP (show_flag) ?
+ XINT (show_flag) : SW_SHOWDEFAULT))
+ > 32)
+ return Qt;
+
+ error ("ShellExecute failed");
+ return Qnil;
+}
+
+void
+syms_of_gui_mswindows (void)
+{
+ DEFSUBR (Fmswindows_shell_execute);
+}
/* !!#### This function has not been Mule-ized */
/* This function cannot GC because gc_currently_forbidden is set when
it's called */
- struct Lisp_Gui_Item* pgui = 0;
+ Lisp_Gui_Item* pgui = 0;
/* degenerate case */
if (STRINGP (gui_item))
CHECK_STRING (suffix2);
}
- GET_C_STRING_FILENAME_DATA_ALLOCA (suffix2, const_bogosity);
+ TO_EXTERNAL_FORMAT (LISP_STRING, suffix2,
+ C_STRING_ALLOCA, const_bogosity,
+ Qfile_name);
wv->value = (char *) const_bogosity;
wv->value = xstrdup (wv->value);
}
wv = xmalloc_widget_value();
if (parent)
parent->contents = wv;
- else
+ else
prev->next = wv;
if (!button_item_to_widget_value (items, wv, 0, 1))
{
free_widget_value_tree (wv);
if (parent)
parent->contents = 0;
- else
+ else
prev->next = 0;
}
- else
+ else
{
wv->value = xstrdup (wv->name); /* what a mess... */
}
/* Synched up with: Not in FSF. */
-#ifndef _XEMACS_XLWLIB_H_
-#define _XEMACS_XLWLIB_H_
+#ifndef INCLUDED_gui_x_h_
+#define INCLUDED_gui_x_h_
#include "../lwlib/lwlib.h"
char *menu_separator_style (CONST char *s);
Lisp_Object widget_value_unwind (Lisp_Object closure);
-#endif /* _XEMACS_XLWLIB_H_ */
+#endif /* INCLUDED_gui_x_h_ */
*/
void
gui_item_add_keyval_pair (Lisp_Object gui_item,
- Lisp_Object key, Lisp_Object val,
+ Lisp_Object key, Lisp_Object val,
Error_behavior errb)
{
- struct Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item);
+ Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item);
if (!KEYWORDP (key))
signal_simple_error_2 ("Non-keyword in gui item", key, pgui_item->name);
else if (EQ (key, Q_selected)) pgui_item->selected = val;
else if (EQ (key, Q_keys)) pgui_item->keys = val;
else if (EQ (key, Q_callback)) pgui_item->callback = val;
- else if (EQ (key, Q_key_sequence)) ; /* ignored for FSF compatability */
+ else if (EQ (key, Q_key_sequence)) ; /* ignored for FSF compatibility */
else if (EQ (key, Q_label)) ; /* ignored for 21.0 implement in 21.2 */
else if (EQ (key, Q_accelerator))
{
void
gui_item_init (Lisp_Object gui_item)
{
- struct Lisp_Gui_Item *lp = XGUI_ITEM (gui_item);
+ Lisp_Gui_Item *lp = XGUI_ITEM (gui_item);
lp->name = Qnil;
lp->callback = Qnil;
Lisp_Object
allocate_gui_item (void)
{
- struct Lisp_Gui_Item *lp =
- alloc_lcrecord_type (struct Lisp_Gui_Item, &lrecord_gui_item);
+ Lisp_Gui_Item *lp = alloc_lcrecord_type (Lisp_Gui_Item, &lrecord_gui_item);
Lisp_Object val;
zero_lcrecord (lp);
int length, plist_p, start;
Lisp_Object *contents;
Lisp_Object gui_item = allocate_gui_item ();
- struct Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item);
+ Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item);
CHECK_VECTOR (item);
length = XVECTOR_LENGTH (item);
pgui_item->callback = contents [1];
start = 2;
}
- else
+ else
start =1;
if (!plist_p && length > 2)
void
gui_add_item_keywords_to_plist (Lisp_Object plist, Lisp_Object gui_item)
{
- struct Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item);
-
+ Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item);
+
if (!NILP (pgui_item->callback))
Fplist_put (plist, Q_callback, pgui_item->callback);
if (!NILP (pgui_item->suffix))
Lisp_Object
gui_item_accelerator (Lisp_Object gui_item)
{
- struct Lisp_Gui_Item* pgui = XGUI_ITEM (gui_item);
-
+ Lisp_Gui_Item* pgui = XGUI_ITEM (gui_item);
+
if (!NILP (pgui->accelerator))
return pgui->accelerator;
gui_item_included_p (Lisp_Object gui_item, Lisp_Object conflist)
{
/* This function can call lisp */
- struct Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item);
+ Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item);
/* Evaluate :included first. Shortcut to avoid evaluating Qt each time */
if (!EQ (pgui_item->included, Qt)
/* This function can call lisp */
char *p = buf;
Bytecount len;
- struct Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item);
+ Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item);
/* Copy item name first */
CHECK_STRING (pgui_item->name);
gui_item_display_flush_right (Lisp_Object gui_item,
char* buf, Bytecount buf_len)
{
- struct Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item);
+ Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item);
*buf = 0;
#ifdef HAVE_MENUBARS
static Lisp_Object
mark_gui_item (Lisp_Object obj)
{
- struct Lisp_Gui_Item *p = XGUI_ITEM (obj);
+ Lisp_Gui_Item *p = XGUI_ITEM (obj);
mark_object (p->name);
mark_object (p->callback);
static unsigned long
gui_item_hash (Lisp_Object obj, int depth)
{
- struct Lisp_Gui_Item *p = XGUI_ITEM (obj);
+ Lisp_Gui_Item *p = XGUI_ITEM (obj);
return HASH2 (HASH5 (internal_hash (p->name, depth + 1),
internal_hash (p->callback, depth + 1),
static int
gui_item_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
{
- struct Lisp_Gui_Item *p1 = XGUI_ITEM (obj1);
- struct Lisp_Gui_Item *p2 = XGUI_ITEM (obj2);
+ Lisp_Gui_Item *p1 = XGUI_ITEM (obj1);
+ Lisp_Gui_Item *p2 = XGUI_ITEM (obj2);
if (!(internal_equal (p1->name, p2->name, depth + 1)
&&
static void
print_gui_item (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
- struct Lisp_Gui_Item *g = XGUI_ITEM (obj);
+ Lisp_Gui_Item *g = XGUI_ITEM (obj);
char buf[20];
if (print_readably)
sub = parse_gui_item_tree_list (XCAR (rest));
else
sub = parse_gui_item_tree_item (XCAR (rest));
-
+
ret = Fcons (sub, ret);
}
/* make the order the same as the items we have parsed */
0, gui_item_equal,
gui_item_hash,
0,
- struct Lisp_Gui_Item);
+ Lisp_Gui_Item);
void
syms_of_gui (void)
/* Written by kkm on 12/24/97 */
-#ifndef _XEMACS_GUI_H_
-#define _XEMACS_GUI_H_
+#ifndef INCLUDED_gui_h_
+#define INCLUDED_gui_h_
int separator_string_p (CONST char *s);
void get_gui_callback (Lisp_Object, Lisp_Object *, Lisp_Object *);
/* Image Instance Object */
/************************************************************************/
-DECLARE_LRECORD (gui_item, struct Lisp_Gui_Item);
-#define XGUI_ITEM(x) \
- XRECORD (x, gui_item, struct Lisp_Gui_Item)
-#define XSETGUI_ITEM(x, p) XSETRECORD (x, p, gui_item)
-#define GUI_ITEMP(x) RECORDP (x, gui_item)
-#define CHECK_GUI_ITEM(x) CHECK_RECORD (x, gui_item)
-#define CONCHECK_GUI_ITEM(x) CONCHECK_RECORD (x, gui_item)
-
/* This structure describes gui button,
menu item or submenu properties */
struct Lisp_Gui_Item
Lisp_Object accelerator; /* Char or Symbol */
};
+DECLARE_LRECORD (gui_item, Lisp_Gui_Item);
+#define XGUI_ITEM(x) XRECORD (x, gui_item, Lisp_Gui_Item)
+#define XSETGUI_ITEM(x, p) XSETRECORD (x, p, gui_item)
+#define GUI_ITEMP(x) RECORDP (x, gui_item)
+#define CHECK_GUI_ITEM(x) CHECK_RECORD (x, gui_item)
+#define CONCHECK_GUI_ITEM(x) CONCHECK_RECORD (x, gui_item)
+
extern Lisp_Object Q_accelerator, Q_active, Q_config, Q_filter, Q_included;
extern Lisp_Object Q_keys, Q_selected, Q_suffix, Qradio, Qtoggle;
extern Lisp_Object Q_key_sequence, Q_label, Q_callback;
#define MAX_MENUITEM_LENGTH 128
-#endif /* _XEMACS_GUI_H_ */
+#endif /* INCLUDED_gui_h_ */
/* Synched up with: Not in FSF. */
-#ifndef _HASH_H_
-#define _HASH_H_
+#ifndef INCLUDED_hash_h_
+#define INCLUDED_hash_h_
typedef struct
{
void map_remhash (remhash_predicate predicate,
struct hash_table *hash_table, void *arg);
-#endif /* _HASH_H_ */
+#endif /* INCLUDED_hash_h_ */
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#ifndef INCLUDED_imgproc_h_
+#define INCLUDED_imgproc_h_
+
/* Synched up with: Not in FSF. */
/* Original author: Jareth Hein */
#define QUANT_GET_COLOR(qt,r,g,b) (qt->histogram[r>>COLOR_SHIFT][g>>COLOR_SHIFT][b>>COLOR_SHIFT])
quant_table *build_EImage_quantable(unsigned char *eimage, int width, int height, int num_colors);
+
+#endif /* INCLUDED_imgproc_h_ */
{
char *locale;
- /* dverna - Nov. 98: ### DON'T DO THIS !!! The default XtLanguageProc
+ /* dverna - Nov. 98: #### DON'T DO THIS !!! The default XtLanguageProc
routine calls setlocale(LC_ALL, lang) which fucks up our lower-level
locale management, and especially the value of LC_NUMERIC. Anyway, since
at this point, we don't know yet whether we're gonna need an X11 frame,
void
XIM_SetSpotLocation (struct frame *f, int x, int y)
{
- /* ### FIX: Must make sure spot fits within Preedit Area */
+ /* #### FIX: Must make sure spot fits within Preedit Area */
XPoint *spot = &(FRAME_X_XIC_SPOT (f));
if (spot->x == (short) x &&
spot->y == (short) y)
{
char *locale;
- /* dverna - Nov. 98: ### DON'T DO THIS !!! The default XtLanguageProc
+ /* dverna - Nov. 98: #### DON'T DO THIS !!! The default XtLanguageProc
routine calls setlocale(LC_ALL, lang) which fucks up our lower-level
locale management, and especially the value of LC_NUMERIC. Anyway, since
at this point, we don't know yet whether we're gonna need an X11 frame,
spot->x = (short) x;
spot->y = (short) y;
- /* ### FIX: Must make sure spot fits within Preedit Area */
+ /* #### FIX: Must make sure spot fits within Preedit Area */
XIC_Value (Set, xic, XNPreeditAttributes, XNSpotLocation, spot);
#ifdef DEBUG_XIM
stderr_out ("Spot: %d %d\n", spot->x, spot->y);
/* Mostly rewritten by Ben Wing. */
-#ifndef _XEMACS_INSDEL_H_
-#define _XEMACS_INSDEL_H_
+#ifndef INCLUDED_insdel_h_
+#define INCLUDED_insdel_h_
/************************************************************************/
/* changing a buffer's text */
void init_buffer_text (struct buffer *b);
void uninit_buffer_text (struct buffer *b);
-#endif /* _XEMACS_INSDEL_H_ */
+#endif /* INCLUDED_insdel_h_ */
/* Synched up with: Not in FSF. */
-#ifndef _XEMACS_ISO_WIDE_H
-#define _XEMACS_ISO_WIDE_H
+#ifndef INCLUDED_iso_wide_h_
+#define INCLUDED_iso_wide_h_
/* The following macros are designed for SunOS 5.0 wide characters,
in which the single byte ISO Latin-1 character 1xxxxxxx are represented
#define WIDE_TO_BYTE(c) (IS_ISO_WIDE (c) ? ISO_WIDE_TO_BYTE (c) : (c))
#define BYTE_TO_WIDE(c) (IS_ISO_BYTE (c) ? ISO_BYTE_TO_WIDE (c) : (c))
-#endif /* _XEMACS_ISO_WIDE_H */
+#endif /* INCLUDED_iso_wide_h_ */
Since keymaps are opaque, the only way to extract information from them
is with the functions lookup-key, key-binding, local-key-binding, and
global-key-binding, which work just as before, and the new function
- map-keymap, which is roughly analagous to maphash.
+ map-keymap, which is roughly analogous to maphash.
Note that map-keymap perpetuates the illusion that the "bucky" submaps
don't exist: if you map over a keymap with bucky submaps, it will also
*/
-typedef struct Lisp_Keymap
+struct Lisp_Keymap
{
struct lcrecord_header header;
- Lisp_Object parents; /* Keymaps to be searched after this one
- * An ordered list */
+ Lisp_Object parents; /* Keymaps to be searched after this one.
+ An ordered list */
Lisp_Object prompt; /* Qnil or a string to print in the minibuffer
- * when reading from this keymap */
-
+ when reading from this keymap */
Lisp_Object table; /* The contents of this keymap */
Lisp_Object inverse_table; /* The inverse mapping of the above */
-
Lisp_Object default_binding; /* Use this if no other binding is found
- * (this overrides parent maps and the
- * normal global-map lookup). */
-
-
+ (this overrides parent maps and the
+ normal global-map lookup). */
Lisp_Object sub_maps_cache; /* Cache of directly inferior keymaps;
This holds an alist, of the key and the
maps, or the modifier bit and the map.
If this is the symbol t, then the cache
- needs to be recomputed.
- */
- int fullness; /* How many entries there are in this table.
- This should be the same as the fullness
- of the `table', but hash.c is broken. */
+ needs to be recomputed. */
Lisp_Object name; /* Just for debugging convenience */
-} Lisp_Keymap;
+};
#define MAKE_MODIFIER_HASH_KEY(modifier) make_int (modifier)
#define MODIFIER_HASH_KEY_BITS(x) (INTP (x) ? XINT (x) : 0)
/* Actually allocate storage for these variables */
-static Lisp_Object Vcurrent_global_map; /* Always a keymap */
+Lisp_Object Vcurrent_global_map; /* Always a keymap */
static Lisp_Object Vmouse_grabbed_buffer;
Lisp_Object shadow,
int mice_only_p,
Lisp_Object buffer);
+static Lisp_Object keymap_submaps (Lisp_Object keymap);
Lisp_Object Qcontrol, Qctrl, Qmeta, Qsuper, Qhyper, Qalt, Qshift;
Lisp_Object Qbutton0, Qbutton1, Qbutton2, Qbutton3;
/* This function can GC */
Lisp_Keymap *keymap = XKEYMAP (obj);
char buf[200];
- int size = XINT (Fkeymap_fullness (obj));
if (print_readably)
error ("printing unreadable object #<keymap 0x%x>", keymap->header.uid);
write_c_string ("#<keymap ", printcharfun);
if (!NILP (keymap->name))
- print_internal (keymap->name, printcharfun, 1);
- /* #### Yuck! This is no way to form plural! --hniksic */
- sprintf (buf, "%s%d entr%s 0x%x>",
- (NILP (keymap->name) ? "" : " "),
- size,
- ((size == 1) ? "y" : "ies"),
- keymap->header.uid);
+ {
+ print_internal (keymap->name, printcharfun, 1);
+ write_c_string (" ", printcharfun);
+ }
+ sprintf (buf, "size %ld 0x%x>",
+ (long) XINT (Fkeymap_fullness (obj)), keymap->header.uid);
write_c_string (buf, printcharfun);
}
static const struct lrecord_description keymap_description[] = {
- { XD_LISP_OBJECT, offsetof(Lisp_Keymap, parents), 6 },
- { XD_LISP_OBJECT, offsetof(Lisp_Keymap, name), 1 },
+ { XD_LISP_OBJECT, offsetof (Lisp_Keymap, parents) },
+ { XD_LISP_OBJECT, offsetof (Lisp_Keymap, prompt) },
+ { XD_LISP_OBJECT, offsetof (Lisp_Keymap, table) },
+ { XD_LISP_OBJECT, offsetof (Lisp_Keymap, inverse_table) },
+ { XD_LISP_OBJECT, offsetof (Lisp_Keymap, default_binding) },
+ { XD_LISP_OBJECT, offsetof (Lisp_Keymap, sub_maps_cache) },
+ { XD_LISP_OBJECT, offsetof (Lisp_Keymap, name) },
{ XD_END }
};
start_keymap = get_keymap (start_keymap, 1, 1);
keymap = start_keymap;
/* Hack special-case parents at top-level */
- tail = ((!NILP (tail)) ? tail : XKEYMAP (keymap)->parents);
+ tail = !NILP (tail) ? tail : XKEYMAP (keymap)->parents;
for (;;)
{
Lisp_Object result;
QUIT;
- result = ((mapper) (keymap, mapper_arg));
+ result = mapper (keymap, mapper_arg);
if (!NILP (result))
{
while (CONSP (malloc_bites))
{
- struct Lisp_Cons *victim = XCONS (malloc_bites);
+ Lisp_Cons *victim = XCONS (malloc_bites);
malloc_bites = victim->cdr;
free_cons (victim);
}
stack_depth--;
if (CONSP (malloc_bites))
{
- struct Lisp_Cons *victim = XCONS (malloc_bites);
+ Lisp_Cons *victim = XCONS (malloc_bites);
tail = victim->car;
malloc_bites = victim->cdr;
free_cons (victim);
*/
}
+/* Prevent luser from shooting herself in the foot using something like
+ (define-key ctl-x-4-map "p" global-map) */
+static void
+check_keymap_definition_loop (Lisp_Object def, Lisp_Keymap *to_keymap)
+{
+ def = get_keymap (def, 0, 0);
+
+ if (KEYMAPP (def))
+ {
+ Lisp_Object maps;
+
+ if (XKEYMAP (def) == to_keymap)
+ signal_simple_error ("Cyclic keymap definition", def);
+
+ for (maps = keymap_submaps (def);
+ CONSP (maps);
+ maps = XCDR (maps))
+ check_keymap_definition_loop (XCDR (XCAR (maps)), to_keymap);
+ }
+}
static void
keymap_store_internal (Lisp_Object keysym, Lisp_Keymap *keymap,
- Lisp_Object value)
+ Lisp_Object def)
{
- Lisp_Object prev_value = Fgethash (keysym, keymap->table, Qnil);
+ Lisp_Object prev_def = Fgethash (keysym, keymap->table, Qnil);
- if (EQ (prev_value, value))
+ if (EQ (prev_def, def))
return;
- if (!NILP (prev_value))
+
+ check_keymap_definition_loop (def, keymap);
+
+ if (!NILP (prev_def))
keymap_delete_inverse_internal (keymap->inverse_table,
- keysym, prev_value);
- if (NILP (value))
+ keysym, prev_def);
+ if (NILP (def))
{
- keymap->fullness--;
- if (keymap->fullness < 0) abort ();
Fremhash (keysym, keymap->table);
}
else
{
- if (NILP (prev_value))
- keymap->fullness++;
- Fputhash (keysym, value, keymap->table);
+ Fputhash (keysym, def, keymap->table);
keymap_store_inverse_internal (keymap->inverse_table,
- keysym, value);
+ keysym, def);
}
keymap_tick++;
}
{
Lisp_Object keysym = key->keysym;
unsigned int modifiers = key->modifiers;
- Lisp_Keymap *k;
-
- if ((modifiers & ~(MOD_CONTROL | MOD_META | MOD_SUPER | MOD_HYPER
- | MOD_ALT | MOD_SHIFT)) != 0)
- abort ();
+ Lisp_Keymap *k = XKEYMAP (keymap);
- k = XKEYMAP (keymap);
+ assert ((modifiers & ~(MOD_CONTROL | MOD_META | MOD_SUPER | MOD_HYPER
+ | MOD_ALT | MOD_SHIFT)) == 0);
/* If the keysym is a one-character symbol, use the char code instead. */
if (SYMBOLP (keysym) && string_char_length (XSYMBOL (keysym)->name) == 1)
- {
- Lisp_Object run_the_gcc_developers_over_with_a_steamroller =
- make_char (string_char (XSYMBOL (keysym)->name, 0));
- keysym = run_the_gcc_developers_over_with_a_steamroller;
- }
+ keysym = make_char (string_char (XSYMBOL (keysym)->name, 0));
if (modifiers & MOD_META) /* Utterly hateful ESC lossage */
{
keymap->inverse_table = Qnil;
keymap->default_binding = Qnil;
keymap->sub_maps_cache = Qnil; /* No possible submaps */
- keymap->fullness = 0;
keymap->name = Qnil;
if (size != 0) /* hack for copy-keymap */
struct key_data indirection;
if (CHARP (idx))
{
- struct Lisp_Event event;
+ Lisp_Event event;
event.event_type = empty_event;
character_to_event (XCHAR (idx), &event,
XCONSOLE (Vselected_console), 0, 0);
copy_keymap_inverse_closure.inverse_table = keymap->inverse_table;
new_keymap->parents = Fcopy_sequence (keymap->parents);
- new_keymap->fullness = keymap->fullness;
new_keymap->sub_maps_cache = Qnil; /* No submaps */
new_keymap->table = Fcopy_hash_table (keymap->table);
new_keymap->inverse_table = Fcopy_hash_table (keymap->inverse_table);
struct gcpro gcpro1, gcpro2;
keymap = get_keymap (keymap, 1, 1);
- fullness = XKEYMAP (keymap)->fullness;
- sub_maps = keymap_submaps (keymap);
+ fullness = XINT (Fhash_table_count (XKEYMAP (keymap)->table));
GCPRO2 (keymap, sub_maps);
- for (; !NILP (sub_maps); sub_maps = XCDR (sub_maps))
+ for (sub_maps = keymap_submaps (keymap);
+ !NILP (sub_maps);
+ sub_maps = XCDR (sub_maps))
{
if (MODIFIER_HASH_KEY_BITS (XCAR (XCAR (sub_maps))) != 0)
{
- Lisp_Object sub_map = XCDR (XCAR (sub_maps));
- fullness--; /* don't count bucky maps */
- fullness += keymap_fullness (sub_map);
+ Lisp_Object bucky_map = XCDR (XCAR (sub_maps));
+ fullness--; /* don't count bucky maps themselves. */
+ fullness += keymap_fullness (bucky_map);
}
}
UNGCPRO;
}
else
{
- signal_simple_error ("Unknown keysym specifier",
- *keysym);
+ signal_simple_error ("Unknown keysym specifier", *keysym);
}
if (SYMBOLP (*keysym))
{
- char *name = (char *)
- string_data (XSYMBOL (*keysym)->name);
+ char *name = (char *) string_data (XSYMBOL (*keysym)->name);
/* FSFmacs uses symbols with the printed representation of keysyms in
their names, like 'M-x, and we use the syntax '(meta x). So, to avoid
{
if (CHAR_OR_CHAR_INTP (spec))
{
- struct Lisp_Event event;
+ Lisp_Event event;
event.event_type = empty_event;
character_to_event (XCHAR_OR_CHAR_INT (spec), &event,
XCONSOLE (Vselected_console), 0, 0);
int
-event_matches_key_specifier_p (struct Lisp_Event *event,
- Lisp_Object key_specifier)
+event_matches_key_specifier_p (Lisp_Event *event, Lisp_Object key_specifier)
{
Lisp_Object event2;
int retval;
static int
meta_prefix_char_p (CONST struct key_data *key)
{
- struct Lisp_Event event;
+ Lisp_Event event;
event.event_type = key_press_event;
event.channel = Vselected_console;
(defvar my-escape-map (lookup-key my-map "\e"))
if the luser really wants the map in a variable.
*/
- Lisp_Object mmap;
+ Lisp_Object meta_map;
struct gcpro ngcpro1;
NGCPRO1 (c);
- mmap = Fgethash (MAKE_MODIFIER_HASH_KEY (MOD_META),
- XKEYMAP (keymap)->table, Qnil);
- if (!NILP (mmap)
- && keymap_fullness (mmap) != 0)
- {
- Lisp_Object desc
- = Fsingle_key_description (Vmeta_prefix_char);
- signal_simple_error_2
- ("Map contains meta-bindings, can't bind", desc, keymap);
- }
+ meta_map = Fgethash (MAKE_MODIFIER_HASH_KEY (MOD_META),
+ XKEYMAP (keymap)->table, Qnil);
+ if (!NILP (meta_map)
+ && keymap_fullness (meta_map) != 0)
+ signal_simple_error_2
+ ("Map contains meta-bindings, can't bind",
+ Fsingle_key_description (Vmeta_prefix_char), keymap);
NUNGCPRO;
}
else
if (metized)
{
- raw_key1.modifiers |= MOD_META;
+ raw_key1.modifiers |= MOD_META;
raw_key2.modifiers |= MOD_META;
metized = 0;
}
c.tail = Qnil;
GCPRO4 (accessible_keymaps, c.tail, prefix, keymap);
- retry:
keymap = get_keymap (keymap, 1, 1);
+
+ retry:
if (NILP (prefix))
- prefix = make_vector (0, Qnil);
- else if (!VECTORP (prefix) || STRINGP (prefix))
{
- prefix = wrong_type_argument (Qarrayp, prefix);
- goto retry;
+ prefix = make_vector (0, Qnil);
}
- else
+ else if (VECTORP (prefix) || STRINGP (prefix))
{
int len = XINT (Flength (prefix));
- Lisp_Object def = Flookup_key (keymap, prefix, Qnil);
+ Lisp_Object def;
Lisp_Object p;
int iii;
struct gcpro ngcpro1;
+ if (len == 0)
+ {
+ prefix = Qnil;
+ goto retry;
+ }
+
+ def = Flookup_key (keymap, prefix, Qnil);
def = get_keymap (def, 0, 1);
if (!KEYMAPP (def))
goto RETURN;
NUNGCPRO;
prefix = p;
}
+ else
+ {
+ prefix = wrong_type_argument (Qarrayp, prefix);
+ goto retry;
+ }
accessible_keymaps = list1 (Fcons (prefix, keymap));
- /* For each map in the list maps,
- look at any other maps it points to
- and stick them at the end if they are not already in the list */
+ /* For each map in the list maps, look at any other maps it points
+ to and stick them at the end if they are not already in the list */
for (c.tail = accessible_keymaps;
!NILP (c.tail);
char buf [255];
if (!EVENTP (key))
{
- struct Lisp_Event event;
+ Lisp_Event event;
event.event_type = empty_event;
CHECK_CHAR_COERCE_INT (key);
character_to_event (XCHAR (key), &event,
format_raw_keys (struct key_data *keys, int count, char *buf)
{
int i;
- struct Lisp_Event event;
+ Lisp_Event event;
event.event_type = key_press_event;
event.channel = Vselected_console;
for (i = 0; i < count; i++)
/* Synched up with: Not in FSF. */
-#ifndef _XEMACS_KEYMAP_H_
-#define _XEMACS_KEYMAP_H_
+#ifndef INCLUDED_keymap_h_
+#define INCLUDED_keymap_h_
-DECLARE_LRECORD (keymap, struct Lisp_Keymap);
-#define XKEYMAP(x) XRECORD (x, keymap, struct Lisp_Keymap)
+typedef struct Lisp_Keymap Lisp_Keymap;
+
+DECLARE_LRECORD (keymap, Lisp_Keymap);
+#define XKEYMAP(x) XRECORD (x, keymap, Lisp_Keymap)
#define XSETKEYMAP(x, p) XSETRECORD (x, p, keymap)
#define KEYMAPP(x) RECORDP (x, keymap)
#define CHECK_KEYMAP(x) CHECK_RECORD (x, keymap)
void key_desc_list_to_event (Lisp_Object list, Lisp_Object event,
int allow_menu_events);
-int event_matches_key_specifier_p (struct Lisp_Event *event,
+int event_matches_key_specifier_p (Lisp_Event *event,
Lisp_Object key_specifier);
-#endif /* _XEMACS_KEYMAP_H_ */
+#endif /* INCLUDED_keymap_h_ */
/* Synched up with: Not in FSF. */
+#ifndef INCLUDED_libsst_h_
+#define INCLUDED_libsst_h_
+
#include <sys/ioctl.h>
#ifndef SUNOS4_0_3
#define AUDIO_4_0_3_COMPAT
#else /* !emacs */
# define warn(str) fprintf (stderr, "%s\n", (str))
#endif /* emacs */
+
+#endif /* INCLUDED_libsst_h_ */
/* Synched up with: Not in FSF. */
+#ifndef INCLUDED_libst_h_
+#define INCLUDED_libst_h_
+
#define SAMPLES_PER_SECOND 8192
#define MINLIN -32768
244, 228, 212, 196, 180, 164, 148, 132,
120, 112, 104, 96, 88, 80, 72, 64,
56, 48, 40, 32, 24, 16, 8, 0 };
+
+#endif /* INCLUDED_libst_h_ */
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#ifndef INCLUDED_line_number_h_
+#define INCLUDED_line_number_h_
+
/* Synched up with: Not in FSF. */
void narrow_line_number_cache (struct buffer *);
void delete_invalidate_line_number_cache (struct buffer *, Bufpos, Bufpos);
EMACS_INT buffer_line_number (struct buffer *, Bufpos, int);
+
+#endif /* INCLUDED_line_number_h_ */
/* If the stream is not line-buffered, then we can just call
Lstream_write_1(), which writes in chunks. Otherwise, we
repeatedly call Lstream_putc(), which knows how to handle
- line buffering. */
+ line buffering. Returns number of bytes written. */
ssize_t
Lstream_write (Lstream *lstr, CONST void *data, size_t size)
if (Lstream_putc (lstr, p[i]) < 0)
break;
}
- return i == 0 ? -1 : 0;
+ return i == 0 ? -1 : (ssize_t) i;
}
int
sizeof (struct fixed_buffer_stream));
Lisp_Object
-make_fixed_buffer_input_stream (CONST unsigned char *buf, size_t size)
+make_fixed_buffer_input_stream (CONST void *buf, size_t size)
{
Lisp_Object obj;
Lstream *lstr = Lstream_new (lstream_fixed_buffer, "r");
struct fixed_buffer_stream *str = FIXED_BUFFER_STREAM_DATA (lstr);
- str->inbuf = buf;
+ str->inbuf = (const unsigned char *) buf;
str->size = size;
XSETLSTREAM (obj, lstr);
return obj;
}
Lisp_Object
-make_fixed_buffer_output_stream (unsigned char *buf, size_t size)
+make_fixed_buffer_output_stream (void *buf, size_t size)
{
Lisp_Object obj;
Lstream *lstr = Lstream_new (lstream_fixed_buffer, "w");
struct fixed_buffer_stream *str = FIXED_BUFFER_STREAM_DATA (lstr);
- str->outbuf = buf;
+ str->outbuf = (unsigned char *) buf;
str->size = size;
XSETLSTREAM (obj, lstr);
return obj;
/* Synched up with: FSF 19.30. */
-#ifndef _XEMACS_MACROS_H_
-#define _XEMACS_MACROS_H_
+#ifndef INCLUDED_macros_h_
+#define INCLUDED_macros_h_
/* Index of next character to fetch from that macro */
extern Lisp_Object Vexecuting_macro;
-#endif /* _XEMACS_MACROS_H_ */
+#endif /* INCLUDED_macros_h_ */
static Lisp_Object
mark_marker (Lisp_Object obj)
{
- struct Lisp_Marker *marker = XMARKER (obj);
+ Lisp_Marker *marker = XMARKER (obj);
Lisp_Object buf;
/* DO NOT mark through the marker's chain.
The buffer's markers chain does not preserve markers from gc;
static void
print_marker (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
- struct Lisp_Marker *marker = XMARKER (obj);
+ Lisp_Marker *marker = XMARKER (obj);
char buf[200];
if (print_readably)
static int
marker_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
{
- struct Lisp_Marker *marker1 = XMARKER (obj1);
- struct Lisp_Marker *marker2 = XMARKER (obj2);
+ Lisp_Marker *marker1 = XMARKER (obj1);
+ Lisp_Marker *marker2 = XMARKER (obj2);
return ((marker1->buffer == marker2->buffer) &&
(marker1->memind == marker2->memind ||
}
static const struct lrecord_description marker_description[] = {
- { XD_LISP_OBJECT, offsetof(struct Lisp_Marker, next), 3 },
+ { XD_LISP_OBJECT, offsetof (Lisp_Marker, next) },
+ { XD_LISP_OBJECT, offsetof (Lisp_Marker, prev) },
+ { XD_LISP_OBJECT, offsetof (Lisp_Marker, buffer) },
{ XD_END }
};
DEFINE_BASIC_LRECORD_IMPLEMENTATION ("marker", marker,
mark_marker, print_marker, 0,
marker_equal, marker_hash, marker_description,
- struct Lisp_Marker);
+ Lisp_Marker);
\f
/* Operations on markers. */
static void
check_marker_circularities (struct buffer *buf)
{
- struct Lisp_Marker *tortoise, *hare;
+ Lisp_Marker *tortoise, *hare;
tortoise = BUF_MARKERS (buf);
hare = tortoise;
{
Bufpos charno;
struct buffer *b;
- struct Lisp_Marker *m;
+ Lisp_Marker *m;
int point_p;
CHECK_MARKER (marker);
void
unchain_marker (Lisp_Object m)
{
- struct Lisp_Marker *marker = XMARKER (m);
+ Lisp_Marker *marker = XMARKER (m);
struct buffer *b = marker->buffer;
if (b == 0)
Bytind
bi_marker_position (Lisp_Object marker)
{
- struct Lisp_Marker *m = XMARKER (marker);
+ Lisp_Marker *m = XMARKER (marker);
struct buffer *buf = m->buffer;
Bytind pos;
void
set_bi_marker_position (Lisp_Object marker, Bytind pos)
{
- struct Lisp_Marker *m = XMARKER (marker);
+ Lisp_Marker *m = XMARKER (marker);
struct buffer *buf = m->buffer;
if (!buf)
*/
(position))
{
- struct Lisp_Marker *marker;
+ Lisp_Marker *marker;
Memind pos;
/* A small optimization trick: convert POS to memind now, rather
int
compute_buffer_marker_usage (struct buffer *b, struct overhead_stats *ovstats)
{
- struct Lisp_Marker *m;
+ Lisp_Marker *m;
int total = 0;
int overhead;
for (m = BUF_MARKERS (b); m; m = m->next)
- total += sizeof (struct Lisp_Marker);
+ total += sizeof (Lisp_Marker);
ovstats->was_requested += total;
overhead = fixed_type_block_overhead (total);
/* #### claiming this is all malloc overhead is not really right,
{
/* Unchain all markers of this buffer
and leave them pointing nowhere. */
- REGISTER struct Lisp_Marker *m, *next;
+ REGISTER Lisp_Marker *m, *next;
for (m = BUF_MARKERS (b); m; m = next)
{
m->buffer = 0;
getrlimit() should be preferred to ulimit().
On Linux, ulimit() is deprecated and always returns -1. */
-#ifndef _XEMACS_MEM_LIMITS_H_
-#define _XEMACS_MEM_LIMITS_H_
+#ifndef INCLUDED_mem_limits_h_
+#define INCLUDED_mem_limits_h_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif /* not NO_LIM_DATA */
#endif /* not HEAP_IN_DATA */
-#endif /* _XEMACS_MEM_LIMITS_H_ */
+#endif /* INCLUDED_mem_limits_h_ */
/* Submenu */
HMENU submenu;
Lisp_Object gui_item = allocate_gui_item ();
- struct Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item);
+ Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item);
struct gcpro gcpro1;
GCPRO1 (gui_item);
/* An ordinary item */
Lisp_Object style, id;
Lisp_Object gui_item = gui_parse_item_keywords (item);
- struct Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item);
+ Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item);
struct gcpro gcpro1;
GCPRO1 (gui_item);
struct gcpro gcpro1;
unsigned long checksum;
Lisp_Object gui_item = allocate_gui_item ();
- struct Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item);
+ Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item);
GCPRO1 (gui_item);
/* We are sometimes called with the menubar unchanged, and with changed
mswindows_popup_menu (Lisp_Object menu_desc, Lisp_Object event)
{
struct frame *f = selected_frame ();
- struct Lisp_Event *eev = NULL;
+ Lisp_Event *eev = NULL;
HMENU menu;
POINT pt;
int ok;
Initially written by kkm 12/24/97,
*/
-#ifndef _XEMACS_MENUBAR_MSW_H_
-#define _XEMACS_MENUBAR_MSW_H_
+#ifndef INCLUDED_menubar_msw_h_
+#define INCLUDED_menubar_msw_h_
#ifdef HAVE_MENUBARS
#endif /* HAVE_MENUBARS */
-#endif /* _XEMACS_MENUBAR_MSW_H_ */
+#endif /* INCLUDED_menubar_msw_h_ */
\f
static void
-make_dummy_xbutton_event (XEvent *dummy,
- Widget daddy,
- struct Lisp_Event *eev)
+make_dummy_xbutton_event (XEvent *dummy, Widget daddy, Lisp_Event *eev)
/* NULL for eev means query pointer */
{
XButtonPressedEvent *btn = (XButtonPressedEvent *) dummy;
widget_value *data;
Widget parent;
Widget menu;
- struct Lisp_Event *eev = NULL;
+ Lisp_Event *eev = NULL;
XEvent xev;
Lisp_Object frame;
Lisp_Object
menu_parse_submenu_keywords (Lisp_Object desc, Lisp_Object gui_item)
{
- struct Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item);
+ Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item);
/* Menu descriptor should be a list */
CHECK_CONS (desc);
Lisp_Object path_entry, submenu_desc, submenu;
struct gcpro gcpro1;
Lisp_Object gui_item = allocate_gui_item ();
- struct Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item);
+ Lisp_Gui_Item* pgui_item = XGUI_ITEM (gui_item);
GCPRO1 (gui_item);
(name, buffer))
{
struct buffer *buf = decode_buffer (buffer, 0);
- struct Lisp_String *n;
+ Lisp_String *n;
Charcount end;
int i;
Bufbyte *name_data;
void
vars_of_menubar (void)
{
- {
- /* put in Vblank_menubar a menubar value which has no visible
- * items. This is a bit tricky due to various quirks. We
- * could use '(["" nil nil]), but this is apparently equivalent
- * to '(nil), and a new frame created with this menubar will
- * get a vertically-squished menubar. If we use " " as the
- * button title instead of "", we get an etched button border.
- * So we use
- * '(("No active menubar" ["" nil nil]))
- * which creates a menu whose title is "No active menubar",
- * and this works fine.
- */
-
- Lisp_Object menu_item[3];
- static CONST char *blank_msg = "No active menubar";
-
- menu_item[0] = build_string ("");
- menu_item[1] = Qnil;
- menu_item[2] = Qnil;
- Vblank_menubar = Fcons (Fcons (build_string (blank_msg),
- Fcons (Fvector (3, &menu_item[0]),
- Qnil)),
- Qnil);
- staticpro (&Vblank_menubar);
- }
+ /* put in Vblank_menubar a menubar value which has no visible
+ * items. This is a bit tricky due to various quirks. We
+ * could use '(["" nil nil]), but this is apparently equivalent
+ * to '(nil), and a new frame created with this menubar will
+ * get a vertically-squished menubar. If we use " " as the
+ * button title instead of "", we get an etched button border.
+ * So we use
+ * '(("No active menubar" ["" nil nil]))
+ * which creates a menu whose title is "No active menubar",
+ * and this works fine.
+ */
+
+ Vblank_menubar = list1 (list2 (build_string ("No active menubar"),
+ vector3 (build_string (""), Qnil, Qnil)));
+ staticpro (&Vblank_menubar);
DEFVAR_BOOL ("popup-menu-titles", &popup_menu_titles /*
If true, popup menus will have title bars at the top.
side-effects.
:key-sequence keys Used in FSF Emacs as an hint to an equivalent keybinding.
- Ignored by XEnacs for easymenu.el compatability.
+ Ignored by XEnacs for easymenu.el compatibility.
:label <form> (unimplemented!) Like :suffix, but replaces label
completely.
/* #### Not properly abstracted for device-independence. */
-#ifndef _XEMACS_MENUBAR_H_
-#define _XEMACS_MENUBAR_H_
+#ifndef INCLUDED_menubar_h_
+#define INCLUDED_menubar_h_
#ifdef HAVE_MENUBARS
#include "gui.h"
#endif /* HAVE_MENUBARS */
-#endif /* _XEMACS_MENUBAR_H_ */
+#endif /* INCLUDED_menubar_h_ */
{
if (!ZEROP (bucket))
{
- struct Lisp_Symbol *next;
+ Lisp_Symbol *next;
if (!SYMBOLP (bucket))
{
signal_simple_error ("Bad obarray passed to try-completions",
{
if (!ZEROP (bucket))
{
- struct Lisp_Symbol *next = symbol_next (XSYMBOL (bucket));
+ Lisp_Symbol *next = symbol_next (XSYMBOL (bucket));
elt = bucket;
eltstring = Fsymbol_name (elt);
if (next)
else
{
write_string_to_stdio_stream (stderr, 0, (CONST Bufbyte *) "\n", 0, 1,
- FORMAT_TERMINAL);
+ Qterminal);
return Qnil;
}
}
struct gcpro gcpro1;
Lisp_Object frame;
+ /* There is an inlining bug in egcs-20000131 c++ that can be worked
+ around as follows: */
+#if defined (__GNUC__) && defined (__cplusplus)
+ alloca (4);
+#endif
+
/* some callers pass in a null string as a way of clearing the echo area.
check for length == 0 now; if this case, neither nonreloc nor reloc
may be valid. */
if (STRINGP (reloc))
nonreloc = XSTRING_DATA (reloc);
write_string_to_stdio_stream (stderr, 0, nonreloc, offset, length,
- FORMAT_TERMINAL);
+ Qterminal);
}
}
/* Synched up with: FSF Emacs 20.3.10 */
-#ifndef _CCL_H
-#define _CCL_H
+#ifndef INCLUDED_mule_ccl_h_
+#define INCLUDED_mule_ccl_h_
/* Macros for exit status of CCL program. */
#define CCL_STAT_SUCCESS 0 /* Terminated successfully. */
extern Lisp_Object Vfont_ccl_encoder_alist;
extern Lisp_Object Qccl_program;
-#endif /* _CCL_H */
+#endif /* INCLUDED_mule_ccl_h_ */
/* Like ftell, but for a buffer in memory */
static long
-dtell()
+dtell (void)
{
return file_posn;
}
/* Data buffer analogs for FileReadS and FileReadL in NAS. */
static unsigned short
-DataReadS(int swapit)
+DataReadS (int swapit)
{
unsigned short us;
}
static AuUint32
-DataReadL(int swapit)
+DataReadL (int swapit)
{
AuUint32 ul;
}
static int
-readChunk(RiffChunk *c)
+readChunk (RiffChunk *c)
{
int status;
char n;
read the wave data from a buffer in memory. */
static WaveInfo *
-WaveOpenDataForReading(CONST char *data,
- int length)
+WaveOpenDataForReading (CONST char *data,
+ int length)
{
RiffChunk ck;
RIFF_FOURCC fourcc;
last edit: 09-Jul-1983 D A Gwyn
*/
+#ifndef INCLUDED_ndir_h_
+#define INCLUDED_ndir_h_
+
#define DIRBLKSIZ 512 /* size of directory block */
#ifdef WINDOWSNT
#define MAXNAMLEN 255
void seekdir (DIR *dirp, long loc);
#define rewinddir( dirp ) seekdir( dirp, 0L )
+
+#endif /* INCLUDED_ndir_h_ */
#endif
extern Lisp_Object Vmswindows_get_true_file_attributes;
-extern char *get_home_directory(void);
+int nt_fake_unix_uid;
static char startup_dir[ MAXPATHLEN ];
uid_t
getuid ()
-{
- return the_passwd.pw_uid;
+{
+ return nt_fake_unix_uid;
}
uid_t
geteuid ()
{
- /* I could imagine arguing for checking to see whether the user is
- in the Administrators group and returning a UID of 0 for that
- case, but I don't know how wise that would be in the long run. */
- return getuid ();
+ return nt_fake_unix_uid;
}
gid_t
struct passwd *
getpwuid (uid_t uid)
{
- if (uid == the_passwd.pw_uid)
- return &the_passwd;
- return NULL;
+ if (uid == nt_fake_unix_uid)
+ {
+ the_passwd.pw_gid = the_passwd.pw_uid = uid;
+ return &the_passwd;
+ }
+ else
+ return NULL;
}
struct passwd *
void
init_user_info ()
{
+ /* This code is pretty much of ad hoc nature. There is no unix-like
+ UIDs under Windows NT. There is no concept of root user, because
+ all security is ACL-based. Instead, let's use a simple variable,
+ nt-fake-unix-uid, which would allow the user to have a uid of
+ choice. --kkm, 02/03/2000 */
+#if 0
/* Find the user's real name by opening the process token and
looking up the name associated with the user-sid in that token.
the_passwd.pw_gid = 123;
}
+ if (token)
+ CloseHandle (token);
+#else
+ /* Obtain only logon id here, uid part is moved to getuid */
+ char name[256];
+ DWORD length = sizeof (name);
+ if (GetUserName (name, &length))
+ strcpy (the_passwd.pw_name, name);
+ else
+ strcpy (the_passwd.pw_name, "unknown");
+#endif
+
/* Ensure HOME and SHELL are defined. */
#if 0
/*
/* Set dir and shell from environment variables. */
strcpy (the_passwd.pw_dir, get_home_directory());
strcpy (the_passwd.pw_shell, getenv ("SHELL"));
-
- if (token)
- CloseHandle (token);
}
/* Normalize filename by converting all path separators to
#endif /* 0 */
static FILETIME utc_base_ft;
-static long double utc_base;
static int init = 0;
+#if 0
+
+static long double utc_base;
+
time_t
convert_time (FILETIME ft)
{
ret -= utc_base;
return (time_t) (ret * 1e-7);
}
+#else
+
+static LARGE_INTEGER utc_base_li;
+
+time_t
+convert_time (FILETIME uft)
+{
+ time_t ret;
+#ifndef MAXLONGLONG
+ SYSTEMTIME st;
+ struct tm t;
+ FILETIME ft;
+ TIME_ZONE_INFORMATION tzi;
+ DWORD tzid;
+#else
+ LARGE_INTEGER lft;
+#endif
+
+ if (!init)
+ {
+ /* Determine the delta between 1-Jan-1601 and 1-Jan-1970. */
+ SYSTEMTIME st;
+
+ st.wYear = 1970;
+ st.wMonth = 1;
+ st.wDay = 1;
+ st.wHour = 0;
+ st.wMinute = 0;
+ st.wSecond = 0;
+ st.wMilliseconds = 0;
+
+ SystemTimeToFileTime (&st, &utc_base_ft);
+
+ utc_base_li.LowPart = utc_base_ft.dwLowDateTime;
+ utc_base_li.HighPart = utc_base_ft.dwHighDateTime;
+
+ init = 1;
+ }
+
+#ifdef MAXLONGLONG
+
+ /* On a compiler that supports long integers, do it the easy way */
+ lft.LowPart = uft.dwLowDateTime;
+ lft.HighPart = uft.dwHighDateTime;
+ ret = (time_t) ((lft.QuadPart - utc_base_li.QuadPart) / 10000000);
+
+#else
+
+ /* Do it the hard way using mktime. */
+ FileTimeToLocalFileTime(&uft, &ft);
+ FileTimeToSystemTime (&ft, &st);
+ tzid = GetTimeZoneInformation (&tzi);
+ t.tm_year = st.wYear - 1900;
+ t.tm_mon = st.wMonth - 1;
+ t.tm_mday = st.wDay;
+ t.tm_hour = st.wHour;
+ t.tm_min = st.wMinute;
+ t.tm_sec = st.wSecond;
+ t.tm_isdst = (tzid == TIME_ZONE_ID_DAYLIGHT);
+ /* st.wMilliseconds not applicable */
+ ret = mktime(&t);
+ if (ret == -1)
+ {
+ ret = 0;
+ }
+
+#endif
+
+ return ret;
+}
+#endif
#if 0
/* in case we ever have need of this */
#endif
+/* stat has been fixed since MSVC 5.0.
+ Oh, and do not encapsulater stat for non-MS compilers, too */
+/* #### popineau@ese-metz.fr says they still might be broken.
+ Oh well... Let's add that `1 ||' condition.... --kkm */
+#if 1 || defined(_MSC_VER) && _MSC_VER < 1100
+
/* Since stat is encapsulated on Windows NT, we need to encapsulate
the equally broken fstat as well. */
-int
+int _cdecl
fstat (int handle, struct stat *buffer)
{
int ret;
buf->st_ino = (unsigned short) (fake_inode ^ (fake_inode >> 16));
/* consider files to belong to current user */
- buf->st_uid = the_passwd.pw_uid;
- buf->st_gid = the_passwd.pw_gid;
+ buf->st_uid = buf->st_gid = nt_fake_unix_uid;
/* volume_info is set indirectly by map_win32_filename */
buf->st_dev = volume_info.serialnum;
buf->st_rdev = volume_info.serialnum;
-
buf->st_size = wfd.nFileSizeLow;
/* Convert timestamps to Unix format. */
return 0;
}
+#endif /* defined(_MSC_VER) && _MSC_VER < 1100 */
/* From callproc.c */
extern Lisp_Object Vbinary_process_input;
CloseHandle (p_file->file);
}
+void
+vars_of_nt (void)
+{
+ DEFVAR_INT ("nt-fake-unix-uid", &nt_fake_unix_uid /*
+*Set uid returned by `user-uid' and `user-real-uid'.
+Under NT and 9x, there is no uids, and even no almighty user called root.
+By setting this variable, you can have any uid of choice. Default is 0.
+Changes to this variable take effect immediately.
+*/ );
+ nt_fake_unix_uid = 0;
+}
+
/* end of nt.c */
-#ifndef _NT_H_
-#define _NT_H_
-
/* Support routines for the NT version of XEmacs.
Copyright (C) 1994 Free Software Foundation, Inc.
/* #define FULL_DEBUG */
+#ifndef INCLUDED_nt_h_
+#define INCLUDED_nt_h_
+
#ifdef DEBUG_XEMACS
#define DebPrint(stuff) _DebPrint stuff
#else
extern void init_ntproc ();
extern void term_ntproc ();
-#endif /* _NT_H_ */
+#endif /* INCLUDED_nt_h_ */
int edata;
int etext;
-/* The major and minor versions of NT. */
-int nt_major_version;
-int nt_minor_version;
-
-/* Distinguish between Windows NT and Windows 95. */
-int os_subtype;
-
/* Cache information describing the NT system for later use. */
void
cache_system_info (void)
{
- union
- {
- struct info
- {
- char major;
- char minor;
- short platform;
- } info;
- DWORD data;
- } version;
-
- /* Cache the version of the operating system. */
- version.data = GetVersion ();
- nt_major_version = version.info.major;
- nt_minor_version = version.info.minor;
-
- if (version.info.platform & 0x8000)
- os_subtype = OS_WIN95;
- else
- os_subtype = OS_NT;
-
/* Cache page size, allocation unit, processor type, etc. */
GetSystemInfo (&sysinfo_cache);
syspage_mask = sysinfo_cache.dwPageSize - 1;
return result;
}
-#if !defined (CANNOT_DUMP) && !defined(HEAP_IN_DATA)
+#if !defined (CANNOT_DUMP) && !defined(HEAP_IN_DATA) && !defined(PDUMP)
/* Recreate the heap from the data that was dumped to the executable.
EXECUTABLE_PATH tells us where to find the executable. */
/* Adapted for XEmacs by David Hobley <david@spook-le0.cia.com.au> */
/* Synced with FSF Emacs 19.34.6 by Marc Paquette <marcpa@cam.org> */
-#ifndef NTHEAP_H_
-#define NTHEAP_H_
+#ifndef INCLUDED_ntheap_h_
+#define INCLUDED_ntheap_h_
#include <windows.h>
#define UNINIT_PTR ((void *) 0xF0A0F0A0)
#define UNINIT_LONG (0xF0A0F0A0L)
-enum {
- OS_WIN95 = 1,
- OS_NT
-};
-
-extern int os_subtype;
-
/* Emulation of Unix sbrk(). */
extern void *sbrk (unsigned long size);
int open_output_file (file_data *p_file, CONST char *name, unsigned long size);
void close_file_data (file_data *p_file);
-#endif /* NTHEAP_H_ */
+#endif /* INCLUDED_ntheap_h_ */
#include <signal.h>
/* must include CRT headers *before* config.h */
-/* ### I don't believe it - martin */
+/* #### I don't believe it - martin */
#include <config.h>
#undef signal
#undef wait
DWORD WINAPI reader_thread (void *arg);
+/* Determine if running on Windows 9x and not NT */
+static int
+windows9x_p (void)
+{
+ return GetVersion () & 0x80000000;
+}
+
/* Find an unused process slot. */
child_process *
new_child (void)
errno = EINVAL;
return -1;
}
- GET_C_STRING_FILENAME_DATA_ALLOCA (full, cmdname);
+ TO_EXTERNAL_FORMAT (LISP_STRING, full,
+ C_STRING_ALLOCA, cmdname,
+ Qfile_name);
}
else
{
GetClassName (hwnd, window_class, sizeof (window_class));
if (strcmp (window_class,
- (os_subtype == OS_WIN95)
+ windows9x_p()
? "tty"
: "ConsoleWindowClass") == 0)
{
if (NILP (Vwin32_start_process_share_console) && cp && cp->hwnd)
{
#if 1
- if (os_subtype == OS_WIN95)
+ if (windows9x_p())
{
/*
Another possibility is to try terminating the VDM out-right by
/* Sync with FSF Emacs 19.34.6 note: dwWinThreadId declared in
w32term.h and defined in w32fns.c, both of which are not in current
- XEmacs. ### Check what we lose by ifdef'ing out these. --marcpa */
+ XEmacs. #### Check what we lose by ifdef'ing out these. --marcpa */
#if 0
/* Need to set input thread locale if present. */
if (dwWinThreadId)
*/
-#ifndef _XEMACS_OBJECTS_MSW_H_
-#define _XEMACS_OBJECTS_MSW_H_
+#ifndef INCLUDED_objects_msw_h_
+#define INCLUDED_objects_msw_h_
#include "objects.h"
#define COLOR_INSTANCE_MSWINDOWS_COLOR(c) \
(MSWINDOWS_COLOR_INSTANCE_DATA (c)->color)
-#define FONT_INSTANCE_MSWINDOWS_HFONT(c) ((HFONT) (c)->data)
+/* The four HFONTS are for the 4 (underlined, strikethrough)
+ combinations. Only the one at index 0, neither underlined nor
+ struk through is created with the font instance. Other fonts are
+ created as necessary during redisplay, using the one at index 0
+ as protptype */
+#define MSWINDOWS_NUM_FONT_VARIANTS 4
+struct mswindows_font_instance_data
+{
+ HFONT hfont [MSWINDOWS_NUM_FONT_VARIANTS];
+};
+
+#define MSWINDOWS_FONT_INSTANCE_DATA(c) \
+ ((struct mswindows_font_instance_data *) (c)->data)
+
+#define FONT_INSTANCE_MSWINDOWS_HFONT_I(c,i) \
+ (MSWINDOWS_FONT_INSTANCE_DATA(c)->hfont[(i)])
+
+#define FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT(c,under,strike) \
+ FONT_INSTANCE_MSWINDOWS_HFONT_I (c, (!!(strike)<<1)|!!(under))
+
+/* If font creation during redisplay fails, then the following
+ value is used to prevent future attempts to create this font.
+ Redisplay uses the "main" font when encounters this value */
+#define MSWINDOWS_BAD_HFONT INVALID_HANDLE_VALUE
+
+HFONT mswindows_get_hfont (Lisp_Font_Instance* f, int under, int strike);
-#endif /* _XEMACS_OBJECTS_MSW_H_ */
+#endif /* INCLUDED_objects_msw_h_ */
/* Synched up with: Not in FSF. */
-#ifndef _XEMACS_OBJECTS_TTY_H_
-#define _XEMACS_OBJECTS_TTY_H_
+#ifndef INCLUDED_objects_tty_h_
+#define INCLUDED_objects_tty_h_
#include "objects.h"
extern Lisp_Object Vtty_color_alist, Vtty_dynamic_color_bg;
extern Lisp_Object Vtty_dynamic_color_fg;
-#endif /* _XEMACS_OBJECTS_TTY_H_ */
+#endif /* INCLUDED_objects_tty_h_ */
{
/* We're dealing with a TrueColor/DirectColor visual, so play games
with the RGB values in the XColor struct. */
- /* ### JH: I'm not sure how a call to XAllocColor can fail in a
+ /* #### JH: I'm not sure how a call to XAllocColor can fail in a
TrueColor or DirectColor visual, so I will just reformat the
request to match the requirements of the visual, and re-issue
the request. If this fails for anybody, I wanna know about it
else
{
int rd, gr, bl;
- /* ### JH: I'm punting here, knowing that doing this will at
+ /* #### JH: I'm punting here, knowing that doing this will at
least draw the color correctly. However, unless we convert
all of the functions that allocate colors (graphics
libraries, etc) to use this function doing this is very
CONST Extbyte *extname;
Extcount extnamelen;
- GET_CHARPTR_EXT_BINARY_DATA_ALLOCA (name, len, extname, extnamelen);
+ TO_EXTERNAL_FORMAT (DATA, (name, len),
+ ALLOCA, (extname, extnamelen),
+ Qbinary);
result = XParseColor (dpy, cmap, (char *) extname, color);
}
if (!result)
}
static int
-x_initialize_color_instance (struct Lisp_Color_Instance *c, Lisp_Object name,
+x_initialize_color_instance (Lisp_Color_Instance *c, Lisp_Object name,
Lisp_Object device, Error_behavior errb)
{
XColor color;
}
static void
-x_print_color_instance (struct Lisp_Color_Instance *c,
+x_print_color_instance (Lisp_Color_Instance *c,
Lisp_Object printcharfun,
int escapeflag)
{
}
static void
-x_finalize_color_instance (struct Lisp_Color_Instance *c)
+x_finalize_color_instance (Lisp_Color_Instance *c)
{
if (c->data)
{
be comparing their names or pixel values instead. */
static int
-x_color_instance_equal (struct Lisp_Color_Instance *c1,
- struct Lisp_Color_Instance *c2,
+x_color_instance_equal (Lisp_Color_Instance *c1,
+ Lisp_Color_Instance *c2,
int depth)
{
XColor color1 = COLOR_INSTANCE_X_COLOR (c1);
}
static unsigned long
-x_color_instance_hash (struct Lisp_Color_Instance *c, int depth)
+x_color_instance_hash (Lisp_Color_Instance *c, int depth)
{
XColor color = COLOR_INSTANCE_X_COLOR (c);
return HASH3 (color.red, color.green, color.blue);
}
static Lisp_Object
-x_color_instance_rgb_components (struct Lisp_Color_Instance *c)
+x_color_instance_rgb_components (Lisp_Color_Instance *c)
{
XColor color = COLOR_INSTANCE_X_COLOR (c);
return (list3 (make_int (color.red),
CONST char *extname;
- GET_C_STRING_CTEXT_DATA_ALLOCA (color, extname);
+ TO_EXTERNAL_FORMAT (LISP_STRING, color, C_STRING_ALLOCA, extname, Qctext);
- return XParseColor (dpy, cmap,
- extname, &c);
+ return XParseColor (dpy, cmap, extname, &c);
}
\f
/************************************************************************/
static int
-x_initialize_font_instance (struct Lisp_Font_Instance *f, Lisp_Object name,
+x_initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name,
Lisp_Object device, Error_behavior errb)
{
- Display *dpy;
+ Display *dpy = DEVICE_X_DISPLAY (XDEVICE (device));
XFontStruct *xf;
CONST char *extname;
- dpy = DEVICE_X_DISPLAY (XDEVICE (device));
- GET_C_STRING_CTEXT_DATA_ALLOCA (f->name, extname);
+ TO_EXTERNAL_FORMAT (LISP_STRING, f->name, C_STRING_ALLOCA, extname, Qctext);
xf = XLoadQueryFont (dpy, extname);
if (!xf)
}
static void
-x_mark_font_instance (struct Lisp_Font_Instance *f)
+x_mark_font_instance (Lisp_Font_Instance *f)
{
mark_object (FONT_INSTANCE_X_TRUENAME (f));
}
static void
-x_print_font_instance (struct Lisp_Font_Instance *f,
+x_print_font_instance (Lisp_Font_Instance *f,
Lisp_Object printcharfun,
int escapeflag)
{
}
static void
-x_finalize_font_instance (struct Lisp_Font_Instance *f)
+x_finalize_font_instance (Lisp_Font_Instance *f)
{
if (f->data)
}
static Lisp_Object
-x_font_instance_truename (struct Lisp_Font_Instance *f, Error_behavior errb)
+x_font_instance_truename (Lisp_Font_Instance *f, Error_behavior errb)
{
struct device *d = XDEVICE (f->device);
}
static Lisp_Object
-x_font_instance_properties (struct Lisp_Font_Instance *f)
+x_font_instance_properties (Lisp_Font_Instance *f)
{
struct device *d = XDEVICE (f->device);
int i;
Lisp_Object result = Qnil;
CONST char *patternext;
- GET_C_STRING_BINARY_DATA_ALLOCA (pattern, patternext);
+ TO_EXTERNAL_FORMAT (LISP_STRING, pattern,
+ C_STRING_ALLOCA, patternext,
+ Qbinary);
names = XListFonts (DEVICE_X_DISPLAY (XDEVICE (device)),
patternext, MAX_FONT_COUNT, &count);
while (count--)
- result = Fcons (build_ext_string (names [count], FORMAT_BINARY), result);
+ result = Fcons (build_ext_string (names [count], Qbinary), result);
if (names)
XFreeFontNames (names);
return result;
CONST char *patternext;
int i;
- GET_C_STRING_BINARY_DATA_ALLOCA (font, patternext);
+ TO_EXTERNAL_FORMAT (LISP_STRING, font,
+ C_STRING_ALLOCA, patternext,
+ Qbinary);
names = XListFonts (DEVICE_X_DISPLAY (XDEVICE (device)),
patternext, MAX_FONT_COUNT, &count);
- /* ### This code seems awfully bogus -- mrb */
+ /* #### This code seems awfully bogus -- mrb */
for (i = 0; i < count; i ++)
{
- CONST Bufbyte *intname;
+ CONST char *intname;
- GET_C_CHARPTR_INT_BINARY_DATA_ALLOCA (names[i], intname);
+ TO_INTERNAL_FORMAT (C_STRING, names[i],
+ C_STRING_ALLOCA, intname,
+ Qbinary);
if (x_font_spec_matches_charset (XDEVICE (device), charset,
- intname, Qnil, 0, -1))
+ (Bufbyte *) intname, Qnil, 0, -1))
{
- result = build_string ((char *) intname);
+ result = build_string (intname);
break;
}
}
/* Synched up with: Not in FSF. */
-#ifndef _XEMACS_OBJECTS_X_H_
-#define _XEMACS_OBJECTS_X_H_
+#ifndef INCLUDED_objects_x_h_
+#define INCLUDED_objects_x_h_
#include "objects.h"
#define FONT_INSTANCE_X_TRUENAME(f) (X_FONT_INSTANCE_DATA (f)->truename)
#endif /* HAVE_X_WINDOWS */
-#endif /* _XEMACS_OBJECTS_X_H_ */
+
+#endif /* INCLUDED_objects_x_h_ */
static Lisp_Object
mark_color_instance (Lisp_Object obj)
{
- struct Lisp_Color_Instance *c = XCOLOR_INSTANCE (obj);
+ Lisp_Color_Instance *c = XCOLOR_INSTANCE (obj);
mark_object (c->name);
if (!NILP (c->device)) /* Vthe_null_color_instance */
MAYBE_DEVMETH (XDEVICE (c->device), mark_color_instance, (c));
int escapeflag)
{
char buf[100];
- struct Lisp_Color_Instance *c = XCOLOR_INSTANCE (obj);
+ Lisp_Color_Instance *c = XCOLOR_INSTANCE (obj);
if (print_readably)
error ("printing unreadable object #<color-instance 0x%x>",
c->header.uid);
static void
finalize_color_instance (void *header, int for_disksave)
{
- struct Lisp_Color_Instance *c = (struct Lisp_Color_Instance *) header;
+ Lisp_Color_Instance *c = (Lisp_Color_Instance *) header;
if (!NILP (c->device))
{
static int
color_instance_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
{
- struct Lisp_Color_Instance *c1 = XCOLOR_INSTANCE (obj1);
- struct Lisp_Color_Instance *c2 = XCOLOR_INSTANCE (obj2);
+ Lisp_Color_Instance *c1 = XCOLOR_INSTANCE (obj1);
+ Lisp_Color_Instance *c2 = XCOLOR_INSTANCE (obj2);
return (c1 == c2) ||
(EQ (c1->device, c2->device) &&
static unsigned long
color_instance_hash (Lisp_Object obj, int depth)
{
- struct Lisp_Color_Instance *c = XCOLOR_INSTANCE (obj);
+ Lisp_Color_Instance *c = XCOLOR_INSTANCE (obj);
struct device *d = DEVICEP (c->device) ? XDEVICE (c->device) : 0;
return HASH2 ((unsigned long) d,
mark_color_instance, print_color_instance,
finalize_color_instance, color_instance_equal,
color_instance_hash, 0,
- struct Lisp_Color_Instance);
+ Lisp_Color_Instance);
\f
DEFUN ("make-color-instance", Fmake_color_instance, 1, 3, 0, /*
Return a new `color-instance' object named NAME (a string).
*/
(name, device, no_error))
{
- struct Lisp_Color_Instance *c;
+ Lisp_Color_Instance *c;
Lisp_Object val;
int retval;
CHECK_STRING (name);
XSETDEVICE (device, decode_device (device));
- c = alloc_lcrecord_type (struct Lisp_Color_Instance, &lrecord_color_instance);
+ c = alloc_lcrecord_type (Lisp_Color_Instance, &lrecord_color_instance);
c->name = name;
c->device = device;
c->data = 0;
*/
(color_instance))
{
- struct Lisp_Color_Instance *c;
+ Lisp_Color_Instance *c;
CHECK_COLOR_INSTANCE (color_instance);
c = XCOLOR_INSTANCE (color_instance);
static Lisp_Object
mark_font_instance (Lisp_Object obj)
{
- struct Lisp_Font_Instance *f = XFONT_INSTANCE (obj);
+ Lisp_Font_Instance *f = XFONT_INSTANCE (obj);
mark_object (f->name);
if (!NILP (f->device)) /* Vthe_null_font_instance */
print_font_instance (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
char buf[200];
- struct Lisp_Font_Instance *f = XFONT_INSTANCE (obj);
+ Lisp_Font_Instance *f = XFONT_INSTANCE (obj);
if (print_readably)
error ("printing unreadable object #<font-instance 0x%x>", f->header.uid);
write_c_string ("#<font-instance ", printcharfun);
static void
finalize_font_instance (void *header, int for_disksave)
{
- struct Lisp_Font_Instance *f = (struct Lisp_Font_Instance *) header;
+ Lisp_Font_Instance *f = (Lisp_Font_Instance *) header;
if (!NILP (f->device))
{
DEFINE_LRECORD_IMPLEMENTATION ("font-instance", font_instance,
mark_font_instance, print_font_instance,
finalize_font_instance, font_instance_equal,
- font_instance_hash, 0, struct Lisp_Font_Instance);
+ font_instance_hash, 0, Lisp_Font_Instance);
\f
DEFUN ("make-font-instance", Fmake_font_instance, 1, 3, 0, /*
Return a new `font-instance' object named NAME.
*/
(name, device, no_error))
{
- struct Lisp_Font_Instance *f;
+ Lisp_Font_Instance *f;
Lisp_Object val;
int retval = 0;
Error_behavior errb = decode_error_behavior_flag (no_error);
XSETDEVICE (device, decode_device (device));
- f = alloc_lcrecord_type (struct Lisp_Font_Instance, &lrecord_font_instance);
+ f = alloc_lcrecord_type (Lisp_Font_Instance, &lrecord_font_instance);
f->name = name;
f->device = device;
font_instance_truename_internal (Lisp_Object font_instance,
Error_behavior errb)
{
- struct Lisp_Font_Instance *f = XFONT_INSTANCE (font_instance);
-
+ Lisp_Font_Instance *f = XFONT_INSTANCE (font_instance);
+
if (NILP (f->device))
{
maybe_signal_simple_error ("Couldn't determine font truename",
font_instance, Qfont, errb);
return Qnil;
}
-
+
return DEVMETH_OR_GIVEN (XDEVICE (f->device),
font_instance_truename, (f, errb), f->name);
}
*/
(font_instance))
{
- struct Lisp_Font_Instance *f;
+ Lisp_Font_Instance *f;
CHECK_FONT_INSTANCE (font_instance);
f = XFONT_INSTANCE (font_instance);
static void
color_create (Lisp_Object obj)
{
- struct Lisp_Specifier *color = XCOLOR_SPECIFIER (obj);
+ Lisp_Specifier *color = XCOLOR_SPECIFIER (obj);
COLOR_SPECIFIER_FACE (color) = Qnil;
COLOR_SPECIFIER_FACE_PROPERTY (color) = Qnil;
static void
color_mark (Lisp_Object obj)
{
- struct Lisp_Specifier *color = XCOLOR_SPECIFIER (obj);
+ Lisp_Specifier *color = XCOLOR_SPECIFIER (obj);
mark_object (COLOR_SPECIFIER_FACE (color));
mark_object (COLOR_SPECIFIER_FACE_PROPERTY (color));
void
set_color_attached_to (Lisp_Object obj, Lisp_Object face, Lisp_Object property)
{
- struct Lisp_Specifier *color = XCOLOR_SPECIFIER (obj);
+ Lisp_Specifier *color = XCOLOR_SPECIFIER (obj);
COLOR_SPECIFIER_FACE (color) = face;
COLOR_SPECIFIER_FACE_PROPERTY (color) = property;
static void
font_create (Lisp_Object obj)
{
- struct Lisp_Specifier *font = XFONT_SPECIFIER (obj);
+ Lisp_Specifier *font = XFONT_SPECIFIER (obj);
FONT_SPECIFIER_FACE (font) = Qnil;
FONT_SPECIFIER_FACE_PROPERTY (font) = Qnil;
static void
font_mark (Lisp_Object obj)
{
- struct Lisp_Specifier *font = XFONT_SPECIFIER (obj);
+ Lisp_Specifier *font = XFONT_SPECIFIER (obj);
mark_object (FONT_SPECIFIER_FACE (font));
mark_object (FONT_SPECIFIER_FACE_PROPERTY (font));
void
set_font_attached_to (Lisp_Object obj, Lisp_Object face, Lisp_Object property)
{
- struct Lisp_Specifier *font = XFONT_SPECIFIER (obj);
+ Lisp_Specifier *font = XFONT_SPECIFIER (obj);
FONT_SPECIFIER_FACE (font) = face;
FONT_SPECIFIER_FACE_PROPERTY (font) = property;
static void
face_boolean_create (Lisp_Object obj)
{
- struct Lisp_Specifier *face_boolean = XFACE_BOOLEAN_SPECIFIER (obj);
+ Lisp_Specifier *face_boolean = XFACE_BOOLEAN_SPECIFIER (obj);
FACE_BOOLEAN_SPECIFIER_FACE (face_boolean) = Qnil;
FACE_BOOLEAN_SPECIFIER_FACE_PROPERTY (face_boolean) = Qnil;
static void
face_boolean_mark (Lisp_Object obj)
{
- struct Lisp_Specifier *face_boolean = XFACE_BOOLEAN_SPECIFIER (obj);
+ Lisp_Specifier *face_boolean = XFACE_BOOLEAN_SPECIFIER (obj);
mark_object (FACE_BOOLEAN_SPECIFIER_FACE (face_boolean));
mark_object (FACE_BOOLEAN_SPECIFIER_FACE_PROPERTY (face_boolean));
set_face_boolean_attached_to (Lisp_Object obj, Lisp_Object face,
Lisp_Object property)
{
- struct Lisp_Specifier *face_boolean = XFACE_BOOLEAN_SPECIFIER (obj);
+ Lisp_Specifier *face_boolean = XFACE_BOOLEAN_SPECIFIER (obj);
FACE_BOOLEAN_SPECIFIER_FACE (face_boolean) = face;
FACE_BOOLEAN_SPECIFIER_FACE_PROPERTY (face_boolean) = property;
}
static const struct lrecord_description color_specifier_description[] = {
- { XD_LISP_OBJECT, specifier_data_offset + offsetof(struct color_specifier, face), 2 },
+ { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct color_specifier, face) },
+ { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct color_specifier, face_property) },
{ XD_END }
};
static const struct lrecord_description font_specifier_description[] = {
- { XD_LISP_OBJECT, specifier_data_offset + offsetof(struct font_specifier, face), 2 },
+ { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct font_specifier, face) },
+ { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct font_specifier, face_property) },
{ XD_END }
};
static const struct lrecord_description face_boolean_specifier_description[] = {
- { XD_LISP_OBJECT, specifier_data_offset + offsetof(struct face_boolean_specifier, face), 2 },
+ { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct face_boolean_specifier, face) },
+ { XD_LISP_OBJECT, specifier_data_offset + offsetof (struct face_boolean_specifier, face_property) },
{ XD_END }
};
{
staticpro_nodump (&Vthe_null_color_instance);
{
- struct Lisp_Color_Instance *c =
- alloc_lcrecord_type (struct Lisp_Color_Instance, &lrecord_color_instance);
+ Lisp_Color_Instance *c =
+ alloc_lcrecord_type (Lisp_Color_Instance, &lrecord_color_instance);
c->name = Qnil;
c->device = Qnil;
c->data = 0;
staticpro_nodump (&Vthe_null_font_instance);
{
- struct Lisp_Font_Instance *f =
- alloc_lcrecord_type (struct Lisp_Font_Instance, &lrecord_font_instance);
+ Lisp_Font_Instance *f =
+ alloc_lcrecord_type (Lisp_Font_Instance, &lrecord_font_instance);
f->name = Qnil;
f->device = Qnil;
f->data = 0;
/* Synched up with: Not in FSF. */
-#ifndef _XEMACS_OBJECTS_H_
-#define _XEMACS_OBJECTS_H_
+#ifndef INCLUDED_objects_h_
+#define INCLUDED_objects_h_
#include "specifier.h"
* Color Instance Object *
****************************************************************************/
-DECLARE_LRECORD (color_instance, struct Lisp_Color_Instance);
-#define XCOLOR_INSTANCE(x) \
- XRECORD (x, color_instance, struct Lisp_Color_Instance)
-#define XSETCOLOR_INSTANCE(x, p) XSETRECORD (x, p, color_instance)
-#define COLOR_INSTANCEP(x) RECORDP (x, color_instance)
-#define CHECK_COLOR_INSTANCE(x) CHECK_RECORD (x, color_instance)
-#define CONCHECK_COLOR_INSTANCE(x) CONCHECK_RECORD (x, color_instance)
-
EXFUN (Fmake_color_instance, 3);
extern Lisp_Object Vthe_null_color_instance;
void *data;
};
+DECLARE_LRECORD (color_instance, Lisp_Color_Instance);
+#define XCOLOR_INSTANCE(x) XRECORD (x, color_instance, Lisp_Color_Instance)
+#define XSETCOLOR_INSTANCE(x, p) XSETRECORD (x, p, color_instance)
+#define COLOR_INSTANCEP(x) RECORDP (x, color_instance)
+#define CHECK_COLOR_INSTANCE(x) CHECK_RECORD (x, color_instance)
+#define CONCHECK_COLOR_INSTANCE(x) CONCHECK_RECORD (x, color_instance)
+
#define COLOR_INSTANCE_NAME(c) ((c)->name)
#define COLOR_INSTANCE_DEVICE(c) ((c)->device)
* Font Instance Object *
****************************************************************************/
-DECLARE_LRECORD (font_instance, struct Lisp_Font_Instance);
-#define XFONT_INSTANCE(x) XRECORD (x, font_instance, struct Lisp_Font_Instance)
+DECLARE_LRECORD (font_instance, Lisp_Font_Instance);
+#define XFONT_INSTANCE(x) XRECORD (x, font_instance, Lisp_Font_Instance)
#define XSETFONT_INSTANCE(x, p) XSETRECORD (x, p, font_instance)
#define FONT_INSTANCEP(x) RECORDP (x, font_instance)
#define CHECK_FONT_INSTANCE(x) CHECK_RECORD (x, font_instance)
#define FONT_INSTANCE_WIDTH(f) ((f)->width)
#define FONT_INSTANCE_HEIGHT(f) ((f)->height)
-#endif /* _XEMACS_OBJECTS_H_ */
+#endif /* INCLUDED_objects_h_ */
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifndef __DragAndDropTypesH__
-#define __DragAndDropTypesH__
+#ifndef INCLUDED_offix_types_h_
+#define INCLUDED_offix_types_h_
#define DndNotDnd -1
#define DndUnknown 0
#define DndEND 10
-#endif
+#endif /* INCLUDED_offix_types_h_ */
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#ifndef __DragAndDropH__
-#define __DragAndDropH__ 1L
+#ifndef INCLUDED_offix_h_
+#define INCLUDED_offix_h_
/* The standard DND types are defined here */
#include "offix-types.h"
int width,int height,
char *image,char *mask,
int hot_x,int hot_y);
-#endif
+
+#endif /* INCLUDED_offix_h_ */
If DATA is OPAQUE_UNINIT, the object's data is uninitialized.
Else the object's data is initialized by copying from DATA. */
Lisp_Object
-make_opaque (size_t size, CONST void *data)
+make_opaque (CONST void *data, size_t size)
{
Lisp_Opaque *p = (Lisp_Opaque *)
alloc_lcrecord (offsetof (Lisp_Opaque, data) + size, &lrecord_opaque);
/* Written by Ben Wing, October 1993. */
-#ifndef _XEMACS_OPAQUE_H_
-#define _XEMACS_OPAQUE_H_
+#ifndef INCLUDED_opaque_h_
+#define INCLUDED_opaque_h_
typedef union {
struct { Lisp_Object obj; } obj;
Opaque pointers should never escape to the Lisp level, so
functions should not be doing this. */
-/* Alternative DATA arguments to make_opaque */
+/* Alternative DATA arguments to make_opaque() */
#define OPAQUE_CLEAR ((CONST void *) 0)
#define OPAQUE_UNINIT ((CONST void *) -1)
#define XOPAQUE_DATA(op) OPAQUE_DATA (XOPAQUE (op))
#define XOPAQUE_MARKFUN(op) OPAQUE_MARKFUN (XOPAQUE (op))
-Lisp_Object make_opaque (size_t size, CONST void *data);
+Lisp_Object make_opaque (CONST void *data, size_t size);
typedef struct Lisp_Opaque_Ptr
{
#define get_opaque_ptr(op) (XOPAQUE_PTR (op)->ptr)
#define set_opaque_ptr(op, ptr_) (XOPAQUE_PTR (op)->ptr = (ptr_))
-#endif /* _XEMACS_OPAQUE_H_ */
+#endif /* INCLUDED_opaque_h_ */
write_string_to_stdio_stream (FILE *stream, struct console *con,
CONST Bufbyte *str,
Bytecount offset, Bytecount len,
- enum external_data_format fmt)
+ Lisp_Object coding_system)
{
- int extlen;
+ Extcount extlen;
CONST Extbyte *extptr;
- GET_CHARPTR_EXT_DATA_ALLOCA (str + offset, len, fmt, extptr, extlen);
+ TO_EXTERNAL_FORMAT (DATA, (str + offset, len),
+ ALLOCA, (extptr, extlen),
+ coding_system);
if (stream)
{
fwrite (extptr, 1, extlen, stream);
else if (EQ (function, Qt) || EQ (function, Qnil))
{
write_string_to_stdio_stream (stdout, 0, newnonreloc, offset, len,
- FORMAT_TERMINAL);
+ Qterminal);
}
else
{
/*
* This buffer should be at least as large as the max string size of the
- * largest float, printed in the biggest notation. This is undoubtably
+ * largest float, printed in the biggest notation. This is undoubtedly
* 20d float_output_format, with the negative of the C-constant "HUGE"
* from <math.h>.
*
void
print_string (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
- struct Lisp_String *s = XSTRING (obj);
+ Lisp_String *s = XSTRING (obj);
/* We distinguish between Bytecounts and Charcounts, to make
Vprint_string_length work correctly under Mule. */
Charcount size = string_char_length (s);
{
p += set_charptr_emchar ((Bufbyte *) p, ch);
}
-
+
output_string (printcharfun, (Bufbyte *) buf, Qnil, 0, p - buf);
break;
/* This function can GC */
/* #### Bug!! (intern "") isn't printed in some distinguished way */
/* #### (the reader also loses on it) */
- struct Lisp_String *name = symbol_name (XSYMBOL (obj));
+ Lisp_String *name = symbol_name (XSYMBOL (obj));
Bytecount size = string_length (name);
struct gcpro gcpro1, gcpro2;
CHECK_CHAR_COERCE_INT (character);
len = set_charptr_emchar (str, XCHAR (character));
- GET_CHARPTR_EXT_DATA_ALLOCA (str, len, FORMAT_TERMINAL, extptr, extlen);
+ TO_EXTERNAL_FORMAT (DATA, (str, len),
+ ALLOCA, (extptr, extlen),
+ Qterminal);
memcpy (alternate_do_string + alternate_do_pointer, extptr, extlen);
alternate_do_pointer += extlen;
alternate_do_string[alternate_do_pointer] = 0;
write_string_to_stdio_stream (file, con,
XSTRING_DATA (char_or_string),
0, XSTRING_LENGTH (char_or_string),
- FORMAT_TERMINAL);
+ Qterminal);
else
{
Bufbyte str[MAX_EMCHAR_LEN];
CHECK_CHAR_COERCE_INT (char_or_string);
len = set_charptr_emchar (str, XCHAR (char_or_string));
- write_string_to_stdio_stream (file, con, str, 0, len, FORMAT_TERMINAL);
+ write_string_to_stdio_stream (file, con, str, 0, len, Qterminal);
}
return char_or_string;
#if 1
/* Debugging kludge -- unbuffered */
-static int debug_print_length = 50;
-static int debug_print_level = 15;
+static int debug_print_length = 50;
+static int debug_print_level = 15;
+static int debug_print_readably = -1;
static void
debug_print_no_newline (Lisp_Object debug_print_obj)
{
/* This function can GC */
- int old_print_readably = print_readably;
- int old_print_depth = print_depth;
- Lisp_Object old_print_length = Vprint_length;
- Lisp_Object old_print_level = Vprint_level;
- Lisp_Object old_inhibit_quit = Vinhibit_quit;
+ int save_print_readably = print_readably;
+ int save_print_depth = print_depth;
+ Lisp_Object save_Vprint_length = Vprint_length;
+ Lisp_Object save_Vprint_level = Vprint_level;
+ Lisp_Object save_Vinhibit_quit = Vinhibit_quit;
struct gcpro gcpro1, gcpro2, gcpro3;
- GCPRO3 (old_print_level, old_print_length, old_inhibit_quit);
+ GCPRO3 (save_Vprint_level, save_Vprint_length, save_Vinhibit_quit);
if (gc_in_progress)
stderr_out ("** gc-in-progress! Bad idea to print anything! **\n");
print_depth = 0;
- print_readably = 0;
+ print_readably = debug_print_readably != -1 ? debug_print_readably : 0;
print_unbuffered++;
/* Could use unwind-protect, but why bother? */
if (debug_print_length > 0)
Vprint_length = make_int (debug_print_length);
if (debug_print_level > 0)
Vprint_level = make_int (debug_print_level);
+
print_internal (debug_print_obj, Qexternal_debugging_output, 1);
- Vinhibit_quit = old_inhibit_quit;
- Vprint_level = old_print_level;
- Vprint_length = old_print_length;
- print_depth = old_print_depth;
- print_readably = old_print_readably;
+
+ Vinhibit_quit = save_Vinhibit_quit;
+ Vprint_level = save_Vprint_level;
+ Vprint_length = save_Vprint_length;
+ print_depth = save_print_depth;
+ print_readably = save_print_readably;
print_unbuffered--;
UNGCPRO;
}
#include "procimpl.h"
#include "sysdep.h"
-#include <windows.h>
#ifndef __MINGW32__
#include <shellapi.h>
#else
/* This one breaks process abstraction. Prototype is in console-msw.h,
used by select_process method in event-msw.c */
HANDLE
-get_nt_process_handle (struct Lisp_Process *p)
+get_nt_process_handle (Lisp_Process *p)
{
return (NT_DATA (p)->h_process);
}
*/
static void
-nt_alloc_process_data (struct Lisp_Process *p)
+nt_alloc_process_data (Lisp_Process *p)
{
p->process_data = xnew_and_zero (struct nt_process_data);
}
static void
-nt_finalize_process_data (struct Lisp_Process *p, int for_disksave)
+nt_finalize_process_data (Lisp_Process *p, int for_disksave)
{
assert (!for_disksave);
if (NT_DATA(p)->h_process)
}
static int
-nt_create_process (struct Lisp_Process *p,
+nt_create_process (Lisp_Process *p,
Lisp_Object *argv, int nargv,
Lisp_Object program, Lisp_Object cur_dir)
{
*/
static void
-nt_update_status_if_terminated (struct Lisp_Process* p)
+nt_update_status_if_terminated (Lisp_Process* p)
{
DWORD exit_code;
nt_send_process (Lisp_Object proc, struct lstream* lstream)
{
volatile Lisp_Object vol_proc = proc;
- struct Lisp_Process *volatile p = XPROCESS (proc);
+ Lisp_Process *volatile p = XPROCESS (proc);
/* use a reasonable-sized buffer (somewhere around the size of the
stream buffer) so as to avoid inundating the stream with blocked
nt_kill_child_process (Lisp_Object proc, int signo,
int current_group, int nomsg)
{
- struct Lisp_Process *p = XPROCESS (proc);
+ Lisp_Process *p = XPROCESS (proc);
/* Enable child signals if necessary. This may lose the first
but it's better than nothing. */
Kirill M. Katsnelson <kkm@kis.ru>, so please bash him and not
the original author(s) */
+/* The IPv6 support is derived from the code for GNU Emacs-20.3
+ written by Wolfgang S. Rupprecht */
+
#include <config.h>
#if !defined (NO_SUBPROCESSES)
#ifdef HAVE_SOCKETS
+#if !(defined(HAVE_GETADDRINFO) && defined(HAVE_GETNAMEINFO))
static int
get_internet_address (Lisp_Object host, struct sockaddr_in *address,
Error_behavior errb)
return 1;
}
+#endif /* !(HAVE_GETADDRINFO && HAVE_GETNAMEINFO) */
static void
set_socket_nonblocking_maybe (int fd, int port, CONST char* proto)
the numeric status that was returned by `wait'. */
static void
-update_status_from_wait_code (struct Lisp_Process *p, int *w_fmh)
+update_status_from_wait_code (Lisp_Process *p, int *w_fmh)
{
/* C compiler lossage when attempting to pass w directly */
int w = *w_fmh;
}
/* For any processes that have changed status and are recorded
- and such, update the corresponding struct Lisp_Process.
+ and such, update the corresponding Lisp_Process.
We separate this from record_exited_processes() so that
we never have to call this function from within a signal
handler. We block SIGCHLD in case record_exited_processes()
*/
static void
-unix_alloc_process_data (struct Lisp_Process *p)
+unix_alloc_process_data (Lisp_Process *p)
{
p->process_data = xnew (struct unix_process_data);
*/
static void
-unix_mark_process_data (struct Lisp_Process *proc)
+unix_mark_process_data (Lisp_Process *proc)
{
mark_object (UNIX_DATA(proc)->tty_name);
}
*/
static void
-unix_init_process_io_handles (struct Lisp_Process *p, void* in, void* out, int flags)
+unix_init_process_io_handles (Lisp_Process *p, void* in, void* out, int flags)
{
UNIX_DATA(p)->infd = (int)in;
}
*/
static int
-unix_create_process (struct Lisp_Process *p,
+unix_create_process (Lisp_Process *p,
Lisp_Object *argv, int nargv,
Lisp_Object program, Lisp_Object cur_dir)
{
}
new_argv[i + 1] = 0;
- GET_C_STRING_FILENAME_DATA_ALLOCA (cur_dir, current_dir);
+ TO_EXTERNAL_FORMAT (LISP_STRING, cur_dir,
+ C_STRING_ALLOCA, current_dir,
+ Qfile_name);
child_setup (xforkin, xforkout, xforkout, new_argv, current_dir);
}
/* Return nonzero if this process is a ToolTalk connection. */
static int
-unix_tooltalk_connection_p (struct Lisp_Process *p)
+unix_tooltalk_connection_p (Lisp_Process *p)
{
return UNIX_DATA(p)->connected_via_filedesc_p;
}
/* This is called to set process' virtual terminal size */
static int
-unix_set_window_size (struct Lisp_Process* p, int cols, int rows)
+unix_set_window_size (Lisp_Process* p, int cols, int rows)
{
return set_window_size (UNIX_DATA(p)->infd, cols, rows);
}
#ifdef HAVE_WAITPID
static void
-unix_update_status_if_terminated (struct Lisp_Process* p)
+unix_update_status_if_terminated (Lisp_Process* p)
{
int w;
#ifdef SIGCHLD
unix_reap_exited_processes (void)
{
int i;
- struct Lisp_Process *p;
+ Lisp_Process *p;
#ifndef OBNOXIOUS_SYSV_SIGCLD_BEHAVIOR
record_exited_processes (1);
/* Use volatile to protect variables from being clobbered by longjmp. */
SIGTYPE (*volatile old_sigpipe) (int) = 0;
volatile Lisp_Object vol_proc = proc;
- struct Lisp_Process *volatile p = XPROCESS (proc);
+ Lisp_Process *volatile p = XPROCESS (proc);
if (!SETJMP (send_process_frame))
{
*/
static USID
-unix_deactivate_process (struct Lisp_Process *p)
+unix_deactivate_process (Lisp_Process *p)
{
SIGTYPE (*old_sigpipe) (int) = 0;
USID usid;
int gid;
int no_pgrp = 0;
int kill_retval;
- struct Lisp_Process *p = XPROCESS (proc);
+ Lisp_Process *p = XPROCESS (proc);
if (!UNIX_DATA(p)->pty_flag)
current_group = 0;
*/
static Lisp_Object
-unix_get_tty_name (struct Lisp_Process *p)
+unix_get_tty_name (Lisp_Process *p)
{
return UNIX_DATA (p)->tty_name;
}
static Lisp_Object
unix_canonicalize_host_name (Lisp_Object host)
{
+#if defined(HAVE_GETADDRINFO) && defined(HAVE_GETNAMEINFO)
+ struct addrinfo hints, *res;
+ static char addrbuf[NI_MAXHOST];
+ Lisp_Object canonname;
+ int retval;
+ char *ext_host;
+
+ xzero (hints);
+ hints.ai_flags = AI_CANONNAME;
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_protocol = 0;
+ TO_EXTERNAL_FORMAT (LISP_STRING, host, C_STRING_ALLOCA, ext_host, Qnative);
+ retval = getaddrinfo (ext_host, NULL, &hints, &res);
+ if (retval != 0)
+ {
+ char *gai_error;
+
+ TO_INTERNAL_FORMAT (C_STRING, gai_strerror (retval),
+ C_STRING_ALLOCA, gai_error,
+ Qnative);
+ maybe_error (Qprocess, ERROR_ME_NOT,
+ "%s \"%s\"", gai_error, XSTRING_DATA (host));
+ canonname = host;
+ }
+ else
+ {
+ int gni = getnameinfo (res->ai_addr, res->ai_addrlen,
+ addrbuf, sizeof(addrbuf),
+ NULL, 0, NI_NUMERICHOST);
+ canonname = gni ? host : build_ext_string (addrbuf, Qnative);
+
+ freeaddrinfo (res);
+ }
+
+ return canonname;
+#else /* ! HAVE_GETADDRINFO */
struct sockaddr_in address;
if (!get_internet_address (host, &address, ERROR_ME_NOT))
else
/* #### any clue what to do here? */
return host;
+#endif /* ! HAVE_GETADDRINFO */
}
/* open a TCP network connection to a given HOST/SERVICE. Treated
unix_open_network_stream (Lisp_Object name, Lisp_Object host, Lisp_Object service,
Lisp_Object protocol, void** vinfd, void** voutfd)
{
- struct sockaddr_in address;
int inch;
int outch;
volatile int s;
error ("Unsupported protocol \"%s\"",
string_data (symbol_name (XSYMBOL (protocol))));
- if (INTP (service))
- port = htons ((unsigned short) XINT (service));
- else
- {
- struct servent *svc_info;
- CHECK_STRING (service);
+ {
+#if defined(HAVE_GETADDRINFO) && defined(HAVE_GETNAMEINFO)
+ struct addrinfo hints, *res;
+ struct addrinfo * volatile lres;
+ char *portstring;
+ volatile int xerrno = 0;
+ volatile int failed_connect = 0;
+ char *ext_host;
+ /*
+ * Caution: service can either be a string or int.
+ * Convert to a C string for later use by getaddrinfo.
+ */
+ if (INTP (service))
+ {
+ char portbuf[128];
+ snprintf (portbuf, sizeof (portbuf), "%ld", (long) XINT (service));
+ portstring = portbuf;
+ port = htons ((unsigned short) XINT (service));
+ }
+ else
+ {
+ CHECK_STRING (service);
+ TO_EXTERNAL_FORMAT (LISP_STRING, service,
+ C_STRING_ALLOCA, portstring,
+ Qnative);
+ port = 0;
+ }
+
+ xzero (hints);
+ hints.ai_flags = 0;
+ hints.ai_family = AF_UNSPEC;
+ if (EQ (protocol, Qtcp))
+ hints.ai_socktype = SOCK_STREAM;
+ else /* EQ (protocol, Qudp) */
+ hints.ai_socktype = SOCK_DGRAM;
+ hints.ai_protocol = 0;
+ TO_EXTERNAL_FORMAT (LISP_STRING, host, C_STRING_ALLOCA, ext_host, Qnative);
+ retval = getaddrinfo (ext_host, portstring, &hints, &res);
+ if (retval != 0)
+ {
+ char *gai_error;
+
+ TO_INTERNAL_FORMAT (C_STRING, gai_strerror (retval),
+ C_STRING_ALLOCA, gai_error,
+ Qnative);
+ error ("%s/%s %s", XSTRING_DATA (host), portstring, gai_error);
+ }
+
+ /* address loop */
+ for (lres = res; lres ; lres = lres->ai_next)
+ {
+ if (EQ (protocol, Qtcp))
+ s = socket (lres->ai_family, SOCK_STREAM, 0);
+ else /* EQ (protocol, Qudp) */
+ s = socket (lres->ai_family, SOCK_DGRAM, 0);
+
+ if (s < 0)
+ continue;
+
+ /* Turn off interrupts here -- see comments below. There used to
+ be code which called bind_polling_period() to slow the polling
+ period down rather than turn it off, but that seems rather
+ bogus to me. Best thing here is to use a non-blocking connect
+ or something, to check for QUIT. */
+
+ /* Comments that are not quite valid: */
+
+ /* Kernel bugs (on Ultrix at least) cause lossage (not just EINTR)
+ when connect is interrupted. So let's not let it get interrupted.
+ Note we do not turn off polling, because polling is only used
+ when not interrupt_input, and thus not normally used on the systems
+ which have this bug. On systems which use polling, there's no way
+ to quit if polling is turned off. */
+
+ /* Slow down polling. Some kernels have a bug which causes retrying
+ connect to fail after a connect. */
+
+ slow_down_interrupts ();
+
+ loop:
+
+ /* A system call interrupted with a SIGALRM or SIGIO comes back
+ here, with can_break_system_calls reset to 0. */
+ SETJMP (break_system_call_jump);
+ if (QUITP)
+ {
+ speed_up_interrupts ();
+ REALLY_QUIT;
+ /* In case something really weird happens ... */
+ slow_down_interrupts ();
+ }
+
+ /* Break out of connect with a signal (it isn't otherwise possible).
+ Thus you don't get screwed with a hung network. */
+ can_break_system_calls = 1;
+ retval = connect (s, lres->ai_addr, lres->ai_addrlen);
+ can_break_system_calls = 0;
+ if (retval == -1)
+ {
+ xerrno = errno;
+ if (errno != EISCONN)
+ {
+ if (errno == EINTR)
+ goto loop;
+ if (errno == EADDRINUSE && retry < 20)
+ {
+ /* A delay here is needed on some FreeBSD systems,
+ and it is harmless, since this retrying takes time anyway
+ and should be infrequent.
+ `sleep-for' allowed for quitting this loop with interrupts
+ slowed down so it can't be used here. Async timers should
+ already be disabled at this point so we can use `sleep'. */
+ sleep (1);
+ retry++;
+ goto loop;
+ }
+ }
+
+ failed_connect = 1;
+ close (s);
+
+ speed_up_interrupts ();
+
+ continue;
+ }
+
+ if (port == 0)
+ {
+ int gni;
+ char servbuf[NI_MAXSERV];
+
+ if (EQ (protocol, Qtcp))
+ gni = getnameinfo (lres->ai_addr, lres->ai_addrlen,
+ NULL, 0, servbuf, sizeof(servbuf),
+ NI_NUMERICSERV);
+ else /* EQ (protocol, Qudp) */
+ gni = getnameinfo (lres->ai_addr, lres->ai_addrlen,
+ NULL, 0, servbuf, sizeof(servbuf),
+ NI_NUMERICSERV | NI_DGRAM);
+
+ if (gni == 0)
+ port = strtol (servbuf, NULL, 10);
+ }
+
+ break;
+ } /* address loop */
+
+ speed_up_interrupts ();
- if (EQ (protocol, Qtcp))
+ freeaddrinfo (res);
+ if (s < 0)
+ {
+ errno = xerrno;
+
+ if (failed_connect)
+ report_file_error ("connection failed", list2 (host, name));
+ else
+ report_file_error ("error creating socket", list1 (name));
+ }
+#else /* ! HAVE_GETADDRINFO */
+ struct sockaddr_in address;
+
+ if (INTP (service))
+ port = htons ((unsigned short) XINT (service));
+ else
+ {
+ struct servent *svc_info;
+ CHECK_STRING (service);
+
+ if (EQ (protocol, Qtcp))
svc_info = getservbyname ((char *) XSTRING_DATA (service), "tcp");
- else /* EQ (protocol, Qudp) */
+ else /* EQ (protocol, Qudp) */
svc_info = getservbyname ((char *) XSTRING_DATA (service), "udp");
- if (svc_info == 0)
- error ("Unknown service \"%s\"", XSTRING_DATA (service));
- port = svc_info->s_port;
- }
+ if (svc_info == 0)
+ error ("Unknown service \"%s\"", XSTRING_DATA (service));
+ port = svc_info->s_port;
+ }
- get_internet_address (host, &address, ERROR_ME);
- address.sin_port = port;
+ get_internet_address (host, &address, ERROR_ME);
+ address.sin_port = port;
- if (EQ (protocol, Qtcp))
+ if (EQ (protocol, Qtcp))
s = socket (address.sin_family, SOCK_STREAM, 0);
- else /* EQ (protocol, Qudp) */
+ else /* EQ (protocol, Qudp) */
s = socket (address.sin_family, SOCK_DGRAM, 0);
- if (s < 0)
- report_file_error ("error creating socket", list1 (name));
+ if (s < 0)
+ report_file_error ("error creating socket", list1 (name));
- /* Turn off interrupts here -- see comments below. There used to
- be code which called bind_polling_period() to slow the polling
- period down rather than turn it off, but that seems rather
- bogus to me. Best thing here is to use a non-blocking connect
- or something, to check for QUIT. */
+ /* Turn off interrupts here -- see comments below. There used to
+ be code which called bind_polling_period() to slow the polling
+ period down rather than turn it off, but that seems rather
+ bogus to me. Best thing here is to use a non-blocking connect
+ or something, to check for QUIT. */
- /* Comments that are not quite valid: */
+ /* Comments that are not quite valid: */
- /* Kernel bugs (on Ultrix at least) cause lossage (not just EINTR)
- when connect is interrupted. So let's not let it get interrupted.
- Note we do not turn off polling, because polling is only used
- when not interrupt_input, and thus not normally used on the systems
- which have this bug. On systems which use polling, there's no way
- to quit if polling is turned off. */
+ /* Kernel bugs (on Ultrix at least) cause lossage (not just EINTR)
+ when connect is interrupted. So let's not let it get interrupted.
+ Note we do not turn off polling, because polling is only used
+ when not interrupt_input, and thus not normally used on the systems
+ which have this bug. On systems which use polling, there's no way
+ to quit if polling is turned off. */
- /* Slow down polling. Some kernels have a bug which causes retrying
- connect to fail after a connect. */
+ /* Slow down polling. Some kernels have a bug which causes retrying
+ connect to fail after a connect. */
- slow_down_interrupts ();
+ slow_down_interrupts ();
- loop:
+ loop:
- /* A system call interrupted with a SIGALRM or SIGIO comes back
- here, with can_break_system_calls reset to 0. */
- SETJMP (break_system_call_jump);
- if (QUITP)
- {
- speed_up_interrupts ();
- REALLY_QUIT;
- /* In case something really weird happens ... */
- slow_down_interrupts ();
- }
+ /* A system call interrupted with a SIGALRM or SIGIO comes back
+ here, with can_break_system_calls reset to 0. */
+ SETJMP (break_system_call_jump);
+ if (QUITP)
+ {
+ speed_up_interrupts ();
+ REALLY_QUIT;
+ /* In case something really weird happens ... */
+ slow_down_interrupts ();
+ }
- /* Break out of connect with a signal (it isn't otherwise possible).
- Thus you don't get screwed with a hung network. */
- can_break_system_calls = 1;
- retval = connect (s, (struct sockaddr *) &address, sizeof (address));
- can_break_system_calls = 0;
- if (retval == -1 && errno != EISCONN)
- {
- int xerrno = errno;
- if (errno == EINTR)
- goto loop;
- if (errno == EADDRINUSE && retry < 20)
- {
- /* A delay here is needed on some FreeBSD systems,
- and it is harmless, since this retrying takes time anyway
- and should be infrequent.
- `sleep-for' allowed for quitting this loop with interrupts
- slowed down so it can't be used here. Async timers should
- already be disabled at this point so we can use `sleep'. */
- sleep (1);
- retry++;
+ /* Break out of connect with a signal (it isn't otherwise possible).
+ Thus you don't get screwed with a hung network. */
+ can_break_system_calls = 1;
+ retval = connect (s, (struct sockaddr *) &address, sizeof (address));
+ can_break_system_calls = 0;
+ if (retval == -1 && errno != EISCONN)
+ {
+ int xerrno = errno;
+ if (errno == EINTR)
goto loop;
- }
+ if (errno == EADDRINUSE && retry < 20)
+ {
+ /* A delay here is needed on some FreeBSD systems,
+ and it is harmless, since this retrying takes time anyway
+ and should be infrequent.
+ `sleep-for' allowed for quitting this loop with interrupts
+ slowed down so it can't be used here. Async timers should
+ already be disabled at this point so we can use `sleep'. */
+ sleep (1);
+ retry++;
+ goto loop;
+ }
- close (s);
+ close (s);
- speed_up_interrupts ();
+ speed_up_interrupts ();
- errno = xerrno;
- report_file_error ("connection failed", list2 (host, name));
- }
+ errno = xerrno;
+ report_file_error ("connection failed", list2 (host, name));
+ }
- speed_up_interrupts ();
+ speed_up_interrupts ();
+#endif /* ! HAVE_GETADDRINFO */
+ }
inch = s;
outch = dup (s);
#include "systty.h"
#include "syswait.h"
-Lisp_Object Qprocessp;
+Lisp_Object Qprocessp, Qprocess_live_p;
/* Process methods */
struct process_methods the_process_methods;
static Lisp_Object
mark_process (Lisp_Object obj)
{
- struct Lisp_Process *proc = XPROCESS (obj);
+ Lisp_Process *proc = XPROCESS (obj);
MAYBE_PROCMETH (mark_process_data, (proc));
mark_object (proc->name);
mark_object (proc->command);
static void
print_process (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
- struct Lisp_Process *proc = XPROCESS (obj);
+ Lisp_Process *proc = XPROCESS (obj);
if (print_readably)
error ("printing unreadable object #<process %s>",
}
#ifdef HAVE_WINDOW_SYSTEM
-extern void debug_process_finalization (struct Lisp_Process *p);
+extern void debug_process_finalization (Lisp_Process *p);
#endif /* HAVE_WINDOW_SYSTEM */
static void
{
/* #### this probably needs to be tied into the tty event loop */
/* #### when there is one */
- struct Lisp_Process *p = (struct Lisp_Process *) header;
+ Lisp_Process *p = (Lisp_Process *) header;
#ifdef HAVE_WINDOW_SYSTEM
if (!for_disksave)
{
DEFINE_LRECORD_IMPLEMENTATION ("process", process,
mark_process, print_process, finalize_process,
- 0, 0, 0, struct Lisp_Process);
+ 0, 0, 0, Lisp_Process);
\f
/************************************************************************/
/* basic process accessors */
directly to the child process, rather than en/decoding FILE_CODING
streams */
void
-get_process_streams (struct Lisp_Process *p,
- Lisp_Object *instr, Lisp_Object *outstr)
+get_process_streams (Lisp_Process *p, Lisp_Object *instr, Lisp_Object *outstr)
{
assert (p);
assert (NILP (p->pipe_instream) || LSTREAMP(p->pipe_instream));
*outstr = p->pipe_outstream;
}
-struct Lisp_Process *
+Lisp_Process *
get_process_from_usid (USID usid)
{
CONST void *vval;
}
int
-get_process_selected_p (struct Lisp_Process *p)
+get_process_selected_p (Lisp_Process *p)
{
return p->selected;
}
void
-set_process_selected_p (struct Lisp_Process *p, int selected_p)
+set_process_selected_p (Lisp_Process *p, int selected_p)
{
p->selected = !!selected_p;
}
int
-connected_via_filedesc_p (struct Lisp_Process *p)
+connected_via_filedesc_p (Lisp_Process *p)
{
return MAYBE_INT_PROCMETH (tooltalk_connection_p, (p));
}
return PROCESSP (obj) ? Qt : Qnil;
}
+DEFUN ("process-live-p", Fprocess_live_p, 1, 1, 0, /*
+Return t if OBJECT is a process that is alive.
+*/
+ (obj))
+{
+ return PROCESSP (obj) && PROCESS_LIVE_P (XPROCESS (obj)) ? Qt : Qnil;
+}
+
DEFUN ("process-list", Fprocess_list, 0, 0, 0, /*
Return a list of all processes.
*/
{
Lisp_Object val, name1;
int i;
- struct Lisp_Process *p =
- alloc_lcrecord_type (struct Lisp_Process, &lrecord_process);
+ Lisp_Process *p = alloc_lcrecord_type (Lisp_Process, &lrecord_process);
/* If name is already in use, modify it until it is unused. */
name1 = name;
}
void
-init_process_io_handles (struct Lisp_Process *p, void* in, void* out, int flags)
+init_process_io_handles (Lisp_Process *p, void* in, void* out, int flags)
{
USID usid = event_stream_create_stream_pair (in, out,
&p->pipe_instream, &p->pipe_outstream,
create_process (Lisp_Object process, Lisp_Object *argv, int nargv,
Lisp_Object program, Lisp_Object cur_dir)
{
- struct Lisp_Process *p = XPROCESS (process);
+ Lisp_Process *p = XPROCESS (process);
int pid;
/* *_create_process may change status_symbol, if the process
pid = PROCMETH (create_process, (p, argv, nargv, program, cur_dir));
p->pid = make_int (pid);
- if (!NILP(p->pipe_instream))
+ if (PROCESS_LIVE_P (p))
event_stream_select_process (p);
}
Bytecount nbytes, nchars;
Bufbyte chars[1024];
Lisp_Object outstream;
- struct Lisp_Process *p = XPROCESS (proc);
+ Lisp_Process *p = XPROCESS (proc);
/* If there is a lot of output from the subprocess, the loop in
execute_internal_event() might call read_process_output() more
Really, the loop in execute_internal_event() should check itself
for a process-filter change, like in status_notify(); but the
struct Lisp_Process is not exported outside of this file. */
- if (NILP(p->pipe_instream))
+ if (!PROCESS_LIVE_P (p))
return -1; /* already closed */
if (!NILP (p->filter) && (p->filter_does_read))
set_process_filter (Lisp_Object proc, Lisp_Object filter, int filter_does_read)
{
CHECK_PROCESS (proc);
- if (PROCESS_LIVE_P (proc)) {
+ if (PROCESS_LIVE_P (XPROCESS (proc))) {
if (EQ (filter, Qt))
event_stream_unselect_process (XPROCESS (proc));
else
(process))
{
process = get_process (process);
+ CHECK_LIVE_PROCESS (process);
return decoding_stream_coding_system (XLSTREAM (XPROCESS (process)->coding_instream) );
}
(process))
{
process = get_process (process);
+ CHECK_LIVE_PROCESS (process);
return encoding_stream_coding_system (XLSTREAM (XPROCESS (process)->coding_outstream));
}
(process))
{
process = get_process (process);
+ CHECK_LIVE_PROCESS (process);
return Fcons (decoding_stream_coding_system
(XLSTREAM (XPROCESS (process)->coding_instream)),
encoding_stream_coding_system
{
codesys = Fget_coding_system (codesys);
process = get_process (process);
+ CHECK_LIVE_PROCESS (process);
+
set_decoding_stream_coding_system
(XLSTREAM (XPROCESS (process)->coding_instream), codesys);
return Qnil;
{
codesys = Fget_coding_system (codesys);
process = get_process (process);
+ CHECK_LIVE_PROCESS (process);
+
set_encoding_stream_coding_system
(XLSTREAM (XPROCESS (process)->coding_outstream), codesys);
return Qnil;
DEFUN ("set-process-coding-system", Fset_process_coding_system,
1, 3, 0, /*
Set coding-systems of PROCESS to DECODING and ENCODING.
+DECODING will be used to decode subprocess output and ENCODING to
+encode subprocess input.
*/
(process, decoding, encoding))
{
static Lisp_Object
exec_sentinel_unwind (Lisp_Object datum)
{
- struct Lisp_Cons *d = XCONS (datum);
+ Lisp_Cons *d = XCONS (datum);
XPROCESS (d->car)->sentinel = d->cdr;
free_cons (d);
return Qnil;
{
/* This function can GC */
int speccount = specpdl_depth ();
- struct Lisp_Process *p = XPROCESS (proc);
+ Lisp_Process *p = XPROCESS (proc);
Lisp_Object sentinel = p->sentinel;
if (NILP (sentinel))
/* Return a string describing a process status list. */
static Lisp_Object
-status_message (struct Lisp_Process *p)
+status_message (Lisp_Process *p)
{
Lisp_Object symbol = p->status_symbol;
int code = p->exit_code;
for (tail = Vprocess_list; CONSP (tail); tail = XCDR (tail))
{
Lisp_Object proc = XCAR (tail);
- struct Lisp_Process *p = XPROCESS (proc);
+ Lisp_Process *p = XPROCESS (proc);
/* p->tick is also volatile. Same thing as above applies. */
int this_process_tick;
if (network_connection_p (proc))
error ("Network connection %s is not a subprocess",
XSTRING_DATA (XPROCESS(proc)->name));
- if (!PROCESS_LIVE_P (proc))
- error ("Process %s is not active",
- XSTRING_DATA (XPROCESS(proc)->name));
+ CHECK_LIVE_PROCESS (proc);
MAYBE_PROCMETH (kill_child_process, (proc, signo, current_group, nomsg));
}
void
deactivate_process (Lisp_Object proc)
{
- struct Lisp_Process *p = XPROCESS (proc);
+ Lisp_Process *p = XPROCESS (proc);
USID usid;
/* It's possible that we got as far in the process-creation
(proc))
{
/* This function can GC */
- struct Lisp_Process *p;
+ Lisp_Process *p;
proc = get_process (proc);
p = XPROCESS (proc);
if (network_connection_p (proc))
p->tick++;
process_tick++;
}
- else if (!NILP(p->pipe_instream))
+ else if (PROCESS_LIVE_P (p))
{
Fkill_process (proc, Qnil);
/* Do this now, since remove_process will make sigchld_handler do nothing. */
{
if (network_connection_p (proc))
Fdelete_process (proc);
- else if (!NILP (XPROCESS (proc)->pipe_instream))
+ else if (PROCESS_LIVE_P (XPROCESS (proc)))
process_send_signal (proc, SIGHUP, 0, 1);
}
}
syms_of_process (void)
{
defsymbol (&Qprocessp, "processp");
+ defsymbol (&Qprocess_live_p, "process-live-p");
defsymbol (&Qrun, "run");
defsymbol (&Qstop, "stop");
defsymbol (&Qopen, "open");
#endif
DEFSUBR (Fprocessp);
+ DEFSUBR (Fprocess_live_p);
DEFSUBR (Fget_process);
DEFSUBR (Fget_buffer_process);
DEFSUBR (Fdelete_process);
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#ifndef _XEMACS_PROCESS_H_
-#define _XEMACS_PROCESS_H_
+#ifndef INCLUDED_process_h_
+#define INCLUDED_process_h_
#if defined (NO_SUBPROCESSES)
#undef XPROCESS
#else /* not NO_SUBPROCESSES */
/* Only process.c needs to know about the guts of this */
-struct Lisp_Process;
-DECLARE_LRECORD (process, struct Lisp_Process);
-#define XPROCESS(x) XRECORD (x, process, struct Lisp_Process)
+DECLARE_LRECORD (process, Lisp_Process);
+#define XPROCESS(x) XRECORD (x, process, Lisp_Process)
#define XSETPROCESS(x, p) XSETRECORD (x, p, process)
#define PROCESSP(x) RECORDP (x, process)
#define CHECK_PROCESS(x) CHECK_RECORD (x, process)
-#define PROCESS_LIVE_P(x) (!NILP (XPROCESS(x)->pipe_instream))
+#define PROCESS_LIVE_P(x) (!NILP ((x)->pipe_instream))
+
+#define CHECK_LIVE_PROCESS(x) do { \
+ CHECK_PROCESS (x); \
+ if (! PROCESS_LIVE_P (XPROCESS (x))) \
+ dead_wrong_type_argument (Qprocess_live_p, (x)); \
+} while (0)
#ifdef emacs
Lisp_Object buffer,
Lisp_Object infd,
Lisp_Object outfd);
-int connected_via_filedesc_p (struct Lisp_Process *p);
+int connected_via_filedesc_p (Lisp_Process *p);
void kill_buffer_processes (Lisp_Object buffer);
void close_process_descs (void);
Lisp_Object status_symbol,
int exit_code, int core_dumped);
-void get_process_streams (struct Lisp_Process *p,
+void get_process_streams (Lisp_Process *p,
Lisp_Object *instr, Lisp_Object *outstr);
-int get_process_selected_p (struct Lisp_Process *p);
-void set_process_selected_p (struct Lisp_Process *p, int selected_p);
+int get_process_selected_p (Lisp_Process *p);
+void set_process_selected_p (Lisp_Process *p, int selected_p);
-struct Lisp_Process *get_process_from_usid (USID usid);
+Lisp_Process *get_process_from_usid (USID usid);
#ifdef HAVE_SOCKETS
int network_connection_p (Lisp_Object process);
#define PTY_TTY_NAME_SPRINTF strcpy (pty_name, ptsname (fd));
#endif
-#endif /* _XEMACS_PROCESS_H_ */
+#endif /* INCLUDED_process_h_ */
process-unix.c, process-msw.c etc. The Lisp_Process structure and other
contents of this file is not exported to the rest of the world */
-#ifndef _XEMACS_PROCIMPL_H_
-#define _XEMACS_PROCIMPL_H_
-
-struct Lisp_Process;
+#ifndef INCLUDED_procimpl_h_
+#define INCLUDED_procimpl_h_
/*
* Structure which keeps methods of the process implementation.
struct process_methods
{
- void (*mark_process_data) (struct Lisp_Process *proc);
- void (*print_process_data) (struct Lisp_Process *proc,
- Lisp_Object printcharfun);
- void (*finalize_process_data) (struct Lisp_Process *proc, int for_disksave);
- void (*alloc_process_data) (struct Lisp_Process *p);
- void (*init_process_io_handles) (struct Lisp_Process *p,
+ void (*mark_process_data) (Lisp_Process *proc);
+ void (*print_process_data) (Lisp_Process *proc, Lisp_Object printcharfun);
+ void (*finalize_process_data) (Lisp_Process *proc, int for_disksave);
+ void (*alloc_process_data) (Lisp_Process *p);
+ void (*init_process_io_handles) (Lisp_Process *p,
void* in, void* out, int flags);
- int (*create_process) (struct Lisp_Process *p,
+ int (*create_process) (Lisp_Process *p,
Lisp_Object *argv, int nargv,
Lisp_Object program, Lisp_Object cur_dir);
- int (*tooltalk_connection_p) (struct Lisp_Process *p);
+ int (*tooltalk_connection_p) (Lisp_Process *p);
#ifdef HAVE_SOCKETS
void (*open_network_stream) (Lisp_Object name, Lisp_Object host,
Lisp_Object service, Lisp_Object protocol,
#endif /* HAVE_MULTICAST */
#endif /* HAVE_SOCKETS */
Lisp_Object (*canonicalize_host_name) (Lisp_Object host);
- int (*set_window_size) (struct Lisp_Process* p, int height, int width);
+ int (*set_window_size) (Lisp_Process* p, int height, int width);
void (*send_process) (Lisp_Object proc, struct lstream* lstream);
void (*reap_exited_processes) (void);
- void (*update_status_if_terminated) (struct Lisp_Process* p);
+ void (*update_status_if_terminated) (Lisp_Process* p);
void (*kill_child_process) (Lisp_Object proc, int signo,
int current_group, int nomsg);
int (*kill_process_by_pid) (int pid, int sigcode);
int (*process_send_eof) (Lisp_Object proc);
- Lisp_Object (*get_tty_name) (struct Lisp_Process *p);
- USID (*deactivate_process) (struct Lisp_Process *p);
+ Lisp_Object (*get_tty_name) (Lisp_Process *p);
+ USID (*deactivate_process) (Lisp_Process *p);
void (*init_process) (void);
};
#endif /* PROCESS_IO_BLOCKING */
Lisp_Object make_process_internal (Lisp_Object name);
-void init_process_io_handles (struct Lisp_Process *p, void* in,
+void init_process_io_handles (Lisp_Process *p, void* in,
void* out, int flags);
void send_process (Lisp_Object proc,
Lisp_Object relocatable,
CONST Bufbyte *nonrelocatable,
int start, int len);
-#endif /* _XEMACS_PROCIMPL_H_ */
+#endif /* INCLUDED_procimpl_h_ */
/* Unconditionally use unsigned char * for this. */
typedef unsigned char *POINTER;
-typedef unsigned long SIZE;
-
#ifdef DOUG_LEA_MALLOC
#define M_TOP_PAD -2
#include <malloc.h>
#include <stddef.h>
-typedef size_t SIZE;
typedef void *POINTER;
#include <unistd.h>
#endif /* emacs. */
void init_ralloc (void);
-#define safe_bcopy(x, y, z) memmove (y, x, z)
#define NIL ((POINTER) 0)
struct bp *prev;
POINTER *variable;
POINTER data;
- SIZE size;
+ size_t size;
POINTER new_data; /* temporarily used for relocation */
struct heap *heap; /* Heap this bloc is in. */
} *bloc_ptr;
allocate the memory. */
static POINTER
-obtain (POINTER address, SIZE size)
+obtain (POINTER address, size_t size)
{
heap_ptr heap;
- SIZE already_available;
+ size_t already_available;
/* Find the heap that ADDRESS falls within. */
for (heap = last_heap; heap; heap = heap->prev)
if (heap == NIL_HEAP)
{
POINTER new = (*real_morecore)(0);
- SIZE get;
+ size_t get;
already_available = (char *)last_heap->end - (char *)address;
If we could not allocate the space, return zero. */
static POINTER
-get_more_space (SIZE size)
+get_more_space (size_t size)
{
POINTER ptr = break_value;
if (obtain (size))
long r_alloc_size_in_use (void);
long
-r_alloc_size_in_use ()
+r_alloc_size_in_use (void)
{
return break_value - virtual_break_value;
}
memory for the new block. */
static bloc_ptr
-get_bloc (SIZE size)
+get_bloc (size_t size)
{
register bloc_ptr new_bloc;
register heap_ptr heap;
if (heap == NIL_HEAP)
{
register bloc_ptr tb = b;
- register SIZE s = 0;
+ register size_t s = 0;
/* Add up the size of all the following blocs. */
while (tb != NIL_BLOC)
that come after BLOC in memory. */
static int
-resize_bloc (bloc_ptr bloc, SIZE size)
+resize_bloc (bloc_ptr bloc, size_t size)
{
register bloc_ptr b;
heap_ptr heap;
POINTER address;
- SIZE old_size;
+ size_t old_size;
/* No need to ever call this if arena is frozen, bug somewhere! */
if (r_alloc_freeze_level)
}
else
{
- safe_bcopy (b->data, b->new_data, b->size);
+ memmove (b->new_data, b->data, b->size);
*b->variable = b->data = b->new_data;
}
}
}
else
{
- safe_bcopy (bloc->data, bloc->new_data, old_size);
+ memmove (bloc->new_data, bloc->data, old_size);
memset (bloc->new_data + old_size, 0, size - old_size);
*bloc->variable = bloc->data = bloc->new_data;
}
}
else
{
- safe_bcopy (b->data, b->new_data, b->size);
+ memmove (b->new_data, b->data, b->size);
*b->variable = b->data = b->new_data;
}
}
not always find a space which is contiguous to the previous. */
POINTER new_bloc_start;
heap_ptr h = first_heap;
- SIZE get = ROUNDUP (size);
+ size_t get = ROUNDUP (size);
address = (POINTER) ROUNDUP (virtual_break_value);
header. */
for (b = last_bloc; b != NIL_BLOC; b = b->prev)
{
- safe_bcopy (b->data, b->new_data, b->size);
+ memmove (b->new_data, b->data, b->size);
*b->variable = b->data = b->new_data;
}
}
else /* size < 0 */
{
- SIZE excess = (char *)first_heap->bloc_start
+ size_t excess = (char *)first_heap->bloc_start
- ((char *)virtual_break_value + size);
address = virtual_break_value;
for (b = first_bloc; b != NIL_BLOC; b = b->next)
{
- safe_bcopy (b->data, b->new_data, b->size);
+ memmove (b->new_data, b->data, b->size);
*b->variable = b->data = b->new_data;
}
}
If we can't allocate the necessary memory, set *PTR to zero, and
return zero. */
-POINTER r_alloc (POINTER *ptr, SIZE size);
+POINTER r_alloc (POINTER *ptr, size_t size);
POINTER
-r_alloc (POINTER *ptr, SIZE size)
+r_alloc (POINTER *ptr, size_t size)
{
bloc_ptr new_bloc;
If more memory cannot be allocated, then leave *PTR unchanged, and
return zero. */
-POINTER r_re_alloc (POINTER *ptr, SIZE size);
+POINTER r_re_alloc (POINTER *ptr, size_t size);
POINTER
-r_re_alloc (POINTER *ptr, SIZE size)
+r_re_alloc (POINTER *ptr, size_t size)
{
register bloc_ptr bloc;
abort ();
/* This frees all unused blocs. It is not too inefficient, as the resize
- and bcopy is done only once. Afterwards, all unreferenced blocs are
+ and memmove is done only once. Afterwards, all unreferenced blocs are
already shrunk to zero size. */
if (!r_alloc_freeze_level)
{
{
assert (b->prev == pb);
assert ((POINTER) MEM_ROUNDUP (b->data) == b->data);
- assert ((SIZE) MEM_ROUNDUP (b->size) == b->size);
+ assert ((size_t) MEM_ROUNDUP (b->size) == b->size);
ph = 0;
for (h = first_heap; h; h = h->next)
static void Addr_Block_initialize(void);
/* Get a suitable VM_ADDR via mmap */
-static VM_ADDR New_Addr_Block( SIZE sz );
+static VM_ADDR New_Addr_Block (size_t sz);
/* Free a VM_ADDR allocated via New_Addr_Block */
-static void Free_Addr_Block( VM_ADDR addr, SIZE sz );
+static void Free_Addr_Block (VM_ADDR addr, size_t sz);
#ifdef MMAP_GENERATE_ADDRESSES
/* Implementation of the three calls for address picking when XEmacs is incharge */
typedef struct addr_chain
{
POINTER addr;
- SIZE sz;
+ size_t sz;
addr_status flag;
struct addr_chain *next;
} ADDRESS_BLOCK, *ADDRESS_CHAIN;
WRT the addition/deletion of address blocks because of the assert
in Coalesce() and the strict ordering of blocks by their address
*/
-static void Addr_Block_initialize()
+static void
+Addr_Block_initialize (void)
{
MEMMETER( MVAL( M_Addrlist_Size )++)
addr_chain = (ADDRESS_CHAIN) UNDERLYING_MALLOC( sizeof( ADDRESS_BLOCK ));
/* Coalesce address blocks if they are contiguous. Only empty and
unavailable slots are coalesced. */
-static void Coalesce_Addr_Blocks()
+static void
+Coalesce_Addr_Blocks (void)
{
ADDRESS_CHAIN p;
for (p = addr_chain; p; p = p->next)
}
/* Get an empty address block of specified size. */
-static VM_ADDR New_Addr_Block( SIZE sz )
+static VM_ADDR
+New_Addr_Block (size_t sz)
{
ADDRESS_CHAIN p = addr_chain;
VM_ADDR new_addr = VM_FAILURE_ADDR;
/* Free an address block. We mark the block as being empty, and attempt to
do any coalescing that may have resulted from this. */
-static void Free_Addr_Block( VM_ADDR addr, SIZE sz )
+static void
+Free_Addr_Block (VM_ADDR addr, size_t sz)
{
ADDRESS_CHAIN p = addr_chain;
for (; p; p = p->next )
/* This is an alternate (simpler) implementation in cases where the
address is picked by the kernel. */
-static void Addr_Block_initialize(void)
+static void
+Addr_Block_initialize (void)
{
/* Nothing. */
}
-static VM_ADDR New_Addr_Block( SIZE sz )
+static VM_ADDR
+New_Addr_Block (size_t sz)
{
return mmap (0, sz, PROT_READ|PROT_WRITE, MAP_FLAGS,
DEV_ZERO_FD, 0 );
}
-static void Free_Addr_Block( VM_ADDR addr, SIZE sz )
+static void
+Free_Addr_Block (VM_ADDR addr, size_t sz)
{
munmap ((caddr_t) addr, sz );
}
/* IMPLEMENTATION OF EXPORTED RELOCATOR INTERFACE */
/*
- r_alloc( POINTER, SIZE ): Allocate a relocatable area with the start
+ r_alloc (POINTER, SIZE): Allocate a relocatable area with the start
address aliased to the first parameter.
*/
-POINTER r_alloc (POINTER *ptr, SIZE size);
+POINTER r_alloc (POINTER *ptr, size_t size);
POINTER
-r_alloc (POINTER *ptr, SIZE size)
+r_alloc (POINTER *ptr, size_t size)
{
MMAP_HANDLE mh;
mh = new_mmap_handle( size );
if (mh)
{
- SIZE hysteresis = (mmap_hysteresis > 0 ? mmap_hysteresis : 0);
- SIZE mmapped_size = ROUNDUP( size + hysteresis );
+ size_t hysteresis = (mmap_hysteresis > 0 ? mmap_hysteresis : 0);
+ size_t mmapped_size = ROUNDUP( size + hysteresis );
MEMMETER( MVAL(M_Map)++ )
MEMMETER( MVAL(M_Pages_Map) += (mmapped_size/page_size) )
MEMMETER( MVAL(M_Wastage) += mmapped_size - size )
If more memory cannot be allocated, then leave *PTR unchanged, and
return zero. */
-POINTER r_re_alloc (POINTER *ptr, SIZE sz);
+POINTER r_re_alloc (POINTER *ptr, size_t sz);
POINTER
-r_re_alloc (POINTER *ptr, SIZE sz)
+r_re_alloc (POINTER *ptr, size_t sz)
{
if (r_alloc_initialized == 0)
{
}
else
{
- SIZE hysteresis = (mmap_hysteresis > 0 ? mmap_hysteresis : 0);
- SIZE actual_sz = ROUNDUP( sz + hysteresis );
+ size_t hysteresis = (mmap_hysteresis > 0 ? mmap_hysteresis : 0);
+ size_t actual_sz = ROUNDUP( sz + hysteresis );
MMAP_HANDLE h = find_mmap_handle( ptr );
VM_ADDR new_vm_addr;
static Lisp_Object
mark_range_table (Lisp_Object obj)
{
- struct Lisp_Range_Table *rt = XRANGE_TABLE (obj);
+ Lisp_Range_Table *rt = XRANGE_TABLE (obj);
int i;
for (i = 0; i < Dynarr_length (rt->entries); i++)
static void
print_range_table (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
- struct Lisp_Range_Table *rt = XRANGE_TABLE (obj);
+ Lisp_Range_Table *rt = XRANGE_TABLE (obj);
char buf[200];
int i;
static int
range_table_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
{
- struct Lisp_Range_Table *rt1 = XRANGE_TABLE (obj1);
- struct Lisp_Range_Table *rt2 = XRANGE_TABLE (obj2);
+ Lisp_Range_Table *rt1 = XRANGE_TABLE (obj1);
+ Lisp_Range_Table *rt2 = XRANGE_TABLE (obj2);
int i;
if (Dynarr_length (rt1->entries) != Dynarr_length (rt2->entries))
static unsigned long
range_table_hash (Lisp_Object obj, int depth)
{
- struct Lisp_Range_Table *rt = XRANGE_TABLE (obj);
+ Lisp_Range_Table *rt = XRANGE_TABLE (obj);
int i;
int size = Dynarr_length (rt->entries);
unsigned long hash = size;
}
static const struct lrecord_description rte_description_1[] = {
- { XD_LISP_OBJECT, offsetof(range_table_entry, val), 1 },
+ { XD_LISP_OBJECT, offsetof (range_table_entry, val) },
{ XD_END }
};
static const struct struct_description rte_description = {
- sizeof(range_table_entry),
+ sizeof (range_table_entry),
rte_description_1
};
static const struct lrecord_description rted_description_1[] = {
- XD_DYNARR_DESC(range_table_entry_dynarr, &rte_description),
+ XD_DYNARR_DESC (range_table_entry_dynarr, &rte_description),
{ XD_END }
};
static const struct struct_description rted_description = {
- sizeof(range_table_entry_dynarr),
+ sizeof (range_table_entry_dynarr),
rted_description_1
};
static const struct lrecord_description range_table_description[] = {
- { XD_STRUCT_PTR, offsetof(struct Lisp_Range_Table, entries), 1, &rted_description },
+ { XD_STRUCT_PTR, offsetof (Lisp_Range_Table, entries), 1, &rted_description },
{ XD_END }
};
mark_range_table, print_range_table, 0,
range_table_equal, range_table_hash,
range_table_description,
- struct Lisp_Range_Table);
+ Lisp_Range_Table);
\f
/************************************************************************/
/* Range table operations */
#ifdef ERROR_CHECK_TYPECHECK
static void
-verify_range_table (struct Lisp_Range_Table *rt)
+verify_range_table (Lisp_Range_Table *rt)
{
int i;
())
{
Lisp_Object obj;
- struct Lisp_Range_Table *rt = alloc_lcrecord_type (struct Lisp_Range_Table,
- &lrecord_range_table);
+ Lisp_Range_Table *rt = alloc_lcrecord_type (Lisp_Range_Table,
+ &lrecord_range_table);
rt->entries = Dynarr_new (range_table_entry);
XSETRANGE_TABLE (obj, rt);
return obj;
*/
(old_table))
{
- struct Lisp_Range_Table *rt, *rtnew;
+ Lisp_Range_Table *rt, *rtnew;
Lisp_Object obj;
CHECK_RANGE_TABLE (old_table);
rt = XRANGE_TABLE (old_table);
- rtnew = alloc_lcrecord_type (struct Lisp_Range_Table, &lrecord_range_table);
+ rtnew = alloc_lcrecord_type (Lisp_Range_Table, &lrecord_range_table);
rtnew->entries = Dynarr_new (range_table_entry);
Dynarr_add_many (rtnew->entries, Dynarr_atp (rt->entries, 0),
*/
(pos, table, default_))
{
- struct Lisp_Range_Table *rt;
+ Lisp_Range_Table *rt;
CHECK_RANGE_TABLE (table);
rt = XRANGE_TABLE (table);
{
int i;
int insert_me_here = -1;
- struct Lisp_Range_Table *rt = XRANGE_TABLE (table);
+ Lisp_Range_Table *rt = XRANGE_TABLE (table);
/* Now insert in the proper place. This gets tricky because
we may be overlapping one or more existing ranges and need
/* Extracted from rangetab.c by O. Galibert, 1998. */
-#ifndef _XEMACS_RANGETAB_H_
-#define _XEMACS_RANGETAB_H_
+#ifndef INCLUDED_rangetab_h_
+#define INCLUDED_rangetab_h_
typedef struct range_table_entry range_table_entry;
struct range_table_entry
struct lcrecord_header header;
range_table_entry_dynarr *entries;
};
+typedef struct Lisp_Range_Table Lisp_Range_Table;
-DECLARE_LRECORD (range_table, struct Lisp_Range_Table);
-#define XRANGE_TABLE(x) \
- XRECORD (x, range_table, struct Lisp_Range_Table)
+DECLARE_LRECORD (range_table, Lisp_Range_Table);
+#define XRANGE_TABLE(x) XRECORD (x, range_table, Lisp_Range_Table)
#define XSETRANGE_TABLE(x, p) XSETRECORD (x, p, range_table)
#define RANGE_TABLEP(x) RECORDP (x, range_table)
#define CHECK_RANGE_TABLE(x) CHECK_RECORD (x, range_table)
-#endif
+#endif /* INCLUDED_rangetab_h_ */
#include <sys/stat.h> /* for S_IFLNK */
-#ifndef PATH_MAX
-#ifdef _POSIX_VERSION
-#define PATH_MAX _POSIX_PATH_MAX
-#else
-#ifdef MAXPATHLEN
-#define PATH_MAX MAXPATHLEN
-#else
-#define PATH_MAX 1024
-#endif
+#if !defined (HAVE_GETCWD) && defined (HAVE_GETWD)
+#undef getcwd
+#define getcwd(buffer, len) getwd (buffer)
#endif
+
+#ifndef PATH_MAX
+# if defined (_POSIX_PATH_MAX)
+# define PATH_MAX _POSIX_PATH_MAX
+# elif defined (MAXPATHLEN)
+# define PATH_MAX MAXPATHLEN
+# else
+# define PATH_MAX 1024
+# endif
#endif
#define MAX_READLINKS 32
+char * xrealpath (const char *path, char resolved_path []);
char *
xrealpath (const char *path, char resolved_path [])
{
*/
else if (*path == '/')
{
- getcwd(new_path, PATH_MAX - 1);
+ getcwd (new_path, PATH_MAX - 1);
new_path += 3;
path++;
}
*/
else
{
- getcwd(new_path, PATH_MAX - 1);
+ getcwd (new_path, PATH_MAX - 1);
new_path += strlen(new_path);
if (new_path[-1] != '/')
*new_path++ = '/';
}
#else
- /* If it's a relative pathname use getwd for starters. */
+ /* If it's a relative pathname use getcwd for starters. */
if (*path != '/')
{
-#ifdef HAVE_GETCWD
- getcwd(new_path, PATH_MAX - 1);
-#else
- getwd(new_path);
-#endif
+ getcwd (new_path, PATH_MAX - 1);
new_path += strlen(new_path);
if (new_path[-1] != '/')
*new_path++ = '/';
/* Synched up with: FSF 19.29. */
-#ifndef __REGEXP_LIBRARY_H__
-#define __REGEXP_LIBRARY_H__
+#ifndef INCLUDED_regex_h_
+#define INCLUDED_regex_h_
/* POSIX says that <sys/types.h> must be included (by the caller) before
<regex.h>. */
size_t errbuf_size);
void regfree (regex_t *preg);
-#endif /* not __REGEXP_LIBRARY_H__ */
+#endif /* INCLUDED_regex_h_ */
#ifndef TCS_VERTICAL
#define TCS_VERTICAL 0x0080
#endif
+#ifndef PHYSICALWIDTH
+#define PHYSICALWIDTH 110
+#endif
+#ifndef PHYSICALHEIGHT
+#define PHYSICALHEIGHT 111
+#endif
+#ifndef PHYSICALOFFSETX
+#define PHYSICALOFFSETX 112
+#endif
+#ifndef PHYSICALOFFSETY
+#define PHYSICALOFFSETY 113
+#endif
+
#define PBS_SMOOTH 0x01
#ifdef CYGWIN_VERSION_DLL_MAJOR
#if 0
-/* ### FIXME: although defining BROKEN_SIGIO is correct for proper ^G
+/* #### FIXME: although defining BROKEN_SIGIO is correct for proper ^G
behavior, bugs in cygwin mean that xemacs locks up frequently if
this is defined. */
#define BROKEN_SIGIO
#define MODE_LINE_BINARY_TEXT(_b_) (NILP ((_b_)->buffer_file_type) ? "T" : "B")
-/* get some redefinitions in place */
-
-#if 0
-/* IO calls that are emulated or shadowed */
-#define access sys_access
-#define chdir sys_chdir
-#define chmod sys_chmod
-#define close sys_close
-#define creat sys_creat
-#define ctime sys_ctime
-#define dup sys_dup
-#define dup2 sys_dup2
-#define fopen sys_fopen
-#define link sys_link
-#define mktemp sys_mktemp
-#define open sys_open
-#define read sys_read
-#define rename sys_rename
-#define unlink sys_unlink
-#define write sys_write
-#define mkdir sys_mkdir
-#define rmdir sys_rmdir
-
-#endif
-
-#if 0
-/* this is hacky, but is necessary to avoid warnings about macro
- redefinitions using the SDK compilers */
-#ifndef __STDC__
-#define __STDC__ 1
-#define MUST_UNDEF__STDC__
-#endif
-#include <direct.h>
-#include <io.h>
-#include <stdio.h>
-#ifdef MUST_UNDEF__STDC__
-#undef __STDC__
-#undef MUST_UNDEF__STDC__
-#endif
-#endif
#include <stdio.h>
+/* subprocess calls that are emulated */
+#ifndef DONT_ENCAPSULATE
+#define spawnve sys_spawnve
+int spawnve (int mode, CONST char *cmdname,
+ CONST char * CONST *argv, CONST char *CONST *envp);
+#endif
/* IO calls that are emulated or shadowed */
#define pipe sys_pipe
void sleep (int seconds);
#endif
-/* subprocess calls that are emulated */
-#define spawnve sys_spawnve
-int spawnve (int mode, CONST char *cmdname,
- CONST char * CONST *argv, CONST char *CONST *envp);
-
#define wait sys_wait
int wait (int *status);
#define popen _popen
#define pclose _pclose
-#if 0
-#define chdir _chdir
-#define execlp _execlp
-#define execvp _execvp
-#define fcloseall _fcloseall
-#define fdopen _fdopen
-#define fgetchar _fgetchar
-#define fileno _fileno
-#define flushall _flushall
-#define fputchar _fputchar
-#define getw _getw
-#define getpid _getpid
-#define isatty _isatty
-#define logb _logb
-#define _longjmp longjmp
-#define lseek _lseek
-#define putw _putw
-#define umask _umask
-/* #define utime _utime */
-/* #define index strchr */
-/* #define rindex strrchr */
-#define read _read
-#define write _write
-#define getcwd _getcwd
-
-#ifdef HAVE_NTGUI
-#define abort win32_abort
-#endif
-
-#endif /* 0 */
-
typedef int uid_t;
typedef int gid_t;
typedef int pid_t;
#define sighold(s) msw_sighold(s)
#define sigrelse(s) msw_sigrelse(s)
#define sigpause(s) msw_sigpause(s)
-#define signal sigset
/* Defines that we need that aren't in the standard signal.h */
#define SIGHUP 1 /* Hang up */
#define getdisk() (_getdrive () - 1)
#define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN)
-#if 0 /* they do. -kkm */
-/* Define this so that winsock.h definitions don't get included when windows.h
- is... I don't know if they do the right thing for emacs. For this to
- have proper effect, config.h must always be included before windows.h. */
-#define _WINSOCKAPI_ 1
-#endif /* 0 */
-
/* Defines size_t and alloca (). */
#include <malloc.h>
/* Synched up with: Not in FSF. */
-#ifndef _XEMACS_SCROLLBAR_MSW_H_
-#define _XEMACS_SCROLLBAR_MSW_H_
+#ifndef INCLUDED_scrollbar_msw_h_
+#define INCLUDED_scrollbar_msw_h_
#if defined (HAVE_MS_WINDOWS) && defined (HAVE_SCROLLBARS)
int mswindows_handle_mousewheel_event (Lisp_Object frame, int keys, int delta);
#endif /* HAVE_MS_WINDOWS and HAVE_SCROLLBARS */
-#endif /* _XEMACS_SCROLLBAR_MSW_H_ */
+#endif /* INCLUDED_scrollbar_msw_h_ */
/* Synched up with: Not in FSF. */
-#ifndef _XEMACS_SCROLLBAR_X_H_
-#define _XEMACS_SCROLLBAR_X_H_
+#ifndef INCLUDED_scrollbar_x_h_
+#define INCLUDED_scrollbar_x_h_
#if defined (HAVE_X_WINDOWS) && defined (HAVE_SCROLLBARS)
void x_set_scrollbar_pointer (struct frame *f, Lisp_Object cursor);
#endif /* HAVE_X_WINDOWS and HAVE_SCROLLBARS */
-#endif /* _XEMACS_SCROLLBAR_H_ */
+
+#endif /* INCLUDED_scrollbar_x_h_ */
w = XWINDOW (window);
wcw = window_char_width (w, 0) - 1;
- /* ### We should be able to scroll further right as long as there is
+ /* #### We should be able to scroll further right as long as there is
a visible truncation glyph. This calculation for max is bogus. */
max_len = w->max_line_len + 2;
/* Synched up with: Not in FSF. */
-#ifndef _XEMACS_SCROLLBAR_H_
-#define _XEMACS_SCROLLBAR_H_
+#ifndef INCLUDED_scrollbar_h_
+#define INCLUDED_scrollbar_h_
#ifdef HAVE_SCROLLBARS
#endif /* HAVE_SCROLLBARS */
-#endif /* _XEMACS_SCROLLBAR_H_ */
+#endif /* INCLUDED_scrollbar_h_ */
{
char *fileext;
- GET_C_STRING_FILENAME_DATA_ALLOCA (file, fileext);
+ TO_EXTERNAL_FORMAT (LISP_STRING, file,
+ C_STRING_ALLOCA, fileext,
+ Qfile_name);
/* #### NAS code should allow specification of a device. */
if (nas_play_sound_file (fileext, vol))
return Qnil;
{
char *fileext;
- GET_C_STRING_FILENAME_DATA_ALLOCA (file, fileext);
+ TO_EXTERNAL_FORMAT (LISP_STRING, file,
+ C_STRING_ALLOCA, fileext,
+ Qfile_name);
if (esd_play_sound_file (fileext, vol))
return Qnil;
}
{
CONST char *fileext;
- GET_C_STRING_FILENAME_DATA_ALLOCA (file, fileext);
+ TO_EXTERNAL_FORMAT (LISP_STRING, file,
+ C_STRING_ALLOCA, fileext,
+ Qfile_name);
/* The sound code doesn't like getting SIGIO interrupts.
Unix sucks! */
stop_interrupts ();
CONST Extbyte *soundext;
Extcount soundextlen;
- GET_STRING_BINARY_DATA_ALLOCA (sound, soundext, soundextlen);
+ TO_EXTERNAL_FORMAT (LISP_STRING, sound,
+ ALLOCA, (soundext, soundextlen),
+ Qbinary);
if (nas_play_sound_data ((unsigned char*)soundext, soundextlen, vol))
return Qnil;
}
Extbyte *soundext;
Extcount soundextlen;
- GET_STRING_BINARY_DATA_ALLOCA (sound, soundext, soundextlen);
+ TO_EXTERNAL_FORMAT (LISP_STRING, sound, ALLOCA, (soundext, soundextlen),
+ Qbinary);
if (esd_play_sound_data (soundext, soundextlen, vol))
return Qnil;
}
CONST Extbyte *soundext;
Extcount soundextlen;
- GET_STRING_BINARY_DATA_ALLOCA (sound, soundext, soundextlen);
+ TO_EXTERNAL_FORMAT (LISP_STRING, sound,
+ ALLOCA, (soundext, soundextlen),
+ Qbinary);
/* The sound code doesn't like getting SIGIO interrupts. Unix sucks! */
stop_interrupts ();
play_sound_data ((unsigned char*)soundext, soundextlen, vol);
static specifier_type_entry_dynarr *the_specifier_type_entry_dynarr;
static const struct lrecord_description ste_description_1[] = {
- { XD_LISP_OBJECT, offsetof(specifier_type_entry, symbol), 1 },
- { XD_STRUCT_PTR, offsetof(specifier_type_entry, meths), 1, &specifier_methods_description },
+ { XD_LISP_OBJECT, offsetof (specifier_type_entry, symbol) },
+ { XD_STRUCT_PTR, offsetof (specifier_type_entry, meths), 1, &specifier_methods_description },
{ XD_END }
};
static const struct struct_description ste_description = {
- sizeof(specifier_type_entry),
+ sizeof (specifier_type_entry),
ste_description_1
};
static const struct lrecord_description sted_description_1[] = {
- XD_DYNARR_DESC(specifier_type_entry_dynarr, &ste_description),
+ XD_DYNARR_DESC (specifier_type_entry_dynarr, &ste_description),
{ XD_END }
};
static const struct struct_description sted_description = {
- sizeof(specifier_type_entry_dynarr),
+ sizeof (specifier_type_entry_dynarr),
sted_description_1
};
!NILP (rest);
rest = XSPECIFIER (rest)->next_specifier)
{
- struct Lisp_Specifier *sp = XSPECIFIER (rest);
+ Lisp_Specifier *sp = XSPECIFIER (rest);
/* This effectively changes the specifier specs.
However, there's no need to call
recompute_cached_specifier_everywhere() or the
!NILP (rest);
rest = XSPECIFIER (rest)->next_specifier)
{
- struct Lisp_Specifier *sp = XSPECIFIER (rest);
+ Lisp_Specifier *sp = XSPECIFIER (rest);
/* Make sure we're actually going to be changing something.
Fremove_specifier() always calls
static Lisp_Object
mark_specifier (Lisp_Object obj)
{
- struct Lisp_Specifier *specifier = XSPECIFIER (obj);
+ Lisp_Specifier *specifier = XSPECIFIER (obj);
mark_object (specifier->global_specs);
mark_object (specifier->device_specs);
{
if (! marked_p (rest))
{
- struct Lisp_Specifier* sp = XSPECIFIER (rest);
+ Lisp_Specifier* sp = XSPECIFIER (rest);
/* A bit of assertion that we're removing both parts of the
magic one altogether */
assert (!MAGIC_SPECIFIER_P(sp)
static void
print_specifier (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
{
- struct Lisp_Specifier *sp = XSPECIFIER (obj);
+ Lisp_Specifier *sp = XSPECIFIER (obj);
char buf[100];
int count = specpdl_depth ();
Lisp_Object the_specs;
static void
finalize_specifier (void *header, int for_disksave)
{
- struct Lisp_Specifier *sp = (struct Lisp_Specifier *) header;
+ Lisp_Specifier *sp = (Lisp_Specifier *) header;
/* don't be snafued by the disksave finalization. */
if (!for_disksave && !GHOST_SPECIFIER_P(sp) && sp->caching)
{
static int
specifier_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
{
- struct Lisp_Specifier *s1 = XSPECIFIER (obj1);
- struct Lisp_Specifier *s2 = XSPECIFIER (obj2);
+ Lisp_Specifier *s1 = XSPECIFIER (obj1);
+ Lisp_Specifier *s2 = XSPECIFIER (obj2);
int retval;
Lisp_Object old_inhibit_quit = Vinhibit_quit;
static unsigned long
specifier_hash (Lisp_Object obj, int depth)
{
- struct Lisp_Specifier *s = XSPECIFIER (obj);
+ Lisp_Specifier *s = XSPECIFIER (obj);
/* specifier hashing is a bit problematic because there are so
many places where data can be stored. We pick what are perhaps
static size_t
sizeof_specifier (CONST void *header)
{
- if (GHOST_SPECIFIER_P ((struct Lisp_Specifier *) header))
- return offsetof (struct Lisp_Specifier, data);
+ if (GHOST_SPECIFIER_P ((Lisp_Specifier *) header))
+ return offsetof (Lisp_Specifier, data);
else
{
- CONST struct Lisp_Specifier *p = (CONST struct Lisp_Specifier *) header;
- return offsetof (struct Lisp_Specifier, data) + p->methods->extra_data_size;
+ CONST Lisp_Specifier *p = (CONST Lisp_Specifier *) header;
+ return offsetof (Lisp_Specifier, data) + p->methods->extra_data_size;
}
}
static const struct lrecord_description specifier_methods_description_1[] = {
- { XD_LISP_OBJECT, offsetof(struct specifier_methods, predicate_symbol), 1 },
+ { XD_LISP_OBJECT, offsetof (struct specifier_methods, predicate_symbol) },
{ XD_END }
};
const struct struct_description specifier_methods_description = {
- sizeof(struct specifier_methods),
+ sizeof (struct specifier_methods),
specifier_methods_description_1
};
};
static const struct struct_description specifier_caching_description = {
- sizeof(struct specifier_caching),
+ sizeof (struct specifier_caching),
specifier_caching_description_1
};
static const struct lrecord_description specifier_description[] = {
- { XD_STRUCT_PTR, offsetof(struct Lisp_Specifier, methods), 1, &specifier_methods_description },
- { XD_LO_LINK, offsetof(struct Lisp_Specifier, next_specifier) },
- { XD_LISP_OBJECT, offsetof(struct Lisp_Specifier, global_specs), 5 },
- { XD_STRUCT_PTR, offsetof(struct Lisp_Specifier, caching), 1, &specifier_caching_description },
- { XD_LISP_OBJECT, offsetof(struct Lisp_Specifier, magic_parent), 2 },
+ { XD_STRUCT_PTR, offsetof (Lisp_Specifier, methods), 1, &specifier_methods_description },
+ { XD_LO_LINK, offsetof (Lisp_Specifier, next_specifier) },
+ { XD_LISP_OBJECT, offsetof (Lisp_Specifier, global_specs) },
+ { XD_LISP_OBJECT, offsetof (Lisp_Specifier, device_specs) },
+ { XD_LISP_OBJECT, offsetof (Lisp_Specifier, frame_specs) },
+ { XD_LISP_OBJECT, offsetof (Lisp_Specifier, window_specs) },
+ { XD_LISP_OBJECT, offsetof (Lisp_Specifier, buffer_specs) },
+ { XD_STRUCT_PTR, offsetof (Lisp_Specifier, caching), 1, &specifier_caching_description },
+ { XD_LISP_OBJECT, offsetof (Lisp_Specifier, magic_parent) },
+ { XD_LISP_OBJECT, offsetof (Lisp_Specifier, fallback) },
{ XD_SPECIFIER_END }
};
specifier_equal, specifier_hash,
specifier_description,
sizeof_specifier,
- struct Lisp_Specifier);
+ Lisp_Specifier);
\f
/************************************************************************/
/* Creating specifiers */
size_t data_size, int call_create_meth)
{
Lisp_Object specifier;
- struct Lisp_Specifier *sp = (struct Lisp_Specifier *)
- alloc_lcrecord (offsetof (struct Lisp_Specifier, data) +
- data_size, &lrecord_specifier);
+ Lisp_Specifier *sp = (Lisp_Specifier *)
+ alloc_lcrecord (offsetof (Lisp_Specifier, data) + data_size,
+ &lrecord_specifier);
sp->methods = spec_meths;
sp->global_specs = Qnil;
{
/* The return value of this function must be GCPRO'd. */
Lisp_Object rest, list_to_build_up = Qnil;
- struct Lisp_Specifier *sp = XSPECIFIER (specifier);
+ Lisp_Specifier *sp = XSPECIFIER (specifier);
struct gcpro gcpro1;
GCPRO1 (list_to_build_up);
specifier_add_spec (Lisp_Object specifier, Lisp_Object locale,
Lisp_Object inst_list, enum spec_add_meth add_meth)
{
- struct Lisp_Specifier *sp = XSPECIFIER (specifier);
+ Lisp_Specifier *sp = XSPECIFIER (specifier);
enum spec_locale_type type = locale_type_from_locale (locale);
Lisp_Object *orig_inst_list, tem;
Lisp_Object list_to_build_up = Qnil;
void
set_specifier_fallback (Lisp_Object specifier, Lisp_Object fallback)
{
- struct Lisp_Specifier *sp = XSPECIFIER (specifier);
+ Lisp_Specifier *sp = XSPECIFIER (specifier);
assert (SPECIFIERP (fallback) ||
!NILP (Fvalid_inst_list_p (fallback, Fspecifier_type (specifier))));
if (SPECIFIERP (fallback))
Lisp_Object depth)
{
/* This function can GC */
- struct Lisp_Specifier *sp;
+ Lisp_Specifier *sp;
Lisp_Object device;
Lisp_Object rest;
int count = specpdl_depth ();
Lisp_Object device = Qnil;
Lisp_Object tag = Qnil;
struct device *d;
- struct Lisp_Specifier *sp;
+ Lisp_Specifier *sp;
sp = XSPECIFIER (specifier);
(specifier, domain, inst_list, default_))
{
Lisp_Object val = Qunbound;
- struct Lisp_Specifier *sp = XSPECIFIER (specifier);
+ Lisp_Specifier *sp = XSPECIFIER (specifier);
struct gcpro gcpro1;
Lisp_Object built_up_list = Qnil;
(specifier, matchspec, domain, inst_list, default_))
{
Lisp_Object val = Qunbound;
- struct Lisp_Specifier *sp = XSPECIFIER (specifier);
+ Lisp_Specifier *sp = XSPECIFIER (specifier);
struct gcpro gcpro1;
Lisp_Object built_up_list = Qnil;
(Lisp_Object specifier, struct frame *f,
Lisp_Object oldval))
{
- struct Lisp_Specifier *sp = XSPECIFIER (specifier);
+ Lisp_Specifier *sp = XSPECIFIER (specifier);
assert (!GHOST_SPECIFIER_P (sp));
if (!sp->caching)
/* Synched up with: Not in FSF. */
-#ifndef _XEMACS_SPECIFIER_H_
-#define _XEMACS_SPECIFIER_H_
+#ifndef INCLUDED_specifier_h_
+#define INCLUDED_specifier_h_
/*
MAGIC SPECIFIERS
/* type-specific extra data attached to a specifier */
char data[1];
};
+typedef struct Lisp_Specifier Lisp_Specifier;
-DECLARE_LRECORD (specifier, struct Lisp_Specifier);
-#define XSPECIFIER(x) XRECORD (x, specifier, struct Lisp_Specifier)
+DECLARE_LRECORD (specifier, Lisp_Specifier);
+#define XSPECIFIER(x) XRECORD (x, specifier, Lisp_Specifier)
#define XSETSPECIFIER(x, p) XSETRECORD (x, p, specifier)
#define SPECIFIERP(x) RECORDP (x, specifier)
#define CHECK_SPECIFIER(x) CHECK_RECORD (x, specifier)
#define SPECMETH(sp, m, args) (((sp)->methods->m##_method) args)
/* Call a void-returning specifier method, if it exists. */
-#define MAYBE_SPECMETH(sp, m, args) do { \
- struct Lisp_Specifier *maybe_specmeth_sp = (sp); \
- if (HAS_SPECMETH_P (maybe_specmeth_sp, m)) \
- SPECMETH (maybe_specmeth_sp, m, args); \
+#define MAYBE_SPECMETH(sp, m, args) do { \
+ Lisp_Specifier *maybe_specmeth_sp = (sp); \
+ if (HAS_SPECMETH_P (maybe_specmeth_sp, m)) \
+ SPECMETH (maybe_specmeth_sp, m, args); \
} while (0)
/***** Defining new specifier types *****/
-#define specifier_data_offset (offsetof(struct Lisp_Specifier, data))
+#define specifier_data_offset (offsetof (Lisp_Specifier, data))
extern const struct lrecord_description specifier_empty_extra_description[];
#ifdef ERROR_CHECK_TYPECHECK
#define DECLARE_SPECIFIER_TYPE(type) \
extern struct specifier_methods * type##_specifier_methods; \
INLINE struct type##_specifier * \
-error_check_##type##_specifier_data (struct Lisp_Specifier *sp); \
+error_check_##type##_specifier_data (Lisp_Specifier *sp); \
INLINE struct type##_specifier * \
-error_check_##type##_specifier_data (struct Lisp_Specifier *sp) \
+error_check_##type##_specifier_data (Lisp_Specifier *sp) \
{ \
if (SPECIFIERP (sp->magic_parent)) \
{ \
assert (SPECIFIER_TYPE_P (sp, type)); \
return (struct type##_specifier *) sp->data; \
} \
-INLINE struct Lisp_Specifier * \
+INLINE Lisp_Specifier * \
error_check_##type##_specifier_type (Lisp_Object obj); \
-INLINE struct Lisp_Specifier * \
+INLINE Lisp_Specifier * \
error_check_##type##_specifier_type (Lisp_Object obj) \
{ \
- struct Lisp_Specifier *sp = XSPECIFIER (obj); \
+ Lisp_Specifier *sp = XSPECIFIER (obj); \
assert (SPECIFIER_TYPE_P (sp, type)); \
return sp; \
} \
#define CHECK_DISPLAYTABLE_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, display_table)
#define CONCHECK_DISPLAYTABLE_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, display_table)
-#endif /* _XEMACS_SPECIFIER_H_ */
+#endif /* INCLUDED_specifier_h_ */
/* Fsymbol_value checks whether XSYMBOL (sym)->value is one of these,
* and does weird magic stuff if so */
-#ifndef _XEMACS_SYMEVAL_H_
-#define _XEMACS_SYMEVAL_H_
+#ifndef INCLUDED_symeval_h_
+#define INCLUDED_symeval_h_
enum symbol_value_type
{
#define DEFVAR_CONST_BOOL(lname, c_location) \
DEFVAR_SYMVAL_FWD (lname, c_location, SYMVAL_CONST_BOOLEAN_FORWARD, 0)
#define DEFVAR_LISP_MAGIC(lname, c_location, magicfun) \
- DEFVAR_SYMVAL_FWD_OBJECT (lname, c_location, SYMVAL_OBJECT_FORWARD, magicfun);
+ DEFVAR_SYMVAL_FWD_OBJECT (lname, c_location, SYMVAL_OBJECT_FORWARD, magicfun)
#define DEFVAR_INT_MAGIC(lname, c_location, magicfun) \
- DEFVAR_SYMVAL_FWD (lname, c_location, SYMVAL_FIXNUM_FORWARD, magicfun);
+ DEFVAR_SYMVAL_FWD (lname, c_location, SYMVAL_FIXNUM_FORWARD, magicfun)
#define DEFVAR_BOOL_MAGIC(lname, c_location, magicfun) \
- DEFVAR_SYMVAL_FWD (lname, c_location, SYMVAL_BOOLEAN_FORWARD, magicfun);
+ DEFVAR_SYMVAL_FWD (lname, c_location, SYMVAL_BOOLEAN_FORWARD, magicfun)
-#endif /* _XEMACS_SYMEVAL_H_ */
+#endif /* INCLUDED_symeval_h_ */
#ifdef WINDOWSNT
#include <direct.h>
-#ifndef __MINGW32__
+#ifdef __MINGW32__
+#include <mingw32/process.h>
+#else
/* <process.h> should not conflict with "process.h", as per ANSI definition.
- This is not true though with visual c though. The trick below works with
- VC4.2b and with VC5.0. It assumes that VC is installed in a kind of
- standard way, so include files get to what/ever/path/include.
+ This is not true with visual c though. The trick below works with
+ VC4.2b, 5.0 and 6.0. It assumes that VC is installed in a kind of
+ standard way, so include path ends with /include.
Unfortunately, this must go before lisp.h, since process.h defines abort()
which will conflict with the macro defined in lisp.h
*/
#include <../include/process.h>
-#else
-#include <mingw32/process.h>
-#endif
+#endif /* __MINGW32__ */
#endif /* WINDOWSNT */
#include "lisp.h"
#ifdef WINDOWSNT
#include <sys/utime.h>
-#include <windows.h>
#include "ntheap.h"
#endif
"failure to obtain process exit value");
}
}
- if (pHandle != NULL && !CloseHandle(pHandle))
+ if (pHandle != NULL && !CloseHandle(pHandle))
{
warn_when_safe (Qprocess, Qwarning,
"failure to close unknown process");
#endif /* no TIOCGPGRP or no TIOCGLTC or no TIOCGETC */
s.main.c_cc[VEOL] = _POSIX_VDISABLE;
#if defined (CBAUD)
- /* <mdiers> ### This is not portable. ###
+ /* <mdiers> #### This is not portable. ###
POSIX does not specify CBAUD, and 4.4BSD does not have it.
Instead, POSIX suggests to use cfset{i,o}speed().
[cf. D. Lewine, POSIX Programmer's Guide, Chapter 8: Terminal
#ifdef TCXONC
if (!TTY_FLAGS (con).flow_control) ioctl (input_fd, TCXONC, 1);
#endif
-#ifndef APOLLO
#ifdef TIOCSTART
if (!TTY_FLAGS (con).flow_control) ioctl (input_fd, TIOCSTART, 0);
#endif
-#endif
#if defined (HAVE_TERMIOS) || defined (HPUX9)
#ifdef TCOON
/* limits of text/data segments */
/************************************************************************/
-#ifndef CANNOT_DUMP
+#if !defined(CANNOT_DUMP) && !defined(PDUMP)
#define NEED_STARTS
#endif
*
*/
+#if !defined(HAVE_TEXT_START) && !defined(PDUMP)
+
#ifdef __cplusplus
extern "C" int _start (void);
#else
extern int _start (void);
#endif
-#ifndef HAVE_TEXT_START
char *
start_of_text (void)
{
#endif /* GOULD */
#endif /* TEXT_START */
}
-#endif /* not HAVE_TEXT_START */
+#endif /* !defined(HAVE_TEXT_START) && !defined(PDUMP) */
/*
* Return the address of the start of the data segment prior to
}
#endif /* NEED_STARTS (not CANNOT_DUMP or not SYSTEM_MALLOC) */
-#ifndef CANNOT_DUMP
+#if !defined(CANNOT_DUMP) && !defined(PDUMP)
/* Some systems that cannot dump also cannot implement these. */
/*
#endif
}
-#endif /* not CANNOT_DUMP */
+#endif /* !defined(CANNOT_DUMP) && !defined(PDUMP) */
\f
/************************************************************************/
{
#if defined (WINDOWSNT)
char hostname [MAX_COMPUTERNAME_LENGTH + 1];
- size_t size = sizeof(hostname);
+ size_t size = sizeof (hostname);
GetComputerName (hostname, &size);
Vsystem_name = build_string (hostname);
#elif !defined (HAVE_GETHOSTNAME)
# endif /* not CANNOT_DUMP */
if (!strchr (hostname, '.'))
{
+# if !(defined(HAVE_GETADDRINFO) && defined(HAVE_GETNAMEINFO))
struct hostent *hp = NULL;
int count;
-# ifdef TRY_AGAIN
+# ifdef TRY_AGAIN
for (count = 0; count < 10; count++)
{
h_errno = 0;
-# endif
+# endif
/* Some systems can't handle SIGALARM/SIGIO in gethostbyname(). */
stop_interrupts ();
hp = gethostbyname (hostname);
start_interrupts ();
-# ifdef TRY_AGAIN
+# ifdef TRY_AGAIN
if (! (hp == 0 && h_errno == TRY_AGAIN))
break;
Fsleep_for (make_int (1));
}
-# endif
+# endif
if (hp)
{
CONST char *fqdn = (CONST char *) hp->h_name;
hostname = (char *) alloca (strlen (fqdn) + 1);
strcpy (hostname, fqdn);
}
+# else /* !(HAVE_GETADDRINFO && HAVE_GETNAMEINFO) */
+ struct addrinfo hints, *res;
+
+ xzero (hints);
+ hints.ai_flags = AI_CANONNAME;
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_protocol = 0;
+ if (!getaddrinfo (hostname, NULL, &hints, &res))
+ {
+ hostname = (char *) alloca (strlen (res->ai_canonname) + 1);
+ strcpy (hostname, res->ai_canonname);
+
+ freeaddrinfo (res);
+ }
+# endif /* !(HAVE_GETADDRINFO && HAVE_GETNAMEINFO) */
}
# endif /* HAVE_SOCKETS */
Vsystem_name = build_string (hostname);
int i;
/* check the table for the OS error code */
- for (i = 0; i < sizeof(errtable)/sizeof(errtable[0]); ++i)
+ for (i = 0; i < countof (errtable); ++i)
{
if (win32_error == errtable[i].oscode)
{
/************************************************************************/
#define PATHNAME_CONVERT_OUT(path) \
- GET_C_CHARPTR_EXT_FILENAME_DATA_ALLOCA ((CONST Bufbyte *) path, path)
+ TO_EXTERNAL_FORMAT (C_STRING, (path), C_STRING_ALLOCA, (path), Qfile_name);
/***************** low-level calls ****************/
mode = va_arg (ap, int);
va_end (ap);
- PATHNAME_CONVERT_OUT (path);
-#if defined (WINDOWSNT)
+#ifdef WINDOWSNT
/* Make all handles non-inheritable */
- return open (path, oflag | _O_NOINHERIT, mode);
-#elif defined (INTERRUPTIBLE_OPEN)
+ oflag |= _O_NOINHERIT;
+#endif
+
+#ifdef INTERRUPTIBLE_OPEN
{
int rtnval;
while ((rtnval = open (path, oflag, mode)) == -1
PATHNAME_CONVERT_OUT (nonreloc);
+#ifdef WINDOWSNT
+ /* Make all handles non-inheritable */
+ oflag |= _O_NOINHERIT;
+#endif
+
for (;;)
{
int rtnval = open (nonreloc, oflag, mode);
Dynarr_add_many (internal_DIRENTRY, (Bufbyte *) rtnval,
offsetof (DIRENTRY, d_name));
- internal_name =
- convert_from_external_format (external_name, external_len,
- &internal_len, FORMAT_FILENAME);
+ TO_INTERNAL_FORMAT (DATA, (external_name, external_len),
+ ALLOCA, (internal_name, internal_len),
+ Qfile_name);
Dynarr_add_many (internal_DIRENTRY, internal_name, internal_len);
Dynarr_add (internal_DIRENTRY, 0); /* zero-terminate */
/* Synched up with: FSF 19.30. Split out of sysdep.c/emacs.c. */
-#ifndef _XEMACS_SYSDEP_H_
-#define _XEMACS_SYSDEP_H_
+#ifndef INCLUDED_sysdep_h_
+#define INCLUDED_sysdep_h_
#include <setjmp.h>
+#ifndef WINDOWSNT
extern char **environ;
+#endif
int eight_bit_tty (struct device *d);
char *xrealpath(CONST char *path, char resolved_path []);
#endif
-#endif /* _XEMACS_SYSDEP_H_ */
+#endif /* INCLUDED_sysdep_h_ */
/* Synched up with: Not really in FSF. */
+#ifndef INCLUDED_sysdir_h_
+#define INCLUDED_sysdir_h_
+
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
# define sys_rmdir rmdir
#endif
+#endif /* INCLUDED_sysdir_h_ */
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
-#ifndef _SYSDLL_H
-#define _SYSDLL_H
+#ifndef INCLUDED_sysdll_h_
+#define INCLUDED_sysdll_h_
#ifdef __cplusplus
extern "C" {
}
#endif
-#endif /* _SYSDLL_H */
+#endif /* INCLUDED_sysdll_h_ */
/* Synched up with: Not really in FSF. */
+#ifndef INCLUDED_sysfile_h_
+#define INCLUDED_sysfile_h_
+
#include <errno.h>
#ifndef WINDOWSNT
#if !defined (ENCAPSULATE_EXECVP) && defined (DONT_ENCAPSULATE)
# define sys_execvp execvp
#endif
+
+#endif /* INCLUDED_sysfile_h_ */
/* Synched up with: Not really in FSF. */
+#ifndef INCLUDED_sysfloat_h_
+#define INCLUDED_sysfloat_h_
+
/* Work around a problem that happens because math.h on hpux 7
defines two static variables--which, in Emacs, are not really static,
because `static' is defined as nothing. The problem is that they are
# define isnan(x) ((x) != (x))
#endif
+#endif /* INCLUDED_sysfloat_h_ */
/* Synched up with: Not really in FSF. */
+#ifndef INCLUDED_sysproc_h_
+#define INCLUDED_sysproc_h_
+
#ifdef HAVE_VFORK_H
# include <vfork.h>
#endif
/* Damn that local process.h! Instead we can define P_WAIT ourselves. */
#define P_WAIT 1
#endif
+
+#endif /* INCLUDED_sysproc_h_ */
/* Synched up with: FSF 19.30. */
-#ifndef _XEMACS_SYSSIGNAL_H_
-#define _XEMACS_SYSSIGNAL_H_
+#ifndef INCLUDED_syssignal_h_
+#define INCLUDED_syssignal_h_
/* In the old world, one could not #include <signal.h> here. The party line
was that that header should always be #included before <config.h>, because
SIGTYPE memory_warning_signal (int sig);
#endif
-#ifdef _WIN32
+#ifdef WINDOWSNT
/* Prototypes for signal functions, see nt.c */
typedef void (__cdecl *msw_sighandler) (int);
msw_sighandler msw_sigset (int sig, msw_sighandler handler);
int msw_raise (int nsig);
#endif /* _WIN32 */
-#endif /* _XEMACS_SYSSIGNAL_H_ */
+#endif /* INCLUDED_syssignal_h_ */
/* Synched up with: FSF 19.30. */
-#ifndef _XEMACS_SYSTIME_H_
-#define _XEMACS_SYSTIME_H_
+#ifndef INCLUDED_systime_h_
+#define INCLUDED_systime_h_
#ifdef TIME_WITH_SYS_TIME
#include <sys/time.h>
# include <utime.h>
#endif
-#ifdef HAVE_TZNAME
+#if defined(HAVE_TZNAME) && !defined(WINDOWSNT) && !defined(__CYGWIN32__)
#ifndef tzname /* For SGI. */
extern char *tzname[]; /* RS6000 and others want it this way. */
#endif
#endif /* WINDOWSNT */
-#endif /* _XEMACS_SYSTIME_H_ */
+#endif /* INCLUDED_systime_h_ */
/* Synched up with: FSF 19.30. */
-#ifndef _XEMACS_SYSTTY_H_
-#define _XEMACS_SYSTTY_H_
+#ifndef INCLUDED_systty_h_
+#define INCLUDED_systty_h_
#ifdef HAVE_TERMIOS
# define HAVE_TCATTR
/* ----------------------------------------------------- */
-#ifdef APOLLO
-#undef TIOCSTART
-#endif
-
#if defined (XENIX) || defined (BROKEN_TIOCGETC)
#undef TIOCGETC /* Avoid confusing some conditionals that test this. */
#endif
#endif /* not def HAVE_TERMIO */
#endif /* not def HAVE_TERMIOS */
-#endif /* _XEMACS_SYSTTY_H_ */
+#endif /* INCLUDED_systty_h_ */
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* Cleanup by Martin Buchholz for Autoconf 2 (see the Autoconf Manual) */
+#ifndef INCLUDED_syswait_h_
+#define INCLUDED_syswait_h_
#include <sys/types.h>
#define WRETCODE(s) ((s) >> 8)
#endif
+#endif /* INCLUDED_syswait_h_ */
if (IMAGE_INSTANCEP (instance))
{
- struct Lisp_Image_Instance* p = XIMAGE_INSTANCE (instance);
+ Lisp_Image_Instance* p = XIMAGE_INSTANCE (instance);
if (IMAGE_INSTANCE_PIXMAP_TYPE_P (p))
{
}
/* map toolbar hwnd to pos*/
-int mswindows_find_toolbar_pos(struct frame* f, HWND ctrl)
+static int mswindows_find_toolbar_pos(struct frame* f, HWND ctrl)
{
int id = GetDlgCtrlID(ctrl);
return id ? id - TOOLBAR_ID_BIAS : -1;
/* Synched up with: Not in FSF. */
-#ifndef _XEMACS_TOOLBAR_H_
-#define _XEMACS_TOOLBAR_H_
+#ifndef INCLUDED_toolbar_h_
+#define INCLUDED_toolbar_h_
#ifdef HAVE_TOOLBARS
#endif /* HAVE_TOOLBARS */
-#endif /* _XEMACS_TOOLBAR_H_ */
+#endif /* INCLUDED_toolbar_h_ */
print_tooltalk_message (Lisp_Object obj, Lisp_Object printcharfun,
int escapeflag)
{
- struct Lisp_Tooltalk_Message *p = XTOOLTALK_MESSAGE (obj);
+ Lisp_Tooltalk_Message *p = XTOOLTALK_MESSAGE (obj);
char buf[200];
DEFINE_LRECORD_IMPLEMENTATION ("tooltalk-message", tooltalk_message,
mark_tooltalk_message, print_tooltalk_message,
0, 0, 0, 0,
- struct Lisp_Tooltalk_Message);
+ Lisp_Tooltalk_Message);
\f
static Lisp_Object
make_tooltalk_message (Tt_message m)
{
Lisp_Object val;
- struct Lisp_Tooltalk_Message *msg =
- alloc_lcrecord_type (struct Lisp_Tooltalk_Message,
- &lrecord_tooltalk_message);
+ Lisp_Tooltalk_Message *msg =
+ alloc_lcrecord_type (Lisp_Tooltalk_Message, &lrecord_tooltalk_message);
msg->m = m;
msg->callback = Qnil;
print_tooltalk_pattern (Lisp_Object obj, Lisp_Object printcharfun,
int escapeflag)
{
- struct Lisp_Tooltalk_Pattern *p = XTOOLTALK_PATTERN (obj);
+ Lisp_Tooltalk_Pattern *p = XTOOLTALK_PATTERN (obj);
char buf[200];
DEFINE_LRECORD_IMPLEMENTATION ("tooltalk-pattern", tooltalk_pattern,
mark_tooltalk_pattern, print_tooltalk_pattern,
0, 0, 0, 0,
- struct Lisp_Tooltalk_Pattern);
+ Lisp_Tooltalk_Pattern);
\f
static Lisp_Object
make_tooltalk_pattern (Tt_pattern p)
{
- struct Lisp_Tooltalk_Pattern *pat =
- alloc_lcrecord_type (struct Lisp_Tooltalk_Pattern,
- &lrecord_tooltalk_pattern);
+ Lisp_Tooltalk_Pattern *pat =
+ alloc_lcrecord_type (Lisp_Tooltalk_Pattern, &lrecord_tooltalk_pattern);
Lisp_Object val;
pat->p = p;
{
Tt_message m = unbox_tooltalk_message (message_);
int n = 0;
+ Tt_status (*fun_str) (Tt_message, const char *) = 0;
CHECK_SYMBOL (attribute);
+
if (EQ (attribute, (Qtt_arg_bval)) ||
EQ (attribute, (Qtt_arg_ival)) ||
EQ (attribute, (Qtt_arg_val)))
if (!VALID_TOOLTALK_MESSAGEP (m))
return Qnil;
- else if (EQ (attribute, Qtt_address))
+ if (EQ (attribute, Qtt_address))
{
CHECK_TOOLTALK_CONSTANT (value);
tt_message_address_set (m, (Tt_address) tooltalk_constant_value (value));
tt_message_disposition_set (m, ((Tt_disposition)
tooltalk_constant_value (value)));
}
- else if (EQ (attribute, Qtt_file))
+ else if (EQ (attribute, Qtt_scope))
{
- CONST char *value_ext;
- CHECK_STRING (value);
- GET_C_STRING_OS_DATA_ALLOCA (value, value_ext);
- tt_message_file_set (m, value_ext);
+ CHECK_TOOLTALK_CONSTANT (value);
+ tt_message_scope_set (m, (Tt_scope) tooltalk_constant_value (value));
}
+ else if (EQ (attribute, Qtt_file))
+ fun_str = tt_message_file_set;
else if (EQ (attribute, Qtt_handler_ptype))
- {
- CONST char *value_ext;
- CHECK_STRING (value);
- GET_C_STRING_OS_DATA_ALLOCA (value, value_ext);
- tt_message_handler_ptype_set (m, value_ext);
- }
+ fun_str = tt_message_handler_ptype_set;
else if (EQ (attribute, Qtt_handler))
- {
- CONST char *value_ext;
- CHECK_STRING (value);
- GET_C_STRING_OS_DATA_ALLOCA (value, value_ext);
- tt_message_handler_set (m, value_ext);
- }
+ fun_str = tt_message_handler_set;
else if (EQ (attribute, Qtt_object))
- {
- CONST char *value_ext;
- CHECK_STRING (value);
- GET_C_STRING_OS_DATA_ALLOCA (value, value_ext);
- tt_message_object_set (m, value_ext);
- }
+ fun_str = tt_message_object_set;
else if (EQ (attribute, Qtt_op))
- {
- CONST char *value_ext;
- CHECK_STRING (value);
- GET_C_STRING_OS_DATA_ALLOCA (value, value_ext);
- tt_message_op_set (m, value_ext);
- }
+ fun_str = tt_message_op_set;
else if (EQ (attribute, Qtt_otype))
- {
- CONST char *value_ext;
- CHECK_STRING (value);
- GET_C_STRING_OS_DATA_ALLOCA (value, value_ext);
- tt_message_otype_set (m, value_ext);
- }
- else if (EQ (attribute, Qtt_scope))
- {
- CHECK_TOOLTALK_CONSTANT (value);
- tt_message_scope_set (m, (Tt_scope) tooltalk_constant_value (value));
- }
+ fun_str = tt_message_otype_set;
else if (EQ (attribute, Qtt_sender_ptype))
- {
- CONST char *value_ext;
- CHECK_STRING (value);
- GET_C_STRING_OS_DATA_ALLOCA (value, value_ext);
- tt_message_sender_ptype_set (m, value_ext);
- }
+ fun_str = tt_message_sender_ptype_set;
else if (EQ (attribute, Qtt_session))
- {
- CONST char *value_ext;
- CHECK_STRING (value);
- GET_C_STRING_OS_DATA_ALLOCA (value, value_ext);
- tt_message_session_set (m, value_ext);
- }
+ fun_str = tt_message_session_set;
+ else if (EQ (attribute, Qtt_status_string))
+ fun_str = tt_message_status_string_set;
else if (EQ (attribute, Qtt_arg_bval))
{
Extbyte *value_ext;
Extcount value_ext_len;
CHECK_STRING (value);
- GET_STRING_OS_DATA_ALLOCA (value, value_ext, value_ext_len);
+ TO_EXTERNAL_FORMAT (LISP_STRING, value,
+ ALLOCA, (value_ext, value_ext_len),
+ Qnative);
tt_message_arg_bval_set (m, n, value_ext, value_ext_len);
}
else if (EQ (attribute, Qtt_arg_ival))
{
CONST char *value_ext;
CHECK_STRING (value);
- GET_C_STRING_OS_DATA_ALLOCA (value, value_ext);
+ TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative);
tt_message_arg_val_set (m, n, value_ext);
}
else if (EQ (attribute, Qtt_status))
CHECK_INT (value);
tt_message_status_set (m, XINT (value));
}
- else if (EQ (attribute, Qtt_status_string))
- {
- CONST char *value_ext;
- CHECK_STRING (value);
- GET_C_STRING_OS_DATA_ALLOCA (value, value_ext);
- tt_message_status_string_set (m, value_ext);
- }
else if (EQ (attribute, Qtt_callback))
{
CHECK_SYMBOL (value);
else
signal_simple_error ("Invalid value for `set-tooltalk-message-attribute'",
attribute);
+
+ if (fun_str)
+ {
+ CONST char *value_ext;
+ CHECK_STRING (value);
+ TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative);
+ (*fun_str) (m, value_ext);
+ }
+
return Qnil;
}
{
CONST char *vtype_ext;
- GET_C_STRING_OS_DATA_ALLOCA (vtype, vtype_ext);
+ TO_EXTERNAL_FORMAT (LISP_STRING, vtype, C_STRING_ALLOCA, vtype_ext, Qnative);
if (NILP (value))
tt_message_arg_add (m, n, vtype_ext, NULL);
else if (STRINGP (value))
{
CONST char *value_ext;
- GET_C_STRING_OS_DATA_ALLOCA (value, value_ext);
+ TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative);
tt_message_arg_add (m, n, vtype_ext, value_ext);
}
else if (INTP (value))
{
CONST char *value_ext;
CHECK_STRING (value);
- GET_C_STRING_OS_DATA_ALLOCA (value, value_ext);
+ TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative);
tt_pattern_file_add (p, value_ext);
}
else if (EQ (attribute, Qtt_object))
{
CONST char *value_ext;
CHECK_STRING (value);
- GET_C_STRING_OS_DATA_ALLOCA (value, value_ext);
+ TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative);
tt_pattern_object_add (p, value_ext);
}
else if (EQ (attribute, Qtt_op))
{
CONST char *value_ext;
CHECK_STRING (value);
- GET_C_STRING_OS_DATA_ALLOCA (value, value_ext);
+ TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative);
tt_pattern_op_add (p, value_ext);
}
else if (EQ (attribute, Qtt_otype))
{
CONST char *value_ext;
CHECK_STRING (value);
- GET_C_STRING_OS_DATA_ALLOCA (value, value_ext);
+ TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative);
tt_pattern_otype_add (p, value_ext);
}
else if (EQ (attribute, Qtt_scope))
{
CONST char *value_ext;
CHECK_STRING (value);
- GET_C_STRING_OS_DATA_ALLOCA (value, value_ext);
+ TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative);
tt_pattern_sender_add (p, value_ext);
}
else if (EQ (attribute, Qtt_sender_ptype))
{
CONST char *value_ext;
CHECK_STRING (value);
- GET_C_STRING_OS_DATA_ALLOCA (value, value_ext);
+ TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative);
tt_pattern_sender_ptype_add (p, value_ext);
}
else if (EQ (attribute, Qtt_session))
{
CONST char *value_ext;
CHECK_STRING (value);
- GET_C_STRING_OS_DATA_ALLOCA (value, value_ext);
+ TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative);
tt_pattern_session_add (p, value_ext);
}
else if (EQ (attribute, Qtt_state))
{
CONST char *vtype_ext;
- GET_C_STRING_OS_DATA_ALLOCA (vtype, vtype_ext);
+ TO_EXTERNAL_FORMAT (LISP_STRING, vtype, C_STRING_ALLOCA, vtype_ext, Qnative);
if (NILP (value))
tt_pattern_arg_add (p, n, vtype_ext, NULL);
else if (STRINGP (value))
{
CONST char *value_ext;
- GET_C_STRING_OS_DATA_ALLOCA (value, value_ext);
+ TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative);
tt_pattern_arg_add (p, n, vtype_ext, value_ext);
}
else if (INTP (value))
Lisp_Object fil;
- /* tt_open() messes with our signal handler flags (at least when no
- ttsessions is running on the machine), therefore we save the
+ /* tt_open() messes with our signal handler flags (at least when no
+ ttsessions is running on the machine), therefore we save the
actions and restore them after the call */
#ifdef HAVE_SIGPROCMASK
{
/* Synched up with: Not in FSF. */
-#ifndef _XEMACS_TOOLTALK_H_
-#define _XEMACS_TOOLTALK_H_
+#ifndef INCLUDED_tooltalk_h_
+#define INCLUDED_tooltalk_h_
#include TT_C_H_PATH
-struct Lisp_Tooltalk_Message;
-DECLARE_LRECORD (tooltalk_message, struct Lisp_Tooltalk_Message);
-#define XTOOLTALK_MESSAGE(x) XRECORD (x, tooltalk_message, struct Lisp_Tooltalk_Message)
+typedef struct Lisp_Tooltalk_Message Lisp_Tooltalk_Message;
+DECLARE_LRECORD (tooltalk_message, Lisp_Tooltalk_Message);
+#define XTOOLTALK_MESSAGE(x) XRECORD (x, tooltalk_message, Lisp_Tooltalk_Message)
#define XSETTOOLTALK_MESSAGE(x, p) XSETRECORD (x, p, tooltalk_message)
#define TOOLTALK_MESSAGEP(x) RECORDP (x, tooltalk_message)
#define CHECK_TOOLTALK_MESSAGE(x) CHECK_RECORD (x, tooltalk_message)
-struct Lisp_Tooltalk_Pattern;
-DECLARE_LRECORD (tooltalk_pattern, struct Lisp_Tooltalk_Pattern);
-#define XTOOLTALK_PATTERN(x) XRECORD (x, tooltalk_pattern, struct Lisp_Tooltalk_Pattern)
+typedef struct Lisp_Tooltalk_Pattern Lisp_Tooltalk_Pattern;
+DECLARE_LRECORD (tooltalk_pattern, Lisp_Tooltalk_Pattern);
+#define XTOOLTALK_PATTERN(x) XRECORD (x, tooltalk_pattern, Lisp_Tooltalk_Pattern)
#define XSETTOOLTALK_PATTERN(x, p) XSETRECORD (x, p, tooltalk_pattern)
#define TOOLTALK_PATTERNP(x) RECORDP (x, tooltalk_pattern)
#define CHECK_TOOLTALK_PATTERN(x) CHECK_RECORD (x, tooltalk_pattern)
extern Lisp_Object Qtooltalk_error;
-#endif /* _XEMACS_TOOLTALK_H_ */
+#endif /* INCLUDED_tooltalk_h_ */
&& NILP (XCAR (next)))
{
/* Add in the space occupied by this element and its chain link. */
- size_so_far += sizeof (struct Lisp_Cons);
+ size_so_far += sizeof (Lisp_Cons);
/* Advance to next element. */
prev = next;
elt = XCAR (next);
/* Add in the space occupied by this element and its chain link. */
- size_so_far += sizeof (struct Lisp_Cons);
+ size_so_far += sizeof (Lisp_Cons);
if (CONSP (elt))
{
- size_so_far += sizeof (struct Lisp_Cons);
+ size_so_far += sizeof (Lisp_Cons);
if (STRINGP (XCAR (elt)))
- size_so_far += (sizeof (struct Lisp_String) - 1
+ size_so_far += (sizeof (Lisp_String) - 1
+ XSTRING_LENGTH (XCAR (elt)));
}
}
/* Add in the space occupied by this element and its chain link. */
- size_so_far += sizeof (struct Lisp_Cons);
+ size_so_far += sizeof (Lisp_Cons);
if (CONSP (elt))
{
- size_so_far += sizeof (struct Lisp_Cons);
+ size_so_far += sizeof (Lisp_Cons);
if (STRINGP (XCAR (elt)))
- size_so_far += (sizeof (struct Lisp_String) - 1
+ size_so_far += (sizeof (Lisp_String) - 1
+ XSTRING_LENGTH (XCAR (elt)));
}
#include "lisp.h"
static void
-report_error (file, fd)
- CONST char *file;
- int fd;
+report_error (const char *file, int fd)
{
if (fd)
close (fd);
report_file_error ("Cannot unexec",
- Fcons (build_ext_string (file, FORMAT_FILENAME), Qnil));
+ Fcons (build_ext_string (file, Qfile_name), Qnil));
}
#endif /* emacs */
l_Elf_Ehdr *old_file_h, *new_file_h;
l_Elf_Phdr *old_program_h, *new_program_h;
l_Elf_Shdr *old_section_h, *new_section_h;
+ l_Elf_Shdr *oldbss;
/* Point to the section name table in the old file. */
char *old_section_names;
(new_data2_addr - OLD_SECTION_H (old_data_index).sh_addr);
new_base_offset = OLD_SECTION_H (old_data_index).sh_offset +
(old_base_addr - OLD_SECTION_H (old_data_index).sh_addr);
- new_offsets_shift = new_bss_addr -
- ((old_base_addr & ~0xfff) + ((old_base_addr & 0xfff) ? 0x1000 : 0));
+ new_offsets_shift = new_bss_addr - (old_base_addr & ~0xfff) +
+ ((old_base_addr & 0xfff) ? 0x1000 : 0);
#ifdef DEBUG
fprintf (stderr, "old_bss_index %d\n", old_bss_index);
/* Fix up a new program header. Extend the writable data segment so
that the bss area is covered too. Find that segment by looking
- for a segment that ends just before the .bss area. Make sure
- that no segments are above the new .data2. Put a loop at the end
- to adjust the offset and address of any segment that is above
- data2, just in case we decide to allow this later. */
+ for one that starts before and ends after the .bss and it PT_LOADable.
+ Put a loop at the end to adjust the offset and address of any segment
+ that is above data2, just in case we decide to allow this later. */
+ oldbss = &OLD_SECTION_H(old_bss_index);
for (n = new_file_h->e_phnum - 1; n >= 0; n--)
{
/* Compute maximum of all requirements for alignment of section. */
- int alignment = (NEW_PROGRAM_H (n)).p_align;
- if ((OLD_SECTION_H (old_bss_index)).sh_addralign > alignment)
- alignment = OLD_SECTION_H (old_bss_index).sh_addralign;
-
- /* Supposedly this condition is okay for the SGI. */
-#if 0
- if (NEW_PROGRAM_H (n).p_vaddr + NEW_PROGRAM_H (n).p_filesz > old_base_addr)
- fatal ("Program segment above .bss in %s\n", old_name);
+ l_Elf_Phdr * ph = (l_Elf_Phdr *)((byte *) new_program_h +
+ new_file_h->e_phentsize*(n));
+#ifdef DEBUG
+ printf ("%d @ %0x + %0x against %0x + %0x",
+ n, ph->p_vaddr, ph->p_memsz,
+ oldbss->sh_addr, oldbss->sh_size);
+#endif
+ if ((ph->p_type == PT_LOAD) &&
+ (ph->p_vaddr <= oldbss->sh_addr) &&
+ ((ph->p_vaddr + ph->p_memsz)>=(oldbss->sh_addr + oldbss->sh_size))) {
+ ph->p_filesz += new_offsets_shift;
+ ph->p_memsz = ph->p_filesz;
+#ifdef DEBUG
+ puts (" That's the one!");
+ fflush (stdout);
+#endif
+ break;
+ }
+#ifdef DEBUG
+ putchar ('\n');
+ fflush (stdout);
#endif
-
- if (NEW_PROGRAM_H (n).p_type == PT_LOAD
- && (round_up ((NEW_PROGRAM_H (n)).p_vaddr
- + (NEW_PROGRAM_H (n)).p_filesz,
- alignment)
- == round_up (old_base_addr, alignment)))
- break;
}
if (n < 0)
fatal ("Couldn't find segment next to %s in %s\n",
old_sbss_index == -1 ? ".sbss" : ".bss", old_name);
- NEW_PROGRAM_H (n).p_filesz += new_offsets_shift;
- NEW_PROGRAM_H (n).p_memsz = NEW_PROGRAM_H (n).p_filesz;
#if 1 /* Maybe allow section after data2 - does this ever happen? */
for (n = new_file_h->e_phnum - 1; n >= 0; n--)
version, we need to bootstrap our heap and .bss section into our
address space before we can actually hand off control to the startup
code supplied by NT (primarily because that code relies upon malloc ()). */
+
+/* **********************
+ Hackers please remember, this _start() thingy is *not* called neither
+ when dumping portably, nor when running from temacs! Do not put
+ significant XEmacs initialization here!
+ ********************** */
+
void
_start (void)
{
- char * p;
extern void mainCRTStartup (void);
/* Cache system info, e.g., the NT page size. */
exit (1);
}
- /* To allow profiling, make sure executable_path names the .exe
- file, not the file created by the profiler */
- p = strrchr (executable_path, '\\');
- strcpy (p+1, PATH_PROGNAME ".exe");
+ /* #### This is super-bogus. When I rename xemacs.exe,
+ the renamed file still loads its heap from xemacs.exe --kkm */
+#if 0
+ {
+ /* To allow profiling, make sure executable_path names the .exe
+ file, not the file created by the profiler */
+ char *p = strrchr (executable_path, '\\');
+ strcpy (p+1, PATH_PROGNAME ".exe");
+ }
+#endif
recreate_heap (executable_path);
heap_state = HEAP_LOADED;
}
+ /* #### This is bogus, too. _fmode is set to different values
+ when we run `xemacs' and `temacs run-emacs'. The sooner we
+ hit and fix all the weirdities this causes us, the better --kkm */
+#if 0
/* The default behavior is to treat files as binary and patch up
text files appropriately, in accordance with the MSDOS code. */
_fmode = O_BINARY;
+#endif
#if 0
/* This prevents ctrl-c's in shells running while we're suspended from
window_truncation_on (struct window *w)
{
/* Minibuffer windows are never truncated.
- ### is this the right way ? */
+ #### is this the right way ? */
if (MINI_WINDOW_P (w))
return 0;
new_buffer = Fother_buffer (obj, Qnil, Qnil);
if (NILP (new_buffer))
new_buffer = Fget_buffer_create (QSscratch);
- Fset_window_buffer (w, new_buffer);
+ Fset_window_buffer (w, new_buffer, Qnil);
if (EQ (w, Fselected_window (Qnil)))
Fset_buffer (p->buffer);
}
/* Otherwise show a different buffer in the
window. */
p->dedicated = Qnil;
- Fset_window_buffer (w, another_buffer);
+ Fset_window_buffer (w, another_buffer, Qnil);
if (EQ (w, Fselected_window (Qnil)))
Fset_buffer (p->buffer);
}
window_min_height = MIN_SAFE_WINDOW_HEIGHT;
}
+static int
+frame_min_height (struct frame *frame)
+{
+ /* For height, we have to see whether the frame has a minibuffer, and
+ whether it wants a modeline. */
+ return (FRAME_MINIBUF_ONLY_P (frame) ? MIN_SAFE_WINDOW_HEIGHT - 1
+ : (! FRAME_HAS_MINIBUF_P (frame)) ? MIN_SAFE_WINDOW_HEIGHT
+ : 2 * MIN_SAFE_WINDOW_HEIGHT - 1);
+}
+
+/* Return non-zero if both frame sizes are less than or equal to
+ minimal allowed values. ROWS and COLS are in characters */
+int
+frame_size_valid_p (struct frame *frame, int rows, int cols)
+{
+ return (rows >= frame_min_height (frame)
+ && cols >= MIN_SAFE_WINDOW_WIDTH);
+}
+
+/* Return non-zero if both frame sizes are less than or equal to
+ minimal allowed values. WIDTH and HEIGHT are in pixels */
+int
+frame_pixsize_valid_p (struct frame *frame, int width, int height)
+{
+ int rows, cols;
+ pixel_to_real_char_size (frame, width, height, &cols, &rows);
+ return frame_size_valid_p (frame, rows, cols);
+}
+
/* If *ROWS or *COLS are too small a size for FRAME, set them to the
minimum allowable size. */
void
check_frame_size (struct frame *frame, int *rows, int *cols)
{
- /* For height, we have to see whether the frame has a minibuffer, and
- whether it wants a modeline. */
- int min_height =
- (FRAME_MINIBUF_ONLY_P (frame) ? MIN_SAFE_WINDOW_HEIGHT - 1
- : (! FRAME_HAS_MINIBUF_P (frame)) ? MIN_SAFE_WINDOW_HEIGHT
- : 2 * MIN_SAFE_WINDOW_HEIGHT - 1);
+ int min_height = frame_min_height (frame);
if (*rows < min_height)
*rows = min_height;
\f
static int window_select_count;
-DEFUN ("set-window-buffer", Fset_window_buffer, 2, 2, 0, /*
+DEFUN ("set-window-buffer", Fset_window_buffer, 2, 3, 0, /*
Make WINDOW display BUFFER as its contents.
BUFFER can be a buffer or buffer name.
+
+With non-nil optional argument `norecord', do not modify the
+global or per-frame buffer ordering.
*/
- (window, buffer))
+ (window, buffer, norecord))
{
Lisp_Object tem;
struct window *w = decode_window (window);
recompute_all_cached_specifiers_in_window (w);
if (EQ (window, Fselected_window (Qnil)))
{
+ if (NILP (norecord))
+ Frecord_buffer (buffer);
+
Fset_buffer (buffer);
}
return Qnil;
/* do this last (after the window is completely initialized and
the mirror-dirty flag is set) so that specifier recomputation
caused as a result of this will work properly and not abort. */
- Fset_window_buffer (new, o->buffer);
+ Fset_window_buffer (new, o->buffer, Qt);
return new;
}
\f
if (INTP (Vwindow_pixel_scroll_increment))
fheight = XINT (Vwindow_pixel_scroll_increment);
- else if (!NILP (Vwindow_pixel_scroll_increment));
+ else if (!NILP (Vwindow_pixel_scroll_increment))
default_face_height_and_width (window, &fheight, &fwidth);
if (Dynarr_length (dla) >= 1)
w->start_at_line_beg = beginning_of_line_p (b, startp);
MARK_WINDOWS_CHANGED (w);
+ /* #### Scroll back by less than a line. This code was
+ originally for scrolling over large pixmaps and it
+ loses when a line being *exposed* at the top of the
+ window is bigger than the current one. However, for
+ pixel based scrolling in general we can guess that
+ the line we are going to display is probably the same
+ size as the one we are on. In that instance we can
+ have a reasonable stab at a suitable top clip. Fixing
+ this properly is hard (and probably slow) as we would
+ have to call redisplay to figure out the exposed line
+ size. */
+ if (!NILP (Vwindow_pixel_scroll_increment)
+ && Dynarr_length (dla) >= (1 + modeline)
+ && dl->ascent + fheight * value > 0)
+ {
+ WINDOW_TEXT_TOP_CLIP (w) = (dl->ascent + fheight * value);
+ }
+
if (!point_would_be_visible (w, startp, XINT (point)))
{
Bufpos new_point;
/* Synched up with: FSF 19.30. */
-#ifndef _XEMACS_WINDOW_H_
-#define _XEMACS_WINDOW_H_
+#ifndef INCLUDED_window_h_
+#define INCLUDED_window_h_
#include "redisplay.h"
#ifdef HAVE_SCROLLBARS
EXFUN (Freplace_buffer_in_windows, 1);
EXFUN (Fselect_window, 2);
EXFUN (Fselected_window, 1);
-EXFUN (Fset_window_buffer, 2);
+EXFUN (Fset_window_buffer, 3);
EXFUN (Fset_window_hscroll, 2);
EXFUN (Fset_window_point, 2);
EXFUN (Fset_window_start, 3);
int buffer_window_count (struct buffer *b, struct frame *f);
int buffer_window_mru (struct window *w);
void check_frame_size (struct frame *frame, int *rows, int *cols);
+int frame_pixsize_valid_p (struct frame *frame, int width, int height);
+int frame_size_valid_p (struct frame *frame, int rows, int cols);
struct window *decode_window (Lisp_Object window);
struct window *find_window_by_pixel_pos (int pix_x, int pix_y, Lisp_Object win);
#endif /* emacs */
-#endif /* _XEMACS_WINDOW_H_ */
+#endif /* INCLUDED_window_h_ */
/* Written by jwz, 14 jun 93 */
-#ifndef _XGCCACHE_H_
-#define _XGCCACHE_H_
+#ifndef INCLUDED_xgccache_h_
+#define INCLUDED_xgccache_h_
struct gc_cache;
struct gc_cache *make_gc_cache (Display *, Window);
void free_gc_cache (struct gc_cache *cache);
GC gc_cache_lookup (struct gc_cache *, XGCValues *, unsigned long mask);
-#endif /* _XGCCACHE_H_ */
+#endif /* INCLUDED_xgccache_h_ */
/* Synched up with: Not in FSF. */
+#ifndef INCLUDED_xintrinsic_h_
+#define INCLUDED_xintrinsic_h_
+
#undef CONST /* X11R4 header thinks it can define CONST */
#include <X11/Intrinsic.h>
#else
# define CONST const
#endif
+
+#endif /* INCLUDED_xintrinsic_h_ */
/* Synched up with: Not in FSF. */
+#ifndef INCLUDED_xintrinsicp_h_
+#define INCLUDED_xintrinsicp_h_
+
#undef CONST /* X11R4 header thinks it can define CONST */
#include <X11/Intrinsic.h>
#else
# define CONST const
#endif
+
+#endif /* INCLUDED_xintrinsicp_h_ */
/* ManagerP.h doesn't exist in old versions of Motif; the stuff is
in XmP.h instead */
+#ifndef INCLUDED_xmmanagerp_h_
+#define INCLUDED_xmmanagerp_h_
+
#include <Xm/Xm.h> /* to get XmVersion */
#if (XmVersion >= 1002)
# include <Xm/ManagerP.h>
#else
# include <Xm/XmP.h>
#endif
+
+#endif /* INCLUDED_xmmanagerp_h_ */
/* PrimitiveP.h doesn't exist in old versions of Motif; the stuff is
in XmP.h instead */
+#ifndef INCLUDED_xmprimitivep_h_
+#define INCLUDED_xmprimitivep_h_
+
#include <Xm/Xm.h> /* to get XmVersion */
#if (XmVersion >= 1002)
# include <Xm/PrimitiveP.h>
#else
# include <Xm/XmP.h>
#endif
+
+#endif /* INCLUDED_xmprimitivep_h_ */
/* Synched up with: Not in FSF. */
+#ifndef INCLUDED_xmu_h_
+#define INCLUDED_xmu_h_
+
#ifdef HAVE_XMU
# include <X11/Xmu/CharSet.h>
#define AssignMin(x, y) {if ((y) < (x)) x = (y);}
typedef enum {XtorientHorizontal, XtorientVertical} XtOrientation;
-#endif
+#endif /* HAVE_XMU */
+#endif /* INCLUDED_xmu_h_ */
+2000-02-07 Martin Buchholz <martin@xemacs.org>
+
+ * XEmacs 21.2.28 is released.
+
+2000-02-07 Martin Buchholz <martin@xemacs.org>
+
+ * automated/lisp-tests.el: Add plist manipulation tests.
+
+2000-02-02 Martin Buchholz <martin@xemacs.org>
+
+ * automated/symbol-tests.el: Crashes fixed, so resurrect
+ makunbound test for dontusethis-set-symbol-value-handler.
+ Add more dontusethis-set-symbol-value-handler tests.
+ Should fix any lingering problems with gnus playing with
+ pathname-coding-system.
+
+2000-01-25 Martin Buchholz <martin@xemacs.org>
+
+ * mule-tests.el: Add coding-system tests.
+
2000-01-18 Martin Buchholz <martin@xemacs.org>
* XEmacs 21.2.27 is released.
(Assert (eq (preceding-char) 0))
(Assert (eq (following-char) ?f))
)
+
+;;-----------------------------------------------------
+;; Test plist manipulation functions.
+;;-----------------------------------------------------
+(let ((sym (make-symbol "test-symbol")))
+ (Assert (eq t (get* sym t t)))
+ (Assert (eq t (get sym t t)))
+ (Assert (eq t (getf nil t t)))
+ (Assert (eq t (plist-get nil t t)))
+ (put sym 'bar 'baz)
+ (Assert (eq 'baz (get sym 'bar)))
+ (Assert (eq 'baz (getf '(bar baz) 'bar)))
+ (Assert (eq 'baz (getf (symbol-plist sym) 'bar)))
+ (Assert (eq 2 (getf '(1 2) 1)))
+ )
emacs_is_beta=t
emacs_major_version=21
emacs_minor_version=2
-emacs_beta_version=27
-xemacs_codename="Hera"
+emacs_beta_version=28
+xemacs_codename="Hermes"
infodock_major_version=4
infodock_minor_version=0
infodock_build_version=8