diff options
| author | Miles Bader | 2005-01-22 21:39:38 +0000 |
|---|---|---|
| committer | Miles Bader | 2005-01-22 21:39:38 +0000 |
| commit | 18643d1d412928c57690271c8b7a65e50503441f (patch) | |
| tree | a9303ce501314fc316c20ca29928b2fa168d0421 /src | |
| parent | cfa4901a57cc9920eec0401d8b33abac7d3f8e5b (diff) | |
| parent | ddff82cf89b20912729a1483da3f28608b44115a (diff) | |
| download | emacs-18643d1d412928c57690271c8b7a65e50503441f.tar.gz emacs-18643d1d412928c57690271c8b7a65e50503441f.zip | |
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-4
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-41
- miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-46
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-47
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-4
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-5
Update from CVS: exi/gnus-faq.texi ([4.1]): Typo.
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-6
Update from CVS
Diffstat (limited to 'src')
| -rw-r--r-- | src/.gdbinit | 15 | ||||
| -rw-r--r-- | src/ChangeLog | 156 | ||||
| -rw-r--r-- | src/alloc.c | 4 | ||||
| -rw-r--r-- | src/config.in | 3 | ||||
| -rw-r--r-- | src/dispnew.c | 12 | ||||
| -rw-r--r-- | src/editfns.c | 29 | ||||
| -rw-r--r-- | src/emacs.c | 15 | ||||
| -rw-r--r-- | src/fileio.c | 6 | ||||
| -rw-r--r-- | src/fns.c | 4 | ||||
| -rw-r--r-- | src/fringe.c | 4 | ||||
| -rw-r--r-- | src/gtkutil.c | 3 | ||||
| -rw-r--r-- | src/indent.c | 5 | ||||
| -rw-r--r-- | src/keyboard.c | 93 | ||||
| -rw-r--r-- | src/keymap.c | 4 | ||||
| -rw-r--r-- | src/lisp.h | 3 | ||||
| -rw-r--r-- | src/macterm.c | 26 | ||||
| -rw-r--r-- | src/process.c | 14 | ||||
| -rw-r--r-- | src/s/darwin.h | 12 | ||||
| -rw-r--r-- | src/w32term.c | 12 | ||||
| -rw-r--r-- | src/window.c | 70 | ||||
| -rw-r--r-- | src/xdisp.c | 121 | ||||
| -rw-r--r-- | src/xterm.c | 14 |
22 files changed, 455 insertions, 170 deletions
diff --git a/src/.gdbinit b/src/.gdbinit index 1f179fb6d64..e0e8535186e 100644 --- a/src/.gdbinit +++ b/src/.gdbinit | |||
| @@ -35,20 +35,23 @@ handle 2 noprint pass | |||
| 35 | # debugging. | 35 | # debugging. |
| 36 | handle SIGALRM ignore | 36 | handle SIGALRM ignore |
| 37 | 37 | ||
| 38 | # Set up a mask to use. | 38 | # $valmask and $tagmask are mask values set up by the xreload macro below. |
| 39 | # This should be EMACS_INT, but in some cases that is a macro. | ||
| 40 | # long ought to work in all cases right now. | ||
| 41 | 39 | ||
| 40 | # Use $bugfix so that the value isn't a constant. | ||
| 41 | # Using a constant runs into GDB bugs sometimes. | ||
| 42 | define xgetptr | 42 | define xgetptr |
| 43 | set $ptr = (gdb_use_union ? $arg0.u.val : $arg0 & $valmask) | gdb_data_seg_bits | 43 | set $bugfix = $arg0 |
| 44 | set $ptr = (gdb_use_union ? $bugfix.u.val : $bugfix & $valmask) | gdb_data_seg_bits | ||
| 44 | end | 45 | end |
| 45 | 46 | ||
| 46 | define xgetint | 47 | define xgetint |
| 47 | set $int = gdb_use_union ? $arg0.s.val : (gdb_use_lsb ? $arg0 : $arg0 << gdb_gctypebits) >> gdb_gctypebits | 48 | set $bugfix = $arg0 |
| 49 | set $int = gdb_use_union ? $bugfix.s.val : (gdb_use_lsb ? $bugfix : $bugfix << gdb_gctypebits) >> gdb_gctypebits | ||
| 48 | end | 50 | end |
| 49 | 51 | ||
| 50 | define xgettype | 52 | define xgettype |
| 51 | set $type = gdb_use_union ? $arg0.s.type : (enum Lisp_Type) (gdb_use_lsb ? $arg0 & $tagmask : $arg0 >> gdb_valbits) | 53 | set $bugfix = $arg0 |
| 54 | set $type = gdb_use_union ? $bugfix.s.type : (enum Lisp_Type) (gdb_use_lsb ? $bugfix & $tagmask : $bugfix >> gdb_valbits) | ||
| 52 | end | 55 | end |
| 53 | 56 | ||
| 54 | # Set up something to print out s-expressions. | 57 | # Set up something to print out s-expressions. |
diff --git a/src/ChangeLog b/src/ChangeLog index 1debb8b5ef6..dbadb42b3ee 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -9,11 +9,161 @@ | |||
| 9 | some possibly unnecessary fontset checking code that crashed | 9 | some possibly unnecessary fontset checking code that crashed |
| 10 | when creating a new frame | 10 | when creating a new frame |
| 11 | 11 | ||
| 12 | 2005-01-22 Steven Tamm <steventamm@mac.com> | ||
| 13 | |||
| 14 | * s/darwin.h: Removed PTY_ITERATION from here. | ||
| 15 | (DARWIN): Defined. | ||
| 16 | * process.c (init_process): Default process-connection-type to | ||
| 17 | nil on darwin 6 or less, t if it is 7 or higher. This way the | ||
| 18 | broken pty behavior is still allowed on darwin 6 for interactive | ||
| 19 | processes for people that know what they are doing. | ||
| 20 | |||
| 21 | 2005-01-22 Kim F. Storm <storm@cua.dk> | ||
| 22 | |||
| 23 | * window.c (auto_window_vscroll_p): New boolean. | ||
| 24 | (syms_of_window): DEFVAR_BOOL it. | ||
| 25 | (Fpos_visible_in_window_p): Extend return value to include RTOP | ||
| 26 | and RBOT values if FULLY is nil. | ||
| 27 | (window_scroll_pixel_based): Adjust vscroll for partially visible | ||
| 28 | rows if auto_window_vscroll_p is set. | ||
| 29 | (Fset_window_vscroll): Do nothing if vscroll is not modified. | ||
| 30 | |||
| 31 | * xdisp.c (pos_visible_p): Replace FULLY arg by RTOP and RBOT args | ||
| 32 | to return number of partially invisible pixels at top and bottom | ||
| 33 | of the dislay row at POS. | ||
| 34 | |||
| 35 | * lisp.h (pos_visible_p): Fix prototype. | ||
| 36 | |||
| 37 | 2005-01-21 Richard M. Stallman <rms@gnu.org> | ||
| 38 | |||
| 39 | * fileio.c (Fcopy_file): Doc fix. | ||
| 40 | |||
| 41 | 2005-01-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 42 | |||
| 43 | * gtkutil.c (xg_tool_bar_detach_callback): Remove unused variable bw. | ||
| 44 | (xg_get_file_name): Move declaration ofx_use_old_gtk_file_dialog to | ||
| 45 | start of function for older compilers. | ||
| 46 | |||
| 47 | 2005-01-20 Richard M. Stallman <rms@gnu.org> | ||
| 48 | |||
| 49 | * editfns.c (Fmessage): If arg is "", return "" (as before). | ||
| 50 | |||
| 51 | * keymap.c (access_keymap): Protect from bad value of meta_prefix_char. | ||
| 52 | |||
| 53 | * .gdbinit (xgetptr, xgetint, xgettype): Copy $arg0 into a temp | ||
| 54 | variable. | ||
| 55 | |||
| 56 | 2005-01-20 Steven Tamm <steventamm@mac.com> | ||
| 57 | |||
| 58 | * editfns.c (Voperating_system_release): Added. | ||
| 59 | (init_editfns): Assign new variable operating-system-release | ||
| 60 | based on call to uname if available. | ||
| 61 | (get_operating_system_release): Added function to | ||
| 62 | allow c-level access to operating system release. | ||
| 63 | |||
| 64 | * config.h: Regenerated. | ||
| 65 | |||
| 66 | * s/darwin.h (PTY_ITERATION): Don't allow PTYs on darwin 6 or | ||
| 67 | less. | ||
| 68 | (MIN_PTY_KERNEL_VERSION): Defined minimum kernel version for | ||
| 69 | using ptys as '7'. | ||
| 70 | |||
| 71 | 2005-01-20 Kim F. Storm <storm@cua.dk> | ||
| 72 | |||
| 73 | * alloc.c (STRING_MARKED_P, VECTOR_MARKED_P): Return boolean. | ||
| 74 | |||
| 75 | * xterm.c (x_draw_glyph_string_box): Fix last_x for full width rows. | ||
| 76 | Thanks to Chong Yidong <cyd@stupidchicken.com> for debugging this. | ||
| 77 | |||
| 78 | * macterm.c (x_draw_glyph_string_box): Likewise. | ||
| 79 | |||
| 80 | * w32term.c (x_draw_glyph_string_box): Likewise. | ||
| 81 | |||
| 82 | * indent.c (Fvertical_motion): Temporarily disable selective display. | ||
| 83 | |||
| 84 | 2005-01-19 Kim F. Storm <storm@cua.dk> | ||
| 85 | |||
| 86 | * xdisp.c (note_mode_line_or_margin_highlight): Fix :pointer | ||
| 87 | image property. | ||
| 88 | |||
| 89 | * fns.c (sweep_weak_table): Advance prev pointer when we keep a pair. | ||
| 90 | |||
| 91 | 2005-01-18 Kim F. Storm <storm@cua.dk> | ||
| 92 | |||
| 93 | * xdisp.c (fast_find_position): Backtrack to find first row if | ||
| 94 | charpos is inside a display overlay that spans multiple lines. | ||
| 95 | |||
| 96 | 2005-01-18 Kenichi Handa <handa@m17n.org> | ||
| 97 | |||
| 98 | * coding.c (decode_coding_iso2022): Translate invalid codes if | ||
| 99 | translation-table is specified. | ||
| 100 | |||
| 101 | 2005-01-18 Kim F. Storm <storm@cua.dk> | ||
| 102 | |||
| 103 | * xdisp.c (back_to_previous_visible_line_start): Undo 2004-12-28 | ||
| 104 | change. If handle_display_prop indicates newline is replaced by | ||
| 105 | image or text, move back to start of relevant overlay or interval | ||
| 106 | and continue scan from there. Simplify. | ||
| 107 | |||
| 108 | 2005-01-17 Kim F. Storm <storm@cua.dk> | ||
| 109 | |||
| 110 | * dispnew.c (mode_line_string, marginal_area_string): Fix | ||
| 111 | off-by-one error in search for glyph. | ||
| 112 | |||
| 113 | 2005-01-16 Kim F. Storm <storm@cua.dk> | ||
| 114 | |||
| 115 | * macterm.c (syms_of_macterm) <mac-allow-anti-aliasing>: Doc fix. | ||
| 116 | |||
| 117 | 2005-01-16 Steven Tamm <steventamm@mac.com> | ||
| 118 | |||
| 119 | * macterm.c (mac_to_x_fontname): Removed spurious argument. | ||
| 120 | |||
| 121 | 2005-01-16 Andreas Schwab <schwab@suse.de> | ||
| 122 | |||
| 123 | * macterm.c (mac_draw_string_common): Fix compilation on OSX 10.1. | ||
| 124 | |||
| 125 | 2005-01-16 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 126 | |||
| 127 | * fringe.c (Fdefine_fringe_bitmap, init_fringe): When assigning | ||
| 128 | fringe_faces, cast result from xmalloc/xrealloc to Lisp_Object *. | ||
| 129 | |||
| 130 | 2005-01-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 131 | |||
| 132 | * keyboard.c (READABLE_EVENTS_DO_TIMERS_NOW) | ||
| 133 | (READABLE_EVENTS_FILTER_EVENTS, READABLE_EVENTS_IGNORE_SQUEEZABLES): | ||
| 134 | New flags for readable_events. | ||
| 135 | (get_filtered_input_pending, readable_filtered_events): Removed. | ||
| 136 | (tracking_off): Call readable_events and get_input_pending with | ||
| 137 | flag READABLE_EVENTS_DO_TIMERS_NOW. | ||
| 138 | (readable_events): Move code from old readable_filtered_events here, | ||
| 139 | but check new READABLE_EVENTS_* in argument flags instead of previous | ||
| 140 | two boolean arguments do_timers_now and filter_events. | ||
| 141 | If we are doing mouse tracking and the mouse moved, return only if | ||
| 142 | READABLE_EVENTS_IGNORE_SQUEEZABLES is not set in flags. | ||
| 143 | (swallow_events): Call get_input_pending with flag | ||
| 144 | READABLE_EVENTS_DO_TIMERS_NOW. | ||
| 145 | (get_input_pending): Move code from old get_filtered_input_pending | ||
| 146 | here. Replace boolean arguments do_timers_now, filter_events with | ||
| 147 | flags, and pass flags to readable_events. Document new | ||
| 148 | READABLE_EVENTS_* flags. | ||
| 149 | (detect_input_pending_ignore_squeezables): New function. | ||
| 150 | (detect_input_pending_run_timers): Call get_input_pending with flag | ||
| 151 | READABLE_EVENTS_DO_TIMERS_NOW. | ||
| 152 | (Finput_pending_p): Call get_input_pending with flags | ||
| 153 | READABLE_EVENTS_DO_TIMERS_NOW and READABLE_EVENTS_FILTER_EVENTS. | ||
| 154 | |||
| 155 | * dispnew.c (update_window, update_frame_1): Replace calls to | ||
| 156 | detect_input_pending with detect_input_pending_ignore_squeezables | ||
| 157 | so that redisplay is not paused if the event queue contains only | ||
| 158 | mouse movements. | ||
| 159 | |||
| 160 | * lisp.h: Declare detect_input_pending_ignore_squeezables. | ||
| 161 | |||
| 12 | 2005-01-15 Steven Tamm <steventamm@mac.com> | 162 | 2005-01-15 Steven Tamm <steventamm@mac.com> |
| 13 | 163 | ||
| 14 | * macterm.c (Vmac_use_core_graphics): defined for | 164 | * macterm.c (Vmac_use_core_graphics): Declare variable for |
| 15 | mac-allow-anti-aliasing | 165 | mac-allow-anti-aliasing. |
| 16 | (syms_of_macterm): Added mac-allow-anti-aliasing | 166 | (syms_of_macterm): DEFVAR_LISP and initialize it. |
| 17 | (mac_draw_string_common): Use core graphics text rendering if | 167 | (mac_draw_string_common): Use core graphics text rendering if |
| 18 | mac-allow-anti-aliasing is enabled. | 168 | mac-allow-anti-aliasing is enabled. |
| 19 | 169 | ||
diff --git a/src/alloc.c b/src/alloc.c index 998f736b9c5..2fac07bdf85 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -143,11 +143,11 @@ static __malloc_size_t bytes_used_when_full; | |||
| 143 | 143 | ||
| 144 | #define MARK_STRING(S) ((S)->size |= ARRAY_MARK_FLAG) | 144 | #define MARK_STRING(S) ((S)->size |= ARRAY_MARK_FLAG) |
| 145 | #define UNMARK_STRING(S) ((S)->size &= ~ARRAY_MARK_FLAG) | 145 | #define UNMARK_STRING(S) ((S)->size &= ~ARRAY_MARK_FLAG) |
| 146 | #define STRING_MARKED_P(S) ((S)->size & ARRAY_MARK_FLAG) | 146 | #define STRING_MARKED_P(S) (((S)->size & ARRAY_MARK_FLAG) != 0) |
| 147 | 147 | ||
| 148 | #define VECTOR_MARK(V) ((V)->size |= ARRAY_MARK_FLAG) | 148 | #define VECTOR_MARK(V) ((V)->size |= ARRAY_MARK_FLAG) |
| 149 | #define VECTOR_UNMARK(V) ((V)->size &= ~ARRAY_MARK_FLAG) | 149 | #define VECTOR_UNMARK(V) ((V)->size &= ~ARRAY_MARK_FLAG) |
| 150 | #define VECTOR_MARKED_P(V) ((V)->size & ARRAY_MARK_FLAG) | 150 | #define VECTOR_MARKED_P(V) (((V)->size & ARRAY_MARK_FLAG) != 0) |
| 151 | 151 | ||
| 152 | /* Value is the number of bytes/chars of S, a pointer to a struct | 152 | /* Value is the number of bytes/chars of S, a pointer to a struct |
| 153 | Lisp_String. This must be used instead of STRING_BYTES (S) or | 153 | Lisp_String. This must be used instead of STRING_BYTES (S) or |
diff --git a/src/config.in b/src/config.in index 87e37e65ef2..34ba3a061df 100644 --- a/src/config.in +++ b/src/config.in | |||
| @@ -598,6 +598,9 @@ Boston, MA 02111-1307, USA. */ | |||
| 598 | /* Define to 1 if you have the <sys/un.h> header file. */ | 598 | /* Define to 1 if you have the <sys/un.h> header file. */ |
| 599 | #undef HAVE_SYS_UN_H | 599 | #undef HAVE_SYS_UN_H |
| 600 | 600 | ||
| 601 | /* Define to 1 if you have the <sys/utsname.h> header file. */ | ||
| 602 | #undef HAVE_SYS_UTSNAME_H | ||
| 603 | |||
| 601 | /* Define to 1 if you have the <sys/vlimit.h> header file. */ | 604 | /* Define to 1 if you have the <sys/vlimit.h> header file. */ |
| 602 | #undef HAVE_SYS_VLIMIT_H | 605 | #undef HAVE_SYS_VLIMIT_H |
| 603 | 606 | ||
diff --git a/src/dispnew.c b/src/dispnew.c index f04e806b368..c07a4cf8395 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -4061,7 +4061,7 @@ update_window (w, force_p) | |||
| 4061 | if (redisplay_dont_pause) | 4061 | if (redisplay_dont_pause) |
| 4062 | force_p = 1; | 4062 | force_p = 1; |
| 4063 | else | 4063 | else |
| 4064 | detect_input_pending (); | 4064 | detect_input_pending_ignore_squeezables (); |
| 4065 | 4065 | ||
| 4066 | /* If forced to complete the update, or if no input is pending, do | 4066 | /* If forced to complete the update, or if no input is pending, do |
| 4067 | the update. */ | 4067 | the update. */ |
| @@ -4135,7 +4135,7 @@ update_window (w, force_p) | |||
| 4135 | scrolling large windows with repeated scroll-up | 4135 | scrolling large windows with repeated scroll-up |
| 4136 | commands will too quickly pause redisplay. */ | 4136 | commands will too quickly pause redisplay. */ |
| 4137 | if (!force_p && ++n_updated % preempt_count == 0) | 4137 | if (!force_p && ++n_updated % preempt_count == 0) |
| 4138 | detect_input_pending (); | 4138 | detect_input_pending_ignore_squeezables (); |
| 4139 | 4139 | ||
| 4140 | changed_p |= update_window_line (w, vpos, | 4140 | changed_p |= update_window_line (w, vpos, |
| 4141 | &mouse_face_overwritten_p); | 4141 | &mouse_face_overwritten_p); |
| @@ -5079,7 +5079,7 @@ update_frame_1 (f, force_p, inhibit_id_p) | |||
| 5079 | 5079 | ||
| 5080 | if (redisplay_dont_pause) | 5080 | if (redisplay_dont_pause) |
| 5081 | force_p = 1; | 5081 | force_p = 1; |
| 5082 | else if (!force_p && detect_input_pending ()) | 5082 | else if (!force_p && detect_input_pending_ignore_squeezables ()) |
| 5083 | { | 5083 | { |
| 5084 | pause = 1; | 5084 | pause = 1; |
| 5085 | goto do_pause; | 5085 | goto do_pause; |
| @@ -5135,7 +5135,7 @@ update_frame_1 (f, force_p, inhibit_id_p) | |||
| 5135 | } | 5135 | } |
| 5136 | 5136 | ||
| 5137 | if ((i - 1) % preempt_count == 0) | 5137 | if ((i - 1) % preempt_count == 0) |
| 5138 | detect_input_pending (); | 5138 | detect_input_pending_ignore_squeezables (); |
| 5139 | 5139 | ||
| 5140 | update_frame_line (f, i); | 5140 | update_frame_line (f, i); |
| 5141 | } | 5141 | } |
| @@ -5828,7 +5828,7 @@ mode_line_string (w, part, x, y, charpos, object, dx, dy, width, height) | |||
| 5828 | it's the one we were looking for. */ | 5828 | it's the one we were looking for. */ |
| 5829 | glyph = row->glyphs[TEXT_AREA]; | 5829 | glyph = row->glyphs[TEXT_AREA]; |
| 5830 | end = glyph + row->used[TEXT_AREA]; | 5830 | end = glyph + row->used[TEXT_AREA]; |
| 5831 | for (x0 = *x; glyph < end && x0 > glyph->pixel_width; ++glyph) | 5831 | for (x0 = *x; glyph < end && x0 >= glyph->pixel_width; ++glyph) |
| 5832 | x0 -= glyph->pixel_width; | 5832 | x0 -= glyph->pixel_width; |
| 5833 | *x = glyph - row->glyphs[TEXT_AREA]; | 5833 | *x = glyph - row->glyphs[TEXT_AREA]; |
| 5834 | if (glyph < end) | 5834 | if (glyph < end) |
| @@ -5920,7 +5920,7 @@ marginal_area_string (w, part, x, y, charpos, object, dx, dy, width, height) | |||
| 5920 | 5920 | ||
| 5921 | glyph = row->glyphs[area]; | 5921 | glyph = row->glyphs[area]; |
| 5922 | end = glyph + row->used[area]; | 5922 | end = glyph + row->used[area]; |
| 5923 | for (x0 = *x - x0; glyph < end && x0 > glyph->pixel_width; ++glyph) | 5923 | for (x0 = *x - x0; glyph < end && x0 >= glyph->pixel_width; ++glyph) |
| 5924 | x0 -= glyph->pixel_width; | 5924 | x0 -= glyph->pixel_width; |
| 5925 | *x = glyph - row->glyphs[area]; | 5925 | *x = glyph - row->glyphs[area]; |
| 5926 | if (glyph < end) | 5926 | if (glyph < end) |
diff --git a/src/editfns.c b/src/editfns.c index 2adc43e3a04..59e57565d49 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -34,6 +34,10 @@ Boston, MA 02111-1307, USA. */ | |||
| 34 | #include <unistd.h> | 34 | #include <unistd.h> |
| 35 | #endif | 35 | #endif |
| 36 | 36 | ||
| 37 | #ifdef HAVE_SYS_UTSNAME_H | ||
| 38 | #include <sys/utsname.h> | ||
| 39 | #endif | ||
| 40 | |||
| 37 | /* systime.h includes <sys/time.h> which, on some systems, is required | 41 | /* systime.h includes <sys/time.h> which, on some systems, is required |
| 38 | for <sys/resource.h>; thus systime.h must be included before | 42 | for <sys/resource.h>; thus systime.h must be included before |
| 39 | <sys/resource.h> */ | 43 | <sys/resource.h> */ |
| @@ -106,6 +110,7 @@ Lisp_Object Vsystem_name; | |||
| 106 | Lisp_Object Vuser_real_login_name; /* login name of current user ID */ | 110 | Lisp_Object Vuser_real_login_name; /* login name of current user ID */ |
| 107 | Lisp_Object Vuser_full_name; /* full name of current user */ | 111 | Lisp_Object Vuser_full_name; /* full name of current user */ |
| 108 | Lisp_Object Vuser_login_name; /* user name from LOGNAME or USER */ | 112 | Lisp_Object Vuser_login_name; /* user name from LOGNAME or USER */ |
| 113 | Lisp_Object Voperating_system_release; /* Operating System Release */ | ||
| 109 | 114 | ||
| 110 | /* Symbol for the text property used to mark fields. */ | 115 | /* Symbol for the text property used to mark fields. */ |
| 111 | 116 | ||
| @@ -170,6 +175,16 @@ init_editfns () | |||
| 170 | Vuser_full_name = build_string (p); | 175 | Vuser_full_name = build_string (p); |
| 171 | else if (NILP (Vuser_full_name)) | 176 | else if (NILP (Vuser_full_name)) |
| 172 | Vuser_full_name = build_string ("unknown"); | 177 | Vuser_full_name = build_string ("unknown"); |
| 178 | |||
| 179 | #ifdef HAVE_SYS_UTSNAME_H | ||
| 180 | { | ||
| 181 | struct utsname uts; | ||
| 182 | uname (&uts); | ||
| 183 | Voperating_system_release = build_string (uts.release); | ||
| 184 | } | ||
| 185 | #else | ||
| 186 | Voperating_system_release = Qnil; | ||
| 187 | #endif | ||
| 173 | } | 188 | } |
| 174 | 189 | ||
| 175 | DEFUN ("char-to-string", Fchar_to_string, Schar_to_string, 1, 1, 0, | 190 | DEFUN ("char-to-string", Fchar_to_string, Schar_to_string, 1, 1, 0, |
| @@ -1344,6 +1359,15 @@ get_system_name () | |||
| 1344 | return ""; | 1359 | return ""; |
| 1345 | } | 1360 | } |
| 1346 | 1361 | ||
| 1362 | char * | ||
| 1363 | get_operating_system_release() | ||
| 1364 | { | ||
| 1365 | if (STRINGP (Voperating_system_release)) | ||
| 1366 | return (char *) SDATA (Voperating_system_release); | ||
| 1367 | else | ||
| 1368 | return ""; | ||
| 1369 | } | ||
| 1370 | |||
| 1347 | DEFUN ("emacs-pid", Femacs_pid, Semacs_pid, 0, 0, 0, | 1371 | DEFUN ("emacs-pid", Femacs_pid, Semacs_pid, 0, 0, 0, |
| 1348 | doc: /* Return the process ID of Emacs, as an integer. */) | 1372 | doc: /* Return the process ID of Emacs, as an integer. */) |
| 1349 | () | 1373 | () |
| @@ -3240,7 +3264,7 @@ usage: (message STRING &rest ARGS) */) | |||
| 3240 | && SBYTES (args[0]) == 0)) | 3264 | && SBYTES (args[0]) == 0)) |
| 3241 | { | 3265 | { |
| 3242 | message (0); | 3266 | message (0); |
| 3243 | return Qnil; | 3267 | return args[0]; |
| 3244 | } | 3268 | } |
| 3245 | else | 3269 | else |
| 3246 | { | 3270 | { |
| @@ -4434,6 +4458,9 @@ functions if all the text being accessed has this property. */); | |||
| 4434 | DEFVAR_LISP ("user-real-login-name", &Vuser_real_login_name, | 4458 | DEFVAR_LISP ("user-real-login-name", &Vuser_real_login_name, |
| 4435 | doc: /* The user's name, based upon the real uid only. */); | 4459 | doc: /* The user's name, based upon the real uid only. */); |
| 4436 | 4460 | ||
| 4461 | DEFVAR_LISP ("operating-system-release", &Voperating_system_release, | ||
| 4462 | doc: /* The release of the operating system Emacs is running on. */); | ||
| 4463 | |||
| 4437 | defsubr (&Spropertize); | 4464 | defsubr (&Spropertize); |
| 4438 | defsubr (&Schar_equal); | 4465 | defsubr (&Schar_equal); |
| 4439 | defsubr (&Sgoto_char); | 4466 | defsubr (&Sgoto_char); |
diff --git a/src/emacs.c b/src/emacs.c index 2deb6606fec..becab72ccdd 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* Fully extensible Emacs, running on Unix, intended for GNU. | 1 | /* Fully extensible Emacs, running on Unix, intended for GNU. |
| 2 | Copyright (C) 1985,86,87,93,94,95,97,98,1999,2001,02,03,2004 | 2 | Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1998, 1999, 2001, |
| 3 | Free Software Foundation, Inc. | 3 | 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 6 | 6 | ||
| @@ -2438,7 +2438,16 @@ syms_of_emacs () | |||
| 2438 | Many arguments are deleted from the list as they are processed. */); | 2438 | Many arguments are deleted from the list as they are processed. */); |
| 2439 | 2439 | ||
| 2440 | DEFVAR_LISP ("system-type", &Vsystem_type, | 2440 | DEFVAR_LISP ("system-type", &Vsystem_type, |
| 2441 | doc: /* Value is symbol indicating type of operating system you are using. */); | 2441 | + doc: /* Value is symbol indicating type of operating system you are using. |
| 2442 | +Special values: | ||
| 2443 | + `gnu/linux' compiled for a GNU/Linux system. | ||
| 2444 | + `darwin' compiled for Darwin (GNU-Darwin, Mac OS X, ...). | ||
| 2445 | + `macos' compiled for Mac OS 9. | ||
| 2446 | + `ms-dos' compiled as an MS-DOS application. | ||
| 2447 | + `windows-nt' compiled as a native W32 application. | ||
| 2448 | + `cygwin' compiled using the Cygwin library. | ||
| 2449 | + `vax-vms' or `axp-vms': compiled for a (Open)VMS system. | ||
| 2450 | +Anything else indicates some sort of Unix system. */); | ||
| 2442 | Vsystem_type = intern (SYSTEM_TYPE); | 2451 | Vsystem_type = intern (SYSTEM_TYPE); |
| 2443 | 2452 | ||
| 2444 | DEFVAR_LISP ("system-configuration", &Vsystem_configuration, | 2453 | DEFVAR_LISP ("system-configuration", &Vsystem_configuration, |
diff --git a/src/fileio.c b/src/fileio.c index 4a5d878d532..c21cdcec675 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -2395,10 +2395,10 @@ Signals a `file-already-exists' error if file NEWNAME already exists, | |||
| 2395 | unless a third argument OK-IF-ALREADY-EXISTS is supplied and non-nil. | 2395 | unless a third argument OK-IF-ALREADY-EXISTS is supplied and non-nil. |
| 2396 | A number as third arg means request confirmation if NEWNAME already exists. | 2396 | A number as third arg means request confirmation if NEWNAME already exists. |
| 2397 | This is what happens in interactive use with M-x. | 2397 | This is what happens in interactive use with M-x. |
| 2398 | Fourth arg KEEP-TIME non-nil means give the new file the same | 2398 | Always sets the file modes of the output file to match the input file. |
| 2399 | Fourth arg KEEP-TIME non-nil means give the output file the same | ||
| 2399 | last-modified time as the old one. (This works on only some systems.) | 2400 | last-modified time as the old one. (This works on only some systems.) |
| 2400 | A prefix arg makes KEEP-TIME non-nil. | 2401 | A prefix arg makes KEEP-TIME non-nil. */) |
| 2401 | Also set the file modes of the target file to match the source file. */) | ||
| 2402 | (file, newname, ok_if_already_exists, keep_time) | 2402 | (file, newname, ok_if_already_exists, keep_time) |
| 2403 | Lisp_Object file, newname, ok_if_already_exists, keep_time; | 2403 | Lisp_Object file, newname, ok_if_already_exists, keep_time; |
| 2404 | { | 2404 | { |
| @@ -4305,6 +4305,10 @@ sweep_weak_table (h, remove_entries_p) | |||
| 4305 | 4305 | ||
| 4306 | h->count = make_number (XFASTINT (h->count) - 1); | 4306 | h->count = make_number (XFASTINT (h->count) - 1); |
| 4307 | } | 4307 | } |
| 4308 | else | ||
| 4309 | { | ||
| 4310 | prev = idx; | ||
| 4311 | } | ||
| 4308 | } | 4312 | } |
| 4309 | else | 4313 | else |
| 4310 | { | 4314 | { |
diff --git a/src/fringe.c b/src/fringe.c index 76908907a03..771e7d4787c 100644 --- a/src/fringe.c +++ b/src/fringe.c | |||
| @@ -1301,7 +1301,7 @@ If BITMAP already exists, the existing definition is replaced. */) | |||
| 1301 | = ((struct fringe_bitmap **) | 1301 | = ((struct fringe_bitmap **) |
| 1302 | xrealloc (fringe_bitmaps, max_fringe_bitmaps * sizeof (struct fringe_bitmap *))); | 1302 | xrealloc (fringe_bitmaps, max_fringe_bitmaps * sizeof (struct fringe_bitmap *))); |
| 1303 | fringe_faces | 1303 | fringe_faces |
| 1304 | = (unsigned *) xrealloc (fringe_faces, max_fringe_bitmaps * sizeof (Lisp_Object)); | 1304 | = (Lisp_Object *) xrealloc (fringe_faces, max_fringe_bitmaps * sizeof (Lisp_Object)); |
| 1305 | 1305 | ||
| 1306 | for (; i < max_fringe_bitmaps; i++) | 1306 | for (; i < max_fringe_bitmaps; i++) |
| 1307 | { | 1307 | { |
| @@ -1472,7 +1472,7 @@ init_fringe () | |||
| 1472 | fringe_bitmaps | 1472 | fringe_bitmaps |
| 1473 | = (struct fringe_bitmap **) xmalloc (max_fringe_bitmaps * sizeof (struct fringe_bitmap *)); | 1473 | = (struct fringe_bitmap **) xmalloc (max_fringe_bitmaps * sizeof (struct fringe_bitmap *)); |
| 1474 | fringe_faces | 1474 | fringe_faces |
| 1475 | = (unsigned *) xmalloc (max_fringe_bitmaps * sizeof (Lisp_Object)); | 1475 | = (Lisp_Object *) xmalloc (max_fringe_bitmaps * sizeof (Lisp_Object)); |
| 1476 | 1476 | ||
| 1477 | for (i = 0; i < max_fringe_bitmaps; i++) | 1477 | for (i = 0; i < max_fringe_bitmaps; i++) |
| 1478 | { | 1478 | { |
diff --git a/src/gtkutil.c b/src/gtkutil.c index 39d5e768dda..aecc4e2eaea 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -1312,6 +1312,7 @@ xg_get_file_name (f, prompt, default_filename, mustmatch_p, only_dir_p) | |||
| 1312 | char *fn = 0; | 1312 | char *fn = 0; |
| 1313 | int filesel_done = 0; | 1313 | int filesel_done = 0; |
| 1314 | xg_get_file_func func; | 1314 | xg_get_file_func func; |
| 1315 | extern int x_use_old_gtk_file_dialog; | ||
| 1315 | 1316 | ||
| 1316 | #if defined (HAVE_GTK_AND_PTHREAD) && defined (__SIGRTMIN) | 1317 | #if defined (HAVE_GTK_AND_PTHREAD) && defined (__SIGRTMIN) |
| 1317 | /* I really don't know why this is needed, but without this the GLIBC add on | 1318 | /* I really don't know why this is needed, but without this the GLIBC add on |
| @@ -1321,7 +1322,6 @@ xg_get_file_name (f, prompt, default_filename, mustmatch_p, only_dir_p) | |||
| 1321 | #endif /* HAVE_GTK_AND_PTHREAD */ | 1322 | #endif /* HAVE_GTK_AND_PTHREAD */ |
| 1322 | 1323 | ||
| 1323 | #ifdef HAVE_GTK_FILE_BOTH | 1324 | #ifdef HAVE_GTK_FILE_BOTH |
| 1324 | extern int x_use_old_gtk_file_dialog; | ||
| 1325 | 1325 | ||
| 1326 | if (x_use_old_gtk_file_dialog) | 1326 | if (x_use_old_gtk_file_dialog) |
| 1327 | w = xg_get_file_with_selection (f, prompt, default_filename, | 1327 | w = xg_get_file_with_selection (f, prompt, default_filename, |
| @@ -3161,7 +3161,6 @@ xg_tool_bar_detach_callback (wbox, w, client_data) | |||
| 3161 | /* When detaching a tool bar, not everything dissapear. There are | 3161 | /* When detaching a tool bar, not everything dissapear. There are |
| 3162 | a few pixels left that are used to drop the tool bar back into | 3162 | a few pixels left that are used to drop the tool bar back into |
| 3163 | place. */ | 3163 | place. */ |
| 3164 | int bw = gtk_container_get_border_width (GTK_CONTAINER (wbox)); | ||
| 3165 | FRAME_TOOLBAR_HEIGHT (f) = 2; | 3164 | FRAME_TOOLBAR_HEIGHT (f) = 2; |
| 3166 | 3165 | ||
| 3167 | /* The height has changed, resize outer widget and set columns | 3166 | /* The height has changed, resize outer widget and set columns |
diff --git a/src/indent.c b/src/indent.c index 24645b104cf..1d69d346f92 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -2071,6 +2071,7 @@ whether or not it is currently displayed in some window. */) | |||
| 2071 | else | 2071 | else |
| 2072 | { | 2072 | { |
| 2073 | int it_start; | 2073 | int it_start; |
| 2074 | int oselective; | ||
| 2074 | 2075 | ||
| 2075 | SET_TEXT_POS (pt, PT, PT_BYTE); | 2076 | SET_TEXT_POS (pt, PT, PT_BYTE); |
| 2076 | start_display (&it, w, pt); | 2077 | start_display (&it, w, pt); |
| @@ -2084,7 +2085,11 @@ whether or not it is currently displayed in some window. */) | |||
| 2084 | it_start = IT_CHARPOS (it); | 2085 | it_start = IT_CHARPOS (it); |
| 2085 | reseat_at_previous_visible_line_start (&it); | 2086 | reseat_at_previous_visible_line_start (&it); |
| 2086 | it.current_x = it.hpos = 0; | 2087 | it.current_x = it.hpos = 0; |
| 2088 | /* Temporarily disable selective display so we don't move too far */ | ||
| 2089 | oselective = it.selective; | ||
| 2090 | it.selective = 0; | ||
| 2087 | move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); | 2091 | move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); |
| 2092 | it.selective = oselective; | ||
| 2088 | 2093 | ||
| 2089 | /* Move back if we got too far. This may happen if | 2094 | /* Move back if we got too far. This may happen if |
| 2090 | truncate-lines is on and PT is beyond right margin. */ | 2095 | truncate-lines is on and PT is beyond right margin. */ |
diff --git a/src/keyboard.c b/src/keyboard.c index 7efea38121e..8abc38b1072 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -646,14 +646,17 @@ static EMACS_TIME timer_last_idleness_start_time; | |||
| 646 | 646 | ||
| 647 | /* Global variable declarations. */ | 647 | /* Global variable declarations. */ |
| 648 | 648 | ||
| 649 | /* Flags for readable_events. */ | ||
| 650 | #define READABLE_EVENTS_DO_TIMERS_NOW (1 << 0) | ||
| 651 | #define READABLE_EVENTS_FILTER_EVENTS (1 << 1) | ||
| 652 | #define READABLE_EVENTS_IGNORE_SQUEEZABLES (1 << 2) | ||
| 653 | |||
| 649 | /* Function for init_keyboard to call with no args (if nonzero). */ | 654 | /* Function for init_keyboard to call with no args (if nonzero). */ |
| 650 | void (*keyboard_init_hook) (); | 655 | void (*keyboard_init_hook) (); |
| 651 | 656 | ||
| 652 | static int read_avail_input P_ ((int)); | 657 | static int read_avail_input P_ ((int)); |
| 653 | static void get_input_pending P_ ((int *, int)); | 658 | static void get_input_pending P_ ((int *, int)); |
| 654 | static void get_filtered_input_pending P_ ((int *, int, int)); | ||
| 655 | static int readable_events P_ ((int)); | 659 | static int readable_events P_ ((int)); |
| 656 | static int readable_filtered_events P_ ((int, int)); | ||
| 657 | static Lisp_Object read_char_x_menu_prompt P_ ((int, Lisp_Object *, | 660 | static Lisp_Object read_char_x_menu_prompt P_ ((int, Lisp_Object *, |
| 658 | Lisp_Object, int *)); | 661 | Lisp_Object, int *)); |
| 659 | static Lisp_Object read_char_x_menu_prompt (); | 662 | static Lisp_Object read_char_x_menu_prompt (); |
| @@ -3440,10 +3443,11 @@ tracking_off (old_value) | |||
| 3440 | input has been processed. If the only input available was | 3443 | input has been processed. If the only input available was |
| 3441 | the sort that we have just disabled, then we need to call | 3444 | the sort that we have just disabled, then we need to call |
| 3442 | redisplay. */ | 3445 | redisplay. */ |
| 3443 | if (!readable_events (1)) | 3446 | if (!readable_events (READABLE_EVENTS_DO_TIMERS_NOW)) |
| 3444 | { | 3447 | { |
| 3445 | redisplay_preserve_echo_area (6); | 3448 | redisplay_preserve_echo_area (6); |
| 3446 | get_input_pending (&input_pending, 1); | 3449 | get_input_pending (&input_pending, |
| 3450 | READABLE_EVENTS_DO_TIMERS_NOW); | ||
| 3447 | } | 3451 | } |
| 3448 | } | 3452 | } |
| 3449 | return Qnil; | 3453 | return Qnil; |
| @@ -3495,20 +3499,19 @@ some_mouse_moved () | |||
| 3495 | /* Return true iff there are any events in the queue that read-char | 3499 | /* Return true iff there are any events in the queue that read-char |
| 3496 | would return. If this returns false, a read-char would block. */ | 3500 | would return. If this returns false, a read-char would block. */ |
| 3497 | static int | 3501 | static int |
| 3498 | readable_filtered_events (do_timers_now, filter_events) | 3502 | readable_events (flags) |
| 3499 | int do_timers_now; | 3503 | int flags; |
| 3500 | int filter_events; | ||
| 3501 | { | 3504 | { |
| 3502 | if (do_timers_now) | 3505 | if (flags & READABLE_EVENTS_DO_TIMERS_NOW) |
| 3503 | timer_check (do_timers_now); | 3506 | timer_check (1); |
| 3504 | 3507 | ||
| 3505 | /* If the buffer contains only FOCUS_IN_EVENT events, | 3508 | /* If the buffer contains only FOCUS_IN_EVENT events, and |
| 3506 | and FILTER_EVENTS is nonzero, report it as empty. */ | 3509 | READABLE_EVENTS_FILTER_EVENTS is set, report it as empty. */ |
| 3507 | if (kbd_fetch_ptr != kbd_store_ptr) | 3510 | if (kbd_fetch_ptr != kbd_store_ptr) |
| 3508 | { | 3511 | { |
| 3509 | int have_live_event = 1; | 3512 | int have_live_event = 1; |
| 3510 | 3513 | ||
| 3511 | if (filter_events) | 3514 | if (flags & READABLE_EVENTS_FILTER_EVENTS) |
| 3512 | { | 3515 | { |
| 3513 | struct input_event *event; | 3516 | struct input_event *event; |
| 3514 | 3517 | ||
| @@ -3529,7 +3532,8 @@ readable_filtered_events (do_timers_now, filter_events) | |||
| 3529 | } | 3532 | } |
| 3530 | 3533 | ||
| 3531 | #ifdef HAVE_MOUSE | 3534 | #ifdef HAVE_MOUSE |
| 3532 | if (!NILP (do_mouse_tracking) && some_mouse_moved ()) | 3535 | if (!(flags & READABLE_EVENTS_IGNORE_SQUEEZABLES) |
| 3536 | && !NILP (do_mouse_tracking) && some_mouse_moved ()) | ||
| 3533 | return 1; | 3537 | return 1; |
| 3534 | #endif | 3538 | #endif |
| 3535 | if (single_kboard) | 3539 | if (single_kboard) |
| @@ -3547,15 +3551,6 @@ readable_filtered_events (do_timers_now, filter_events) | |||
| 3547 | return 0; | 3551 | return 0; |
| 3548 | } | 3552 | } |
| 3549 | 3553 | ||
| 3550 | /* Return true iff there are any events in the queue that read-char | ||
| 3551 | would return. If this returns false, a read-char would block. */ | ||
| 3552 | static int | ||
| 3553 | readable_events (do_timers_now) | ||
| 3554 | int do_timers_now; | ||
| 3555 | { | ||
| 3556 | return readable_filtered_events (do_timers_now, 0); | ||
| 3557 | } | ||
| 3558 | |||
| 3559 | /* Set this for debugging, to have a way to get out */ | 3554 | /* Set this for debugging, to have a way to get out */ |
| 3560 | int stop_character; | 3555 | int stop_character; |
| 3561 | 3556 | ||
| @@ -4226,7 +4221,7 @@ swallow_events (do_display) | |||
| 4226 | } | 4221 | } |
| 4227 | 4222 | ||
| 4228 | old_timers_run = timers_run; | 4223 | old_timers_run = timers_run; |
| 4229 | get_input_pending (&input_pending, 1); | 4224 | get_input_pending (&input_pending, READABLE_EVENTS_DO_TIMERS_NOW); |
| 4230 | 4225 | ||
| 4231 | if (timers_run != old_timers_run && do_display) | 4226 | if (timers_run != old_timers_run && do_display) |
| 4232 | redisplay_preserve_echo_area (7); | 4227 | redisplay_preserve_echo_area (7); |
| @@ -6518,18 +6513,20 @@ lucid_event_type_list_p (object) | |||
| 6518 | but works even if FIONREAD does not exist. | 6513 | but works even if FIONREAD does not exist. |
| 6519 | (In fact, this may actually read some input.) | 6514 | (In fact, this may actually read some input.) |
| 6520 | 6515 | ||
| 6521 | If DO_TIMERS_NOW is nonzero, actually run timer events that are ripe. | 6516 | If READABLE_EVENTS_DO_TIMERS_NOW is set in FLAGS, actually run |
| 6522 | If FILTER_EVENTS is nonzero, ignore internal events (FOCUS_IN_EVENT). */ | 6517 | timer events that are ripe. |
| 6518 | If READABLE_EVENTS_FILTER_EVENTS is set in FLAGS, ignore internal | ||
| 6519 | events (FOCUS_IN_EVENT). | ||
| 6520 | If READABLE_EVENTS_IGNORE_SQUEEZABLES is set in FLAGS, ignore mouse | ||
| 6521 | movements. */ | ||
| 6523 | 6522 | ||
| 6524 | static void | 6523 | static void |
| 6525 | get_filtered_input_pending (addr, do_timers_now, filter_events) | 6524 | get_input_pending (addr, flags) |
| 6526 | int *addr; | 6525 | int *addr; |
| 6527 | int do_timers_now; | 6526 | int flags; |
| 6528 | int filter_events; | ||
| 6529 | { | 6527 | { |
| 6530 | /* First of all, have we already counted some input? */ | 6528 | /* First of all, have we already counted some input? */ |
| 6531 | *addr = (!NILP (Vquit_flag) | 6529 | *addr = (!NILP (Vquit_flag) || readable_events (flags)); |
| 6532 | || readable_filtered_events (do_timers_now, filter_events)); | ||
| 6533 | 6530 | ||
| 6534 | /* If input is being read as it arrives, and we have none, there is none. */ | 6531 | /* If input is being read as it arrives, and we have none, there is none. */ |
| 6535 | if (*addr > 0 || (interrupt_input && ! interrupts_deferred)) | 6532 | if (*addr > 0 || (interrupt_input && ! interrupts_deferred)) |
| @@ -6537,23 +6534,7 @@ get_filtered_input_pending (addr, do_timers_now, filter_events) | |||
| 6537 | 6534 | ||
| 6538 | /* Try to read some input and see how much we get. */ | 6535 | /* Try to read some input and see how much we get. */ |
| 6539 | gobble_input (0); | 6536 | gobble_input (0); |
| 6540 | *addr = (!NILP (Vquit_flag) | 6537 | *addr = (!NILP (Vquit_flag) || readable_events (flags)); |
| 6541 | || readable_filtered_events (do_timers_now, filter_events)); | ||
| 6542 | } | ||
| 6543 | |||
| 6544 | /* Store into *addr a value nonzero if terminal input chars are available. | ||
| 6545 | Serves the purpose of ioctl (0, FIONREAD, addr) | ||
| 6546 | but works even if FIONREAD does not exist. | ||
| 6547 | (In fact, this may actually read some input.) | ||
| 6548 | |||
| 6549 | If DO_TIMERS_NOW is nonzero, actually run timer events that are ripe. */ | ||
| 6550 | |||
| 6551 | static void | ||
| 6552 | get_input_pending (addr, do_timers_now) | ||
| 6553 | int *addr; | ||
| 6554 | int do_timers_now; | ||
| 6555 | { | ||
| 6556 | get_filtered_input_pending (addr, do_timers_now, 0); | ||
| 6557 | } | 6538 | } |
| 6558 | 6539 | ||
| 6559 | /* Interface to read_avail_input, blocking SIGIO or SIGALRM if necessary. */ | 6540 | /* Interface to read_avail_input, blocking SIGIO or SIGALRM if necessary. */ |
| @@ -9869,6 +9850,18 @@ detect_input_pending () | |||
| 9869 | return input_pending; | 9850 | return input_pending; |
| 9870 | } | 9851 | } |
| 9871 | 9852 | ||
| 9853 | /* Return nonzero if input events other than mouse movements are | ||
| 9854 | pending. */ | ||
| 9855 | |||
| 9856 | int | ||
| 9857 | detect_input_pending_ignore_squeezables () | ||
| 9858 | { | ||
| 9859 | if (!input_pending) | ||
| 9860 | get_input_pending (&input_pending, READABLE_EVENTS_IGNORE_SQUEEZABLES); | ||
| 9861 | |||
| 9862 | return input_pending; | ||
| 9863 | } | ||
| 9864 | |||
| 9872 | /* Return nonzero if input events are pending, and run any pending timers. */ | 9865 | /* Return nonzero if input events are pending, and run any pending timers. */ |
| 9873 | 9866 | ||
| 9874 | int | 9867 | int |
| @@ -9878,7 +9871,7 @@ detect_input_pending_run_timers (do_display) | |||
| 9878 | int old_timers_run = timers_run; | 9871 | int old_timers_run = timers_run; |
| 9879 | 9872 | ||
| 9880 | if (!input_pending) | 9873 | if (!input_pending) |
| 9881 | get_input_pending (&input_pending, 1); | 9874 | get_input_pending (&input_pending, READABLE_EVENTS_DO_TIMERS_NOW); |
| 9882 | 9875 | ||
| 9883 | if (old_timers_run != timers_run && do_display) | 9876 | if (old_timers_run != timers_run && do_display) |
| 9884 | { | 9877 | { |
| @@ -9927,7 +9920,9 @@ if there is a doubt, the value is t. */) | |||
| 9927 | if (!NILP (Vunread_command_events) || unread_command_char != -1) | 9920 | if (!NILP (Vunread_command_events) || unread_command_char != -1) |
| 9928 | return (Qt); | 9921 | return (Qt); |
| 9929 | 9922 | ||
| 9930 | get_filtered_input_pending (&input_pending, 1, 1); | 9923 | get_input_pending (&input_pending, |
| 9924 | READABLE_EVENTS_DO_TIMERS_NOW | ||
| 9925 | | READABLE_EVENTS_FILTER_EVENTS); | ||
| 9931 | return input_pending > 0 ? Qt : Qnil; | 9926 | return input_pending > 0 ? Qt : Qnil; |
| 9932 | } | 9927 | } |
| 9933 | 9928 | ||
diff --git a/src/keymap.c b/src/keymap.c index ea0b1843b85..074cc1706bf 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -525,6 +525,10 @@ access_keymap (map, idx, t_ok, noinherit, autoload) | |||
| 525 | struct gcpro gcpro1; | 525 | struct gcpro gcpro1; |
| 526 | Lisp_Object meta_map; | 526 | Lisp_Object meta_map; |
| 527 | GCPRO1 (map); | 527 | GCPRO1 (map); |
| 528 | /* A strange value in which Meta is set would cause | ||
| 529 | infinite recursion. Protect against that. */ | ||
| 530 | if (meta_prefix_char & CHAR_META) | ||
| 531 | meta_prefix_char = make_number (27); | ||
| 528 | meta_map = get_keymap (access_keymap (map, meta_prefix_char, | 532 | meta_map = get_keymap (access_keymap (map, meta_prefix_char, |
| 529 | t_ok, noinherit, autoload), | 533 | t_ok, noinherit, autoload), |
| 530 | 0, autoload); | 534 | 0, autoload); |
diff --git a/src/lisp.h b/src/lisp.h index bb7766a7b82..2e82a336a66 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2481,7 +2481,7 @@ extern void syms_of_xdisp P_ ((void)); | |||
| 2481 | extern void init_xdisp P_ ((void)); | 2481 | extern void init_xdisp P_ ((void)); |
| 2482 | extern Lisp_Object safe_eval P_ ((Lisp_Object)); | 2482 | extern Lisp_Object safe_eval P_ ((Lisp_Object)); |
| 2483 | extern int pos_visible_p P_ ((struct window *, int, int *, | 2483 | extern int pos_visible_p P_ ((struct window *, int, int *, |
| 2484 | int *, int *, int)); | 2484 | int *, int *, int *, int)); |
| 2485 | 2485 | ||
| 2486 | /* Defined in vm-limit.c. */ | 2486 | /* Defined in vm-limit.c. */ |
| 2487 | extern void memory_warnings P_ ((POINTER_TYPE *, void (*warnfun) ())); | 2487 | extern void memory_warnings P_ ((POINTER_TYPE *, void (*warnfun) ())); |
| @@ -2947,6 +2947,7 @@ EXFUN (Fevent_convert_list, 1); | |||
| 2947 | EXFUN (Fread_key_sequence, 5); | 2947 | EXFUN (Fread_key_sequence, 5); |
| 2948 | EXFUN (Fset_input_mode, 4); | 2948 | EXFUN (Fset_input_mode, 4); |
| 2949 | extern int detect_input_pending P_ ((void)); | 2949 | extern int detect_input_pending P_ ((void)); |
| 2950 | extern int detect_input_pending_ignore_squeezables P_ ((void)); | ||
| 2950 | extern int detect_input_pending_run_timers P_ ((int)); | 2951 | extern int detect_input_pending_run_timers P_ ((int)); |
| 2951 | extern void safe_run_hooks P_ ((Lisp_Object)); | 2952 | extern void safe_run_hooks P_ ((Lisp_Object)); |
| 2952 | extern void cmd_error_internal P_ ((Lisp_Object, char *)); | 2953 | extern void cmd_error_internal P_ ((Lisp_Object, char *)); |
diff --git a/src/macterm.c b/src/macterm.c index d35a210e4c6..d083252d90c 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Implementation of GUI terminal on the Mac OS. | 1 | /* Implementation of GUI terminal on the Mac OS. |
| 2 | Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | 2 | Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This file is part of GNU Emacs. | 4 | This file is part of GNU Emacs. |
| 5 | 5 | ||
| @@ -731,7 +731,7 @@ mac_draw_string_common (display, w, gc, x, y, buf, nchars, mode, | |||
| 731 | int nchars, mode, bytes_per_char; | 731 | int nchars, mode, bytes_per_char; |
| 732 | { | 732 | { |
| 733 | SetPortWindowPort (w); | 733 | SetPortWindowPort (w); |
| 734 | #ifdef MAC_OSX | 734 | #ifdef MAC_OS_X_VERSION_10_2 |
| 735 | UInt32 textFlags, savedFlags; | 735 | UInt32 textFlags, savedFlags; |
| 736 | if (!NILP(Vmac_use_core_graphics)) { | 736 | if (!NILP(Vmac_use_core_graphics)) { |
| 737 | textFlags = kQDUseCGTextRendering; | 737 | textFlags = kQDUseCGTextRendering; |
| @@ -748,7 +748,7 @@ mac_draw_string_common (display, w, gc, x, y, buf, nchars, mode, | |||
| 748 | 748 | ||
| 749 | MoveTo (x, y); | 749 | MoveTo (x, y); |
| 750 | DrawText (buf, 0, nchars * bytes_per_char); | 750 | DrawText (buf, 0, nchars * bytes_per_char); |
| 751 | #ifdef MAC_OSX | 751 | #ifdef MAC_OS_X_VERSION_10_2 |
| 752 | if (!NILP(Vmac_use_core_graphics)) | 752 | if (!NILP(Vmac_use_core_graphics)) |
| 753 | SwapQDTextFlags(savedFlags); | 753 | SwapQDTextFlags(savedFlags); |
| 754 | #endif | 754 | #endif |
| @@ -2648,15 +2648,9 @@ x_draw_glyph_string_box (s) | |||
| 2648 | struct glyph *last_glyph; | 2648 | struct glyph *last_glyph; |
| 2649 | Rect clip_rect; | 2649 | Rect clip_rect; |
| 2650 | 2650 | ||
| 2651 | last_x = window_box_right (s->w, s->area); | 2651 | last_x = ((s->row->full_width_p && !s->w->pseudo_window_p) |
| 2652 | if (s->row->full_width_p | 2652 | ? WINDOW_RIGHT_EDGE_X (s->w) |
| 2653 | && !s->w->pseudo_window_p) | 2653 | : window_box_right (s->w, s->area)); |
| 2654 | { | ||
| 2655 | last_x += WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH (s->w); | ||
| 2656 | if (s->area != RIGHT_MARGIN_AREA | ||
| 2657 | || WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (s->w)) | ||
| 2658 | last_x += WINDOW_RIGHT_FRINGE_WIDTH (s->w); | ||
| 2659 | } | ||
| 2660 | 2654 | ||
| 2661 | /* The glyph that may have a right box line. */ | 2655 | /* The glyph that may have a right box line. */ |
| 2662 | last_glyph = (s->cmp || s->img | 2656 | last_glyph = (s->cmp || s->img |
| @@ -5951,7 +5945,7 @@ decode_mac_font_name (name, size, scriptcode) | |||
| 5951 | 5945 | ||
| 5952 | 5946 | ||
| 5953 | static char * | 5947 | static char * |
| 5954 | mac_to_x_fontname (name, size, style, scriptcode, encoding_base) | 5948 | mac_to_x_fontname (name, size, style, scriptcode) |
| 5955 | char *name; | 5949 | char *name; |
| 5956 | int size; | 5950 | int size; |
| 5957 | Style style; | 5951 | Style style; |
| @@ -6822,7 +6816,7 @@ XLoadQueryFont (Display *dpy, char *fontname) | |||
| 6822 | font->max_bounds.width = max_width; | 6816 | font->max_bounds.width = max_width; |
| 6823 | } | 6817 | } |
| 6824 | } | 6818 | } |
| 6825 | 6819 | ||
| 6826 | TextFont (old_fontnum); /* restore previous font number, size and face */ | 6820 | TextFont (old_fontnum); /* restore previous font number, size and face */ |
| 6827 | TextSize (old_fontsize); | 6821 | TextSize (old_fontsize); |
| 6828 | TextFace (old_fontface); | 6822 | TextFace (old_fontface); |
| @@ -9950,7 +9944,9 @@ Toolbox for processing before Emacs sees it. */); | |||
| 9950 | #endif | 9944 | #endif |
| 9951 | 9945 | ||
| 9952 | DEFVAR_LISP ("mac-allow-anti-aliasing", &Vmac_use_core_graphics, | 9946 | DEFVAR_LISP ("mac-allow-anti-aliasing", &Vmac_use_core_graphics, |
| 9953 | doc: /* If non-nil, the text will be rendered using Core Graphics text rendering which may anti-alias the text. */); | 9947 | doc: /* If non-nil, allow anti-aliasing. |
| 9948 | The text will be rendered using Core Graphics text rendering which | ||
| 9949 | may anti-alias the text. */); | ||
| 9954 | Vmac_use_core_graphics = Qnil; | 9950 | Vmac_use_core_graphics = Qnil; |
| 9955 | 9951 | ||
| 9956 | DEFVAR_INT ("mac-keyboard-text-encoding", &mac_keyboard_text_encoding, | 9952 | DEFVAR_INT ("mac-keyboard-text-encoding", &mac_keyboard_text_encoding, |
diff --git a/src/process.c b/src/process.c index ac92678c8e0..1bd8b3ae64d 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -187,6 +187,7 @@ extern Lisp_Object QCfilter; | |||
| 187 | #include "syswait.h" | 187 | #include "syswait.h" |
| 188 | 188 | ||
| 189 | extern void set_waiting_for_input P_ ((EMACS_TIME *)); | 189 | extern void set_waiting_for_input P_ ((EMACS_TIME *)); |
| 190 | extern char *get_operating_system_release (); | ||
| 190 | 191 | ||
| 191 | #ifndef USE_CRT_DLL | 192 | #ifndef USE_CRT_DLL |
| 192 | extern int errno; | 193 | extern int errno; |
| @@ -6702,6 +6703,19 @@ init_process () | |||
| 6702 | Fprovide (intern ("make-network-process"), subfeatures); | 6703 | Fprovide (intern ("make-network-process"), subfeatures); |
| 6703 | } | 6704 | } |
| 6704 | #endif /* HAVE_SOCKETS */ | 6705 | #endif /* HAVE_SOCKETS */ |
| 6706 | |||
| 6707 | #ifdef DARWIN | ||
| 6708 | /* PTYs are broken on Darwin < 6, but are sometimes useful for interactive | ||
| 6709 | processes. As such, we only change the default value. */ | ||
| 6710 | if (initialized) | ||
| 6711 | { | ||
| 6712 | char *release = get_operating_system_release(); | ||
| 6713 | if (!release || !release[0] || (release[0] < MIN_PTY_KERNEL_VERSION | ||
| 6714 | && release[1] == '.')) { | ||
| 6715 | Vprocess_connection_type = Qnil; | ||
| 6716 | } | ||
| 6717 | } | ||
| 6718 | #endif | ||
| 6705 | } | 6719 | } |
| 6706 | 6720 | ||
| 6707 | void | 6721 | void |
diff --git a/src/s/darwin.h b/src/s/darwin.h index 9f78405a43c..5b162ea08a3 100644 --- a/src/s/darwin.h +++ b/src/s/darwin.h | |||
| @@ -37,6 +37,10 @@ Boston, MA 02111-1307, USA. */ | |||
| 37 | #define BSD_SYSTEM | 37 | #define BSD_SYSTEM |
| 38 | /* #define VMS */ | 38 | /* #define VMS */ |
| 39 | 39 | ||
| 40 | #ifndef DARWIN | ||
| 41 | #define DARWIN 1 | ||
| 42 | #endif | ||
| 43 | |||
| 40 | /* MAC_OS is used to conditionally compile code common to both MAC_OS8 | 44 | /* MAC_OS is used to conditionally compile code common to both MAC_OS8 |
| 41 | and MAC_OSX. */ | 45 | and MAC_OSX. */ |
| 42 | #ifdef MAC_OSX | 46 | #ifdef MAC_OSX |
| @@ -103,10 +107,18 @@ Boston, MA 02111-1307, USA. */ | |||
| 103 | 107 | ||
| 104 | /* | 108 | /* |
| 105 | * Define HAVE_PTYS if the system supports pty devices. | 109 | * Define HAVE_PTYS if the system supports pty devices. |
| 110 | * Note: PTYs are broken on darwin <6. Use at your own risk. | ||
| 106 | */ | 111 | */ |
| 107 | 112 | ||
| 108 | #define HAVE_PTYS | 113 | #define HAVE_PTYS |
| 109 | 114 | ||
| 115 | /** | ||
| 116 | * PTYs only work correctly on Darwin 7 or higher. So make the | ||
| 117 | * default for process-connection-type dependent on the kernel | ||
| 118 | * version. | ||
| 119 | */ | ||
| 120 | #define MIN_PTY_KERNEL_VERSION '7' | ||
| 121 | |||
| 110 | /* | 122 | /* |
| 111 | * Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate | 123 | * Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate |
| 112 | * The 4.2 opendir, etc., library functions. | 124 | * The 4.2 opendir, etc., library functions. |
diff --git a/src/w32term.c b/src/w32term.c index 9ed4eb3b64e..bffdd8f2565 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -2072,15 +2072,9 @@ x_draw_glyph_string_box (s) | |||
| 2072 | struct glyph *last_glyph; | 2072 | struct glyph *last_glyph; |
| 2073 | RECT clip_rect; | 2073 | RECT clip_rect; |
| 2074 | 2074 | ||
| 2075 | last_x = window_box_right (s->w, s->area); | 2075 | last_x = ((s->row->full_width_p && !s->w->pseudo_window_p) |
| 2076 | if (s->row->full_width_p | 2076 | ? WINDOW_RIGHT_EDGE_X (s->w) |
| 2077 | && !s->w->pseudo_window_p) | 2077 | : window_box_right (s->w, s->area)); |
| 2078 | { | ||
| 2079 | last_x += WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH (s->w); | ||
| 2080 | if (s->area != RIGHT_MARGIN_AREA | ||
| 2081 | || WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (s->w)) | ||
| 2082 | last_x += WINDOW_RIGHT_FRINGE_WIDTH (s->w); | ||
| 2083 | } | ||
| 2084 | 2078 | ||
| 2085 | /* The glyph that may have a right box line. */ | 2079 | /* The glyph that may have a right box line. */ |
| 2086 | last_glyph = (s->cmp || s->img | 2080 | last_glyph = (s->cmp || s->img |
diff --git a/src/window.c b/src/window.c index 27aa8102290..9b8a031f6c1 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -124,6 +124,11 @@ Lisp_Object Vother_window_scroll_buffer; | |||
| 124 | 124 | ||
| 125 | Lisp_Object Vtemp_buffer_show_function; | 125 | Lisp_Object Vtemp_buffer_show_function; |
| 126 | 126 | ||
| 127 | /* Non-zero means line and page scrolling on tall lines (with images) | ||
| 128 | does partial scrolling by modifying window-vscroll. */ | ||
| 129 | |||
| 130 | int auto_window_vscroll_p; | ||
| 131 | |||
| 127 | /* Non-zero means to use mode-line-inactive face in all windows but the | 132 | /* Non-zero means to use mode-line-inactive face in all windows but the |
| 128 | selected-window and the minibuffer-scroll-window when the | 133 | selected-window and the minibuffer-scroll-window when the |
| 129 | minibuffer is active. */ | 134 | minibuffer is active. */ |
| @@ -328,9 +333,11 @@ If POS is only out of view because of horizontal scrolling, return non-nil. | |||
| 328 | POS defaults to point in WINDOW; WINDOW defaults to the selected window. | 333 | POS defaults to point in WINDOW; WINDOW defaults to the selected window. |
| 329 | 334 | ||
| 330 | If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil, | 335 | If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil, |
| 331 | return value is a list (X Y FULLY) where X and Y are the pixel coordinates | 336 | return value is a list (X Y FULLY [RTOP RBOT]) where X and Y are the pixel |
| 332 | relative to the top left corner of the window, and FULLY is t if the | 337 | coordinates relative to the top left corner of the window, and FULLY is t if the |
| 333 | character after POS is fully visible and nil otherwise. */) | 338 | character after POS is fully visible and nil otherwise. If FULLY is nil, |
| 339 | RTOP and RBOT are the number of pixels invisible at the top and bottom row | ||
| 340 | of the window. */) | ||
| 334 | (pos, window, partially) | 341 | (pos, window, partially) |
| 335 | Lisp_Object pos, window, partially; | 342 | Lisp_Object pos, window, partially; |
| 336 | { | 343 | { |
| @@ -339,7 +346,7 @@ character after POS is fully visible and nil otherwise. */) | |||
| 339 | register struct buffer *buf; | 346 | register struct buffer *buf; |
| 340 | struct text_pos top; | 347 | struct text_pos top; |
| 341 | Lisp_Object in_window = Qnil; | 348 | Lisp_Object in_window = Qnil; |
| 342 | int fully_p = 1; | 349 | int rtop, rbot, fully_p = 1; |
| 343 | int x, y; | 350 | int x, y; |
| 344 | 351 | ||
| 345 | w = decode_window (window); | 352 | w = decode_window (window); |
| @@ -362,14 +369,19 @@ character after POS is fully visible and nil otherwise. */) | |||
| 362 | && posint <= BUF_ZV (buf) | 369 | && posint <= BUF_ZV (buf) |
| 363 | && CHARPOS (top) >= BUF_BEGV (buf) | 370 | && CHARPOS (top) >= BUF_BEGV (buf) |
| 364 | && CHARPOS (top) <= BUF_ZV (buf) | 371 | && CHARPOS (top) <= BUF_ZV (buf) |
| 365 | && pos_visible_p (w, posint, &fully_p, &x, &y, NILP (partially)) | 372 | && pos_visible_p (w, posint, &x, &y, &rtop, &rbot, NILP (partially)) |
| 366 | && (!NILP (partially) || fully_p)) | 373 | && (fully_p = !rtop && !rbot, (!NILP (partially) || fully_p))) |
| 367 | in_window = Qt; | 374 | in_window = Qt; |
| 368 | 375 | ||
| 369 | if (!NILP (in_window) && !NILP (partially)) | 376 | if (!NILP (in_window) && !NILP (partially)) |
| 370 | in_window = Fcons (make_number (x), | 377 | in_window = Fcons (make_number (x), |
| 371 | Fcons (make_number (y), | 378 | Fcons (make_number (y), |
| 372 | Fcons (fully_p ? Qt : Qnil, Qnil))); | 379 | Fcons (fully_p ? Qt : Qnil, |
| 380 | (fully_p | ||
| 381 | ? Qnil | ||
| 382 | : Fcons (make_number (rtop), | ||
| 383 | Fcons (make_number (rbot), | ||
| 384 | Qnil)))))); | ||
| 373 | return in_window; | 385 | return in_window; |
| 374 | } | 386 | } |
| 375 | 387 | ||
| @@ -4564,6 +4576,31 @@ window_scroll_pixel_based (window, n, whole, noerror) | |||
| 4564 | 4576 | ||
| 4565 | start = it.current.pos; | 4577 | start = it.current.pos; |
| 4566 | } | 4578 | } |
| 4579 | else if (auto_window_vscroll_p) | ||
| 4580 | { | ||
| 4581 | if (NILP (XCAR (XCDR (XCDR (tem))))) | ||
| 4582 | { | ||
| 4583 | int px; | ||
| 4584 | int dy = WINDOW_FRAME_LINE_HEIGHT (w); | ||
| 4585 | if (whole) | ||
| 4586 | dy = window_box_height (w) - next_screen_context_lines * dy; | ||
| 4587 | dy *= n; | ||
| 4588 | |||
| 4589 | if (n < 0 && (px = XINT (Fnth (make_number (3), tem))) > 0) | ||
| 4590 | { | ||
| 4591 | px = max (0, -w->vscroll - min (px, -dy)); | ||
| 4592 | Fset_window_vscroll (window, make_number (px), Qt); | ||
| 4593 | return; | ||
| 4594 | } | ||
| 4595 | if (n > 0 && (px = XINT (Fnth (make_number (4), tem))) > 0) | ||
| 4596 | { | ||
| 4597 | px = max (0, -w->vscroll + min (px, dy)); | ||
| 4598 | Fset_window_vscroll (window, make_number (px), Qt); | ||
| 4599 | return; | ||
| 4600 | } | ||
| 4601 | } | ||
| 4602 | Fset_window_vscroll (window, make_number (0), Qt); | ||
| 4603 | } | ||
| 4567 | 4604 | ||
| 4568 | /* If scroll_preserve_screen_position is non-nil, we try to set | 4605 | /* If scroll_preserve_screen_position is non-nil, we try to set |
| 4569 | point in the same window line as it is now, so get that line. */ | 4606 | point in the same window line as it is now, so get that line. */ |
| @@ -6335,13 +6372,16 @@ If PIXELS-P is non-nil, the return value is VSCROLL. */) | |||
| 6335 | : XFLOATINT (vscroll)); | 6372 | : XFLOATINT (vscroll)); |
| 6336 | w->vscroll = min (w->vscroll, 0); | 6373 | w->vscroll = min (w->vscroll, 0); |
| 6337 | 6374 | ||
| 6338 | /* Adjust glyph matrix of the frame if the virtual display | 6375 | if (w->vscroll != old_dy) |
| 6339 | area becomes larger than before. */ | 6376 | { |
| 6340 | if (w->vscroll < 0 && w->vscroll < old_dy) | 6377 | /* Adjust glyph matrix of the frame if the virtual display |
| 6341 | adjust_glyphs (f); | 6378 | area becomes larger than before. */ |
| 6379 | if (w->vscroll < 0 && w->vscroll < old_dy) | ||
| 6380 | adjust_glyphs (f); | ||
| 6342 | 6381 | ||
| 6343 | /* Prevent redisplay shortcuts. */ | 6382 | /* Prevent redisplay shortcuts. */ |
| 6344 | XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; | 6383 | XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; |
| 6384 | } | ||
| 6345 | } | 6385 | } |
| 6346 | 6386 | ||
| 6347 | return Fwindow_vscroll (window, pixels_p); | 6387 | return Fwindow_vscroll (window, pixels_p); |
| @@ -6653,6 +6693,10 @@ is displayed in the `mode-line' face. */); | |||
| 6653 | doc: /* *Non-nil means `display-buffer' should make a separate frame. */); | 6693 | doc: /* *Non-nil means `display-buffer' should make a separate frame. */); |
| 6654 | pop_up_frames = 0; | 6694 | pop_up_frames = 0; |
| 6655 | 6695 | ||
| 6696 | DEFVAR_BOOL ("auto-window-vscroll", &auto_window_vscroll_p, | ||
| 6697 | doc: /* *Non-nil means to automatically adjust `window-vscroll' to view tall lines. */); | ||
| 6698 | auto_window_vscroll_p = 1; | ||
| 6699 | |||
| 6656 | DEFVAR_BOOL ("display-buffer-reuse-frames", &display_buffer_reuse_frames, | 6700 | DEFVAR_BOOL ("display-buffer-reuse-frames", &display_buffer_reuse_frames, |
| 6657 | doc: /* *Non-nil means `display-buffer' should reuse frames. | 6701 | doc: /* *Non-nil means `display-buffer' should reuse frames. |
| 6658 | If the buffer in question is already displayed in a frame, raise that frame. */); | 6702 | If the buffer in question is already displayed in a frame, raise that frame. */); |
diff --git a/src/xdisp.c b/src/xdisp.c index 950ec6c57b2..6a59de7ef8d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -1246,15 +1246,16 @@ line_bottom_y (it) | |||
| 1246 | } | 1246 | } |
| 1247 | 1247 | ||
| 1248 | 1248 | ||
| 1249 | /* Return 1 if position CHARPOS is visible in window W. Set *FULLY to | 1249 | /* Return 1 if position CHARPOS is visible in window W. |
| 1250 | 1 if POS is visible and the line containing POS is fully visible. | 1250 | If visible, set *X and *Y to pixel coordinates of top left corner. |
| 1251 | Set *RTOP and *RBOT to pixel height of an invisible area of glyph at POS. | ||
| 1251 | EXACT_MODE_LINE_HEIGHTS_P non-zero means compute exact mode-line | 1252 | EXACT_MODE_LINE_HEIGHTS_P non-zero means compute exact mode-line |
| 1252 | and header-lines heights. */ | 1253 | and header-lines heights. */ |
| 1253 | 1254 | ||
| 1254 | int | 1255 | int |
| 1255 | pos_visible_p (w, charpos, fully, x, y, exact_mode_line_heights_p) | 1256 | pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p) |
| 1256 | struct window *w; | 1257 | struct window *w; |
| 1257 | int charpos, *fully, *x, *y, exact_mode_line_heights_p; | 1258 | int charpos, *x, *y, *rtop, *rbot, exact_mode_line_heights_p; |
| 1258 | { | 1259 | { |
| 1259 | struct it it; | 1260 | struct it it; |
| 1260 | struct text_pos top; | 1261 | struct text_pos top; |
| @@ -1267,7 +1268,7 @@ pos_visible_p (w, charpos, fully, x, y, exact_mode_line_heights_p) | |||
| 1267 | set_buffer_internal_1 (XBUFFER (w->buffer)); | 1268 | set_buffer_internal_1 (XBUFFER (w->buffer)); |
| 1268 | } | 1269 | } |
| 1269 | 1270 | ||
| 1270 | *fully = visible_p = 0; | 1271 | visible_p = 0; |
| 1271 | SET_TEXT_POS_FROM_MARKER (top, w->start); | 1272 | SET_TEXT_POS_FROM_MARKER (top, w->start); |
| 1272 | 1273 | ||
| 1273 | /* Compute exact mode line heights, if requested. */ | 1274 | /* Compute exact mode line heights, if requested. */ |
| @@ -1298,14 +1299,16 @@ pos_visible_p (w, charpos, fully, x, y, exact_mode_line_heights_p) | |||
| 1298 | if (top_y < window_top_y) | 1299 | if (top_y < window_top_y) |
| 1299 | visible_p = bottom_y > window_top_y; | 1300 | visible_p = bottom_y > window_top_y; |
| 1300 | else if (top_y < it.last_visible_y) | 1301 | else if (top_y < it.last_visible_y) |
| 1301 | { | ||
| 1302 | visible_p = 1; | 1302 | visible_p = 1; |
| 1303 | *fully = bottom_y <= it.last_visible_y; | ||
| 1304 | } | ||
| 1305 | if (visible_p && x) | 1303 | if (visible_p && x) |
| 1306 | { | 1304 | { |
| 1307 | *x = it.current_x; | 1305 | *x = it.current_x; |
| 1308 | *y = max (top_y + it.max_ascent - it.ascent, window_top_y); | 1306 | *y = max (top_y + it.max_ascent - it.ascent, window_top_y); |
| 1307 | if (rtop) | ||
| 1308 | { | ||
| 1309 | *rtop = max (0, window_top_y - top_y); | ||
| 1310 | *rbot = max (0, bottom_y - it.last_visible_y); | ||
| 1311 | } | ||
| 1309 | } | 1312 | } |
| 1310 | } | 1313 | } |
| 1311 | else if (it.current_y + it.max_ascent + it.max_descent > it.last_visible_y) | 1314 | else if (it.current_y + it.max_ascent + it.max_descent > it.last_visible_y) |
| @@ -1322,6 +1325,11 @@ pos_visible_p (w, charpos, fully, x, y, exact_mode_line_heights_p) | |||
| 1322 | move_it_to (&it2, charpos, -1, -1, -1, MOVE_TO_POS); | 1325 | move_it_to (&it2, charpos, -1, -1, -1, MOVE_TO_POS); |
| 1323 | *x = it2.current_x; | 1326 | *x = it2.current_x; |
| 1324 | *y = it2.current_y + it2.max_ascent - it2.ascent; | 1327 | *y = it2.current_y + it2.max_ascent - it2.ascent; |
| 1328 | if (rtop) | ||
| 1329 | { | ||
| 1330 | *rtop = 0; | ||
| 1331 | *rbot = max (0, (it2.current_y + it2.max_ascent + it2.max_descent) - it.last_visible_y); | ||
| 1332 | } | ||
| 1325 | } | 1333 | } |
| 1326 | } | 1334 | } |
| 1327 | } | 1335 | } |
| @@ -4669,51 +4677,52 @@ static void | |||
| 4669 | back_to_previous_visible_line_start (it) | 4677 | back_to_previous_visible_line_start (it) |
| 4670 | struct it *it; | 4678 | struct it *it; |
| 4671 | { | 4679 | { |
| 4672 | int visible_p = 0; | 4680 | while (IT_CHARPOS (*it) > BEGV) |
| 4673 | |||
| 4674 | /* Go back one newline if not on BEGV already. */ | ||
| 4675 | if (IT_CHARPOS (*it) > BEGV) | ||
| 4676 | back_to_previous_line_start (it); | ||
| 4677 | |||
| 4678 | /* Move over lines that are invisible because of selective display | ||
| 4679 | or text properties. */ | ||
| 4680 | while (IT_CHARPOS (*it) > BEGV | ||
| 4681 | && !visible_p) | ||
| 4682 | { | 4681 | { |
| 4683 | visible_p = 1; | 4682 | back_to_previous_line_start (it); |
| 4683 | if (IT_CHARPOS (*it) <= BEGV) | ||
| 4684 | break; | ||
| 4684 | 4685 | ||
| 4685 | /* If selective > 0, then lines indented more than that values | 4686 | /* If selective > 0, then lines indented more than that values |
| 4686 | are invisible. */ | 4687 | are invisible. */ |
| 4687 | if (it->selective > 0 | 4688 | if (it->selective > 0 |
| 4688 | && indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it), | 4689 | && indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it), |
| 4689 | (double) it->selective)) /* iftc */ | 4690 | (double) it->selective)) /* iftc */ |
| 4690 | visible_p = 0; | 4691 | continue; |
| 4691 | else | ||
| 4692 | { | ||
| 4693 | Lisp_Object prop; | ||
| 4694 | 4692 | ||
| 4695 | /* Check the newline before point for invisibility. */ | 4693 | /* Check the newline before point for invisibility. */ |
| 4696 | prop = Fget_char_property (make_number (IT_CHARPOS (*it) - 1), | 4694 | { |
| 4695 | Lisp_Object prop; | ||
| 4696 | prop = Fget_char_property (make_number (IT_CHARPOS (*it) - 1), | ||
| 4697 | Qinvisible, it->window); | 4697 | Qinvisible, it->window); |
| 4698 | if (TEXT_PROP_MEANS_INVISIBLE (prop)) | 4698 | if (TEXT_PROP_MEANS_INVISIBLE (prop)) |
| 4699 | visible_p = 0; | 4699 | continue; |
| 4700 | } | 4700 | } |
| 4701 | |||
| 4702 | #if 0 | ||
| 4703 | /* Commenting this out fixes the bug described in | ||
| 4704 | http://www.math.ku.dk/~larsh/emacs/emacs-loops-on-large-images/test-case.txt. */ | ||
| 4705 | if (visible_p) | ||
| 4706 | { | ||
| 4707 | struct it it2 = *it; | ||
| 4708 | |||
| 4709 | if (handle_display_prop (&it2) == HANDLED_RETURN) | ||
| 4710 | visible_p = 0; | ||
| 4711 | } | ||
| 4712 | #endif | ||
| 4713 | 4701 | ||
| 4714 | /* Back one more newline if the current one is invisible. */ | 4702 | /* If newline has a display property that replaces the newline with something |
| 4715 | if (!visible_p) | 4703 | else (image or text), find start of overlay or interval and continue search |
| 4716 | back_to_previous_line_start (it); | 4704 | from that point. */ |
| 4705 | { | ||
| 4706 | struct it it2 = *it; | ||
| 4707 | int pos = IT_CHARPOS (*it); | ||
| 4708 | int beg, end; | ||
| 4709 | Lisp_Object val, overlay; | ||
| 4710 | |||
| 4711 | if (handle_display_prop (&it2) == HANDLED_RETURN | ||
| 4712 | && !NILP (val = get_char_property_and_overlay | ||
| 4713 | (make_number (pos), Qdisplay, Qnil, &overlay)) | ||
| 4714 | && (OVERLAYP (overlay) | ||
| 4715 | ? (beg = OVERLAY_POSITION (OVERLAY_START (overlay))) | ||
| 4716 | : get_property_and_range (pos, Qdisplay, &val, &beg, &end, Qnil))) | ||
| 4717 | { | ||
| 4718 | if (beg < BEGV) | ||
| 4719 | beg = BEGV; | ||
| 4720 | IT_CHARPOS (*it) = beg; | ||
| 4721 | IT_BYTEPOS (*it) = buf_charpos_to_bytepos (current_buffer, beg); | ||
| 4722 | continue; | ||
| 4723 | } | ||
| 4724 | } | ||
| 4725 | break; | ||
| 4717 | } | 4726 | } |
| 4718 | 4727 | ||
| 4719 | xassert (IT_CHARPOS (*it) >= BEGV); | 4728 | xassert (IT_CHARPOS (*it) >= BEGV); |
| @@ -20751,6 +20760,28 @@ fast_find_position (w, charpos, hpos, vpos, x, y, stop) | |||
| 20751 | past_end = 1; | 20760 | past_end = 1; |
| 20752 | } | 20761 | } |
| 20753 | 20762 | ||
| 20763 | /* If whole rows or last part of a row came from a display overlay, | ||
| 20764 | row_containing_pos will skip over such rows because their end pos | ||
| 20765 | equals the start pos of the overlay or interval. Backtrack if we | ||
| 20766 | have a STOP object and previous row's end glyph came from STOP. */ | ||
| 20767 | if (!NILP (stop)) | ||
| 20768 | { | ||
| 20769 | struct glyph_row *prev = row-1; | ||
| 20770 | while ((prev = row - 1, prev >= first) | ||
| 20771 | && MATRIX_ROW_END_CHARPOS (prev) == charpos | ||
| 20772 | && prev->used[TEXT_AREA] > 0) | ||
| 20773 | { | ||
| 20774 | end = prev->glyphs[TEXT_AREA]; | ||
| 20775 | glyph = end + prev->used[TEXT_AREA]; | ||
| 20776 | while (--glyph >= end | ||
| 20777 | && INTEGERP (glyph->object)); | ||
| 20778 | if (glyph >= end | ||
| 20779 | && !EQ (stop, glyph->object)) | ||
| 20780 | break; | ||
| 20781 | row = prev; | ||
| 20782 | } | ||
| 20783 | } | ||
| 20784 | |||
| 20754 | *x = row->x; | 20785 | *x = row->x; |
| 20755 | *y = row->y; | 20786 | *y = row->y; |
| 20756 | *vpos = MATRIX_ROW_VPOS (row, w->current_matrix); | 20787 | *vpos = MATRIX_ROW_VPOS (row, w->current_matrix); |
| @@ -21212,9 +21243,9 @@ note_mode_line_or_margin_highlight (w, x, y, area) | |||
| 21212 | help_echo_pos = charpos; | 21243 | help_echo_pos = charpos; |
| 21213 | } | 21244 | } |
| 21214 | } | 21245 | } |
| 21215 | if (NILP (pointer)) | ||
| 21216 | pointer = Fsafe_plist_get (XCDR (object), QCpointer); | ||
| 21217 | } | 21246 | } |
| 21247 | if (NILP (pointer)) | ||
| 21248 | pointer = Fsafe_plist_get (XCDR (object), QCpointer); | ||
| 21218 | } | 21249 | } |
| 21219 | 21250 | ||
| 21220 | if (STRINGP (string)) | 21251 | if (STRINGP (string)) |
diff --git a/src/xterm.c b/src/xterm.c index d0b595ea73c..a68725a463c 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -2133,15 +2133,9 @@ x_draw_glyph_string_box (s) | |||
| 2133 | struct glyph *last_glyph; | 2133 | struct glyph *last_glyph; |
| 2134 | XRectangle clip_rect; | 2134 | XRectangle clip_rect; |
| 2135 | 2135 | ||
| 2136 | last_x = window_box_right (s->w, s->area); | 2136 | last_x = ((s->row->full_width_p && !s->w->pseudo_window_p) |
| 2137 | if (s->row->full_width_p | 2137 | ? WINDOW_RIGHT_EDGE_X (s->w) |
| 2138 | && !s->w->pseudo_window_p) | 2138 | : window_box_right (s->w, s->area)); |
| 2139 | { | ||
| 2140 | last_x += WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH (s->w); | ||
| 2141 | if (s->area != RIGHT_MARGIN_AREA | ||
| 2142 | || WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (s->w)) | ||
| 2143 | last_x += WINDOW_RIGHT_FRINGE_WIDTH (s->w); | ||
| 2144 | } | ||
| 2145 | 2139 | ||
| 2146 | /* The glyph that may have a right box line. */ | 2140 | /* The glyph that may have a right box line. */ |
| 2147 | last_glyph = (s->cmp || s->img | 2141 | last_glyph = (s->cmp || s->img |
| @@ -4335,7 +4329,7 @@ xg_scroll_callback (widget, data) | |||
| 4335 | } | 4329 | } |
| 4336 | 4330 | ||
| 4337 | if (part >= 0) | 4331 | if (part >= 0) |
| 4338 | { | 4332 | { |
| 4339 | window_being_scrolled = bar->window; | 4333 | window_being_scrolled = bar->window; |
| 4340 | last_scroll_bar_part = part; | 4334 | last_scroll_bar_part = part; |
| 4341 | x_send_scroll_bar_event (bar->window, part, portion, whole); | 4335 | x_send_scroll_bar_event (bar->window, part, portion, whole); |