diff options
| author | Miles Bader <miles@gnu.org> | 2008-01-30 07:57:28 +0000 |
|---|---|---|
| committer | Miles Bader <miles@gnu.org> | 2008-01-30 07:57:28 +0000 |
| commit | d235ca2ff8fab139ce797757fcb159d1e28fa7e0 (patch) | |
| tree | 96c5cd1a06a0d9dc26e8470c6eabfc032c0046f3 /src | |
| parent | 3709a060f679dba14df71ae64a0035fa2b5b3106 (diff) | |
| parent | 02cbe062bee38a6705bafb1699d77e3c44cfafcf (diff) | |
| download | emacs-d235ca2ff8fab139ce797757fcb159d1e28fa7e0.tar.gz | |
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-324
Diffstat (limited to 'src')
52 files changed, 676 insertions, 2163 deletions
diff --git a/src/.gdbinit b/src/.gdbinit index be7473f0a82..2242df6e428 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -1,5 +1,6 @@ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. # # This file is part of GNU Emacs. # diff --git a/src/ChangeLog b/src/ChangeLog index e942fc32eeb..0645765cdde 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,215 @@ +2008-01-29 Miles Bader <miles@gnu.org> + + * macterm.c (XTset_vertical_scroll_bar): Fix merge mistake. + +2008-01-28 Jason Rumney <jasonr@gnu.org> + + * w32.c (stat): Don't double check for networked drive. + +2008-01-28 Stefan Monnier <monnier@iro.umontreal.ca> + + * window.c (run_window_configuration_change_hook): New function. + Code extracted from set_window_buffer. Set the selected frame. + (set_window_buffer): Use it. + * window.h (run_window_configuration_change_hook): Declare. + * dispnew.c (change_frame_size_1): Use it instead of set-window-buffer. + + * keyboard.c (read_char): Yet another int/Lisp_Object mixup (YAILOM). + +2008-01-27 Dan Nicolaescu <dann@ics.uci.edu> + + * Makefile.in: Remove references to unused macros. + +2008-01-26 Eli Zaretskii <eliz@gnu.org> + + * w32.c (g_b_init_get_sid_sub_authority) + (g_b_init_get_sid_sub_authority_count): New static variables. + (GetSidSubAuthority_Proc, GetSidSubAuthorityCount_Proc): New typedefs. + (get_sid_sub_authority, get_sid_sub_authority_count): New functions. + (init_user_info): Use them to retrieve uid and gid. + Use 500/513, the Windows defaults, as Administrator's uid/gid. + (fstat): Use pw_uid and pw_gid from the_passwd structure for + st_uid and st_gid of the file. + +2008-01-26 Jason Rumney <jasonr@gnu.org> + + * w32.c (logon_network_drive): New function. + (stat): Use it. + +2008-01-26 Chong Yidong <cyd@stupidchicken.com> + + * xdisp.c (pos_visible_p): Handle the case where charpos falls on + invisible text covered with an ellipsis. + +2008-01-25 Richard Stallman <rms@gnu.org> + + * xdisp.c (redisplay_window): Run Qwindow_text_change_functions and + jump back to beginning. Move some other initializations after that. + (Qwindow_text_change_functions, Vwindow_text_change_functions): + New variables. + (syms_of_xdisp): Init them. + + * keyboard.c (read_char): Restore echo_message_buffer after redisplay. + + * buffer.c (reset_buffer_local_variables): + Implement `permanent-local-hook'. + (Qpermanent_local_hook): New variable. + (syms_of_buffer): Init and staticpro it. + +2008-01-25 Michael Albinus <michael.albinus@gmx.de> + + * dbusbind.c (xd_retrieve_arg): Pacify GCC on x86_64 GNU/Linux. + +2008-01-25 Thien-Thi Nguyen <ttn@gnuvola.org> + + * fns.c (Fclrhash): Return TABLE. + +2008-01-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (x_scroll_bar_create): Initialize bar->redraw_needed_p. + (XTset_vertical_scroll_bar): Redraw scroll bar if bar->redraw_needed_p + is set even without positional changes. + (x_scroll_bar_clear): Set bar->redraw_needed_p. + + * macterm.h (struct scroll_bar): New member `redraw_needed_p'. + +2008-01-23 Jason Rumney <jasonr@gnu.org> + + * xterm.c (handle_one_xevent): Revert to counting chars not bytes. + + * w32term.c (w32_read_socket) <WM_CHAR>: Decode characters outside + the unicode range available in MULE by locale-coding-system. + Improve dbcs lead byte detection. Set event timestamp and modifiers + earlier. + +2008-01-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * mac.c (mac_emacs_pid) [MAC_OSX]: New variable. + [MAC_OSX] (init_mac_osx_environment): Initialize it. + [MAC_OSX] (mac_try_close_socket) [SELECT_USE_CFSOCKET]: Return 0 + when used on child processes. + +2008-01-21 Michael Albinus <michael.albinus@gmx.de> + + * dbusbind.c (Fdbus_method_return_internal): Rename from + Fdbus_method_return. + (Fdbus_unregister_object): Move to dbus.el. + (Fdbus_call_method, Fdbus_method_return_internal) + (Fdbus_send_signal): Improve debug messages. + +2008-01-20 Martin Rudalics <rudalics@gmx.at> + + * undo.c (undo_inhibit_record_point): New variable. + (syms_of_undo): Initialize it. + (record_point): Don't record point when undo_inhibit_record_point + is set. + +2008-01-19 Stefan Monnier <monnier@iro.umontreal.ca> + + * process.c (list_processes_1): Don't use SCHARS on a nil buffer name. + + * xdisp.c (Qauto_hscroll_mode): New var. + (syms_of_xdisp): Initialize it. + (hscroll_window_tree): Use it to lookup `auto-hscroll-mode' in each + window's buffer. + (hscroll_windows): Don't check automatic_hscrolling_p here. + + * window.c (set_window_buffer): Don't unnecessarily reset hscroll and + vscroll if we're setting window-buffer to the value it already has. + +2008-01-18 Dan Nicolaescu <dann@ics.uci.edu> + + * m/intel386.h: Remove references to XENIX. + +2008-01-17 Andreas Schwab <schwab@suse.de> + + * m/amdx86-64.h (START_FILES, LIB_STANDARD): Use HAVE_LIB64_DIR + instead of HAVE_X86_64_LIB64_DIR. + * m/ibms390x.h (START_FILES, LIB_STANDARD): Likewise. + +2008-01-17 Glenn Morris <rgm@gnu.org> + + * m/ibms390x.h (START_FILES, LIB_STANDARD): Adjust value according + to HAVE_X86_64_LIB64_DIR. + +2008-01-16 Dan Nicolaescu <dann@ics.uci.edu> + + * s/irix3-3.h: + * s/irix4-0.h: + * s/386-ix.h: + * s/domain.h: + * s/hpux9-x11r4.h: + * s/hpux9shxr4.h: Remove files for systems no longer supported. + + * sysdep.c: Remove code containing references to symbols defined + by unsupported systems. + +2008-01-16 Glenn Morris <rgm@gnu.org> + + * coding.c (select-safe-coding-system-function): Doc fix. + +2008-01-15 Glenn Morris <rgm@gnu.org> + + * config.in: Revert 2008-01-13 change: this is a generated file. + +2008-01-13 Tom Tromey <tromey@redhat.com> + + * lisp.h: Fix typo. + +2008-01-13 Dan Nicolaescu <dann@ics.uci.edu> + + * m/sequent-ptx.h: + * m/sequent.h: + * s/ptx.h: + * s/ptx4-2.h: + * s/ptx4.h: Remove files for systems no longer supported. + + * callproc.c (Fcall_process): Fix previous change. + +2008-01-13 Dan Nicolaescu <dann@ics.uci.edu> + + * unexsunos4.c: Remove file, system not supported anymore. + + * src/m/mips.h: + * src/m/intel386.h: + * callproc.c: + * config.in: + * ecrt0.c: + * emacs.c: + * fileio.c: + * frame.c: + * getpagesize.h: + * keyboard.c: + * lread.c: + * process.c: + * puresize.h: + * sysdep.c: + * systty.h: + * syswait.h: + * unexec.c: + * xdisp.c: + * alloc.c: Remove code containing references to symbols defined by + unsupported systems. + +2008-01-11 Kenichi Handa <handa@ni.aist.go.jp> + + * coding.c (detect_coding_mask): Fix previous change. + +2008-01-10 Chong Yidong <cyd@stupidchicken.com> + + * process.c (wait_reading_process_output): Check for window + changes caused by timers. + +2008-01-09 Kenichi Handa <handa@ni.aist.go.jp> + + * coding.c (detect_coding_iso2022): New arg + latin_extra_code_state. Allow Latin extra codes only + when *latin_extra_code_state is nonzero. + (detect_coding_mask): If there is a NULL byte, detect the encoding + as UTF-16 or binary. If Latin extra codes exist, detect the + encoding as ISO-2022 only when there's no other proper encoding is + found. + 2008-01-08 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> * frame.c (Fmake_terminal_frame): Use #ifdef MAC_OS8 instead of @@ -1836,8 +2048,7 @@ 2007-08-29 Dan Nicolaescu <dann@ics.uci.edu> * callproc.c (child_setup, getenv_internal): Use the - display-environment-variable and term-environment-variable frame - params. + display-environment-variable and term-environment-variable frame params. (set_initial_environment): Initialise Vprocess_environment. * config.in: Disable multi-keyboard support on a mac. diff --git a/src/ChangeLog.10 b/src/ChangeLog.10 index b7187263257..577f1be615d 100644 --- a/src/ChangeLog.10 +++ b/src/ChangeLog.10 @@ -27916,8 +27916,8 @@ See ChangeLog.9 for earlier changes. ;; add-log-time-zone-rule: t ;; End: - Copyright (C) 2001, 2002, 2003, 2004, 2005, - 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, + 2008 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/Makefile.in b/src/Makefile.in index d0943e69eea..9435a88a1ec 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1032,11 +1032,6 @@ temacs${EXEEXT}: MAKE_PARALLEL $(LOCALCPP) $(STARTFILES) stamp-oldxmenu ${obj} $ prefix-args${EXEEXT}: prefix-args.c $(config_h) $(CC) $(ALL_CFLAGS) $(LDFLAGS) ${srcdir}/prefix-args.c -o prefix-args -/* Do not lose if this was not defined. */ -#ifndef OLDXMENU_OPTIONS -#define OLDXMENU_OPTIONS -#endif - #if defined (HAVE_X_WINDOWS) && defined (HAVE_X11) && defined (HAVE_MENUS) && ! defined (HAVE_GTK) /* We use stamp-xmenu with these two deps @@ -1082,7 +1077,7 @@ C_SWITCH_X_SITE_1 = C_SWITCH_X_SITE C_SWITCH_X_MACHINE_1 = C_SWITCH_X_MACHINE C_SWITCH_X_SYSTEM_1 = C_SWITCH_X_SYSTEM really-oldXMenu: - cd ${oldXMenudir}; ${MAKE} ${MFLAGS} OLDXMENU_OPTIONS \ + cd ${oldXMenudir}; ${MAKE} ${MFLAGS} \ CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}' \ "C_SWITCH_X_SITE=$(C_SWITCH_X_SITE_1)" \ "C_SWITCH_X_MACHINE=$(C_SWITCH_X_MACHINE_1)" \ diff --git a/src/alloc.c b/src/alloc.c index be75fc47cbf..c1ebd0cf2a3 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -1928,11 +1928,7 @@ allocate_string () consing_since_gc += sizeof *s; #ifdef GC_CHECK_STRING_BYTES - if (!noninteractive -#ifdef MAC_OS8 - && current_sblock -#endif - ) + if (!noninteractive) { if (++check_string_bytes_count == 200) { diff --git a/src/buffer.c b/src/buffer.c index 5958c1f91be..c18e3ad8ddf 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -153,6 +153,7 @@ Lisp_Object Qucs_set_table_for_input; int inhibit_modification_hooks; Lisp_Object Qfundamental_mode, Qmode_class, Qpermanent_local; +Lisp_Object Qpermanent_local_hook; Lisp_Object Qprotected_field; @@ -762,13 +763,38 @@ reset_buffer_local_variables (b, permanent_too) b->local_var_alist = Qnil; else { - Lisp_Object tmp, last = Qnil; + Lisp_Object tmp, prop, last = Qnil; for (tmp = b->local_var_alist; CONSP (tmp); tmp = XCDR (tmp)) if (CONSP (XCAR (tmp)) && SYMBOLP (XCAR (XCAR (tmp))) - && !NILP (Fget (XCAR (XCAR (tmp)), Qpermanent_local))) - /* If permanent-local, keep it. */ - last = tmp; + && !NILP (prop = Fget (XCAR (XCAR (tmp)), Qpermanent_local))) + { + /* If permanent-local, keep it. */ + last = tmp; + if (EQ (prop, Qpermanent_local_hook)) + { + /* This is a partially permanent hook variable. + Preserve only the elements that want to be preserved. */ + Lisp_Object list, newlist; + list = XCDR (XCAR (tmp)); + if (!CONSP (list)) + newlist = list; + else + for (newlist = Qnil; CONSP (list); list = XCDR (list)) + { + Lisp_Object elt = XCAR (list); + /* Preserve element ELT if it's t, + if it is a function with a `permanent-local-hook' property, + or if it's not a symbol. */ + if (! SYMBOLP (elt) + || EQ (elt, Qt) + || !NILP (Fget (elt, Qpermanent_local_hook))) + newlist = Fcons (elt, newlist); + } + XSETCDR (XCAR (tmp), Fnreverse (newlist)); + } + } + /* Delete this local variable. */ else if (NILP (last)) b->local_var_alist = XCDR (tmp); else @@ -5308,6 +5334,8 @@ syms_of_buffer () staticpro (&Vbuffer_alist); staticpro (&Qprotected_field); staticpro (&Qpermanent_local); + Qpermanent_local_hook = intern ("permanent-local-hook"); + staticpro (&Qpermanent_local_hook); staticpro (&Qkill_buffer_hook); Qoverlayp = intern ("overlayp"); staticpro (&Qoverlayp); @@ -5335,6 +5363,7 @@ syms_of_buffer () staticpro (&Qbefore_change_functions); Qafter_change_functions = intern ("after-change-functions"); staticpro (&Qafter_change_functions); + /* The next one is initialized in init_buffer_once. */ staticpro (&Qucs_set_table_for_input); Qkill_buffer_query_functions = intern ("kill-buffer-query-functions"); @@ -5575,7 +5604,8 @@ its hooks should not expect certain variables such as DEFVAR_PER_BUFFER ("mode-name", ¤t_buffer->mode_name, Qnil, - doc: /* Pretty name of current buffer's major mode (a string). */); + doc: /* Pretty name of current buffer's major mode. +Usually a string. See `mode-line-format' for other possible forms. */); DEFVAR_PER_BUFFER ("local-abbrev-table", ¤t_buffer->abbrev_table, Qnil, doc: /* Local (mode-specific) abbrev table of current buffer. */); diff --git a/src/callproc.c b/src/callproc.c index 4a320bf0b3d..a3b7b7afa4a 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -160,14 +160,14 @@ Lisp_Object call_process_cleanup (fdpid) Lisp_Object fdpid; { -#if defined (MSDOS) || defined (MAC_OS8) +#if defined (MSDOS) /* for MSDOS fdpid is really (fd . tempfile) */ register Lisp_Object file; file = Fcdr (fdpid); emacs_close (XFASTINT (Fcar (fdpid))); if (strcmp (SDATA (file), NULL_DEVICE) != 0) unlink (SDATA (file)); -#else /* not MSDOS and not MAC_OS8 */ +#else /* not MSDOS */ register int pid = XFASTINT (Fcdr (fdpid)); if (call_process_exited) @@ -244,10 +244,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) char *outf, *tempfile; int outfilefd; #endif -#ifdef MAC_OS8 - char *tempfile; - int outfilefd; -#endif #if 0 int mask; #endif @@ -471,32 +467,11 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) fd[1] = outfilefd; #endif /* MSDOS */ -#ifdef MAC_OS8 - /* Since we don't have pipes on the Mac, create a temporary file to - hold the output of the subprocess. */ - tempfile = (char *) alloca (SBYTES (Vtemp_file_name_pattern) + 1); - bcopy (SDATA (Vtemp_file_name_pattern), tempfile, - SBYTES (Vtemp_file_name_pattern) + 1); - - mktemp (tempfile); - - outfilefd = creat (tempfile, S_IREAD | S_IWRITE); - if (outfilefd < 0) - { - close (filefd); - report_file_error ("Opening process output file", - Fcons (build_string (tempfile), Qnil)); - } - fd[0] = filefd; - fd[1] = outfilefd; -#endif /* MAC_OS8 */ - if (INTEGERP (buffer)) fd[1] = emacs_open (NULL_DEVICE, O_WRONLY, 0), fd[0] = -1; else { #ifndef MSDOS -#ifndef MAC_OS8 errno = 0; if (pipe (fd) == -1) { @@ -504,7 +479,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) report_file_error ("Creating process pipe", Qnil); } #endif -#endif #if 0 /* Replaced by close_process_descs */ set_exclusive_use (fd[0]); @@ -562,52 +536,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) report_file_error ("Cannot redirect stderr", Fcons (error_file, Qnil)); } -#ifdef MAC_OS8 - { - /* Call run_mac_command in sysdep.c here directly instead of doing - a child_setup as for MSDOS and other platforms. Note that this - code does not handle passing the environment to the synchronous - Mac subprocess. */ - char *infn, *outfn, *errfn, *currdn; - - /* close these files so subprocess can write to them */ - close (outfilefd); - if (fd_error != outfilefd) - close (fd_error); - fd1 = -1; /* No harm in closing that one! */ - - infn = SDATA (infile); - outfn = tempfile; - if (NILP (error_file)) - errfn = NULL_DEVICE; - else if (EQ (Qt, error_file)) - errfn = outfn; - else - errfn = SDATA (error_file); - currdn = SDATA (current_dir); - pid = run_mac_command (new_argv, currdn, infn, outfn, errfn); - - /* Record that the synchronous process exited and note its - termination status. */ - synch_process_alive = 0; - synch_process_retcode = pid; - if (synch_process_retcode < 0) /* means it couldn't be exec'ed */ - { - synchronize_system_messages_locale (); - synch_process_death = strerror (errno); - } - - /* Since CRLF is converted to LF within `decode_coding', we can - always open a file with binary mode. */ - fd[0] = open (tempfile, O_BINARY); - if (fd[0] < 0) - { - unlink (tempfile); - close (filefd); - report_file_error ("Cannot re-open temporary file", Qnil); - } - } -#else /* not MAC_OS8 */ #ifdef MSDOS /* MW, July 1993 */ /* Note that on MSDOS `child_setup' actually returns the child process exit status, not its PID, so we assign it to `synch_process_retcode' @@ -670,7 +598,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) if (fd_error >= 0) emacs_close (fd_error); #endif /* not MSDOS */ -#endif /* not MAC_OS8 */ environ = save_environ; @@ -704,14 +631,14 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) /* Enable sending signal if user quits below. */ call_process_exited = 0; -#if defined(MSDOS) || defined(MAC_OS8) +#if defined(MSDOS) /* MSDOS needs different cleanup information. */ record_unwind_protect (call_process_cleanup, Fcons (make_number (fd[0]), build_string (tempfile))); #else record_unwind_protect (call_process_cleanup, Fcons (make_number (fd[0]), make_number (pid))); -#endif /* not MSDOS and not MAC_OS8 */ +#endif /* not MSDOS */ if (BUFFERP (buffer)) diff --git a/src/coding.c b/src/coding.c index 32a775f3468..89a3090fa56 100644 --- a/src/coding.c +++ b/src/coding.c @@ -9810,7 +9810,9 @@ Function to call to select safe coding system for encoding a text. If set, this function is called to force a user to select a proper coding system which can encode the text in the case that a default -coding system used in each operation can't encode the text. +coding system used in each operation can't encode the text. The +function should take care that the buffer is not modified while +the coding system is being selected. The default value is `select-safe-coding-system' (which see). */); Vselect_safe_coding_system_function = Qnil; diff --git a/src/config.in b/src/config.in index d548fb77326..3451db40e0e 100644 --- a/src/config.in +++ b/src/config.in @@ -301,6 +301,9 @@ Boston, MA 02110-1301, USA. */ /* Define if you have <langinfo.h> and nl_langinfo(CODESET). */ #undef HAVE_LANGINFO_CODESET +/* Define to 1 if the directory /usr/lib64 exists. */ +#undef HAVE_LIB64_DIR + /* Define to 1 if you have the `com_err' library (-lcom_err). */ #undef HAVE_LIBCOM_ERR @@ -720,9 +723,6 @@ Boston, MA 02110-1301, USA. */ /* Define to 1 if you have the X11R6 or newer version of Xt. */ #undef HAVE_X11XTR6 -/* Define to 1 if the file /usr/lib64 exists. */ -#undef HAVE_X86_64_LIB64_DIR - /* Define to 1 if you have the Xaw3d library (-lXaw3d). */ #undef HAVE_XAW3D diff --git a/src/dbusbind.c b/src/dbusbind.c index 136cea9adb4..4bc48f3b6e9 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -33,11 +33,10 @@ Boston, MA 02110-1301, USA. */ /* Subroutines. */ Lisp_Object Qdbus_get_unique_name; Lisp_Object Qdbus_call_method; -Lisp_Object Qdbus_method_return; +Lisp_Object Qdbus_method_return_internal; Lisp_Object Qdbus_send_signal; Lisp_Object Qdbus_register_signal; Lisp_Object Qdbus_register_method; -Lisp_Object Qdbus_unregister_object; /* D-Bus error symbol. */ Lisp_Object Qdbus_error; @@ -595,10 +594,14 @@ xd_retrieve_arg (dtype, iter) case DBUS_TYPE_INT32: case DBUS_TYPE_UINT32: { + /* Assignment to EMACS_INT stops GCC whining about limited + range of data type. */ dbus_uint32_t val; + EMACS_INT val1; dbus_message_iter_get_basic (iter, &val); XD_DEBUG_MESSAGE ("%c %d", dtype, val); - return make_fixnum_or_float (val); + val1 = val; + return make_fixnum_or_float (val1); } case DBUS_TYPE_INT64: @@ -833,14 +836,22 @@ usage: (dbus-call-method BUS SERVICE PATH INTERFACE METHOD &rest ARGS) */) /* Append parameters to the message. */ for (i = 5; i < nargs; ++i) { - - XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); - XD_DEBUG_MESSAGE ("Parameter%d %s", - i-4, SDATA (format2 ("%s", args[i], Qnil))); - dtype = XD_OBJECT_TO_DBUS_TYPE (args[i]); if (XD_DBUS_TYPE_P (args[i])) - ++i; + { + XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); + XD_DEBUG_VALID_LISP_OBJECT_P (args[i+1]); + XD_DEBUG_MESSAGE ("Parameter%d %s %s", i-4, + SDATA (format2 ("%s", args[i], Qnil)), + SDATA (format2 ("%s", args[i+1], Qnil))); + ++i; + } + else + { + XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); + XD_DEBUG_MESSAGE ("Parameter%d %s", i-4, + SDATA (format2 ("%s", args[i], Qnil))); + } /* Check for valid signature. We use DBUS_TYPE_INVALID as indication that there is no parent type. */ @@ -872,7 +883,8 @@ usage: (dbus-call-method BUS SERVICE PATH INTERFACE METHOD &rest ARGS) */) { /* Loop over the parameters of the D-Bus reply message. Construct a Lisp list, which is returned by `dbus-call-method'. */ - while ((dtype = dbus_message_iter_get_arg_type (&iter)) != DBUS_TYPE_INVALID) + while ((dtype = dbus_message_iter_get_arg_type (&iter)) + != DBUS_TYPE_INVALID) { result = Fcons (xd_retrieve_arg (dtype, &iter), result); dbus_message_iter_next (&iter); @@ -880,7 +892,7 @@ usage: (dbus-call-method BUS SERVICE PATH INTERFACE METHOD &rest ARGS) */) } else { - /* No arguments: just return nil. */ + /* No arguments: just return nil. */ } /* Cleanup. */ @@ -895,12 +907,13 @@ usage: (dbus-call-method BUS SERVICE PATH INTERFACE METHOD &rest ARGS) */) RETURN_UNGCPRO (Fnreverse (result)); } -DEFUN ("dbus-method-return", Fdbus_method_return, Sdbus_method_return, +DEFUN ("dbus-method-return-internal", Fdbus_method_return_internal, + Sdbus_method_return_internal, 3, MANY, 0, - doc: /* Return to method SERIAL on the D-Bus BUS. + doc: /* Return for message SERIAL on the D-Bus BUS. This is an internal function, it shall not be used outside dbus.el. -usage: (dbus-method-return BUS SERIAL SERVICE &rest ARGS) */) +usage: (dbus-method-return-internal BUS SERIAL SERVICE &rest ARGS) */) (nargs, args) int nargs; register Lisp_Object *args; @@ -948,14 +961,22 @@ usage: (dbus-method-return BUS SERIAL SERVICE &rest ARGS) */) /* Append parameters to the message. */ for (i = 3; i < nargs; ++i) { - - XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); - XD_DEBUG_MESSAGE ("Parameter%d %s", - i-2, SDATA (format2 ("%s", args[i], Qnil))); - dtype = XD_OBJECT_TO_DBUS_TYPE (args[i]); if (XD_DBUS_TYPE_P (args[i])) - ++i; + { + XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); + XD_DEBUG_VALID_LISP_OBJECT_P (args[i+1]); + XD_DEBUG_MESSAGE ("Parameter%d %s %s", i-2, + SDATA (format2 ("%s", args[i], Qnil)), + SDATA (format2 ("%s", args[i+1], Qnil))); + ++i; + } + else + { + XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); + XD_DEBUG_MESSAGE ("Parameter%d %s", i-2, + SDATA (format2 ("%s", args[i], Qnil))); + } /* Check for valid signature. We use DBUS_TYPE_INVALID as indication that there is no parent type. */ @@ -1064,13 +1085,22 @@ usage: (dbus-send-signal BUS SERVICE PATH INTERFACE SIGNAL &rest ARGS) */) /* Append parameters to the message. */ for (i = 5; i < nargs; ++i) { - XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); - XD_DEBUG_MESSAGE ("Parameter%d %s", - i-4, SDATA (format2 ("%s", args[i], Qnil))); - dtype = XD_OBJECT_TO_DBUS_TYPE (args[i]); if (XD_DBUS_TYPE_P (args[i])) - ++i; + { + XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); + XD_DEBUG_VALID_LISP_OBJECT_P (args[i+1]); + XD_DEBUG_MESSAGE ("Parameter%d %s %s", i-4, + SDATA (format2 ("%s", args[i], Qnil)), + SDATA (format2 ("%s", args[i+1], Qnil))); + ++i; + } + else + { + XD_DEBUG_VALID_LISP_OBJECT_P (args[i]); + XD_DEBUG_MESSAGE ("Parameter%d %s", i-4, + SDATA (format2 ("%s", args[i], Qnil))); + } /* Check for valid signature. We use DBUS_TYPE_INVALID as indication that there is no parent type. */ @@ -1392,56 +1422,6 @@ used for composing the returning D-Bus message. */) return list2 (key, list3 (service, path, handler)); } -DEFUN ("dbus-unregister-object", Fdbus_unregister_object, - Sdbus_unregister_object, - 1, 1, 0, - doc: /* Unregister OBJECT from the D-Bus. -OBJECT must be the result of a preceding `dbus-register-signal' or -`dbus-register-method' call. It returns t if OBJECT has been -unregistered, nil otherwise. */) - (object) - Lisp_Object object; -{ - Lisp_Object value; - struct gcpro gcpro1; - - /* Check parameter. */ - if (!(CONSP (object) && (!NILP (CAR_SAFE (object))) - && CONSP (CDR_SAFE (object)))) - wrong_type_argument (intern ("D-Bus"), object); - - /* Find the corresponding entry in the hash table. */ - value = Fgethash (CAR_SAFE (object), Vdbus_registered_functions_table, Qnil); - - /* Loop over the registered functions. */ - while (!NILP (value)) - { - GCPRO1 (value); - - /* (car value) has the structure (UNAME SERVICE PATH HANDLER). - (cdr object) has the structure ((SERVICE PATH HANDLER) ...). */ - if (!NILP (Fequal (CDR_SAFE (CAR_SAFE (value)), - CAR_SAFE (CDR_SAFE (object))))) - { - /* Compute new hash value. */ - value = Fdelete (CAR_SAFE (value), - Fgethash (CAR_SAFE (object), - Vdbus_registered_functions_table, Qnil)); - if (NILP (value)) - Fremhash (CAR_SAFE (object), Vdbus_registered_functions_table); - else - Fputhash (CAR_SAFE (object), value, - Vdbus_registered_functions_table); - RETURN_UNGCPRO (Qt); - } - UNGCPRO; - value = CDR_SAFE (value); - } - - /* Return. */ - return Qnil; -} - void syms_of_dbusbind () @@ -1455,9 +1435,9 @@ syms_of_dbusbind () staticpro (&Qdbus_call_method); defsubr (&Sdbus_call_method); - Qdbus_method_return = intern ("dbus-method-return"); - staticpro (&Qdbus_method_return); - defsubr (&Sdbus_method_return); + Qdbus_method_return_internal = intern ("dbus-method-return-internal"); + staticpro (&Qdbus_method_return_internal); + defsubr (&Sdbus_method_return_internal); Qdbus_send_signal = intern ("dbus-send-signal"); staticpro (&Qdbus_send_signal); @@ -1471,10 +1451,6 @@ syms_of_dbusbind () staticpro (&Qdbus_register_method); defsubr (&Sdbus_register_method); - Qdbus_unregister_object = intern ("dbus-unregister-object"); - staticpro (&Qdbus_unregister_object); - defsubr (&Sdbus_unregister_object); - Qdbus_error = intern ("dbus-error"); staticpro (&Qdbus_error); Fput (Qdbus_error, Qerror_conditions, diff --git a/src/dispnew.c b/src/dispnew.c index d869fb53f73..a4219ead66d 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -6386,9 +6386,7 @@ change_frame_size_1 (f, newheight, newwidth, pretend, delay, safe) record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); - /* This isn't quite a no-op: it runs window-configuration-change-hook. */ - Fset_window_buffer (FRAME_SELECTED_WINDOW (f), - XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer, Qt); + run_window_configuration_change_hook (f); unbind_to (count, Qnil); } diff --git a/src/ecrt0.c b/src/ecrt0.c index 36f6caeceb9..41bd1c8b323 100644 --- a/src/ecrt0.c +++ b/src/ecrt0.c @@ -84,146 +84,6 @@ char **environ; static start1 (); #endif -#ifdef APOLLO -extern char *malloc(), *realloc(), *(*_libc_malloc) (), *(*_libc_realloc)(); -extern void free(), (*_libc_free) (); extern int main(); -std_$call void unix_$main(); - -_start() -{ - _libc_malloc = malloc; - _libc_realloc = realloc; - _libc_free = free; - unix_$main(main); /* no return */ -} -#endif /* APOLLO */ - -#if defined(orion) || defined(pyramid) || defined(celerity) || defined(ALLIANT) || defined(clipper) || defined(sps7) - -#if defined(sps7) && defined(V3x) - asm(" section 10"); - asm(" ds.b 0xb0"); -#endif - -#ifdef ALLIANT -/* _start must initialize _curbrk and _minbrk on the first startup; - when starting up after dumping, it must initialize them to what they were - before the dumping, since they are in the shared library and - are not dumped. See ADJUST_EXEC_HEADER in m-alliant.h. */ -extern unsigned char *_curbrk, *_minbrk; -extern unsigned char end; -unsigned char *_setbrk = &end; -#ifdef ALLIANT_2800 -unsigned char *_end = &end; -#endif -#endif - -#ifndef DUMMIES -#define DUMMIES -#endif - -_start (DUMMIES argc, argv, envp) - int argc; - char **argv, **envp; -{ -#ifdef ALLIANT -#ifdef ALLIANT_2800 - _curbrk = _end; - _minbrk = _end; -#else - _curbrk = _setbrk; - _minbrk = _setbrk; -#endif -#endif - - environ = envp; - - exit (main (argc, argv, envp)); -} - -#endif /* orion or pyramid or celerity or alliant or clipper */ - -#if defined (ns16000) && !defined (sequent) && !defined (UMAX) && !defined (CRT0_DUMMIES) - -_start () -{ -/* On 16000, _start pushes fp onto stack */ - start1 (); -} - -/* ignore takes care of skipping the fp value pushed in start. */ -static -start1 (ignore, argc, argv) - int ignore; - int argc; - register char **argv; -{ - environ = argv + argc + 1; - - if (environ == *argv) - environ--; - exit (main (argc, argv, environ)); -} -#endif /* ns16000, not sequent and not UMAX, and not the CRT0_DUMMIES method */ - -#ifdef UMAX -_start() -{ - asm(" exit [] # undo enter"); - asm(" .set exitsc,1"); - asm(" .set sigcatchall,0x400"); - - asm(" .globl _exit"); - asm(" .globl start"); - asm(" .globl __start"); - asm(" .globl _main"); - asm(" .globl _environ"); - asm(" .globl _sigvec"); - asm(" .globl sigentry"); - - asm("start:"); - asm(" br .xstart"); - asm(" .org 0x20"); - asm(" .double p_glbl,0,0xf00000,0"); - asm(" .org 0x30"); - asm(".xstart:"); - asm(" adjspb $8"); - asm(" movd 8(sp),0(sp) # argc"); - asm(" addr 12(sp),r0"); - asm(" movd r0,4(sp) # argv"); - asm("L1:"); - asm(" movd r0,r1"); - asm(" addqd $4,r0"); - asm(" cmpqd $0,0(r1) # null args term ?"); - asm(" bne L1"); - asm(" cmpd r0,0(4(sp)) # end of 'env' or 'argv' ?"); - asm(" blt L2"); - asm(" addqd $-4,r0 # envp's are in list"); - asm("L2:"); - asm(" movd r0,8(sp) # env"); - asm(" movd r0,@_environ # indir is 0 if no env ; not 0 if env"); - asm(" movqd $0,tos # setup intermediate signal handler"); - asm(" addr @sv,tos"); - asm(" movzwd $sigcatchall,tos"); - asm(" jsr @_sigvec"); - asm(" adjspb $-12"); - asm(" jsr @_main"); - asm(" adjspb $-12"); - asm(" movd r0,tos"); - asm(" jsr @_exit"); - asm(" adjspb $-4"); - asm(" addr @exitsc,r0"); - asm(" svc"); - asm(" .align 4 # sigvec arg"); - asm("sv:"); - asm(" .double sigentry"); - asm(" .double 0"); - asm(" .double 0"); - - asm(" .comm p_glbl,1"); -} -#endif /* UMAX */ - #ifdef CRT0_DUMMIES /* Define symbol "start": here; some systems want that symbol. */ @@ -295,21 +155,10 @@ start1 (CRT0_DUMMIES argc, xargv) asm (" global _start"); asm (" text"); asm ("_start:"); -#ifndef NU -#ifdef STRIDE - asm (" comm havefpu%,2"); -#else /* m68k, not STRIDE */ asm (" comm splimit%,4"); -#endif /* STRIDE */ asm (" global exit"); asm (" text"); -#ifdef STRIDE - asm (" trap &3"); - asm (" mov.w %d0,havefpu%"); -#else /* m68k, not STRIDE */ asm (" mov.l %d0,splimit%"); -#endif /* STRIDE */ -#endif /* not NU */ asm (" jsr start1"); asm (" mov.l %d0,(%sp)"); asm (" jsr exit"); @@ -319,32 +168,6 @@ start1 (CRT0_DUMMIES argc, xargv) #ifdef m68000 -#ifdef ISI68K -/* Added by ESM Sun May 24 12:44:02 1987 to get new ISI library to work */ -/* Edited by Ray Mon May 15 15:59:56 EST 1989 so we can compile with gcc */ -#if defined(BSD4_3) && !defined(__GNUC__) -static foo () { -#endif - asm (" .globl is68020"); - asm ("is68020:"); -#ifndef BSD4_3 - asm (" .long 0x00000000"); - asm (" .long 0xffffffff"); -/* End of stuff added by ESM */ -#endif - asm (" .text"); - asm (" .globl __start"); - asm ("__start:"); - asm (" .word 0"); - asm (" link a6,#0"); - asm (" jbsr _start1"); - asm (" unlk a6"); - asm (" rts"); -#if defined(BSD4_3) && !defined(__GNUC__) - } -#endif -#else /* not ISI68K */ - _start () { #ifdef sun @@ -353,7 +176,6 @@ _start () /* On 68000, _start pushes a6 onto stack */ start1 (); } -#endif /* not ISI68k */ #endif /* m68000 */ #endif /* m68k */ @@ -373,15 +195,6 @@ start1 (ignore, argc, xargv) if ((char *)environ == xargv) environ--; -#ifdef sun_68881 - asm(" jsr f68881_used"); -#endif -#ifdef sun_fpa - asm(" jsr ffpa_used"); -#endif -#ifdef sun_soft - asm(" jsr start_float"); -#endif exit (main (argc, argv, environ)); } @@ -503,85 +316,6 @@ char **argv_value; #endif /* new hp assembler */ #endif /* hp9000s300 */ -#ifdef GOULD - -/* startup code has to be in near text rather - than fartext as allocated by the C compiler. */ - asm(" .text"); - asm(" .align 2"); - asm(" .globl __start"); - asm(" .text"); - asm("__start:"); -/* setup base register b1 (function base). */ - asm(" .using b1,."); - asm(" tpcbr b1"); -/* setup base registers b3 through b7 (data references). */ - asm(" file basevals,b3"); -/* setup base register b2 (stack pointer); it should be - aligned on a 8-word boundary; but because it is pointing - to argc, its value should be remembered (in r5). */ - asm(" movw b2,r4"); - asm(" movw b2,r5"); - asm(" andw #~0x1f,r4"); - asm(" movw r4,b2"); -/* allocate stack frame to do some work. */ - asm(" subea 16w,b2"); -/* initialize signal catching for UTX/32 1.2; this is - necessary to make restart from saved image work. */ - asm(" movea sigcatch,r1"); - asm(" movw r1,8w[b2]"); - asm(" svc #1,#150"); -/* setup address of argc for start1. */ - asm(" movw r5,8w[b2]"); - asm(" func #1,_start1"); - asm(" halt"); -/* space for ld to store base register initial values. */ - asm(" .align 5"); - asm("basevals:"); - asm(" .word __base3,__base4,__base5,__base6,__base7"); - -static -start1 (xargc) - int *xargc; -{ - register int argc; - register char **argv; - - argc = *xargc; - argv = (char **)(xargc) + 1; - environ = argv + argc + 1; - - if (environ == argv) - environ--; - exit (main (argc, argv, environ)); - -} - -#endif /* GOULD */ - -#ifdef elxsi -#include <elxsi/argvcache.h> - -extern char **environ; -extern int errno; -extern void _init_doscan(), _init_iob(); -extern char end[]; -char *_init_brk = end; - -_start() -{ - environ = exec_cache.ac_envp; - brk (_init_brk); - errno = 0; - _init_doscan (); - _init_iob (); - _exit (exit (main (exec_cache.ac_argc, - exec_cache.ac_argv, - exec_cache.ac_envp))); -} -#endif /* elxsi */ - - #ifdef sparc asm (".global __start"); asm (".text"); diff --git a/src/emacs.c b/src/emacs.c index 1d6fb90fdb5..839582a3bf3 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1364,9 +1364,7 @@ main (argc, argv #ifdef CLASH_DETECTION init_filelock (); #endif -#ifndef MAC_OS8 init_atimer (); -#endif running_asynch_code = 0; /* Handle --unibyte and the EMACS_UNIBYTE envvar, @@ -1559,7 +1557,6 @@ main (argc, argv /* The basic levels of Lisp must come first. */ /* And data must come first of all for the sake of symbols like error-message. */ -#ifndef MAC_OS8 /* Called before init_window_once for Mac OS Classic. */ syms_of_data (); #endif @@ -1577,8 +1574,6 @@ main (argc, argv syms_of_casetab (); syms_of_callproc (); syms_of_category (); -#ifndef MAC_OS8 - /* Called before init_window_once for Mac OS Classic. */ syms_of_ccl (); #endif syms_of_character (); @@ -1600,11 +1595,8 @@ main (argc, argv syms_of_marker (); syms_of_minibuf (); syms_of_process (); -#ifndef MAC_OS8 - /* Called before init_window_once for Mac OS Classic. */ syms_of_search (); syms_of_frame (); -#endif syms_of_syntax (); syms_of_terminal (); syms_of_term (); @@ -1612,10 +1604,7 @@ main (argc, argv #ifdef HAVE_SOUND syms_of_sound (); #endif -#ifndef MAC_OS8 - /* Called before init_window_once for Mac OS Classic. */ syms_of_textprop (); -#endif syms_of_composite (); #ifdef VMS syms_of_vmsproc (); @@ -1700,10 +1689,7 @@ main (argc, argv init_editfns (); /* init_process uses Voperating_system_release. */ init_process (); /* init_display uses add_keyboard_wait_descriptor. */ -#ifndef MAC_OS8 - /* Called before init_window_once for Mac OS Classic. */ init_keyboard (); /* This too must precede init_sys_modes. */ -#endif #ifdef VMS init_vmsproc (); /* And this too. */ #endif /* VMS */ diff --git a/src/fileio.c b/src/fileio.c index 873d5d41d22..26020732160 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -68,10 +68,6 @@ extern int errno; #endif #endif -#ifdef APOLLO -#include <sys/time.h> -#endif - #include "lisp.h" #include "intervals.h" #include "buffer.h" @@ -814,12 +810,6 @@ directory_file_name (src, dst) /* 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 DOS_NT @@ -827,7 +817,6 @@ directory_file_name (src, dst) #endif ) dst[slen - 1] = 0; -#endif #ifdef DOS_NT CORRECT_DIR_SEPS (dst); #endif @@ -1802,10 +1791,6 @@ See also the function `substitute-in-file-name'.") while (*p) { if (p[0] == '/' && p[1] == '/' -#ifdef APOLLO - /* // at start of filename is meaningful on Apollo system. */ - && nm != p -#endif /* APOLLO */ ) nm = p + 1; if (p[0] == '/' && p[1] == '~') @@ -2037,10 +2022,6 @@ See also the function `substitute-in-file-name'.") *o++ = *p++; } else if (!strncmp (p, "//", 2) -#ifdef APOLLO - /* // at start of filename is meaningful in Apollo system. */ - && o != target -#endif /* APOLLO */ ) { o = target; @@ -2056,11 +2037,6 @@ See also the function `substitute-in-file-name'.") { while (o != target && *--o != '/') ; -#ifdef APOLLO - if (o == target + 1 && o[-1] == '/' && o[0] == '/') - ++o; - else -#endif /* APOLLO */ if (o == target && *o == '/') ++o; p += 3; @@ -2111,11 +2087,11 @@ search_embedded_absfilename (nm, endp) #endif /* VMS */ || IS_DIRECTORY_SEP (p[-1])) && file_name_absolute_p (p) -#if defined (APOLLO) || defined (WINDOWSNT) || defined(CYGWIN) +#if defined (WINDOWSNT) || defined(CYGWIN) /* // at start of file name is meaningful in Apollo, WindowsNT and Cygwin systems. */ && !(IS_DIRECTORY_SEP (p[0]) && p - 1 == nm) -#endif /* not (APOLLO || WINDOWSNT || CYGWIN) */ +#endif /* not (WINDOWSNT || CYGWIN) */ ) { for (s = p; *s && (!IS_DIRECTORY_SEP (*s) @@ -3801,12 +3777,7 @@ variable `last-coding-system-used' to the coding system actually used. */) } if (total < 0) #else -#ifndef APOLLO if (stat (SDATA (filename), &st) < 0) -#else - if ((fd = emacs_open (SDATA (filename), O_RDONLY, 0)) < 0 - || fstat (fd, &st) < 0) -#endif /* not APOLLO */ #endif /* WINDOWSNT */ { if (fd >= 0) emacs_close (fd); @@ -4652,9 +4623,6 @@ variable `last-coding-system-used' to the coding system actually used. */) { if (!EQ (current_buffer->undo_list, Qt)) current_buffer->undo_list = Qnil; -#ifdef APOLLO - stat (SDATA (filename), &st); -#endif if (NILP (handler)) { @@ -5330,16 +5298,14 @@ This does code conversion according to the value of but who knows about all the other machines with NFS?) */ #if 0 - /* On VMS and APOLLO, must do the stat after the close + /* On VMS, must do the stat after the close since closing changes the modtime. */ #ifndef VMS -#ifndef APOLLO /* Recall that #if defined does not work on VMS. */ #define FOO fstat (desc, &st); #endif #endif -#endif /* NFS can report a write failure now. */ if (emacs_close (desc) < 0) diff --git a/src/fns.c b/src/fns.c index 13c16381744..3a12768e621 100644 --- a/src/fns.c +++ b/src/fns.c @@ -4779,12 +4779,13 @@ DEFUN ("hash-table-p", Fhash_table_p, Shash_table_p, 1, 1, 0, DEFUN ("clrhash", Fclrhash, Sclrhash, 1, 1, 0, - doc: /* Clear hash table TABLE. */) + doc: /* Clear hash table TABLE and return it. */) (table) Lisp_Object table; { hash_clear (check_hash_table (table)); - return Qnil; + /* Be compatible with XEmacs. */ + return table; } @@ -5200,9 +5201,10 @@ invoked by mouse clicks and mouse menu items. */); DEFVAR_BOOL ("use-file-dialog", &use_file_dialog, doc: /* *Non-nil means mouse commands use a file dialog to ask for files. -This applies to commands from menus and tool bar buttons. The value of -`use-dialog-box' takes precedence over this variable, so a file dialog is only -used if both `use-dialog-box' and this variable are non-nil. */); +This applies to commands from menus and tool bar buttons even when +they are initiated from the keyboard. The value of `use-dialog-box' +takes precedence over this variable, so a file dialog is only used if +both `use-dialog-box' and this variable are non-nil. */); use_file_dialog = 1; defsubr (&Sidentity); diff --git a/src/frame.c b/src/frame.c index 0a3a910934f..30c5e5e9d36 100644 --- a/src/frame.c +++ b/src/frame.c @@ -604,9 +604,6 @@ make_terminal_frame (struct terminal *terminal) else f->output_method = output_termcap; #else -#ifdef MAC_OS8 - make_mac_terminal_frame (f); -#else { f->output_method = output_termcap; f->terminal = terminal; @@ -631,7 +628,6 @@ make_terminal_frame (struct terminal *terminal) FRAME_FOREGROUND_PIXEL(f) = FACE_TTY_DEFAULT_FG_COLOR; FRAME_BACKGROUND_PIXEL(f) = FACE_TTY_DEFAULT_BG_COLOR; #endif -#endif /* MAC_OS8 */ #endif /* MSDOS */ if (!noninteractive) @@ -698,7 +694,7 @@ affects all frames on the same terminal device. */) abort (); #else /* not MSDOS */ -#if 0 /* #ifdef MAC_OS8 */ +#if 0 /* This can happen for multi-tty when using both terminal frames and Carbon frames. */ if (sf->output_method != output_mac) @@ -1370,13 +1366,7 @@ The functions are run with one arg, the frame to be deleted. */) if (! FRAME_LIVE_P (f)) return Qnil; - if (NILP (force) && !other_visible_frames (f) -#ifdef MAC_OS8 - /* Terminal frame deleted before any other visible frames are - created. */ - && strcmp (SDATA (f->name), "F1") != 0 -#endif - ) + if (NILP (force) && !other_visible_frames (f)) error ("Attempt to delete the sole visible or iconified frame"); #if 0 diff --git a/src/getpagesize.h b/src/getpagesize.h index 5c3180dc36e..ab54062f912 100644 --- a/src/getpagesize.h +++ b/src/getpagesize.h @@ -43,13 +43,9 @@ Boston, MA 02110-1301, USA. */ # define CLSIZE 1 # endif /* no CLSIZE */ # else /* no NBPG */ -# ifdef NBPC -# define getpagesize() NBPC -# else /* no NBPC */ # ifdef PAGESIZE # define getpagesize() PAGESIZE # endif /* PAGESIZE */ -# endif /* no NBPC */ # endif /* no NBPG */ # endif /* no EXEC_PAGESIZE */ # else /* no HAVE_SYS_PARAM_H */ diff --git a/src/keyboard.c b/src/keyboard.c index a88298dabcf..0f7a49d3832 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -95,18 +95,7 @@ volatile int interrupt_input_blocked; during the current critical section. */ int interrupt_input_pending; - -#ifdef HAVE_WINDOW_SYSTEM -/* Make all keyboard buffers much bigger when using X windows. */ -#ifdef MAC_OS8 -/* But not too big (local data > 32K error) if on Mac OS Classic. */ -#define KBD_BUFFER_SIZE 512 -#else -#define KBD_BUFFER_SIZE 4096 -#endif -#else /* No X-windows, character input */ #define KBD_BUFFER_SIZE 4096 -#endif /* No X-windows */ #ifdef MULTI_KBOARD KBOARD *initial_kboard; @@ -2715,6 +2704,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) /* if redisplay was requested */ if (commandflag >= 0) { + int echo_current = EQ (echo_message_buffer, echo_area_buffer[0]); + /* If there is pending input, process any events which are not user-visible, such as X selection_request events. */ if (input_pending @@ -2738,6 +2729,12 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) swallow_events (0); /* If that cleared input_pending, try again to redisplay. */ } + + /* Prevent the redisplay we just did + from messing up echoing of the input after the prompt. */ + if (commandflag == 0 && echo_current) + echo_message_buffer = echo_area_buffer[0]; + } /* Message turns off echoing unless more keystrokes turn it on again. @@ -7234,7 +7231,7 @@ tty_read_avail_input (struct terminal *terminal, if (n_to_read > sizeof cbuf) n_to_read = sizeof cbuf; #else /* no FIONREAD */ -#if defined (USG) || defined (DGUX) || defined(CYGWIN) +#if defined (USG) || defined(CYGWIN) /* Read some input if available, but don't wait. */ n_to_read = sizeof cbuf; fcntl (fileno (tty->input), F_SETFL, O_NDELAY); @@ -7284,9 +7281,9 @@ tty_read_avail_input (struct terminal *terminal, ); #ifndef FIONREAD -#if defined (USG) || defined (DGUX) || defined (CYGWIN) +#if defined (USG) || defined (CYGWIN) fcntl (fileno (tty->input), F_SETFL, 0); -#endif /* USG or DGUX or CYGWIN */ +#endif /* USG or CYGWIN */ #endif /* no FIONREAD */ if (nread <= 0) diff --git a/src/lisp.h b/src/lisp.h index f3cdd1a26a7..284ee0b2b25 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1413,7 +1413,7 @@ typedef unsigned char UCHAR; All callers should assure that at least this size of memory is allocated at the place pointed by the second argument. - Thers are 6 modifiers, each consumes 2 chars. + There are 6 modifiers, each consumes 2 chars. The octal form of a character code consumes (1 + CHARACTERBITS / 3 + 1) chars (including backslash at the head). We need one more byte for string terminator `\0'. */ diff --git a/src/lread.c b/src/lread.c index 7b43dedecfb..24805abb4eb 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1336,9 +1336,6 @@ complete_filename_p (pathname) return (IS_DIRECTORY_SEP (s[0]) || (SCHARS (pathname) > 2 && IS_DEVICE_SEP (s[1]) && IS_DIRECTORY_SEP (s[2])) -#ifdef ALTOS - || *s == '@' -#endif #ifdef VMS || index (s, ':') #endif /* VMS */ diff --git a/src/m/amdx86-64.h b/src/m/amdx86-64.h index 37ae8ebb148..cdf8599e9b6 100644 --- a/src/m/amdx86-64.h +++ b/src/m/amdx86-64.h @@ -146,7 +146,7 @@ Boston, MA 02110-1301, USA. */ #else /* !__OpenBSD__ && !__FreeBSD__ && !__NetBSD__ && !sun */ #undef START_FILES -#ifdef HAVE_X86_64_LIB64_DIR +#ifdef HAVE_LIB64_DIR #define START_FILES pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o #else #define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o @@ -158,7 +158,7 @@ Boston, MA 02110-1301, USA. */ versions of ld are one-pass linkers, we need to mention -lgcc twice, or else we risk getting unresolved externals. */ #undef LIB_STANDARD -#ifdef HAVE_X86_64_LIB64_DIR +#ifdef HAVE_LIB64_DIR #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib64/crtn.o #else #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o diff --git a/src/m/ibms390x.h b/src/m/ibms390x.h index 7c0c577523e..443357966b6 100644 --- a/src/m/ibms390x.h +++ b/src/m/ibms390x.h @@ -152,10 +152,18 @@ NOTE-END */ #define XPNTR(a) XUINT (a) #undef START_FILES +#ifdef HAVE_LIB64_DIR #define START_FILES pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o +#else +#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o +#endif #undef LIB_STANDARD +#ifdef HAVE_LIB64_DIR #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib64/crtn.o +#else +#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o +#endif /* arch-tag: 4b87653c-6add-4663-8691-7d9dc17b5519 (do not change this comment) */ diff --git a/src/m/intel386.h b/src/m/intel386.h index 6ea2bbc60c6..680a2cc106d 100644 --- a/src/m/intel386.h +++ b/src/m/intel386.h @@ -85,17 +85,6 @@ NOTE-END */ #define DOT_GLOBAL_START -#ifdef XENIX -/* Data type of load average, as read out of kmem. */ -#define LOAD_AVE_TYPE short - -/* Convert that into an integer that is 100 for a load average of 1.0 */ -#define LOAD_AVE_CVT(x) (((double) (x)) * 100.0 / FSCALE) - -#define FSCALE 256.0 /* determined by experimentation... */ -#endif - - #ifdef SOLARIS2 /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE long @@ -153,28 +142,6 @@ NOTE-END */ /* #define VIRT_ADDR_VARIES */ -#ifdef XENIX -/* Define NO_REMAP if memory segmentation makes it not work well - to change the boundary between the text section and data section - when Emacs is dumped. If you define this, the preloaded Lisp - code will not be sharable; but that's better than failing completely. */ - -#define NO_REMAP - -/* Since cannot purify, use standard Xenix 386 startup code. */ - -#define START_FILES /lib/386/Sseg.o pre-crt0.o /lib/386/Scrt0.o - -/* These really use terminfo. */ - -#define LIBS_TERMCAP /lib/386/Slibcurses.a \ - /lib/386/Slibtinfo.a /lib/386/Slibx.a - -/* Standard libraries for this machine. Since `-l' doesn't work in `ld'. */ -/* '__fltused' is unresolved w/o Slibcfp.a */ -#define LIB_STANDARD /lib/386/Slibcfp.a /lib/386/Slibc.a -#else /* not XENIX */ - /* this brings in alloca() if we're using cc */ #ifdef USG #ifndef LIB_STANDARD @@ -188,7 +155,6 @@ NOTE-END */ #define NO_REMAP #define TEXT_START 0 #endif /* USG */ -#endif /* not XENIX */ #ifdef USG5_4 #define DATA_SEG_BITS 0x08000000 diff --git a/src/m/mips.h b/src/m/mips.h index 866a2a13742..f1401425603 100644 --- a/src/m/mips.h +++ b/src/m/mips.h @@ -130,7 +130,7 @@ NOTE-END */ /* Alter some of the options used when linking. */ -#if !defined(NEWSOS5) && !defined(__linux__) +#if !defined(__linux__) #ifdef BSD_SYSTEM /* DECstations don't have this library. @@ -161,7 +161,7 @@ NOTE-END */ #endif #endif /* not BSD_SYSTEM */ -#endif /* not NEWSOS5 && not __linux__ */ +#endif /* not __linux__ */ /* The standard definitions of these macros would work ok, but these are faster because the constants are short. */ @@ -173,7 +173,7 @@ NOTE-END */ ((int)(type) << VALBITS) \ + (((unsigned) (ptr) << (BITS_PER_INT-VALBITS)) >> (BITS_PER_INT-VALBITS))) -#if !defined (NEWSOS5) && !defined (__linux__) +#if !defined (__linux__) #ifdef USG /* Cancel certain parts of standard sysV support. */ @@ -213,7 +213,7 @@ NOTE-END */ #undef HAVE_UNION_WAIT #endif /* BSD_SYSTEM */ -#endif /* not NEWSOS5 && not __linux__ */ +#endif /* not __linux__ */ /* arch-tag: 8fd020ee-78a7-4d87-96ce-6129f52f7bee (do not change this comment) */ diff --git a/src/m/sequent-ptx.h b/src/m/sequent-ptx.h deleted file mode 100644 index de998e9fa31..00000000000 --- a/src/m/sequent-ptx.h +++ /dev/null @@ -1,132 +0,0 @@ -/* machine description file for SEQUENT machines running DYNIX/ptx - Copyright (C) 1985, 1986, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs 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 3, or (at your option) -any later version. - -GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ - - -/* The following line tells the configuration script what sort of - operating system this machine is likely to run. - USUAL-OPSYS="ptx" */ - -#include "intel386.h" - -/* Define how to take a char and sign-extend into an int. - On machines where char is signed, this is a no-op. */ -/* CHECK THIS */ -#define SIGN_EXTEND_CHAR(c) (c) - -/* Now define a symbol for the cpu type, if your compiler - does not define it automatically: - Ones defined so far include vax, m68000, ns16000, pyramid, - orion, tahoe, APOLLO and many others. */ - -/* BTW: ptx defines _SEQUENT_, i386 */ - -/* Use type int rather than a union, to represent Lisp_Object */ -/* This is desirable for most machines. */ - -#define NO_UNION_TYPE - -/* crt0.c should use the vax-bsd style of entry, with these dummy args. */ -/* Already defined. Assume prior definition works for PTX. */ -#if 0 -#undef CRT0_DUMMIES -#define CRT0_DUMMIES dummy1, dummy2, dummy3, -#endif - -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the 24-bit bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - -/* Data type of load average, as read out of kmem. */ - -#undef LOAD_AVE_TYPE -#define LOAD_AVE_TYPE unsigned long - -/* Convert that into an integer that is 100 for a load average of 1.0 */ - -#undef FSCALE -#define FSCALE 1000.0 -#undef LOAD_AVE_CVT -#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) - -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - -/* Define VIRT_ADDR_VARIES if the virtual addresses of - pure and impure space as loaded can vary, and even their - relative order cannot be relied on. - - Otherwise Emacs assumes that text space precedes data space, - numerically. */ - -/* #define VIRT_ADDR_VARIES */ - -/* Define NO_REMAP if memory segmentation makes it not work well - to change the boundary between the text section and data section - when Emacs is dumped. If you define this, the preloaded Lisp - code will not be sharable; but that's better than failing completely. */ -/* On PTX, can't seem to get a valid executable unless NO_REMAP is - defined. This did work in the Sequent patched Emacs 18.57. */ -#ifndef NO_REMAP -#define NO_REMAP -#endif -/* #undef NO_REMAP */ - -/* If a valid PTX executable could be dumped without NO_REMAP defined, - here's a guess at some defines to make it work. */ -#ifndef NO_REMAP - -/* PTX has getpagesize() but it returns 296. Using the default method of - including getpagesize.h in unexec.c returns 4096 which seems more - reasonable. */ -#undef HAVE_GETPAGESIZE - -/* Override magic number for a.out header. */ -#define EXEC_MAGIC 0411 /* from a.out.h: separated I&D */ - -#define ADJUST_TEXT_SCNHDR_SIZE -#define ADJUST_TEXTBASE - -/* The file sections in the Symmetry a.out must be on 4K boundaries. */ -/* #define DATA_SECTION_ALIGNMENT (4096-1) */ - -#endif /* ifndef NO_REMAP */ - -/* Avoids a compiler bug. */ -#define TAHOE_REGISTER_BUG - -/* (short) negative-int doesn't sign-extend correctly. */ -#define SHORT_CAST_BUG - -/* Cause compilations to be done in parallel in ymakefile. */ -#define MAKE_PARALLEL $& - -/* Use terminfo library. */ -#define LIBS_TERMCAP -ltermlib - -/* arch-tag: 0494629b-7e11-4f6f-865f-62254ac46099 - (do not change this comment) */ diff --git a/src/m/sequent.h b/src/m/sequent.h deleted file mode 100644 index 97df4da6e09..00000000000 --- a/src/m/sequent.h +++ /dev/null @@ -1,169 +0,0 @@ -/* machine description file for SEQUENT BALANCE machines - Copyright (C) 1985, 1986, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs 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 3, or (at your option) -any later version. - -GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ - - -/* The following line tells the configuration script what sort of - operating system this machine is likely to run. - USUAL-OPSYS="note" - -NOTE-START -Use -opsystem=bsd4-2, or -opsystem=bsd4-3 on newer systems. -NOTE-END */ - -/* NOTE: this file works for DYNIX release 2.0 - (not tested on 1.3) on NS32000's */ - -/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word - is the most significant byte. */ - -#undef WORDS_BIG_ENDIAN - -/* Define NO_ARG_ARRAY if you cannot take the address of the first of a - * group of arguments and treat it as an array of the arguments. */ - -/* #define NO_ARG_ARRAY */ - -/* Define WORD_MACHINE if addresses and such have - * to be corrected before they can be used as byte counts. */ - -/* #define WORD_MACHINE */ - -/* Now define a symbol for the cpu type, if your compiler - does not define it automatically: - vax, m68000, ns16000, pyramid, orion, tahoe and APOLLO - are the ones defined so far. */ - -/* BTW: DYNIX defines sequent, ns32000, and ns16000 (GENIX compatibility) */ -#ifndef sequent /* pre DYNIX 2.1 releases */ -# define sequent -#endif - -/* Use type int rather than a union, to represent Lisp_Object */ -/* This is desirable for most machines. */ - -#define NO_UNION_TYPE - -/* crt0.c should use the vax-bsd style of entry, with these dummy args. */ - -#define CRT0_DUMMIES bogus_fp, - -/* crt0.c should define a symbol `start' and do .globl with a dot. */ - -#define DOT_GLOBAL_START - -/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend - the 24-bit bit field into an int. In other words, if bit fields - are always unsigned. - - If you use NO_UNION_TYPE, this flag does not matter. */ - -#define EXPLICIT_SIGN_EXTEND - -/* Data type of load average, as read out of kmem. */ - -#define LOAD_AVE_TYPE unsigned long - -/* Convert that into an integer that is 100 for a load average of 1.0 */ - -#define FSCALE 1000.0 -#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) - -/* Define CANNOT_DUMP on machines where unexec does not work. - Then the function dump-emacs will not be defined - and temacs will do (load "loadup") automatically unless told otherwise. */ - -/* #define CANNOT_DUMP */ - -/* Define VIRT_ADDR_VARIES if the virtual addresses of - pure and impure space as loaded can vary, and even their - relative order cannot be relied on. - - Otherwise Emacs assumes that text space precedes data space, - numerically. */ - -/* #define VIRT_ADDR_VARIES */ - -/* Name of file the to look in - for the kernel symbol table (for load average) */ - -#undef KERNEL_FILE -#define KERNEL_FILE "/dynix" - -/* Avoids a compiler bug */ - -#define TAHOE_REGISTER_BUG - -/* Say that the text segment of a.out includes the header; - the header actually occupies the first few bytes of the text segment - and is counted in hdr.a_text. Furthermore, the value written - in the a_text in the file must have N_ADDRADJ added to it. */ - -#define A_TEXT_OFFSET(HDR) (sizeof (HDR) + N_ADDRADJ (HDR)) - -/* This is the offset of the executable's text, from the start of the file. */ - -#define A_TEXT_SEEK(HDR) (N_TXTOFF (hdr) + sizeof (hdr)) - -/* (short) negative-int doesn't sign-extend correctly */ -#define SHORT_CAST_BUG - -/* Cause compilations to be done in parallel in ymakefile. */ -#define MAKE_PARALLEL & - -/* Say that mailer interlocking uses flock. */ -#define MAIL_USE_FLOCK - -/* On many 4.2-based systems, there's a rather tricky bug - * with the interpretation of the pid/pgrp value given to - * the F_SETOWN fcntl() call. It works as documented EXCEPT - * when applied to filedescriptors for sockets, in which case - * the sign must be reversed. If your emacs subprocesses get - * SIGIO's when they shouldn't, while running on a socket - * (e.g. under X windows), you should probably define this. - */ - -#define F_SETOWN_SOCK_NEG - -/* Some really obscure 4.2-based systems (like Sequent DYNIX) - * do not support asynchronous I/O (using SIGIO) on sockets, - * even though it works fine on tty's. If you have one of - * these systems, define the following, and then use it in - * config.h (or elsewhere) to decide when (not) to use SIGIO. - */ - -#define NO_SOCK_SIGIO - -/* Define how to search all pty names. - This is for Dynix 3.0; delete next 5 definitions for older systems. */ - -#define PTY_MAJOR "pqrstuvwPQRSTUVW" -#define PTY_MINOR "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" -#define PTY_ITERATION \ - register int ma, mi; \ - for (ma = 0; ma < sizeof(PTY_MAJOR) - 1; ma++) \ - for (mi = 0; mi < sizeof(PTY_MINOR) - 1; mi++) -#define PTY_NAME_SPRINTF \ - sprintf (ptyname, "/dev/pty%c%c", PTY_MAJOR[ma], PTY_MINOR[mi]); -#define PTY_TTY_NAME_SPRINTF \ - sprintf (ptyname, "/dev/tty%c%c", PTY_MAJOR[ma], PTY_MINOR[mi]); - -/* arch-tag: 81caea48-aa64-4021-9544-e969dea71ee8 - (do not change this comment) */ diff --git a/src/mac.c b/src/mac.c index 1369db63039..5a8c8823ec4 100644 --- a/src/mac.c +++ b/src/mac.c @@ -5008,6 +5008,9 @@ extern int noninteractive; sys_select. */ static CFMutableDictionaryRef cfsockets_for_select; +/* Process ID of Emacs. */ +static pid_t mac_emacs_pid; + static void socket_callback (s, type, address, data, info) CFSocketRef s; @@ -5103,7 +5106,7 @@ mac_try_close_socket (fd) int fd; { #if SELECT_USE_CFSOCKET - if (cfsockets_for_select) + if (getpid () == mac_emacs_pid && cfsockets_for_select) { void *key = (void *) fd; CFSocketRef socket = @@ -5339,6 +5342,8 @@ init_mac_osx_environment () char *p, *q; struct stat st; + mac_emacs_pid = getpid (); + /* Initialize locale related variables. */ mac_system_script_code = (ScriptCode) GetScriptManagerVariable (smSysScript); diff --git a/src/macterm.c b/src/macterm.c index a46c9cbbda4..2d03c8918c5 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -5071,6 +5071,7 @@ x_scroll_bar_create (w, top, left, width, height, disp_top, disp_height) #ifdef MAC_OSX bar->fringe_extended_p = Qnil; #endif + bar->redraw_needed_p = Qnil; #ifdef USE_TOOLKIT_SCROLL_BARS bar->track_top = Qnil; bar->track_height = Qnil; @@ -5287,14 +5288,24 @@ XTset_vertical_scroll_bar (w, portion, whole, position) BLOCK_INPUT; /* If already correctly positioned, do nothing. */ - if (!(XINT (bar->left) == sb_left - && XINT (bar->top) == top - && XINT (bar->width) == sb_width - && XINT (bar->height) == height + if (XINT (bar->left) == sb_left + && XINT (bar->top) == top + && XINT (bar->width) == sb_width + && XINT (bar->height) == height #ifdef MAC_OSX - && !NILP (bar->fringe_extended_p) == fringe_extended_p + && !NILP (bar->fringe_extended_p) == fringe_extended_p #endif - )) + ) + { + if (!NILP (bar->redraw_needed_p)) + { +#if USE_CG_DRAWING + mac_prepare_for_quickdraw (f); +#endif + Draw1Control (SCROLL_BAR_CONTROL_REF (bar)); + } + } + else { /* Since toolkit scroll bars are smaller than the space reserved for them on the frame, we have to clear "under" them. */ @@ -5336,6 +5347,8 @@ XTset_vertical_scroll_bar (w, portion, whole, position) bar->fringe_extended_p = fringe_extended_p ? Qt : Qnil; #endif + bar->redraw_needed_p = Qnil; + #ifdef USE_TOOLKIT_SCROLL_BARS if (NILP (bar->track_top)) { @@ -5693,8 +5706,15 @@ void x_scroll_bar_clear (f) FRAME_PTR f; { - XTcondemn_scroll_bars (f); - XTjudge_scroll_bars (f); + Lisp_Object bar; + + /* We can have scroll bars even if this is 0, + if we just turned off scroll bar mode. + But in that case we should not clear them. */ + if (FRAME_HAS_VERTICAL_SCROLL_BARS (f)) + for (bar = FRAME_SCROLL_BARS (f); VECTORP (bar); + bar = XSCROLL_BAR (bar)->next) + XSCROLL_BAR (bar)->redraw_needed_p = Qt; } diff --git a/src/macterm.h b/src/macterm.h index 03016f30e0f..11d7e05a38f 100644 --- a/src/macterm.h +++ b/src/macterm.h @@ -457,6 +457,9 @@ struct scroll_bar { Lisp_Object fringe_extended_p; #endif + /* t if redraw needed in the next XTset_vertical_scroll_bar call. */ + Lisp_Object redraw_needed_p; + #ifdef USE_TOOLKIT_SCROLL_BARS /* The position and size of the scroll bar handle track area in pixels, relative to the frame. */ diff --git a/src/process.c b/src/process.c index b157ca469b7..e5546488aae 100644 --- a/src/process.c +++ b/src/process.c @@ -78,7 +78,7 @@ Boston, MA 02110-1301, USA. */ #include <client.h> #endif -/* On some systems, e.g. DGUX, inet_addr returns a 'struct in_addr'. */ +/* On some systems, inet_addr returns a 'struct in_addr'. */ #ifdef HAVE_BROKEN_INET_ADDR #define IN_ADDR struct in_addr #define NUMERIC_ADDR_ERROR (numeric_addr.s_addr == -1) @@ -87,12 +87,12 @@ Boston, MA 02110-1301, USA. */ #define NUMERIC_ADDR_ERROR (numeric_addr == -1) #endif -#if defined(BSD_SYSTEM) || defined(STRIDE) +#if defined(BSD_SYSTEM) #include <sys/ioctl.h> #if !defined (O_NDELAY) && defined (HAVE_PTYS) && !defined(USG5) #include <fcntl.h> #endif /* HAVE_PTYS and no O_NDELAY */ -#endif /* BSD_SYSTEM || STRIDE */ +#endif /* BSD_SYSTEM */ #ifdef BROKEN_O_NONBLOCK #undef O_NONBLOCK @@ -596,7 +596,6 @@ allocate_pty () #else sprintf (pty_name, "/dev/tty%c%x", c, i); #endif /* no PTY_TTY_NAME_SPRINTF */ -#ifndef UNIPLUS if (access (pty_name, 6) != 0) { emacs_close (fd); @@ -606,7 +605,6 @@ allocate_pty () return -1; # endif /* IRIS */ } -#endif /* not UNIPLUS */ setup_pty (fd); return fd; } @@ -1360,8 +1358,11 @@ list_processes_1 (query_only) w_proc = i; if (!NILP (p->buffer)) { - if (NILP (XBUFFER (p->buffer)->name) && w_buffer < 8) - w_buffer = 8; /* (Killed) */ + if (NILP (XBUFFER (p->buffer)->name)) + { + if (w_buffer < 8) + w_buffer = 8; /* (Killed) */ + } else if ((i = SCHARS (XBUFFER (p->buffer)->name), (i > w_buffer))) w_buffer = i; } @@ -1888,12 +1889,12 @@ create_process (process, new_argv, current_dir) #endif if (forkin < 0) report_file_error ("Opening pty", Qnil); -#if defined (RTU) || defined (UNIPLUS) || defined (DONT_REOPEN_PTY) +#if defined (DONT_REOPEN_PTY) /* In the case that vfork is defined as fork, the parent process (Emacs) may send some data before the child process completes tty options setup. So we setup tty before forking. */ child_setup_tty (forkout); -#endif /* RTU or UNIPLUS or DONT_REOPEN_PTY */ +#endif /* DONT_REOPEN_PTY */ #else forkin = forkout = -1; #endif /* not USG, or USG_SUBTTY_WORKS */ @@ -1934,15 +1935,6 @@ create_process (process, new_argv, current_dir) set_exclusive_use (outchannel); #endif -/* Stride people say it's a mystery why this is needed - as well as the O_NDELAY, but that it fails without this. */ -#if defined (STRIDE) || (defined (pfa) && defined (HAVE_PTYS)) - { - int one = 1; - ioctl (inchannel, FIONBIO, &one); - } -#endif - #ifdef O_NONBLOCK fcntl (inchannel, F_SETFL, O_NONBLOCK); fcntl (outchannel, F_SETFL, O_NONBLOCK); @@ -1992,7 +1984,7 @@ create_process (process, new_argv, current_dir) #ifdef BSD4_1 sighold (SIGCHLD); #else /* not BSD4_1 */ -#if defined (BSD_SYSTEM) || defined (UNIPLUS) || defined (HPUX) +#if defined (BSD_SYSTEM) || defined (HPUX) sigsetmask (sigmask (SIGCHLD)); #else /* ordinary USG */ #if 0 @@ -2106,7 +2098,7 @@ create_process (process, new_argv, current_dir) } #endif /* TIOCNOTTY */ -#if !defined (RTU) && !defined (UNIPLUS) && !defined (DONT_REOPEN_PTY) +#if !defined (DONT_REOPEN_PTY) /*** There is a suggestion that this ought to be a conditional on TIOCSPGRP, or !(defined (HAVE_SETSID) && defined (TIOCSCTTY)). @@ -2140,7 +2132,7 @@ create_process (process, new_argv, current_dir) ioctl (xforkout, TIOCSPGRP, &pgrp); #endif } -#endif /* not UNIPLUS and not RTU and not DONT_REOPEN_PTY */ +#endif /* not DONT_REOPEN_PTY */ #ifdef SETUP_SLAVE_PTY if (pty_flag) @@ -2167,7 +2159,7 @@ create_process (process, new_argv, current_dir) #ifdef BSD4_1 sigrelse (SIGCHLD); #else /* not BSD4_1 */ -#if defined (BSD_SYSTEM) || defined (UNIPLUS) || defined (HPUX) +#if defined (BSD_SYSTEM) || defined (HPUX) sigsetmask (SIGEMPTYMASK); #else /* ordinary USG */ #if 0 @@ -2178,10 +2170,10 @@ create_process (process, new_argv, current_dir) #endif /* SIGCHLD */ #endif /* !POSIX_SIGNALS */ -#if !defined (RTU) && !defined (UNIPLUS) && !defined (DONT_REOPEN_PTY) +#if !defined (DONT_REOPEN_PTY) if (pty_flag) child_setup_tty (xforkout); -#endif /* not RTU and not UNIPLUS and not DONT_REOPEN_PTY */ +#endif /* not DONT_REOPEN_PTY */ #ifdef WINDOWSNT pid = child_setup (xforkin, xforkout, xforkout, new_argv, 1, current_dir); @@ -2259,7 +2251,7 @@ create_process (process, new_argv, current_dir) #ifdef BSD4_1 sigrelse (SIGCHLD); #else /* not BSD4_1 */ -#if defined (BSD_SYSTEM) || defined (UNIPLUS) || defined (HPUX) +#if defined (BSD_SYSTEM) || defined (HPUX) sigsetmask (SIGEMPTYMASK); #else /* ordinary USG */ #if 0 @@ -4650,12 +4642,6 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, else if (xerrno == ENOMEM) no_avail = 1; #endif -#ifdef ALLIANT - /* This happens for no known reason on ALLIANT. - I am guessing that this is the right response. -- RMS. */ - else if (xerrno == EFAULT) - no_avail = 1; -#endif else if (xerrno == EBADF) { #ifdef AIX @@ -4717,6 +4703,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, { int old_timers_run = timers_run; struct buffer *old_buffer = current_buffer; + Lisp_Object old_window = selected_window; int leave = 0; if (detect_input_pending_run_timers (do_display)) @@ -4730,7 +4717,8 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, an alike. Make read_key_sequence aware of that. */ if (timers_run != old_timers_run && waiting_for_user_input_p == -1 - && old_buffer != current_buffer) + && (old_buffer != current_buffer + || !EQ (old_window, selected_window))) record_asynch_buffer_change (); if (leave) diff --git a/src/puresize.h b/src/puresize.h index 6f2982746ce..89632596546 100644 --- a/src/puresize.h +++ b/src/puresize.h @@ -70,7 +70,7 @@ extern void pure_write_error P_ ((void)) NO_RETURN; /* Define PURE_P. */ #if defined(VIRT_ADDR_VARIES) || defined(CYGWIN) -/* For machines like APOLLO where text and data can go anywhere +/* For machines where text and data can go anywhere in virtual memory. */ extern EMACS_INT pure[]; diff --git a/src/s/386-ix.h b/src/s/386-ix.h deleted file mode 100644 index 33658dd65e6..00000000000 --- a/src/s/386-ix.h +++ /dev/null @@ -1,18 +0,0 @@ -/* Interactive 386/ix. */ - -#include "usg5-3.h" - -#define BROKEN_TIOCGETC - -/* There are some reports that the following is needed - with some version of this system. -#undef LIBX11_SYSTEM -#define LIBX11_SYSTEM -linet -*/ - -/* This is said to be needed as a result of having _insque rather - than insque in -loldX. This may not always be the right thing. */ -#define WRONG_NAME_INSQUE - -/* arch-tag: c2fc2d64-46fd-4a87-933b-85eff622829c - (do not change this comment) */ diff --git a/src/s/domain.h b/src/s/domain.h deleted file mode 100644 index ebcdc7ea365..00000000000 --- a/src/s/domain.h +++ /dev/null @@ -1,7 +0,0 @@ -#include "bsd4-3.h" - -/* Inhibit using -X, which is the default. */ -#define LD_SWITCH_SYSTEM - -/* arch-tag: 08941c4f-d0b6-4ad6-b7e3-7e7fe76c0e94 - (do not change this comment) */ diff --git a/src/s/hpux9-x11r4.h b/src/s/hpux9-x11r4.h deleted file mode 100644 index 6a701d5a412..00000000000 --- a/src/s/hpux9-x11r4.h +++ /dev/null @@ -1,12 +0,0 @@ -/* System description file for hpux version 9 using X11R4. */ - -#include "hpux9.h" - -#undef C_SWITCH_X_SYSTEM -#define C_SWITCH_X_SYSTEM -I/usr/include/Motif1.1 - -#undef LD_SWITCH_X_DEFAULT -#define LD_SWITCH_X_DEFAULT -L/usr/lib/Motif1.1 - -/* arch-tag: 47664d7b-23ce-43e6-acdd-044a4be08da3 - (do not change this comment) */ diff --git a/src/s/hpux9shxr4.h b/src/s/hpux9shxr4.h deleted file mode 100644 index 63810273698..00000000000 --- a/src/s/hpux9shxr4.h +++ /dev/null @@ -1,10 +0,0 @@ -#include "hpux9shr.h" - -#undef C_SWITCH_X_SYSTEM -#define C_SWITCH_X_SYSTEM -I/usr/include/Motif1.1 - -#undef LD_SWITCH_X_DEFAULT -#define LD_SWITCH_X_DEFAULT -L/usr/lib/Motif1.1 - -/* arch-tag: 7f68b8b6-c733-4e6c-81df-39d8d13fb656 - (do not change this comment) */ diff --git a/src/s/irix3-3.h b/src/s/irix3-3.h deleted file mode 100644 index bb5785c6115..00000000000 --- a/src/s/irix3-3.h +++ /dev/null @@ -1,156 +0,0 @@ -/* Definitions file for GNU Emacs running on Silicon Graphics Irix system 3.3. - Copyright (C) 1987, 1990, 1999, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs 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 3, or (at your option) -any later version. - -GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ - - -/* - * Define symbols to identify the version of Unix this is. - * Define all the symbols that apply correctly. - */ - -#define USG -#define USG5 -#define IRIS -#ifndef IRIX -#define IRIX -#endif - -/* SYSTEM_TYPE should indicate the kind of system you are using. - It sets the Lisp variable system-type. */ - -#define SYSTEM_TYPE "irix" - -/* nomultiplejobs should be defined if your system's shell - does not have "job control" (the ability to stop a program, - run some other program, then continue the first one). */ - -/* #define NOMULTIPLEJOBS */ - -/* Default is to set interrupt_input to 0: don't do input buffering within Emacs */ - -/* #define INTERRUPT_INPUT */ - -/* Letter to use in finding device name of first pty, - if system supports pty's. 'a' means it is /dev/ptya0 */ - -#define FIRST_PTY_LETTER 'a' - -/* - * Define HAVE_TERMIO if the system provides sysV-style ioctls - * for terminal control. - */ - -#define HAVE_TERMIO - -/* - * Define HAVE_PTYS if the system supports pty devices. - */ - -#define HAVE_PTYS - -/* Define HAVE_SOCKETS if system supports 4.2-compatible sockets. */ - -#define HAVE_SOCKETS - -/* - * Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate - * The 4.2 opendir, etc., library functions. - */ - -/* #define NONSYSTEM_DIR_LIBRARY */ - -/* Define this symbol if your system has the functions bcopy, etc. */ - -#define BSTRING - -/* subprocesses should be defined if you want to - have code for asynchronous subprocesses - (as used in M-x compile and M-x shell). - This is generally OS dependent, and not supported - under most USG systems. */ - -#define subprocesses - -/* If your system uses COFF (Common Object File Format) then define the - preprocessor symbol "COFF". */ - -/* #define COFF */ - -/* define MAIL_USE_FLOCK if the mailer uses flock - to interlock access to /usr/spool/mail/$USER. - The alternative is that a lock file named - /usr/spool/mail/$USER.lock. */ - -#define MAIL_USE_FLOCK - -/* Define CLASH_DETECTION if you want lock files to be written - so that Emacs can tell instantly when you try to modify - a file that someone else has modified in his Emacs. */ - -/* #define CLASH_DETECTION */ - -/* The file containing the kernel's symbol table is called /unix. */ - -#define KERNEL_FILE "/unix" - -/* The symbol in the kernel where the load average is found - is named _avenrun. */ - -#define LDAV_SYMBOL "avenrun" - - -/* setjmp and longjmp can safely replace _setjmp and _longjmp, - but they will run slower. */ - -#define _setjmp setjmp -#define _longjmp longjmp - -/* On USG systems these have different names */ - -#define index strchr -#define rindex strrchr - -/* USG systems tend to put everything declared static - into the initialized data area, which becomes pure after dumping Emacs. - Foil this. Emacs carefully avoids static vars inside functions. */ - -/* #define static */ - -/* This is how to get the device name of the tty end of a pty. */ -#define PTY_TTY_NAME_SPRINTF \ - sprintf (ptyname, "/dev/ttyq%d", minor (stb.st_rdev)); - - -#define HAVE_SYSVIPC - -/* sioctl.h should be included where appropriate. */ - -#define NEED_SIOCTL - -/* This affects child_setup. */ - -#define SETPGRP_RELEASES_CTTY - -/* This was formerly in LIBS_MACHINE in iris4d.h, - but it is not needed for newer system versions. */ -#define LIBS_SYSTEM -lsun - -/* arch-tag: cccdd761-2ae9-4e71-a33e-749681c01889 - (do not change this comment) */ diff --git a/src/s/irix4-0.h b/src/s/irix4-0.h deleted file mode 100644 index e06940a0378..00000000000 --- a/src/s/irix4-0.h +++ /dev/null @@ -1,79 +0,0 @@ -/* Definitions file for GNU Emacs running on Silicon Graphics Irix system 4.0 - - Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs 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 3, or (at your option) -any later version. - -GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ - - -#include "irix3-3.h" - -#define USG5_3 -#define IRIX4 -/* XPointer is not defined in the older X headers -- JPff@maths.bath.ac.uk */ -#define XPointer caddr_t - -#undef NEED_SIOCTL - -/* Include unistd.h, even though we don't define POSIX. */ -#define NEED_UNISTD_H - -/* Make process_send_signal work by "typing" a signal character on the pty. */ -#define SIGNALS_VIA_CHARACTERS - -#ifndef __GNUC__ -/* use K&R C */ -/* We need to increase the expression tree space with -Wf,-XNh - (ghazi@caip.rutgers.edu 7/8/97.) -*/ -#define C_SWITCH_SYSTEM -cckr -Wf,-XNh4000 -#endif - -/* SGI has all the fancy wait stuff, but we can't include sys/wait.h - because it defines BIG_ENDIAN and LITTLE_ENDIAN (ugh!.) Instead - we'll just define WNOHANG right here. - (An implicit decl is good enough for wait3.) */ - -#define WNOHANG 0x1 - -/* No need to use sprintf to get the tty name--we get that from _getpty. */ -#undef PTY_TTY_NAME_SPRINTF -#define PTY_TTY_NAME_SPRINTF -/* No need to get the pty name at all. */ -#define PTY_NAME_SPRINTF -/* We need only try once to open a pty. */ -#define PTY_ITERATION -/* Here is how to do it. */ -/* It is necessary to prevent SIGCHLD signals within _getpty. - So we block them. */ -#define PTY_OPEN \ -{ \ - int mask = sigblock (sigmask (SIGCHLD)); \ - char *name = _getpty (&fd, O_RDWR | O_NDELAY, 0600, 0); \ - sigsetmask(mask); \ - if (name == 0) \ - return -1; \ - if (fd < 0) \ - return -1; \ - if (fstat (fd, &stb) < 0) \ - return -1; \ - strcpy (pty_name, name); \ -} - -/* arch-tag: cfd7e200-a4dc-4f67-9a32-4184c10b0c57 - (do not change this comment) */ diff --git a/src/s/ptx.h b/src/s/ptx.h deleted file mode 100644 index 346aab187cc..00000000000 --- a/src/s/ptx.h +++ /dev/null @@ -1,174 +0,0 @@ -/* Definitions file for GNU Emacs running on Sequent DYNIX/ptx 1.x/2.x - Copyright (C) 1987, 1990, 1999, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs 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 3, or (at your option) -any later version. - -GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ - -/* This file was written by Bill Burton <billb@progress.com>. Parts were - adapted from m-ptx1-2.h and process.c as distributed with the Emacs 18.57 - on the Sequent Public software tape. Other parts were adapted from - usg5-4.h. */ - -/* Use the SysVr3 file for base configuration even though much is changed. */ -#include "usg5-3.h" - -/* Undo these defines because they are incorrect or need to be changed. */ -#undef LIB_X11_LIB -#undef LIBX11_SYSTEM -#undef USG_SHARED_LIBRARIES - -/* <sys/stat.h> *defines* stat as a static function. If "static" - is blank, then many files will have a public definition for stat. */ -#undef static - -/* PTX supports job control. */ -#undef NOMULTIPLEJOBS - -/* PTX has System V streams. */ -#define SYSV_STREAMS - -/* Leave out -lPW since it conflicts with term.o and because we're not sure - if the alloca found there by autoconf should be trusted on PTX. */ -#define LIB_STANDARD -lc - -/* Local define. If TCP/IP is not installed, comment this out. */ -#define TCPIP_INSTALLED - -#ifdef TCPIP_INSTALLED -#define HAVE_SOCKETS -#else -#undef subprocesses -#endif - -#ifdef HAVE_X_WINDOWS - -#define LIBX11_SYSTEM -lsocket -linet -lnsl -/* This is also defined so that lib-src/profile can link. */ -#define LIBS_SYSTEM -lseq - -#else /* ! HAVE_X_WINDOWS */ - -#ifdef HAVE_SOCKETS -#define LIBS_SYSTEM -lsocket -linet -lnsl -lseq -#else -#define LIBS_SYSTEM -lseq -#endif - -#endif /* ! HAVE_X_WINDOWS */ - -/* No <sioctl.h> */ -#define NO_SIOCTL_H - -/* If we have X windows, configure should find gettimeofday in -lX11. - Since we emulate gettimeofday below, we really have it anyway. */ -#ifndef HAVE_GETTIMEOFDAY -#define HAVE_GETTIMEOFDAY -#endif - -#ifdef emacs -#include <sys/stropts.h> /* Support for pty's */ -#include <sys/conf.h> - -/*#define BROKEN_SIGIO*/ /* BROKEN_SIGIO is already defined. PTX - has SIGIO, but it's just an alias for - SIGPOLL. */ - -/* Emulate gettimeofday() except for the time zone information which Emacs - doesn't use anyway. Get_process_stats() is in -lseq. */ -#include <sys/procstats.h> -#define gettimeofday(tp, tzp) get_process_stats (tp, PS_SELF, 0, 0) - -/* Define timezone since it's not in sys/time.h. Unfortunately, this causes - trouble when building with X since this struct is defined in - <X11/Xos.h>. */ -struct timezone -{ - int tz_minuteswest; - int tz_dsttime; -}; - -/* Unfortunately, this define is not checked in all files including - <X11/Xos.h> so we can't use it. */ -/* #define XOS_NEEDS_TIME_H */ - -/* In ptx/WINDOWS, this prevents problems with the timezone struct being - redefined in <X11/Xos.h>. It seems the necessary include files are - included via systime.h so leaving them out here is not a problem. This - may not work in X11R5 or X11R6. */ -#define __TIMEVAL__ - -#endif /* emacs */ - -/* PTX doesn't have FIONREAD at all. */ -#undef INTERRUPT_INPUT -#define BROKEN_FIONREAD - -/* We can support this */ -#define CLASH_DETECTION - -/* PTX has termios */ -#define HAVE_TERMIOS -#undef HAVE_TERMIO -#undef BROKEN_TIOCGWINSZ -#undef BROKEN_TIOCGETC - -/* It is possible to receive SIGCHLD when there are no children - waiting, because a previous waitsys cleaned up the carcass of child - without clearing the SIGCHLD pending info. So, use a non-blocking - wait3 instead, which maps to waitpid in SysVr4. */ -/* Not sure if this is used but PTX does support waitpid. */ -/*#define HAVE_WAIT_HEADER*/ -/*#define WAITTYPE int*/ -#define wait3(status, options, rusage) \ - waitpid ((pid_t) -1, (status), (options)) -/*#define WRETCODE(w) (w >> 8)*/ - -/* PTX has pty's but not like System V */ -#define HAVE_PTYS -#undef SYSV_PTYS - -/* Provide pty support which is defined into process.c:allocate_pty. - Basic ideas for handling getpseudotty were lifted from process.c in - Emacs 18.57 included on the Sequent Public Software tape. However, this - implementation bears almost no resemblance to the original and does not - require that process.c be patched. */ -#define PTY_ITERATION \ - char *mastername, *slavename; \ - while (1) - -#define PTY_OPEN \ - if (failed_count++ >= 5) break; \ - if ((fd = getpseudotty (&slavename, &mastername)) < 0) { \ - error("Out of ptys."); \ - continue; \ - } \ - strcpy (pty_name, slavename); - -/* Define these to prevent the default logic in process.c:allocate_pty - from being used. */ -#define PTY_NAME_SPRINTF -#define PTY_TTY_NAME_SPRINTF - -/* PTX doesn't seem to have memmove. */ -#define MEMMOVE_MISSING - -/* Kenneth Stailey <kstailey@eagle.dol-esa.gov> says this is needed. */ -#define POSIX_SIGNALS - -/* arch-tag: 4f5e3abc-643b-413a-bae6-ed212d3af997 - (do not change this comment) */ diff --git a/src/s/ptx4-2.h b/src/s/ptx4-2.h deleted file mode 100644 index 3940093c28d..00000000000 --- a/src/s/ptx4-2.h +++ /dev/null @@ -1,20 +0,0 @@ -#include "ptx4.h" - -/* Gelling Kevan (gellingk.eurostar@ems.rail.co.uk) - says that PTX 4.2.3 needs this version. */ -#undef SETUP_SLAVE_PTY -#define SETUP_SLAVE_PTY \ - if (ioctl (xforkin, I_PUSH, "ptem") == -1) \ - fatal ("ioctl I_PUSH ptem", errno); \ - if (ioctl (xforkin, I_PUSH, "ldterm") == -1) \ - fatal ("ioctl I_PUSH ldterm", errno); - -/* Gelling Kevan (gellingk.eurostar@ems.rail.co.uk) - says that gmalloc.c needs _POSIX_SOURCE. - This defines _POSIX_SOURCE only for gmalloc.c. */ -#ifdef _MALLOC_INTERNAL -#define _POSIX_SOURCE -#endif - -/* arch-tag: 10a9fab3-9e84-4e9e-9535-6ff42baf9e77 - (do not change this comment) */ diff --git a/src/s/ptx4.h b/src/s/ptx4.h deleted file mode 100644 index 4e8913a0a6d..00000000000 --- a/src/s/ptx4.h +++ /dev/null @@ -1,61 +0,0 @@ -/* s/ file for Sequent "ptx 4", which is a modified SVR5.4. - -Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs 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 3, or (at your option) -any later version. - -GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ - - -/* Tell usg5-4.h not to include filio.h. */ -#define NO_FILIO_H - -#include "usg5-4.h" - -/* Marcus Daniels <marcus@sysc.pdx.edu> says that SIGINFO is defined - on ptx4 but it is not a signal. Prevent process.c from doing the - wrong thing. */ -#define BROKEN_SIGINFO - -/* pae@dim.com (Phil Ernhardt) says this correction to - the definition in usg5-4.h is needed to prevent - all asynchronous subprocesses from exiting right away. */ - -/* James Youngman <jay@gnu.org> found that on "DYNIX/ptx ARNIE 4.0 - * V4.4.2 i386", the push of the ttcompat module would fail. It seems - * that PTX 4.4.2 doesn't have that module, so if the push fails we - * don't kill ourselves. While this version lacks ttcompat, it also - * has ptem, but the manual page for ptem indicates that it should - * be pushed onto the slave side before the line discipline module. - * See also the streampty manual page, if you're curious (and have - * a ptx system). - */ - -/* rms: I hope that older versions which do have ttcompat - will not get confused by the code to use ptem. */ - -#undef SETUP_SLAVE_PTY -#define SETUP_SLAVE_PTY \ - if (ioctl (xforkin, I_PUSH, "ptem") == -1 && errno != EINVAL) \ - fatal ("ioctl I_PUSH ptem", errno); \ - if (ioctl (xforkin, I_PUSH, "ldterm") == -1) \ - fatal ("ioctl I_PUSH ldterm", errno); \ - if (ioctl (xforkin, I_PUSH, "ttcompat") == -1 && errno != EINVAL) \ - fatal ("ioctl I_PUSH ttcompat", errno); - -/* arch-tag: 14621824-8dca-432b-a97a-049fc4ce0e9f - (do not change this comment) */ diff --git a/src/sysdep.c b/src/sysdep.c index 7c7b3810956..01126c4907e 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -49,15 +49,6 @@ extern void srandom P_ ((unsigned int)); #include "blockinput.h" -#ifdef MAC_OS8 -#include <sys/param.h> - -#ifndef subprocesses -/* Nonzero means delete a process right away if it exits (process.c). */ -static int delete_exited_processes; -#endif -#endif /* MAC_OS8 */ - #ifdef WINDOWSNT #define read sys_read #define write sys_write @@ -151,12 +142,12 @@ extern int errno; #undef TIOCSWINSZ #endif -#if defined (USG) || defined (DGUX) +#if defined (USG) #include <sys/utsname.h> #ifndef MEMORY_IN_STRING_H #include <memory.h> #endif -#if defined (TIOCGWINSZ) || defined (ISC4_0) +#if defined (TIOCGWINSZ) #ifdef NEED_SIOCTL #include <sys/sioctl.h> #endif @@ -164,8 +155,8 @@ extern int errno; #include <sys/stream.h> #include <sys/ptem.h> #endif -#endif /* TIOCGWINSZ or ISC4_0 */ -#endif /* USG or DGUX */ +#endif /* TIOCGWINSZ */ +#endif /* USG */ extern int quit_char; @@ -345,17 +336,6 @@ discard_tty_input () &buf.main, 0, 0, terminator_mask, 0, 0); queue_kbd_input (); #else /* not VMS */ -#ifdef APOLLO - { - struct tty_display_info *tty; - for (tty = tty_list; tty; tty = tty->next) - { - int zero = 0; - if (tty->input) - ioctl (fileno (tty->input), TIOCFLUSH, &zero); - } - } -#else /* not Apollo */ #ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */ while (dos_keyread () != -1) ; @@ -372,7 +352,6 @@ discard_tty_input () } } #endif /* not MSDOS */ -#endif /* not Apollo */ #endif /* not VMS */ #endif /* not WINDOWSNT */ } @@ -532,11 +511,6 @@ wait_for_termination (pid) else sigpause (SIGEMPTYMASK); #else /* not BSD_SYSTEM, and not HPUX version >= 6 */ -#if defined (UNIPLUS) - if (0 > kill (pid, 0)) - break; - wait (0); -#else /* neither BSD_SYSTEM nor UNIPLUS: random sysV */ #ifdef POSIX_SIGNALS /* would this work for GNU/Linux as well? */ sigblock (sigmask (SIGCHLD)); errno = 0; @@ -570,7 +544,6 @@ wait_for_termination (pid) #endif /* not WINDOWSNT */ #endif /* not HAVE_SYSV_SIGPAUSE */ #endif /* not POSIX_SIGNALS */ -#endif /* not UNIPLUS */ #endif /* not BSD_SYSTEM, and not HPUX version >= 6 */ #endif /* not VMS */ #else /* not subprocesses */ @@ -727,12 +700,6 @@ child_setup_tty (out) if (interrupt_input) reset_sigio (0); #endif /* BSD4_1 */ -#ifdef RTU - { - int zero = 0; - ioctl (out, FIOASYNC, &zero); - } -#endif /* RTU */ #endif /* not DOS_NT */ } #endif /* not VMS */ @@ -821,7 +788,6 @@ sys_suspend () /* Fork a subshell. */ -#ifndef MAC_OS8 void sys_subshell () { @@ -957,7 +923,6 @@ sys_subshell () synch_process_alive = 0; #endif /* !VMS */ } -#endif /* !MAC_OS8 */ static void save_signal_handlers (saved_handlers) @@ -1066,69 +1031,6 @@ unrequest_sigio (void) } #else /* no FASYNC */ -#ifdef STRIDE /* Stride doesn't have FASYNC - use FIOASYNC */ - -void -request_sigio () -{ - int on = 1; - - if (noninteractive || read_socket_hook) - return; - - /* XXX CURTTY() is bogus here. */ - ioctl (fileno (CURTTY ()->input), FIOASYNC, &on); - interrupts_deferred = 0; -} - -void -unrequest_sigio () -{ - int off = 0; - - if (noninteractive || read_socket_hook) - return; - - /* XXX CURTTY() is bogus here. */ - ioctl (fileno (CURTTY ()->input), FIOASYNC, &off); - interrupts_deferred = 1; -} - -#else /* not FASYNC, not STRIDE */ - -#ifdef _CX_UX - -#include <termios.h> - -void -request_sigio () -{ - int on = 1; - sigset_t st; - - if (noninteractive || read_socket_hook) - return; - - sigemptyset (&st); - sigaddset (&st, SIGIO); - ioctl (0, FIOASYNC, &on); /* XXX This fails for multiple ttys. */ - interrupts_deferred = 0; - sigprocmask (SIG_UNBLOCK, &st, (sigset_t *)0); -} - -void -unrequest_sigio () -{ - int off = 0; - - if (noninteractive || read_socket_hook) - return; - - ioctl (0, FIOASYNC, &off); /* XXX This fails for multiple ttys. */ - interrupts_deferred = 1; -} - -#else /* ! _CX_UX */ #ifndef MSDOS void @@ -1150,8 +1052,6 @@ unrequest_sigio () } #endif /* MSDOS */ -#endif /* _CX_UX */ -#endif /* STRIDE */ #endif /* FASYNC */ #endif /* F_SETFL */ #endif /* SIGIO */ @@ -1486,10 +1386,6 @@ init_sys_modes (tty_out) #if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS) XSETINT (Vtty_erase_char, tty.main.c_cc[VERASE]); -#ifdef DGUX - /* This allows meta to be sent on 8th bit. */ - tty.main.c_iflag &= ~INPCK; /* don't check input for parity */ -#endif tty.main.c_iflag |= (IGNBRK); /* Ignore break condition */ tty.main.c_iflag &= ~ICRNL; /* Disable map of CR to NL on input */ #ifdef INLCR /* I'm just being cautious, @@ -1703,11 +1599,9 @@ init_sys_modes (tty_out) #ifdef TCXONC if (!tty_out->flow_control) ioctl (fileno (tty_out->input), TCXONC, 1); #endif -#ifndef APOLLO #ifdef TIOCSTART if (!tty_out->flow_control) ioctl (fileno (tty_out->input), TIOCSTART, 0); #endif -#endif #if defined (HAVE_TERMIOS) || defined (HPUX9) #ifdef TCOON @@ -2085,14 +1979,6 @@ setup_pty (fd) } #endif #endif -#ifdef IBMRTAIX - /* On AIX, the parent gets SIGHUP when a pty attached child dies. So, we */ - /* ignore SIGHUP once we've started a child on a pty. Note that this may */ - /* cause EMACS not to die when it should, i.e., when its own controlling */ - /* tty goes away. I've complained to the AIX developers, and they may */ - /* change this behavior, but I'm not going to hold my breath. */ - signal (SIGHUP, SIG_IGN); -#endif } #endif /* HAVE_PTYS */ @@ -2377,13 +2263,8 @@ start_of_text () #ifdef TEXT_START return ((char *) TEXT_START); #else -#ifdef GOULD - extern csrt (); - return ((char *) csrt); -#else /* not GOULD */ extern int _start (); return ((char *) _start); -#endif /* GOULD */ #endif /* TEXT_START */ } #endif /* not HAVE_TEXT_START */ @@ -3324,16 +3205,6 @@ get_random () return val & ((1L << VALBITS) - 1); } -#ifdef WRONG_NAME_INSQUE - -insque (q,p) - caddr_t q,p; -{ - _insque (q,p); -} - -#endif - #ifdef VMS #ifdef getenv diff --git a/src/systty.h b/src/systty.h index 411286908a3..a7e8c41c698 100644 --- a/src/systty.h +++ b/src/systty.h @@ -26,9 +26,6 @@ Boston, MA 02110-1301, USA. */ /* Include the proper files. */ #ifdef HAVE_TERMIO -#ifdef __DGUX -#include <sys/ioctl.h> -#endif #ifndef NO_TERMIO #include <termio.h> #endif /* not NO_TERMIO */ @@ -130,42 +127,18 @@ static struct sensemode { #ifdef SYSV_PTYS #include <sys/types.h> #include <sys/tty.h> -#ifdef titan -#include <sys/ttyhw.h> -#include <sys/stream.h> -#endif #ifndef NO_PTY_H #include <sys/pty.h> #endif #endif -/* saka@pfu.fujitsu.co.JP writes: - FASYNC defined in this file. But, FASYNC don't working. - so no problem, because unrequest_sigio only need. */ -#if defined (pfa) -#include <sys/file.h> -#endif - /* Special cases - inhibiting the use of certain features. */ -#ifdef APOLLO -#undef TIOCSTART -#endif - -#ifdef XENIX -#undef TIOCGETC /* Avoid confusing some conditionals that test this. */ -#endif - #ifdef BROKEN_TIOCGETC #undef TIOCGETC /* Avoid confusing some conditionals that test this. */ #endif -/* UNIPLUS systems may have FIONREAD. */ -#ifdef UNIPLUS -#include <sys.ioctl.h> -#endif - /* Allow m- file to inhibit use of FIONREAD. */ #ifdef BROKEN_FIONREAD #undef FIONREAD diff --git a/src/syswait.h b/src/syswait.h index 9f652a63b85..6bfab435459 100644 --- a/src/syswait.h +++ b/src/syswait.h @@ -79,7 +79,7 @@ Boston, MA 02110-1301, USA. */ #else /* not WAIT_USE_INT */ -#if (!defined (BSD_SYSTEM) && !defined (UNIPLUS) && !defined (STRIDE) && !(defined (HPUX) && !defined (NOMULTIPLEJOBS)) && !defined (HAVE_WAIT_HEADER)) +#if (!defined (BSD_SYSTEM) && !(defined (HPUX) && !defined (NOMULTIPLEJOBS)) && !defined (HAVE_WAIT_HEADER)) #define WAITTYPE int #define WIFSTOPPED(w) ((w&0377) == 0177) #define WIFSIGNALED(w) ((w&0377) != 0177 && (w&~0377) == 0) @@ -129,7 +129,7 @@ Boston, MA 02110-1301, USA. */ #ifndef WIFEXITED #define WIFEXITED(w) (WTERMSIG (w) == 0) #endif -#endif /* BSD_SYSTEM || UNIPLUS || STRIDE || HPUX */ +#endif /* BSD_SYSTEM || HPUX */ #endif /* not WAIT_USE_INT */ #endif /* no WAITTYPE */ diff --git a/src/terminal.c b/src/terminal.c index 8b1836b3681..914db8818f3 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -1,5 +1,5 @@ /* Functions related to terminal devices. - Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/undo.c b/src/undo.c index bf528e23935..77590e4ace8 100644 --- a/src/undo.c +++ b/src/undo.c @@ -53,8 +53,12 @@ Lisp_Object Qapply; an undo-boundary. */ Lisp_Object pending_boundary; +/* Nonzero means do not record point in record_point. */ + +int undo_inhibit_record_point; + /* Record point as it was at beginning of this command (if necessary) - And prepare the undo info for recording a change. + and prepare the undo info for recording a change. PT is the position of point that will naturally occur as a result of the undo record that will be added just after this command terminates. */ @@ -64,6 +68,14 @@ record_point (pt) { int at_boundary; + /* Don't record position of pt when undo_inhibit_record_point holds. + Needed to avoid inserting a position record in buffer-undo-list + when last_point_position has not been set up correctly by + command_loop_1, for example, when running a repeat-repeat-char + event. */ + if (undo_inhibit_record_point) + return; + /* Allocate a cons cell to be the undo boundary after this command. */ if (NILP (pending_boundary)) pending_boundary = Fcons (Qnil, Qnil); @@ -719,6 +731,10 @@ If it returns nil, the other forms of truncation are done. Garbage collection is inhibited around the call to this function, so it must make sure not to do a lot of consing. */); Vundo_outer_limit_function = Qnil; + + DEFVAR_BOOL ("undo-inhibit-record-point", &undo_inhibit_record_point, + doc: /* Non-nil means do not record `point' in `buffer-undo-list'. */); + undo_inhibit_record_point = 0; } /* arch-tag: d546ee01-4aed-4ffb-bb8b-eefaae50d38a diff --git a/src/unexec.c b/src/unexec.c index 05cff698313..b0ef8fc4d51 100644 --- a/src/unexec.c +++ b/src/unexec.c @@ -975,92 +975,9 @@ copy_text_and_data (new, a_out) lseek (new, (long) N_TXTOFF (hdr), 0); #endif /* no A_TEXT_SEEK */ -#ifdef RISCiX - - /* Acorn's RISC-iX has a wacky way of initialising the position of the heap. - * There is a little table in crt0.o that is filled at link time with - * the min and current brk positions, among other things. When start - * runs, it copies the table to where these parameters live during - * execution. This data is in text space, so it cannot be modified here - * before saving the executable, so the data is written manually. In - * addition, the table does not have a label, and the nearest accessible - * label (mcount) is not prefixed with a '_', thus making it inaccessible - * from within C programs. To overcome this, emacs's executable is passed - * through the command 'nm %s | fgrep mcount' into a pipe, and the - * resultant output is then used to find the address of 'mcount'. As far as - * is possible to determine, in RISC-iX releases prior to 1.2, the negative - * offset of the table from mcount is 0x2c, whereas from 1.2 onwards it is - * 0x30. bss_end has been rounded up to page boundary. This solution is - * based on suggestions made by Kevin Welton and Steve Hunt of Acorn, and - * avoids the need for a custom version of crt0.o for emacs which has its - * table in data space. - */ - - { - char command[1024]; - char errbuf[1024]; - char address_text[32]; - int proforma[4]; - FILE *pfile; - char *temp_ptr; - char c; - int mcount_address, mcount_offset, count; - extern char *_execname; - - - /* The use of _execname is incompatible with RISCiX 1.1 */ - sprintf (command, "nm %s | fgrep mcount", _execname); - - if ( (pfile = popen(command, "r")) == NULL) - { - sprintf (errbuf, "Could not open pipe"); - PERROR (errbuf); - } - - count=0; - while ( ((c=getc(pfile)) != EOF) && (c != ' ') && (count < 31)) - address_text[count++]=c; - address_text[count]=0; - - if ((count == 0) || pclose(pfile) != NULL) - { - sprintf (errbuf, "Failed to execute the command '%s'\n", command); - PERROR (errbuf); - } - - sscanf(address_text, "%x", &mcount_address); - ptr = (char *) unexec_text_start; - mcount_offset = (char *)mcount_address - ptr; - -#ifdef RISCiX_1_1 -#define EDATA_OFFSET 0x2c -#else -#define EDATA_OFFSET 0x30 -#endif - - end = ptr + mcount_offset - EDATA_OFFSET; - - write_segment (new, ptr, end); - - proforma[0] = bss_end; /* becomes _edata */ - proforma[1] = bss_end; /* becomes _end */ - proforma[2] = bss_end; /* becomes _minbrk */ - proforma[3] = bss_end; /* becomes _curbrk */ - - write (new, proforma, 16); - - temp_ptr = ptr; - ptr = end + 16; - end = temp_ptr + hdr.a_text; - - write_segment (new, ptr, end); - } - -#else /* !RISCiX */ ptr = (char *) unexec_text_start; end = ptr + hdr.a_text; write_segment (new, ptr, end); -#endif /* RISCiX */ ptr = (char *) unexec_data_start; end = ptr + hdr.a_data; @@ -1175,13 +1092,8 @@ adjust_lnnoptrs (writedesc, readdesc, new_name) { register int nsyms; register int new; -#if defined (amdahl_uts) || defined (pfa) - SYMENT symentry; - AUXENT auxentry; -#else struct syment symentry; union auxent auxentry; -#endif if (!lnnoptr || !f_hdr.f_symptr) return 0; diff --git a/src/unexsunos4.c b/src/unexsunos4.c deleted file mode 100644 index 17f2b298e00..00000000000 --- a/src/unexsunos4.c +++ /dev/null @@ -1,381 +0,0 @@ -/* Unexec for Sunos 4 using shared libraries. - Copyright (C) 1990, 1994, 1999, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs 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 3, or (at your option) -any later version. - -GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to -the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ - -/* Contributed by Viktor Dukhovni. */ -/* - * Unexec for Berkeley a.out format + SUNOS shared libraries - * The unexeced executable contains the __DYNAMIC area from the - * original text file, and then the rest of data + bss + malloced area of - * the current process. (The __DYNAMIC area is at the top of the process - * data segment, we use "data_start" defined externally to mark the start - * of the "real" data segment.) - * - * For programs that want to remap some of the data segment read only - * a run_time_remap is provided. This attempts to remap largest area starting - * and ending on page boundaries between "data_start" and "bndry" - * For this it to figure out where the text file is located. A path search - * is attempted after trying argv[0] and if all fails we simply do not remap - * - * One feature of run_time_remap () is mandatory: reseting the break. - * - * Note that we can no longer map data into the text segment, as this causes - * the __DYNAMIC struct to become read only, breaking the runtime loader. - * Thus we no longer need to mess with a private crt0.c, the standard one - * will do just fine, since environ can live in the writable area between - * __DYNAMIC and data_start, just make sure that pre-crt0.o (the name - * is somewhat abused here) is loaded first! - * - */ - -#ifdef emacs -#include <config.h> -#endif - -#include <sys/param.h> -#include <sys/mman.h> -#include <sys/file.h> -#include <sys/stat.h> -#include <string.h> -#include <stdio.h> -#include <a.out.h> - -#if defined (SUNOS4) || defined (__FreeBSD__) || defined (__NetBSD__) -#define UNDO_RELOCATION -#endif - -#ifdef UNDO_RELOCATION -#include <link.h> -#endif - -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif - -/* NetBSD needs this bit, but SunOS does not have it. */ -#ifndef MAP_FILE -#define MAP_FILE 0 -#endif - - -/* - * for programs other than emacs - * define data_start + initialized here, and make sure - * this object is loaded first! - * emacs will define these elsewhere, and load the object containing - * data_start (pre-crt0.o or firstfile.o?) first! - * The custom crt0.o *must not* be loaded! - */ -#ifndef emacs - static int data_start = 0; - static int initialized = 0; -#else - extern int initialized; - extern unsigned data_start; - extern int pureptr; -#endif - -extern char *getenv (); -static unsigned brk_value; -static struct exec nhdr; -static int rd_only_len; -static long cookie; - - -unexec (new_name, a_name, bndry, bss_start, entry) - char *new_name, *a_name; - unsigned bndry, bss_start, entry; -{ - int fd, new; - char *old; - struct exec ohdr; /* Allocate on the stack, not needed in the next life */ - struct stat stat; - - if ((fd = open (a_name, O_RDONLY)) < 0) - { - fprintf (stderr, "%s: open: ", a_name); - perror (a_name); - exit (1); - } - if ((new = open (new_name, O_WRONLY | O_CREAT, 0666)) == -1) - { - fprintf (stderr, "%s: open: ", a_name); - perror (new_name); - exit (1); - } - - if ((fstat (fd, &stat) == -1)) - { - fprintf (stderr, "%s: ", a_name); - perror ("fstat"); - exit (1); - } - - old = (char *)mmap (0, stat.st_size, PROT_READ, MAP_FILE|MAP_SHARED, fd, 0); - if (old == (char *)-1) - { - fprintf (stderr, "%s: ", a_name); - perror ("mmap"); - exit (1); - } - close (fd); - - nhdr = ohdr = (*(struct exec *)old); - - - /* - * Remember a magic cookie so we know we've got the right binary - * when remapping. - */ - cookie = time (0); - - /* Save the break, it is reset to &_end (by ld.so?). */ - brk_value = (unsigned) sbrk (0); - - /* - * Round up data start to a page boundary (Lose if not a 2 power!) - */ - data_start = ((((int)&data_start) - 1) & ~(N_PAGSIZ (nhdr) - 1)) + N_PAGSIZ (nhdr); - - /* - * Round down read only pages to a multiple of the page size - */ - if (bndry) - rd_only_len = ((int)bndry & ~(N_PAGSIZ (nhdr) - 1)) - data_start; - -#ifndef emacs - /* Have to do this some time before dumping the data */ - initialized = 1; -#endif - - /* Handle new data and bss sizes and optional new entry point. - No one actually uses bss_start and entry, but tradition compels - one to support them. - Could complain if bss_start > brk_value, - but the caller is *supposed* to know what she is doing. */ - nhdr.a_data = (bss_start ? bss_start : brk_value) - N_DATADDR (nhdr); - nhdr.a_bss = bss_start ? brk_value - bss_start : 0; - if (entry) - nhdr.a_entry = entry; - - /* - * Write out the text segment with new header - * Dynamic executables are ZMAGIC with N_TXTOFF==0 and the header - * part of the text segment, but no need to rely on this. - * So write the TEXT first, then go back replace the header. - * Doing it in the other order is less general! - */ - lseek (new, N_TXTOFF (nhdr), L_SET); - write (new, old + N_TXTOFF (ohdr), N_TXTOFF (ohdr) + ohdr.a_text); - lseek (new, 0L, L_SET); - write (new, &nhdr, sizeof (nhdr)); - - /* - * Write out the head of the old data segment from the file not - * from core, this has the unresolved __DYNAMIC relocation data - * we need to reload - */ - lseek (new, N_DATOFF (nhdr), L_SET); - write (new, old + N_DATOFF (ohdr), (int)&data_start - N_DATADDR (ohdr)); - - /* - * Copy the rest of the data from core - */ - write (new, &data_start, N_BSSADDR (nhdr) - (int)&data_start); - - /* - * Copy the symbol table and line numbers - */ - lseek (new, N_TRELOFF (nhdr), L_SET); - write (new, old + N_TRELOFF (ohdr), stat.st_size - N_TRELOFF (ohdr)); - - /* Some other BSD systems use this file. - We don't know whether this change is right for them. */ -#ifdef UNDO_RELOCATION - /* Undo the relocations done at startup by ld.so. - It will do these relocations again when we start the dumped Emacs. - Doing them twice gives incorrect results. */ - { - unsigned long daddr = N_DATADDR (ohdr); - unsigned long rel, erel; -#ifdef SUNOS4 -#ifdef SUNOS4_SHARED_LIBRARIES - extern struct link_dynamic _DYNAMIC; - - /* SunOS4.x's ld_rel is relative to N_TXTADDR. */ - if (!ohdr.a_dynamic) - /* This was statically linked. */ - rel = erel = 0; - else if (_DYNAMIC.ld_version < 2) - { - rel = _DYNAMIC.ld_un.ld_1->ld_rel + N_TXTADDR (ohdr); - erel = _DYNAMIC.ld_un.ld_1->ld_hash + N_TXTADDR (ohdr); - } - else - { - rel = _DYNAMIC.ld_un.ld_2->ld_rel + N_TXTADDR (ohdr); - erel = _DYNAMIC.ld_un.ld_2->ld_hash + N_TXTADDR (ohdr); - } -#else /* not SUNOS4_SHARED_LIBRARIES */ - rel = erel = 0; -#endif /* not SUNOS4_SHARED_LIBRARIES */ -#ifdef sparc -#define REL_INFO_TYPE struct reloc_info_sparc -#else -#define REL_INFO_TYPE struct relocation_info -#endif /* sparc */ -#define REL_TARGET_ADDRESS(r) (((REL_INFO_TYPE *)(r))->r_address) -#endif /* SUNOS4 */ -#if defined (__FreeBSD__) || defined (__NetBSD__) - extern struct _dynamic _DYNAMIC; - - /* FreeBSD's LD_REL is a virtual address itself. */ - rel = LD_REL (&_DYNAMIC); - erel = rel + LD_RELSZ (&_DYNAMIC); -#define REL_INFO_TYPE struct relocation_info -#define REL_TARGET_ADDRESS(r) (((REL_INFO_TYPE *)(r))->r_address) -#endif - - for (; rel < erel; rel += sizeof (REL_INFO_TYPE)) - { - /* This is the virtual address where ld.so will do relocation. */ - unsigned long target = REL_TARGET_ADDRESS (rel); - /* This is the offset in the data segment. */ - unsigned long segoffset = target - daddr; - - /* If it is located below data_start, we have to do nothing here, - because the old data has been already written to the location. */ - if (target < (unsigned long)&data_start) - continue; - - lseek (new, N_DATOFF (nhdr) + segoffset, L_SET); - write (new, old + N_DATOFF (ohdr) + segoffset, sizeof (unsigned long)); - } - } -#endif /* UNDO_RELOCATION */ - - fchmod (new, 0755); -} - -void -run_time_remap (progname) - char *progname; -{ - char aout[MAXPATHLEN]; - register char *path, *p; - - /* Just in case */ - if (!initialized) - return; - - /* Restore the break */ - brk ((char *) brk_value); - - /* If nothing to remap: we are done! */ - if (rd_only_len == 0) - return; - - /* - * Attempt to find the executable - * First try argv[0], will almost always succeed as shells tend to give - * the full path from the hash list rather than using execvp () - */ - if (is_it (progname)) - return; - - /* - * If argv[0] is a full path and does not exist, not much sense in - * searching further - */ - if (strchr (progname, '/')) - return; - - /* - * Try to search for argv[0] on the PATH - */ - path = getenv ("PATH"); - if (path == NULL) - return; - - while (*path) - { - /* copy through ':' or end */ - for (p = aout; *p = *path; ++p, ++path) - if (*p == ':') - { - ++path; /* move past ':' */ - break; - } - *p++ = '/'; - strcpy (p, progname); - /* - * aout is a candidate full path name - */ - if (is_it (aout)) - return; - } -} - -is_it (filename) - char *filename; -{ - int fd; - long filenames_cookie; - struct exec hdr; - - /* - * Open an executable and check for a valid header! - * Can't bcmp the header with what we had, it may have been stripped! - * so we may save looking at non executables with the same name, mostly - * directories. - */ - fd = open (filename, O_RDONLY); - if (fd != -1) - { - if (read (fd, &hdr, sizeof (hdr)) == sizeof (hdr) - && !N_BADMAG (hdr) && N_DATOFF (hdr) == N_DATOFF (nhdr) - && N_TRELOFF (hdr) == N_TRELOFF (nhdr)) - { - /* compare cookies */ - lseek (fd, N_DATOFF (hdr) + (int)&cookie - N_DATADDR (hdr), L_SET); - read (fd, &filenames_cookie, sizeof (filenames_cookie)); - if (filenames_cookie == cookie) - { /* Eureka */ - - /* - * Do the mapping - * The PROT_EXEC may not be needed, but it is safer this way. - * should the shared library decide to indirect through - * addresses in the data segment not part of __DYNAMIC - */ - mmap ((char *) data_start, rd_only_len, PROT_READ | PROT_EXEC, - MAP_FILE | MAP_SHARED | MAP_FIXED, fd, - N_DATOFF (hdr) + data_start - N_DATADDR (hdr)); - close (fd); - return 1; - } - } - close (fd); - } - return 0; -} - -/* arch-tag: 30227420-2c6f-4700-a4f8-9e45e52f53b1 - (do not change this comment) */ diff --git a/src/w32.c b/src/w32.c index 5a8289789da..2395c236769 100644 --- a/src/w32.c +++ b/src/w32.c @@ -120,6 +120,8 @@ static BOOL g_b_init_open_process_token; static BOOL g_b_init_get_token_information; static BOOL g_b_init_lookup_account_sid; static BOOL g_b_init_get_sid_identifier_authority; +static BOOL g_b_init_get_sid_sub_authority; +static BOOL g_b_init_get_sid_sub_authority_count; /* BEGIN: Wrapper functions around OpenProcessToken @@ -161,6 +163,12 @@ typedef BOOL (WINAPI * LookupAccountSid_Proc) ( PSID_NAME_USE peUse); typedef PSID_IDENTIFIER_AUTHORITY (WINAPI * GetSidIdentifierAuthority_Proc) ( PSID pSid); +typedef PDWORD (WINAPI * GetSidSubAuthority_Proc) ( + PSID pSid, + DWORD n); +typedef PUCHAR (WINAPI * GetSidSubAuthorityCount_Proc) ( + PSID pSid); + /* ** A utility function ** */ static BOOL @@ -349,6 +357,57 @@ PSID_IDENTIFIER_AUTHORITY WINAPI get_sid_identifier_authority ( return (s_pfn_Get_Sid_Identifier_Authority (pSid)); } +PDWORD WINAPI get_sid_sub_authority ( + PSID pSid, + DWORD n) +{ + static GetSidSubAuthority_Proc s_pfn_Get_Sid_Sub_Authority = NULL; + static DWORD zero = 0U; + HMODULE hm_advapi32 = NULL; + if (is_windows_9x () == TRUE) + { + return &zero; + } + if (g_b_init_get_sid_sub_authority == 0) + { + g_b_init_get_sid_sub_authority = 1; + hm_advapi32 = LoadLibrary ("Advapi32.dll"); + s_pfn_Get_Sid_Sub_Authority = + (GetSidSubAuthority_Proc) GetProcAddress ( + hm_advapi32, "GetSidSubAuthority"); + } + if (s_pfn_Get_Sid_Sub_Authority == NULL) + { + return &zero; + } + return (s_pfn_Get_Sid_Sub_Authority (pSid, n)); +} + +PUCHAR WINAPI get_sid_sub_authority_count ( + PSID pSid) +{ + static GetSidSubAuthorityCount_Proc s_pfn_Get_Sid_Sub_Authority_Count = NULL; + static UCHAR zero = 0U; + HMODULE hm_advapi32 = NULL; + if (is_windows_9x () == TRUE) + { + return &zero; + } + if (g_b_init_get_sid_sub_authority_count == 0) + { + g_b_init_get_sid_sub_authority_count = 1; + hm_advapi32 = LoadLibrary ("Advapi32.dll"); + s_pfn_Get_Sid_Sub_Authority_Count = + (GetSidSubAuthorityCount_Proc) GetProcAddress ( + hm_advapi32, "GetSidSubAuthorityCount"); + } + if (s_pfn_Get_Sid_Sub_Authority_Count == NULL) + { + return &zero; + } + return (s_pfn_Get_Sid_Sub_Authority_Count (pSid)); +} + /* END: Wrapper functions around OpenProcessToken and other functions in advapi32.dll that are only @@ -547,39 +606,47 @@ init_user_info () domain, &dlength, &user_type)) { strcpy (the_passwd.pw_name, name); - /* Determine a reasonable uid value. */ + /* Determine a reasonable uid value. */ if (stricmp ("administrator", name) == 0) { - the_passwd.pw_uid = 0; - the_passwd.pw_gid = 0; + the_passwd.pw_uid = 500; /* well-known Administrator uid */ + the_passwd.pw_gid = 513; /* well-known None gid */ } else { - SID_IDENTIFIER_AUTHORITY * pSIA; - - pSIA = get_sid_identifier_authority (*((PSID *) user_sid)); - /* I believe the relative portion is the last 4 bytes (of 6) - with msb first. */ - the_passwd.pw_uid = ((pSIA->Value[2] << 24) + - (pSIA->Value[3] << 16) + - (pSIA->Value[4] << 8) + - (pSIA->Value[5] << 0)); - /* restrict to conventional uid range for normal users */ - the_passwd.pw_uid = the_passwd.pw_uid % 60001; + /* Use the last sub-authority value of the RID, the relative + portion of the SID, as user/group ID. */ + DWORD n_subauthorities = + *get_sid_sub_authority_count (*((PSID *) user_sid)); + + if (n_subauthorities < 1) + the_passwd.pw_uid = 0; /* the "World" RID */ + else + { + the_passwd.pw_uid = + *get_sid_sub_authority (*((PSID *) user_sid), + n_subauthorities - 1); + /* Restrict to conventional uid range for normal users. */ + the_passwd.pw_uid %= 60001; + } /* Get group id */ if (get_token_information (token, TokenPrimaryGroup, (PVOID) user_sid, sizeof (user_sid), &trash)) { - SID_IDENTIFIER_AUTHORITY * pSIA; - - pSIA = get_sid_identifier_authority (*((PSID *) user_sid)); - the_passwd.pw_gid = ((pSIA->Value[2] << 24) + - (pSIA->Value[3] << 16) + - (pSIA->Value[4] << 8) + - (pSIA->Value[5] << 0)); - /* I don't know if this is necessary, but for safety... */ - the_passwd.pw_gid = the_passwd.pw_gid % 60001; + n_subauthorities = + *get_sid_sub_authority_count (*((PSID *) user_sid)); + + if (n_subauthorities < 1) + the_passwd.pw_gid = 0; /* the "World" RID */ + else + { + the_passwd.pw_gid = + *get_sid_sub_authority (*((PSID *) user_sid), + n_subauthorities - 1); + /* I don't know if this is necessary, but for safety... */ + the_passwd.pw_gid %= 60001; + } } else the_passwd.pw_gid = the_passwd.pw_uid; @@ -1938,6 +2005,36 @@ unc_volume_file_attributes (const char *path) return attrs; } +/* Ensure a network connection is authenticated. */ +static void +logon_network_drive (const char *path) +{ + NETRESOURCE resource; + char share[MAX_PATH]; + int i, n_slashes; + + /* Only logon to networked drives. */ + if (!IS_DIRECTORY_SEP (path[0]) || !IS_DIRECTORY_SEP (path[1])) + return; + n_slashes = 2; + strncpy (share, path, MAX_PATH); + /* Truncate to just server and share name. */ + for (i = 2; i < MAX_PATH; i++) + { + if (IS_DIRECTORY_SEP (share[i]) && ++n_slashes > 3) + { + share[i] = '\0'; + break; + } + } + + resource.dwType = RESOURCETYPE_DISK; + resource.lpLocalName = NULL; + resource.lpRemoteName = share; + resource.lpProvider = NULL; + + WNetAddConnection2 (&resource, NULL, NULL, CONNECT_INTERACTIVE); +} /* Shadow some MSVC runtime functions to map requests for long filenames to reasonable short names if necessary. This was originally added to @@ -2495,6 +2592,8 @@ stat (const char * path, struct stat * buf) } else { + logon_network_drive (name); + fh = FindFirstFile (name, &wfd); if (fh == INVALID_HANDLE_VALUE) { @@ -2668,8 +2767,8 @@ fstat (int desc, struct stat * buf) buf->st_ino = fake_inode; /* consider files to belong to current user */ - buf->st_uid = 0; - buf->st_gid = 0; + buf->st_uid = the_passwd.pw_uid; + buf->st_gid = the_passwd.pw_gid; buf->st_dev = info.dwVolumeSerialNumber; buf->st_rdev = info.dwVolumeSerialNumber; diff --git a/src/window.c b/src/window.c index a6648685d4b..d1e3225e198 100644 --- a/src/window.c +++ b/src/window.c @@ -3307,6 +3307,25 @@ Fset_window_buffer_unwind (obuf) EXFUN (Fset_window_fringes, 4); EXFUN (Fset_window_scroll_bars, 4); +void +run_window_configuration_change_hook (struct frame *f) +{ + if (! NILP (Vwindow_configuration_change_hook) + && ! NILP (Vrun_hooks)) + { + int count = SPECPDL_INDEX (); + if (SELECTED_FRAME () != f) + { + Lisp_Object frame; + XSETFRAME (frame, f); + record_unwind_protect (Fselect_frame, Fselected_frame ()); + Fselect_frame (frame); + } + call1 (Vrun_hooks, Qwindow_configuration_change_hook); + unbind_to (count, Qnil); + } +} + /* Make WINDOW display BUFFER as its contents. RUN_HOOKS_P non-zero means it's allowed to run hooks. See make_frame for a case where it's not allowed. KEEP_MARGINS_P non-zero means that the current @@ -3321,6 +3340,7 @@ set_window_buffer (window, buffer, run_hooks_p, keep_margins_p) struct window *w = XWINDOW (window); struct buffer *b = XBUFFER (buffer); int count = SPECPDL_INDEX (); + int samebuf = EQ (buffer, w->buffer); w->buffer = buffer; @@ -3339,16 +3359,28 @@ set_window_buffer (window, buffer, run_hooks_p, keep_margins_p) XSETFASTINT (w->window_end_vpos, 0); bzero (&w->last_cursor, sizeof w->last_cursor); w->window_end_valid = Qnil; - w->hscroll = w->min_hscroll = make_number (0); - w->vscroll = 0; - set_marker_both (w->pointm, buffer, BUF_PT (b), BUF_PT_BYTE (b)); - set_marker_restricted (w->start, - make_number (b->last_window_start), - buffer); - w->start_at_line_beg = Qnil; - w->force_start = Qnil; - XSETFASTINT (w->last_modified, 0); - XSETFASTINT (w->last_overlay_modified, 0); + if (!(keep_margins_p && samebuf)) + { /* If we're not actually changing the buffer, Don't reset hscroll and + vscroll. This case happens for example when called from + change_frame_size_1, where we use a dummy call to + Fset_window_buffer on the frame's selected window (and no other) + just in order to run window-configuration-change-hook. + Resetting hscroll and vscroll here is problematic for things like + image-mode and doc-view-mode since it resets the image's position + whenever we resize the frame. */ + w->hscroll = w->min_hscroll = make_number (0); + w->vscroll = 0; + set_marker_both (w->pointm, buffer, BUF_PT (b), BUF_PT_BYTE (b)); + set_marker_restricted (w->start, + make_number (b->last_window_start), + buffer); + w->start_at_line_beg = Qnil; + w->force_start = Qnil; + XSETFASTINT (w->last_modified, 0); + XSETFASTINT (w->last_overlay_modified, 0); + } + /* Maybe we could move this into the `if' but it's not obviously safe and + I doubt it's worth the trouble. */ windows_or_buffers_changed++; /* We must select BUFFER for running the window-scroll-functions. @@ -3395,10 +3427,7 @@ set_window_buffer (window, buffer, run_hooks_p, keep_margins_p) if (! NILP (Vwindow_scroll_functions)) run_hook_with_args_2 (Qwindow_scroll_functions, window, Fmarker_position (w->start)); - - if (! NILP (Vwindow_configuration_change_hook) - && ! NILP (Vrun_hooks)) - call1 (Vrun_hooks, Qwindow_configuration_change_hook); + run_window_configuration_change_hook (XFRAME (WINDOW_FRAME (w))); } unbind_to (count, Qnil); diff --git a/src/window.h b/src/window.h index fb56be8bfb7..b2c62fde01f 100644 --- a/src/window.h +++ b/src/window.h @@ -790,6 +790,7 @@ extern void foreach_window P_ ((struct frame *, extern void grow_mini_window P_ ((struct window *, int)); extern void shrink_mini_window P_ ((struct window *)); +void run_window_configuration_change_hook (struct frame *f); /* Make WINDOW display BUFFER as its contents. RUN_HOOKS_P non-zero means it's allowed to run hooks. See make_frame for a case where diff --git a/src/xdisp.c b/src/xdisp.c index 99099df7463..2993fbe912f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -239,6 +239,7 @@ extern Lisp_Object Qhelp_echo; Lisp_Object Qoverriding_local_map, Qoverriding_terminal_local_map; Lisp_Object Qwindow_scroll_functions, Vwindow_scroll_functions; +Lisp_Object Qwindow_text_change_functions, Vwindow_text_change_functions; Lisp_Object Qredisplay_end_trigger_functions, Vredisplay_end_trigger_functions; Lisp_Object Qinhibit_point_motion_hooks; Lisp_Object QCeval, QCfile, QCdata, QCpropertize; @@ -696,6 +697,7 @@ int trace_move; point visible. */ int automatic_hscrolling_p; +Lisp_Object Qauto_hscroll_mode; /* How close to the margin can point get before the window is scrolled horizontally. */ @@ -1328,6 +1330,28 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, rowh, vpos) visible_p = 1; if (visible_p) { + Lisp_Object window, prop; + + XSETWINDOW (window, w); + prop = Fget_char_property (make_number (it.position.charpos), + Qinvisible, window); + + /* If charpos coincides with invisible text covered with an + ellipsis, use the first glyph of the ellipsis to compute + the pixel positions. */ + if (TEXT_PROP_MEANS_INVISIBLE (prop) == 2) + { + struct glyph_row *row = it.glyph_row; + struct glyph *glyph = row->glyphs[TEXT_AREA]; + struct glyph *end = glyph + row->used[TEXT_AREA]; + int x = row->x; + + for (; glyph < end && glyph->charpos < charpos; glyph++) + x += glyph->pixel_width; + + top_x = x; + } + *x = top_x; *y = max (top_y + max (0, it.max_ascent - it.ascent), window_top_y); *rtop = max (0, window_top_y - top_y); @@ -8936,8 +8960,6 @@ echo_area_display (update_frame_p) if (!FRAME_VISIBLE_P (f) || !f->glyphs_initialized_p) return 0; -/* The terminal frame is used as the first Emacs frame on the Mac OS. */ -#ifndef MAC_OS8 #ifdef HAVE_WINDOW_SYSTEM /* When Emacs starts, selected_frame may be the initial terminal frame. If we let this through, a message would be displayed on @@ -8945,7 +8967,6 @@ echo_area_display (update_frame_p) if (FRAME_INITIAL_P (XFRAME (selected_frame))) return 0; #endif /* HAVE_WINDOW_SYSTEM */ -#endif /* Redraw garbaged frames. */ if (frame_garbaged) @@ -10535,11 +10556,12 @@ hscroll_window_tree (window) /* Scroll when cursor is inside this scroll margin. */ h_margin = hscroll_margin * WINDOW_FRAME_COLUMN_WIDTH (w); - if ((XFASTINT (w->hscroll) - && w->cursor.x <= h_margin) - || (cursor_row->enabled_p - && cursor_row->truncated_on_right_p - && (w->cursor.x >= text_area_width - h_margin))) + if (!NILP (Fbuffer_local_value (Qauto_hscroll_mode, w->buffer)) + && ((XFASTINT (w->hscroll) + && w->cursor.x <= h_margin) + || (cursor_row->enabled_p + && cursor_row->truncated_on_right_p + && (w->cursor.x >= text_area_width - h_margin)))) { struct it it; int hscroll; @@ -10629,16 +10651,9 @@ static int hscroll_windows (window) Lisp_Object window; { - int hscrolled_p; - - if (automatic_hscrolling_p) - { - hscrolled_p = hscroll_window_tree (window); - if (hscrolled_p) - clear_desired_matrices (XFRAME (WINDOW_FRAME (XWINDOW (window)))); - } - else - hscrolled_p = 0; + int hscrolled_p = hscroll_window_tree (window); + if (hscrolled_p) + clear_desired_matrices (XFRAME (WINDOW_FRAME (XWINDOW (window)))); return hscrolled_p; } @@ -13032,8 +13047,7 @@ redisplay_window (window, just_this_one_p) *w->desired_matrix->method = 0; #endif - specbind (Qinhibit_point_motion_hooks, Qt); - + restart: reconsider_clip_changes (w, buffer); /* Has the mode line to be updated? */ @@ -13084,10 +13098,6 @@ redisplay_window (window, just_this_one_p) /* Really select the buffer, for the sake of buffer-local variables. */ set_buffer_internal_1 (XBUFFER (w->buffer)); - SET_TEXT_POS (opoint, PT, PT_BYTE); - - beg_unchanged = BEG_UNCHANGED; - end_unchanged = END_UNCHANGED; current_matrix_up_to_date_p = (!NILP (w->window_end_valid) @@ -13096,6 +13106,23 @@ redisplay_window (window, just_this_one_p) && XFASTINT (w->last_modified) >= MODIFF && XFASTINT (w->last_overlay_modified) >= OVERLAY_MODIFF); + /* Run the window-bottom-change-functions + if it is possible that the text on the screen has changed + (either due to modification of the text, or any other reason). */ + if (!current_matrix_up_to_date_p + && !NILP (Vwindow_text_change_functions)) + { + safe_run_hooks (Qwindow_text_change_functions); + goto restart; + } + + beg_unchanged = BEG_UNCHANGED; + end_unchanged = END_UNCHANGED; + + SET_TEXT_POS (opoint, PT, PT_BYTE); + + specbind (Qinhibit_point_motion_hooks, Qt); + buffer_unchanged_p = (!NILP (w->window_end_valid) && !current_buffer->clip_changed @@ -24288,6 +24315,9 @@ syms_of_xdisp () staticpro (&Qwindow_scroll_functions); Qwindow_scroll_functions = intern ("window-scroll-functions"); + staticpro (&Qwindow_text_change_functions); + Qwindow_text_change_functions = intern ("window-text-change-functions"); + staticpro (&Qredisplay_end_trigger_functions); Qredisplay_end_trigger_functions = intern ("redisplay-end-trigger-functions"); @@ -24599,6 +24629,11 @@ and its new display-start position. Note that the value of `window-end' is not valid when these functions are called. */); Vwindow_scroll_functions = Qnil; + DEFVAR_LISP ("window-text-change-functions", + &Vwindow_text_change_functions, + doc: /* Functions to call in redisplay when text in the window might change. */); + Vwindow_text_change_functions = Qnil; + DEFVAR_LISP ("redisplay-end-trigger-functions", &Vredisplay_end_trigger_functions, doc: /* Functions called when redisplay of a window reaches the end trigger. Each function is called with two arguments, the window and the end trigger value. @@ -24708,6 +24743,8 @@ the frame's other specifications determine how to blink the cursor off. */); DEFVAR_BOOL ("auto-hscroll-mode", &automatic_hscrolling_p, doc: /* *Non-nil means scroll the display automatically to make point visible. */); automatic_hscrolling_p = 1; + Qauto_hscroll_mode = intern ("auto-hscroll-mode"); + staticpro (&Qauto_hscroll_mode); DEFVAR_INT ("hscroll-margin", &hscroll_margin, doc: /* *How many columns away from the window edge point is allowed to get diff --git a/src/xterm.c b/src/xterm.c index 1c5daca6425..aea431ea3fa 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -6776,9 +6776,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) kbd_buffer_store_event_hold (&inev.ie, hold_quit); } - /* Previous code updated count by nchars rather than nbytes, - but that seems bogus to me. ++kfs */ - count += nbytes; + count += nchars; inev.ie.kind = NO_EVENT; /* Already stored above. */ @@ -7275,7 +7273,9 @@ x_dispatch_event (event, display) We return as soon as there are no more events to be read. We return the number of characters stored into the buffer, - thus pretending to be `read'. + thus pretending to be `read' (except the characters we store + in the keyboard buffer can be multibyte, so are not necessarily + C chars). EXPECTED is nonzero if the caller knows input is available. */ |
