comparison src/w32fns.c @ 39973:579177964efa

Avoid (most) uses of XCAR/XCDR as lvalues, for flexibility in experimenting with lisp system changes.
author Ken Raeburn <raeburn@raeburn.org>
date Tue, 16 Oct 2001 09:09:51 +0000
parents 66e0816837a8
children f6ecf530f0a3
comparison
equal deleted inserted replaced
39972:b2479b43184b 39973:579177964efa
3782 UnregisterHotKey (focus_window, HOTKEY_ID (msg.wParam)); 3782 UnregisterHotKey (focus_window, HOTKEY_ID (msg.wParam));
3783 /* Mark item as erased. NB: this code must be 3783 /* Mark item as erased. NB: this code must be
3784 thread-safe. The next line is okay because the cons 3784 thread-safe. The next line is okay because the cons
3785 cell is never made into garbage and is not relocated by 3785 cell is never made into garbage and is not relocated by
3786 GC. */ 3786 GC. */
3787 XCAR ((Lisp_Object) msg.lParam) = Qnil; 3787 XSETCAR ((Lisp_Object) msg.lParam, Qnil);
3788 if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0)) 3788 if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0))
3789 abort (); 3789 abort ();
3790 break; 3790 break;
3791 case WM_EMACS_TOGGLE_LOCK_KEY: 3791 case WM_EMACS_TOGGLE_LOCK_KEY:
3792 { 3792 {
6864 6864
6865 UNBLOCK_INPUT; 6865 UNBLOCK_INPUT;
6866 6866
6867 /* Make a list of the fonts we got back. 6867 /* Make a list of the fonts we got back.
6868 Store that in the font cache for the display. */ 6868 Store that in the font cache for the display. */
6869 XCDR (dpyinfo->name_list_element) 6869 XSETCDR (dpyinfo->name_list_element,
6870 = Fcons (Fcons (tpat, list), 6870 Fcons (Fcons (tpat, list),
6871 XCDR (dpyinfo->name_list_element)); 6871 XCDR (dpyinfo->name_list_element)));
6872 6872
6873 label_cached: 6873 label_cached:
6874 if (NILP (list)) continue; /* Try the remaining alternatives. */ 6874 if (NILP (list)) continue; /* Try the remaining alternatives. */
6875 6875
6876 newlist = second_best = Qnil; 6876 newlist = second_best = Qnil;
6913 continue; 6913 continue;
6914 6914
6915 hdc = GetDC (dpyinfo->root_window); 6915 hdc = GetDC (dpyinfo->root_window);
6916 oldobj = SelectObject (hdc, thisinfo.hfont); 6916 oldobj = SelectObject (hdc, thisinfo.hfont);
6917 if (GetTextMetrics (hdc, &thisinfo.tm)) 6917 if (GetTextMetrics (hdc, &thisinfo.tm))
6918 XCDR (tem) = make_number (FONT_WIDTH (&thisinfo)); 6918 XSETCDR (tem, make_number (FONT_WIDTH (&thisinfo)));
6919 else 6919 else
6920 XCDR (tem) = make_number (0); 6920 XSETCDR (tem, make_number (0));
6921 SelectObject (hdc, oldobj); 6921 SelectObject (hdc, oldobj);
6922 ReleaseDC (dpyinfo->root_window, hdc); 6922 ReleaseDC (dpyinfo->root_window, hdc);
6923 DeleteObject(thisinfo.hfont); 6923 DeleteObject(thisinfo.hfont);
6924 UNBLOCK_INPUT; 6924 UNBLOCK_INPUT;
6925 } 6925 }
13238 13238
13239 /* Safe to add new key to list, even if we have focus. */ 13239 /* Safe to add new key to list, even if we have focus. */
13240 if (NILP (item)) 13240 if (NILP (item))
13241 w32_grabbed_keys = Fcons (key, w32_grabbed_keys); 13241 w32_grabbed_keys = Fcons (key, w32_grabbed_keys);
13242 else 13242 else
13243 XCAR (item) = key; 13243 XSETCAR (item, key);
13244 13244
13245 /* Notify input thread about new hot-key definition, so that it 13245 /* Notify input thread about new hot-key definition, so that it
13246 takes effect without needing to switch focus. */ 13246 takes effect without needing to switch focus. */
13247 PostThreadMessage (dwWindowsThreadId, WM_EMACS_REGISTER_HOT_KEY, 13247 PostThreadMessage (dwWindowsThreadId, WM_EMACS_REGISTER_HOT_KEY,
13248 (WPARAM) key, 0); 13248 (WPARAM) key, 0);