From: tomo Date: Tue, 6 Jul 1999 05:20:15 +0000 (+0000) Subject: Sync up with r21-2-17-1999-07-06-13. X-Git-Tag: r21-2-17-tomo-4~6 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=eae7c1f8ecb8a9f667f5cd83c5777d7f315cc90e;p=chise%2Fxemacs-chise.git Sync up with r21-2-17-1999-07-06-13. --- diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog index 60391ae..625071a 100644 --- a/lwlib/ChangeLog +++ b/lwlib/ChangeLog @@ -1,3 +1,8 @@ +1999-07-05 Didier Verna + + * lwlib-Xm.c (xm_update_one_widget): add missing #ifdefs around + call to xm_update_label. + 1999-06-28 Andy Piper * lwlib-Xm.c: unconditionally enable text field & list code. diff --git a/lwlib/lwlib-Xm.c b/lwlib/lwlib-Xm.c index 98f570c..48bb2de 100644 --- a/lwlib/lwlib-Xm.c +++ b/lwlib/lwlib-Xm.c @@ -4,13 +4,13 @@ This file is part of the Lucid Widget Library. -The Lucid Widget Library is free software; you can redistribute it and/or +The Lucid Widget Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. The Lucid Widget Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of +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. @@ -86,7 +86,7 @@ xm_update_menu (widget_instance* instance, Widget widget, widget_value* val, #endif /* Structures to keep destroyed instances */ -typedef struct _destroyed_instance +typedef struct _destroyed_instance { char* name; char* type; @@ -126,7 +126,7 @@ make_destroyed_instance (char* name, char* type, Widget widget, Widget parent, instance->next = NULL; return instance; } - + static void free_destroyed_instance (destroyed_instance* instance) { @@ -145,7 +145,7 @@ first_child (Widget widget) Boolean lw_motif_widget_p (Widget widget) { - return + return #ifdef LWLIB_DIALOGS_MOTIF XtClass (widget) == xmDialogShellWidgetClass || #endif @@ -157,7 +157,7 @@ resource_string (Widget widget, char *name) { XtResource resource; char *result = NULL; - + resource.resource_name = "labelString"; resource.resource_class = "LabelString"; /* #### should be Xmsomething... */ resource.resource_type = XtRString; @@ -183,7 +183,7 @@ destroy_all_children (Widget widget) children = XtCompositeChildren (widget, &number); if (children) { - /* Unmanage all children and destroy them. They will only be + /* Unmanage all children and destroy them. They will only be * really destroyed when we get out of DispatchEvent. */ for (i = 0; i < number; i++) { @@ -285,7 +285,7 @@ xm_update_label (widget_instance* instance, Widget widget, widget_value* val) XtSetArg (al [ac], XmNlabelString, built_string); ac++; XtSetArg (al [ac], XmNlabelType, XmSTRING); ac++; } - + if (val->key) { key_string = XmStringCreateLtoR (val->key, XmSTRING_DEFAULT_CHARSET); @@ -365,7 +365,7 @@ xm_update_cascadebutton (widget_instance* instance, Widget widget, XtRemoveAllCallbacks (widget, XmNcascadingCallback); XtAddCallback (widget, XmNcascadingCallback, xm_pull_down_callback, instance); - } + } } #endif /* LWLIB_MENUBARS_MOTIF */ @@ -461,7 +461,7 @@ make_menu_in_widget (widget_instance* instance, Widget widget, num_children = 0; for (child_index = 0, cur = val; cur; child_index++, cur = cur->next) - { + { ac = 0; button = 0; XtSetArg (al [ac], XmNsensitive, cur->enabled); ac++; @@ -579,7 +579,7 @@ update_one_menu_entry (widget_instance* instance, Widget widget, menu = NULL; XtSetArg (al [0], XmNsubMenuId, &menu); XtGetValues (widget, al, 1); - + contents = val->contents; if (!menu) @@ -768,7 +768,7 @@ xm_update_one_widget (widget_instance* instance, Widget widget, { WidgetClass class; Arg al [2]; - + /* Mark as not edited */ val->edited = False; @@ -777,10 +777,12 @@ xm_update_one_widget (widget_instance* instance, Widget widget, XtSetArg (al [1], XmNuserData, val->call_data); XtSetValues (widget, al, 2); +#if defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) /* Common to all label like widgets */ if (XtIsSubclass (widget, xmLabelWidgetClass)) xm_update_label (instance, widget, val); - +#endif /* defined (LWLIB_DIALOGS_MOTIF) || defined (LWLIB_MENUBARS_MOTIF) */ + class = XtClass (widget); /* Class specific things */ if (class == xmPushButtonWidgetClass || @@ -805,7 +807,7 @@ xm_update_one_widget (widget_instance* instance, Widget widget, XtSetArg (al [0], XmNradioBehavior, &radiobox); XtGetValues (widget, al, 1); - + if (radiobox) xm_update_radiobox (instance, widget, val); #ifdef LWLIB_MENUBARS_MOTIF @@ -848,7 +850,7 @@ xm_update_one_value (widget_instance* instance, Widget widget, val->call_data = old_wv->call_data; break; } - + if (class == xmToggleButtonWidgetClass || class == xmToggleButtonGadgetClass) { Arg al [1]; @@ -939,7 +941,7 @@ xm_update_one_value (widget_instance* instance, Widget widget, /* This function is for activating a button from a program. It's wrong because we pass a NULL argument in the call_data which is not Motif compatible. This is used from the XmNdefaultAction callback of the List widgets to - have a double-click put down a dialog box like the button would do. + have a double-click put down a dialog box like the button would do. I could not find a way to do that with accelerators. */ static void @@ -989,7 +991,7 @@ Ctrlm: ArmAndActivate()\n"; /* This is a kludge to disable drag-and-drop in dialog boxes. The symptom was a segv down in libXm somewhere if you used the middle button on a dialog box to begin a drag; when you released the button to make a drop - things would lose if you were not over the button where you started the + things would lose if you were not over the button where you started the drag (canceling the operation). This was probably due to the fact that the dialog boxes were not set up to handle a drag but were trying to do so anyway for some reason. @@ -1022,7 +1024,7 @@ make_dialog (char* name, Widget parent, Boolean pop_up_p, Arg al[64]; /* Arg List */ int ac; /* Arg Count */ int i; - + #ifdef DND_KLUDGE XtTranslations dnd_override = XtParseTranslationTable (disable_dnd_trans); # define DO_DND_KLUDGE(widget) XtOverrideTranslations ((widget), dnd_override) @@ -1070,7 +1072,7 @@ make_dialog (char* name, Widget parent, Boolean pop_up_p, XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++; XtSetArg(al[ac], XmNrightOffset, 13); ac++; row = XmCreateRowColumn (form, "row", al, ac); - + n_children = 0; for (i = 0; i < left_buttons; i++) { @@ -1112,7 +1114,7 @@ make_dialog (char* name, Widget parent, Boolean pop_up_p, al, ac); DO_DND_KLUDGE (children [n_children]); n_children++; - + for (i = 0; i < right_buttons; i++) { char button_name [16]; @@ -1124,9 +1126,9 @@ make_dialog (char* name, Widget parent, Boolean pop_up_p, if (! button) button = children [n_children]; n_children++; } - + XtManageChildren (children, n_children); - + ac = 0; XtSetArg(al[ac], XmNtopAttachment, XmATTACH_NONE); ac++; XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++; @@ -1225,7 +1227,7 @@ make_dialog (char* name, Widget parent, Boolean pop_up_p, list activate the default button */ XtAddCallback (value, XmNdefaultActionCallback, activate_button, button); } - + ac = 0; XtSetArg(al[ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++; @@ -1241,7 +1243,7 @@ make_dialog (char* name, Widget parent, Boolean pop_up_p, XtSetArg(al[ac], XmNrightOffset, 13); ac++; message = XmCreateLabel (form, "message", al, ac); DO_DND_KLUDGE (message); - + if (list) XtManageChild (value); @@ -1256,7 +1258,7 @@ make_dialog (char* name, Widget parent, Boolean pop_up_p, children [i] = icon; i++; children [i] = icon_separator; i++; XtManageChildren (children, i); - + if (text_input_slot || list) { XtInstallAccelerators (value, button); @@ -1267,7 +1269,7 @@ make_dialog (char* name, Widget parent, Boolean pop_up_p, XtInstallAccelerators (form, button); XmProcessTraversal(value, XmTRAVERSE_CURRENT); } - + #ifdef DND_KLUDGE XtFree ((char *) dnd_override); #endif @@ -1346,7 +1348,7 @@ recenter_widget (Widget widget) x = (Position) ((parent_width - child_width) / 2); y = (Position) ((parent_height - child_height) / 2); - + XtTranslateCoords (parent, x, y, &x, &y); if ((Dimension) (x + child_width) > screen_width) @@ -1459,7 +1461,7 @@ xm_create_dialog (widget_instance* instance) shell_name = "Question"; break; } - + total_buttons = name [1] - '0'; if (name [3] == 'T' || name [3] == 't') @@ -1469,9 +1471,9 @@ xm_create_dialog (widget_instance* instance) } else if (name [3]) right_buttons = name [4] - '0'; - + left_buttons = total_buttons - right_buttons; - + widget = make_dialog (name, parent, pop_up_p, shell_name, icon_name, text_input_slot, radio_box, list, left_buttons, right_buttons); @@ -1530,7 +1532,7 @@ make_scrollbar (widget_instance *instance, int vertical) { {xm_scrollbar_callback, NULL}, {NULL, NULL} }; callbacks[0].closure = (XtPointer) instance; - + XtSetArg (al[ac], XmNminimum, 1); ac++; XtSetArg (al[ac], XmNmaximum, INT_MAX); ac++; XtSetArg (al[ac], XmNincrement, 1); ac++; @@ -1587,7 +1589,7 @@ make_button (widget_instance *instance) if (!val->call_data) button = XmCreateLabel (instance->parent, val->name, al, ac); - + else if (val->type == TOGGLE_TYPE || val->type == RADIO_TYPE) { XtSetArg (al [ac], XmNset, val->selected); ac++; @@ -1711,7 +1713,7 @@ make_combo_box (widget_instance *instance) /* Table of functions to create widgets */ widget_creation_entry -xm_creation_table [] = +xm_creation_table [] = { #ifdef LWLIB_MENUBARS_MOTIF {"menubar", make_menubar}, @@ -1843,12 +1845,12 @@ xm_pop_instance (widget_instance* instance, Boolean up) if (up) XtManageChild (widget); else - XtUnmanageChild (widget); + XtUnmanageChild (widget); } } -/* motif callback */ +/* motif callback */ enum do_call_type { pre_activate, selection, no_selection, post_activate }; @@ -1898,7 +1900,7 @@ do_call (Widget widget, XtPointer closure, enum do_call_type type) } /* Like lw_internal_update_other_instances except that it does not do - anything if its shell parent is not managed. This is to protect + anything if its shell parent is not managed. This is to protect lw_internal_update_other_instances to dereference freed memory if the widget was ``destroyed'' by caching it in the all_destroyed_instances list */ @@ -1933,7 +1935,7 @@ xm_generic_callback (Widget widget, XtPointer closure, XtPointer call_data) XtSetArg (al [0], XmNset, !check); XtSetValues (widget, al, 1); } -#endif +#endif lw_internal_update_other_instances (widget, closure, call_data); do_call (widget, closure, selection); } @@ -1972,10 +1974,10 @@ xm_pull_down_callback (Widget widget, XtPointer closure, XtPointer call_data) if (call_data) { /* new behavior for incremental menu construction */ - + } else -#endif +#endif do_call (widget, closure, pre_activate); } diff --git a/src/ChangeLog b/src/ChangeLog index bdef495..6ff85e6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -72,6 +72,11 @@ (ccl_driver): New case lable `CCL_Extention'. (setup_ccl_program): Initialize the member `private_state' of CCL. +1999-07-05 Didier Verna + + * indent.c: new symbol Qcoerce. + (Fmove_to_column): use it + doc string update. + 1999-07-04 Andy Piper * console.c: undo earlier Fprovide changes. @@ -167,7 +172,7 @@ X11R5. * s/cygwin32.h: fix me website address. - + * event-msw.c: add NMHDR for pre b20 cygwin builds. * gui-x.c (button_item_to_widget_value): only add callback if it @@ -365,7 +370,7 @@ (HAVE_UMICH_LDAP): Removed (HAVE_NS_LDAP): Removed - * eldap.h (struct Lisp_LDAP): Removed the `livep' member as + * eldap.h (struct Lisp_LDAP): Removed the `livep' member as suggested by Olivier Galibert (CHECK_LIVE_LDAP): Test on `ld' instead of `livep' @@ -383,7 +388,7 @@ 1999-06-16 Norbert Koch - * redisplay-msw.c: Run 'ccl_driver' with 'CCL_MODE_ENCODING' as in + * redisplay-msw.c: Run 'ccl_driver' with 'CCL_MODE_ENCODING' as in redisplay-x.c 1999-06-12 MORIOKA Tomohiko @@ -661,9 +666,9 @@ ARG2. 1999-05-21 Andy Piper - + * xselect.c: deleted. - + * symsinit.h: declare select initialisation. * select.h: new file. declare commonly used select functions and @@ -796,7 +801,7 @@ is interned in the main obarray. 1999-04-23 Gunnar Evermann - + * menubar-x.c (pre_activate_callback): set accelerator field in "No menu" entries to nil. Avoid crash in command_builder_operate_menu_accelerator @@ -818,13 +823,13 @@ * m/intel386.h: remove redundant definitions. * s/mingw32.h: new header for mingw32. - + * unexnt.c: (open_input_file): function moved to nt.c. (close_file_data): ditto. (rva_to_section): function moved to ntproc. * symsinit.h: declare syms_of_ntproc(); - + * objects-msw.c (mswindows_font_instance_truename): new function. * ntproc.c: remove many warnings. @@ -836,7 +841,7 @@ (sys_spawnve): fix bad MULE/GCPRO bug in filename handling. * ntheap.h: remove declarations of functions that are now static. - + * ntheap.c: support static heap. * nt.h: conditionalise X_OK definition. @@ -847,7 +852,7 @@ (_sys_read_ahead): moved to ntproc.c * emacs.c: make sure syms_of_ntptroc gets called under windows. - + * console-msw.h: support mingw32. * getloadavg.c: ditto. * ntplay.c: ditto. @@ -858,14 +863,14 @@ * config.h.in: dont turn on DEBUG_ENCAPSULATION by default because some systems don't have all of the encapsulated system calls. - + * callproc.c: warning elimination. * dired-msw.c: ditto. * process-nt.c: ditto. * realpath.c: ditto. - + * Makefile.in.in: tweak : and ; for building under mswindows. - + 1999-04-26 Michael Harnois * eldap.c (allocate_ldap): Adapt to the new semantics of @@ -981,7 +986,7 @@ * symbols.c: Make gung-ho mandatory. make_pure_pname -> make_string or make_string_nocopy. Fix various alloc_lcrecord_type. - + * lread.c: Remove everything purespace related. (Flocate_file_clear_hashing): purified -> c_readonly. (locate_file): Ditto. @@ -1150,7 +1155,7 @@ * fns.c (base64_decode_1): Remove COUNTER. (base64_decode_1): Accept CRLF in addition to CR. - (base64_decode_1): Disallow a stray character after final EOF; the + (base64_decode_1): Disallow a stray character after final EOF; the check was probably a remnant of buggy recode code. 1998-12-05 Hrvoje Niksic @@ -1319,8 +1324,8 @@ (composite_char_string): (make-composite-char): (composite-char-string): - (syms_of_mule_charset): - (complex_vars_of_mule_charset): + (syms_of_mule_charset): + (complex_vars_of_mule_charset): * mule-charset.h (LEADING_BYTE_COMPOSITE): (CHAR_LEADING_BYTE): (MAKE_CHAR): @@ -1333,8 +1338,8 @@ (reset_iso2022): (parse_iso2022_esc): (encode_coding_iso2022): - #ifdef out all composite character support using - #ifdef ENABLE_COMPOSITE_CHARS + #ifdef out all composite character support using + #ifdef ENABLE_COMPOSITE_CHARS * alloc.c: Define lrecord_coding_system only if ! FILE_CODING @@ -5618,4 +5623,3 @@ Wed May 27, 1998 Darryl Okahata 1998-05-10 Hrvoje Niksic * frame.c (Ffocus_frame): New function. - diff --git a/src/indent.c b/src/indent.c index 5d97e4d..7ace51f 100644 --- a/src/indent.c +++ b/src/indent.c @@ -40,6 +40,8 @@ Boston, MA 02111-1307, USA. */ #endif #include "window.h" +Lisp_Object Qcoerce; + /* Indentation can insert tabs if this is non-zero; otherwise always uses spaces */ int indent_tabs_mode; @@ -342,9 +344,11 @@ and horizontal scrolling has no effect. If specified column is within a character, point goes after that character. If it's past end of line, point goes to end of line. -A non-nil second (optional) argument FORCE means, if the line -is too short to reach column COLUMN then add spaces/tabs to get there, -and if COLUMN is in the middle of a tab character, change it to spaces. +A value of 'coerce for the second (optional) argument FORCE means if +COLUMN is in the middle of a tab character, change it to spaces. +Any other non-nil value means the same, plus if the line is too short to +reach column COLUMN, then add spaces/tabs to get there. + Returns the actual column that it moved to. */ (column, force, buffer)) @@ -428,7 +432,7 @@ Returns the actual column that it moved to. } /* If line ends prematurely, add space to the end. */ - if (col < goal && !NILP (force)) + if (col < goal && !NILP (force) && !EQ (force, Qcoerce)) { col = goal; Findent_to (make_int (col), Qzero, buffer); @@ -541,7 +545,7 @@ vpix_motion (line_start_cache_dynarr *cache, int start, int end) assert (start <= end); assert (start >= 0); assert (end < Dynarr_length (cache)); - + vpix = 0; for (i = start; i <= end; i++) vpix += Dynarr_atp (cache, i)->height; @@ -681,7 +685,7 @@ Lisp_Object vertical_motion_1 (Lisp_Object lines, Lisp_Object window, bufpos = vmotion_1 (w, orig, XINT (lines), vpos, vpix); /* Note that the buffer's point is set, not the window's point. */ - if (selected) + if (selected) BUF_SET_PT (XBUFFER (w->buffer), bufpos); else set_marker_restricted (w->pointm[CURRENT_DISP], @@ -856,7 +860,7 @@ that the motion should be as close as possible to PIXELS. bufpos = vmotion_pixels (window, orig, XINT (pixels), howto, &motion); - if (selected) + if (selected) BUF_SET_PT (XBUFFER (w->buffer), bufpos); else set_marker_restricted (w->pointm[CURRENT_DISP], @@ -879,6 +883,8 @@ syms_of_indent (void) #endif DEFSUBR (Fvertical_motion); DEFSUBR (Fvertical_motion_pixels); + + defsymbol (&Qcoerce, "coerce"); } void