commit b995b4ae8f9e08719a92bbe3bd6ac7e8ff091309 (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Sun Jan 11 01:18:15 2015 -0800 Default to 'configure --enable-silent-rules' This greatly shortens the 'make' output, making it more readable and useful. For example, on my platform it shortens a 4125-character line "gcc -std=gnu99 -c -Demacs -I. -I. -I../lib ... emacs.c" -- a line so long that it's hard to see what's going on or where the diagnostics are -- to just "CC emacs.o". * INSTALL: Document this. * configure.ac: Add AM_SILENT_RULES([yes]). (AM_DEFAULT_VERBOSITY): Remove now-unnecessary initialization. * etc/NEWS: Document this. Fixes: bug#19501 diff --git a/ChangeLog b/ChangeLog index ceceb68..cca9100 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2015-01-11 Paul Eggert + + Default to 'configure --enable-silent-rules' + This greatly shortens the 'make' output, making it more readable + and useful. For example, on my platform it shortens a + 4125-character line "gcc -std=gnu99 -c -Demacs -I. -I. -I../lib + ... emacs.c" -- a line so long that it's hard to see what's going + on or where the diagnostics are -- to just "CC emacs.o". + * INSTALL: Document this. + * configure.ac: Add AM_SILENT_RULES([yes]). + (AM_DEFAULT_VERBOSITY): Remove now-unnecessary initialization. + Fixes: bug#19501 + 2015-01-06 Paul Eggert Merge from gnulib diff --git a/INSTALL b/INSTALL index 1ed2698..5532020 100644 --- a/INSTALL +++ b/INSTALL @@ -316,10 +316,9 @@ generated warnings may still be useful, though you may prefer building with 'make WERROR_CFLAGS=' so that the warnings are not treated as errors. -Use --enable-silent-rules to cause 'make' to chatter less. This is -helpful when combined with options like --enable-gcc-warnings that -generate long shell-command lines. 'make V=0' also suppresses the -chatter. +Use --disable-silent-rules to cause 'make' to give more details about +the commands it executes. This can be helpful when debugging a build +that goes awry. 'make V=1' also enables the extra chatter. Use --enable-link-time-optimization to enable link-time optimizer. If you're using GNU compiler, this feature is supported since version 4.5.0. diff --git a/configure.ac b/configure.ac index e09b289..4cad214 100644 --- a/configure.ac +++ b/configure.ac @@ -1011,9 +1011,11 @@ if test "${enableval}" != "no"; then fi fi) +dnl Prefer silent make output. For verbose output, use +dnl 'configure --disable-silent-rules' or 'make V=1' . +AM_SILENT_RULES([yes]) dnl Port to Automake 1.11. dnl This section can be removed once we assume Automake 1.14 or later. -: ${AM_DEFAULT_VERBOSITY=1} : ${AM_V=$AM_DEFAULT_VERBOSITY} : ${AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY} AC_SUBST([AM_V]) diff --git a/etc/ChangeLog b/etc/ChangeLog index 7a27312..20f88bd 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,8 @@ +2015-01-11 Paul Eggert + + Default to 'configure --enable-silent-rules' + * NEWS: Document this. + 2015-01-10 Daniel Colascione * NEWS: Fix typo diff --git a/etc/NEWS b/etc/NEWS index 59d90ab..b3267e1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -40,8 +40,10 @@ or by sticking with Emacs 24.4. ** The configure option `--with-pkg-config-prog' has been removed. Use './configure PKG_CONFIG=/full/name/of/pkg-config' if you need to. -** The configure option '--enable-silent-rules' and the command -'make V=0' now do a better job of suppressing chatter. +** The configure option '--enable-silent-rules' is now the default, +and silent rules are now quieter. To get the old behavior where +'make' chatters a lot, configure with '--disable-silent-rules' or +build with 'make V=1'. --- ** The `grep-changelog' script (and its manual page) are no longer included. commit 6cc9ad8d246774837b95b3f01d9007f10d89c9cc Author: Paul Eggert Date: Sat Jan 10 21:50:52 2015 -0800 Spelling fixes diff --git a/lisp/international/ccl.el b/lisp/international/ccl.el index afc5196..429c14b 100644 --- a/lisp/international/ccl.el +++ b/lisp/international/ccl.el @@ -1357,10 +1357,10 @@ BRANCH := (branch EXPRESSION CCL_BLOCK_0 [CCL_BLOCK_1 ...]) ;; Execute STATEMENTs until (break) or (end) is executed. ;; Create a block of STATEMENTs for repeating. The STATEMENTs -;; are executed sequentially unitl REPEAT or BREAK is executed. +;; are executed sequentially until REPEAT or BREAK is executed. ;; If REPEAT statement is executed, STATEMENTs are executed from the ;; start again. If BREAK statements is executed, the execution -;; exits from the block. If neither REAPEAT nor BREAK is +;; exits from the block. If neither REPEAT nor BREAK is ;; executed, the execution exits from the block after executing the ;; last STATEMENT. LOOP := (loop STATEMENT [STATEMENT ...]) @@ -1516,7 +1516,7 @@ TRANSLATE := ;; respectively. ;; On encoding, the charset of highest priority is selected. ;; After the execution, DST is specified by its charset - ;; id number and codepouin in REG_1 and REG_2 respectively. + ;; id number and codepoint in REG_1 and REG_2 respectively. (translate-character REG_0 REG_1 REG_2) ;; Same as above except for SYMBOL specifying the name of @@ -1540,7 +1540,7 @@ LOOKUP := | (lookup-integer SYMBOL REG(integer)) MAP := - ;; The following statements are for internal use only. + ;; The following statements are for internal use only. (iterate-multiple-map REG REG MAP-IDs) | (map-multiple REG REG (MAP-SET)) | (map-single REG REG MAP-ID) commit 6a37ecee0884ff30ac7666e6502e2a9d2608f291 Author: Paul Eggert Date: Sat Jan 10 13:33:38 2015 -0800 Port to 32-bit --with-wide-int Prefer symbol indexes to struct Lisp_Symbol * casted and then widened, as the latter had trouble with GCC on Fedora 21 when configured --with-wide-int and when used in static initializers. * lib-src/make-docfile.c (write_globals): Define and use symbols like iQnil (a small integer, like 0) rather than aQnil (an address constant). * src/alloc.c (garbage_collect_1, which_symbols): * src/lread.c (init_obarray): Prefer builtin_lisp_symbol when it can be used. * src/dispextern.h (struct image_type.type): * src/font.c (font_property_table.key): * src/frame.c (struct frame_parm_table.sym): * src/keyboard.c (scroll_bar_parts, struct event_head): * src/xdisp.c (struct props.name): Use the index of a builtin symbol rather than its address. All uses changed. * src/lisp.h (TAG_SYMPTR, XSYMBOL_INIT): Remove, replacing with ... (TAG_SYMOFFSET, SYMBOL_INDEX): ... new macros that deal with symbol indexes rather than pointers, and which work better on MSB hosts because they shift right before tagging. All uses changed. (DEFINE_LISP_SYMBOL_BEGIN, DEFINE_LISP_SYMBOL_END): No longer noops on wide-int hosts, since they work now. (builtin_lisp_symbol): New function. diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index ec4d16a..7403596 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,5 +1,10 @@ 2015-01-10 Paul Eggert + Port to 32-bit --with-wide-int + * make-docfile.c (write_globals): Define and use symbols like + iQnil (a small integer, like 0) rather than aQnil (an address + constant). + Port to 32-bit Sun C 5.12 sparc * make-docfile.c (close_emacs_globals): Align lispsym to GCALIGNMENT. The alignment is required on all platforms; it just happens to have diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index 7c5c4bc..bc5420e 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c @@ -613,7 +613,7 @@ compare_globals (const void *a, const void *b) if (ga->type != gb->type) return ga->type - gb->type; - /* Consider "nil" to be the least, so that aQnil is firat. That + /* Consider "nil" to be the least, so that iQnil is zero. That way, Qnil's internal representation is zero, which is a bit faster. */ if (ga->type == SYMBOL) { @@ -701,9 +701,9 @@ write_globals (void) } else if (globals[i].type == SYMBOL) printf (("DEFINE_LISP_SYMBOL_BEGIN (%s)\n" - "#define a%s (&lispsym[%d])\n" - "#define %s make_lisp_symbol (a%s)\n" - "DEFINE_LISP_SYMBOL_END (a%s)\n\n"), + "#define i%s %d\n" + "#define %s builtin_lisp_symbol (i%s)\n" + "DEFINE_LISP_SYMBOL_END (%s)\n\n"), globals[i].name, globals[i].name, symnum++, globals[i].name, globals[i].name, globals[i].name); else diff --git a/src/ChangeLog b/src/ChangeLog index 39775eb..14d582d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,27 @@ 2015-01-10 Paul Eggert + Port to 32-bit --with-wide-int + Prefer symbol indexes to struct Lisp_Symbol * casted and then + widened, as the latter had trouble with GCC on Fedora 21 when + configured --with-wide-int and when used in static initializers. + * alloc.c (garbage_collect_1, which_symbols): + * lread.c (init_obarray): + Prefer builtin_lisp_symbol when it can be used. + * dispextern.h (struct image_type.type): + * font.c (font_property_table.key): + * frame.c (struct frame_parm_table.sym): + * keyboard.c (scroll_bar_parts, struct event_head): + * xdisp.c (struct props.name): + Use the index of a builtin symbol rather than its address. + All uses changed. + * lisp.h (TAG_SYMPTR, XSYMBOL_INIT): Remove, replacing with ... + (TAG_SYMOFFSET, SYMBOL_INDEX): ... new macros that deal with + symbol indexes rather than pointers, and which work better on MSB + hosts because they shift right before tagging. All uses changed. + (DEFINE_LISP_SYMBOL_BEGIN, DEFINE_LISP_SYMBOL_END): + No longer noops on wide-int hosts, since they work now. + (builtin_lisp_symbol): New function. + Port to HAVE_FREETYPE && !HAVE_XFT * dispextern.h (struct face.extra) [HAVE_FREETYPE && !HAVE_XFT]: * font.h (syms_of_xftfont) [HAVE_FREETYPE && !HAVE_XFT]: diff --git a/src/alloc.c b/src/alloc.c index 712c8f7..7c93733 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -5630,7 +5630,7 @@ garbage_collect_1 (void *end) mark_buffer (&buffer_local_symbols); for (i = 0; i < ARRAYELTS (lispsym); i++) - mark_object (make_lisp_symbol (&lispsym[i])); + mark_object (builtin_lisp_symbol (i)); for (i = 0; i < staticidx; i++) mark_object (*staticvec[i]); @@ -7019,7 +7019,7 @@ which_symbols (Lisp_Object obj, EMACS_INT find_max) { for (int i = 0; i < ARRAYELTS (lispsym); i++) { - Lisp_Object sym = make_lisp_symbol (&lispsym[i]); + Lisp_Object sym = builtin_lisp_symbol (i); if (symbol_uses_obj (sym, obj)) { found = Fcons (sym, found); diff --git a/src/dispextern.h b/src/dispextern.h index 161f252..e9e6f70 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -2906,8 +2906,8 @@ struct redisplay_interface struct image_type { - /* A symbol uniquely identifying the image type, e.g., 'jpeg'. */ - struct Lisp_Symbol *type; + /* Index of a symbol uniquely identifying the image type, e.g., 'jpeg'. */ + int type; /* Check that SPEC is a valid image specification for the given image type. Value is true if SPEC is valid. */ diff --git a/src/font.c b/src/font.c index 60134b1..a68c3c7 100644 --- a/src/font.c +++ b/src/font.c @@ -639,30 +639,30 @@ font_prop_validate_otf (Lisp_Object prop, Lisp_Object val) values. */ static const struct { - /* Pointer to the key symbol. */ - struct Lisp_Symbol *key; + /* Index of the key symbol. */ + int key; /* Function to validate PROP's value VAL, or NULL if any value is ok. The value is VAL or its regularized value if VAL is valid, and Qerror if not. */ Lisp_Object (*validator) (Lisp_Object prop, Lisp_Object val); } font_property_table[] = - { { XSYMBOL_INIT (QCtype), font_prop_validate_symbol }, - { XSYMBOL_INIT (QCfoundry), font_prop_validate_symbol }, - { XSYMBOL_INIT (QCfamily), font_prop_validate_symbol }, - { XSYMBOL_INIT (QCadstyle), font_prop_validate_symbol }, - { XSYMBOL_INIT (QCregistry), font_prop_validate_symbol }, - { XSYMBOL_INIT (QCweight), font_prop_validate_style }, - { XSYMBOL_INIT (QCslant), font_prop_validate_style }, - { XSYMBOL_INIT (QCwidth), font_prop_validate_style }, - { XSYMBOL_INIT (QCsize), font_prop_validate_non_neg }, - { XSYMBOL_INIT (QCdpi), font_prop_validate_non_neg }, - { XSYMBOL_INIT (QCspacing), font_prop_validate_spacing }, - { XSYMBOL_INIT (QCavgwidth), font_prop_validate_non_neg }, + { { SYMBOL_INDEX (QCtype), font_prop_validate_symbol }, + { SYMBOL_INDEX (QCfoundry), font_prop_validate_symbol }, + { SYMBOL_INDEX (QCfamily), font_prop_validate_symbol }, + { SYMBOL_INDEX (QCadstyle), font_prop_validate_symbol }, + { SYMBOL_INDEX (QCregistry), font_prop_validate_symbol }, + { SYMBOL_INDEX (QCweight), font_prop_validate_style }, + { SYMBOL_INDEX (QCslant), font_prop_validate_style }, + { SYMBOL_INDEX (QCwidth), font_prop_validate_style }, + { SYMBOL_INDEX (QCsize), font_prop_validate_non_neg }, + { SYMBOL_INDEX (QCdpi), font_prop_validate_non_neg }, + { SYMBOL_INDEX (QCspacing), font_prop_validate_spacing }, + { SYMBOL_INDEX (QCavgwidth), font_prop_validate_non_neg }, /* The order of the above entries must match with enum font_property_index. */ - { XSYMBOL_INIT (QClang), font_prop_validate_symbol }, - { XSYMBOL_INIT (QCscript), font_prop_validate_symbol }, - { XSYMBOL_INIT (QCotf), font_prop_validate_otf } + { SYMBOL_INDEX (QClang), font_prop_validate_symbol }, + { SYMBOL_INDEX (QCscript), font_prop_validate_symbol }, + { SYMBOL_INDEX (QCotf), font_prop_validate_otf } }; /* Return an index number of font property KEY or -1 if KEY is not an @@ -674,7 +674,7 @@ get_font_prop_index (Lisp_Object key) int i; for (i = 0; i < ARRAYELTS (font_property_table); i++) - if (EQ (key, make_lisp_symbol (font_property_table[i].key))) + if (EQ (key, builtin_lisp_symbol (font_property_table[i].key))) return i; return -1; } @@ -691,7 +691,7 @@ font_prop_validate (int idx, Lisp_Object prop, Lisp_Object val) if (NILP (val)) return val; if (NILP (prop)) - prop = make_lisp_symbol (font_property_table[idx].key); + prop = builtin_lisp_symbol (font_property_table[idx].key); else { idx = get_font_prop_index (prop); diff --git a/src/frame.c b/src/frame.c index fb9bf2e..3d2ffbf 100644 --- a/src/frame.c +++ b/src/frame.c @@ -2925,48 +2925,48 @@ or bottommost possible position (that stays within the screen). */) struct frame_parm_table { const char *name; - struct Lisp_Symbol *sym; + int sym; }; static const struct frame_parm_table frame_parms[] = { - {"auto-raise", XSYMBOL_INIT (Qauto_raise)}, - {"auto-lower", XSYMBOL_INIT (Qauto_lower)}, - {"background-color", 0}, - {"border-color", XSYMBOL_INIT (Qborder_color)}, - {"border-width", XSYMBOL_INIT (Qborder_width)}, - {"cursor-color", XSYMBOL_INIT (Qcursor_color)}, - {"cursor-type", XSYMBOL_INIT (Qcursor_type)}, - {"font", 0}, - {"foreground-color", 0}, - {"icon-name", XSYMBOL_INIT (Qicon_name)}, - {"icon-type", XSYMBOL_INIT (Qicon_type)}, - {"internal-border-width", XSYMBOL_INIT (Qinternal_border_width)}, - {"right-divider-width", XSYMBOL_INIT (Qright_divider_width)}, - {"bottom-divider-width", XSYMBOL_INIT (Qbottom_divider_width)}, - {"menu-bar-lines", XSYMBOL_INIT (Qmenu_bar_lines)}, - {"mouse-color", XSYMBOL_INIT (Qmouse_color)}, - {"name", XSYMBOL_INIT (Qname)}, - {"scroll-bar-width", XSYMBOL_INIT (Qscroll_bar_width)}, - {"scroll-bar-height", XSYMBOL_INIT (Qscroll_bar_height)}, - {"title", XSYMBOL_INIT (Qtitle)}, - {"unsplittable", XSYMBOL_INIT (Qunsplittable)}, - {"vertical-scroll-bars", XSYMBOL_INIT (Qvertical_scroll_bars)}, - {"horizontal-scroll-bars", XSYMBOL_INIT (Qhorizontal_scroll_bars)}, - {"visibility", XSYMBOL_INIT (Qvisibility)}, - {"tool-bar-lines", XSYMBOL_INIT (Qtool_bar_lines)}, - {"scroll-bar-foreground", XSYMBOL_INIT (Qscroll_bar_foreground)}, - {"scroll-bar-background", XSYMBOL_INIT (Qscroll_bar_background)}, - {"screen-gamma", XSYMBOL_INIT (Qscreen_gamma)}, - {"line-spacing", XSYMBOL_INIT (Qline_spacing)}, - {"left-fringe", XSYMBOL_INIT (Qleft_fringe)}, - {"right-fringe", XSYMBOL_INIT (Qright_fringe)}, - {"wait-for-wm", XSYMBOL_INIT (Qwait_for_wm)}, - {"fullscreen", XSYMBOL_INIT (Qfullscreen)}, - {"font-backend", XSYMBOL_INIT (Qfont_backend)}, - {"alpha", XSYMBOL_INIT (Qalpha)}, - {"sticky", XSYMBOL_INIT (Qsticky)}, - {"tool-bar-position", XSYMBOL_INIT (Qtool_bar_position)}, + {"auto-raise", SYMBOL_INDEX (Qauto_raise)}, + {"auto-lower", SYMBOL_INDEX (Qauto_lower)}, + {"background-color", -1}, + {"border-color", SYMBOL_INDEX (Qborder_color)}, + {"border-width", SYMBOL_INDEX (Qborder_width)}, + {"cursor-color", SYMBOL_INDEX (Qcursor_color)}, + {"cursor-type", SYMBOL_INDEX (Qcursor_type)}, + {"font", -1}, + {"foreground-color", -1}, + {"icon-name", SYMBOL_INDEX (Qicon_name)}, + {"icon-type", SYMBOL_INDEX (Qicon_type)}, + {"internal-border-width", SYMBOL_INDEX (Qinternal_border_width)}, + {"right-divider-width", SYMBOL_INDEX (Qright_divider_width)}, + {"bottom-divider-width", SYMBOL_INDEX (Qbottom_divider_width)}, + {"menu-bar-lines", SYMBOL_INDEX (Qmenu_bar_lines)}, + {"mouse-color", SYMBOL_INDEX (Qmouse_color)}, + {"name", SYMBOL_INDEX (Qname)}, + {"scroll-bar-width", SYMBOL_INDEX (Qscroll_bar_width)}, + {"scroll-bar-height", SYMBOL_INDEX (Qscroll_bar_height)}, + {"title", SYMBOL_INDEX (Qtitle)}, + {"unsplittable", SYMBOL_INDEX (Qunsplittable)}, + {"vertical-scroll-bars", SYMBOL_INDEX (Qvertical_scroll_bars)}, + {"horizontal-scroll-bars", SYMBOL_INDEX (Qhorizontal_scroll_bars)}, + {"visibility", SYMBOL_INDEX (Qvisibility)}, + {"tool-bar-lines", SYMBOL_INDEX (Qtool_bar_lines)}, + {"scroll-bar-foreground", SYMBOL_INDEX (Qscroll_bar_foreground)}, + {"scroll-bar-background", SYMBOL_INDEX (Qscroll_bar_background)}, + {"screen-gamma", SYMBOL_INDEX (Qscreen_gamma)}, + {"line-spacing", SYMBOL_INDEX (Qline_spacing)}, + {"left-fringe", SYMBOL_INDEX (Qleft_fringe)}, + {"right-fringe", SYMBOL_INDEX (Qright_fringe)}, + {"wait-for-wm", SYMBOL_INDEX (Qwait_for_wm)}, + {"fullscreen", SYMBOL_INDEX (Qfullscreen)}, + {"font-backend", SYMBOL_INDEX (Qfont_backend)}, + {"alpha", SYMBOL_INDEX (Qalpha)}, + {"sticky", SYMBOL_INDEX (Qsticky)}, + {"tool-bar-position", SYMBOL_INDEX (Qtool_bar_position)}, }; #ifdef HAVE_WINDOW_SYSTEM @@ -4824,9 +4824,9 @@ syms_of_frame (void) for (i = 0; i < ARRAYELTS (frame_parms); i++) { - Lisp_Object v = (frame_parms[i].sym - ? make_lisp_symbol (frame_parms[i].sym) - : intern_c_string (frame_parms[i].name)); + Lisp_Object v = (frame_parms[i].sym < 0 + ? intern_c_string (frame_parms[i].name) + : builtin_lisp_symbol (frame_parms[i].sym)); Fput (v, Qx_frame_parameter, make_number (i)); } } diff --git a/src/image.c b/src/image.c index addb932..5d08a89 100644 --- a/src/image.c +++ b/src/image.c @@ -548,8 +548,8 @@ static struct image_type * define_image_type (struct image_type *type) { struct image_type *p = NULL; - struct Lisp_Symbol *new_type = type->type; - bool type_valid = 1; + int new_type = type->type; + bool type_valid = true; block_input (); @@ -561,14 +561,15 @@ define_image_type (struct image_type *type) { #if defined HAVE_NTGUI && defined WINDOWSNT /* If we failed to load the library before, don't try again. */ - Lisp_Object tested = Fassq (make_lisp_symbol (new_type), Vlibrary_cache); + Lisp_Object tested = Fassq (builtin_lisp_symbol (new_type), + Vlibrary_cache); if (CONSP (tested) && NILP (XCDR (tested))) - type_valid = 0; + type_valid = false; else #endif { type_valid = type->init (); - CACHE_IMAGE_TYPE (make_lisp_symbol (new_type), + CACHE_IMAGE_TYPE (builtin_lisp_symbol (new_type), type_valid ? Qt : Qnil); } } @@ -1747,7 +1748,7 @@ lookup_image (struct frame *f, Lisp_Object spec) /* Do image transformations and compute masks, unless we don't have the image yet. */ - if (!EQ (make_lisp_symbol (img->type->type), Qpostscript)) + if (!EQ (builtin_lisp_symbol (img->type->type), Qpostscript)) postprocess_image (f, img); } @@ -2332,7 +2333,7 @@ static const struct image_keyword xbm_format[XBM_LAST] = static struct image_type xbm_type = { - XSYMBOL_INIT (Qxbm), + SYMBOL_INDEX (Qxbm), xbm_image_p, xbm_load, x_clear_image, @@ -3138,7 +3139,7 @@ static bool init_xpm_functions (void); static struct image_type xpm_type = { - XSYMBOL_INIT (Qxpm), + SYMBOL_INDEX (Qxpm), xpm_image_p, xpm_load, x_clear_image, @@ -5066,7 +5067,7 @@ static const struct image_keyword pbm_format[PBM_LAST] = static struct image_type pbm_type = { - XSYMBOL_INIT (Qpbm), + SYMBOL_INDEX (Qpbm), pbm_image_p, pbm_load, x_clear_image, @@ -5453,7 +5454,7 @@ static bool init_png_functions (void); static struct image_type png_type = { - XSYMBOL_INIT (Qpng), + SYMBOL_INDEX (Qpng), png_image_p, png_load, x_clear_image, @@ -6105,7 +6106,7 @@ static bool init_jpeg_functions (void); static struct image_type jpeg_type = { - XSYMBOL_INIT (Qjpeg), + SYMBOL_INDEX (Qjpeg), jpeg_image_p, jpeg_load, x_clear_image, @@ -6705,7 +6706,7 @@ static bool init_tiff_functions (void); static struct image_type tiff_type = { - XSYMBOL_INIT (Qtiff), + SYMBOL_INDEX (Qtiff), tiff_image_p, tiff_load, x_clear_image, @@ -7164,7 +7165,7 @@ static bool init_gif_functions (void); static struct image_type gif_type = { - XSYMBOL_INIT (Qgif), + SYMBOL_INDEX (Qgif), gif_image_p, gif_load, gif_clear_image, @@ -7851,7 +7852,7 @@ static bool init_imagemagick_functions (void); static struct image_type imagemagick_type = { - XSYMBOL_INIT (Qimagemagick), + SYMBOL_INDEX (Qimagemagick), imagemagick_image_p, imagemagick_load, imagemagick_clear_image, @@ -8623,7 +8624,7 @@ static bool init_svg_functions (void); static struct image_type svg_type = { - XSYMBOL_INIT (Qsvg), + SYMBOL_INDEX (Qsvg), svg_image_p, svg_load, x_clear_image, @@ -9039,7 +9040,7 @@ static const struct image_keyword gs_format[GS_LAST] = static struct image_type gs_type = { - XSYMBOL_INIT (Qpostscript), + SYMBOL_INDEX (Qpostscript), gs_image_p, gs_load, gs_clear_image, diff --git a/src/keyboard.c b/src/keyboard.c index 2a50003..5411aff 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -5164,17 +5164,17 @@ static const char *const lispy_drag_n_drop_names[] = "drag-n-drop" }; -/* An array of scroll bar parts, indexed by an enum scroll_bar_part value. - Note that Qnil corresponds to scroll_bar_nowhere and should not appear - in Lisp events. */ -static struct Lisp_Symbol *const scroll_bar_parts[] = { - XSYMBOL_INIT (Qnil), XSYMBOL_INIT (Qabove_handle), XSYMBOL_INIT (Qhandle), - XSYMBOL_INIT (Qbelow_handle), XSYMBOL_INIT (Qup), XSYMBOL_INIT (Qdown), - XSYMBOL_INIT (Qtop), XSYMBOL_INIT (Qbottom), XSYMBOL_INIT (Qend_scroll), - XSYMBOL_INIT (Qratio), XSYMBOL_INIT (Qbefore_handle), - XSYMBOL_INIT (Qhorizontal_handle), XSYMBOL_INIT (Qafter_handle), - XSYMBOL_INIT (Qleft), XSYMBOL_INIT (Qright), XSYMBOL_INIT (Qleftmost), - XSYMBOL_INIT (Qrightmost), XSYMBOL_INIT (Qend_scroll), XSYMBOL_INIT (Qratio) +/* An array of symbol indexes of scroll bar parts, indexed by an enum + scroll_bar_part value. Note that Qnil corresponds to + scroll_bar_nowhere and should not appear in Lisp events. */ +static short const scroll_bar_parts[] = { + SYMBOL_INDEX (Qnil), SYMBOL_INDEX (Qabove_handle), SYMBOL_INDEX (Qhandle), + SYMBOL_INDEX (Qbelow_handle), SYMBOL_INDEX (Qup), SYMBOL_INDEX (Qdown), + SYMBOL_INDEX (Qtop), SYMBOL_INDEX (Qbottom), SYMBOL_INDEX (Qend_scroll), + SYMBOL_INDEX (Qratio), SYMBOL_INDEX (Qbefore_handle), + SYMBOL_INDEX (Qhorizontal_handle), SYMBOL_INDEX (Qafter_handle), + SYMBOL_INDEX (Qleft), SYMBOL_INDEX (Qright), SYMBOL_INDEX (Qleftmost), + SYMBOL_INDEX (Qrightmost), SYMBOL_INDEX (Qend_scroll), SYMBOL_INDEX (Qratio) }; /* A vector, indexed by button number, giving the down-going location @@ -5448,7 +5448,7 @@ make_scroll_bar_position (struct input_event *ev, Lisp_Object type) { return list5 (ev->frame_or_window, type, Fcons (ev->x, ev->y), make_number (ev->timestamp), - make_lisp_symbol (scroll_bar_parts[ev->part])); + builtin_lisp_symbol (scroll_bar_parts[ev->part])); } /* Given a struct input_event, build the lisp event which represents @@ -6087,7 +6087,7 @@ make_lispy_movement (struct frame *frame, Lisp_Object bar_window, enum scroll_ba { Lisp_Object part_sym; - part_sym = make_lisp_symbol (scroll_bar_parts[part]); + part_sym = builtin_lisp_symbol (scroll_bar_parts[part]); return list2 (Qscroll_bar_movement, list5 (bar_window, Qvertical_scroll_bar, @@ -10986,28 +10986,27 @@ init_keyboard (void) /* This type's only use is in syms_of_keyboard, to put properties on the event header symbols. */ -struct event_head { - struct Lisp_Symbol *var; - struct Lisp_Symbol *kind; +struct event_head +{ + short var; + short kind; }; - - static const struct event_head head_table[] = { - {XSYMBOL_INIT (Qmouse_movement), XSYMBOL_INIT (Qmouse_movement)}, - {XSYMBOL_INIT (Qscroll_bar_movement), XSYMBOL_INIT (Qmouse_movement)}, + {SYMBOL_INDEX (Qmouse_movement), SYMBOL_INDEX (Qmouse_movement)}, + {SYMBOL_INDEX (Qscroll_bar_movement), SYMBOL_INDEX (Qmouse_movement)}, /* Some of the event heads. */ - {XSYMBOL_INIT (Qswitch_frame), XSYMBOL_INIT (Qswitch_frame)}, + {SYMBOL_INDEX (Qswitch_frame), SYMBOL_INDEX (Qswitch_frame)}, - {XSYMBOL_INIT (Qfocus_in), XSYMBOL_INIT (Qfocus_in)}, - {XSYMBOL_INIT (Qfocus_out), XSYMBOL_INIT (Qfocus_out)}, - {XSYMBOL_INIT (Qdelete_frame), XSYMBOL_INIT (Qdelete_frame)}, - {XSYMBOL_INIT (Qiconify_frame), XSYMBOL_INIT (Qiconify_frame)}, - {XSYMBOL_INIT (Qmake_frame_visible), XSYMBOL_INIT (Qmake_frame_visible)}, + {SYMBOL_INDEX (Qfocus_in), SYMBOL_INDEX (Qfocus_in)}, + {SYMBOL_INDEX (Qfocus_out), SYMBOL_INDEX (Qfocus_out)}, + {SYMBOL_INDEX (Qdelete_frame), SYMBOL_INDEX (Qdelete_frame)}, + {SYMBOL_INDEX (Qiconify_frame), SYMBOL_INDEX (Qiconify_frame)}, + {SYMBOL_INDEX (Qmake_frame_visible), SYMBOL_INDEX (Qmake_frame_visible)}, /* `select-window' should be handled just like `switch-frame' in read_key_sequence. */ - {XSYMBOL_INIT (Qselect_window), XSYMBOL_INIT (Qswitch_frame)} + {SYMBOL_INDEX (Qselect_window), SYMBOL_INDEX (Qswitch_frame)} }; void @@ -11180,8 +11179,8 @@ syms_of_keyboard (void) for (i = 0; i < ARRAYELTS (head_table); i++) { const struct event_head *p = &head_table[i]; - Lisp_Object var = make_lisp_symbol (p->var); - Lisp_Object kind = make_lisp_symbol (p->kind); + Lisp_Object var = builtin_lisp_symbol (p->var); + Lisp_Object kind = builtin_lisp_symbol (p->kind); Fput (var, Qevent_kind, kind); Fput (var, Qevent_symbol_elements, list1 (var)); } diff --git a/src/lisp.h b/src/lisp.h index ab72bf1..1fa1deb 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -725,25 +725,20 @@ struct Lisp_Symbol #define TAG_PTR(tag, ptr) \ ((USE_LSB_TAG ? (tag) : (EMACS_UINT) (tag) << VALBITS) + (uintptr_t) (ptr)) -/* Yield an integer that tags PTR as a symbol. */ -#define TAG_SYMPTR(ptr) \ +/* Yield an integer that contains a symbol tag along with OFFSET. + OFFSET should be the offset in bytes from 'lispsym' to the symbol. */ +#define TAG_SYMOFFSET(offset) \ TAG_PTR (Lisp_Symbol, \ - ((uintptr_t) ((char *) (ptr) - (char *) lispsym) \ - >> (USE_LSB_TAG ? 0 : GCTYPEBITS))) + ((uintptr_t) (offset) >> (USE_LSB_TAG ? 0 : GCTYPEBITS))) /* Declare extern constants for Lisp symbols. These can be helpful when using a debugger like GDB, on older platforms where the debug - format does not represent C macros. However, they don't work with - GCC if INTPTR_MAX != EMACS_INT_MAX. */ -#if EMACS_INT_MAX == INTPTR_MAX -# define DEFINE_LISP_SYMBOL_BEGIN(name) \ - DEFINE_GDB_SYMBOL_BEGIN (Lisp_Object, name) -# define DEFINE_LISP_SYMBOL_END(name) \ - DEFINE_GDB_SYMBOL_END (LISP_INITIALLY (TAG_SYMPTR (name))) -#else -# define DEFINE_LISP_SYMBOL_BEGIN(name) /* empty */ -# define DEFINE_LISP_SYMBOL_END(name) /* empty */ -#endif + format does not represent C macros. */ +#define DEFINE_LISP_SYMBOL_BEGIN(name) \ + DEFINE_GDB_SYMBOL_BEGIN (Lisp_Object, name) +#define DEFINE_LISP_SYMBOL_END(name) \ + DEFINE_GDB_SYMBOL_END (LISP_INITIALLY (TAG_SYMOFFSET (i##name \ + * sizeof *lispsym))) #include "globals.h" @@ -973,9 +968,9 @@ XSTRING (Lisp_Object a) return XUNTAG (a, Lisp_String); } -/* XSYMBOL_INIT (Qfoo) is like XSYMBOL (Qfoo), except it is valid in - static initializers, and SYM must be a C-defined symbol. */ -#define XSYMBOL_INIT(sym) a##sym +/* The index of the C-defined Lisp symbol SYM. + This can be used in a static initializer. */ +#define SYMBOL_INDEX(sym) i##sym INLINE struct Lisp_Float * XFLOAT (Lisp_Object a) @@ -1054,12 +1049,18 @@ make_lisp_ptr (void *ptr, enum Lisp_Type type) INLINE Lisp_Object make_lisp_symbol (struct Lisp_Symbol *sym) { - Lisp_Object a = XIL (TAG_SYMPTR (sym)); + Lisp_Object a = XIL (TAG_SYMOFFSET ((char *) sym - (char *) lispsym)); eassert (XSYMBOL (a) == sym); return a; } INLINE Lisp_Object +builtin_lisp_symbol (int index) +{ + return make_lisp_symbol (lispsym + index); +} + +INLINE Lisp_Object make_lisp_proc (struct Lisp_Process *p) { return make_lisp_ptr (p, Lisp_Vectorlike); diff --git a/src/lread.c b/src/lread.c index 3240524..7f7bd89 100644 --- a/src/lread.c +++ b/src/lread.c @@ -4058,7 +4058,7 @@ init_obarray (void) staticpro (&initial_obarray); for (int i = 0; i < ARRAYELTS (lispsym); i++) - define_symbol (make_lisp_symbol (&lispsym[i]), defsym_name[i]); + define_symbol (builtin_lisp_symbol (i), defsym_name[i]); DEFSYM (Qunbound, "unbound"); diff --git a/src/xdisp.c b/src/xdisp.c index 36babfa..31702ed 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -622,8 +622,8 @@ enum prop_handled struct props { - /* The name of the property. */ - struct Lisp_Symbol *name; + /* The symbol index of the name of the property. */ + short name; /* A unique index for the property. */ enum prop_idx idx; @@ -644,14 +644,14 @@ static enum prop_handled handle_fontified_prop (struct it *); static struct props it_props[] = { - {XSYMBOL_INIT (Qfontified), FONTIFIED_PROP_IDX, handle_fontified_prop}, + {SYMBOL_INDEX (Qfontified), FONTIFIED_PROP_IDX, handle_fontified_prop}, /* Handle `face' before `display' because some sub-properties of `display' need to know the face. */ - {XSYMBOL_INIT (Qface), FACE_PROP_IDX, handle_face_prop}, - {XSYMBOL_INIT (Qdisplay), DISPLAY_PROP_IDX, handle_display_prop}, - {XSYMBOL_INIT (Qinvisible), INVISIBLE_PROP_IDX, handle_invisible_prop}, - {XSYMBOL_INIT (Qcomposition), COMPOSITION_PROP_IDX, handle_composition_prop}, - {NULL, 0, NULL} + {SYMBOL_INDEX (Qface), FACE_PROP_IDX, handle_face_prop}, + {SYMBOL_INDEX (Qdisplay), DISPLAY_PROP_IDX, handle_display_prop}, + {SYMBOL_INDEX (Qinvisible), INVISIBLE_PROP_IDX, handle_invisible_prop}, + {SYMBOL_INDEX (Qcomposition), COMPOSITION_PROP_IDX, handle_composition_prop}, + {0, 0, NULL} }; /* Value is the position described by X. If X is a marker, value is @@ -3516,7 +3516,8 @@ compute_stop_pos (struct it *it) /* Get properties here. */ for (p = it_props; p->handler; ++p) - values_here[p->idx] = textget (iv->plist, make_lisp_symbol (p->name)); + values_here[p->idx] = textget (iv->plist, + builtin_lisp_symbol (p->name)); /* Look for an interval following iv that has different properties. */ @@ -3529,7 +3530,7 @@ compute_stop_pos (struct it *it) for (p = it_props; p->handler; ++p) { Lisp_Object new_value = textget (next_iv->plist, - make_lisp_symbol (p->name)); + builtin_lisp_symbol (p->name)); if (!EQ (values_here[p->idx], new_value)) break; } commit 649937920b5023be5c0685d1537f5ea2bfb9899a Author: Paul Eggert Date: Sat Jan 10 13:13:57 2015 -0800 Port to HAVE_FREETYPE && !HAVE_XFT * dispextern.h (struct face.extra) [HAVE_FREETYPE && !HAVE_XFT]: * font.h (syms_of_xftfont) [HAVE_FREETYPE && !HAVE_XFT]: Declare in this case too. diff --git a/src/ChangeLog b/src/ChangeLog index c050835..39775eb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2015-01-10 Paul Eggert + + Port to HAVE_FREETYPE && !HAVE_XFT + * dispextern.h (struct face.extra) [HAVE_FREETYPE && !HAVE_XFT]: + * font.h (syms_of_xftfont) [HAVE_FREETYPE && !HAVE_XFT]: + Declare in this case too. + 2015-01-10 Eli Zaretskii * w32fns.c (Fw32_register_hot_key): Use XINT instead of XLI. diff --git a/src/dispextern.h b/src/dispextern.h index 1a9aef1..161f252 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1716,8 +1716,8 @@ struct face attributes except the font. */ struct face *ascii_face; -#ifdef HAVE_XFT - /* Extra member that a font-driver uses privately. */ +#if defined HAVE_XFT || defined HAVE_FREETYPE +/* Extra member that a font-driver uses privately. */ void *extra; #endif }; diff --git a/src/font.h b/src/font.h index d12ae2c..5a3e38a 100644 --- a/src/font.h +++ b/src/font.h @@ -780,10 +780,10 @@ extern void syms_of_xfont (void); extern void syms_of_ftxfont (void); #ifdef HAVE_XFT extern struct font_driver xftfont_driver; -extern void syms_of_xftfont (void); #endif #if defined HAVE_FREETYPE || defined HAVE_XFT extern struct font_driver ftxfont_driver; +extern void syms_of_xftfont (void); #endif #ifdef HAVE_BDFFONT extern void syms_of_bdffont (void); commit 288e1fd737265b7fc20c2c0d5a7b4ffaf26ecf66 Author: Paul Eggert Date: Sat Jan 10 13:35:33 2015 -0800 Port to 32-bit Sun C 5.12 sparc * make-docfile.c (close_emacs_globals): Align lispsym to GCALIGNMENT. The alignment is required on all platforms; it just happens to have been properly aligned on the previous platforms we tested. diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 9a1fc7a..ec4d16a 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,10 @@ +2015-01-10 Paul Eggert + + Port to 32-bit Sun C 5.12 sparc + * make-docfile.c (close_emacs_globals): Align lispsym to GCALIGNMENT. + The alignment is required on all platforms; it just happens to have + been properly aligned on the previous platforms we tested. + 2015-01-05 Paul Eggert Use 0 for Qnil diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index 22c4bad..7c5c4bc 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c @@ -635,7 +635,7 @@ close_emacs_globals (int num_symbols) "#ifndef DEFINE_SYMBOLS\n" "extern\n" "#endif\n" - "struct Lisp_Symbol lispsym[%d];\n"), + "struct Lisp_Symbol alignas (GCALIGNMENT) lispsym[%d];\n"), num_symbols); } diff --git a/src/lisp.h b/src/lisp.h index 9819e07..ab72bf1 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -233,8 +233,8 @@ extern bool suppress_checking EXTERNALLY_VISIBLE; USE_LSB_TAG not only requires the least 3 bits of pointers returned by malloc to be 0 but also needs to be able to impose a mult-of-8 alignment - on the few static Lisp_Objects used: all the defsubr as well - as the two special buffers buffer_defaults and buffer_local_symbols. */ + on the few static Lisp_Objects used: lispsym, all the defsubr, and + the two special buffers buffer_defaults and buffer_local_symbols. */ enum Lisp_Bits { commit 29eaf3c8a8c7b22e34a6183fec5343d82762f590 Author: Paul Eggert Date: Sat Jan 10 13:35:33 2015 -0800 Port Qnil==0 changes to 32-bit --with-wide-int * lisp.h (lisp_h_XSYMBOL, XSYMBOL): Assume USE_LSB_TAG in the macro-implemented version. For the non-USE_LSB_TAG case, supply a new inline function that is the inverse of the new TAG_SYMPTR. (lisp_h_XUNTAGBASE, XUNTAGBASE): Remove. All uses removed. (TAG_SYMPTR) [!USE_LSB_TAG]: If the pointer subtraction yields a negative number, don't allow sign bits to bleed into the encoded value. Shift in zero bits instead. diff --git a/src/ChangeLog b/src/ChangeLog index b6358d0..c050835 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -21,6 +21,15 @@ 2015-01-09 Paul Eggert + Port Qnil==0 changes to 32-bit --with-wide-int + * lisp.h (lisp_h_XSYMBOL, XSYMBOL): Assume USE_LSB_TAG in the + macro-implemented version. For the non-USE_LSB_TAG case, supply + a new inline function that is the inverse of the new TAG_SYMPTR. + (lisp_h_XUNTAGBASE, XUNTAGBASE): Remove. All uses removed. + (TAG_SYMPTR) [!USE_LSB_TAG]: If the pointer subtraction yields a + negative number, don't allow sign bits to bleed into the encoded + value. Shift in zero bits instead. + Refactor pointer-to-integer conversion * gfilenotify.c (monitor_to_lisp, lisp_to_monitor): Rename and move to lisp.h. All uses changed. diff --git a/src/lisp.h b/src/lisp.h index 4571c45..9819e07 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -356,9 +356,6 @@ error !; #define lisp_h_XHASH(a) XUINT (a) #define lisp_h_XPNTR(a) \ (SYMBOLP (a) ? XSYMBOL (a) : (void *) ((intptr_t) (XLI (a) & VALMASK))) -#define lisp_h_XSYMBOL(a) \ - (eassert (SYMBOLP (a)), \ - (struct Lisp_Symbol *) XUNTAGBASE (a, Lisp_Symbol, lispsym)) #ifndef GC_CHECK_CONS_LIST # define lisp_h_check_cons_list() ((void) 0) #endif @@ -367,10 +364,12 @@ error !; XIL ((EMACS_INT) (((EMACS_UINT) (n) << INTTYPEBITS) + Lisp_Int0)) # define lisp_h_XFASTINT(a) XINT (a) # define lisp_h_XINT(a) (XLI (a) >> INTTYPEBITS) +# define lisp_h_XSYMBOL(a) \ + (eassert (SYMBOLP (a)), \ + (struct Lisp_Symbol *) ((uintptr_t) XLI (a) - Lisp_Symbol \ + + (char *) lispsym)) # define lisp_h_XTYPE(a) ((enum Lisp_Type) (XLI (a) & ~VALMASK)) # define lisp_h_XUNTAG(a, type) ((void *) (intptr_t) (XLI (a) - (type))) -# define lisp_h_XUNTAGBASE(a, type, base) \ - ((void *) ((char *) (base) - (type) + (intptr_t) XLI (a))) #endif /* When compiling via gcc -O0, define the key operations as macros, as @@ -402,7 +401,6 @@ error !; # define XCONS(a) lisp_h_XCONS (a) # define XHASH(a) lisp_h_XHASH (a) # define XPNTR(a) lisp_h_XPNTR (a) -# define XSYMBOL(a) lisp_h_XSYMBOL (a) # ifndef GC_CHECK_CONS_LIST # define check_cons_list() lisp_h_check_cons_list () # endif @@ -410,9 +408,9 @@ error !; # define make_number(n) lisp_h_make_number (n) # define XFASTINT(a) lisp_h_XFASTINT (a) # define XINT(a) lisp_h_XINT (a) +# define XSYMBOL(a) lisp_h_XSYMBOL (a) # define XTYPE(a) lisp_h_XTYPE (a) # define XUNTAG(a, type) lisp_h_XUNTAG (a, type) -# define XUNTAGBASE(a, type, base) lisp_h_XUNTAGBASE (a, type, base) # endif #endif @@ -612,7 +610,7 @@ INLINE bool (VECTORLIKEP) (Lisp_Object); INLINE bool WINDOWP (Lisp_Object); INLINE struct Lisp_Save_Value *XSAVE_VALUE (Lisp_Object); INLINE struct Lisp_Symbol *(XSYMBOL) (Lisp_Object); -INLINE void *(XUNTAGBASE) (Lisp_Object, int, void *); +INLINE void *(XUNTAG) (Lisp_Object, int); /* Defined in chartab.c. */ extern Lisp_Object char_table_ref (Lisp_Object, int); @@ -728,9 +726,10 @@ struct Lisp_Symbol ((USE_LSB_TAG ? (tag) : (EMACS_UINT) (tag) << VALBITS) + (uintptr_t) (ptr)) /* Yield an integer that tags PTR as a symbol. */ -#define TAG_SYMPTR(ptr) \ - TAG_PTR (Lisp_Symbol, \ - USE_LSB_TAG ? (char *) (ptr) - (char *) lispsym : (intptr_t) (ptr)) +#define TAG_SYMPTR(ptr) \ + TAG_PTR (Lisp_Symbol, \ + ((uintptr_t) ((char *) (ptr) - (char *) lispsym) \ + >> (USE_LSB_TAG ? 0 : GCTYPEBITS))) /* Declare extern constants for Lisp symbols. These can be helpful when using a debugger like GDB, on older platforms where the debug @@ -833,10 +832,9 @@ LISP_MACRO_DEFUN (XPNTR, void *, (Lisp_Object a), (a)) LISP_MACRO_DEFUN (make_number, Lisp_Object, (EMACS_INT n), (n)) LISP_MACRO_DEFUN (XINT, EMACS_INT, (Lisp_Object a), (a)) LISP_MACRO_DEFUN (XFASTINT, EMACS_INT, (Lisp_Object a), (a)) +LISP_MACRO_DEFUN (XSYMBOL, struct Lisp_Symbol *, (Lisp_Object a), (a)) LISP_MACRO_DEFUN (XTYPE, enum Lisp_Type, (Lisp_Object a), (a)) LISP_MACRO_DEFUN (XUNTAG, void *, (Lisp_Object a, int type), (a, type)) -LISP_MACRO_DEFUN (XUNTAGBASE, void *, (Lisp_Object a, int type, void *base), - (a, type, base)) #else /* ! USE_LSB_TAG */ @@ -889,6 +887,17 @@ XFASTINT (Lisp_Object a) return n; } +/* Extract A's value as a symbol. */ +INLINE struct Lisp_Symbol * +XSYMBOL (Lisp_Object a) +{ + uintptr_t i = (uintptr_t) XUNTAG (a, Lisp_Symbol); + if (! USE_LSB_TAG) + i <<= GCTYPEBITS; + void *p = (char *) lispsym + i; + return p; +} + /* Extract A's type. */ INLINE enum Lisp_Type XTYPE (Lisp_Object a) @@ -897,16 +906,6 @@ XTYPE (Lisp_Object a) return USE_LSB_TAG ? i & ~VALMASK : i >> VALBITS; } -/* Extract A's pointer value, assuming A's type is TYPE. - If USE_LSB_TAG, add BASE to A's pointer value while extracting. */ -INLINE void * -XUNTAGBASE (Lisp_Object a, int type, void *base) -{ - char *b = USE_LSB_TAG ? base : 0; - intptr_t i = USE_LSB_TAG ? XLI (a) - type : XLI (a) & VALMASK; - return b + i; -} - /* Extract A's pointer value, assuming A's type is TYPE. */ INLINE void * XUNTAG (Lisp_Object a, int type) @@ -974,8 +973,6 @@ XSTRING (Lisp_Object a) return XUNTAG (a, Lisp_String); } -LISP_MACRO_DEFUN (XSYMBOL, struct Lisp_Symbol *, (Lisp_Object a), (a)) - /* XSYMBOL_INIT (Qfoo) is like XSYMBOL (Qfoo), except it is valid in static initializers, and SYM must be a C-defined symbol. */ #define XSYMBOL_INIT(sym) a##sym @@ -1058,8 +1055,7 @@ INLINE Lisp_Object make_lisp_symbol (struct Lisp_Symbol *sym) { Lisp_Object a = XIL (TAG_SYMPTR (sym)); - eassert (XTYPE (a) == Lisp_Symbol - && XUNTAGBASE (a, Lisp_Symbol, lispsym) == sym); + eassert (XSYMBOL (a) == sym); return a; } commit ec7605b4b13776c1079a25891b82b2401a584632 Author: Lars Magne Ingebrigtsen Date: Sat Jan 10 17:54:24 2015 +0100 (shr-urlify): Don't bother the user about invalidly-encoded display strings diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5bebd09..674b267 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-01-10 Lars Magne Ingebrigtsen + + * net/shr.el (shr-urlify): Don't bother the user about + invalidly-encoded display strings. + 2015-01-10 Ivan Shmakov * net/shr.el (shr-urlify): Decode URLs before using them as titles diff --git a/lisp/net/shr.el b/lisp/net/shr.el index a2bad81..feb934c 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -894,8 +894,7 @@ START, and END. Note that START and END should be markers." (add-text-properties start (point) (list 'shr-url url - 'help-echo (let ((iri (or (with-demoted-errors - "shr-urlify: %s" + 'help-echo (let ((iri (or (ignore-errors (decode-coding-string (url-unhex-string url) 'utf-8 t)) commit fd6b7e5807c521b011896d3a62c02330d8c9d3d4 Author: Ivan Shmakov Date: Sat Jan 10 17:48:38 2015 +0100 (shr-urlify): Decode URLs before using them as titles Fixes: debbugs:19555 * lisp/net/shr.el (shr-urlify): Decode URLs before using them as titles. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6c67f4e..5bebd09 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-01-10 Ivan Shmakov + + * net/shr.el (shr-urlify): Decode URLs before using them as titles + (bug#19555). + 2015-01-10 Lars Magne Ingebrigtsen * net/eww.el (eww): Always interpret URLs that start with https?: diff --git a/lisp/net/shr.el b/lisp/net/shr.el index ed824cf..a2bad81 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -894,7 +894,13 @@ START, and END. Note that START and END should be markers." (add-text-properties start (point) (list 'shr-url url - 'help-echo (if title (shr-fold-text (format "%s (%s)" url title)) url) + 'help-echo (let ((iri (or (with-demoted-errors + "shr-urlify: %s" + (decode-coding-string + (url-unhex-string url) + 'utf-8 t)) + url))) + (if title (format "%s (%s)" iri title) iri)) 'follow-link t 'mouse-face 'highlight 'keymap shr-map))) commit afaa7c183bd069d740d0de6e61c0804ec9e47b20 Author: Lars Magne Ingebrigtsen Date: Sat Jan 10 17:26:37 2015 +0100 eww title cleanup when loading (eww): Clear the title when loading so that we don't display misleading information. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ac0701f..6c67f4e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -5,6 +5,8 @@ (eww): Also interpret things like "en.wikipedia.org/wiki/Free software" as an URL. (eww): Don't interpret "org/foo" as an URL. + (eww): Clear the title when loading so that we don't display + misleading information. 2015-01-10 Daniel Colascione diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 46b0760..6a6da17 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -277,6 +277,7 @@ word(s) will be searched for via `eww-search-prefix'." (eww-save-history)) (eww-setup-buffer) (plist-put eww-data :url url) + (plist-put eww-data :title "") (eww-update-header-line-format) (let ((inhibit-read-only t)) (insert (format "Loading %s..." url)) commit 1fd00738641f54cef63a4bdc389e8eaf94643577 Author: Lars Magne Ingebrigtsen Date: Sat Jan 10 16:41:49 2015 +0100 (eww): Don't interpret "org/foo" as an URL. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9bfcd50..ac0701f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -4,6 +4,7 @@ as plain URLs, even if they have spaces in them (bug#19556). (eww): Also interpret things like "en.wikipedia.org/wiki/Free software" as an URL. + (eww): Don't interpret "org/foo" as an URL. 2015-01-10 Daniel Colascione diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 8278e3c..46b0760 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -258,7 +258,7 @@ word(s) will be searched for via `eww-search-prefix'." (if (or (string-match "\\`https?:" url) ;; Also try to match "naked" URLs like ;; en.wikipedia.org/wiki/Free software - (string-match "\\`[a-z._]+/" url) + (string-match "\\`[A-Za-z_]+\\.[A-Za-z._]+/" url) (and (= (length (split-string url)) 1) (or (and (not (string-match-p "\\`[\"\'].*[\"\']\\'" url)) (> (length (split-string url "[.:]")) 1)) commit 790ca72b3e5790bd8af6f76831ac0c3dde01288e Author: Lars Magne Ingebrigtsen Date: Sat Jan 10 16:20:44 2015 +0100 Further eww DWIM URL interpretation fixups (eww): Also interpret things like "en.wikipedia.org/wiki/Free software" as an URL. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 808be4b..9bfcd50 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -2,6 +2,8 @@ * net/eww.el (eww): Always interpret URLs that start with https?: as plain URLs, even if they have spaces in them (bug#19556). + (eww): Also interpret things like "en.wikipedia.org/wiki/Free + software" as an URL. 2015-01-10 Daniel Colascione diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 52c1501..8278e3c 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -256,6 +256,9 @@ word(s) will be searched for via `eww-search-prefix'." (user-error "FTP is not supported.")) (t (if (or (string-match "\\`https?:" url) + ;; Also try to match "naked" URLs like + ;; en.wikipedia.org/wiki/Free software + (string-match "\\`[a-z._]+/" url) (and (= (length (split-string url)) 1) (or (and (not (string-match-p "\\`[\"\'].*[\"\']\\'" url)) (> (length (split-string url "[.:]")) 1)) @@ -263,7 +266,7 @@ word(s) will be searched for via `eww-search-prefix'." (progn (unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url) (setq url (concat "http://" url))) - ;; some site don't redirect final / + ;; Some sites do not redirect final / (when (string= (url-filename (url-generic-parse-url url)) "") (setq url (concat url "/")))) (setq url (concat eww-search-prefix commit 0046f2c1580d439351fbecf2c28526a5e1c845ec Author: Lars Magne Ingebrigtsen Date: Sat Jan 10 16:01:43 2015 +0100 Tweak eww DWIM URL recognition Fixes: debbugs:19556 * net/eww.el (eww): Always interpret URLs that start with https?: as plain URLs, even if they have spaces in them. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fc7f5e5..808be4b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-01-10 Lars Magne Ingebrigtsen + + * net/eww.el (eww): Always interpret URLs that start with https?: + as plain URLs, even if they have spaces in them (bug#19556). + 2015-01-10 Daniel Colascione * vc/vc-hooks.el (vc-prefix-map): Bind vc-delete-file to C-x v x, diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 2ce95d9..52c1501 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -255,10 +255,11 @@ word(s) will be searched for via `eww-search-prefix'." ((string-match-p "\\`ftp://" url) (user-error "FTP is not supported.")) (t - (if (and (= (length (split-string url)) 1) - (or (and (not (string-match-p "\\`[\"\'].*[\"\']\\'" url)) - (> (length (split-string url "[.:]")) 1)) - (string-match eww-local-regex url))) + (if (or (string-match "\\`https?:" url) + (and (= (length (split-string url)) 1) + (or (and (not (string-match-p "\\`[\"\'].*[\"\']\\'" url)) + (> (length (split-string url "[.:]")) 1)) + (string-match eww-local-regex url)))) (progn (unless (string-match-p "\\`[a-zA-Z][-a-zA-Z0-9+.]*://" url) (setq url (concat "http://" url))) commit 485763c0dcdc4f5ab1030f4bae6acbbe0ce9497e Author: Eli Zaretskii Date: Sat Jan 10 13:27:35 2015 +0200 MS-Windows followup for change in semantics of XIL and XLI. (Bug#15880) src/w32fns.c (Fw32_register_hot_key): Use XINT instead of XLI. src/w32notify.c (Fw32notify_add_watch, w32_get_watch_object): Use make_pointer_integer instead of XIL. (Fw32notify_rm_watch): Use XINTPTR instead of XLI. src/w32inevt.c (handle_file_notifications): Use make_pointer_integer instead of XIL. Put a list of the descriptor, action, and file name in event->arg, instead of spreading them between event->code and event->arg. src/w32term.c (queue_notifications): Use make_pointer_integer instead of XIL. Put a list of the descriptor, action, and file name in event->arg, instead of spreading them between event->code and event->arg. src/keyboard.c (kbd_buffer_get_event) [HAVE_W32NOTIFY]: Adjust Lisp event creation to changes in w32term.c and w32inevt.c above. diff --git a/src/ChangeLog b/src/ChangeLog index c11ba11..b6358d0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,24 @@ +2015-01-10 Eli Zaretskii + + * w32fns.c (Fw32_register_hot_key): Use XINT instead of XLI. + + * w32notify.c (Fw32notify_add_watch, w32_get_watch_object): Use + make_pointer_integer instead of XIL. + (Fw32notify_rm_watch): Use XINTPTR instead of XLI. + + * w32inevt.c (handle_file_notifications): Use make_pointer_integer + instead of XIL. Put a list of the descriptor, action, and file + name in event->arg, instead of spreading them between event->code + and event->arg. + + * w32term.c (queue_notifications): Use make_pointer_integer + instead of XIL. Put a list of the descriptor, action, and file + name in event->arg, instead of spreading them between event->code + and event->arg. + + * keyboard.c (kbd_buffer_get_event) [HAVE_W32NOTIFY]: Adjust Lisp + event creation to changes in w32term.c and w32inevt.c above. + 2015-01-09 Paul Eggert Refactor pointer-to-integer conversion diff --git a/src/keyboard.c b/src/keyboard.c index c177c80..2a50003 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -4025,11 +4025,7 @@ kbd_buffer_get_event (KBOARD **kbp, { #ifdef HAVE_W32NOTIFY /* Make an event (file-notify (DESCRIPTOR ACTION FILE) CALLBACK). */ - obj = list3 (Qfile_notify, - list3 (make_number (event->code), - XCAR (event->arg), - XCDR (event->arg)), - event->frame_or_window); + obj = list3 (Qfile_notify, event->arg, event->frame_or_window); #else obj = make_lispy_event (event); #endif diff --git a/src/w32fns.c b/src/w32fns.c index ced3d87..789a91a 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -7235,7 +7235,7 @@ The return value is the hotkey-id if registered, otherwise nil. */) /* Notify input thread about new hot-key definition, so that it takes effect without needing to switch focus. */ PostThreadMessage (dwWindowsThreadId, WM_EMACS_REGISTER_HOT_KEY, - (WPARAM) XLI (key), 0); + (WPARAM) XINT (key), 0); } return key; diff --git a/src/w32inevt.c b/src/w32inevt.c index daf4a5c..e09903f 100644 --- a/src/w32inevt.c +++ b/src/w32inevt.c @@ -657,11 +657,12 @@ handle_file_notifications (struct input_event *hold_quit) Lisp_Object action = lispy_file_action (fni->Action); inev.kind = FILE_NOTIFY_EVENT; - inev.code = (ptrdiff_t)XINT (XIL ((EMACS_INT)notifications_desc)); inev.timestamp = GetTickCount (); inev.modifiers = 0; inev.frame_or_window = callback; inev.arg = Fcons (action, fname); + inev.arg = list3 (make_pointer_integer (notifications_desc), + action, fname); kbd_buffer_store_event_hold (&inev, hold_quit); if (!fni->NextEntryOffset) diff --git a/src/w32notify.c b/src/w32notify.c index a0d555b..ab6cd12 100644 --- a/src/w32notify.c +++ b/src/w32notify.c @@ -580,7 +580,7 @@ generate notifications correctly, though. */) report_file_error ("Cannot watch file", Fcons (file, Qnil)); } /* Store watch object in watch list. */ - watch_descriptor = XIL ((EMACS_INT)dirwatch); + watch_descriptor = make_pointer_integer (dirwatch); watch_object = Fcons (watch_descriptor, callback); watch_list = Fcons (watch_object, watch_list); @@ -605,7 +605,7 @@ WATCH-DESCRIPTOR should be an object returned by `w32notify-add-watch'. */) if (!NILP (watch_object)) { watch_list = Fdelete (watch_object, watch_list); - dirwatch = (struct notification *)XLI (watch_descriptor); + dirwatch = (struct notification *)XINTPTR (watch_descriptor); if (w32_valid_pointer_p (dirwatch, sizeof(struct notification))) status = remove_watch (dirwatch); } @@ -620,7 +620,7 @@ WATCH-DESCRIPTOR should be an object returned by `w32notify-add-watch'. */) Lisp_Object w32_get_watch_object (void *desc) { - Lisp_Object descriptor = XIL ((EMACS_INT)desc); + Lisp_Object descriptor = make_pointer_integer (desc); /* This is called from the input queue handling code, inside a critical section, so we cannot possibly QUIT if watch_list is not diff --git a/src/w32term.c b/src/w32term.c index 8a53a58..ce28e05 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -3247,12 +3247,11 @@ queue_notifications (struct input_event *event, W32Msg *msg, struct frame *f, Lisp_Object action = lispy_file_action (fni->Action); event->kind = FILE_NOTIFY_EVENT; - event->code - = (ptrdiff_t)XINT (XIL ((EMACS_INT)notifications_desc)); event->timestamp = msg->msg.time; event->modifiers = 0; event->frame_or_window = callback; - event->arg = Fcons (action, fname); + event->arg = list3 (make_pointer_integer (notifications_desc), + action, fname); kbd_buffer_store_event (event); (*evcount)++;