Now on revision 113669. ------------------------------------------------------------ revno: 113669 committer: Dmitry Antipov branch nick: trunk timestamp: Sat 2013-08-03 07:29:03 +0400 message: Drop FRAME_PTR typedef. * composite.c, font.c, font.h, fontset.c, fontset.h, frame.c, frame.h: * ftfont.c, ftxfont.c, gtkutil.c, gtkutil.h, image.c, keyboard.c: * menu.c, menu.h, msdos.c, nsfns.m, nsfont.m, nsmenu.m, nsterm.h: * nsterm.m, scroll.c, term.c, w32fns.c, w32font.c, w32font.h: * w32inevt.c, w32inevt.h, w32menu.c, w32notify.c, w32term.c, w32term.h: * w32uniscribe.c, w32xfns.c, widget.c, window.c, xdisp.c, xfaces.c: * xfns.c, xfont.c, xftfont.c, xmenu.c, xselect.c, xterm.c: All related users changed. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-08-02 21:16:33 +0000 +++ src/ChangeLog 2013-08-03 03:29:03 +0000 @@ -1,3 +1,15 @@ +2013-08-03 Dmitry Antipov + + Drop FRAME_PTR typedef. + * composite.c, font.c, font.h, fontset.c, fontset.h, frame.c, frame.h: + * ftfont.c, ftxfont.c, gtkutil.c, gtkutil.h, image.c, keyboard.c: + * menu.c, menu.h, msdos.c, nsfns.m, nsfont.m, nsmenu.m, nsterm.h: + * nsterm.m, scroll.c, term.c, w32fns.c, w32font.c, w32font.h: + * w32inevt.c, w32inevt.h, w32menu.c, w32notify.c, w32term.c, w32term.h: + * w32uniscribe.c, w32xfns.c, widget.c, window.c, xdisp.c, xfaces.c: + * xfns.c, xfont.c, xftfont.c, xmenu.c, xselect.c, xterm.c: + All related users changed. + 2013-08-02 Stefan Monnier * eval.c (default_toplevel_binding): New function. === modified file 'src/composite.c' --- src/composite.c 2013-07-16 06:39:49 +0000 +++ src/composite.c 2013-08-03 03:29:03 +0000 @@ -901,7 +901,7 @@ Lisp_Object string) { ptrdiff_t count = SPECPDL_INDEX (); - FRAME_PTR f = XFRAME (win->frame); + struct frame *f = XFRAME (win->frame); Lisp_Object pos = make_number (charpos); ptrdiff_t to; ptrdiff_t pt = PT, pt_byte = PT_BYTE; === modified file 'src/font.c' --- src/font.c 2013-08-01 10:33:25 +0000 +++ src/font.c 2013-08-03 03:29:03 +0000 @@ -204,9 +204,9 @@ -static int font_pixel_size (FRAME_PTR f, Lisp_Object); -static Lisp_Object font_open_entity (FRAME_PTR, Lisp_Object, int); -static Lisp_Object font_matching_entity (FRAME_PTR, Lisp_Object *, +static int font_pixel_size (struct frame *f, Lisp_Object); +static Lisp_Object font_open_entity (struct frame *, Lisp_Object, int); +static Lisp_Object font_matching_entity (struct frame *, Lisp_Object *, Lisp_Object); static unsigned font_encode_char (Lisp_Object, int); @@ -269,7 +269,7 @@ /* Return a pixel size of font-spec SPEC on frame F. */ static int -font_pixel_size (FRAME_PTR f, Lisp_Object spec) +font_pixel_size (struct frame *f, Lisp_Object spec) { #ifdef HAVE_WINDOW_SYSTEM Lisp_Object size = AREF (spec, FONT_SIZE_INDEX); @@ -2497,14 +2497,14 @@ is a number frames sharing this cache, and FONT-CACHE-DATA is a cons (FONT-SPEC FONT-ENTITY ...). */ -static void font_prepare_cache (FRAME_PTR, struct font_driver *); -static void font_finish_cache (FRAME_PTR, struct font_driver *); -static Lisp_Object font_get_cache (FRAME_PTR, struct font_driver *); -static void font_clear_cache (FRAME_PTR, Lisp_Object, +static void font_prepare_cache (struct frame *, struct font_driver *); +static void font_finish_cache (struct frame *, struct font_driver *); +static Lisp_Object font_get_cache (struct frame *, struct font_driver *); +static void font_clear_cache (struct frame *, Lisp_Object, struct font_driver *); static void -font_prepare_cache (FRAME_PTR f, struct font_driver *driver) +font_prepare_cache (struct frame *f, struct font_driver *driver) { Lisp_Object cache, val; @@ -2526,7 +2526,7 @@ static void -font_finish_cache (FRAME_PTR f, struct font_driver *driver) +font_finish_cache (struct frame *f, struct font_driver *driver) { Lisp_Object cache, val, tmp; @@ -2547,7 +2547,7 @@ static Lisp_Object -font_get_cache (FRAME_PTR f, struct font_driver *driver) +font_get_cache (struct frame *f, struct font_driver *driver) { Lisp_Object val = driver->get_cache (f); Lisp_Object type = driver->type; @@ -2562,7 +2562,7 @@ static void -font_clear_cache (FRAME_PTR f, Lisp_Object cache, struct font_driver *driver) +font_clear_cache (struct frame *f, Lisp_Object cache, struct font_driver *driver) { Lisp_Object tail, elt; Lisp_Object tail2, entity; @@ -2760,7 +2760,7 @@ font-related attributes. */ static Lisp_Object -font_matching_entity (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec) +font_matching_entity (struct frame *f, Lisp_Object *attrs, Lisp_Object spec) { struct font_driver_list *driver_list = f->font_driver_list; Lisp_Object ftype, size, entity; @@ -2806,7 +2806,7 @@ opened font object. */ static Lisp_Object -font_open_entity (FRAME_PTR f, Lisp_Object entity, int pixel_size) +font_open_entity (struct frame *f, Lisp_Object entity, int pixel_size) { struct font_driver_list *driver_list; Lisp_Object objlist, size, val, font_object; @@ -2884,7 +2884,7 @@ /* Close FONT_OBJECT that is opened on frame F. */ static void -font_close_object (FRAME_PTR f, Lisp_Object font_object) +font_close_object (struct frame *f, Lisp_Object font_object) { struct font *font = XFONT_OBJECT (font_object); @@ -2904,7 +2904,7 @@ FONT is a font-entity and it must be opened to check. */ int -font_has_char (FRAME_PTR f, Lisp_Object font, int c) +font_has_char (struct frame *f, Lisp_Object font, int c) { struct font *fontp; @@ -3075,7 +3075,7 @@ character that the entity must support. */ Lisp_Object -font_find_for_lface (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec, int c) +font_find_for_lface (struct frame *f, Lisp_Object *attrs, Lisp_Object spec, int c) { Lisp_Object work; Lisp_Object entities, val; @@ -3222,7 +3222,7 @@ Lisp_Object -font_open_for_lface (FRAME_PTR f, Lisp_Object entity, Lisp_Object *attrs, Lisp_Object spec) +font_open_for_lface (struct frame *f, Lisp_Object entity, Lisp_Object *attrs, Lisp_Object spec) { int size; @@ -3269,7 +3269,7 @@ font-object. */ Lisp_Object -font_load_for_lface (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec) +font_load_for_lface (struct frame *f, Lisp_Object *attrs, Lisp_Object spec) { Lisp_Object entity, name; @@ -3298,7 +3298,7 @@ /* Make FACE on frame F ready to use the font opened for FACE. */ void -font_prepare_for_face (FRAME_PTR f, struct face *face) +font_prepare_for_face (struct frame *f, struct face *face) { if (face->font->driver->prepare_face) face->font->driver->prepare_face (f, face); @@ -3308,7 +3308,7 @@ /* Make FACE on frame F stop using the font opened for FACE. */ void -font_done_for_face (FRAME_PTR f, struct face *face) +font_done_for_face (struct frame *f, struct face *face) { if (face->font->driver->done_face) face->font->driver->done_face (f, face); @@ -3320,7 +3320,7 @@ font is found, return Qnil. */ Lisp_Object -font_open_by_spec (FRAME_PTR f, Lisp_Object spec) +font_open_by_spec (struct frame *f, Lisp_Object spec) { Lisp_Object attrs[LFACE_VECTOR_SIZE]; @@ -3344,7 +3344,7 @@ found, return Qnil. */ Lisp_Object -font_open_by_name (FRAME_PTR f, Lisp_Object name) +font_open_by_name (struct frame *f, Lisp_Object name) { Lisp_Object args[2]; Lisp_Object spec, ret; @@ -3374,7 +3374,7 @@ (e.g. syms_of_xfont). */ void -register_font_driver (struct font_driver *driver, FRAME_PTR f) +register_font_driver (struct font_driver *driver, struct frame *f) { struct font_driver_list *root = f ? f->font_driver_list : font_driver_list; struct font_driver_list *prev, *list; @@ -3402,7 +3402,7 @@ } void -free_font_driver_list (FRAME_PTR f) +free_font_driver_list (struct frame *f) { struct font_driver_list *list, *next; @@ -3424,7 +3424,7 @@ F. */ Lisp_Object -font_update_drivers (FRAME_PTR f, Lisp_Object new_drivers) +font_update_drivers (struct frame *f, Lisp_Object new_drivers) { Lisp_Object active_drivers = Qnil; struct font_driver_list *list; @@ -3513,7 +3513,7 @@ } int -font_put_frame_data (FRAME_PTR f, struct font_driver *driver, void *data) +font_put_frame_data (struct frame *f, struct font_driver *driver, void *data) { struct font_data_list *list, *prev; @@ -3547,7 +3547,7 @@ void * -font_get_frame_data (FRAME_PTR f, struct font_driver *driver) +font_get_frame_data (struct frame *f, struct font_driver *driver) { struct font_data_list *list; @@ -3621,7 +3621,7 @@ font_at (int c, ptrdiff_t pos, struct face *face, struct window *w, Lisp_Object string) { - FRAME_PTR f; + struct frame *f; bool multibyte; Lisp_Object font_object; @@ -4234,7 +4234,7 @@ FOR_EACH_FRAME (list, frame) { - FRAME_PTR f = XFRAME (frame); + struct frame *f = XFRAME (frame); struct font_driver_list *driver_list = f->font_driver_list; for (; driver_list; driver_list = driver_list->next) @@ -4782,7 +4782,7 @@ (Lisp_Object font_object, Lisp_Object string) { Lisp_Object frame = selected_frame; - FRAME_PTR f = XFRAME (frame); + struct frame *f = XFRAME (frame); struct font *font; struct face *face; int i, len, width; === modified file 'src/font.h' --- src/font.h 2013-08-01 10:33:25 +0000 +++ src/font.h 2013-08-03 03:29:03 +0000 @@ -504,7 +504,7 @@ /* Return a cache of font-entities on frame F. The cache must be a cons whose cdr part is the actual cache area. */ - Lisp_Object (*get_cache) (FRAME_PTR F); + Lisp_Object (*get_cache) (struct frame *f); /* List fonts exactly matching with FONT_SPEC on FRAME. The value is a list of font-entities. The font properties to be considered @@ -549,21 +549,21 @@ /* Open a font specified by FONT_ENTITY on frame F. If the font is scalable, open it with PIXEL_SIZE. */ - Lisp_Object (*open) (FRAME_PTR f, Lisp_Object font_entity, + Lisp_Object (*open) (struct frame *f, Lisp_Object font_entity, int pixel_size); /* Close FONT on frame F. */ - void (*close) (FRAME_PTR f, struct font *font); + void (*close) (struct frame *f, struct font *font); /* Optional (if FACE->extra is not used). Prepare FACE for displaying characters by FONT on frame F by storing some data in FACE->extra. If successful, return 0. Otherwise, return -1. */ - int (*prepare_face) (FRAME_PTR f, struct face *face); + int (*prepare_face) (struct frame *f, struct face *face); /* Optional. Done FACE for displaying characters by FACE->font on frame F. */ - void (*done_face) (FRAME_PTR f, struct face *face); + void (*done_face) (struct frame *f, struct face *face); /* Optional. If FONT (FONT-ENTITY or FONT-OBJECT) has a glyph for character C @@ -646,12 +646,12 @@ Make the font driver ready for frame F. Usually this function makes some data specific to F and stores it in F by calling font_put_frame_data (). */ - int (*start_for_frame) (FRAME_PTR f); + int (*start_for_frame) (struct frame *f); /* Optional. End using the driver for frame F. Usually this function free some data stored for F. */ - int (*end_for_frame) (FRAME_PTR f); + int (*end_for_frame) (struct frame *f); /* Optional. @@ -674,7 +674,7 @@ If FONT is usable on frame F, return 0. Otherwise return -1. This method is used only for debugging. If this method is NULL, Emacs assumes that the font is usable on any frame. */ - int (*check) (FRAME_PTR F, struct font *font); + int (*check) (struct frame *f, struct font *font); /* Optional. @@ -698,8 +698,8 @@ /* Chain of font drivers. There's one global font driver list - (font_driver_list in font.c). In addition, each frame has its own - font driver list at FRAME_PTR->font_driver_list. */ + (font_driver_list in font.c). In addition, each frame has + its own font driver list at F->font_driver_list. */ struct font_driver_list { @@ -713,8 +713,8 @@ }; -/* Chain of arbitrary data specific to each font driver. Each frame - has its own font data list at FRAME_PTR->font_data_list. */ +/* Chain of arbitrary data specific to each font driver. + Each frame has its own font data list at F->font_data_list. */ struct font_data_list { @@ -747,22 +747,22 @@ extern Lisp_Object font_get_name (Lisp_Object font_object); extern Lisp_Object font_spec_from_name (Lisp_Object font_name); extern Lisp_Object font_get_frame (Lisp_Object font_object); -extern int font_has_char (FRAME_PTR, Lisp_Object, int); +extern int font_has_char (struct frame *, Lisp_Object, int); extern void font_clear_prop (Lisp_Object *attrs, enum font_property_index prop); -extern Lisp_Object font_find_for_lface (FRAME_PTR f, Lisp_Object *lface, +extern Lisp_Object font_find_for_lface (struct frame *f, Lisp_Object *lface, Lisp_Object spec, int c); -extern Lisp_Object font_open_for_lface (FRAME_PTR f, Lisp_Object entity, +extern Lisp_Object font_open_for_lface (struct frame *f, Lisp_Object entity, Lisp_Object *lface, Lisp_Object spec); -extern Lisp_Object font_load_for_lface (FRAME_PTR f, Lisp_Object *lface, +extern Lisp_Object font_load_for_lface (struct frame *f, Lisp_Object *lface, Lisp_Object spec); -extern void font_prepare_for_face (FRAME_PTR f, struct face *face); -extern void font_done_for_face (FRAME_PTR f, struct face *face); +extern void font_prepare_for_face (struct frame *f, struct face *face); +extern void font_done_for_face (struct frame *f, struct face *face); -extern Lisp_Object font_open_by_spec (FRAME_PTR f, Lisp_Object spec); -extern Lisp_Object font_open_by_name (FRAME_PTR f, Lisp_Object name); +extern Lisp_Object font_open_by_spec (struct frame *f, Lisp_Object spec); +extern Lisp_Object font_open_by_name (struct frame *f, Lisp_Object name); extern Lisp_Object font_intern_prop (const char *str, ptrdiff_t len, bool force_symbol); @@ -777,9 +777,9 @@ char *name, int bytes); extern int font_unparse_fcname (Lisp_Object font, int pixel_size, char *name, int bytes); -extern void register_font_driver (struct font_driver *driver, FRAME_PTR f); -extern void free_font_driver_list (FRAME_PTR f); -extern Lisp_Object font_update_drivers (FRAME_PTR f, Lisp_Object list); +extern void register_font_driver (struct font_driver *driver, struct frame *f); +extern void free_font_driver_list (struct frame *f); +extern Lisp_Object font_update_drivers (struct frame *f, Lisp_Object list); extern Lisp_Object font_range (ptrdiff_t, ptrdiff_t, ptrdiff_t *, struct window *, struct face *, Lisp_Object); @@ -788,10 +788,10 @@ extern Lisp_Object font_put_extra (Lisp_Object font, Lisp_Object prop, Lisp_Object val); -extern int font_put_frame_data (FRAME_PTR f, +extern int font_put_frame_data (struct frame *f, struct font_driver *driver, void *data); -extern void *font_get_frame_data (FRAME_PTR f, +extern void *font_get_frame_data (struct frame *f, struct font_driver *driver); extern void font_filter_properties (Lisp_Object font, === modified file 'src/fontset.c' --- src/fontset.c 2013-07-16 06:39:49 +0000 +++ src/fontset.c 2013-08-03 03:29:03 +0000 @@ -539,8 +539,9 @@ { Lisp_Object vec, font_group; int i, charset_matched = 0, found_index; - FRAME_PTR f = (FRAMEP (FONTSET_FRAME (fontset)) - ? XFRAME (FONTSET_FRAME (fontset)) : XFRAME (selected_frame)); + struct frame *f = (FRAMEP (FONTSET_FRAME (fontset)) + ? XFRAME (FONTSET_FRAME (fontset)) + : XFRAME (selected_frame)); Lisp_Object rfont_def; font_group = fontset_get_font_group (fontset, fallback ? -1 : c); @@ -859,7 +860,7 @@ } static void -free_realized_fontset (FRAME_PTR f, Lisp_Object fontset) +free_realized_fontset (struct frame *f, Lisp_Object fontset) { #if 0 Lisp_Object tail; @@ -877,7 +878,7 @@ free_realized_face. */ void -free_face_fontset (FRAME_PTR f, struct face *face) +free_face_fontset (struct frame *f, struct face *face) { Lisp_Object fontset; @@ -930,7 +931,7 @@ the macro FACE_FOR_CHAR. */ int -face_for_char (FRAME_PTR f, struct face *face, int c, int pos, Lisp_Object object) +face_for_char (struct frame *f, struct face *face, int c, int pos, Lisp_Object object) { Lisp_Object fontset, rfont_def, charset; int face_id; @@ -1048,7 +1049,7 @@ Called from realize_x_face. */ int -make_fontset_for_ascii_face (FRAME_PTR f, int base_fontset_id, struct face *face) +make_fontset_for_ascii_face (struct frame *f, int base_fontset_id, struct face *face) { Lisp_Object base_fontset, fontset, frame; @@ -1227,7 +1228,7 @@ /* Return a list of base fontset names matching PATTERN on frame F. */ Lisp_Object -list_fontsets (FRAME_PTR f, Lisp_Object pattern, int size) +list_fontsets (struct frame *f, Lisp_Object pattern, int size) { Lisp_Object frame, regexp, val; int id; @@ -1284,7 +1285,7 @@ for (tail = FONTSET_FACE_ALIST (this); CONSP (tail); tail = XCDR (tail)) { - FRAME_PTR f = XFRAME (FONTSET_FRAME (this)); + struct frame *f = XFRAME (FONTSET_FRAME (this)); int face_id = XINT (XCDR (XCAR (tail))); struct face *face = FACE_FROM_ID (f, face_id); @@ -1612,7 +1613,7 @@ name = FONTSET_NAME (fontset); FOR_EACH_FRAME (tail, fr) { - FRAME_PTR f = XFRAME (fr); + struct frame *f = XFRAME (fr); Lisp_Object font_object; struct face *face; @@ -2140,7 +2141,7 @@ frame = FONTSET_FRAME (fontset); if (FRAMEP (frame)) { - FRAME_PTR f = XFRAME (frame); + struct frame *f = XFRAME (frame); if (FRAME_LIVE_P (f)) ASET (vec, 1, === modified file 'src/fontset.h' --- src/fontset.h 2013-04-05 14:07:02 +0000 +++ src/fontset.h 2013-08-03 03:29:03 +0000 @@ -28,12 +28,12 @@ struct face; -extern void free_face_fontset (FRAME_PTR, struct face *); -extern int face_for_char (FRAME_PTR, struct face *, int, +extern void free_face_fontset (struct frame *, struct face *); +extern int face_for_char (struct frame *, struct face *, int, int, Lisp_Object); extern Lisp_Object font_for_char (struct face *, int, int, Lisp_Object); -extern int make_fontset_for_ascii_face (FRAME_PTR, int, struct face *); +extern int make_fontset_for_ascii_face (struct frame *, int, struct face *); extern int fontset_from_font (Lisp_Object); extern int fs_query_fontset (Lisp_Object, int); extern Lisp_Object list_fontsets (struct frame *, Lisp_Object, int); === modified file 'src/frame.c' --- src/frame.c 2013-08-01 06:38:49 +0000 +++ src/frame.c 2013-08-03 03:29:03 +0000 @@ -1093,7 +1093,7 @@ (Exception: if F is the terminal frame, and we are using X, return 1.) */ static int -other_visible_frames (FRAME_PTR f) +other_visible_frames (struct frame *f) { Lisp_Object frames, this; @@ -1467,7 +1467,7 @@ and returns whatever that function returns. */) (void) { - FRAME_PTR f; + struct frame *f; Lisp_Object lispy_dummy; Lisp_Object x, y, retval; struct gcpro gcpro1; @@ -1513,7 +1513,7 @@ and nil for X and Y. */) (void) { - FRAME_PTR f; + struct frame *f; Lisp_Object lispy_dummy; Lisp_Object x, y; @@ -2610,7 +2610,7 @@ to store the new value in the parameter alist. */ void -x_set_frame_parameters (FRAME_PTR f, Lisp_Object alist) +x_set_frame_parameters (struct frame *f, Lisp_Object alist) { Lisp_Object tail; @@ -3348,7 +3348,7 @@ /* Return non-nil if frame F wants a bitmap icon. */ Lisp_Object -x_icon_type (FRAME_PTR f) +x_icon_type (struct frame *f) { Lisp_Object tem; === modified file 'src/frame.h' --- src/frame.h 2013-08-01 14:54:29 +0000 +++ src/frame.h 2013-08-03 03:29:03 +0000 @@ -591,8 +591,6 @@ /* Return a pointer to the image cache of frame F. */ #define FRAME_IMAGE_CACHE(F) ((F)->terminal->image_cache) -typedef struct frame *FRAME_PTR; - #define XFRAME(p) \ (eassert (FRAMEP (p)), (struct frame *) XUNTAG (p, Lisp_Vectorlike)) #define XSETFRAME(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_FRAME)) @@ -1206,7 +1204,7 @@ extern void x_set_scroll_bar_default_width (struct frame *); extern void x_set_offset (struct frame *, int, int, int); -extern void x_wm_set_size_hint (FRAME_PTR f, long flags, bool user_position); +extern void x_wm_set_size_hint (struct frame *f, long flags, bool user_position); extern Lisp_Object x_new_font (struct frame *, Lisp_Object, int); === modified file 'src/ftfont.c' --- src/ftfont.c 2013-08-01 10:33:25 +0000 +++ src/ftfont.c 2013-08-03 03:29:03 +0000 @@ -493,12 +493,12 @@ } #endif /* HAVE_LIBOTF */ -static Lisp_Object ftfont_get_cache (FRAME_PTR); +static Lisp_Object ftfont_get_cache (struct frame *); static Lisp_Object ftfont_list (struct frame *, Lisp_Object); static Lisp_Object ftfont_match (struct frame *, Lisp_Object); static Lisp_Object ftfont_list_family (struct frame *); -static Lisp_Object ftfont_open (FRAME_PTR, Lisp_Object, int); -static void ftfont_close (FRAME_PTR, struct font *); +static Lisp_Object ftfont_open (struct frame *, Lisp_Object, int); +static void ftfont_close (struct frame *, struct font *); static int ftfont_has_char (Lisp_Object, int); static unsigned ftfont_encode_char (struct font *, int); static int ftfont_text_extents (struct font *, unsigned *, int, @@ -568,7 +568,7 @@ }; static Lisp_Object -ftfont_get_cache (FRAME_PTR f) +ftfont_get_cache (struct frame *f) { return freetype_font_cache; } @@ -1173,7 +1173,7 @@ static Lisp_Object -ftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size) +ftfont_open (struct frame *f, Lisp_Object entity, int pixel_size) { struct ftfont_info *ftfont_info; struct font *font; @@ -1317,7 +1317,7 @@ } static void -ftfont_close (FRAME_PTR f, struct font *font) +ftfont_close (struct frame *f, struct font *font) { struct ftfont_info *ftfont_info = (struct ftfont_info *) font; Lisp_Object val, cache; === modified file 'src/ftxfont.c' --- src/ftxfont.c 2013-08-01 10:33:25 +0000 +++ src/ftxfont.c 2013-08-03 03:29:03 +0000 @@ -57,7 +57,7 @@ /* Return an array of 6 GCs for antialiasing. */ static GC * -ftxfont_get_gcs (FRAME_PTR f, long unsigned int foreground, long unsigned int background) +ftxfont_get_gcs (struct frame *f, long unsigned int foreground, long unsigned int background) { XColor color; XGCValues xgcv; @@ -134,7 +134,7 @@ } static int -ftxfont_draw_bitmap (FRAME_PTR f, GC gc_fore, GC *gcs, struct font *font, +ftxfont_draw_bitmap (struct frame *f, GC gc_fore, GC *gcs, struct font *font, unsigned int code, int x, int y, XPoint *p, int size, int *n, bool flush) { @@ -212,7 +212,7 @@ } static void -ftxfont_draw_background (FRAME_PTR f, struct font *font, GC gc, int x, int y, +ftxfont_draw_background (struct frame *f, struct font *font, GC gc, int x, int y, int width) { XGCValues xgcv; @@ -246,7 +246,7 @@ } static Lisp_Object -ftxfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size) +ftxfont_open (struct frame *f, Lisp_Object entity, int pixel_size) { Lisp_Object font_object; struct font *font; @@ -260,7 +260,7 @@ } static void -ftxfont_close (FRAME_PTR f, struct font *font) +ftxfont_close (struct frame *f, struct font *font) { ftfont_driver.close (f, font); } @@ -269,7 +269,7 @@ ftxfont_draw (struct glyph_string *s, int from, int to, int x, int y, bool with_background) { - FRAME_PTR f = s->f; + struct frame *f = s->f; struct face *face = s->face; struct font *font = s->font; XPoint p[0x700]; @@ -338,7 +338,7 @@ } static int -ftxfont_end_for_frame (FRAME_PTR f) +ftxfont_end_for_frame (struct frame *f) { struct ftxfont_frame_data *data = font_get_frame_data (f, &ftxfont_driver); === modified file 'src/gtkutil.c' --- src/gtkutil.c 2013-07-16 21:35:45 +0000 +++ src/gtkutil.c 2013-08-03 03:29:03 +0000 @@ -136,7 +136,7 @@ W can be a GtkMenu or a GtkWindow widget. */ static void -xg_set_screen (GtkWidget *w, FRAME_PTR f) +xg_set_screen (GtkWidget *w, struct frame *f) { if (FRAME_X_DISPLAY (f) != DEFAULT_GDK_DISPLAY ()) { @@ -280,7 +280,7 @@ } static GdkPixbuf * -xg_get_pixbuf_from_pixmap (FRAME_PTR f, Pixmap pix) +xg_get_pixbuf_from_pixmap (struct frame *f, Pixmap pix) { int iunused; GdkPixbuf *tmp_buf; @@ -311,7 +311,7 @@ /* Apply GMASK to GPIX and return a GdkPixbuf with an alpha channel. */ static GdkPixbuf * -xg_get_pixbuf_from_pix_and_mask (FRAME_PTR f, +xg_get_pixbuf_from_pix_and_mask (struct frame *f, Pixmap pix, Pixmap mask) { @@ -387,7 +387,7 @@ If OLD_WIDGET is not NULL, that widget is modified. */ static GtkWidget * -xg_get_image_for_pixmap (FRAME_PTR f, +xg_get_image_for_pixmap (struct frame *f, struct image *img, GtkWidget *widget, GtkImage *old_widget) @@ -641,7 +641,7 @@ GtkWidget *previous_toplevel, gpointer user_data) { - FRAME_PTR f = (FRAME_PTR) user_data; + struct frame *f = (struct frame *) user_data; struct x_output *x = f->output_data.x; GtkWidget *top = gtk_widget_get_toplevel (x->ttip_lbl); @@ -663,7 +663,7 @@ GtkTooltip *tooltip, gpointer user_data) { - FRAME_PTR f = (FRAME_PTR) user_data; + struct frame *f = (struct frame *) user_data; struct x_output *x = f->output_data.x; if (x->ttip_widget == NULL) { @@ -707,7 +707,7 @@ Return true if a system tooltip is available. */ bool -xg_prepare_tooltip (FRAME_PTR f, +xg_prepare_tooltip (struct frame *f, Lisp_Object string, int *width, int *height) @@ -764,7 +764,7 @@ xg_prepare_tooltip must have been called before this function. */ void -xg_show_tooltip (FRAME_PTR f, int root_x, int root_y) +xg_show_tooltip (struct frame *f, int root_x, int root_y) { #ifdef USE_GTK_TOOLTIP struct x_output *x = f->output_data.x; @@ -783,7 +783,7 @@ system tooltips). */ bool -xg_hide_tooltip (FRAME_PTR f) +xg_hide_tooltip (struct frame *f) { bool ret = 0; #ifdef USE_GTK_TOOLTIP @@ -827,7 +827,7 @@ F is the frame we shall set geometry for. */ static void -xg_set_geometry (FRAME_PTR f) +xg_set_geometry (struct frame *f) { if (f->size_hint_flags & (USPosition | PPosition)) { @@ -865,7 +865,7 @@ and use a GtkFixed widget, this doesn't happen automatically. */ static void -xg_clear_under_internal_border (FRAME_PTR f) +xg_clear_under_internal_border (struct frame *f) { if (FRAME_INTERNAL_BORDER_WIDTH (f) > 0) { @@ -903,7 +903,7 @@ PIXELWIDTH, PIXELHEIGHT is the new size in pixels. */ void -xg_frame_resized (FRAME_PTR f, int pixelwidth, int pixelheight) +xg_frame_resized (struct frame *f, int pixelwidth, int pixelheight) { int rows, columns; @@ -939,7 +939,7 @@ COLUMNS/ROWS is the size the edit area shall have after the resize. */ void -xg_frame_set_char_size (FRAME_PTR f, int cols, int rows) +xg_frame_set_char_size (struct frame *f, int cols, int rows) { int pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows) + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f); @@ -1002,7 +1002,7 @@ The policy is to keep the number of editable lines. */ static void -xg_height_or_width_changed (FRAME_PTR f) +xg_height_or_width_changed (struct frame *f) { gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), FRAME_TOTAL_PIXEL_WIDTH (f), @@ -1042,7 +1042,7 @@ /* Set the background of widget W to PIXEL. */ static void -xg_set_widget_bg (FRAME_PTR f, GtkWidget *w, long unsigned int pixel) +xg_set_widget_bg (struct frame *f, GtkWidget *w, long unsigned int pixel) { #ifdef HAVE_GTK3 GdkRGBA bg; @@ -1093,7 +1093,7 @@ Lisp_Object rest, frame; FOR_EACH_FRAME (rest, frame) { - FRAME_PTR f = XFRAME (frame); + struct frame *f = XFRAME (frame); if (FRAME_LIVE_P (f) && FRAME_X_P (f) && FRAME_X_DISPLAY (f) == dpy) @@ -1115,7 +1115,7 @@ #ifdef HAVE_GTK3 /* The event doesn't arrive in the normal event loop. Send event here. */ - FRAME_PTR f = (FRAME_PTR) user_data; + struct frame *f = (struct frame *) user_data; struct input_event ie; EVENT_INIT (ie); @@ -1131,7 +1131,7 @@ Return true if creation succeeded. */ bool -xg_create_frame_widgets (FRAME_PTR f) +xg_create_frame_widgets (struct frame *f) { GtkWidget *wtop; GtkWidget *wvbox, *whbox; @@ -1300,7 +1300,7 @@ } void -xg_free_frame_widgets (FRAME_PTR f) +xg_free_frame_widgets (struct frame *f) { if (FRAME_GTK_OUTER_WIDGET (f)) { @@ -1332,7 +1332,7 @@ flag (this is useful when FLAGS is 0). */ void -x_wm_set_size_hint (FRAME_PTR f, long int flags, bool user_position) +x_wm_set_size_hint (struct frame *f, long int flags, bool user_position) { /* Must use GTK routines here, otherwise GTK resets the size hints to its own defaults. */ @@ -1432,7 +1432,7 @@ BG is the pixel value to change to. */ void -xg_set_background_color (FRAME_PTR f, long unsigned int bg) +xg_set_background_color (struct frame *f, long unsigned int bg) { if (FRAME_GTK_WIDGET (f)) { @@ -1447,7 +1447,7 @@ functions so GTK does not overwrite the icon. */ void -xg_set_frame_icon (FRAME_PTR f, Pixmap icon_pixmap, Pixmap icon_mask) +xg_set_frame_icon (struct frame *f, Pixmap icon_pixmap, Pixmap icon_mask) { GdkPixbuf *gp = xg_get_pixbuf_from_pix_and_mask (f, icon_pixmap, @@ -1693,7 +1693,7 @@ The dialog W is not destroyed when this function returns. */ static int -xg_dialog_run (FRAME_PTR f, GtkWidget *w) +xg_dialog_run (struct frame *f, GtkWidget *w) { ptrdiff_t count = SPECPDL_INDEX (); struct xg_dialog_data dd; @@ -1813,7 +1813,7 @@ Returns the created widget. */ static GtkWidget * -xg_get_file_with_chooser (FRAME_PTR f, +xg_get_file_with_chooser (struct frame *f, char *prompt, char *default_filename, bool mustmatch_p, bool only_dir_p, @@ -1935,7 +1935,7 @@ Returns the created widget. */ static GtkWidget * -xg_get_file_with_selection (FRAME_PTR f, +xg_get_file_with_selection (struct frame *f, char *prompt, char *default_filename, bool mustmatch_p, bool only_dir_p, @@ -1977,7 +1977,7 @@ The returned string must be freed by the caller. */ char * -xg_get_file_name (FRAME_PTR f, +xg_get_file_name (struct frame *f, char *prompt, char *default_filename, bool mustmatch_p, @@ -2051,7 +2051,7 @@ DEFAULT_NAME, if non-zero, is the default font name. */ Lisp_Object -xg_get_font (FRAME_PTR f, const char *default_name) +xg_get_font (struct frame *f, const char *default_name) { GtkWidget *w; int done = 0; @@ -2169,7 +2169,7 @@ allocated xg_menu_cb_data if CL_DATA is NULL. */ static xg_menu_cb_data * -make_cl_data (xg_menu_cb_data *cl_data, FRAME_PTR f, GCallback highlight_cb) +make_cl_data (xg_menu_cb_data *cl_data, struct frame *f, GCallback highlight_cb) { if (! cl_data) { @@ -2201,7 +2201,7 @@ static void update_cl_data (xg_menu_cb_data *cl_data, - FRAME_PTR f, + struct frame *f, GCallback highlight_cb) { if (cl_data) @@ -2251,7 +2251,7 @@ FOR_EACH_FRAME (rest, frame) { - FRAME_PTR f = XFRAME (frame); + struct frame *f = XFRAME (frame); if (FRAME_X_P (f) && FRAME_GTK_OUTER_WIDGET (f)) { @@ -2480,7 +2480,7 @@ static GtkWidget * xg_create_one_menuitem (widget_value *item, - FRAME_PTR f, + struct frame *f, GCallback select_cb, GCallback highlight_cb, xg_menu_cb_data *cl_data, @@ -2551,7 +2551,7 @@ static GtkWidget * create_menus (widget_value *data, - FRAME_PTR f, + struct frame *f, GCallback select_cb, GCallback deactivate_cb, GCallback highlight_cb, @@ -2694,9 +2694,9 @@ Returns the widget created. */ GtkWidget * -xg_create_widget (const char *type, const char *name, FRAME_PTR f, widget_value *val, - GCallback select_cb, GCallback deactivate_cb, - GCallback highlight_cb) +xg_create_widget (const char *type, const char *name, struct frame *f, + widget_value *val, GCallback select_cb, + GCallback deactivate_cb, GCallback highlight_cb) { GtkWidget *w = 0; bool menu_bar_p = strcmp (type, "menubar") == 0; @@ -2802,7 +2802,7 @@ static void xg_update_menubar (GtkWidget *menubar, - FRAME_PTR f, + struct frame *f, GList **list, GList *iter, int pos, @@ -3119,7 +3119,7 @@ static GtkWidget * xg_update_submenu (GtkWidget *submenu, - FRAME_PTR f, + struct frame *f, widget_value *val, GCallback select_cb, GCallback deactivate_cb, @@ -3261,8 +3261,8 @@ HIGHLIGHT_CB is the callback to call when entering/leaving menu items. */ void -xg_modify_menubar_widgets (GtkWidget *menubar, FRAME_PTR f, widget_value *val, - bool deep_p, +xg_modify_menubar_widgets (GtkWidget *menubar, struct frame *f, + widget_value *val, bool deep_p, GCallback select_cb, GCallback deactivate_cb, GCallback highlight_cb) { @@ -3336,7 +3336,7 @@ menubar_map_cb (GtkWidget *w, gpointer user_data) { GtkRequisition req; - FRAME_PTR f = (FRAME_PTR) user_data; + struct frame *f = (struct frame *) user_data; gtk_widget_get_preferred_size (w, NULL, &req); if (FRAME_MENUBAR_HEIGHT (f) != req.height) { @@ -3349,7 +3349,7 @@ changed. */ void -xg_update_frame_menubar (FRAME_PTR f) +xg_update_frame_menubar (struct frame *f) { struct x_output *x = f->output_data.x; GtkRequisition req; @@ -3387,7 +3387,7 @@ This is used when deleting a frame, and when turning off the menu bar. */ void -free_frame_menubar (FRAME_PTR f) +free_frame_menubar (struct frame *f) { struct x_output *x = f->output_data.x; @@ -3406,7 +3406,7 @@ } bool -xg_event_is_for_menubar (FRAME_PTR f, XEvent *event) +xg_event_is_for_menubar (struct frame *f, XEvent *event) { struct x_output *x = f->output_data.x; GList *iter; @@ -3619,7 +3619,7 @@ to set resources for the widget. */ void -xg_create_scroll_bar (FRAME_PTR f, +xg_create_scroll_bar (struct frame *f, struct scroll_bar *bar, GCallback scroll_callback, GCallback end_callback, @@ -3681,7 +3681,7 @@ /* Remove the scroll bar represented by SCROLLBAR_ID from the frame F. */ void -xg_remove_scroll_bar (FRAME_PTR f, ptrdiff_t scrollbar_id) +xg_remove_scroll_bar (struct frame *f, ptrdiff_t scrollbar_id) { GtkWidget *w = xg_get_widget_from_map (scrollbar_id); if (w) @@ -3699,7 +3699,7 @@ WIDTH, HEIGHT is the size in pixels the bar shall have. */ void -xg_update_scrollbar_pos (FRAME_PTR f, +xg_update_scrollbar_pos (struct frame *f, ptrdiff_t scrollbar_id, int top, int left, @@ -3781,7 +3781,7 @@ { GtkWidget *wscroll = xg_get_widget_from_map (bar->x_window); - FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); + struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); if (wscroll && NILP (bar->dragging)) { @@ -3861,7 +3861,7 @@ frame. This function does additional checks. */ bool -xg_event_is_for_scrollbar (FRAME_PTR f, XEvent *event) +xg_event_is_for_scrollbar (struct frame *f, XEvent *event) { bool retval = 0; @@ -3946,7 +3946,8 @@ gpointer gmod = g_object_get_data (G_OBJECT (w), XG_TOOL_BAR_LAST_MODIFIER); intptr_t mod = (intptr_t) gmod; - FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA); + struct frame *f = (struct frame *) g_object_get_data (G_OBJECT (w), + XG_FRAME_DATA); Lisp_Object key, frame; struct input_event event; EVENT_INIT (event); @@ -4149,7 +4150,7 @@ GtkWidget *w, gpointer client_data) { - FRAME_PTR f = (FRAME_PTR) client_data; + struct frame *f = (struct frame *) client_data; g_object_set (G_OBJECT (w), "show-arrow", !x_gtk_whole_detached_tool_bar, NULL); @@ -4186,7 +4187,7 @@ GtkWidget *w, gpointer client_data) { - FRAME_PTR f = (FRAME_PTR) client_data; + struct frame *f = (struct frame *) client_data; g_object_set (G_OBJECT (w), "show-arrow", TRUE, NULL); if (f) @@ -4224,7 +4225,8 @@ gpointer client_data) { intptr_t idx = (intptr_t) client_data; - FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA); + struct frame *f = (struct frame *) g_object_get_data (G_OBJECT (w), + XG_FRAME_DATA); Lisp_Object help, frame; if (! f || ! f->n_tool_bar_items || NILP (f->tool_bar_items)) @@ -4297,7 +4299,7 @@ /* Attach a tool bar to frame F. */ static void -xg_pack_tool_bar (FRAME_PTR f, Lisp_Object pos) +xg_pack_tool_bar (struct frame *f, Lisp_Object pos) { struct x_output *x = f->output_data.x; bool into_hbox = EQ (pos, Qleft) || EQ (pos, Qright); @@ -4354,7 +4356,7 @@ x->toolbar_is_packed = true; } -static bool xg_update_tool_bar_sizes (FRAME_PTR f); +static bool xg_update_tool_bar_sizes (struct frame *f); static void tb_size_cb (GtkWidget *widget, @@ -4364,7 +4366,7 @@ /* When tool bar is created it has one preferred size. But when size is allocated between widgets, it may get another. So we must update size hints if tool bar size changes. Seen on Fedora 18 at least. */ - FRAME_PTR f = (FRAME_PTR) user_data; + struct frame *f = (struct frame *) user_data; if (xg_update_tool_bar_sizes (f)) x_wm_set_size_hint (f, 0, 0); } @@ -4372,7 +4374,7 @@ /* Create a tool bar for frame F. */ static void -xg_create_tool_bar (FRAME_PTR f) +xg_create_tool_bar (struct frame *f) { struct x_output *x = f->output_data.x; #if GTK_CHECK_VERSION (3, 3, 6) @@ -4415,7 +4417,7 @@ Returns IMAGE if RTL is not found. */ static Lisp_Object -find_rtl_image (FRAME_PTR f, Lisp_Object image, Lisp_Object rtl) +find_rtl_image (struct frame *f, Lisp_Object image, Lisp_Object rtl) { int i; Lisp_Object file, rtl_name; @@ -4443,7 +4445,7 @@ } static GtkToolItem * -xg_make_tool_item (FRAME_PTR f, +xg_make_tool_item (struct frame *f, GtkWidget *wimage, GtkWidget **wbutton, const char *label, @@ -4606,7 +4608,7 @@ } static bool -xg_update_tool_bar_sizes (FRAME_PTR f) +xg_update_tool_bar_sizes (struct frame *f) { struct x_output *x = f->output_data.x; GtkRequisition req; @@ -4654,7 +4656,7 @@ /* Update the tool bar for frame F. Add new buttons and remove old. */ void -update_frame_tool_bar (FRAME_PTR f) +update_frame_tool_bar (struct frame *f) { int i, j; struct x_output *x = f->output_data.x; @@ -4929,7 +4931,7 @@ Remove the tool bar. */ void -free_frame_tool_bar (FRAME_PTR f) +free_frame_tool_bar (struct frame *f) { struct x_output *x = f->output_data.x; @@ -4976,7 +4978,7 @@ } void -xg_change_toolbar_position (FRAME_PTR f, Lisp_Object pos) +xg_change_toolbar_position (struct frame *f, Lisp_Object pos) { struct x_output *x = f->output_data.x; GtkWidget *top_widget = TOOLBAR_TOP_WIDGET (x); === modified file 'src/gtkutil.h' --- src/gtkutil.h 2013-01-01 09:11:05 +0000 +++ src/gtkutil.h 2013-08-03 03:29:03 +0000 @@ -55,7 +55,7 @@ { xg_list_node ptrs; - FRAME_PTR f; + struct frame *f; Lisp_Object menu_bar_vector; int menu_bar_items_used; GCallback highlight_cb; @@ -81,46 +81,46 @@ extern bool xg_uses_old_file_dialog (void) ATTRIBUTE_CONST; -extern char *xg_get_file_name (FRAME_PTR f, +extern char *xg_get_file_name (struct frame *f, char *prompt, char *default_filename, bool mustmatch_p, bool only_dir_p); -extern Lisp_Object xg_get_font (FRAME_PTR f, const char *); +extern Lisp_Object xg_get_font (struct frame *f, const char *); extern GtkWidget *xg_create_widget (const char *type, const char *name, - FRAME_PTR f, + struct frame *f, struct _widget_value *val, GCallback select_cb, GCallback deactivate_cb, GCallback highlight_cb); extern void xg_modify_menubar_widgets (GtkWidget *menubar, - FRAME_PTR f, + struct frame *f, struct _widget_value *val, bool deep_p, GCallback select_cb, GCallback deactivate_cb, GCallback highlight_cb); -extern void xg_update_frame_menubar (FRAME_PTR f); +extern void xg_update_frame_menubar (struct frame *f); -extern bool xg_event_is_for_menubar (FRAME_PTR f, XEvent *event); +extern bool xg_event_is_for_menubar (struct frame *f, XEvent *event); extern bool xg_have_tear_offs (void); extern ptrdiff_t xg_get_scroll_id_for_window (Display *dpy, Window wid); -extern void xg_create_scroll_bar (FRAME_PTR f, +extern void xg_create_scroll_bar (struct frame *f, struct scroll_bar *bar, GCallback scroll_callback, GCallback end_callback, const char *scroll_bar_name); -extern void xg_remove_scroll_bar (FRAME_PTR f, ptrdiff_t scrollbar_id); +extern void xg_remove_scroll_bar (struct frame *f, ptrdiff_t scrollbar_id); -extern void xg_update_scrollbar_pos (FRAME_PTR f, +extern void xg_update_scrollbar_pos (struct frame *f, ptrdiff_t scrollbar_id, int top, int left, @@ -131,40 +131,40 @@ int portion, int position, int whole); -extern bool xg_event_is_for_scrollbar (FRAME_PTR f, XEvent *event); +extern bool xg_event_is_for_scrollbar (struct frame *f, XEvent *event); extern int xg_get_default_scrollbar_width (void); -extern void update_frame_tool_bar (FRAME_PTR f); -extern void free_frame_tool_bar (FRAME_PTR f); -extern void xg_change_toolbar_position (FRAME_PTR f, Lisp_Object pos); +extern void update_frame_tool_bar (struct frame *f); +extern void free_frame_tool_bar (struct frame *f); +extern void xg_change_toolbar_position (struct frame *f, Lisp_Object pos); -extern void xg_frame_resized (FRAME_PTR f, +extern void xg_frame_resized (struct frame *f, int pixelwidth, int pixelheight); -extern void xg_frame_set_char_size (FRAME_PTR f, int cols, int rows); +extern void xg_frame_set_char_size (struct frame *f, int cols, int rows); extern GtkWidget * xg_win_to_widget (Display *dpy, Window wdesc); extern void xg_display_open (char *display_name, Display **dpy); extern void xg_display_close (Display *dpy); extern GdkCursor * xg_create_default_cursor (Display *dpy); -extern bool xg_create_frame_widgets (FRAME_PTR f); -extern void xg_free_frame_widgets (FRAME_PTR f); -extern void xg_set_background_color (FRAME_PTR f, unsigned long bg); +extern bool xg_create_frame_widgets (struct frame *f); +extern void xg_free_frame_widgets (struct frame *f); +extern void xg_set_background_color (struct frame *f, unsigned long bg); extern bool xg_check_special_colors (struct frame *f, const char *color_name, XColor *color); -extern void xg_set_frame_icon (FRAME_PTR f, +extern void xg_set_frame_icon (struct frame *f, Pixmap icon_pixmap, Pixmap icon_mask); -extern bool xg_prepare_tooltip (FRAME_PTR f, +extern bool xg_prepare_tooltip (struct frame *f, Lisp_Object string, int *width, int *height); -extern void xg_show_tooltip (FRAME_PTR f, int root_x, int root_y); -extern bool xg_hide_tooltip (FRAME_PTR f); +extern void xg_show_tooltip (struct frame *f, int root_x, int root_y); +extern bool xg_hide_tooltip (struct frame *f); /* Mark all callback data that are Lisp_object:s during GC. */ === modified file 'src/image.c' --- src/image.c 2013-07-20 19:20:33 +0000 +++ src/image.c 2013-08-03 03:29:03 +0000 @@ -164,20 +164,20 @@ /* Functions to access the contents of a bitmap, given an id. */ int -x_bitmap_height (FRAME_PTR f, ptrdiff_t id) +x_bitmap_height (struct frame *f, ptrdiff_t id) { return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].height; } int -x_bitmap_width (FRAME_PTR f, ptrdiff_t id) +x_bitmap_width (struct frame *f, ptrdiff_t id) { return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].width; } #if defined (HAVE_X_WINDOWS) || defined (HAVE_NTGUI) ptrdiff_t -x_bitmap_pixmap (FRAME_PTR f, ptrdiff_t id) +x_bitmap_pixmap (struct frame *f, ptrdiff_t id) { /* HAVE_NTGUI needs the explicit cast here. */ return (ptrdiff_t) FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].pixmap; @@ -186,7 +186,7 @@ #ifdef HAVE_X_WINDOWS int -x_bitmap_mask (FRAME_PTR f, ptrdiff_t id) +x_bitmap_mask (struct frame *f, ptrdiff_t id) { return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].mask; } @@ -195,7 +195,7 @@ /* Allocate a new bitmap record. Returns index of new record. */ static ptrdiff_t -x_allocate_bitmap_record (FRAME_PTR f) +x_allocate_bitmap_record (struct frame *f) { Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); ptrdiff_t i; @@ -216,7 +216,7 @@ /* Add one reference to the reference count of the bitmap with id ID. */ void -x_reference_bitmap (FRAME_PTR f, ptrdiff_t id) +x_reference_bitmap (struct frame *f, ptrdiff_t id) { ++FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].refcount; } @@ -384,7 +384,7 @@ /* Remove reference to bitmap with id number ID. */ void -x_destroy_bitmap (FRAME_PTR f, ptrdiff_t id) +x_destroy_bitmap (struct frame *f, ptrdiff_t id) { Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); === modified file 'src/keyboard.c' --- src/keyboard.c 2013-07-19 10:55:36 +0000 +++ src/keyboard.c 2013-08-03 03:29:03 +0000 @@ -1281,7 +1281,7 @@ #endif bool ignore_mouse_drag_p; -static FRAME_PTR +static struct frame * some_mouse_moved (void) { Lisp_Object tail, frame; @@ -2163,7 +2163,7 @@ This causes trouble if we are trying to read a mouse motion event (i.e., if we are inside a `track-mouse' form), so we restore the mouse_moved flag. */ - FRAME_PTR f = NILP (do_mouse_tracking) ? NULL : some_mouse_moved (); + struct frame *f = NILP (do_mouse_tracking) ? NULL : some_mouse_moved (); help = call1 (Qmouse_fixup_help_message, help); if (f) f->mouse_moved = 1; @@ -4152,7 +4152,7 @@ /* Try generating a mouse motion event. */ else if (!NILP (do_mouse_tracking) && some_mouse_moved ()) { - FRAME_PTR f = some_mouse_moved (); + struct frame *f = some_mouse_moved (); Lisp_Object bar_window; enum scroll_bar_part part; Lisp_Object x, y; @@ -5898,7 +5898,7 @@ case DRAG_N_DROP_EVENT: { - FRAME_PTR f; + struct frame *f; Lisp_Object head, position; Lisp_Object files; @@ -5977,7 +5977,7 @@ #ifdef HAVE_GPM case GPM_CLICK_EVENT: { - FRAME_PTR f = XFRAME (event->frame_or_window); + struct frame *f = XFRAME (event->frame_or_window); Lisp_Object head, position; Lisp_Object *start_pos_ptr; Lisp_Object start_pos; @@ -6031,7 +6031,7 @@ } static Lisp_Object -make_lispy_movement (FRAME_PTR frame, Lisp_Object bar_window, enum scroll_bar_part part, +make_lispy_movement (struct frame *frame, Lisp_Object bar_window, enum scroll_bar_part part, Lisp_Object x, Lisp_Object y, Time t) { /* Is it a scroll bar movement? */ === modified file 'src/menu.c' --- src/menu.c 2013-07-16 21:35:45 +0000 +++ src/menu.c 2013-08-03 03:29:03 +0000 @@ -867,7 +867,8 @@ VECTOR is an array of menu events for the whole menu. */ void -find_and_call_menu_selection (FRAME_PTR f, int menu_bar_items_used, Lisp_Object vector, void *client_data) +find_and_call_menu_selection (struct frame *f, int menu_bar_items_used, + Lisp_Object vector, void *client_data) { Lisp_Object prefix, entry; Lisp_Object *subprefix_stack; @@ -950,7 +951,7 @@ /* As above, but return the menu selection instead of storing in kb buffer. If KEYMAPS, return full prefixes to selection. */ Lisp_Object -find_and_return_menu_selection (FRAME_PTR f, bool keymaps, void *client_data) +find_and_return_menu_selection (struct frame *f, bool keymaps, void *client_data) { Lisp_Object prefix, entry; int i; @@ -1060,7 +1061,7 @@ Lisp_Object title; const char *error_name = NULL; Lisp_Object selection = Qnil; - FRAME_PTR f = NULL; + struct frame *f = NULL; Lisp_Object x, y, window; bool keymaps = 0; bool for_click = 0; @@ -1116,7 +1117,7 @@ if (get_current_pos_p) { /* Use the mouse's current position. */ - FRAME_PTR new_f = SELECTED_FRAME (); + struct frame *new_f = SELECTED_FRAME (); #ifdef HAVE_X_WINDOWS /* Can't use mouse_position_hook for X since it returns coordinates relative to the window the mouse is in, === modified file 'src/menu.h' --- src/menu.h 2013-01-01 09:11:05 +0000 +++ src/menu.h 2013-08-03 03:29:03 +0000 @@ -35,20 +35,20 @@ || defined (HAVE_NS) extern void free_menubar_widget_value_tree (widget_value *); extern void update_submenu_strings (widget_value *); -extern void find_and_call_menu_selection (FRAME_PTR, int, +extern void find_and_call_menu_selection (struct frame *, int, Lisp_Object, void *); extern widget_value *xmalloc_widget_value (void); extern widget_value *digest_single_submenu (int, int, bool); #endif #ifdef HAVE_X_WINDOWS -extern void mouse_position_for_popup (FRAME_PTR f, int *x, int *y); +extern void mouse_position_for_popup (struct frame *f, int *x, int *y); #endif -extern Lisp_Object w32_menu_show (FRAME_PTR, int, int, int, int, +extern Lisp_Object w32_menu_show (struct frame *, int, int, int, int, Lisp_Object, const char **); -extern Lisp_Object ns_menu_show (FRAME_PTR, int, int, bool, bool, +extern Lisp_Object ns_menu_show (struct frame *, int, int, bool, bool, Lisp_Object, const char **); -extern Lisp_Object xmenu_show (FRAME_PTR, int, int, bool, bool, +extern Lisp_Object xmenu_show (struct frame *, int, int, bool, bool, Lisp_Object, const char **, Time); #endif /* MENU_H */ === modified file 'src/msdos.c' --- src/msdos.c 2013-07-31 12:50:59 +0000 +++ src/msdos.c 2013-08-03 03:29:03 +0000 @@ -298,7 +298,7 @@ } void -mouse_get_pos (FRAME_PTR *f, int insist, Lisp_Object *bar_window, +mouse_get_pos (struct frame **f, int insist, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, Time *time) { @@ -1158,7 +1158,7 @@ to put the cursor at the end of the text displayed there. */ static void -IT_cmgoto (FRAME_PTR f) +IT_cmgoto (struct frame *f) { /* Only set the cursor to where it should be if the display is already in sync with the window contents. */ @@ -1760,7 +1760,7 @@ } } -extern void init_frame_faces (FRAME_PTR); +extern void init_frame_faces (struct frame *); #endif /* !HAVE_X_WINDOWS */ === modified file 'src/nsfns.m' --- src/nsfns.m 2013-07-31 12:50:59 +0000 +++ src/nsfns.m 2013-08-03 03:29:03 +0000 @@ -143,7 +143,7 @@ dpyinfo = ns_display_info_for_name (object); else { - FRAME_PTR f = decode_window_system_frame (object); + struct frame *f = decode_window_system_frame (object); dpyinfo = FRAME_NS_DISPLAY_INFO (f); } @@ -431,7 +431,7 @@ } static void -ns_set_name_internal (FRAME_PTR f, Lisp_Object name) +ns_set_name_internal (struct frame *f, Lisp_Object name) { struct gcpro gcpro1; Lisp_Object encoded_name, encoded_icon_name; @@ -503,7 +503,7 @@ specified a name for the frame; the name will override any set by the redisplay code. */ static void -x_explicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval) +x_explicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { NSTRACE (x_explicitly_set_name); ns_set_name (f, arg, 1); @@ -514,7 +514,7 @@ name; names set this way will never override names set by the user's lisp code. */ void -x_implicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval) +x_implicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { NSTRACE (x_implicitly_set_name); @@ -857,7 +857,7 @@ /* This is the same as the xfns.c definition. */ static void -x_set_cursor_type (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval) +x_set_cursor_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { set_frame_cursor_types (f, arg); === modified file 'src/nsfont.m' --- src/nsfont.m 2013-08-01 10:33:25 +0000 +++ src/nsfont.m 2013-08-03 03:29:03 +0000 @@ -619,13 +619,13 @@ ========================================================================== */ -static Lisp_Object nsfont_get_cache (FRAME_PTR frame); +static Lisp_Object nsfont_get_cache (struct frame *frame); static Lisp_Object nsfont_list (struct frame *, Lisp_Object); static Lisp_Object nsfont_match (struct frame *, Lisp_Object); static Lisp_Object nsfont_list_family (struct frame *); -static Lisp_Object nsfont_open (FRAME_PTR f, Lisp_Object font_entity, +static Lisp_Object nsfont_open (struct frame *f, Lisp_Object font_entity, int pixel_size); -static void nsfont_close (FRAME_PTR f, struct font *font); +static void nsfont_close (struct frame *f, struct font *font); static int nsfont_has_char (Lisp_Object entity, int c); static unsigned int nsfont_encode_char (struct font *font, int c); static int nsfont_text_extents (struct font *font, unsigned int *code, @@ -659,7 +659,7 @@ /* Return a cache of font-entities on FRAME. The cache must be a cons whose cdr part is the actual cache area. */ static Lisp_Object -nsfont_get_cache (FRAME_PTR frame) +nsfont_get_cache (struct frame *frame) { Display_Info *dpyinfo = FRAME_NS_DISPLAY_INFO (frame); return (dpyinfo->name_list_element); @@ -724,7 +724,7 @@ /* Open a font specified by FONT_ENTITY on frame F. If the font is scalable, open it with PIXEL_SIZE. */ static Lisp_Object -nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size) +nsfont_open (struct frame *f, Lisp_Object font_entity, int pixel_size) { BOOL synthItal; unsigned int traits = 0; @@ -931,7 +931,7 @@ /* Close FONT on frame F. */ static void -nsfont_close (FRAME_PTR f, struct font *font) +nsfont_close (struct frame *f, struct font *font) { struct nsfont_info *font_info = (struct nsfont_info *)font; int i; === modified file 'src/nsmenu.m' --- src/nsmenu.m 2013-07-16 21:35:45 +0000 +++ src/nsmenu.m 2013-08-03 03:29:03 +0000 @@ -806,7 +806,7 @@ ========================================================================== */ Lisp_Object -ns_menu_show (FRAME_PTR f, int x, int y, bool for_click, bool keymaps, +ns_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps, Lisp_Object title, const char **error) { EmacsMenu *pmenu; @@ -1028,7 +1028,7 @@ ========================================================================== */ void -free_frame_tool_bar (FRAME_PTR f) +free_frame_tool_bar (struct frame *f) /* -------------------------------------------------------------------------- Under NS we just hide the toolbar until it might be needed again. -------------------------------------------------------------------------- */ @@ -1040,7 +1040,7 @@ } void -update_frame_tool_bar (FRAME_PTR f) +update_frame_tool_bar (struct frame *f) /* -------------------------------------------------------------------------- Update toolbar contents -------------------------------------------------------------------------- */ === modified file 'src/nsterm.h' --- src/nsterm.h 2013-08-02 09:42:23 +0000 +++ src/nsterm.h 2013-08-03 03:29:03 +0000 @@ -781,7 +781,7 @@ /* Implemented in nsterm, published in or needed from nsfns. */ extern Lisp_Object Qfontsize; -extern Lisp_Object ns_list_fonts (FRAME_PTR f, Lisp_Object pattern, +extern Lisp_Object ns_list_fonts (struct frame *f, Lisp_Object pattern, int size, int maxnames); extern void ns_clear_frame (struct frame *f); @@ -827,11 +827,11 @@ extern const char *ns_get_defaults_value (const char *key); /* in nsmenu */ -extern void update_frame_tool_bar (FRAME_PTR f); -extern void free_frame_tool_bar (FRAME_PTR f); -extern void find_and_call_menu_selection (FRAME_PTR f, +extern void update_frame_tool_bar (struct frame *f); +extern void free_frame_tool_bar (struct frame *f); +extern void find_and_call_menu_selection (struct frame *f, int menu_bar_items_used, Lisp_Object vector, void *client_data); -extern Lisp_Object find_and_return_menu_selection (FRAME_PTR f, +extern Lisp_Object find_and_return_menu_selection (struct frame *f, bool keymaps, void *client_data); extern Lisp_Object ns_popup_dialog (Lisp_Object position, Lisp_Object contents, === modified file 'src/nsterm.m' --- src/nsterm.m 2013-08-02 09:42:23 +0000 +++ src/nsterm.m 2013-08-03 03:29:03 +0000 @@ -1353,7 +1353,7 @@ static void -ns_fullscreen_hook (FRAME_PTR f) +ns_fullscreen_hook (struct frame *f) { EmacsView *view = (EmacsView *)FRAME_NS_VIEW (f); === modified file 'src/scroll.c' --- src/scroll.c 2013-03-08 21:37:41 +0000 +++ src/scroll.c 2013-08-03 03:29:03 +0000 @@ -86,7 +86,7 @@ new contents appears. */ static void -calculate_scrolling (FRAME_PTR frame, +calculate_scrolling (struct frame *frame, /* matrix is of size window_size + 1 on each side. */ struct matrix_elt *matrix, int window_size, int lines_below, @@ -422,7 +422,7 @@ is the equivalent of draw_cost for the old line contents */ static void -calculate_direct_scrolling (FRAME_PTR frame, +calculate_direct_scrolling (struct frame *frame, /* matrix is of size window_size + 1 on each side. */ struct matrix_elt *matrix, int window_size, int lines_below, @@ -793,7 +793,7 @@ void -scrolling_1 (FRAME_PTR frame, int window_size, int unchanged_at_top, +scrolling_1 (struct frame *frame, int window_size, int unchanged_at_top, int unchanged_at_bottom, int *draw_cost, int *old_draw_cost, int *old_hash, int *new_hash, int free_at_end) { @@ -883,7 +883,7 @@ overhead and multiply factor values */ static void -line_ins_del (FRAME_PTR frame, int ov1, int pf1, int ovn, int pfn, +line_ins_del (struct frame *frame, int ov1, int pf1, int ovn, int pfn, register int *ov, register int *mf) { register int i; @@ -901,7 +901,7 @@ } static void -ins_del_costs (FRAME_PTR frame, +ins_del_costs (struct frame *frame, const char *one_line_string, const char *multi_string, const char *setup_string, const char *cleanup_string, int *costvec, int *ncostvec, @@ -957,7 +957,7 @@ */ void -do_line_insertion_deletion_costs (FRAME_PTR frame, +do_line_insertion_deletion_costs (struct frame *frame, const char *ins_line_string, const char *multi_ins_string, const char *del_line_string, === modified file 'src/term.c' --- src/term.c 2013-08-02 21:16:33 +0000 +++ src/term.c 2013-08-03 03:29:03 +0000 @@ -2522,7 +2522,7 @@ } static bool -term_mouse_movement (FRAME_PTR frame, Gpm_Event *event) +term_mouse_movement (struct frame *frame, Gpm_Event *event) { /* Has the mouse moved off the glyph it was on at the last sighting? */ if (event->x != last_mouse_x || event->y != last_mouse_y) @@ -2563,7 +2563,7 @@ This clears mouse_moved until the next motion event arrives. */ static void -term_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window, +term_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, Time *timeptr) { === modified file 'src/w32fns.c' --- src/w32fns.c 2013-08-01 06:38:49 +0000 +++ src/w32fns.c 2013-08-03 03:29:03 +0000 @@ -285,7 +285,7 @@ return x_display_info_for_name (frame); else { - FRAME_PTR f; + struct frame *f; CHECK_LIVE_FRAME (frame); f = XFRAME (frame); @@ -344,7 +344,7 @@ not Emacs's own window. */ void -x_real_positions (FRAME_PTR f, int *xptr, int *yptr) +x_real_positions (struct frame *f, int *xptr, int *yptr) { POINT pt; RECT rect; @@ -1019,7 +1019,7 @@ } void -w32_regenerate_palette (FRAME_PTR f) +w32_regenerate_palette (struct frame *f) { struct w32_palette_entry * list; LOGPALETTE * log_palette; @@ -1069,7 +1069,7 @@ #if 0 /* Keep these around in case we ever want to track color usage. */ void -w32_map_color (FRAME_PTR f, COLORREF color) +w32_map_color (struct frame *f, COLORREF color) { struct w32_palette_entry * list = FRAME_W32_DISPLAY_INFO (f)->color_list; @@ -1100,7 +1100,7 @@ } void -w32_unmap_color (FRAME_PTR f, COLORREF color) +w32_unmap_color (struct frame *f, COLORREF color) { struct w32_palette_entry * list = FRAME_W32_DISPLAY_INFO (f)->color_list; struct w32_palette_entry **prev = &FRAME_W32_DISPLAY_INFO (f)->color_list; @@ -1153,7 +1153,7 @@ If ALLOC is nonzero, allocate a new colormap cell. */ int -w32_defined_color (FRAME_PTR f, const char *color, XColor *color_def, int alloc) +w32_defined_color (struct frame *f, const char *color, XColor *color_def, int alloc) { register Lisp_Object tem; COLORREF w32_color_ref; @@ -1224,7 +1224,7 @@ ARG says. */ int -x_decode_color (FRAME_PTR f, Lisp_Object arg, int def) +x_decode_color (struct frame *f, Lisp_Object arg, int def) { XColor cdef; @@ -1525,7 +1525,7 @@ void -x_set_cursor_type (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval) +x_set_cursor_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { set_frame_cursor_types (f, arg); @@ -1787,7 +1787,7 @@ specified a name for the frame; the name will override any set by the redisplay code. */ void -x_explicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval) +x_explicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { x_set_name (f, arg, 1); } @@ -1796,7 +1796,7 @@ name; names set this way will never override names set by the user's lisp code. */ void -x_implicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval) +x_implicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { x_set_name (f, arg, 0); } @@ -4645,7 +4645,7 @@ (Lisp_Object color, Lisp_Object frame) { XColor foo; - FRAME_PTR f = decode_window_system_frame (frame); + struct frame *f = decode_window_system_frame (frame); CHECK_STRING (color); @@ -4660,7 +4660,7 @@ (Lisp_Object color, Lisp_Object frame) { XColor foo; - FRAME_PTR f = decode_window_system_frame (frame); + struct frame *f = decode_window_system_frame (frame); CHECK_STRING (color); @@ -6610,7 +6610,7 @@ If optional parameter FRAME is not specified, use selected frame. */) (Lisp_Object command, Lisp_Object frame) { - FRAME_PTR f = decode_window_system_frame (frame); + struct frame *f = decode_window_system_frame (frame); CHECK_NUMBER (command); === modified file 'src/w32font.c' --- src/w32font.c 2013-08-01 10:33:25 +0000 +++ src/w32font.c 2013-08-03 03:29:03 +0000 @@ -99,7 +99,7 @@ /* Font spacing symbols - defined in font.c. */ extern Lisp_Object Qc, Qp, Qm; -static void fill_in_logfont (FRAME_PTR, LOGFONT *, Lisp_Object); +static void fill_in_logfont (struct frame *, LOGFONT *, Lisp_Object); static BYTE w32_antialias_type (Lisp_Object); static Lisp_Object lispy_antialias_type (BYTE); @@ -297,7 +297,7 @@ Return a cache of font-entities on FRAME. The cache must be a cons whose cdr part is the actual cache area. */ Lisp_Object -w32font_get_cache (FRAME_PTR f) +w32font_get_cache (struct frame *f) { struct w32_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); @@ -355,7 +355,7 @@ Open a font specified by FONT_ENTITY on frame F. If the font is scalable, open it with PIXEL_SIZE. */ static Lisp_Object -w32font_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size) +w32font_open (struct frame *f, Lisp_Object font_entity, int pixel_size) { Lisp_Object font_object = font_make_object (VECSIZE (struct w32font_info), @@ -379,7 +379,7 @@ /* w32 implementation of close for font_backend. Close FONT on frame F. */ void -w32font_close (FRAME_PTR f, struct font *font) +w32font_close (struct frame *f, struct font *font) { int i; struct w32font_info *w32_font = (struct w32font_info *) font; @@ -731,13 +731,13 @@ storing some data in FACE->extra. If successful, return 0. Otherwise, return -1. static int -w32font_prepare_face (FRAME_PTR f, struct face *face); +w32font_prepare_face (struct frame *f, struct face *face); */ /* w32 implementation of done_face for font backend. Optional. Done FACE for displaying characters by FACE->font on frame F. static void -w32font_done_face (FRAME_PTR f, struct face *face); */ +w32font_done_face (struct frame *f, struct face *face); */ /* w32 implementation of get_bitmap for font backend. Optional. @@ -889,7 +889,7 @@ } int -w32font_open_internal (FRAME_PTR f, Lisp_Object font_entity, +w32font_open_internal (struct frame *f, Lisp_Object font_entity, int pixel_size, Lisp_Object font_object) { int len, size; @@ -1961,7 +1961,7 @@ /* Fill in all the available details of LOGFONT from FONT_SPEC. */ static void -fill_in_logfont (FRAME_PTR f, LOGFONT *logfont, Lisp_Object font_spec) +fill_in_logfont (struct frame *f, LOGFONT *logfont, Lisp_Object font_spec) { Lisp_Object tmp, extra; int dpi = FRAME_RES_Y (f); @@ -2464,7 +2464,7 @@ in the font selection dialog. */) (Lisp_Object frame, Lisp_Object exclude_proportional) { - FRAME_PTR f = decode_window_system_frame (frame); + struct frame *f = decode_window_system_frame (frame); CHOOSEFONT cf; LOGFONT lf; TEXTMETRIC tm; === modified file 'src/w32font.h' --- src/w32font.h 2013-08-01 16:09:20 +0000 +++ src/w32font.h 2013-08-03 03:29:03 +0000 @@ -63,16 +63,16 @@ #define CACHE_BLOCKSIZE 128 -Lisp_Object w32font_get_cache (FRAME_PTR fe); +Lisp_Object w32font_get_cache (struct frame *fe); Lisp_Object w32font_list_internal (struct frame *f, Lisp_Object font_spec, int opentype_only); Lisp_Object w32font_match_internal (struct frame *f, Lisp_Object font_spec, int opentype_only); -int w32font_open_internal (FRAME_PTR f, Lisp_Object font_entity, +int w32font_open_internal (struct frame *f, Lisp_Object font_entity, int pixel_size, Lisp_Object font_object); -void w32font_close (FRAME_PTR f, struct font *font); +void w32font_close (struct frame *f, struct font *font); int w32font_has_char (Lisp_Object entity, int c); int w32font_text_extents (struct font *font, unsigned *code, int nglyphs, struct font_metrics *metrics); === modified file 'src/w32inevt.c' --- src/w32inevt.c 2013-06-03 19:06:09 +0000 +++ src/w32inevt.c 2013-08-03 03:29:03 +0000 @@ -103,10 +103,10 @@ } /* In a generic, multi-frame world this should take a console handle - and return the frame for it + and return the frame for it. Right now, there's only one frame so return it. */ -static FRAME_PTR +static struct frame * get_frame (void) { return SELECTED_FRAME (); @@ -394,7 +394,7 @@ /* Mouse position hook. */ void -w32_console_mouse_position (FRAME_PTR *f, +w32_console_mouse_position (struct frame **f, int insist, Lisp_Object *bar_window, enum scroll_bar_part *part, @@ -461,7 +461,7 @@ if (event->dwEventFlags == MOUSE_MOVED) { - FRAME_PTR f = SELECTED_FRAME (); + struct frame *f = SELECTED_FRAME (); Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); int mx = event->dwMousePosition.X, my = event->dwMousePosition.Y; @@ -555,7 +555,7 @@ static void resize_event (WINDOW_BUFFER_SIZE_RECORD *event) { - FRAME_PTR f = get_frame (); + struct frame *f = get_frame (); change_frame_size (f, event->dwSize.Y, event->dwSize.X, 0, 1, 0); SET_FRAME_GARBAGED (f); @@ -565,7 +565,7 @@ maybe_generate_resize_event (void) { CONSOLE_SCREEN_BUFFER_INFO info; - FRAME_PTR f = get_frame (); + struct frame *f = get_frame (); GetConsoleScreenBufferInfo (GetStdHandle (STD_OUTPUT_HANDLE), &info); === modified file 'src/w32inevt.h' --- src/w32inevt.h 2013-01-01 09:11:05 +0000 +++ src/w32inevt.h 2013-08-03 03:29:03 +0000 @@ -23,7 +23,7 @@ extern int w32_console_read_socket (struct terminal *term, struct input_event *hold_quit); -extern void w32_console_mouse_position (FRAME_PTR *f, int insist, +extern void w32_console_mouse_position (struct frame **f, int insist, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, === modified file 'src/w32menu.c' --- src/w32menu.c 2013-07-31 12:50:59 +0000 +++ src/w32menu.c 2013-08-03 03:29:03 +0000 @@ -100,13 +100,13 @@ Lisp_Object Qdebug_on_next_call; -void set_frame_menubar (FRAME_PTR, bool, bool); +void set_frame_menubar (struct frame *, bool, bool); #ifdef HAVE_DIALOGS -static Lisp_Object w32_dialog_show (FRAME_PTR, int, Lisp_Object, char**); +static Lisp_Object w32_dialog_show (struct frame *, int, Lisp_Object, char**); #else static int is_simple_dialog (Lisp_Object); -static Lisp_Object simple_dialog_show (FRAME_PTR, Lisp_Object, Lisp_Object); +static Lisp_Object simple_dialog_show (struct frame *, Lisp_Object, Lisp_Object); #endif static void utf8to16 (unsigned char *, int, WCHAR *); @@ -137,7 +137,7 @@ otherwise it is "Question". */) (Lisp_Object position, Lisp_Object contents, Lisp_Object header) { - FRAME_PTR f = NULL; + struct frame *f = NULL; Lisp_Object window; /* Decode the first argument: find the window or frame to use. */ @@ -147,7 +147,7 @@ { #if 0 /* Using the frame the mouse is on may not be right. */ /* Use the mouse's current position. */ - FRAME_PTR new_f = SELECTED_FRAME (); + struct frame *new_f = SELECTED_FRAME (); Lisp_Object bar_window; enum scroll_bar_part part; Time time; @@ -252,7 +252,7 @@ This way we can safely execute Lisp code. */ void -x_activate_menubar (FRAME_PTR f) +x_activate_menubar (struct frame *f) { set_frame_menubar (f, 0, 1); @@ -269,7 +269,7 @@ and put the appropriate events into the keyboard buffer. */ void -menubar_selection_callback (FRAME_PTR f, void * client_data) +menubar_selection_callback (struct frame *f, void * client_data) { Lisp_Object prefix, entry; Lisp_Object vector; @@ -361,7 +361,7 @@ it is set the first time this is called, from initialize_frame_menubar. */ void -set_frame_menubar (FRAME_PTR f, bool first_time, bool deep_p) +set_frame_menubar (struct frame *f, bool first_time, bool deep_p) { HMENU menubar_widget = f->output_data.w32->menubar_widget; Lisp_Object items; @@ -613,7 +613,7 @@ is visible. */ void -initialize_frame_menubar (FRAME_PTR f) +initialize_frame_menubar (struct frame *f) { /* This function is called before the first chance to redisplay the frame. It has to be, so the frame will have the right size. */ @@ -625,7 +625,7 @@ This is used when deleting a frame, and when turning off the menu bar. */ void -free_frame_menubar (FRAME_PTR f) +free_frame_menubar (struct frame *f) { block_input (); @@ -656,7 +656,7 @@ (We return nil on failure, but the value doesn't actually matter.) */ Lisp_Object -w32_menu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, +w32_menu_show (struct frame *f, int x, int y, int for_click, int keymaps, Lisp_Object title, const char **error) { int i; @@ -983,7 +983,7 @@ "button6", "button7", "button8", "button9", "button10" }; static Lisp_Object -w32_dialog_show (FRAME_PTR f, int keymaps, +w32_dialog_show (struct frame *f, int keymaps, Lisp_Object title, Lisp_Object header, char **error) { @@ -1219,7 +1219,7 @@ } static Lisp_Object -simple_dialog_show (FRAME_PTR f, Lisp_Object contents, Lisp_Object header) +simple_dialog_show (struct frame *f, Lisp_Object contents, Lisp_Object header) { int answer; UINT type; @@ -1699,7 +1699,7 @@ (void) { #ifdef HAVE_MENUS - FRAME_PTR f; + struct frame *f; f = SELECTED_FRAME (); return (f->output_data.w32->menubar_active > 0) ? Qt : Qnil; #else === modified file 'src/w32notify.c' --- src/w32notify.c 2013-07-02 16:32:03 +0000 +++ src/w32notify.c 2013-08-03 03:29:03 +0000 @@ -129,7 +129,7 @@ volatile int *terminate) { int done = 0; - FRAME_PTR f = SELECTED_FRAME (); + struct frame *f = SELECTED_FRAME (); /* A single buffer is used to communicate all notifications to the main thread. Since both the main thread and several watcher === modified file 'src/w32term.c' --- src/w32term.c 2013-08-02 04:21:51 +0000 +++ src/w32term.c 2013-08-03 03:29:03 +0000 @@ -181,7 +181,7 @@ /* Where the mouse was last time we reported a mouse event. */ static RECT last_mouse_glyph; -static FRAME_PTR last_mouse_glyph_frame; +static struct frame *last_mouse_glyph_frame; /* The scroll bar in which the last motion event occurred. @@ -249,7 +249,7 @@ #endif static void my_set_foreground_window (HWND); static void my_destroy_window (struct frame *, HWND); -static void w32fullscreen_hook (FRAME_PTR); +static void w32fullscreen_hook (struct frame *); #ifdef GLYPH_DEBUG static void x_check_font (struct frame *, struct font *); @@ -450,7 +450,7 @@ /* Draw a filled rectangle at the specified position. */ void -w32_fill_rect (FRAME_PTR f, HDC hdc, COLORREF pix, RECT *lprect) +w32_fill_rect (struct frame *f, HDC hdc, COLORREF pix, RECT *lprect) { HBRUSH hb; @@ -460,7 +460,7 @@ } void -w32_clear_window (FRAME_PTR f) +w32_clear_window (struct frame *f) { RECT rect; HDC hdc = get_frame_dc (f); @@ -3370,7 +3370,7 @@ static Lisp_Object last_mouse_motion_frame; static int -note_mouse_movement (FRAME_PTR frame, MSG *msg) +note_mouse_movement (struct frame *frame, MSG *msg) { int mouse_x = LOWORD (msg->lParam); int mouse_y = HIWORD (msg->lParam); @@ -3419,7 +3419,7 @@ ************************************************************************/ static struct scroll_bar *x_window_to_scroll_bar (Window); -static void x_scroll_bar_report_motion (FRAME_PTR *, Lisp_Object *, +static void x_scroll_bar_report_motion (struct frame **, Lisp_Object *, enum scroll_bar_part *, Lisp_Object *, Lisp_Object *, unsigned long *); @@ -3461,11 +3461,11 @@ movement. */ static void -w32_mouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window, +w32_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, unsigned long *time) { - FRAME_PTR f1; + struct frame *f1; block_input (); @@ -3696,7 +3696,7 @@ /*#define ATTACH_THREADS*/ static BOOL -my_show_window (FRAME_PTR f, HWND hwnd, int how) +my_show_window (struct frame *f, HWND hwnd, int how) { #ifndef ATTACH_THREADS return SendMessage (FRAME_W32_WINDOW (f), WM_EMACS_SHOWWINDOW, @@ -3816,7 +3816,7 @@ static void x_scroll_bar_remove (struct scroll_bar *bar) { - FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); + struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); block_input (); @@ -3979,7 +3979,7 @@ `*redeem_scroll_bar_hook' is applied to its window before the judgment. */ static void -w32_condemn_scroll_bars (FRAME_PTR frame) +w32_condemn_scroll_bars (struct frame *frame) { /* Transfer all the scroll bars to FRAME_CONDEMNED_SCROLL_BARS. */ while (! NILP (FRAME_SCROLL_BARS (frame))) @@ -4047,7 +4047,7 @@ last call to `*condemn_scroll_bars_hook'. */ static void -w32_judge_scroll_bars (FRAME_PTR f) +w32_judge_scroll_bars (struct frame *f) { Lisp_Object bar, next; @@ -4185,14 +4185,14 @@ on the scroll bar. */ static void -x_scroll_bar_report_motion (FRAME_PTR *fp, Lisp_Object *bar_window, +x_scroll_bar_report_motion (struct frame **fp, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, unsigned long *time) { struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); Window w = SCROLL_BAR_W32_WINDOW (bar); - FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); + struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); int pos; int top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (f, XINT (bar->height)); SCROLLINFO si; @@ -4244,7 +4244,7 @@ redraw them. */ void -x_scroll_bar_clear (FRAME_PTR f) +x_scroll_bar_clear (struct frame *f) { Lisp_Object bar; @@ -4974,7 +4974,7 @@ if (f) { extern void menubar_selection_callback - (FRAME_PTR f, void * client_data); + (struct frame *f, void * client_data); menubar_selection_callback (f, (void *)msg.msg.wParam); } @@ -5071,7 +5071,7 @@ FOR_EACH_FRAME (tail, frame) { - FRAME_PTR f = XFRAME (frame); + struct frame *f = XFRAME (frame); /* The tooltip has been drawn already. Avoid the SET_FRAME_GARBAGED below. */ if (EQ (frame, tip_frame)) @@ -5692,7 +5692,7 @@ } static void -w32fullscreen_hook (FRAME_PTR f) +w32fullscreen_hook (struct frame *f) { if (FRAME_VISIBLE_P (f)) { @@ -5964,7 +5964,7 @@ } static void -w32_frame_raise_lower (FRAME_PTR f, int raise_flag) +w32_frame_raise_lower (struct frame *f, int raise_flag) { if (! FRAME_W32_P (f)) return; === modified file 'src/w32term.h' --- src/w32term.h 2013-07-31 12:50:59 +0000 +++ src/w32term.h 2013-08-03 03:29:03 +0000 @@ -205,7 +205,7 @@ extern struct w32_display_info *w32_term_init (Lisp_Object, char *, char *); -extern int w32_defined_color (FRAME_PTR f, const char *color, +extern int w32_defined_color (struct frame *f, const char *color, XColor *color_def, int alloc); extern void x_set_window_size (struct frame *f, int change_grav, int cols, int rows); === modified file 'src/w32uniscribe.c' --- src/w32uniscribe.c 2013-08-01 16:09:20 +0000 +++ src/w32uniscribe.c 2013-08-03 03:29:03 +0000 @@ -106,7 +106,7 @@ } static Lisp_Object -uniscribe_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size) +uniscribe_open (struct frame *f, Lisp_Object font_entity, int pixel_size) { Lisp_Object font_object = font_make_object (VECSIZE (struct uniscribe_font_info), @@ -135,7 +135,7 @@ } static void -uniscribe_close (FRAME_PTR f, struct font *font) +uniscribe_close (struct frame *f, struct font *font) { struct uniscribe_font_info *uniscribe_font = (struct uniscribe_font_info *) font; @@ -599,8 +599,8 @@ int x, int y, int with_background); Unused: - int uniscribe_prepare_face (FRAME_PTR f, struct face *face); - void uniscribe_done_face (FRAME_PTR f, struct face *face); + int uniscribe_prepare_face (struct frame *f, struct face *face); + void uniscribe_done_face (struct frame *f, struct face *face); int uniscribe_get_bitmap (struct font *font, unsigned code, struct font_bitmap *bitmap, int bits_per_pixel); void uniscribe_free_bitmap (struct font *font, struct font_bitmap *bitmap); @@ -608,8 +608,8 @@ void uniscribe_free_outline (struct font *font, void *outline); int uniscribe_anchor_point (struct font *font, unsigned code, int index, int *x, int *y); - int uniscribe_start_for_frame (FRAME_PTR f); - int uniscribe_end_for_frame (FRAME_PTR f); + int uniscribe_start_for_frame (struct frame *f); + int uniscribe_end_for_frame (struct frame *f); */ === modified file 'src/w32xfns.c' --- src/w32xfns.c 2013-01-02 16:13:04 +0000 +++ src/w32xfns.c 2013-08-03 03:29:03 +0000 @@ -90,7 +90,7 @@ } void -select_palette (FRAME_PTR f, HDC hdc) +select_palette (struct frame *f, HDC hdc) { struct w32_display_info *display_info = FRAME_W32_DISPLAY_INFO (f); @@ -117,7 +117,7 @@ } void -deselect_palette (FRAME_PTR f, HDC hdc) +deselect_palette (struct frame *f, HDC hdc) { if (f->output_data.w32->old_palette) SelectPalette (hdc, f->output_data.w32->old_palette, FALSE); @@ -126,7 +126,7 @@ /* Get a DC for frame and select palette for drawing; force an update of all frames if palette's mapping changes. */ HDC -get_frame_dc (FRAME_PTR f) +get_frame_dc (struct frame *f) { HDC hdc; @@ -146,7 +146,7 @@ } int -release_frame_dc (FRAME_PTR f, HDC hdc) +release_frame_dc (struct frame *f, HDC hdc) { int ret; === modified file 'src/widget.c' --- src/widget.c 2013-08-02 13:22:23 +0000 +++ src/widget.c 2013-08-03 03:29:03 +0000 @@ -806,7 +806,7 @@ widget_store_internal_border (Widget widget) { EmacsFrame ew = (EmacsFrame) widget; - FRAME_PTR f = ew->emacs_frame.frame; + struct frame *f = ew->emacs_frame.frame; ew->emacs_frame.internal_border_width = f->internal_border_width; } === modified file 'src/window.c' --- src/window.c 2013-07-30 05:56:18 +0000 +++ src/window.c 2013-08-03 03:29:03 +0000 @@ -3019,7 +3019,7 @@ minimum allowable size. */ void -check_frame_size (FRAME_PTR frame, int *rows, int *cols) +check_frame_size (struct frame *frame, int *rows, int *cols) { /* For height, we have to see: how many windows the frame has at minimum (one or two), @@ -5516,7 +5516,7 @@ struct Lisp_Vector *saved_windows; Lisp_Object new_current_buffer; Lisp_Object frame; - FRAME_PTR f; + struct frame *f; ptrdiff_t old_point = -1; CHECK_WINDOW_CONFIGURATION (configuration); === modified file 'src/xdisp.c' --- src/xdisp.c 2013-07-24 17:36:42 +0000 +++ src/xdisp.c 2013-08-03 03:29:03 +0000 @@ -1854,7 +1854,7 @@ not force the value into range. */ void -pixel_to_glyph_coords (FRAME_PTR f, register int pix_x, register int pix_y, +pixel_to_glyph_coords (struct frame *f, register int pix_x, register int pix_y, int *x, int *y, NativeRectangle *bounds, int noclip) { @@ -11449,7 +11449,7 @@ /* Where the mouse was last time we reported a mouse event. */ -FRAME_PTR last_mouse_frame; +struct frame *last_mouse_frame; /* Tool-bar item index of the item on which a mouse button was pressed or -1. */ === modified file 'src/xfaces.c' --- src/xfaces.c 2013-08-01 10:33:25 +0000 +++ src/xfaces.c 2013-08-03 03:29:03 +0000 @@ -869,7 +869,7 @@ if these pointers are not null. */ static ptrdiff_t -load_pixmap (FRAME_PTR f, Lisp_Object name, unsigned int *w_ptr, +load_pixmap (struct frame *f, Lisp_Object name, unsigned int *w_ptr, unsigned int *h_ptr) { ptrdiff_t bitmap_id; @@ -3075,7 +3075,7 @@ { if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value)) { - FRAME_PTR f; + struct frame *f; old_value = LFACE_FONT (lface); if (! FONTP (value)) === modified file 'src/xfns.c' --- src/xfns.c 2013-08-02 13:22:23 +0000 +++ src/xfns.c 2013-08-03 03:29:03 +0000 @@ -176,7 +176,7 @@ dpyinfo = x_display_info_for_name (object); else { - FRAME_PTR f = decode_window_system_frame (object); + struct frame *f = decode_window_system_frame (object); dpyinfo = FRAME_X_DISPLAY_INFO (f); } @@ -369,7 +369,7 @@ not Emacs's own window. */ void -x_real_positions (FRAME_PTR f, int *xptr, int *yptr) +x_real_positions (struct frame *f, int *xptr, int *yptr) { int win_x, win_y, outer_x IF_LINT (= 0), outer_y IF_LINT (= 0); int real_x = 0, real_y = 0; @@ -565,7 +565,7 @@ Signal an error if color can't be allocated. */ static int -x_decode_color (FRAME_PTR f, Lisp_Object color_name, int mono_color) +x_decode_color (struct frame *f, Lisp_Object color_name, int mono_color) { XColor cdef; @@ -626,7 +626,7 @@ may be any format that GdkPixbuf knows about, i.e. not just bitmaps. */ int -xg_set_icon (FRAME_PTR f, Lisp_Object file) +xg_set_icon (struct frame *f, Lisp_Object file) { int result = 0; Lisp_Object found; @@ -660,7 +660,7 @@ } int -xg_set_icon_from_xpm_data (FRAME_PTR f, const char **data) +xg_set_icon_from_xpm_data (struct frame *f, const char **data) { GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data (data); @@ -1050,7 +1050,7 @@ static void -x_set_cursor_type (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval) +x_set_cursor_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { set_frame_cursor_types (f, arg); @@ -1449,7 +1449,7 @@ icon name to NAME. */ static void -x_set_name_internal (FRAME_PTR f, Lisp_Object name) +x_set_name_internal (struct frame *f, Lisp_Object name) { if (FRAME_X_WINDOW (f)) { @@ -1608,7 +1608,7 @@ specified a name for the frame; the name will override any set by the redisplay code. */ static void -x_explicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval) +x_explicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { x_set_name (f, arg, 1); } @@ -1617,7 +1617,7 @@ name; names set this way will never override names set by the user's lisp code. */ void -x_implicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval) +x_implicitly_set_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { x_set_name (f, arg, 0); } @@ -1730,7 +1730,7 @@ for example, but Xt doesn't). */ static void -hack_wm_protocols (FRAME_PTR f, Widget widget) +hack_wm_protocols (struct frame *f, Widget widget) { Display *dpy = XtDisplay (widget); Window w = XtWindow (widget); @@ -2538,7 +2538,7 @@ #else /* not USE_X_TOOLKIT */ #ifdef USE_GTK static void -x_window (FRAME_PTR f) +x_window (struct frame *f) { if (! xg_create_frame_widgets (f)) error ("Unable to create window"); @@ -3485,7 +3485,7 @@ (Lisp_Object color, Lisp_Object frame) { XColor foo; - FRAME_PTR f = decode_window_system_frame (frame); + struct frame *f = decode_window_system_frame (frame); CHECK_STRING (color); @@ -3500,7 +3500,7 @@ (Lisp_Object color, Lisp_Object frame) { XColor foo; - FRAME_PTR f = decode_window_system_frame (frame); + struct frame *f = decode_window_system_frame (frame); CHECK_STRING (color); @@ -4586,7 +4586,7 @@ /* Wait for responses to all X commands issued so far for frame F. */ void -x_sync (FRAME_PTR f) +x_sync (struct frame *f) { block_input (); XSync (FRAME_X_DISPLAY (f), False); @@ -5770,7 +5770,8 @@ This function is only defined on NS, MS Windows, and X Windows with the Motif or Gtk toolkits. With the Motif toolkit, ONLY-DIR-P is ignored. Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */) - (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename, Lisp_Object mustmatch, Lisp_Object only_dir_p) + (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename, + Lisp_Object mustmatch, Lisp_Object only_dir_p) { int result; struct frame *f = SELECTED_FRAME (); @@ -5943,7 +5944,7 @@ Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */) (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename, Lisp_Object mustmatch, Lisp_Object only_dir_p) { - FRAME_PTR f = SELECTED_FRAME (); + struct frame *f = SELECTED_FRAME (); char *fn; Lisp_Object file = Qnil; Lisp_Object decoded_file; @@ -6006,7 +6007,7 @@ nil, it defaults to the selected frame. */) (Lisp_Object frame, Lisp_Object ignored) { - FRAME_PTR f = decode_window_system_frame (frame); + struct frame *f = decode_window_system_frame (frame); Lisp_Object font; Lisp_Object font_param; char *default_name = NULL; === modified file 'src/xfont.c' --- src/xfont.c 2013-08-01 10:33:25 +0000 +++ src/xfont.c 2013-08-03 03:29:03 +0000 @@ -114,19 +114,19 @@ ? NULL : pcm); } -static Lisp_Object xfont_get_cache (FRAME_PTR); +static Lisp_Object xfont_get_cache (struct frame *); static Lisp_Object xfont_list (struct frame *, Lisp_Object); static Lisp_Object xfont_match (struct frame *, Lisp_Object); static Lisp_Object xfont_list_family (struct frame *); -static Lisp_Object xfont_open (FRAME_PTR, Lisp_Object, int); -static void xfont_close (FRAME_PTR, struct font *); -static int xfont_prepare_face (FRAME_PTR, struct face *); +static Lisp_Object xfont_open (struct frame *, Lisp_Object, int); +static void xfont_close (struct frame *, struct font *); +static int xfont_prepare_face (struct frame *, struct face *); static int xfont_has_char (Lisp_Object, int); static unsigned xfont_encode_char (struct font *, int); static int xfont_text_extents (struct font *, unsigned *, int, struct font_metrics *); static int xfont_draw (struct glyph_string *, int, int, int, int, bool); -static int xfont_check (FRAME_PTR, struct font *); +static int xfont_check (struct frame *, struct font *); struct font_driver xfont_driver = { @@ -152,7 +152,7 @@ }; static Lisp_Object -xfont_get_cache (FRAME_PTR f) +xfont_get_cache (struct frame *f) { Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); @@ -676,7 +676,7 @@ } static Lisp_Object -xfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size) +xfont_open (struct frame *f, Lisp_Object entity, int pixel_size) { Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); Display *display = dpyinfo->display; @@ -892,7 +892,7 @@ } static void -xfont_close (FRAME_PTR f, struct font *font) +xfont_close (struct frame *f, struct font *font) { block_input (); XFreeFont (FRAME_X_DISPLAY (f), ((struct xfont_info *) font)->xfont); @@ -900,7 +900,7 @@ } static int -xfont_prepare_face (FRAME_PTR f, struct face *face) +xfont_prepare_face (struct frame *f, struct face *face) { block_input (); XSetFont (FRAME_X_DISPLAY (f), face->gc, @@ -1089,7 +1089,7 @@ } static int -xfont_check (FRAME_PTR f, struct font *font) +xfont_check (struct frame *f, struct font *font) { struct xfont_info *xfont = (struct xfont_info *) font; === modified file 'src/xftfont.c' --- src/xftfont.c 2013-08-01 10:33:25 +0000 +++ src/xftfont.c 2013-08-03 03:29:03 +0000 @@ -70,7 +70,7 @@ XftColor xft_bg; /* color for face->background */ }; -static void xftfont_get_colors (FRAME_PTR, struct face *, GC gc, +static void xftfont_get_colors (struct frame *, struct face *, GC gc, struct xftface_info *, XftColor *fg, XftColor *bg); @@ -80,7 +80,9 @@ may be NULL. */ static void -xftfont_get_colors (FRAME_PTR f, struct face *face, GC gc, struct xftface_info *xftface_info, XftColor *fg, XftColor *bg) +xftfont_get_colors (struct frame *f, struct face *face, GC gc, + struct xftface_info *xftface_info, + XftColor *fg, XftColor *bg) { if (xftface_info && face->gc == gc) { @@ -262,7 +264,7 @@ } static Lisp_Object -xftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size) +xftfont_open (struct frame *f, Lisp_Object entity, int pixel_size) { FcResult result; Display *display = FRAME_X_DISPLAY (f); @@ -484,7 +486,7 @@ } static void -xftfont_close (FRAME_PTR f, struct font *font) +xftfont_close (struct frame *f, struct font *font) { struct xftfont_info *xftfont_info = (struct xftfont_info *) font; @@ -499,7 +501,7 @@ } static int -xftfont_prepare_face (FRAME_PTR f, struct face *face) +xftfont_prepare_face (struct frame *f, struct face *face) { struct xftface_info *xftface_info; @@ -522,7 +524,7 @@ } static void -xftfont_done_face (FRAME_PTR f, struct face *face) +xftfont_done_face (struct frame *f, struct face *face) { struct xftface_info *xftface_info; @@ -595,7 +597,7 @@ } static XftDraw * -xftfont_get_xft_draw (FRAME_PTR f) +xftfont_get_xft_draw (struct frame *f) { XftDraw *xft_draw = font_get_frame_data (f, &xftfont_driver); @@ -617,7 +619,7 @@ xftfont_draw (struct glyph_string *s, int from, int to, int x, int y, bool with_background) { - FRAME_PTR f = s->f; + struct frame *f = s->f; struct face *face = s->face; struct xftfont_info *xftfont_info = (struct xftfont_info *) s->font; struct xftface_info *xftface_info = NULL; @@ -677,7 +679,7 @@ #endif static int -xftfont_end_for_frame (FRAME_PTR f) +xftfont_end_for_frame (struct frame *f) { XftDraw *xft_draw; === modified file 'src/xmenu.c' --- src/xmenu.c 2013-08-02 03:55:24 +0000 +++ src/xmenu.c 2013-08-03 03:29:03 +0000 @@ -111,7 +111,7 @@ static Lisp_Object Qdebug_on_next_call; #if defined (USE_X_TOOLKIT) || defined (USE_GTK) -static Lisp_Object xdialog_show (FRAME_PTR, bool, Lisp_Object, Lisp_Object, +static Lisp_Object xdialog_show (struct frame *, bool, Lisp_Object, Lisp_Object, const char **); #endif @@ -130,7 +130,7 @@ menubar_id_to_frame (LWLIB_ID id) { Lisp_Object tail, frame; - FRAME_PTR f; + struct frame *f; FOR_EACH_FRAME (tail, frame) { @@ -154,7 +154,7 @@ the scroll bar or the edit window. Fx_popup_menu needs to be sure it is the edit window. */ void -mouse_position_for_popup (FRAME_PTR f, int *x, int *y) +mouse_position_for_popup (struct frame *f, int *x, int *y) { Window root, dummy_window; int dummy; @@ -219,7 +219,7 @@ `x-popup-dialog' does not return. */) (Lisp_Object position, Lisp_Object contents, Lisp_Object header) { - FRAME_PTR f = NULL; + struct frame *f = NULL; Lisp_Object window; /* Decode the first argument: find the window or frame to use. */ @@ -229,7 +229,7 @@ { #if 0 /* Using the frame the mouse is on may not be right. */ /* Use the mouse's current position. */ - FRAME_PTR new_f = SELECTED_FRAME (); + struct frame *new_f = SELECTED_FRAME (); Lisp_Object bar_window; enum scroll_bar_part part; Time time; @@ -481,7 +481,7 @@ (Lisp_Object frame) { XEvent ev; - FRAME_PTR f = decode_window_system_frame (frame); + struct frame *f = decode_window_system_frame (frame); Widget menubar; block_input (); @@ -559,10 +559,7 @@ (Lisp_Object frame) { GtkWidget *menubar; - FRAME_PTR f; - - /* gcc 2.95 doesn't accept the FRAME_PTR declaration after - block_input (). */ + struct frame *f; block_input (); f = decode_window_system_frame (frame); @@ -620,7 +617,7 @@ execute Lisp code. */ void -x_activate_menubar (FRAME_PTR f) +x_activate_menubar (struct frame *f) { eassert (FRAME_X_P (f)); @@ -682,7 +679,7 @@ for that widget. F is the frame if known, or NULL if not known. */ static void -show_help_event (FRAME_PTR f, xt_or_gtk_widget widget, Lisp_Object help) +show_help_event (struct frame *f, xt_or_gtk_widget widget, Lisp_Object help) { Lisp_Object frame; @@ -815,7 +812,7 @@ static void menubar_selection_callback (Widget widget, LWLIB_ID id, XtPointer client_data) { - FRAME_PTR f; + struct frame *f; f = menubar_id_to_frame (id); if (!f) @@ -829,7 +826,7 @@ changed. */ static void -update_frame_menubar (FRAME_PTR f) +update_frame_menubar (struct frame *f) { #ifdef USE_GTK xg_update_frame_menubar (f); @@ -911,7 +908,7 @@ it is set the first time this is called, from initialize_frame_menubar. */ void -set_frame_menubar (FRAME_PTR f, bool first_time, bool deep_p) +set_frame_menubar (struct frame *f, bool first_time, bool deep_p) { xt_or_gtk_widget menubar_widget; #ifdef USE_X_TOOLKIT @@ -1263,7 +1260,7 @@ is visible. */ void -initialize_frame_menubar (FRAME_PTR f) +initialize_frame_menubar (struct frame *f) { /* This function is called before the first chance to redisplay the frame. It has to be, so the frame will have the right size. */ @@ -1278,7 +1275,7 @@ #ifndef USE_GTK void -free_frame_menubar (FRAME_PTR f) +free_frame_menubar (struct frame *f) { Widget menubar_widget; @@ -1355,7 +1352,7 @@ create_and_show_popup_menu below. */ struct next_popup_x_y { - FRAME_PTR f; + struct frame *f; int x; int y; }; @@ -1413,7 +1410,7 @@ menu pops down. menu_item_selection will be set to the selection. */ static void -create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, int x, int y, +create_and_show_popup_menu (struct frame *f, widget_value *first_wv, int x, int y, bool for_click, Time timestamp) { int i; @@ -1522,7 +1519,7 @@ menu pops down. menu_item_selection will be set to the selection. */ static void -create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, +create_and_show_popup_menu (struct frame *f, widget_value *first_wv, int x, int y, bool for_click, Time timestamp) { int i; @@ -1601,7 +1598,7 @@ } Lisp_Object -xmenu_show (FRAME_PTR f, int x, int y, bool for_click, bool keymaps, +xmenu_show (struct frame *f, int x, int y, bool for_click, bool keymaps, Lisp_Object title, const char **error_name, Time timestamp) { int i; @@ -1894,7 +1891,7 @@ dialog pops down. menu_item_selection will be set to the selection. */ static void -create_and_show_dialog (FRAME_PTR f, widget_value *first_wv) +create_and_show_dialog (struct frame *f, widget_value *first_wv) { GtkWidget *menu; @@ -1940,7 +1937,7 @@ dialog pops down. menu_item_selection will be set to the selection. */ static void -create_and_show_dialog (FRAME_PTR f, widget_value *first_wv) +create_and_show_dialog (struct frame *f, widget_value *first_wv) { LWLIB_ID dialog_id; @@ -1984,7 +1981,7 @@ "button6", "button7", "button8", "button9", "button10" }; static Lisp_Object -xdialog_show (FRAME_PTR f, +xdialog_show (struct frame *f, bool keymaps, Lisp_Object title, Lisp_Object header, @@ -2214,7 +2211,7 @@ static void pop_down_menu (Lisp_Object arg) { - FRAME_PTR f = XSAVE_POINTER (arg, 0); + struct frame *f = XSAVE_POINTER (arg, 0); XMenu *menu = XSAVE_POINTER (arg, 1); block_input (); @@ -2242,7 +2239,7 @@ Lisp_Object -xmenu_show (FRAME_PTR f, int x, int y, bool for_click, bool keymaps, +xmenu_show (struct frame *f, int x, int y, bool for_click, bool keymaps, Lisp_Object title, const char **error_name, Time timestamp) { Window root; === modified file 'src/xselect.c' --- src/xselect.c 2013-07-30 05:56:18 +0000 +++ src/xselect.c 2013-08-03 03:29:03 +0000 @@ -993,7 +993,7 @@ We do this when about to delete a frame. */ void -x_clear_frame_selections (FRAME_PTR f) +x_clear_frame_selections (struct frame *f) { Lisp_Object frame; Lisp_Object rest; @@ -2377,7 +2377,7 @@ /* Get the mouse position in frame relative coordinates. */ static void -mouse_position_for_drop (FRAME_PTR f, int *x, int *y) +mouse_position_for_drop (struct frame *f, int *x, int *y) { Window root, dummy_window; int dummy; === modified file 'src/xterm.c' --- src/xterm.c 2013-08-02 13:22:23 +0000 +++ src/xterm.c 2013-08-03 03:29:03 +0000 @@ -212,7 +212,7 @@ /* Where the mouse was last time we reported a mouse event. */ static XRectangle last_mouse_glyph; -static FRAME_PTR last_mouse_glyph_frame; +static struct frame *last_mouse_glyph_frame; /* The scroll bar in which the last X motion event occurred. @@ -3188,7 +3188,7 @@ static void -XTtoggle_invisible_pointer (FRAME_PTR f, int invisible) +XTtoggle_invisible_pointer (struct frame *f, int invisible) { block_input (); if (invisible) @@ -3797,7 +3797,7 @@ static Lisp_Object last_mouse_motion_frame; static int -note_mouse_movement (FRAME_PTR frame, XMotionEvent *event) +note_mouse_movement (struct frame *frame, XMotionEvent *event) { last_mouse_movement_time = event->time; last_mouse_motion_event = *event; @@ -3873,11 +3873,11 @@ movement. */ static void -XTmouse_position (FRAME_PTR *fp, int insist, Lisp_Object *bar_window, +XTmouse_position (struct frame **fp, int insist, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, Time *timestamp) { - FRAME_PTR f1; + struct frame *f1; block_input (); @@ -4416,7 +4416,8 @@ gdouble position; int part = -1, whole = 0, portion = 0; GtkAdjustment *adj = GTK_ADJUSTMENT (gtk_range_get_adjustment (range)); - FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (range), XG_FRAME_DATA); + struct frame *f = (struct frame *) g_object_get_data (G_OBJECT (range), + XG_FRAME_DATA); if (xg_ignore_gtk_scrollbar) return FALSE; position = gtk_adjustment_get_value (adj); @@ -5033,7 +5034,7 @@ { int dragging = ! NILP (bar->dragging); Window w = bar->x_window; - FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); + struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); GC gc = f->output_data.x->normal_gc; /* If the display is already accurate, do nothing. */ @@ -5374,7 +5375,7 @@ `*redeem_scroll_bar_hook' is applied to its window before the judgment. */ static void -XTcondemn_scroll_bars (FRAME_PTR frame) +XTcondemn_scroll_bars (struct frame *frame) { /* Transfer all the scroll bars to FRAME_CONDEMNED_SCROLL_BARS. */ while (! NILP (FRAME_SCROLL_BARS (frame))) @@ -5442,7 +5443,7 @@ last call to `*condemn_scroll_bars_hook'. */ static void -XTjudge_scroll_bars (FRAME_PTR f) +XTjudge_scroll_bars (struct frame *f) { Lisp_Object bar, next; @@ -5478,7 +5479,7 @@ x_scroll_bar_expose (struct scroll_bar *bar, XEvent *event) { Window w = bar->x_window; - FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); + struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); GC gc = f->output_data.x->normal_gc; int width_trim = VERTICAL_SCROLL_BAR_WIDTH_TRIM; @@ -5577,7 +5578,7 @@ static void x_scroll_bar_note_movement (struct scroll_bar *bar, XEvent *event) { - FRAME_PTR f = XFRAME (XWINDOW (bar->window)->frame); + struct frame *f = XFRAME (XWINDOW (bar->window)->frame); last_mouse_movement_time = event->xmotion.time; @@ -5605,13 +5606,13 @@ on the scroll bar. */ static void -x_scroll_bar_report_motion (FRAME_PTR *fp, Lisp_Object *bar_window, +x_scroll_bar_report_motion (struct frame **fp, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, Time *timestamp) { struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); Window w = bar->x_window; - FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); + struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); int win_x, win_y; Window dummy_window; int dummy_coord; @@ -5679,7 +5680,7 @@ redraw them. */ static void -x_scroll_bar_clear (FRAME_PTR f) +x_scroll_bar_clear (struct frame *f) { #ifndef USE_TOOLKIT_SCROLL_BARS Lisp_Object bar; @@ -8524,7 +8525,7 @@ } static void -XTfullscreen_hook (FRAME_PTR f) +XTfullscreen_hook (struct frame *f) { if (FRAME_VISIBLE_P (f)) { @@ -8925,7 +8926,7 @@ /* Request focus with XEmbed */ void -xembed_request_focus (FRAME_PTR f) +xembed_request_focus (struct frame *f) { /* See XEmbed Protocol Specification at http://freedesktop.org/wiki/Specifications/xembed-spec */ @@ -8937,7 +8938,7 @@ /* Activate frame with Extended Window Manager Hints */ void -x_ewmh_activate_frame (FRAME_PTR f) +x_ewmh_activate_frame (struct frame *f) { /* See Window Manager Specification/Extended Window Manager Hints at http://freedesktop.org/wiki/Specifications/wm-spec */ @@ -8955,7 +8956,7 @@ } static void -XTframe_raise_lower (FRAME_PTR f, int raise_flag) +XTframe_raise_lower (struct frame *f, int raise_flag) { if (raise_flag) x_raise_frame (f); ------------------------------------------------------------ revno: 113668 committer: Xue Fuqiao branch nick: trunk timestamp: Sat 2013-08-03 10:57:00 +0800 message: * etc/TODO: Adjust entry about bug reporting. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2013-08-02 14:26:22 +0000 +++ etc/ChangeLog 2013-08-03 02:57:00 +0000 @@ -1,10 +1,14 @@ +2013-08-03 Xue Fuqiao + + * TODO: Adjust entry about bug reporting. + 2013-08-02 Bastien Guerry * DEVEL.HUMOR: New entry. 2013-08-02 Xue Fuqiao - * tutorials/TUTORIAL: Remove a redundant sentence. + * tutorials/TUTORIAL: Remove a redundant sentence about yanking. * tutorials/TUTORIAL.cn: Update; synchronize with TUTORIAL. === modified file 'etc/TODO' --- etc/TODO 2013-02-24 19:45:17 +0000 +++ etc/TODO 2013-08-03 02:57:00 +0000 @@ -176,6 +176,15 @@ ** Check for any included packages that define obsolete bug-reporting commands. Change them to use report-emacs-bug. +*** Related functions: +**** gnus-bug +**** report-calc-bug +**** org-submit-bug-report +**** lm-report-bug +**** tramp-bug +**** c-submit-bug-report +**** ffap-bug and ffap-submit-bug (obsoleted) +[Do all of them need changing?] ** Allow fringe indicators to display a tooltip (provide a help-echo property?) ------------------------------------------------------------ revno: 113667 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2013-08-02 22:34:22 -0400 message: * lisp/emacs-lisp/package.el (package-desc-from-define): Ignore unknown keys. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-08-02 21:23:07 +0000 +++ lisp/ChangeLog 2013-08-03 02:34:22 +0000 @@ -1,3 +1,7 @@ +2013-08-03 Stefan Monnier + + * emacs-lisp/package.el (package-desc-from-define): Ignore unknown keys. + 2013-08-02 Stefan Monnier * emacs-lisp/easy-mmode.el (define-globalized-minor-mode) === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2013-07-22 11:39:32 +0000 +++ lisp/emacs-lisp/package.el 2013-08-03 02:34:22 +0000 @@ -296,7 +296,7 @@ (:constructor package-desc-from-define (name-string version-string &optional summary requirements - &key kind archive + &key kind archive &allow-other-keys &aux (name (intern name-string)) (version (version-to-list version-string)) ------------------------------------------------------------ revno: 113666 committer: Glenn Morris branch nick: trunk timestamp: Fri 2013-08-02 18:47:54 -0700 message: Fix previous core-elisp-tests.el fix diff: === modified file 'test/automated/core-elisp-tests.el' --- test/automated/core-elisp-tests.el 2013-08-03 01:43:30 +0000 +++ test/automated/core-elisp-tests.el 2013-08-03 01:47:54 +0000 @@ -32,7 +32,7 @@ (should (equal (list (let ((c-e-x 1)) (defvar c-e-x 2) c-e-x) c-e-x) '(1 2))) (should (equal (list (let ((c-e-x 1)) - (defcustom c-e-x "doc" 2 :group 'blah) c-e-x) + (defcustom c-e-x 2 "doc" :group 'blah) c-e-x) c-e-x) '(1 2))))) ------------------------------------------------------------ revno: 113665 committer: Glenn Morris branch nick: trunk timestamp: Fri 2013-08-02 18:43:30 -0700 message: * test/automated/core-elisp-tests.el (core-elisp-tests): Fix defcustom. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2013-08-03 01:02:51 +0000 +++ test/ChangeLog 2013-08-03 01:43:30 +0000 @@ -1,5 +1,7 @@ 2013-08-03 Glenn Morris + * automated/core-elisp-tests.el (core-elisp-tests): Fix defcustom. + * automated/icalendar-tests.el (icalendar-tests--test-export) (icalendar-tests--test-import): Use getenv/setenv rather than set-time-zone-rule. === modified file 'test/automated/core-elisp-tests.el' --- test/automated/core-elisp-tests.el 2013-08-02 21:16:33 +0000 +++ test/automated/core-elisp-tests.el 2013-08-03 01:43:30 +0000 @@ -31,7 +31,9 @@ ;; is properly initialized. (should (equal (list (let ((c-e-x 1)) (defvar c-e-x 2) c-e-x) c-e-x) '(1 2))) - (should (equal (list (let ((c-e-x 1)) (defcustom c-e-x 2) c-e-x) c-e-x) + (should (equal (list (let ((c-e-x 1)) + (defcustom c-e-x "doc" 2 :group 'blah) c-e-x) + c-e-x) '(1 2))))) (provide 'core-elisp-tests) ------------------------------------------------------------ revno: 113664 committer: Glenn Morris branch nick: trunk timestamp: Fri 2013-08-02 21:02:51 -0400 message: icalendar-tests.el tweaks related to timezone handling * test/automated/icalendar-tests.el (icalendar-tests--test-export) (icalendar-tests--test-import): Use getenv/setenv rather than set-time-zone-rule. (icalendar-tests--test-import): Reset zone even if error occurred. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2013-08-02 21:16:33 +0000 +++ test/ChangeLog 2013-08-03 01:02:51 +0000 @@ -1,3 +1,10 @@ +2013-08-03 Glenn Morris + + * automated/icalendar-tests.el (icalendar-tests--test-export) + (icalendar-tests--test-import): + Use getenv/setenv rather than set-time-zone-rule. + (icalendar-tests--test-import): Reset zone even if error occurred. + 2013-08-02 Stefan Monnier * automated/core-elisp-tests.el: New file. === modified file 'test/automated/icalendar-tests.el' --- test/automated/icalendar-tests.el 2013-07-11 15:57:45 +0000 +++ test/automated/icalendar-tests.el 2013-08-03 01:02:51 +0000 @@ -428,12 +428,12 @@ European style input data must use german month names. American and ISO style input data must use english month names." - (let ((tz (cadr (current-time-zone))) + (let ((tz (getenv "TZ")) (calendar-date-style 'iso) (icalendar-recurring-start-year 2000)) (unwind-protect (progn - (set-time-zone-rule "CET") + (setenv "TZ" "CET") (when input-iso (let ((calendar-month-name-array ["January" "February" "March" "April" "May" "June" "July" "August" @@ -461,8 +461,8 @@ "Saturday"])) (setq calendar-date-style 'american) (icalendar-tests--do-test-export input-american expected-output)))) - ;; restore time-zone if something went terribly wrong - (set-time-zone-rule tz)))) + ;; restore time-zone even if something went terribly wrong + (setenv "TZ" tz)))) (defun icalendar-tests--do-test-export (input expected-output) "Actually perform export test. @@ -671,37 +671,39 @@ Argument EXPECTED-ISO expected iso style diary string. Argument EXPECTED-EUROPEAN expected european style diary string. Argument EXPECTED-AMERICAN expected american style diary string." - (let ((timezone (cadr (current-time-zone)))) - (set-time-zone-rule "CET") - (with-temp-buffer - (if (string-match "^BEGIN:VCALENDAR" input) - (insert input) - (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n") - (insert "VERSION:2.0\nBEGIN:VEVENT\n") - (insert input) - (unless (eq (char-before) ?\n) - (insert "\n")) - (insert "END:VEVENT\nEND:VCALENDAR\n")) - (let ((icalendar-import-format "%s%d%l%o%t%u%c%U") - (icalendar-import-format-summary "%s") - (icalendar-import-format-location "\n Location: %s") - (icalendar-import-format-description "\n Desc: %s") - (icalendar-import-format-organizer "\n Organizer: %s") - (icalendar-import-format-status "\n Status: %s") - (icalendar-import-format-url "\n URL: %s") - (icalendar-import-format-class "\n Class: %s") - (icalendar-import-format-uid "\n UID: %s") - calendar-date-style) - (when expected-iso - (setq calendar-date-style 'iso) - (icalendar-tests--do-test-import input expected-iso)) - (when expected-european - (setq calendar-date-style 'european) - (icalendar-tests--do-test-import input expected-european)) - (when expected-american - (setq calendar-date-style 'american) - (icalendar-tests--do-test-import input expected-american)))) - (set-time-zone-rule timezone))) + (let ((timezone (getenv "TZ"))) + (unwind-protect + (progn + (setenv "TZ" "CET") + (with-temp-buffer + (if (string-match "^BEGIN:VCALENDAR" input) + (insert input) + (insert "BEGIN:VCALENDAR\nPRODID:-//Emacs//NONSGML icalendar.el//EN\n") + (insert "VERSION:2.0\nBEGIN:VEVENT\n") + (insert input) + (unless (eq (char-before) ?\n) + (insert "\n")) + (insert "END:VEVENT\nEND:VCALENDAR\n")) + (let ((icalendar-import-format "%s%d%l%o%t%u%c%U") + (icalendar-import-format-summary "%s") + (icalendar-import-format-location "\n Location: %s") + (icalendar-import-format-description "\n Desc: %s") + (icalendar-import-format-organizer "\n Organizer: %s") + (icalendar-import-format-status "\n Status: %s") + (icalendar-import-format-url "\n URL: %s") + (icalendar-import-format-class "\n Class: %s") + (icalendar-import-format-uid "\n UID: %s") + calendar-date-style) + (when expected-iso + (setq calendar-date-style 'iso) + (icalendar-tests--do-test-import input expected-iso)) + (when expected-european + (setq calendar-date-style 'european) + (icalendar-tests--do-test-import input expected-european)) + (when expected-american + (setq calendar-date-style 'american) + (icalendar-tests--do-test-import input expected-american))))) + (setenv "TZ" timezone)))) (defun icalendar-tests--do-test-import (input expected-output) "Actually perform import test. ------------------------------------------------------------ revno: 113663 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2013-08-02 17:23:07 -0400 message: * lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode) (easy-mmode-define-navigation): Avoid ((lambda (..) ..) ...). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-08-02 21:16:33 +0000 +++ lisp/ChangeLog 2013-08-02 21:23:07 +0000 @@ -1,5 +1,8 @@ 2013-08-02 Stefan Monnier + * emacs-lisp/easy-mmode.el (define-globalized-minor-mode) + (easy-mmode-define-navigation): Avoid ((lambda (..) ..) ...). + * custom.el (custom-initialize-default, custom-initialize-set) (custom-initialize-reset, custom-initialize-changed): Affect the toplevel-default-value (bug#6275, bug#14586). === modified file 'lisp/emacs-lisp/easy-mmode.el' --- lisp/emacs-lisp/easy-mmode.el 2013-05-27 16:12:52 +0000 +++ lisp/emacs-lisp/easy-mmode.el 2013-08-02 21:23:07 +0000 @@ -419,7 +419,7 @@ ;; Go through existing buffers. (dolist (buf (buffer-list)) (with-current-buffer buf - (if ,global-mode (,turn-on) (when ,mode (,mode -1)))))) + (if ,global-mode (funcall #',turn-on) (when ,mode (,mode -1)))))) ;; Autoloading define-globalized-minor-mode autoloads everything ;; up-to-here. @@ -449,8 +449,8 @@ (if ,mode (progn (,mode -1) - (,turn-on)) - (,turn-on)))) + (funcall #',turn-on)) + (funcall #',turn-on)))) (setq ,MODE-major-mode major-mode))))) (put ',MODE-enable-in-buffers 'definition-name ',global-mode) @@ -589,7 +589,7 @@ (prog1 (or (< (- (point-max) (point-min)) (buffer-size))) (widen)))) ,body - (when was-narrowed (,narrowfun))))))) + (when was-narrowed (funcall #',narrowfun))))))) (unless name (setq name base-name)) `(progn (defun ,next-sym (&optional count) @@ -601,13 +601,13 @@ ,(funcall when-narrowed `(if (not (re-search-forward ,re nil t count)) (if (looking-at ,re) - (goto-char (or ,(if endfun `(,endfun)) (point-max))) + (goto-char (or ,(if endfun `(funcall #',endfun)) (point-max))) (user-error "No next %s" ,name)) (goto-char (match-beginning 0)) (when (and (eq (current-buffer) (window-buffer (selected-window))) (called-interactively-p 'interactive)) (let ((endpt (or (save-excursion - ,(if endfun `(,endfun) + ,(if endfun `(funcall #',endfun) `(re-search-forward ,re nil t 2))) (point-max)))) (unless (pos-visible-in-window-p endpt nil t) ------------------------------------------------------------ revno: 113662 committer: Stefan Monnier branch nick: trunk timestamp: Fri 2013-08-02 17:16:33 -0400 message: Make defvar affect the default binding outside of any let. * src/eval.c (default_toplevel_binding): New function. (Fdefvar): Use it. (unbind_to, backtrace_eval_unrewind): Do a bit of CSE simplification. (Fdefault_toplevel_value, Fset_default_toplevel_value): New subrs. (syms_of_eval): Export them. * src/data.c (Fdefault_value): Micro cleanup. * src/term.c (init_tty): Use "false". * lisp/custom.el (custom-initialize-default, custom-initialize-set) (custom-initialize-reset, custom-initialize-changed): Affect the toplevel-default-value (bug#6275, bug#14586). * lisp/emacs-lisp/advice.el (ad-compile-function): Undo previous workaround for bug#6275. * test/automated/core-elisp-tests.el: New file. diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-07-31 06:27:20 +0000 +++ etc/NEWS 2013-08-02 21:16:33 +0000 @@ -524,6 +524,8 @@ * Incompatible Lisp Changes in Emacs 24.4 +** `defvar' and `defcustom' in a let-binding affect the "external" default. + ** The syntax of ?» and ?« is now punctuation instead of matched parens. Some languages match those as »...« and others as «...» so better stay neutral. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-08-02 16:29:16 +0000 +++ lisp/ChangeLog 2013-08-02 21:16:33 +0000 @@ -1,3 +1,11 @@ +2013-08-02 Stefan Monnier + + * custom.el (custom-initialize-default, custom-initialize-set) + (custom-initialize-reset, custom-initialize-changed): Affect the + toplevel-default-value (bug#6275, bug#14586). + * emacs-lisp/advice.el (ad-compile-function): Undo previous workaround + for bug#6275. + 2013-08-02 Juanma Barranquero * emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): === modified file 'lisp/custom.el' --- lisp/custom.el 2013-06-20 11:29:30 +0000 +++ lisp/custom.el 2013-08-02 21:16:33 +0000 @@ -49,63 +49,66 @@ ;;; The `defcustom' Macro. -(defun custom-initialize-default (symbol value) - "Initialize SYMBOL with VALUE. +(defun custom-initialize-default (symbol exp) + "Initialize SYMBOL with EXP. This will do nothing if symbol already has a default binding. Otherwise, if symbol has a `saved-value' property, it will evaluate the car of that and use it as the default binding for symbol. -Otherwise, VALUE will be evaluated and used as the default binding for +Otherwise, EXP will be evaluated and used as the default binding for symbol." - (eval `(defvar ,symbol ,(if (get symbol 'saved-value) - (car (get symbol 'saved-value)) - value)))) + (eval `(defvar ,symbol ,(let ((sv (get symbol 'saved-value))) + (if sv (car sv) exp))))) -(defun custom-initialize-set (symbol value) - "Initialize SYMBOL based on VALUE. +(defun custom-initialize-set (symbol exp) + "Initialize SYMBOL based on EXP. If the symbol doesn't have a default binding already, then set it using its `:set' function (or `set-default' if it has none). The value is either the value in the symbol's `saved-value' property, -if any, or VALUE." - (unless (default-boundp symbol) - (funcall (or (get symbol 'custom-set) 'set-default) - symbol - (eval (if (get symbol 'saved-value) - (car (get symbol 'saved-value)) - value))))) +if any, or the value of EXP." + (condition-case nil + (default-toplevel-value symbol) + (error + (funcall (or (get symbol 'custom-set) #'set-default-toplevel-value) + symbol + (eval (let ((sv (get symbol 'saved-value))) + (if sv (car sv) exp))))))) -(defun custom-initialize-reset (symbol value) - "Initialize SYMBOL based on VALUE. +(defun custom-initialize-reset (symbol exp) + "Initialize SYMBOL based on EXP. Set the symbol, using its `:set' function (or `set-default' if it has none). The value is either the symbol's current value (as obtained using the `:get' function), if any, or the value in the symbol's `saved-value' property if any, -or (last of all) VALUE." - (funcall (or (get symbol 'custom-set) 'set-default) +or (last of all) the value of EXP." + (funcall (or (get symbol 'custom-set) #'set-default-toplevel-value) symbol - (cond ((default-boundp symbol) - (funcall (or (get symbol 'custom-get) 'default-value) - symbol)) - ((get symbol 'saved-value) - (eval (car (get symbol 'saved-value)))) - (t - (eval value))))) + (condition-case nil + (let ((def (default-toplevel-value symbol)) + (getter (get symbol 'custom-get))) + (if getter (funcall getter symbol) def)) + (error + (eval (let ((sv (get symbol 'saved-value))) + (if sv (car sv) exp))))))) -(defun custom-initialize-changed (symbol value) - "Initialize SYMBOL with VALUE. +(defun custom-initialize-changed (symbol exp) + "Initialize SYMBOL with EXP. Like `custom-initialize-reset', but only use the `:set' function if not using the standard setting. For the standard setting, use `set-default'." - (cond ((default-boundp symbol) - (funcall (or (get symbol 'custom-set) 'set-default) - symbol - (funcall (or (get symbol 'custom-get) 'default-value) - symbol))) - ((get symbol 'saved-value) - (funcall (or (get symbol 'custom-set) 'set-default) - symbol - (eval (car (get symbol 'saved-value))))) - (t - (set-default symbol (eval value))))) + (condition-case nil + (let ((def (default-toplevel-value symbol))) + (funcall (or (get symbol 'custom-set) #'set-default-toplevel-value) + symbol + (let ((getter (get symbol 'custom-get))) + (if getter (funcall getter symbol) def)))) + (error + (cond + ((get symbol 'saved-value) + (funcall (or (get symbol 'custom-set) #'set-default-toplevel-value) + symbol + (eval (car (get symbol 'saved-value))))) + (t + (set-default symbol (eval exp))))))) (defvar custom-delayed-init-variables nil "List of variables whose initialization is pending.") === modified file 'lisp/emacs-lisp/advice.el' --- lisp/emacs-lisp/advice.el 2013-01-15 06:05:22 +0000 +++ lisp/emacs-lisp/advice.el 2013-08-02 21:16:33 +0000 @@ -2280,7 +2280,6 @@ (defun ad-compile-function (function) "Byte-compile the assembled advice function." (require 'bytecomp) - (require 'warnings) ;To define warning-suppress-types before we let-bind it. (let ((byte-compile-warnings byte-compile-warnings) ;; Don't pop up windows showing byte-compiler warnings. (warning-suppress-types '((bytecomp)))) === modified file 'src/ChangeLog' --- src/ChangeLog 2013-08-02 13:22:23 +0000 +++ src/ChangeLog 2013-08-02 21:16:33 +0000 @@ -1,3 +1,13 @@ +2013-08-02 Stefan Monnier + + * eval.c (default_toplevel_binding): New function. + (Fdefvar): Use it. + (unbind_to, backtrace_eval_unrewind): Do a bit of CSE simplification. + (Fdefault_toplevel_value, Fset_default_toplevel_value): New subrs. + (syms_of_eval): Export them. + * data.c (Fdefault_value): Micro cleanup. + * term.c (init_tty): Use "false". + 2013-08-02 Dmitry Antipov Fix X GC leak in GTK and raw (no toolkit) X ports. === modified file 'src/data.c' --- src/data.c 2013-07-23 06:48:34 +0000 +++ src/data.c 2013-08-02 21:16:33 +0000 @@ -1384,9 +1384,7 @@ local bindings in certain buffers. */) (Lisp_Object symbol) { - register Lisp_Object value; - - value = default_value (symbol); + Lisp_Object value = default_value (symbol); if (!EQ (value, Qunbound)) return value; === modified file 'src/eval.c' --- src/eval.c 2013-07-27 22:14:07 +0000 +++ src/eval.c 2013-08-02 21:16:33 +0000 @@ -658,6 +658,51 @@ return base_variable; } +static union specbinding * +default_toplevel_binding (Lisp_Object symbol) +{ + union specbinding *binding = NULL; + union specbinding *pdl = specpdl_ptr; + while (pdl > specpdl) + { + switch ((--pdl)->kind) + { + case SPECPDL_LET_DEFAULT: + case SPECPDL_LET: + if (EQ (specpdl_symbol (pdl), symbol)) + binding = pdl; + break; + } + } + return binding; +} + +DEFUN ("default-toplevel-value", Fdefault_toplevel_value, Sdefault_toplevel_value, 1, 1, 0, + doc: /* Return SYMBOL's toplevel default value. +"Toplevel" means outside of any let binding. */) + (Lisp_Object symbol) +{ + union specbinding *binding = default_toplevel_binding (symbol); + Lisp_Object value + = binding ? specpdl_old_value (binding) : Fdefault_value (symbol); + if (!EQ (value, Qunbound)) + return value; + xsignal1 (Qvoid_variable, symbol); +} + +DEFUN ("set-default-toplevel-value", Fset_default_toplevel_value, + Sset_default_toplevel_value, 2, 2, 0, + doc: /* Set SYMBOL's toplevel default value to VALUE. +"Toplevel" means outside of any let binding. */) + (Lisp_Object symbol, Lisp_Object value) +{ + union specbinding *binding = default_toplevel_binding (symbol); + if (binding) + set_specpdl_old_value (binding, value); + else + Fset_default (symbol, value); + return Qnil; +} DEFUN ("defvar", Fdefvar, Sdefvar, 1, UNEVALLED, 0, doc: /* Define SYMBOL as a variable, and return SYMBOL. @@ -706,18 +751,10 @@ else { /* Check if there is really a global binding rather than just a let binding that shadows the global unboundness of the var. */ - union specbinding *pdl = specpdl_ptr; - while (pdl > specpdl) + union specbinding *binding = default_toplevel_binding (sym); + if (binding && EQ (specpdl_old_value (binding), Qunbound)) { - if ((--pdl)->kind >= SPECPDL_LET - && EQ (specpdl_symbol (pdl), sym) - && EQ (specpdl_old_value (pdl), Qunbound)) - { - message_with_string - ("Warning: defvar ignored because %s is let-bound", - SYMBOL_NAME (sym), 1); - break; - } + set_specpdl_old_value (binding, eval_sub (XCAR (tail))); } } tail = XCDR (tail); @@ -3311,19 +3348,21 @@ case SPECPDL_BACKTRACE: break; case SPECPDL_LET: - /* If variable has a trivial value (no forwarding), we can - just set it. No need to check for constant symbols here, - since that was already done by specbind. */ - if (XSYMBOL (specpdl_symbol (specpdl_ptr))->redirect - == SYMBOL_PLAINVAL) - SET_SYMBOL_VAL (XSYMBOL (specpdl_symbol (specpdl_ptr)), - specpdl_old_value (specpdl_ptr)); - else - /* NOTE: we only ever come here if make_local_foo was used for - the first time on this var within this let. */ - Fset_default (specpdl_symbol (specpdl_ptr), - specpdl_old_value (specpdl_ptr)); - break; + { /* If variable has a trivial value (no forwarding), we can + just set it. No need to check for constant symbols here, + since that was already done by specbind. */ + struct Lisp_Symbol *sym = XSYMBOL (specpdl_symbol (specpdl_ptr)); + if (sym->redirect == SYMBOL_PLAINVAL) + { + SET_SYMBOL_VAL (sym, specpdl_old_value (specpdl_ptr)); + break; + } + else + { /* FALLTHROUGH!! + NOTE: we only ever come here if make_local_foo was used for + the first time on this var within this let. */ + } + } case SPECPDL_LET_DEFAULT: Fset_default (specpdl_symbol (specpdl_ptr), specpdl_old_value (specpdl_ptr)); @@ -3511,24 +3550,23 @@ case SPECPDL_BACKTRACE: break; case SPECPDL_LET: - /* If variable has a trivial value (no forwarding), we can - just set it. No need to check for constant symbols here, - since that was already done by specbind. */ - if (XSYMBOL (specpdl_symbol (tmp))->redirect - == SYMBOL_PLAINVAL) - { - struct Lisp_Symbol *sym = XSYMBOL (specpdl_symbol (tmp)); - Lisp_Object old_value = specpdl_old_value (tmp); - set_specpdl_old_value (tmp, SYMBOL_VAL (sym)); - SET_SYMBOL_VAL (sym, old_value); - break; - } - else - { - /* FALLTHROUGH! - NOTE: we only ever come here if make_local_foo was used for - the first time on this var within this let. */ - } + { /* If variable has a trivial value (no forwarding), we can + just set it. No need to check for constant symbols here, + since that was already done by specbind. */ + struct Lisp_Symbol *sym = XSYMBOL (specpdl_symbol (tmp)); + if (sym->redirect == SYMBOL_PLAINVAL) + { + Lisp_Object old_value = specpdl_old_value (tmp); + set_specpdl_old_value (tmp, SYMBOL_VAL (sym)); + SET_SYMBOL_VAL (sym, old_value); + break; + } + else + { /* FALLTHROUGH!! + NOTE: we only ever come here if make_local_foo was used for + the first time on this var within this let. */ + } + } case SPECPDL_LET_DEFAULT: { Lisp_Object sym = specpdl_symbol (tmp); @@ -3796,6 +3834,8 @@ defsubr (&Ssetq); defsubr (&Squote); defsubr (&Sfunction); + defsubr (&Sdefault_toplevel_value); + defsubr (&Sset_default_toplevel_value); defsubr (&Sdefvar); defsubr (&Sdefvaralias); defsubr (&Sdefconst); === modified file 'src/term.c' --- src/term.c 2013-07-18 08:35:27 +0000 +++ src/term.c 2013-08-02 21:16:33 +0000 @@ -2933,7 +2933,7 @@ TERMINAL_TYPE is the termcap type of the device, e.g. "vt100". - If MUST_SUCCEED is true, then all errors are fatal. */ + If MUST_SUCCEED is true, then all errors are fatal. */ struct terminal * init_tty (const char *name, const char *terminal_type, bool must_succeed) @@ -2944,7 +2944,7 @@ int status; struct tty_display_info *tty = NULL; struct terminal *terminal = NULL; - bool ctty = 0; /* True if asked to open controlling tty. */ + bool ctty = false; /* True if asked to open controlling tty. */ if (!terminal_type) maybe_fatal (must_succeed, 0, @@ -3031,7 +3031,7 @@ tty->termcap_term_buffer = xmalloc (buffer_size); /* On some systems, tgetent tries to access the controlling - terminal. */ + terminal. */ block_tty_out_signal (); status = tgetent (tty->termcap_term_buffer, terminal_type); unblock_tty_out_signal (); @@ -3101,13 +3101,13 @@ Right (tty) = tgetstr ("nd", address); Down (tty) = tgetstr ("do", address); if (!Down (tty)) - Down (tty) = tgetstr ("nl", address); /* Obsolete name for "do" */ + Down (tty) = tgetstr ("nl", address); /* Obsolete name for "do". */ if (tgetflag ("bs")) - Left (tty) = "\b"; /* can't possibly be longer! */ - else /* (Actually, "bs" is obsolete...) */ + Left (tty) = "\b"; /* Can't possibly be longer! */ + else /* (Actually, "bs" is obsolete...) */ Left (tty) = tgetstr ("le", address); if (!Left (tty)) - Left (tty) = tgetstr ("bc", address); /* Obsolete name for "le" */ + Left (tty) = tgetstr ("bc", address); /* Obsolete name for "le". */ tty->TS_pad_char = tgetstr ("pc", address); tty->TS_repeat = tgetstr ("rp", address); tty->TS_end_standout_mode = tgetstr ("se", address); @@ -3229,7 +3229,7 @@ don't think we're losing anything by turning it off. */ terminal->line_ins_del_ok = 0; - tty->TN_max_colors = 16; /* Required to be non-zero for tty-display-color-p */ + tty->TN_max_colors = 16; /* Must be non-zero for tty-display-color-p. */ #endif /* DOS_NT */ #ifdef HAVE_GPM @@ -3325,16 +3325,16 @@ tty->Wcm->cm_tab = 0; /* We can't support standout mode, because it uses magic cookies. */ tty->TS_standout_mode = 0; - /* But that means we cannot rely on ^M to go to column zero! */ + /* But that means we cannot rely on ^M to go to column zero! */ CR (tty) = 0; - /* LF can't be trusted either -- can alter hpos */ - /* if move at column 0 thru a line with TS_standout_mode */ + /* LF can't be trusted either -- can alter hpos. */ + /* If move at column 0 thru a line with TS_standout_mode. */ Down (tty) = 0; } tty->specified_window = FrameRows (tty); - if (Wcm_init (tty) == -1) /* can't do cursor motion */ + if (Wcm_init (tty) == -1) /* Can't do cursor motion. */ { maybe_fatal (must_succeed, terminal, "Terminal type \"%s\" is not powerful enough to run Emacs", === modified file 'test/ChangeLog' --- test/ChangeLog 2013-08-01 23:10:51 +0000 +++ test/ChangeLog 2013-08-02 21:16:33 +0000 @@ -1,3 +1,7 @@ +2013-08-02 Stefan Monnier + + * automated/core-elisp-tests.el: New file. + 2013-08-01 Glenn Morris * automated/file-notify-tests.el (file-notify--test-remote-enabled): === added file 'test/automated/core-elisp-tests.el' --- test/automated/core-elisp-tests.el 1970-01-01 00:00:00 +0000 +++ test/automated/core-elisp-tests.el 2013-08-02 21:16:33 +0000 @@ -0,0 +1,38 @@ +;;; core-elisp-tests.el --- Testing some core Elisp rules + +;; Copyright (C) 2013 Free Software Foundation, Inc. + +;; Author: Stefan Monnier +;; Keywords: + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; + +;;; Code: + +(ert-deftest core-elisp-tests () + "Test some core Elisp rules." + (with-temp-buffer + ;; Check that when defvar is run within a let-binding, the toplevel default + ;; is properly initialized. + (should (equal (list (let ((c-e-x 1)) (defvar c-e-x 2) c-e-x) c-e-x) + '(1 2))) + (should (equal (list (let ((c-e-x 1)) (defcustom c-e-x 2) c-e-x) c-e-x) + '(1 2))))) + +(provide 'core-elisp-tests) +;;; core-elisp-tests.el ends here ------------------------------------------------------------ revno: 113661 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2013-08-02 18:29:16 +0200 message: lisp/emacs-lisp/lisp-mode.el: Support cl-def* expressions in imenu. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-08-02 16:03:13 +0000 +++ lisp/ChangeLog 2013-08-02 16:29:16 +0000 @@ -1,5 +1,8 @@ 2013-08-02 Juanma Barranquero + * emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): + Add cl-def* expressions. + * frameset.el (frameset-filter-params): Fix order of arguments. 2013-08-02 Juanma Barranquero === modified file 'lisp/emacs-lisp/lisp-mode.el' --- lisp/emacs-lisp/lisp-mode.el 2013-06-18 22:13:25 +0000 +++ lisp/emacs-lisp/lisp-mode.el 2013-08-02 16:29:16 +0000 @@ -110,7 +110,9 @@ "define-compiler-macro" "define-modify-macro" "defsetf" "define-setf-expander" "define-method-combination" - "defgeneric" "defmethod") t)) + "defgeneric" "defmethod" + "cl-defun" "cl-defsubst" "cl-defmacro" + "cl-define-compiler-macro") t)) "\\s-+\\(\\(\\sw\\|\\s_\\)+\\)")) 2) (list (purecopy "Variables") @@ -132,7 +134,8 @@ (regexp-opt '("defgroup" "deftheme" "deftype" "defstruct" "defclass" "define-condition" "define-widget" - "defface" "defpackage") t)) + "defface" "defpackage" "cl-deftype" + "cl-defstruct") t)) "\\s-+'?\\(\\(\\sw\\|\\s_\\)+\\)")) 2)) ------------------------------------------------------------ revno: 113660 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2013-08-02 18:03:13 +0200 message: lisp/frameset.el (frameset-filter-params): Fix order of arguments. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-08-02 04:33:58 +0000 +++ lisp/ChangeLog 2013-08-02 16:03:13 +0000 @@ -1,5 +1,9 @@ 2013-08-02 Juanma Barranquero + * frameset.el (frameset-filter-params): Fix order of arguments. + +2013-08-02 Juanma Barranquero + Move code related to saving frames to frameset.el. * desktop.el: Require frameset. (desktop-restore-frames): Doc fix. === modified file 'lisp/frameset.el' --- lisp/frameset.el 2013-08-02 04:33:58 +0000 +++ lisp/frameset.el 2013-08-02 16:03:13 +0000 @@ -230,7 +230,7 @@ (:restore (when saving (push current filtered))) ((or `(,fun . ,args) (and fun (pred fboundp))) - (let ((this (apply fun filtered current parameters saving args))) + (let ((this (apply fun current filtered parameters saving args))) (when this (push (if (eq this t) current this) filtered)))) (other ------------------------------------------------------------ revno: 113659 committer: Bastien Guerry branch nick: trunk timestamp: Fri 2013-08-02 16:26:22 +0200 message: PS: I re-read the manual of bzr to make sure I don't break anything. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2013-08-02 14:06:27 +0000 +++ etc/ChangeLog 2013-08-02 14:26:22 +0000 @@ -1,3 +1,7 @@ +2013-08-02 Bastien Guerry + + * DEVEL.HUMOR: New entry. + 2013-08-02 Xue Fuqiao * tutorials/TUTORIAL: Remove a redundant sentence. === modified file 'etc/DEVEL.HUMOR' --- etc/DEVEL.HUMOR 2008-01-22 15:28:56 +0000 +++ etc/DEVEL.HUMOR 2013-08-02 14:26:22 +0000 @@ -194,3 +194,11 @@ depression or loneliness when it is left out of the picture, so I wouldn't worry about it too much." -- Lennart Borgman and Jason Rumney + +---------------------------------------------------------------------- + + "... a non-CS-educated guy like me ..." + + "Kind of late, but thanks for letting us know. I've just revoked your + write access to the repository for the obvious safety reasons," + -- Bastien Guerry and Stefan Monnier ------------------------------------------------------------ revno: 113658 committer: Xue Fuqiao branch nick: trunk timestamp: Fri 2013-08-02 22:06:27 +0800 message: Add indexes for elisp manual. * doc/lispref/display.texi (Face Functions): Add an index. * doc/lispref/variables.texi (Variable Aliases): Add an index. * doc/lispref/functions.texi (Defining Functions): Add an index. * doc/lispref/nonascii.texi (Coding System Basics): Add an index. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2013-08-02 12:52:26 +0000 +++ etc/ChangeLog 2013-08-02 14:06:27 +0000 @@ -1,5 +1,7 @@ 2013-08-02 Xue Fuqiao + * tutorials/TUTORIAL: Remove a redundant sentence. + * tutorials/TUTORIAL.cn: Update; synchronize with TUTORIAL. * tutorials/TUTORIAL.translators (Maintainer): Update the maintainer. === modified file 'etc/tutorials/TUTORIAL' --- etc/tutorials/TUTORIAL 2013-01-01 09:11:05 +0000 +++ etc/tutorials/TUTORIAL 2013-08-02 14:06:27 +0000 @@ -372,13 +372,15 @@ The difference between "killing" and "deleting" is that "killed" text can be reinserted (at any position), whereas "deleted" things cannot -be reinserted in this way (you can, however, undo a deletion--see below). -Reinsertion of killed text is called "yanking". Generally, the -commands that can remove a lot of text kill the text (they are set up so -that you can yank the text), while the commands that remove just one -character, or only remove blank lines and spaces, do deletion (so you -cannot yank that text). and C-d do deletion in the simplest -case, with no argument. When given an argument, they kill instead. +be reinserted in this way (you can, however, undo a deletion--see +below). Reinsertion of killed text is called "yanking". (Think of it +as yanking back, or pulling back, some text that was taken away.) +Generally, the commands that can remove a lot of text kill the text +(they are set up so that you can yank the text), while the commands +that remove just one character, or only remove blank lines and spaces, +do deletion (so you cannot yank that text). and C-d do deletion +in the simplest case, with no argument. When given an argument, they +kill instead. >> Move the cursor to the beginning of a line which is not empty. Then type C-k to kill the text on that line. @@ -391,13 +393,12 @@ their contents. This is not mere repetition. C-u 2 C-k kills two lines and their newlines; typing C-k twice would not do that. -Reinserting killed text is called "yanking". (Think of it as yanking -back, or pulling back, some text that was taken away.) You can yank -the killed text either at the same place where it was killed, or at -some other place in the text you are editing, or even in a different -file. You can yank the same text several times; that makes multiple -copies of it. Some other editors call killing and yanking "cutting" -and "pasting" (see the Glossary in the Emacs manual). +You can yank the killed text either at the same place where it was +killed, or at some other place in the text you are editing, or even in +a different file. You can yank the same text several times; that +makes multiple copies of it. Some other editors call killing and +yanking "cutting" and "pasting" (see the Glossary in the Emacs +manual). The command for yanking is C-y. It reinserts the last killed text, at the current cursor position. ------------------------------------------------------------ revno: 113657 committer: Xue Fuqiao branch nick: trunk timestamp: Fri 2013-08-02 21:52:10 +0800 message: Add indexes for elisp manual. * doc/lispref/display.texi (Face Functions): Add an index. * doc/lispref/variables.texi (Variable Aliases): Add an index. * doc/lispref/functions.texi (Defining Functions): Add an index. * doc/lispref/nonascii.texi (Coding System Basics): Add an index. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2013-07-31 12:59:10 +0000 +++ doc/lispref/ChangeLog 2013-08-02 13:52:10 +0000 @@ -1,3 +1,13 @@ +2013-08-02 Xue Fuqiao + + * display.texi (Face Functions): Add an index. + + * variables.texi (Variable Aliases): Add an index. + + * functions.texi (Defining Functions): Add an index. + + * nonascii.texi (Coding System Basics): Add an index. + 2013-07-31 Xue Fuqiao * nonascii.texi (Non-ASCII Characters): Update menu. === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2013-06-30 15:10:33 +0000 +++ doc/lispref/display.texi 2013-08-02 13:52:10 +0000 @@ -2738,6 +2738,7 @@ @end defun @cindex face alias +@cindex alias, for faces A @dfn{face alias} provides an equivalent name for a face. You can define a face alias by giving the alias symbol the @code{face-alias} property, with a value of the target face name. The following example === modified file 'doc/lispref/functions.texi' --- doc/lispref/functions.texi 2013-06-24 06:58:52 +0000 +++ doc/lispref/functions.texi 2013-08-02 13:52:10 +0000 @@ -580,6 +580,7 @@ @end defmac @cindex function aliases +@cindex alias, for functions @defun defalias name definition &optional doc @anchor{Definition of defalias} This function defines the symbol @var{name} as a function, with === modified file 'doc/lispref/nonascii.texi' --- doc/lispref/nonascii.texi 2013-07-31 12:59:10 +0000 +++ doc/lispref/nonascii.texi 2013-08-02 13:52:10 +0000 @@ -1012,6 +1012,7 @@ as an alias for the coding system. @end defun +@cindex alias, for coding systems @defun coding-system-aliases coding-system This function returns the list of aliases of @var{coding-system}. @end defun === modified file 'doc/lispref/variables.texi' --- doc/lispref/variables.texi 2013-06-12 01:25:53 +0000 +++ doc/lispref/variables.texi 2013-08-02 13:52:10 +0000 @@ -1838,6 +1838,7 @@ @node Variable Aliases @section Variable Aliases @cindex variable aliases +@cindex alias, for variables It is sometimes useful to make two variables synonyms, so that both variables always have the same value, and changing either one also ------------------------------------------------------------ revno: 113656 author: Lars Magne Ingebrigtsen committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2013-08-02 13:34:22 +0000 message: Merge changes made in Gnus trunk 2013-08-02 Lars Magne Ingebrigtsen * gnus-group.el (gnus-group-delete-articles): Allow deleting only "old" articles. * gnus-delay.el (gnus-delay-article): Run `message-send-hook' so that we can get spell-checking etc. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-08-02 08:36:15 +0000 +++ lisp/gnus/ChangeLog 2013-08-02 13:34:22 +0000 @@ -1,3 +1,13 @@ +2013-08-02 Lars Magne Ingebrigtsen + + * gnus-delay.el (gnus-delay-article): Fix typo. + + * gnus-group.el (gnus-group-delete-articles): Allow deleting only "old" + articles. + + * gnus-delay.el (gnus-delay-article): Run `message-send-hook' so that + we can get spell-checking etc. + 2013-08-02 Katsumi Yamaoka * rfc2047.el (rfc2047-encode-message-header): Unify charsets into === modified file 'lisp/gnus/gnus-delay.el' --- lisp/gnus/gnus-delay.el 2013-03-05 17:13:01 +0000 +++ lisp/gnus/gnus-delay.el 2013-08-02 13:34:22 +0000 @@ -80,6 +80,8 @@ (list (read-string "Target date (YYYY-MM-DD), time (hh:mm), or length of delay (units in [mhdwMY]): " gnus-delay-default-delay))) + ;; Allow spell checking etc. + (run-hooks 'message-send-hook) (let (num unit days year month day hour minute deadline) (cond ((string-match "\\([0-9][0-9][0-9]?[0-9]?\\)-\\([0-9]+\\)-\\([0-9]+\\)" === modified file 'lisp/gnus/gnus-group.el' --- lisp/gnus/gnus-group.el 2013-07-02 10:38:58 +0000 +++ lisp/gnus/gnus-group.el 2013-08-02 13:34:22 +0000 @@ -2796,14 +2796,21 @@ (lambda (group) (gnus-group-delete-group group nil t)))))) -(defun gnus-group-delete-articles (group) - "Delete all articles in the current group." - (interactive (list (gnus-group-group-name))) +(defun gnus-group-delete-articles (group &optional oldp) + "Delete all articles in the current group. +If OLDP (the prefix), only delete articles that are \"old\", +according to the expiry settings. Note that this will delete old +not-expirable articles, too." + (interactive (list (gnus-group-group-name) + current-prefix-arg)) (let ((articles (gnus-uncompress-range (gnus-active group)))) (when (gnus-yes-or-no-p (format "Do you really want to delete these %d articles forever? " (length articles))) - (gnus-request-expire-articles articles group 'force)))) + (gnus-request-expire-articles articles group + (if current-prefix-arg + nil + 'force))))) (defun gnus-group-delete-group (group &optional force no-prompt) "Delete the current group. Only meaningful with editable groups. ------------------------------------------------------------ revno: 113655 committer: Dmitry Antipov branch nick: trunk timestamp: Fri 2013-08-02 17:22:23 +0400 message: Fix X GC leak in GTK and raw (no toolkit) X ports. * xterm.c (x_free_frame_resources): If white and black relief GCs are allocated, always free them here. * xfns.c (x_make_gc): Omit redundant initialization. * widget.c (create_frame_gcs): Remove the leftover. (EmacsFrameDestroy): Do nothing because all GCs are now freed in x_free_frame_resources. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-08-02 09:42:23 +0000 +++ src/ChangeLog 2013-08-02 13:22:23 +0000 @@ -1,3 +1,13 @@ +2013-08-02 Dmitry Antipov + + Fix X GC leak in GTK and raw (no toolkit) X ports. + * xterm.c (x_free_frame_resources): If white and black relief + GCs are allocated, always free them here. + * xfns.c (x_make_gc): Omit redundant initialization. + * widget.c (create_frame_gcs): Remove the leftover. + (EmacsFrameDestroy): Do nothing because all GCs are now freed + in x_free_frame_resources. + 2013-08-02 Jan Djärv * nsterm.m (windowWillResize:toSize:): Only change title if === modified file 'src/widget.c' --- src/widget.c 2013-06-30 16:14:22 +0000 +++ src/widget.c 2013-08-02 13:22:23 +0000 @@ -503,26 +503,6 @@ update_wm_hints (ew); } - -#if 0 - -static void -create_frame_gcs (EmacsFrame ew) -{ - struct frame *s = ew->emacs_frame.frame; - - s->output_data.x->normal_gc - = XCreateGC (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)), 0, 0); - s->output_data.x->reverse_gc - = XCreateGC (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)), 0, 0); - s->output_data.x->cursor_gc - = XCreateGC (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)), 0, 0); - s->output_data.x->black_relief.gc = 0; - s->output_data.x->white_relief.gc = 0; -} - -#endif /* 0 */ - static char setup_frame_cursor_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -683,19 +663,7 @@ static void EmacsFrameDestroy (Widget widget) { - EmacsFrame ew = (EmacsFrame) widget; - struct frame* s = ew->emacs_frame.frame; - - if (! s) emacs_abort (); - if (! s->output_data.x) emacs_abort (); - - block_input (); - x_free_gcs (s); - if (s->output_data.x->white_relief.gc) - XFreeGC (XtDisplay (widget), s->output_data.x->white_relief.gc); - if (s->output_data.x->black_relief.gc) - XFreeGC (XtDisplay (widget), s->output_data.x->black_relief.gc); - unblock_input (); + /* All GCs are now freed in x_free_frame_resources. */ } static void === modified file 'src/xfns.c' --- src/xfns.c 2013-08-02 03:55:24 +0000 +++ src/xfns.c 2013-08-02 13:22:23 +0000 @@ -2788,10 +2788,6 @@ | GCFillStyle | GCLineWidth), &gc_values); - /* Reliefs. */ - f->output_data.x->white_relief.gc = 0; - f->output_data.x->black_relief.gc = 0; - /* Create the gray border tile used when the pointer is not in the frame. Since this depends on the frame's pixel values, this must be done on a per-frame basis. */ === modified file 'src/xterm.c' --- src/xterm.c 2013-08-01 07:33:58 +0000 +++ src/xterm.c 2013-08-02 13:22:23 +0000 @@ -9439,6 +9439,19 @@ unload_color (f, f->output_data.x->black_relief.pixel); x_free_gcs (f); + + /* Free extra GCs allocated by x_setup_relief_colors. */ + if (f->output_data.x->white_relief.gc) + { + XFreeGC (dpyinfo->display, f->output_data.x->white_relief.gc); + f->output_data.x->white_relief.gc = 0; + } + if (f->output_data.x->black_relief.gc) + { + XFreeGC (dpyinfo->display, f->output_data.x->black_relief.gc); + f->output_data.x->black_relief.gc = 0; + } + XFlush (FRAME_X_DISPLAY (f)); } ------------------------------------------------------------ revno: 113654 committer: Xue Fuqiao branch nick: trunk timestamp: Fri 2013-08-02 20:52:26 +0800 message: * tutorials/TUTORIAL.cn: Update; synchronize with TUTORIAL. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2013-08-02 06:59:25 +0000 +++ etc/ChangeLog 2013-08-02 12:52:26 +0000 @@ -1,5 +1,7 @@ 2013-08-02 Xue Fuqiao + * tutorials/TUTORIAL.cn: Update; synchronize with TUTORIAL. + * tutorials/TUTORIAL.translators (Maintainer): Update the maintainer. 2013-08-02 Juanma Barranquero === modified file 'etc/tutorials/TUTORIAL.cn' --- etc/tutorials/TUTORIAL.cn 2013-03-12 01:14:08 +0000 +++ etc/tutorials/TUTORIAL.cn 2013-08-02 12:52:26 +0000 @@ -14,8 +14,9 @@ 先按一下 ESC 键然后放开,再输入 。我们用 来表示 ESC 键。 -重要提示:要退出 Emacs,请用 C-x C-c(两个连续的组合键)。下文中左边顶 -行的“>>”字样用来提示你尝试键盘命令。比如: +重要提示:要退出 Emacs,请用 C-x C-c(两个连续的组合键)。 +要退出一个正在运行中的命令,请用 C-g。 +下文中左边顶行的“>>”字样用来提示你尝试键盘命令。比如: <> [本页当中特意留出一些空白是出于教学目的,请继续往后阅读] >> 现在输入 C-v (查看下一屏文字)移动到下一屏。 @@ -43,7 +44,9 @@ (注意是 CONTROL-L,不是 CONTROL-1) >> 找到光标,留意其附近的文字,然后输入 C-l。 - 找找光标在哪里,你会发现其附近的文字并没有变化。 + 找找光标在哪里,你会发现其附近的文字与之前相同,位置却变为屏幕的中心。 + 如果你再次输入 C-l ,附近的文字将移动到屏幕的顶端。再次输入 C-l , + 文字将移动到底端。 如果你的键盘上有 PageUp 和 PageDn,也可以用这两个键来滚屏。不过使用 C-v 和 M-v 的效率要更高一些。 @@ -78,8 +81,8 @@ >> 用 C-f 把光标移动到这一行,然后再用 C-p 往上挪。 注意观察当光标在一行的中央时 C-p 命令的行为。 -每行文字都以一个“换行符”结束,“换行符”把行与行区分开来。文件的最后 -一行也应该也有一个换行符(不过 Emacs 并不强制要求这一点)。 +每行文字都以一个“换行符”结束,“换行符”把行与行区分开来。(通常情况下, +一个文件的最后一行会有一个换行符,但是 Emacs 不强制要求这一点。) >> 在一行的行头输入 C-b。 光标应该会移动到前一行的行尾,因为光标在回退过程中越过了换行符。 @@ -179,27 +182,20 @@ 标志――只要给出有一个前缀参数,不管其值为何,它都会改变命令的功能。 而 C-v 和 M-v 则属于另一种类型的例外。当给定一个参数时,它们将滚动你指 -定的“行数”,而不是“屏数”。举例来说,C-u 8 C-v 将屏幕向下滚动 8 行, -而不是 8 屏。 +定的“行数”,而不是“屏数”。举例来说,C-u 8 C-v 将文本向下滚动 8 行。 >> 现在试试看,输入 C-u 8 C-v。 这个命令应该已经将文字向上滚动了 8 行。如果你想将它再次地向下滚动,你可 以给定一个参数然后执行 M-v。 -如果你正在使用一个窗口系统,比如 X11 或者微软的 Windows,那么在 Emacs -窗口的边缘应该有一个长方形的区域叫“滚动条”,你可以用鼠标操纵滚动条来 -滚动文字。 - ->> 试着在“滚动条内的反白区域”上按一下鼠标中键。 - 文字应该会滚动到鼠标所指示的位置。 - ->> 当按住中键时,试着将鼠标上下移动。 - 你会看到文字随着鼠标的移动而上下滚动。 - 【Windows 版本符合 Windows 程序的传统操作习惯,上述操作不适用。】 - - -* 在 EMACS 失去响应的时候(WHEN EMACS IS HUNG) +如果你正在使用图形界面,比如 X 或者微软的 Windows,那么在 Emacs窗 +口的一边应该有一个长方形的区域叫“滚动条”。你可以用鼠标操纵滚动条来滚动 +文字。 + +如果你的鼠标有滚轮的话,你也可以使用滚轮来滚动。 + +* 如果 EMACS 失去响应(IF EMACS STOPS RESPONDING) ----------------------------------------------- 如果 Emacs 对你的命令失去响应,你可以用 C-g 来安全地终止这条命令。C-g @@ -234,7 +230,7 @@ * 窗格(WINDOWS) ----------------- -Emacs 可以有多个窗格,每个窗格显示不同的文字。后面会介绍怎么对付多个窗 +Emacs 可以有多个“窗格”,每个窗格显示不同的文字。后面会介绍怎么对付多个窗 格,现在我们先学会如何关掉多余的窗格。其实也很简单: C-x 1 只保留一个窗格(也就是关掉其它所有窗格)。 @@ -244,49 +240,46 @@ >> 把光标移到本行然后输入 C-u 0 C-l。 ->> 输入 CONTROL-h k CONTROL-f。观察当一个新窗格出现时当前窗格(用来显示 - CONTROL-f 命令的文档)是如何缩小的。 +>> 输入 C-h k C-f。观察当一个新窗格出现时当前窗格(用来显示 + C-f 命令的文档)是如何缩小的。 >> 输入 C-x 1 关掉文档窗格。 -这个命令跟先前学过的命令不太一样,因为它包含了两个字符,以 CONTROL-x 开 -始。有一系列命令都是以 CONTROL-x 开始的,这些命令许多都跟“窗格、文件、 -缓冲区【缓冲区(buffer)会在后文详细介绍】”等等诸如此类的东西有关,其 -中有些命令可能包含了 2 个、3 个或者 4 个字符。 +有一系列命令是以 CONTROL-x 开始的,这些命令许多都跟“窗格、文件、缓冲区 +【缓冲区(buffer)会在后文详细介绍】”等等诸如此类的东西有关,其中有些 +命令可能包含了 2 个、3 个或者 4 个字符。 * 插入与删除(INSERTING AND DELETING) -------------------------------------- -插入文字很简单,直接敲键盘就可以了。你能看到的字符,比如 A、7、* 等等, -都被 Emacs 视为文字并且可以直接插入。敲 (回车键)会插入一个换 -行符。 - -你可以用 来删除最后输入的一个字符,这个跟你在 Emacs 之外的用 -法应该一样。一般来说 就是位于 键上方某处的一个大块头 -的键,通常被标示为“Delete”、“Del”或者“Backspace”。 - -如果你找到了“Backspace”键,那么它应该就是 ;这时哪怕你又在别 -的地方找到了一个“Del”键,那么它也应该不是 。 - -一种更通用的说法是, 将删除位于光标前的一个字符。 - ->> 现在就来试试――敲点字,然后按几下 删除它们。 +插入文字很简单,直接敲键盘就可以了。普通的字符,比如 A、7、* 等等,会 +随着你的输入而插入。要插入一个换行符,输入 (这个键在键盘上有 +时会被标注成“Enter”)。 + +你可以用 来删除光标左边的字符,这个键通常被标注为“Backspace”――跟 +你在 Emacs 之外的用法应该一样,删除最后一个输入的字符。 + +你的键盘上可能有另外一个键,标注着 ,但那个不是我们所说的 。 + +>> 现在就来试试――敲点字,然后按几下 删除它们。 不用担心文件被修改,你做什么都没关系,这里就是专给你练习用的。 如果一行文字很长、超出了窗格的宽度,显示不下的部分会在紧邻的下一行继续 -显示。这时会有一个反斜线(在控制台下是反斜线,如果你用图形窗口系统,则 -应该是一个小小的转弯箭头)显示在右边沿,表明这是某一行的接续显示。 - ->> 输入文字,一直到屏幕的右边界,然后继续,你会看到一个接续行出现。 - ->> 用 删掉一些文字,直到此行长度小于窗格宽度,接续行就消失了。 +显示。如果你使用的是图形界面,文本区域两边的狭窄区域(左右“边缘”)会出 +现小小的转弯箭头,表明这是某一行的接续显示。如果你使用的是文本终端,接 +续显示由屏幕最右边一列的一个反斜线来表示。 + +>> 输入文字,一直到屏幕的右边界,然后继续。 +你会看到一个接续行出现。 + +>> 用 删掉一些文字,直到此行长度小于窗格宽度,接续行就消失了。 换行符跟其它字符一样可以被删除。两行中间的换行符被删除后,这两行将会合 并成一行。如果合并后的这一行太长,超出了窗格宽度,它就会以一个接续行来 显示。 ->> 移动光标到某行的开头并输入 。 +>> 移动光标到某行的开头并输入 。 这时该行将与其前一行一起被合并为一行。 >> 输入 重新插入你刚才删除的换行符。 @@ -299,10 +292,10 @@ 好,现在你应该已经掌握了最基本的的文本插入和修改功能,其实删除还可以 “以词为单位”进行,下面是一个关于“删除”操作的小结: - 删除光标前的一个字符 + 删除光标前的一个字符 C-d 删除光标后的一个字符 - M- 移除光标前的一个词 + M- 移除光标前的一个词 M-d 移除光标后的一个词 C-k 移除从光标到“行尾”间的字符 @@ -311,29 +304,31 @@ 【可能你已经注意到了“删除(delete)”和“移除(kill)”的用词区别,后 文会有详细说明。】 -注意“ 和 C-d”还有“M- 和 M-d”是根据前述惯例从 C-f -和 M-f 衍生出来的(其实不是控制字符,我们先忽略这一点)。C-k -和 M-k 的关系在某种程度上与 C-e 和 M-e 一样――如果把“一行”和“一句” -作一个类比的话。 +注意“ 和 C-d”还有“M- 和 M-d”是根据前述惯例从 C-f和 M-f 衍生 +出来的(其实不是控制字符,我们先忽略这一点)。C-k和 M-k 的关系在 +某种程度上与 C-e 和 M-e 一样――如果把“一行”和“一句”作一个类比的话。 你也可以用一种通用的办法来移除缓冲区里的任何一部分:首先把光标移动到你 -想要移除的区域的一端,然后按 C-@ 或 C-SPC(任一即可,SPC指空格)【注意, -C-SPC 往往被中文用户设定成输入法热键,如果这样,C-SPC 就被系统拦截而无 -法传递给 Emacs 了,因此这里还是推荐使用C-@。】,然后将光标移动到另一端, -再按 C-w 就可以把位于这两点之间的所有文字移除了。 +想要移除的区域的一端,然后按 C-指空格)【注意,C- 往 +往被中文用户设定成输入法热键,如果这样,C- 就被系统拦截而无法传递 +给 Emacs 了,在这种情况下可以使用C-@。】,然后将光标移动到你准备移除的 +文字的另一端。这个时候, Emacs 会高亮光标和你按下 C- 之间的文本。 +最后,按下 C-w 。这样就可以把位于这两点之间的所有文字移除了。 >> 移动光标到上一段开头的“你”字。 ->> 输入 C-@ 。Emacs 应该会在屏幕的下方显示一个“Mark set”的消息。 +>> 输入 C- 。Emacs 应该会在屏幕的下方显示一个“Mark set”的消息。 >> 移动光标到第二行中的“端”字。 >> 输入 C-w,从“你”开始到“端”之前的文字被全部移除。 -注意,“移除(kill)”和“删除(delete)”的不同在于被移除的东西可以找回 -来,而被删除的就不行了。【实际上,移除掉的东西虽然看起来“消失”了,但 -实际上被 Emacs 记录了下来,因此还可以找回来;而删除掉的东西虽然也可能还 -在内存里,但是已经被 Emacs“抛弃”了,所以就找不回来了。】重新插入被移 -除的文字称为“召回(yank)”。一般而言,那些可能消除很多文字的命令会把 -消除掉的文字记录下来(它们被设定成了“可召回”),而那些只消除一个字符 -或者只消除空白的命令就不会记录被消除的内容(自然你也就无法召回了)。 +注意,“移除(kill)”和“删除(delete)”的不同在于被移除的东西可以被重新 +插入(在任何位置),而被删除的就不能使用相同的方法重新插入了(不过可以 +通过撤销一个删除命令来做到,后文会提到)。【实际上,移除掉的东西虽然看 +起来“消失”了,但实际上被 Emacs 记录了下来,因此还可以找回来;而删除掉 +的东西虽然也可能还在内存里,但是已经被 Emacs“抛弃”了,所以就找不回来 +了。】重新插入被移除的文字称为“召回(yank)”。一般而言,那些可能消除很 +多文字的命令会把消除掉的文字记录下来(它们被设定成了“可召回”),而那些 +只消除一个字符或者只消除空白的命令就不会记录被消除的内容(自然你也就无 +法召回了)。 >> 移动光标到一非空白行的行头,然后输入 C-k 移除那一行上的文字。 @@ -345,9 +340,10 @@ C-k 会把两行以及它们的换行符移除;而如果只是输入 C-k 两次显然不是这个结 果。 -将被移除的文字恢复的动作称为“召回(yanking)”。(就好像把别人从你身边 +重新插入被移除的文字恢复的动作称为“召回(yanking)”。(就好像把别人从你身边 移走的东西又猛力地拉回来。)你可以在你删除文字的地方召回,也可以在别的 -地方召回,还可以多次召回同样的文字以得到它的多个拷贝。 +地方召回,还可以多次召回同样的文字以得到它的多个拷贝。很多其它的编辑器 +把移除和召回叫做“剪切”和“粘贴” (详情可见 Emacs 使用手册里的术语表)。 召回的命令是 C-y。它会在光标所在处插入你最后移除的文字。 @@ -383,24 +379,23 @@ * 撤销(UNDO) -------------- -如果你修改了一段文字,又觉得改得不好,可以用 undo 命令进行撤销: -C-x u。 +如果你修改了一段文字,又觉得改得不好,可以用 undo 命令进行撤销:C-/。 -通常 C-x u 会消除一个命令所造成的所有改变;如果你在一行中连续多次地使用 -C-x u,你会把以前的命令也依次撤销。 +通常 C-/ 会消除一个命令所造成的所有改变;如果你在一行中连续多次地使用 +C-/,你会把以前的命令也依次撤销。 但是有两个例外: 1) 没有改变文字的命令不算(包括光标移动命令和滚动命令) -2) 从键盘输入的字符以组为单位――每组 20 个字符――来进行处理。 - (这是为了减少你在撤销“插入文字”动作时需要输入 C-x u 的次数) - ->> 用 C-k 将这一行移除,然后输入 C-x u ,它会再次出现。 - -C-_ 也是撤销命令;它的作用跟 C-x u 一样,但是它比较容易多次输入。C-_ 的 -缺点是在某些键盘上可能不太容易按,这也正是我们同时提供 C-x u 的原因。在 -某些终端上,你可以按住 CONTROL 再按“/”来输入 C-_。 - -数字参数对于 C-_ 和 C-x u 的意义是执行撤销的重复次数。 +2) 从键盘输入的字符以组为单位――每组最多 20 个字符――来进行处理。 + (这是为了减少你在撤销“插入文字”动作时需要输入 C-/ 的次数) + +>> 用 C-k 将这一行移除,然后输入 C-/ ,它会再次出现。 + +C-_ 也是撤销命令;它的作用跟 C-/ 一样,但是它比较容易多次输入。在 +某些终端上,输入 C-/ 实际上向 Emacs 发送的是 C-_ 。 +另外, C-x u 和 C-/ 完全一样,但是按起来有些麻烦。 + +数字参数对于 C-/ 、 C-_ 和 C-x u 的意义是执行撤销的重复次数。 * 文件(FILE) @@ -416,14 +411,13 @@ 文件也保存到计算机上。在存盘的时候,Emacs 会把存盘前的文件重命名保存, 以防你改完之后又想反悔。 -在屏幕的下方,你应该能够看到头尾都是短线“-”的一行,行首通常是一些诸如 -“--:-- TUTORIAL.cn”的文字,这些文字代表了你当前正在访问的文件。比如你 -现在正在访问的文件叫“TUTORIAL.cn”,它只是一个给你临时使用的拷贝。每当 -Emacs 寻找到一个文件,文件名就会出现在这个位置。 +在屏幕的下方,你应该能够看到头部有短线“-”的一行,行首通常是一些诸如“ +-:--- TUTORIAL.cn”的文字,这些文字代表了你当前正在访问的文件。比如你现 +在正在访问的文件是对 Emacs 快速指南的一份临时拷贝,叫做“TUTORIAL.cn”。 +每当Emacs 寻找到一个文件,文件名就会出现在这个位置。 -寻找文件的命令有一个特点,那就是你必须给出文件名。我们称这个命令“从终 -端读入了一个参数”(在这里,这个参数显然就是文件名)。在你输入这条命令 -之后: +寻找文件的命令有一个特点,那就是你必须给出文件名。我们称这个命令“读入 +了一个参数”(在这里,这个参数显然就是文件名)。在你输入这条命令之后: C-x C-f 寻找一个文件 @@ -437,10 +431,10 @@ 这会关掉小缓冲,同时也会取消使用小缓冲的 C-x C-f 命令。 当然了,你也没有找任何文件。 -用 结束文件名的输入。这之后 C-x C-f 命令开始工作并找到你指定的 -文件。小缓冲在 C-x C-f 命令结束之后也会消失。 +用 结束文件名的输入。之后,小缓冲会消失,C-x C-f 将会去寻找你 +指定的文件。小缓冲在 C-x C-f 命令结束之后也会消失。 -眨眼间文件就被显示在屏幕上,你可以开始编辑了。存盘用这条命令: +文件被显示在了屏幕上,你可以开始编辑了。存盘用这条命令: C-x C-s 储存这个文件 @@ -450,15 +444,16 @@ M-x customize-variable make-backup-files 】 存盘结束后,Emacs 会显示写入文件的文件名。你最好养成经常存盘的习惯,这 -可以减少系统崩溃和死机给你带来的损失。 +可以减少系统崩溃和死机给你带来的损失(也可参见下面的“自动保存”一节)。 ->> 输入 C-x C-s 把本快速指南存下来。 - 你会在屏幕的下方看到一条消息:“Wrote ...TUTORIAL.cn”。 +>> 输入 C-x C-s TUTORIAL.cn 。 + 这将会把该指南保存为一个名为 TUTORIAL.cn 的文件,并且在屏幕的下方显 + 示一条消息:“Wrote ...TUTORIAL.cn”。 你不但可以寻找一个已有的文件来查看或编辑,还可以寻找一个不存在的文件。 -实际上这正是 Emacs 创建新文件的方法:找到不存在的新文件。只有在存盘的时 -候,Emacs 才会真正创建这个文件。而在这之后的一切就跟编辑一个已有文件没 -有区别了。 +实际上这正是 Emacs 创建新文件的方法:找到不存在的新文件。事实上,只有 +在存盘的时候,Emacs 才会真正创建这个文件。而在这之后的一切就跟编辑一个 +已有文件没有区别了。 * 缓冲区(BUFFER) @@ -468,10 +463,6 @@ 切回第一个文件,一种办法是再用一次 C-x C-f。这样,你就可以在 Emacs 中同 时打开多个文件。 ->> 用 C-x C-f foo 的方式建立一个名为“foo”的文件。 - 输入一些文字,再用 C-x C-s 保存文件“foo”。 - 最后,输入 C-x C-f TUTORIAL.cn 回到这里。 - Emacs 把每个编辑中的文件都放在一个称为“缓冲区(buffer)”的地方。每寻 找到一个文件,Emacs 就在其内部开辟一个缓冲区。用下面的命令可以列出当前 所有的缓冲区: @@ -490,24 +481,28 @@ C-x C-f 是一种办法。不过还有一个更简单的办法,那就是用 C-x b。用这条命 令,你必须输入缓冲区的名称。 ->> 输入 C-x b foo 以回到文件“foo”的缓冲区。 +>> 通过输入 C-x C-f foo 创建一个名为“foo”的文件。 然后输入 C-x b TUTORIAL.cn 回到这里。 大多数情况下,缓冲区与跟其对应的文件是同名的(不包括目录名),不过这也 不是绝对的。用 C-x C-b 得到的缓冲区列表总是显示缓冲区名。 -你在 Emacs 窗格里看到的“任何”文字都一定属于某个缓冲区。然而,缓冲区未 -必有对应文件:比如显示缓冲区列表的缓冲区就是这样。再比如“*Messages*” -缓冲区也没有对应文件,这个缓冲区里存放的都是在 Emacs 底部出现的消息。 +缓冲区未必有对应文件。显示缓冲区列表的缓冲区(叫做“*Buffer List*”)就 +是这样。这个 TUTORIAL.cn 缓冲区起初没有对应的文件,但是现在有了,因为 +在前一节你输入了 C-x C-s , 将它保存成了一个文件。 + +“*Messages*”缓冲区也没有对应文件,这个缓冲区里存放的都是在 Emacs 底部 +出现的消息。 >> 输入 C-x b *Messages* 瞅瞅消息缓冲区里都有什么东西。 然后再输入 C-x b TUTORIAL.cn 回到这里。 如果你对某个文件做了些修改,然后切换到另一个文件,这个动作并不会帮你把 -前一个文件存盘。对第一个文件的修改仍然仅存在于 Emacs 中,也就是在它对应 -的缓冲区里。并且,对第二个文件的修改也不会影响到第一个文件。这很有用, -但是也挺麻烦:因为如果你想要存储第一个文件,还需要先 C-x C-f 切换回去再 -用 C-x C-s 存盘。你需要一个更简便的方法,而 Emacs 已经为你准备好了: +前一个文件存盘。对第一个文件的修改仍然仅存在于 Emacs 中,也就是在它对 +应的缓冲区里。并且,对第二个文件的修改也不会影响到第一个文件。这很有用, +但也意味着你需要一个简便的办法来保存第一个文件的缓冲区。先切换回那个缓 +冲区,再用 C-x C-s 存盘,太麻烦了。你需要一个更简便的方法,而 Emacs 已 +经为你准备好了: C-x s 保存多个缓冲区 @@ -532,21 +527,18 @@ 很多扩展命令都相当有用,虽然与你已经学过的命令比起来,他们可能不那么常 用。我们早已经见过一些扩展命令了,比如用 C-x C-f 寻找文件和用 C-x C-s 保存文件;退出 Emacs 用的 C-x C-c 也是扩展命令。(不用担心退出 Emacs 会 -给你带来什么损失,Emacs 会在退出之前提醒你存盘的) - -在控制台下,C-z 可以暂时离开 Emacs――当然,你还可以再回来。 - -在允许 C-z 的系统中,C-z 会把 Emacs“挂起”,也就是说,它会回到 shell -但不退出 Emacs。在常用的 shell 中,通常可以用“fg”或者“%emacs”命令再 -次回到 Emacs 中。 - -在没有提供挂起功能的系统中,C-z 会在 Emacs 之下创建一个子 shell 来让你 -运行其它程序,并且再次“回到”Emacs 中――虽然我们并没有真正离开过。这 -种情况下,通常用 shell 命令“exit”从子 shell 回到 Emacs。 - -你最好在打算退出登陆的时候再用 C-x C-c。在 Emacs 被诸如邮件处理程序之类 -的外部程序调用之后,也可以用 C-x C-c 退出。不过一般来讲,如果你不想退出 -登录,最好还是把 Emacs 挂起而不是退出。 +给你带来什么损失,Emacs 会在退出之前提醒你存盘的。) + +如果你使用图形界面,你不需要任何特殊的命令来切换 Emacs 和其他应用程序。 +你可以使用鼠标或者窗口管理器的命令。然而,如果你使用只能同时显示一个应 +用程序的文本终端,你需要“挂起” Emacs ,以切换到其他的应用程序。 + +C-z 可以暂时离开 Emacs――当然,你还可以再回来。在允许 C-z 的系统中,C-z +会把 Emacs“挂起”,也就是说,它会回到 shell但不杀死 Emacs 的进程。在常 +用的 shell 中,通常可以用“fg”或者“%emacs”命令再次回到 Emacs 中。 + +你最好在打算退出登陆的时候再用 C-x C-c。在把 Emacs 当做一个临时的编辑 +器的时候(比如被一个邮件处理程序调用),也可以用 C-x C-c 退出。 C-x 的扩展命令有很多,下面列出的是你已经学过的: @@ -557,11 +549,11 @@ C-x 1 关掉其它所有窗格,只保留一个。 C-x u 撤销。 -用命令名扩展的命令通常并不常用,或只用在部分模式下。比如 replace-string -(字符串替换)这个命令,它会在全文范围内把一个字符串替换成另一个。在输 -入 M-x 之后,Emacs 会在屏幕底端向你询问并等待你输入命令名。如果你想输入 -“replace-string”,其实只需要敲“repl s”就行了,Emacs 会帮你自动 -补齐。输入完之后按 。 +用命令名扩展的命令通常并不常用,或只用在部分模式下。比如 +replace-string(字符串替换)这个命令,它会把一个字符串替换成另一个。在 +输入 M-x 之后,Emacs 会在屏幕底端向你询问并等待你输入命令名。如果你想 +输入“replace-string”,其实只需要敲“repl s”就行了,Emacs 会帮你自 +动补齐。输入完之后按 提交。 字符串替换命令需要两个参数――被替换的字符串和用来替换它的字符串。每个 参数的输入都以换行符来结束。 @@ -586,8 +578,8 @@ “#hello.c#”。这个文件会在正常存盘之后被 Emacs 删除。 所以,假如不幸真的发生了,你大可以从容地打开原来的文件(注意不是自动保 -存文件)然后输入 M-x recover file 来恢复你的自动保存文件。在提 -示确认的时候,输入 yes。 +存文件)然后输入 M-x recover file 来恢复你的自动保存文件。在 +提示确认的时候,输入 yes。 * 回显区(ECHO AREA) @@ -602,7 +594,7 @@ 位于回显区正上方的一行被称为“状态栏”。状态栏上会显示一些信息,比如: ---:** TUTORIAL.cn (Fundamental)--L670--54%---------------- + -:**- TUTORIAL.cn 63% L749 (Fundamental) 状态栏显示了 Emacs 的状态和你正在编辑的文字的一些信息。 @@ -631,7 +623,7 @@ 编辑自然语言文本――比如现在――应该用 Text 模式。 ->> 输入 M-x text mode。 +>> 输入 M-x text-mode 。 别担心,什么都没变。不过细心一些可以发现,M-f 和 M-b 现在把单引号(') 视为词的一部分了。而在先前的 Fundamental 模式中,M-f 和 M-b 都将单引号 @@ -643,7 +635,8 @@ 用 C-h m 可以查看当前主模式的文档。 ->> 用 C-u C-v 将本行带到屏幕的最上方。 +>> 把光标移动到下一行。 +>> 用 C-l C-l 将本行带到屏幕的最上方。 >> 输入 C-h m,看看 Text 模式与 Fundamental 模式有哪些不同。 >> 输入 C-x 1 关掉文档窗格。 @@ -655,12 +648,12 @@ 有一个叫做自动折行(Auto Fill)的辅模式很有用,特别是在编辑自然语言文本 的时候。启用自动折行后,Emacs 会在你打字超出一行边界时自动替你换行。 -用 M-x auto fill mode 启动自动折行模式。再用一次这条命令,自动 -折行模式会被关闭。也就是说,如果自动折行模式没有被开启,这个命令会开启 -它;如果已经开启了,这个命令会关闭它。所以我们说,这个命令可以用来“开 -关(toggle)”模式。 +用 M-x auto-fill-mode 启动自动折行模式。再用一次这条命令,自 +动折行模式会被关闭。也就是说,如果自动折行模式没有被开启,这个命令会开 +启它;如果已经开启了,这个命令会关闭它。所以我们说,这个命令可以用来 +“开关(toggle)”模式。 ->> 现在输入 M-x auto fill mode。然后随便敲点什么,直到你看到它 +>> 现在输入 M-x auto-fill-mode 。然后随便敲点什么,直到你看到它 分成两行。你必须敲一些空格,因为 Auto Fill 只在空白处进行断行。 【输入空格对英文来说是必须的,而对中文则不必。】 @@ -680,12 +673,11 @@ * 搜索(SEARCHING) ------------------- -Emacs 可以向前或向后搜索字符串。搜索命令是一个移动光标的命令:搜索成功 -后,光标会停留在搜索目标出现的地方。 +Emacs 可以向前或向后搜索字符串(“字符串”指的是一组连续的字符)。搜索命 +令是一个移动光标的命令:搜索成功后,光标会停留在搜索目标出现的地方。 -Emacs 的搜索命令的独特之处在于,它是“渐进的(incremental)”。意思是搜 -索与输入同时进行:你在键盘上一字一句地输入搜索词的过程中,Emacs 就已经 -开始替你搜索了。 +Emacs 的搜索命令是“渐进的(incremental)”。意思是搜索与输入同时进行: +你在键盘上一字一句地输入搜索词的过程中,Emacs 就已经开始替你搜索了。 C-s 是向前搜索,C-r 是向后搜索。不过手别这么快!别着急试。 @@ -696,7 +688,7 @@ 慢慢输入“cursor”这个词,每敲一个字都停顿一下并观察光标。 现在你应该已曾经找到“cursor”这个词了。 >> 再按一次 C-s,搜索下一个“cursor”出现的位置。 ->> 现在按四次退格键,看看光标是如何移动的。 +>> 现在按四次 ,看看光标是如何移动的。 >> 敲 结束搜索。 看仔细了么?在一次渐进式搜索中,Emacs 会尝试跳到搜索目标出现的位置。要 @@ -705,19 +697,14 @@ 现 C-g 会让光标回到搜索开始的位置,而 则让光标留在搜索结果上, 这是很有用的功能。】 -注意:在某些终端下,输入 C-x C-s 会冻结屏幕【屏幕没有任何输出】,使你看 -不到 Emacs 的任何变化。其原因是操作系统的“流量控制”功能拦截了 C-s 并 -冻结了屏幕。用 C-q 可以解除屏幕冻结。要解决这个问题,请参考 Emacs 手册 -里的“Spontaneous Entry to Incremental Search”一节【Emacs 手册可能还没 -有中文翻译】,那里提供了一些有用的建议。 - -在渐进式搜索中,按退格键会删除目标字符串的最后一个字符,并且光标会回到 -最近一次搜索的命中位置。比如你已经输入了“c”,光标就停在“c”第一次出 -现的位置,再输入“u”,光标停在“cu”第一次出现的位置,这时再按退格键, -“u”就从搜索字串中消失了,然后光标会回到“c”第一次出现的位置。 - -另外,如果你在搜索的时候输入了 CONTROL 或者 META 组合键的话,搜索可能会 -结束。(也有例外,比如 C-s 和 M-r 这些用于搜索的命令。) +在渐进式搜索中,按 会“撤回”到最近一次搜索的命中位置。如果之前没 +有一个命中, 会抹去搜索字符串中的最后一个字符。比如你已经输入了 +“c”,光标就停在“c”第一次出现的位置,再输入“u”,光标停在“cu”第一次出现 +的位置,这时再按 ,“u”就从搜索字串中消失了,然后光标会回到“c”第 +一次出现的位置。 + +另外,如果你在搜索的时候输入了 control 或者 meta 组合键的话,搜索可能会 +结束。(也有例外,比如 C-s 和 C-r 这些用于搜索的命令。) 前面说的都是“向下”搜索,如果想“向上”搜索,可以用 C-r。C-r 与 C-s 相比除了搜索方向相反之外,其余的操作都一样。 @@ -728,7 +715,7 @@ Emacs 的迷人之处很多,能够在屏幕上同时显示多个窗格就是其中之一。 ->> 移动光标到这一行,然后输入 C-u 0 C-l。 +>> 移动光标到这一行,然后输入 C-l C-l。 >> 现在输入 C-x 2,它会将屏幕划分成两个窗格。 这两个窗格里显示的都是本篇快速指南,而光标则停留在上方的窗格里。 @@ -746,18 +733,17 @@ >> 再输入 C-x o 将光标移回到上方的窗格里。 光标会回到它在上方窗格中原本所在的位置。 -连续使用 C-x o 可以遍历所有窗格。每一个窗格都有它自己的光标位置,但是只 -有一个窗格会真正显示这个光标。【其它窗格在控制台下不会显示光标,在图形 -窗口下缺省显示为镂空光标。】一般所有的编辑命令都作用于这个光标所在的窗 -格,我们称这个窗格为“被选中的窗格”。 +连续使用 C-x o 可以遍历所有窗格。“被选中的窗格”,也就是绝大多数的编辑 +操作所发生的地方,是在你不打字时闪烁光标的那个窗格。其他的窗格有它们自 +己的光标位置; 如果你在图形界面下运行 Emacs ,这些光标是镂空的长方形。 当你在一个窗格中编辑,但用另一个窗格作为参考的时候,C-M-v 是很有用的命 -令。你可以始终处于编辑窗格中,然后用 C-M-v 命令滚动另外一个窗格。【比如 -翻译和校对就很适合用这种方式进行。】 +令。无需离开被选中的窗格,你就可以用 C-M-v 命令滚动另外一个窗格中的文 +字。【比如翻译和校对就很适合用这种方式进行。】 -C-M-v 是一个 CONTROL-META 组合键。如果你有 META 键的话,可以同时按住 -CONTROL 和 META 键并输入 v。CONTROL 和 META 键先按哪个都可以,因为它们 -只是用来“修饰(modify)”你输入的字符的。 +C-M-v 是一个 CONTROL-META 组合键。如果你有 META (或 Alt)键的话,可以 +同时按住CONTROL 和 META 键并输入 v。CONTROL 和 META 键先按哪个都可以, +因为它们只是用来“修饰(modify)”你输入的字符的。 如果你并没有 META 键,你也可以用 ESC 来代替,不过这样的话就要注意按键顺 序了:你必须先输入 ESC ,然后再输入 CONTROL-v。CONTROL-ESC v 是没用的, @@ -779,6 +765,26 @@ >> 输入 C-x o 回到上方的窗格,然后再用 C-x 1 关掉下方窗格。 +* 多窗口(MULTIPLE FRAMES) +------------------ + +Emacs 可以创建多个窗口。窗口由许多窗格以及菜单、滚动条、回显区等组成。 +在图形界面下,多个窗口可以同时显示出来。在文本终端中,只能同时显示一个 +窗口。 + +>> 输入 M-x make-frame 。 + 可以看到一个新的窗口出现在了你的屏幕上。 + +你可以在新的窗口里做最初的窗口里可以做的任何事情。第一个窗口没有什么特 +别的。 + +>> 输入 M-x delete-frame . + 这个命令将会关闭选中的窗口。 + +你也可以通过图形系统来关闭某个窗口(通常是在窗口上面的某个角落里的一个 +“X”按钮)。如果你关闭的是 Emacs 进程的最后一个窗口, Emacs 将会退出。 + + * 递归编辑(RECURSIVE EDITING LEVELS) -------------------------------------- @@ -810,9 +816,7 @@ 么帮助。如果你连自己到底需要什么帮助都不知道,那么就输入 C-h ?,Emacs 会告诉你它能提供了哪些帮助。如果你按了 C-h 又想反悔,可以用 C-g 取消。 -(有些主机改变了 C-h 的意义,这种以己度人外加一刀切的做法确实不太好,不 -过倒是让你可以义正辞严地抱怨他们的系统管理员。话说回来,如果你按 C-h 之 -后没有任何帮助信息显示出来,那么试试 F1 键或者 M-x help 。) +(如果你按 C-h 之后没有任何帮助信息显示出来,那么试试 F1 键或者 M-x help 。) 最基本的帮助功能是 C-h c。输入 C-h c 之后再输入一个组合键,Emacs 会给出 这个命令的简要说明。 @@ -823,9 +827,9 @@ C-p runs the command previous-line -这条消息显示了 C-p 命令对应的函数名,函数名主要用来定制和扩展 Emacs。命 -令的功能由函数完成,所以函数名本身也可以被看成是最简单的文档――至少对 -于你已经学过的命令来说,它们的函数名足以解释它们的功能了。 +这条消息显示了 C-p 命令对应的函数名。命令的功能由函数完成,所以函数名 +本身也可以被看成是最简单的文档――至少对于你已经学过的命令来说,它们的函 +数名足以解释它们的功能了。 多字符命令一样可以用 C-h c 来查看。 @@ -841,7 +845,7 @@ C-h f 解释一个函数。需要输入函数名。 ->> 试试看,输入 C-h f previous-line。 +>> 试试看,输入 C-h f previous-line 。 Emacs 会给出它所知道的所有有关“实现 C-p 命令功能的函数”的信息。 C-h v 用来显示 Emacs 变量的文档。Emacs 变量可以被用来“定制 Emacs 的行 @@ -852,7 +856,7 @@ 的命令。这些命令全都可以用 M-x 来启动。对于某些命令来说, 相关命令搜索还会列出一两个组合键。 ->> 输入 C-h a file。 +>> 输入 C-h a file 。 Emacs 会在另一个窗格里显示一个 M-x 命令列表,这个列表包含了所有名称中含 有“file”的命令。你可以看到像“C-x C-f”这样的组合键显示在“find-file” @@ -862,7 +866,7 @@ >> 输入 C-x 1 来删除 help 窗格。 - C-h i 阅读联机手册(也就是通常讲的 Info)。 + C-h i 阅读手册(也就是通常讲的 Info)。 这个命令会打开一个称为“*info*”的特殊缓冲区,在那里, 你可以阅读安装在系统里的软件包使用手册。要读 Emacs 的使 用手册,按 m emacs 就可以了。如果你之前从没用 @@ -875,18 +879,19 @@ --------------------------- 想学习更多的使用技巧,Emacs 使用手册(manual)值得一读。你可以读纸版的 -书,也可以看电子版的联机手册(可以从 Help 菜单进入或者按 F10 h r)。提 -两个你可能会很感兴趣的功能吧,一个是可以帮你少敲键盘的 completion(自动 -补全),另一个是方便文件处理的 dired(目录编辑)。 +书,也可以在 Emacs 中读(可以从 Help 菜单进入或者按 C-h r)。提两个你 +可能会很感兴趣的功能吧,一个是可以帮你少敲键盘的 completion(自动补全), +另一个是方便文件处理的 dired(目录编辑)。 Completion 可以替你节省不必要的键盘输入。比如说你想切换到 *Message* 缓 冲区,你就可以用 C-x b *M 来完成。只要 Emacs 能够根据你已经输入的 -文字确定你想要输入的内容,它就会自动帮你补齐。有关 Completion 的详细说 -明可以在 Emacs Info 中的“Completion”一节里找到。 +文字确定你想要输入的内容,它就会自动帮你补齐。Completion 也可用于命令 +名和文件名。有关 Completion 的详细说明可以在 Emacs Info 中的 +“Completion”一节里找到。 Dired 能够在一个缓冲区里列出一个目录下的所有文件(可以选择是否也列出子 目录),然后你可以在这个文件列表上完成对文件的移动、访问、重命名或删除 -等等操作。Dired 也在 Emacs Info 中有详细介绍,参见“Dired”一节。 +等等操作。Dired 也在 Emacs 使用手册中有详细介绍,参见“Dired”一节。 Emacs 使用手册里还有许许多多的精彩功能等着你来了解。 @@ -894,8 +899,7 @@ * 总结(CONCLUSION) -------------------- -记住,要退出 Emacs 请用 C-x C-c。要暂时切换到 shell 并且稍后再回到 -Emacs 里来,请用 C-z。【切换到 shell 仅对控制台下的 Emacs 有效】 +要退出 Emacs 请用 C-x C-c。 本文完全是为零起点新手所写的起步教程。如果你觉得哪里还看不明白,千万不 要怀疑自己,那一定是我们没有写好。我们永远欢迎你的不满和抱怨。 @@ -905,6 +909,7 @@ --------------------- 翻译:孙一江 +维护:薛富侨 校对:水木社区(www.newsmth.net)Emacs 板众多网友及众多 Emacs 中文用户 Emacs 快速指南(Tutorial)早有两个刘昭宏的中文译本,繁简各一。其简体版本 @@ -915,11 +920,11 @@ 的译文质量很高,在翻译过程中给予过我们许多借鉴和参考,在此对刘昭宏的工作 表示感谢。 -翻译过程中最大的挑战莫过于术语译词的选择了。经过水木社区 Emacs 板热心网 -友小范围内的讨论,我们选择了现在的译法。用户的广泛参与是自由软件生命力 -的源泉,所以如果你有任何建议、勘误或想法,请用你喜欢的方式向我们提出。 -你可以通过电子邮件直接联系译者,也可以放到 GNU Emacs 的开发邮件列表或者 -水木社区的 Emacs 板上进行讨论。 +翻译过程中最大的挑战莫过于术语译词的选择了。经过水木社区 Emacs 板热心 +网友小范围内的讨论,我们选择了现在的译法。用户的广泛参与是自由软件生命 +力的源泉,所以如果你有任何建议、勘误或想法,请用你喜欢的方式向我们提出。 +你可以通过电子邮件直接联系维护者,也可以放到 GNU Emacs 的开发邮件列表 +或者水木社区的 Emacs 板上进行讨论。 下面列出主要术语的译词对照,并给出注释说明: @@ -941,6 +946,8 @@ search 搜索 incremental search 渐进式搜索 [3] +对于其他没有提到的术语,读者可以参考 Emacs 使用手册里的术语表。 + [1] “window”一词在计算机相关的领域一般都被译为“窗口”。但是在 Emacs 中,还有一个“frame”的概念。在被广泛使用的 X 窗口系统和微软的视窗 (Windows)系列操作系统中,Emacs 的一个“frame”就是一个“窗口”,因 @@ -977,46 +984,56 @@ This tutorial descends from a long line of Emacs tutorials starting with the one written by Stuart Cracraft for the original Emacs. -This version of the tutorial, like GNU Emacs, is copyrighted, and -comes with permission to distribute copies on certain conditions: - -Copyright (C) 1985, 1996, 1998, 2001-2013 Free Software Foundation, Inc. - - Permission is granted to anyone to make or distribute verbatim copies - of this document as received, in any medium, provided that the - copyright notice and permission notice are preserved, - and that the distributor grants the recipient permission - for further redistribution as permitted by this notice. - - Permission is granted to distribute modified versions - of this document, or of portions of it, - under the above conditions, provided also that they - carry prominent notices stating who last altered them. - -The conditions for copying Emacs itself are more complex, but in the -same spirit. Please read the file COPYING and then do give copies of -GNU Emacs to your friends. Help stamp out software obstructionism -("ownership") by using, writing, and sharing free software! +This version of the tutorial is a part of GNU Emacs. It is copyrighted +and comes with permission to distribute copies on certain conditions: + + Copyright (C) 1985, 1996, 1998, 2001-2013 Free Software Foundation, + Inc. + + This file is part of GNU Emacs. + + GNU Emacs is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GNU Emacs is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Emacs. If not, see . + +Please read the file COPYING and then do give copies of GNU Emacs to +your friends. Help stamp out software obstructionism ("ownership") by +using, writing, and sharing free software! 【下面为版权声明的译文,仅供参考。实际法律效力以英文原文为准。】 本快速指南沿袭自历史悠久的 Emacs 快速指南,可上溯至 Stuart Cracraft 为最 初的 Emacs 所作的版本。 -本篇文档与 GNU Emacs 一样拥有版权,并允许在下列条件的约束下发行其拷贝: - - Copyright (C) 1985, 1996, 1998, 2001-2013 Free Software Foundation, Inc. - - 本文档允许在不变更文档内容的情况下由任何人发布在任何媒体上,同时必须 - 完整保留版权和许可声明,且需给予受众与发行者完全相同的、如本声明所允 - 许的再次发行本文档的权利。 - - 本声明允许在与上述条件相同的情况下发布经过修改的全部或部分文档,同时 - 必须附带显要的文字以申明文档的最后修改者。 - -Emacs 自身的版权问题虽比本文档要复杂一些,但也基于相同的精神。敬请阅读文 -件“COPYING”,然后向你的朋友们分发 GNU Emacs 拷贝。让我们以使用、编写和 -分享自由软件的实际行动来共同祛除软件障碍主义(所谓的“所有权”)! +本篇指南是 GNU Emacs 的一部分,并允许在下列条件的约束下发行其拷贝: + + Copyright (C) 1985, 1996, 1998, 2001-2013 Free Software Foundation, + Inc. + + 本文件为 GNU Emacs 的一部分。 + + GNU Emacs 为自由软件;您可依据自由软件基金会所发表的GNU通用公共授权 + 条款,对本程序再次发布和/或修改;无论您依据的是本授权的第三版,或 + (您可选的)任一日后发行的版本。 + + GNU Emacs 是基于使用目的而加以发布,然而不负任何担保责任;亦无对适 + 售性或特定目的适用性所为的默示性担保。详情请参照GNU通用公共授权。 + + 您应已收到附随于 GNU Emacs 的GNU通用公共授权的副本;如果没有,请参照 + . + +敬请阅读文件“COPYING”,然后向你的朋友们分发 GNU Emacs 拷贝。让我们以使 +用、编写和分享自由软件的实际行动来共同祛除软件障碍主义(所谓的“所有 +权”)! ;;; Local Variables: ;;; coding: utf-8 ------------------------------------------------------------ revno: 113653 fixes bug: http://debbugs.gnu.org/15005 committer: Jan D. branch nick: trunk timestamp: Fri 2013-08-02 11:42:23 +0200 message: * nsterm.h (EmacsView): Add maximizing_resize, put it and old_title inside NS_IMPL_COCOA. * nsterm.m (windowWillResize:toSize:): Only change title if ! maximizing_resize && FULLSCREEN_NONE. strdup title before modifying it. (viewDidEndLiveResize): New method. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-08-02 07:07:08 +0000 +++ src/ChangeLog 2013-08-02 09:42:23 +0000 @@ -1,3 +1,13 @@ +2013-08-02 Jan Djärv + + * nsterm.m (windowWillResize:toSize:): Only change title if + ! maximizing_resize && FULLSCREEN_NONE (Bug#15005). strdup title before + modifying it. + (viewDidEndLiveResize): New method. + + * nsterm.h (EmacsView): Add maximizing_resize, put it and old_title + inside NS_IMPL_COCOA. + 2013-08-02 Dmitry Antipov * insdel.c (adjust_after_replace, replace_range, del_range_2): === modified file 'src/nsterm.h' --- src/nsterm.h 2013-07-06 17:58:41 +0000 +++ src/nsterm.h 2013-08-02 09:42:23 +0000 @@ -109,7 +109,10 @@ @interface EmacsView : NSView #endif { +#ifdef NS_IMPL_COCOA char *old_title; + BOOL maximizing_resize; +#endif BOOL windowClosing; NSString *workingText; BOOL processingCompose; === modified file 'src/nsterm.m' --- src/nsterm.m 2013-08-01 14:54:29 +0000 +++ src/nsterm.m 2013-08-02 09:42:23 +0000 @@ -5663,17 +5663,17 @@ old_title = 0; } } - else + else if (fs_state == FULLSCREEN_NONE && ! maximizing_resize) { char *size_title; NSWindow *window = [self window]; if (old_title == 0) { - const char *t = [[[self window] title] UTF8String]; + char *t = strdup ([[[self window] title] UTF8String]); char *pos = strstr (t, " — "); if (pos) *pos = '\0'; - old_title = xstrdup (t); + old_title = t; } size_title = xmalloc (strlen (old_title) + 40); esprintf (size_title, "%s — (%d x %d)", old_title, cols, rows); @@ -5712,22 +5712,28 @@ NSTRACE (windowDidResize); /*fprintf (stderr,"windowDidResize: %.0f\n",[theWindow frame].size.height); */ +if (cols > 0 && rows > 0) + { + [self updateFrameSize: YES]; + } + + ns_send_appdefined (-1); +} + #ifdef NS_IMPL_COCOA +- (void)viewDidEndLiveResize +{ + [super viewDidEndLiveResize]; if (old_title != 0) { + [[self window] setTitle: [NSString stringWithUTF8String: old_title]]; xfree (old_title); old_title = 0; } + maximizing_resize = NO; +} #endif /* NS_IMPL_COCOA */ - if (cols > 0 && rows > 0) - { - [self updateFrameSize: YES]; - } - - ns_send_appdefined (-1); -} - - (void)windowDidBecomeKey: (NSNotification *)notification /* cf. x_detect_focus_change(), x_focus_changed(), x_new_focus_frame() */ @@ -5831,7 +5837,10 @@ FRAME_NS_VIEW (f) = self; emacsframe = f; +#ifdef NS_IMPL_COCOA old_title = 0; + maximizing_resize = NO; +#endif win = [[EmacsWindow alloc] initWithContentRect: r @@ -5974,6 +5983,9 @@ maximized_width = -1; result.origin.y = defaultFrame.origin.y; [self setFSValue: FULLSCREEN_HEIGHT]; +#ifdef NS_IMPL_COCOA + maximizing_resize = YES; +#endif } else if (next_maximized == FULLSCREEN_WIDTH) { @@ -5992,12 +6004,18 @@ maximized_width = result.size.width; maximized_height = result.size.height; [self setFSValue: FULLSCREEN_MAXIMIZED]; +#ifdef NS_IMPL_COCOA + maximizing_resize = YES; +#endif } else { /* restore */ result = ns_userRect.size.height ? ns_userRect : result; ns_userRect = NSMakeRect (0, 0, 0, 0); +#ifdef NS_IMPL_COCOA + maximizing_resize = fs_state != FULLSCREEN_NONE; +#endif [self setFSValue: FULLSCREEN_NONE]; maximized_width = maximized_height = -1; } ------------------------------------------------------------ revno: 113652 committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2013-08-02 08:36:15 +0000 message: lisp/gnus/rfc2047.el (rfc2047-encode-message-header): Unify charsets into a single one used for encoding the whole text in a header diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2013-08-02 00:50:14 +0000 +++ lisp/gnus/ChangeLog 2013-08-02 08:36:15 +0000 @@ -1,3 +1,8 @@ +2013-08-02 Katsumi Yamaoka + + * rfc2047.el (rfc2047-encode-message-header): Unify charsets into + a single one used for encoding the whole text in a header. + 2013-08-01 Lars Magne Ingebrigtsen * message.el (message-ignored-news-headers): Delete X-Gnus-Delayed === modified file 'lisp/gnus/rfc2047.el' --- lisp/gnus/rfc2047.el 2013-01-01 09:11:05 +0000 +++ lisp/gnus/rfc2047.el 2013-08-02 08:36:15 +0000 @@ -235,85 +235,96 @@ (interactive "*") (save-excursion (goto-char (point-min)) - (let (alist elem method) + (let (alist elem method charsets) (while (not (eobp)) (save-restriction (rfc2047-narrow-to-field) (setq method nil - alist rfc2047-header-encoding-alist) - (while (setq elem (pop alist)) - (when (or (and (stringp (car elem)) - (looking-at (car elem))) - (eq (car elem) t)) - (setq alist nil - method (cdr elem)))) - (if (not (rfc2047-encodable-p)) - (prog2 - (when (eq method 'address-mime) - (rfc2047-quote-special-characters-in-quoted-strings)) - (if (and (eq (mm-body-7-or-8) '8bit) - (mm-multibyte-p) - (mm-coding-system-p - (car message-posting-charset))) - ;; 8 bit must be decoded. - (mm-encode-coding-region - (point-min) (point-max) - (mm-charset-to-coding-system - (car message-posting-charset)))) - ;; No encoding necessary, but folding is nice - (when nil - (rfc2047-fold-region - (save-excursion - (goto-char (point-min)) - (skip-chars-forward "^:") - (when (looking-at ": ") - (forward-char 2)) - (point)) - (point-max)))) - ;; We found something that may perhaps be encoded. - (re-search-forward "^[^:]+: *" nil t) - (cond - ((eq method 'address-mime) - (rfc2047-encode-region (point) (point-max))) - ((eq method 'mime) - (let ((rfc2047-encoding-type 'mime)) - (rfc2047-encode-region (point) (point-max)))) - ((eq method 'default) - (if (and (featurep 'mule) - (if (boundp 'enable-multibyte-characters) - (default-value 'enable-multibyte-characters)) - mail-parse-charset) - (mm-encode-coding-region (point) (point-max) - mail-parse-charset))) - ;; We get this when CC'ing messages to newsgroups with - ;; 8-bit names. The group name mail copy just got - ;; unconditionally encoded. Previously, it would ask - ;; whether to encode, which was quite confusing for the - ;; user. If the new behavior is wrong, tell me. I have - ;; left the old code commented out below. - ;; -- Per Abrahamsen Date: 2001-10-07. - ;; Modified by Dave Love, with the commented-out code changed - ;; in accordance with changes elsewhere. - ((null method) - (rfc2047-encode-region (point) (point-max))) -;;; ((null method) -;;; (if (or (message-options-get -;;; 'rfc2047-encode-message-header-encode-any) -;;; (message-options-set -;;; 'rfc2047-encode-message-header-encode-any -;;; (y-or-n-p -;;; "Some texts are not encoded. Encode anyway?"))) -;;; (rfc2047-encode-region (point-min) (point-max)) -;;; (error "Cannot send unencoded text"))) - ((mm-coding-system-p method) - (if (or (and (featurep 'mule) - (if (boundp 'enable-multibyte-characters) - (default-value 'enable-multibyte-characters))) - (featurep 'file-coding)) - (mm-encode-coding-region (point) (point-max) method))) - ;; Hm. - (t))) - (goto-char (point-max))))))) + alist rfc2047-header-encoding-alist + charsets (mm-find-mime-charset-region (point-min) (point-max))) + ;; M$ Outlook boycotts decoding of a header if it consists + ;; of two or more encoded words and those charsets differ; + ;; it seems to decode all words in a header from a charset + ;; found first in the header. So, we unify the charsets into + ;; a single one used for encoding the whole text in a header. + (let ((mm-coding-system-priorities + (if (= (length charsets) 1) + (cons (mm-charset-to-coding-system (car charsets)) + mm-coding-system-priorities) + mm-coding-system-priorities))) + (while (setq elem (pop alist)) + (when (or (and (stringp (car elem)) + (looking-at (car elem))) + (eq (car elem) t)) + (setq alist nil + method (cdr elem)))) + (if (not (rfc2047-encodable-p)) + (prog2 + (when (eq method 'address-mime) + (rfc2047-quote-special-characters-in-quoted-strings)) + (if (and (eq (mm-body-7-or-8) '8bit) + (mm-multibyte-p) + (mm-coding-system-p + (car message-posting-charset))) + ;; 8 bit must be decoded. + (mm-encode-coding-region + (point-min) (point-max) + (mm-charset-to-coding-system + (car message-posting-charset)))) + ;; No encoding necessary, but folding is nice + (when nil + (rfc2047-fold-region + (save-excursion + (goto-char (point-min)) + (skip-chars-forward "^:") + (when (looking-at ": ") + (forward-char 2)) + (point)) + (point-max)))) + ;; We found something that may perhaps be encoded. + (re-search-forward "^[^:]+: *" nil t) + (cond + ((eq method 'address-mime) + (rfc2047-encode-region (point) (point-max))) + ((eq method 'mime) + (let ((rfc2047-encoding-type 'mime)) + (rfc2047-encode-region (point) (point-max)))) + ((eq method 'default) + (if (and (featurep 'mule) + (if (boundp 'enable-multibyte-characters) + (default-value 'enable-multibyte-characters)) + mail-parse-charset) + (mm-encode-coding-region (point) (point-max) + mail-parse-charset))) + ;; We get this when CC'ing messages to newsgroups with + ;; 8-bit names. The group name mail copy just got + ;; unconditionally encoded. Previously, it would ask + ;; whether to encode, which was quite confusing for the + ;; user. If the new behavior is wrong, tell me. I have + ;; left the old code commented out below. + ;; -- Per Abrahamsen Date: 2001-10-07. + ;; Modified by Dave Love, with the commented-out code changed + ;; in accordance with changes elsewhere. + ((null method) + (rfc2047-encode-region (point) (point-max))) +;;; ((null method) +;;; (if (or (message-options-get +;;; 'rfc2047-encode-message-header-encode-any) +;;; (message-options-set +;;; 'rfc2047-encode-message-header-encode-any +;;; (y-or-n-p +;;; "Some texts are not encoded. Encode anyway?"))) +;;; (rfc2047-encode-region (point-min) (point-max)) +;;; (error "Cannot send unencoded text"))) + ((mm-coding-system-p method) + (if (or (and (featurep 'mule) + (if (boundp 'enable-multibyte-characters) + (default-value 'enable-multibyte-characters))) + (featurep 'file-coding)) + (mm-encode-coding-region (point) (point-max) method))) + ;; Hm. + (t))) + (goto-char (point-max)))))))) ;; Fixme: This, and the require below may not be the Right Thing, but ;; should be safe just before release. -- fx 2001-02-08 ------------------------------------------------------------ revno: 113651 committer: Dmitry Antipov branch nick: trunk timestamp: Fri 2013-08-02 12:32:32 +0400 message: Fix last change. diff: === modified file 'src/insdel.c' --- src/insdel.c 2013-08-02 07:07:08 +0000 +++ src/insdel.c 2013-08-02 08:32:32 +0000 @@ -1374,8 +1374,11 @@ the deletion will be undone first. Thus, undo will insert before deleting, and thus will keep the markers before and after this text separate. */ - record_insert (from + SCHARS (deletion), inschars); - record_delete (from, deletion); + if (!NILP (deletion)) + { + record_insert (from + SCHARS (deletion), inschars); + record_delete (from, deletion); + } GAP_SIZE -= outgoing_insbytes; GPT += inschars; ------------------------------------------------------------ revno: 113650 committer: Dmitry Antipov branch nick: trunk timestamp: Fri 2013-08-02 11:07:08 +0400 message: * insdel.c (adjust_after_replace, replace_range, del_range_2): Do not check whether undo is enabled because record_insert and record_delete does that themselves. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-08-02 04:21:51 +0000 +++ src/ChangeLog 2013-08-02 07:07:08 +0000 @@ -1,5 +1,11 @@ 2013-08-02 Dmitry Antipov + * insdel.c (adjust_after_replace, replace_range, del_range_2): + Do not check whether undo is enabled because record_insert and + record_delete does that themselves. + +2013-08-02 Dmitry Antipov + * xterm.h (struct x_output) [HAVE_X_I18N]: Remove xic_base_fontname member which is not really used any more. (FRAME_XIC_BASE_FONTNAME): Remove. === modified file 'src/insdel.c' --- src/insdel.c 2013-07-16 21:35:45 +0000 +++ src/insdel.c 2013-08-02 07:07:08 +0000 @@ -1211,12 +1211,9 @@ adjust_markers_for_insert (from, from_byte, from + len, from_byte + len_byte, 0); - if (! EQ (BVAR (current_buffer, undo_list), Qt)) - { - if (nchars_del > 0) - record_delete (from, prev_text); - record_insert (from, len); - } + if (nchars_del > 0) + record_delete (from, prev_text); + record_insert (from, len); if (len > nchars_del) adjust_overlays_for_insert (from, len - nchars_del); @@ -1373,15 +1370,12 @@ emacs_abort (); #endif - if (! EQ (BVAR (current_buffer, undo_list), Qt)) - { - /* Record the insertion first, so that when we undo, - the deletion will be undone first. Thus, undo - will insert before deleting, and thus will keep - the markers before and after this text separate. */ - record_insert (from + SCHARS (deletion), inschars); - record_delete (from, deletion); - } + /* Record the insertion first, so that when we undo, + the deletion will be undone first. Thus, undo + will insert before deleting, and thus will keep + the markers before and after this text separate. */ + record_insert (from + SCHARS (deletion), inschars); + record_delete (from, deletion); GAP_SIZE -= outgoing_insbytes; GPT += inschars; @@ -1718,8 +1712,7 @@ so that undo handles this after reinserting the text. */ adjust_markers_for_delete (from, from_byte, to, to_byte); - if (! EQ (BVAR (current_buffer, undo_list), Qt)) - record_delete (from, deletion); + record_delete (from, deletion); MODIFF++; CHARS_MODIFF = MODIFF; ------------------------------------------------------------ revno: 113649 committer: Xue Fuqiao branch nick: trunk timestamp: Fri 2013-08-02 14:59:25 +0800 message: * etc/tutorials/TUTORIAL.translators (Maintainer): Update the maintainer. * lisp/mh-e/mh-e.el: Add a FIXME. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2013-08-02 03:44:59 +0000 +++ etc/ChangeLog 2013-08-02 06:59:25 +0000 @@ -1,3 +1,7 @@ +2013-08-02 Xue Fuqiao + + * tutorials/TUTORIAL.translators (Maintainer): Update the maintainer. + 2013-08-02 Juanma Barranquero * tutorials/TUTORIAL.es: Fix typos (bug#15000). === modified file 'etc/tutorials/TUTORIAL.translators' --- etc/tutorials/TUTORIAL.translators 2012-01-21 14:58:38 +0000 +++ etc/tutorials/TUTORIAL.translators 2013-08-02 06:59:25 +0000 @@ -7,7 +7,7 @@ * TUTORIAL.cn: Author: Sun Yijiang -Maintainer: Sun Yijiang +Maintainer: Xue Fuqiao * TUTORIAL.cs: Author: Milan Zamazal === modified file 'lisp/mh-e/mh-e.el' --- lisp/mh-e/mh-e.el 2013-05-09 01:40:20 +0000 +++ lisp/mh-e/mh-e.el 2013-08-02 06:59:25 +0000 @@ -1019,6 +1019,7 @@ (when delete-other-windows-flag (delete-other-windows))) +;; FIXME: Maybe out of date? --xfq (if (boundp 'customize-package-emacs-version-alist) (add-to-list 'customize-package-emacs-version-alist '(MH-E ("6.0" . "22.1") ("6.1" . "22.1") ("7.0" . "22.1")