diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/.gdbinit | 6 | ||||
| -rw-r--r-- | src/ChangeLog | 48 | ||||
| -rw-r--r-- | src/callproc.c | 3 | ||||
| -rw-r--r-- | src/emacs.c | 3 | ||||
| -rw-r--r-- | src/keymap.c | 129 | ||||
| -rw-r--r-- | src/lread.c | 33 | ||||
| -rw-r--r-- | src/minibuf.c | 19 | ||||
| -rw-r--r-- | src/process.c | 2 | ||||
| -rw-r--r-- | src/term.c | 16 | ||||
| -rw-r--r-- | src/textprop.c | 6 |
10 files changed, 234 insertions, 31 deletions
diff --git a/src/.gdbinit b/src/.gdbinit index 10f993fdd9f..4120b1e10bf 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -764,6 +764,12 @@ show environment DISPLAY show environment TERM #set args -geometry 80x40+0+0 +# People get bothered when they see messages about non-existent functions... +echo \n +echo If you see messages below about functions not being defined,\n +echo don\'t worry about them. Nothing is wrong.\n +echo \n + # Don't let abort actually run, as it will make # stdio stop working and therefore the `pr' command above as well. break abort diff --git a/src/ChangeLog b/src/ChangeLog index 4f6cb895004..6ad7c939bce 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,51 @@ +2006-01-01 Ken Raeburn <raeburn@gnu.org> + + * callproc.c (Fcall_process_region): Bind file-name-handler-alist + to nil for the call to Fwrite_region. + +2005-12-31 Richard M. Stallman <rms@gnu.org> + + * minibuf.c (read_minibuf): Clear out all other minibuffer windows. + +2005-12-31 Eli Zaretskii <eliz@gnu.org> + + * emacs.c (gdb_pvec_type): A dummy variable for GDB's sake. + +2005-12-30 Luc Teirlinck <teirllm@auburn.edu> + + * textprop.c (set_text_properties): Reword description of return value. + Return Qnil if caller wants to remove all text properties from a + string and the string already has no intervals. + +2005-12-30 Stefan Monnier <monnier@iro.umontreal.ca> + + * term.c (visible_cursor): New boolean var. + (set_terminal_modes, tty_show_cursor): Use "vs" or "ve" depending on + visible_cursor. + (syms_of_term): Export the new var as "visible-cursor". + +2005-12-30 Eli Zaretskii <eliz@gnu.org> + + * .gdbinit: Tell users not to worry about GDB warnings that some + functions do not exist in the binary. + +2005-12-30 Andreas Schwab <schwab@suse.de> + + * process.c (Fnetwork_interface_info): Correctly terminate the + loop over ifflag_table. + +2005-12-29 Richard M. Stallman <rms@gnu.org> + + * lread.c (readevalloop): Test for reading a whole buffer + before actually reading anything. Handle all cases, including + START = END = nil and an already-narrowed buffer. + Convert END to a marker if it is a number. + + * keymap.c (describe_map): Put sparse map elements into an array, + sort them, then output a sequence of identical bindings on one line. + (struct describe_map_elt): New data type. + (describe_map_compare): New function. + 2005-12-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> * gtkutil.c (xg_get_file_with_chooser): Changed message shown diff --git a/src/callproc.c b/src/callproc.c index f38b7c03ab3..c7804b485c7 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -1133,6 +1133,9 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r int count1 = SPECPDL_INDEX (); specbind (intern ("coding-system-for-write"), val); + /* POSIX lets mk[s]temp use "."; don't invoke jka-compr if we + happen to get a ".Z" suffix. */ + specbind (intern ("file-name-handler-alist"), Qnil); Fwrite_region (start, end, filename_string, Qnil, Qlambda, Qnil, Qnil); unbind_to (count1, Qnil); diff --git a/src/emacs.c b/src/emacs.c index 142da86df95..d38cf4379bf 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -113,6 +113,9 @@ EMACS_INT gdb_data_seg_bits = 0; #endif EMACS_INT PVEC_FLAG = PSEUDOVECTOR_FLAG; EMACS_INT gdb_array_mark_flag = ARRAY_MARK_FLAG; +/* GDB might say "No enum type named pvec_type" if we don't have at + least one symbol with that type, and then xbacktrace could fail. */ +enum pvec_type gdb_pvec_type = PVEC_TYPE_MASK; /* Command line args from shell, as list of strings. */ Lisp_Object Vcommand_line_args; diff --git a/src/keymap.c b/src/keymap.c index 97789a75f1d..64069ca4deb 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -3167,6 +3167,34 @@ describe_translation (definition, args) insert_string ("??\n"); } +/* describe_map puts all the usable elements of a sparse keymap + into an array of `struct describe_map_elt', + then sorts them by the events. */ + +struct describe_map_elt { Lisp_Object event; Lisp_Object definition; int shadowed; }; + +/* qsort comparison function for sorting `struct describe_map_elt' by + the event field. */ + +static int +describe_map_compare (aa, bb) + const void *aa, *bb; +{ + const struct describe_map_elt *a = aa, *b = bb; + if (INTEGERP (a->event) && INTEGERP (b->event)) + return ((XINT (a->event) > XINT (b->event)) + - (XINT (a->event) < XINT (b->event))); + if (!INTEGERP (a->event) && INTEGERP (b->event)) + return 1; + if (INTEGERP (a->event) && !INTEGERP (b->event)) + return -1; + if (SYMBOLP (a->event) && SYMBOLP (b->event)) + return (Fstring_lessp (a->event, b->event) ? -1 + : Fstring_lessp (b->event, a->event) ? 1 + : 0); + return 0; +} + /* Describe the contents of map MAP, assuming that this map itself is reached by the sequence of prefix keys PREFIX (a string or vector). PARTIAL, SHADOW, NOMENU are as in `describe_map_tree' above. */ @@ -3190,6 +3218,13 @@ describe_map (map, prefix, elt_describer, partial, shadow, int first = 1; struct gcpro gcpro1, gcpro2, gcpro3; + /* These accumulate the values from sparse keymap bindings, + so we can sort them and handle them in order. */ + int length_needed = 0; + struct describe_map_elt *vect; + int slots_used = 0; + int i; + suppress = Qnil; if (partial) @@ -3201,6 +3236,12 @@ describe_map (map, prefix, elt_describer, partial, shadow, kludge = Fmake_vector (make_number (1), Qnil); definition = Qnil; + for (tail = map; CONSP (tail); tail = XCDR (tail)) + length_needed++; + + vect = ((struct describe_map_elt *) + alloca (sizeof (struct describe_map_elt) * length_needed)); + GCPRO3 (prefix, definition, kludge); for (tail = map; CONSP (tail); tail = XCDR (tail)) @@ -3215,6 +3256,7 @@ describe_map (map, prefix, elt_describer, partial, shadow, else if (CONSP (XCAR (tail))) { int this_shadowed = 0; + event = XCAR (XCAR (tail)); /* Ignore bindings whose "prefix" are not really valid events. @@ -3255,27 +3297,10 @@ describe_map (map, prefix, elt_describer, partial, shadow, tem = Flookup_key (map, kludge, Qt); if (!EQ (tem, definition)) continue; - if (first) - { - previous_description_column = 0; - insert ("\n", 1); - first = 0; - } - - /* THIS gets the string to describe the character EVENT. */ - insert1 (Fkey_description (kludge, prefix)); - - /* Print a description of the definition of this character. - elt_describer will take care of spacing out far enough - for alignment purposes. */ - (*elt_describer) (definition, Qnil); - - if (this_shadowed) - { - SET_PT (PT - 1); - insert_string (" (binding currently shadowed)"); - SET_PT (PT + 1); - } + vect[slots_used].event = event; + vect[slots_used].definition = definition; + vect[slots_used].shadowed = this_shadowed; + slots_used++; } else if (EQ (XCAR (tail), Qkeymap)) { @@ -3289,6 +3314,68 @@ describe_map (map, prefix, elt_describer, partial, shadow, } } + /* If we found some sparse map events, sort them. */ + + qsort (vect, slots_used, sizeof (struct describe_map_elt), + describe_map_compare); + + /* Now output them in sorted order. */ + + for (i = 0; i < slots_used; i++) + { + Lisp_Object start, end; + + if (first) + { + previous_description_column = 0; + insert ("\n", 1); + first = 0; + } + + ASET (kludge, 0, vect[i].event); + start = vect[i].event; + end = start; + + definition = vect[i].definition; + + /* Find consecutive chars that are identically defined. */ + if (INTEGERP (vect[i].event)) + { + while (i + 1 < slots_used + && XINT (vect[i + 1].event) == XINT (vect[i].event) + 1 + && !NILP (Fequal (vect[i + 1].definition, definition)) + && vect[i].shadowed == vect[i + 1].shadowed) + i++; + end = vect[i].event; + } + + /* Now START .. END is the range to describe next. */ + + /* Insert the string to describe the event START. */ + insert1 (Fkey_description (kludge, prefix)); + + if (!EQ (start, end)) + { + insert (" .. ", 4); + + ASET (kludge, 0, end); + /* Insert the string to describe the character END. */ + insert1 (Fkey_description (kludge, prefix)); + } + + /* Print a description of the definition of this character. + elt_describer will take care of spacing out far enough + for alignment purposes. */ + (*elt_describer) (vect[i].definition, Qnil); + + if (vect[i].shadowed) + { + SET_PT (PT - 1); + insert_string (" (binding currently shadowed)"); + SET_PT (PT + 1); + } + } + UNGCPRO; } diff --git a/src/lread.c b/src/lread.c index 236ebebda13..0eb54393482 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1323,7 +1323,18 @@ readevalloop (readcharfun, stream, sourcename, evalfun, int count = SPECPDL_INDEX (); struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; struct buffer *b = 0; + int bpos; int continue_reading_p; + /* Nonzero if reading an entire buffer. */ + int whole_buffer = 0; + /* 1 on the first time around. */ + int first_sexp = 1; + + if (MARKERP (readcharfun)) + { + if (NILP (start)) + start = readcharfun; + } if (BUFFERP (readcharfun)) b = XBUFFER (readcharfun); @@ -1349,7 +1360,6 @@ readevalloop (readcharfun, stream, sourcename, evalfun, if (b != 0 && NILP (b->name)) error ("Reading from killed buffer"); - if (!NILP (start)) { /* Switch to the buffer we are reading from. */ @@ -1364,9 +1374,20 @@ readevalloop (readcharfun, stream, sourcename, evalfun, /* Set point and ZV around stuff to be read. */ Fgoto_char (start); - Fnarrow_to_region (make_number (BEGV), end); + if (!NILP (end)) + Fnarrow_to_region (make_number (BEGV), end); + + /* Just for cleanliness, convert END to a marker + if it is an integer. */ + if (INTEGERP (end)) + end = Fpoint_max_marker (); } + /* On the first cycle, we can easily test here + whether we are reading the whole buffer. */ + if (b && first_sexp) + whole_buffer = (PT == BEG && ZV == Z); + instream = stream; read_next: c = READCHAR; @@ -1416,8 +1437,11 @@ readevalloop (readcharfun, stream, sourcename, evalfun, if (!NILP (start) && continue_reading_p) start = Fpoint_marker (); + + /* Restore saved point and BEGV. */ unbind_to (count1, Qnil); + /* Now eval what we just read. */ val = (*evalfun) (val); if (printflag) @@ -1428,11 +1452,12 @@ readevalloop (readcharfun, stream, sourcename, evalfun, else Fprint (val, Qnil); } + + first_sexp = 0; } build_load_history (sourcename, - stream || (INTEGERP (start) && INTEGERP (end) - && XINT (start) == BEG && XINT (end) == Z)); + stream || whole_buffer); UNGCPRO; diff --git a/src/minibuf.c b/src/minibuf.c index 7f3f7fe87ea..b327f2d040a 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -464,6 +464,9 @@ read_minibuf (map, initial, prompt, backup_n, expflag, /* String to add to the history. */ Lisp_Object histstring; + Lisp_Object empty_minibuf; + Lisp_Object dummy, frame; + extern Lisp_Object Qfront_sticky; extern Lisp_Object Qrear_nonsticky; @@ -641,6 +644,22 @@ read_minibuf (map, initial, prompt, backup_n, expflag, Vminibuf_scroll_window = selected_window; if (minibuf_level == 1 || !EQ (minibuf_window, selected_window)) minibuf_selected_window = selected_window; + + /* Empty out the minibuffers of all frames other than the one + where we are going to display one now. + Set them to point to ` *Minibuf-0*', which is always empty. */ + empty_minibuf = Fget_buffer (build_string (" *Minibuf-0*")); + + FOR_EACH_FRAME (dummy, frame) + { + Lisp_Object root_window = Fframe_root_window (frame); + Lisp_Object mini_window = XWINDOW (root_window)->next; + + if (! NILP (mini_window) && !NILP (Fwindow_minibuffer_p (mini_window))) + Fset_window_buffer (mini_window, empty_minibuf, Qnil); + } + + /* Display this minibuffer in the proper window. */ Fset_window_buffer (minibuf_window, Fcurrent_buffer (), Qnil); Fselect_window (minibuf_window, Qnil); XSETFASTINT (XWINDOW (minibuf_window)->hscroll, 0); diff --git a/src/process.c b/src/process.c index 752768a7bad..e869456e5c8 100644 --- a/src/process.c +++ b/src/process.c @@ -3558,7 +3558,7 @@ FLAGS is the current flags of the interface. */) int fnum; any++; - for (fp = ifflag_table; flags != 0 && fp; fp++) + for (fp = ifflag_table; flags != 0 && fp->flag_sym; fp++) { if (flags & fp->flag_bit) { diff --git a/src/term.c b/src/term.c index 49356348545..899739de6ae 100644 --- a/src/term.c +++ b/src/term.c @@ -109,6 +109,10 @@ static void delete_tty P_ ((struct terminal *)); #define OUTPUT1_IF(tty, a) do { if (a) emacs_tputs ((tty), a, 1, cmputc); } while (0) +/* If true, use "vs", otherwise use "ve" to make the cursor visible. */ + +static int visible_cursor; + /* Display space properties */ extern Lisp_Object Qspace, QCalign_to, QCwidth; @@ -217,7 +221,7 @@ tty_set_terminal_modes (struct terminal *terminal) } OUTPUT_IF (tty, tty->TS_termcap_modes); - OUTPUT_IF (tty, tty->TS_cursor_visible); + OUTPUT_IF (tty, visible_cursor ? tty->TS_cursor_visible : tty->TS_cursor_normal); OUTPUT_IF (tty, tty->TS_keypad_mode); losecursor (tty); fflush (tty->output); @@ -359,7 +363,8 @@ tty_show_cursor (struct tty_display_info *tty) { tty->cursor_hidden = 0; OUTPUT_IF (tty, tty->TS_cursor_normal); - OUTPUT_IF (tty, tty->TS_cursor_visible); + if (visible_cursor) + OUTPUT_IF (tty, tty->TS_cursor_visible); } } @@ -3031,6 +3036,13 @@ The functions are run with one argument, the name of the tty that was revived. See `resume-tty'. */); Vresume_tty_functions = Qnil; + DEFVAR_BOOL ("visible-cursor", &visible_cursor, + doc: /* Non-nil means to make the cursor very visible. +This only has an effect when running in a text terminal. +What means \"very visible\" is up to your terminal. It may make the cursor +bigger, or it may make it blink, or it may do nothing at all. */); + visible_cursor = 1; + defsubr (&Stty_display_color_p); defsubr (&Stty_display_color_cells); defsubr (&Stty_no_underline); diff --git a/src/textprop.c b/src/textprop.c index fa9b0e498c5..029f2f41031 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -1316,8 +1316,8 @@ the designated part of OBJECT. */) properties PROPERTIES. OBJECT is the buffer or string containing the text. OBJECT nil means use the current buffer. SIGNAL_AFTER_CHANGE_P nil means don't signal after changes. Value - is non-nil if properties were replaced; it is nil if there weren't - any properties to replace. */ + is nil if the function _detected_ that it did not replace any + properties, non-nil otherwise. */ Lisp_Object set_text_properties (start, end, properties, object, signal_after_change_p) @@ -1341,7 +1341,7 @@ set_text_properties (start, end, properties, object, signal_after_change_p) && XFASTINT (end) == SCHARS (object)) { if (! STRING_INTERVALS (object)) - return Qt; + return Qnil; STRING_SET_INTERVALS (object, NULL_INTERVAL); return Qt; |
