From d673aedc2feb6828c7470492b254ff9cfe1f9e63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Wed, 12 Sep 2012 22:21:39 +0200 Subject: [PATCH 01/88] * configure.ac: No --with-x-toolkit given: Try gtk3 toolkit first and then gtk2 if not found. --with-x-toolkit=gtk|yes: As above, but fail if gtk2 or gt3 not found. --with-x-toolkit=gtk2: Only try gtk2, fail if not found. --with-x-toolkit=gtk3: Only try gtk3, fail if not found. --- ChangeLog | 8 ++++++++ configure.ac | 39 +++++++++++++++++++++++++-------------- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 23fc479e124..a8a7fdc2966 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-09-12 Jan Djärv + + * configure.ac: No --with-x-toolkit given: Try gtk3 toolkit first + and then gtk2 if not found. + --with-x-toolkit=gtk|yes: As above, but fail if gtk2 or gt3 not found. + --with-x-toolkit=gtk2: Only try gtk2, fail if not found. + --with-x-toolkit=gtk3: Only try gtk3, fail if not found. + 2012-09-11 Glenn Morris * Makefile.in (install-arch-dep, install-arch-indep, install-doc): diff --git a/configure.ac b/configure.ac index 9491c1da8d5..ed1849514c1 100644 --- a/configure.ac +++ b/configure.ac @@ -138,7 +138,7 @@ dnl This should be the last --with option, because --with-x is dnl added later on when we find the path of X, and it's best to dnl keep them together visually. AC_ARG_WITH([x-toolkit],[AS_HELP_STRING([--with-x-toolkit=KIT], - [use an X toolkit (KIT one of: yes or gtk, gtk3, lucid or athena, motif, no)])], + [use an X toolkit (KIT one of: yes or gtk, gtk2, gtk3, lucid or athena, motif, no)])], [ case "${withval}" in y | ye | yes ) val=gtk ;; n | no ) val=no ;; @@ -146,11 +146,13 @@ AC_ARG_WITH([x-toolkit],[AS_HELP_STRING([--with-x-toolkit=KIT], a | at | ath | athe | athen | athena ) val=athena ;; m | mo | mot | moti | motif ) val=motif ;; g | gt | gtk ) val=gtk ;; + gtk2 ) val=gtk2 ;; gtk3 ) val=gtk3 ;; * ) AC_MSG_ERROR([`--with-x-toolkit=$withval' is invalid; -this option's value should be `yes', `no', `lucid', `athena', `motif', `gtk' or -`gtk3'. `yes' and `gtk' are synonyms. `athena' and `lucid' are synonyms.]) +this option's value should be `yes', `no', `lucid', `athena', `motif', `gtk', +`gtk2' or `gtk3'. `yes' and `gtk' are synonyms. +`athena' and `lucid' are synonyms.]) ;; esac with_x_toolkit=$val @@ -1578,6 +1580,9 @@ case "${window_system}" in dnl Don't set this for GTK. A lot of tests below assumes Xt when dnl USE_X_TOOLKIT is set. USE_X_TOOLKIT=none ;; + gtk2 ) with_gtk2=yes + term_header=gtkutil.h + USE_X_TOOLKIT=none ;; gtk3 ) with_gtk3=yes term_header=gtkutil.h USE_X_TOOLKIT=none ;; @@ -1900,35 +1905,41 @@ fi HAVE_GTK=no GTK_OBJ= -if test "${with_gtk3}" = "yes"; then +check_gtk2=no +gtk3_pkg_errors= +if test "${with_gtk3}" = "yes" || test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then GLIB_REQUIRED=2.28 GTK_REQUIRED=3.0 GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED" dnl Checks for libraries. PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no) - if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then + if test "$pkg_check_gtk" = "no" && test "$with_gtk3" = "yes"; then AC_MSG_ERROR($GTK_PKG_ERRORS) fi - AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.]) - GTK_OBJ=emacsgtkfixed.o - term_header=gtkutil.h + if test "$pkg_check_gtk" = "yes"; then + AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.]) + GTK_OBJ=emacsgtkfixed.o + term_header=gtkutil.h + else + check_gtk2=yes + gtk3_pkg_errors="$GTK_PKG_ERRORS " + fi fi -if test "$pkg_check_gtk" != "yes"; then - HAVE_GTK=no -if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then +if test "${with_gtk2}" = "yes" || test "$check_gtk2" = "yes"; then GLIB_REQUIRED=2.10 GTK_REQUIRED=2.10 GTK_MODULES="gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED" dnl Checks for libraries. PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no) - if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then - AC_MSG_ERROR($GTK_PKG_ERRORS) + if test "$pkg_check_gtk" = "no"; then + if test "$USE_X_TOOLKIT" = "maybe" || test "$with_gtk" = "yes" || test "$with_gtk2" = "yes"; then + AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS) + fi fi fi -fi if test x"$pkg_check_gtk" = xyes; then From a9f9d9de77e246af750ce5304320b0f66a085ea9 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 12 Sep 2012 23:51:46 +0300 Subject: [PATCH 02/88] Use Isearch lax whitespace mode in Info. http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00811.html * lisp/info.el (Info-search): Don't check for isearch-mode and isearch-regexp before let-binding search-spaces-regexp to Info-search-whitespace-regexp. (Info-isearch-search): Let-bind Info-search-whitespace-regexp to search-whitespace-regexp if isearch-lax-whitespace or isearch-regexp-lax-whitespace is non-nil. (Info-mode): Don't set local variable search-whitespace-regexp. --- lisp/ChangeLog | 11 +++++++++++ lisp/info.el | 49 +++++++++++++++++++++++-------------------------- 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 549b70a1de1..ecb110bc30e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2012-09-12 Juri Linkov + + * info.el (Info-search): Don't check for isearch-mode and + isearch-regexp before let-binding search-spaces-regexp to + Info-search-whitespace-regexp. + (Info-isearch-search): Let-bind Info-search-whitespace-regexp to + search-whitespace-regexp if isearch-lax-whitespace or + isearch-regexp-lax-whitespace is non-nil. + (Info-mode): Don't set local variable search-whitespace-regexp. + http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00811.html + 2012-09-12 Stefan Monnier * emacs-lisp/debug.el (debugger-outer-unread-command-char, debug) diff --git a/lisp/info.el b/lisp/info.el index fe4afd72163..5862e5e850f 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -1882,9 +1882,7 @@ If DIRECTION is `backward', search in the reverse direction." (while (and (not give-up) (or (null found) (not (funcall isearch-filter-predicate beg-found found)))) - (let ((search-spaces-regexp - (if (or (not isearch-mode) isearch-regexp) - Info-search-whitespace-regexp))) + (let ((search-spaces-regexp Info-search-whitespace-regexp)) (if (if backward (re-search-backward regexp bound t) (re-search-forward regexp bound t)) @@ -1904,9 +1902,7 @@ If DIRECTION is `backward', search in the reverse direction." (if (null Info-current-subfile) (if isearch-mode (signal 'search-failed (list regexp "end of manual")) - (let ((search-spaces-regexp - (if (or (not isearch-mode) isearch-regexp) - Info-search-whitespace-regexp))) + (let ((search-spaces-regexp Info-search-whitespace-regexp)) (if backward (re-search-backward regexp) (re-search-forward regexp)))) @@ -1964,9 +1960,7 @@ If DIRECTION is `backward', search in the reverse direction." (while (and (not give-up) (or (null found) (not (funcall isearch-filter-predicate beg-found found)))) - (let ((search-spaces-regexp - (if (or (not isearch-mode) isearch-regexp) - Info-search-whitespace-regexp))) + (let ((search-spaces-regexp Info-search-whitespace-regexp)) (if (if backward (re-search-backward regexp nil t) (re-search-forward regexp nil t)) @@ -2034,21 +2028,26 @@ If DIRECTION is `backward', search in the reverse direction." (defun Info-isearch-search () (if Info-isearch-search (lambda (string &optional bound noerror count) - (Info-search - (cond - (isearch-word - ;; Lax version of word search - (let ((lax (not (or isearch-nonincremental - (eq (length string) - (length (isearch--state-string - (car isearch-cmds)))))))) - (if (functionp isearch-word) - (funcall isearch-word string lax) - (word-search-regexp string lax)))) - (isearch-regexp string) - (t (regexp-quote string))) - bound noerror count - (unless isearch-forward 'backward)) + (let ((Info-search-whitespace-regexp + (if (if isearch-regexp + isearch-regexp-lax-whitespace + isearch-lax-whitespace) + search-whitespace-regexp))) + (Info-search + (cond + (isearch-word + ;; Lax version of word search + (let ((lax (not (or isearch-nonincremental + (eq (length string) + (length (isearch--state-string + (car isearch-cmds)))))))) + (if (functionp isearch-word) + (funcall isearch-word string lax) + (word-search-regexp string lax)))) + (isearch-regexp string) + (t (regexp-quote string))) + bound noerror count + (unless isearch-forward 'backward))) (point)) (isearch-search-fun-default))) @@ -4157,8 +4156,6 @@ Advanced commands: 'Info-isearch-push-state) (set (make-local-variable 'isearch-filter-predicate) 'Info-isearch-filter) - (set (make-local-variable 'search-whitespace-regexp) - Info-search-whitespace-regexp) (set (make-local-variable 'revert-buffer-function) 'Info-revert-buffer-function) (Info-set-mode-line) From 40bce90baad677cd631c27819b32cca9c5d3a1ab Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 12 Sep 2012 14:34:24 -0700 Subject: [PATCH 03/88] More fixes for 'volatile' and setjmp/longjmp. * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's. * image.c (struct png_load_context) [HAVE_PNG]: New type. (png_load_body) [HAVE_PNG]: (jpeg_load_body) [HAVE_JPEG]: New function, with most of the old parent function's body. (png_load) [HAVE_PNG]: (jpeg_load) [HAVE_JPEG]: Invoke the new function, to avoid longjmp munging our locals. (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code. (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when longjmp is passed 2, as the C standard doesn't guarantee this. Instead, store the failure code into mgr->failure_code. --- src/ChangeLog | 16 ++++ src/eval.c | 11 +-- src/image.c | 198 +++++++++++++++++++++++++++++++------------------- 3 files changed, 145 insertions(+), 80 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 8b47c52c23f..c0d3316bea1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,19 @@ +2012-09-12 Paul Eggert + + More fixes for 'volatile' and setjmp/longjmp. + * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's. + * image.c (struct png_load_context) [HAVE_PNG]: New type. + (png_load_body) [HAVE_PNG]: + (jpeg_load_body) [HAVE_JPEG]: + New function, with most of the old parent function's body. + (png_load) [HAVE_PNG]: + (jpeg_load) [HAVE_JPEG]: + Invoke the new function, to avoid longjmp munging our locals. + (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code. + (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when + longjmp is passed 2, as the C standard doesn't guarantee this. + Instead, store the failure code into mgr->failure_code. + 2012-09-12 Stefan Monnier * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p) diff --git a/src/eval.c b/src/eval.c index 8a8a507a1b6..3c0c65e9366 100644 --- a/src/eval.c +++ b/src/eval.c @@ -707,7 +707,7 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */) else { /* Check if there is really a global binding rather than just a let binding that shadows the global unboundness of the var. */ - volatile struct specbinding *pdl = specpdl_ptr; + struct specbinding *pdl = specpdl_ptr; while (pdl > specpdl) { if (EQ ((--pdl)->symbol, sym) && !pdl->func @@ -1204,12 +1204,9 @@ See also the function `signal' for more info. usage: (condition-case VAR BODYFORM &rest HANDLERS) */) (Lisp_Object args) { - register Lisp_Object bodyform, handlers; - volatile Lisp_Object var; - - var = Fcar (args); - bodyform = Fcar (Fcdr (args)); - handlers = Fcdr (Fcdr (args)); + Lisp_Object var = Fcar (args); + Lisp_Object bodyform = Fcar (Fcdr (args)); + Lisp_Object handlers = Fcdr (Fcdr (args)); return internal_lisp_condition_case (var, bodyform, handlers); } diff --git a/src/image.c b/src/image.c index cf01602050f..cd5df99ef57 100644 --- a/src/image.c +++ b/src/image.c @@ -5591,20 +5591,31 @@ png_read_from_file (png_structp png_ptr, png_bytep data, png_size_t length) /* Load PNG image IMG for use on frame F. Value is non-zero if successful. */ +struct png_load_context +{ + /* These are members so that _longjmp doesn't munge local variables. */ + png_struct *png_ptr; + png_info *info_ptr; + png_info *end_info; + FILE *fp; + png_byte *pixels; + png_byte **rows; +}; + static int -png_load (struct frame *f, struct image *img) +png_load_body (struct frame *f, struct image *img, struct png_load_context *c) { Lisp_Object file, specified_file; Lisp_Object specified_data; int x, y; ptrdiff_t i; XImagePtr ximg, mask_img = NULL; - png_struct *png_ptr = NULL; + png_struct *png_ptr; png_info *info_ptr = NULL, *end_info = NULL; - FILE *volatile fp = NULL; + FILE *fp = NULL; png_byte sig[8]; - png_byte * volatile pixels = NULL; - png_byte ** volatile rows = NULL; + png_byte *pixels = NULL; + png_byte **rows = NULL; png_uint_32 width, height; int bit_depth, color_type, interlace_type; png_byte channels; @@ -5671,24 +5682,26 @@ png_load (struct frame *f, struct image *img) png_ptr = fn_png_create_read_struct (PNG_LIBPNG_VER_STRING, NULL, my_png_error, my_png_warning); - if (!png_ptr) + if (png_ptr) { - if (fp) fclose (fp); - return 0; + info_ptr = fn_png_create_info_struct (png_ptr); + end_info = fn_png_create_info_struct (png_ptr); } - info_ptr = fn_png_create_info_struct (png_ptr); - if (!info_ptr) - { - fn_png_destroy_read_struct (&png_ptr, NULL, NULL); - if (fp) fclose (fp); - return 0; - } + c->png_ptr = png_ptr; + c->info_ptr = info_ptr; + c->end_info = end_info; + c->fp = fp; + c->pixels = pixels; + c->rows = rows; - end_info = fn_png_create_info_struct (png_ptr); - if (!end_info) + if (! (info_ptr && end_info)) + { + fn_png_destroy_read_struct (&c->png_ptr, &c->info_ptr, &c->end_info); + png_ptr = 0; + } + if (! png_ptr) { - fn_png_destroy_read_struct (&png_ptr, &info_ptr, NULL); if (fp) fclose (fp); return 0; } @@ -5698,14 +5711,18 @@ png_load (struct frame *f, struct image *img) if (_setjmp (PNG_JMPBUF (png_ptr))) { error: - if (png_ptr) - fn_png_destroy_read_struct (&png_ptr, &info_ptr, &end_info); - xfree (pixels); - xfree (rows); - if (fp) fclose (fp); + if (c->png_ptr) + fn_png_destroy_read_struct (&c->png_ptr, &c->info_ptr, &c->end_info); + xfree (c->pixels); + xfree (c->rows); + if (c->fp) + fclose (c->fp); return 0; } + /* Silence a bogus diagnostic; see GCC bug 54561. */ + IF_LINT (fp = c->fp); + /* Read image info. */ if (!NILP (specified_data)) fn_png_set_read_fn (png_ptr, (void *) &tbr, png_read_from_memory); @@ -5821,8 +5838,8 @@ png_load (struct frame *f, struct image *img) if (min (PTRDIFF_MAX, SIZE_MAX) / sizeof *rows < height || min (PTRDIFF_MAX, SIZE_MAX) / sizeof *pixels / height < row_bytes) memory_full (SIZE_MAX); - pixels = xmalloc (sizeof *pixels * row_bytes * height); - rows = xmalloc (height * sizeof *rows); + c->pixels = pixels = xmalloc (sizeof *pixels * row_bytes * height); + c->rows = rows = xmalloc (height * sizeof *rows); for (i = 0; i < height; ++i) rows[i] = pixels + i * row_bytes; @@ -5832,7 +5849,7 @@ png_load (struct frame *f, struct image *img) if (fp) { fclose (fp); - fp = NULL; + c->fp = NULL; } /* Create an image and pixmap serving as mask if the PNG image @@ -5907,7 +5924,7 @@ png_load (struct frame *f, struct image *img) #endif /* COLOR_TABLE_SUPPORT */ /* Clean up. */ - fn_png_destroy_read_struct (&png_ptr, &info_ptr, &end_info); + fn_png_destroy_read_struct (&c->png_ptr, &c->info_ptr, &c->end_info); xfree (rows); xfree (pixels); @@ -5936,6 +5953,13 @@ png_load (struct frame *f, struct image *img) return 1; } +static int +png_load (struct frame *f, struct image *img) +{ + struct png_load_context c; + return png_load_body (f, img, &c); +} + #else /* HAVE_PNG */ #ifdef HAVE_NS @@ -6106,6 +6130,16 @@ struct my_jpeg_error_mgr { struct jpeg_error_mgr pub; jmp_buf setjmp_buffer; + + /* The remaining members are so that _longjmp doesn't munge local + variables. */ + struct jpeg_decompress_struct cinfo; + enum + { + MY_JPEG_ERROR_EXIT, + MY_JPEG_INVALID_IMAGE_SIZE, + MY_JPEG_CANNOT_CREATE_X + } failure_code; }; @@ -6113,6 +6147,7 @@ static _Noreturn void my_error_exit (j_common_ptr cinfo) { struct my_jpeg_error_mgr *mgr = (struct my_jpeg_error_mgr *) cinfo->err; + mgr->failure_code = MY_JPEG_ERROR_EXIT; _longjmp (mgr->setjmp_buffer, 1); } @@ -6319,17 +6354,15 @@ jpeg_file_src (j_decompress_ptr cinfo, FILE *fp) from the JPEG lib. */ static int -jpeg_load (struct frame *f, struct image *img) +jpeg_load_body (struct frame *f, struct image *img, + struct my_jpeg_error_mgr *mgr) { - struct jpeg_decompress_struct cinfo; - struct my_jpeg_error_mgr mgr; Lisp_Object file, specified_file; Lisp_Object specified_data; - FILE * volatile fp = NULL; + FILE *fp = NULL; JSAMPARRAY buffer; int row_stride, x, y; XImagePtr ximg = NULL; - int rc; unsigned long *colors; int width, height; @@ -6361,24 +6394,33 @@ jpeg_load (struct frame *f, struct image *img) /* Customize libjpeg's error handling to call my_error_exit when an error is detected. This function will perform a longjmp. */ - cinfo.err = fn_jpeg_std_error (&mgr.pub); - mgr.pub.error_exit = my_error_exit; - - if ((rc = _setjmp (mgr.setjmp_buffer)) != 0) + mgr->cinfo.err = fn_jpeg_std_error (&mgr->pub); + mgr->pub.error_exit = my_error_exit; + if (_setjmp (mgr->setjmp_buffer)) { - if (rc == 1) + switch (mgr->failure_code) { - /* Called from my_error_exit. Display a JPEG error. */ - char buf[JMSG_LENGTH_MAX]; - cinfo.err->format_message ((j_common_ptr) &cinfo, buf); - image_error ("Error reading JPEG image `%s': %s", img->spec, - build_string (buf)); + case MY_JPEG_ERROR_EXIT: + { + char buf[JMSG_LENGTH_MAX]; + mgr->cinfo.err->format_message ((j_common_ptr) &mgr->cinfo, buf); + image_error ("Error reading JPEG image `%s': %s", img->spec, + build_string (buf)); + break; + } + + case MY_JPEG_INVALID_IMAGE_SIZE: + image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil); + break; + + case MY_JPEG_CANNOT_CREATE_X: + break; } /* Close the input file and destroy the JPEG object. */ if (fp) - fclose ((FILE *) fp); - fn_jpeg_destroy_decompress (&cinfo); + fclose (fp); + fn_jpeg_destroy_decompress (&mgr->cinfo); /* If we already have an XImage, free that. */ x_destroy_x_image (ximg); @@ -6390,44 +6432,47 @@ jpeg_load (struct frame *f, struct image *img) /* Create the JPEG decompression object. Let it read from fp. Read the JPEG image header. */ - fn_jpeg_CreateDecompress (&cinfo, JPEG_LIB_VERSION, sizeof (cinfo)); + fn_jpeg_CreateDecompress (&mgr->cinfo, JPEG_LIB_VERSION, sizeof *&mgr->cinfo); if (NILP (specified_data)) - jpeg_file_src (&cinfo, (FILE *) fp); + jpeg_file_src (&mgr->cinfo, fp); else - jpeg_memory_src (&cinfo, SDATA (specified_data), + jpeg_memory_src (&mgr->cinfo, SDATA (specified_data), SBYTES (specified_data)); - fn_jpeg_read_header (&cinfo, 1); + fn_jpeg_read_header (&mgr->cinfo, 1); /* Customize decompression so that color quantization will be used. Start decompression. */ - cinfo.quantize_colors = 1; - fn_jpeg_start_decompress (&cinfo); - width = img->width = cinfo.output_width; - height = img->height = cinfo.output_height; + mgr->cinfo.quantize_colors = 1; + fn_jpeg_start_decompress (&mgr->cinfo); + width = img->width = mgr->cinfo.output_width; + height = img->height = mgr->cinfo.output_height; if (!check_image_size (f, width, height)) { - image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil); - _longjmp (mgr.setjmp_buffer, 2); + mgr->failure_code = MY_JPEG_INVALID_IMAGE_SIZE; + _longjmp (mgr->setjmp_buffer, 1); } /* Create X image and pixmap. */ if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap)) - _longjmp (mgr.setjmp_buffer, 2); + { + mgr->failure_code = MY_JPEG_CANNOT_CREATE_X; + _longjmp (mgr->setjmp_buffer, 1); + } /* Allocate colors. When color quantization is used, - cinfo.actual_number_of_colors has been set with the number of - colors generated, and cinfo.colormap is a two-dimensional array - of color indices in the range 0..cinfo.actual_number_of_colors. + mgr->cinfo.actual_number_of_colors has been set with the number of + colors generated, and mgr->cinfo.colormap is a two-dimensional array + of color indices in the range 0..mgr->cinfo.actual_number_of_colors. No more than 255 colors will be generated. */ { int i, ir, ig, ib; - if (cinfo.out_color_components > 2) + if (mgr->cinfo.out_color_components > 2) ir = 0, ig = 1, ib = 2; - else if (cinfo.out_color_components > 1) + else if (mgr->cinfo.out_color_components > 1) ir = 0, ig = 1, ib = 0; else ir = 0, ig = 0, ib = 0; @@ -6437,15 +6482,15 @@ jpeg_load (struct frame *f, struct image *img) a default color, and we don't have to care about which colors can be freed safely, and which can't. */ init_color_table (); - colors = alloca (cinfo.actual_number_of_colors * sizeof *colors); + colors = alloca (mgr->cinfo.actual_number_of_colors * sizeof *colors); - for (i = 0; i < cinfo.actual_number_of_colors; ++i) + for (i = 0; i < mgr->cinfo.actual_number_of_colors; ++i) { /* Multiply RGB values with 255 because X expects RGB values in the range 0..0xffff. */ - int r = cinfo.colormap[ir][i] << 8; - int g = cinfo.colormap[ig][i] << 8; - int b = cinfo.colormap[ib][i] << 8; + int r = mgr->cinfo.colormap[ir][i] << 8; + int g = mgr->cinfo.colormap[ig][i] << 8; + int b = mgr->cinfo.colormap[ib][i] << 8; colors[i] = lookup_rgb_color (f, r, g, b); } @@ -6457,21 +6502,21 @@ jpeg_load (struct frame *f, struct image *img) } /* Read pixels. */ - row_stride = width * cinfo.output_components; - buffer = cinfo.mem->alloc_sarray ((j_common_ptr) &cinfo, JPOOL_IMAGE, - row_stride, 1); + row_stride = width * mgr->cinfo.output_components; + buffer = mgr->cinfo.mem->alloc_sarray ((j_common_ptr) &mgr->cinfo, + JPOOL_IMAGE, row_stride, 1); for (y = 0; y < height; ++y) { - fn_jpeg_read_scanlines (&cinfo, buffer, 1); - for (x = 0; x < cinfo.output_width; ++x) + fn_jpeg_read_scanlines (&mgr->cinfo, buffer, 1); + for (x = 0; x < mgr->cinfo.output_width; ++x) XPutPixel (ximg, x, y, colors[buffer[0][x]]); } /* Clean up. */ - fn_jpeg_finish_decompress (&cinfo); - fn_jpeg_destroy_decompress (&cinfo); + fn_jpeg_finish_decompress (&mgr->cinfo); + fn_jpeg_destroy_decompress (&mgr->cinfo); if (fp) - fclose ((FILE *) fp); + fclose (fp); /* Maybe fill in the background field while we have ximg handy. */ if (NILP (image_spec_value (img->spec, QCbackground, NULL))) @@ -6484,6 +6529,13 @@ jpeg_load (struct frame *f, struct image *img) return 1; } +static int +jpeg_load (struct frame *f, struct image *img) +{ + struct my_jpeg_error_mgr mgr; + return jpeg_load_body (f, img, &mgr); +} + #else /* HAVE_JPEG */ #ifdef HAVE_NS From 5f0cb45a6f6af1dea4d41f5da86fc3e36828c6d0 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 12 Sep 2012 18:22:08 -0700 Subject: [PATCH 04/88] Work around GCC and GNOME bugs when --enable-gcc-warnings. * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify', to work around GNOME bug 683906. * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber. (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp. This works around GCC bug 54561. --- src/ChangeLog | 9 +++++++++ src/emacsgtkfixed.c | 5 +++++ src/image.c | 8 ++++++++ 3 files changed, 22 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index c0d3316bea1..29e8ea4232e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2012-09-13 Paul Eggert + + Work around GCC and GNOME bugs when --enable-gcc-warnings. + * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify', + to work around GNOME bug 683906. + * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber. + (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp. + This works around GCC bug 54561. + 2012-09-12 Paul Eggert More fixes for 'volatile' and setjmp/longjmp. diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c index 940482654b3..a21d0f8a422 100644 --- a/src/emacsgtkfixed.c +++ b/src/emacsgtkfixed.c @@ -27,6 +27,11 @@ along with GNU Emacs. If not, see . */ #include "frame.h" #include "xterm.h" +/* Silence a bogus diagnostic; see GNOME bug 683906. */ +#include +#undef G_STATIC_ASSERT +#define G_STATIC_ASSERT(x) verify (x) + #define EMACS_TYPE_FIXED emacs_fixed_get_type () #define EMACS_FIXED(obj) \ G_TYPE_CHECK_INSTANCE_CAST (obj, EMACS_TYPE_FIXED, EmacsFixed) diff --git a/src/image.c b/src/image.c index cd5df99ef57..d4e54fb7dcd 100644 --- a/src/image.c +++ b/src/image.c @@ -6140,6 +6140,9 @@ struct my_jpeg_error_mgr MY_JPEG_INVALID_IMAGE_SIZE, MY_JPEG_CANNOT_CREATE_X } failure_code; +#ifdef lint + FILE *fp; +#endif }; @@ -6392,6 +6395,8 @@ jpeg_load_body (struct frame *f, struct image *img, return 0; } + IF_LINT (mgr->fp = fp); + /* Customize libjpeg's error handling to call my_error_exit when an error is detected. This function will perform a longjmp. */ mgr->cinfo.err = fn_jpeg_std_error (&mgr->pub); @@ -6430,6 +6435,9 @@ jpeg_load_body (struct frame *f, struct image *img, return 0; } + /* Silence a bogus diagnostic; see GCC bug 54561. */ + IF_LINT (fp = mgr->fp); + /* Create the JPEG decompression object. Let it read from fp. Read the JPEG image header. */ fn_jpeg_CreateDecompress (&mgr->cinfo, JPEG_LIB_VERSION, sizeof *&mgr->cinfo); From bd8d610845a89c2cf5d7d75ff552df572b30f5e7 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 12 Sep 2012 22:00:41 -0400 Subject: [PATCH 05/88] * lisp/emacs-lisp/edebug.el: Use lexical-binding. Remove the "edebug-" prefix from non-dynamically-scoped variables. Mark unused args with underscore. (edebug-save-restriction, edebug-outside-excursion): Use `declare'. (edebug-form-data): Use defvar-local. (edebug-make-before-and-after-form, edebug-make-after-form): Use backquote. (edebug-args, edebug-value, edebug-after-index, edebug-arg-mode): Not dynamically scoped any more. (edebug--enter-trace): Add arguments `function' and `args'. Rename from edebug-enter-trace. (edebug-enter): Call it accordingly. Bind edebug-function explicitly. (edebug--update-coverage): Add `after-index' and `value' args. Rename from edebug-update-coverage. (edebug-slow-after): Call it accordingly. (edebug--recursive-edit): Add arg `arg-mode'. Rename from edebug-recursive-edit. (edebug--display): Call it accordingly. Add args `value', `offset-index', and `arg-mode'. Rename from edebug-display. (edebug-debugger, edebug): Call it accordingly. (edebug-eval-display-list): Use dolist. --- lisp/ChangeLog | 24 +++ lisp/emacs-lisp/edebug.el | 380 ++++++++++++++++++-------------------- 2 files changed, 208 insertions(+), 196 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ecb110bc30e..f0bbd7558bc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,27 @@ +2012-09-13 Stefan Monnier + + * emacs-lisp/edebug.el: Use lexical-binding. + Remove the "edebug-" prefix from non-dynamically-scoped variables. + Mark unused args with underscore. + (edebug-save-restriction, edebug-outside-excursion): Use `declare'. + (edebug-form-data): Use defvar-local. + (edebug-make-before-and-after-form, edebug-make-after-form): + Use backquote. + (edebug-args, edebug-value, edebug-after-index, edebug-arg-mode): + Not dynamically scoped any more. + (edebug--enter-trace): Add arguments `function' and `args'. + Rename from edebug-enter-trace. + (edebug-enter): Call it accordingly. Bind edebug-function explicitly. + (edebug--update-coverage): Add `after-index' and `value' args. + Rename from edebug-update-coverage. + (edebug-slow-after): Call it accordingly. + (edebug--recursive-edit): Add arg `arg-mode'. Rename from + edebug-recursive-edit. + (edebug--display): Call it accordingly. Add args `value', + `offset-index', and `arg-mode'. Rename from edebug-display. + (edebug-debugger, edebug): Call it accordingly. + (edebug-eval-display-list): Use dolist. + 2012-09-12 Juri Linkov * info.el (Info-search): Don't check for isearch-mode and diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index f147fba167d..42260d12a82 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -1,4 +1,4 @@ -;;; edebug.el --- a source-level debugger for Emacs Lisp +;;; edebug.el --- a source-level debugger for Emacs Lisp -*- lexical-binding: t -*- ;; Copyright (C) 1988-1995, 1997, 1999-2012 Free Software Foundation, Inc. @@ -237,7 +237,7 @@ If the result is non-nil, then break. Errors are ignored." (defun get-edebug-spec (symbol) ;; Get the spec of symbol resolving all indirection. - (let ((edebug-form-spec nil) + (let ((spec nil) (indirect symbol)) (while (progn @@ -245,9 +245,8 @@ If the result is non-nil, then break. Errors are ignored." (setq indirect (function-get indirect 'edebug-form-spec 'macro)))) ;; (edebug-trace "indirection: %s" edebug-form-spec) - (setq edebug-form-spec indirect)) - edebug-form-spec - )) + (setq spec indirect)) + spec)) ;;;###autoload (defun edebug-basic-spec (spec) @@ -337,9 +336,7 @@ A lambda list keyword is a symbol that starts with `&'." (lambda (e1 e2) (funcall function (car e1) (car e2)))))) -;;(def-edebug-spec edebug-save-restriction t) - -;; Not used. If it is used, def-edebug-spec must be defined before use. +;; Not used. '(defmacro edebug-save-restriction (&rest body) "Evaluate BODY while saving the current buffers restriction. BODY may change buffer outside of current restriction, unlike @@ -347,6 +344,7 @@ save-restriction. BODY may change the current buffer, and the restriction will be restored to the original buffer, and the current buffer remains current. Return the result of the last expression in BODY." + (declare (debug t)) `(let ((edebug:s-r-beg (point-min-marker)) (edebug:s-r-end (point-max-marker))) (unwind-protect @@ -621,19 +619,19 @@ already is one.)" ;; The internal data that is needed for edebugging is kept in the ;; buffer-local variable `edebug-form-data'. -(make-variable-buffer-local 'edebug-form-data) +(defvar-local edebug-form-data nil + "A list of entries associating symbols with buffer regions. +This is an automatic buffer local variable. Each entry looks like: +\(SYMBOL BEGIN-MARKER END-MARKER). The markers +are at the beginning and end of an entry level form and SYMBOL is +a symbol that holds all edebug related information for the form on its +property list. -(defvar edebug-form-data nil) -;; A list of entries associating symbols with buffer regions. -;; This is an automatic buffer local variable. Each entry looks like: -;; @code{(@var{symbol} @var{begin-marker} @var{end-marker}). The markers -;; are at the beginning and end of an entry level form and @var{symbol} is -;; a symbol that holds all edebug related information for the form on its -;; property list. +In the future (haha!), the symbol will be irrelevant and edebug data will +be stored in the definitions themselves rather than in the property +list of a symbol.") -;; In the future, the symbol will be irrelevant and edebug data will -;; be stored in the definitions themselves rather than in the property -;; list of a symbol. +;; FIXME: Use cl-defstruct. (defun edebug-make-form-data-entry (symbol begin end) (list symbol begin end)) @@ -648,7 +646,7 @@ already is one.)" (nth 2 entry)) (defsubst edebug-set-form-data-entry (entry name begin end) - (setcar entry name);; in case name is changed + (setcar entry name) ;; In case name is changed. (set-marker (nth 1 entry) begin) (set-marker (nth 2 entry) end)) @@ -1081,7 +1079,8 @@ already is one.)" ;; If it gets an error, make it nil. (let ((temp-hook edebug-setup-hook)) (setq edebug-setup-hook nil) - (run-hooks 'temp-hook)) + (if (functionp temp-hook) (funcall temp-hook) + (mapc #'funcall temp-hook))) (let (result edebug-top-window-data @@ -1218,8 +1217,8 @@ already is one.)" (defvar edebug-offset-list) ; the list of offset positions. (defun edebug-inc-offset (offset) - ;; modifies edebug-offset-index and edebug-offset-list - ;; accesses edebug-func-marc and buffer point + ;; Modifies edebug-offset-index and edebug-offset-list + ;; accesses edebug-func-marc and buffer point. (prog1 edebug-offset-index (setq edebug-offset-list (cons (- offset edebug-form-begin-marker) @@ -1232,13 +1231,11 @@ already is one.)" ;; given FORM. Looks like: ;; (edebug-after (edebug-before BEFORE-INDEX) AFTER-INDEX FORM) ;; Also increment the offset index for subsequent use. - (list 'edebug-after - (list 'edebug-before before-index) - after-index form)) + `(edebug-after (edebug-before ,before-index) ,after-index ,form)) (defun edebug-make-after-form (form after-index) ;; Like edebug-make-before-and-after-form, but only after. - (list 'edebug-after 0 after-index form)) + `(edebug-after 0 ,after-index ,form)) (defun edebug-unwrap (sexp) @@ -1514,18 +1511,18 @@ expressions; a `progn' form will be returned enclosing these forms." ;; Otherwise it signals an error. The place of the error is found ;; with the two before- and after-offset functions. -(defun edebug-no-match (cursor &rest edebug-args) +(defun edebug-no-match (cursor &rest args) ;; Throw a no-match, or signal an error immediately if gate is active. ;; Remember this point in case we need to report this error. (setq edebug-error-point (or edebug-error-point (edebug-before-offset cursor)) - edebug-best-error (or edebug-best-error edebug-args)) + edebug-best-error (or edebug-best-error args)) (if (and edebug-gate (not edebug-&optional)) (progn (if edebug-error-point (goto-char edebug-error-point)) - (apply 'edebug-syntax-error edebug-args)) - (funcall 'throw 'no-match edebug-args))) + (apply 'edebug-syntax-error args)) + (funcall 'throw 'no-match args))) (defun edebug-match (cursor specs) @@ -1752,7 +1749,7 @@ expressions; a `progn' form will be returned enclosing these forms." specs)))) -(defun edebug-match-gate (cursor) +(defun edebug-match-gate (_cursor) ;; Simply set the gate to prevent backtracking at this level. (setq edebug-gate t) nil) @@ -1841,7 +1838,7 @@ expressions; a `progn' form will be returned enclosing these forms." nil)) -(defun edebug-match-function (cursor) +(defun edebug-match-function (_cursor) (error "Use function-form instead of function in edebug spec")) (defun edebug-match-&define (cursor specs) @@ -1898,7 +1895,7 @@ expressions; a `progn' form will be returned enclosing these forms." (edebug-move-cursor cursor) (list name))) -(defun edebug-match-colon-name (cursor spec) +(defun edebug-match-colon-name (_cursor spec) ;; Set the edebug-def-name to the spec. (setq edebug-def-name (if edebug-def-name @@ -1983,6 +1980,8 @@ expressions; a `progn' form will be returned enclosing these forms." def-body)) ;; FIXME? Isn't this missing the doc-string? Cf defun. (def-edebug-spec defmacro + ;; FIXME: Improve `declare' so we can Edebug gv-expander and + ;; gv-setter declarations. (&define name lambda-list [&optional ("declare" &rest sexp)] def-body)) (def-edebug-spec arglist lambda-list) ;; deprecated - use lambda-list. @@ -2162,10 +2161,7 @@ expressions; a `progn' form will be returned enclosing these forms." ;; Dynamically bound variables, declared globally but left unbound. (defvar edebug-function) ; the function being executed. change name!! -(defvar edebug-args) ; the arguments of the function (defvar edebug-data) ; the edebug data for the function -(defvar edebug-value) ; the result of the expression -(defvar edebug-after-index) (defvar edebug-def-mark) ; the mark for the definition (defvar edebug-freq-count) ; the count of expression visits. (defvar edebug-coverage) ; the coverage results of each expression of function. @@ -2191,7 +2187,7 @@ expressions; a `progn' form will be returned enclosing these forms." ;;; Handling signals -(defun edebug-signal (edebug-signal-name edebug-signal-data) +(defun edebug-signal (signal-name signal-data) "Signal an error. Args are SIGNAL-NAME, and associated DATA. A signal name is a symbol with an `error-conditions' property that is a list of condition names. @@ -2205,19 +2201,18 @@ See `condition-case'. This is the Edebug replacement for the standard `signal'. It should only be active while Edebug is. It checks `debug-on-error' to see whether it should call the debugger. When execution is resumed, the -error is signaled again. -\n(fn SIGNAL-NAME DATA)" - (if (and (listp debug-on-error) (memq edebug-signal-name debug-on-error)) - (edebug 'error (cons edebug-signal-name edebug-signal-data))) +error is signaled again." + (if (and (listp debug-on-error) (memq signal-name debug-on-error)) + (edebug 'error (cons signal-name signal-data))) ;; If we reach here without another non-local exit, then send signal again. ;; i.e. the signal is not continuable, yet. ;; Avoid infinite recursion. (let ((signal-hook-function nil)) - (signal edebug-signal-name edebug-signal-data))) + (signal signal-name signal-data))) ;;; Entering Edebug -(defun edebug-enter (edebug-function edebug-args edebug-body) +(defun edebug-enter (function args body) ;; Entering FUNC. The arguments are ARGS, and the body is BODY. ;; Setup edebug variables and evaluate BODY. This function is called ;; when a function evaluated with edebug-eval-top-level-form is entered. @@ -2226,50 +2221,51 @@ error is signaled again. ;; Is this the first time we are entering edebug since ;; lower-level recursive-edit command? ;; More precisely, this tests whether Edebug is currently active. - (if (not edebug-entered) - (let ((edebug-entered t) - ;; Binding max-lisp-eval-depth here is OK, - ;; but not inside an unwind-protect. - ;; Doing it here also keeps it from growing too large. - (max-lisp-eval-depth (+ 100 max-lisp-eval-depth)) ; too much?? - (max-specpdl-size (+ 200 max-specpdl-size)) + (let ((edebug-function function)) + (if (not edebug-entered) + (let ((edebug-entered t) + ;; Binding max-lisp-eval-depth here is OK, + ;; but not inside an unwind-protect. + ;; Doing it here also keeps it from growing too large. + (max-lisp-eval-depth (+ 100 max-lisp-eval-depth)) ; too much?? + (max-specpdl-size (+ 200 max-specpdl-size)) - (debugger edebug-debugger) ; only while edebug is active. - (edebug-outside-debug-on-error debug-on-error) - (edebug-outside-debug-on-quit debug-on-quit) - ;; Binding these may not be the right thing to do. - ;; We want to allow the global values to be changed. - (debug-on-error (or debug-on-error edebug-on-error)) - (debug-on-quit edebug-on-quit) + (debugger edebug-debugger) ; only while edebug is active. + (edebug-outside-debug-on-error debug-on-error) + (edebug-outside-debug-on-quit debug-on-quit) + ;; Binding these may not be the right thing to do. + ;; We want to allow the global values to be changed. + (debug-on-error (or debug-on-error edebug-on-error)) + (debug-on-quit edebug-on-quit) - ;; Lexical bindings must be uncompiled for this to work. - (cl-lexical-debug t)) - (unwind-protect - (let ((signal-hook-function 'edebug-signal)) - (setq edebug-execution-mode (or edebug-next-execution-mode - edebug-initial-mode - edebug-execution-mode) - edebug-next-execution-mode nil) - (edebug-enter edebug-function edebug-args edebug-body)))) + ;; Lexical bindings must be uncompiled for this to work. + (cl-lexical-debug t)) + (unwind-protect + (let ((signal-hook-function 'edebug-signal)) + (setq edebug-execution-mode (or edebug-next-execution-mode + edebug-initial-mode + edebug-execution-mode) + edebug-next-execution-mode nil) + (edebug-enter function args body)))) - (let* ((edebug-data (get edebug-function 'edebug)) - (edebug-def-mark (car edebug-data)) ; mark at def start - (edebug-freq-count (get edebug-function 'edebug-freq-count)) - (edebug-coverage (get edebug-function 'edebug-coverage)) - (edebug-buffer (marker-buffer edebug-def-mark)) + (let* ((edebug-data (get function 'edebug)) + (edebug-def-mark (car edebug-data)) ; mark at def start + (edebug-freq-count (get function 'edebug-freq-count)) + (edebug-coverage (get function 'edebug-coverage)) + (edebug-buffer (marker-buffer edebug-def-mark)) - (edebug-stack (cons edebug-function edebug-stack)) - (edebug-offset-indices (cons 0 edebug-offset-indices)) - ) - (if (get edebug-function 'edebug-on-entry) - (progn - (setq edebug-execution-mode 'step) - (if (eq (get edebug-function 'edebug-on-entry) 'temp) - (put edebug-function 'edebug-on-entry nil)))) - (if edebug-trace - (edebug-enter-trace edebug-body) - (funcall edebug-body)) - ))) + (edebug-stack (cons function edebug-stack)) + (edebug-offset-indices (cons 0 edebug-offset-indices)) + ) + (if (get function 'edebug-on-entry) + (progn + (setq edebug-execution-mode 'step) + (if (eq (get function 'edebug-on-entry) 'temp) + (put function 'edebug-on-entry nil)))) + (if edebug-trace + (edebug--enter-trace function args body) + (funcall body)) + )))) (defun edebug-var-status (var) "Return a cons cell describing the status of VAR's current binding. @@ -2296,14 +2292,14 @@ STATUS should be a list returned by `edebug-var-status'." (t (set var value))))) -(defun edebug-enter-trace (edebug-body) +(defun edebug--enter-trace (function args body) (let ((edebug-stack-depth (1+ edebug-stack-depth)) edebug-result) (edebug-print-trace-before - (format "%s args: %s" edebug-function edebug-args)) - (prog1 (setq edebug-result (funcall edebug-body)) + (format "%s args: %s" function args)) + (prog1 (setq edebug-result (funcall body)) (edebug-print-trace-after - (format "%s result: %s" edebug-function edebug-result))))) + (format "%s result: %s" function edebug-result))))) (def-edebug-spec edebug-tracing (form body)) @@ -2331,49 +2327,49 @@ MSG is printed after `::::} '." -(defun edebug-slow-before (edebug-before-index) +(defun edebug-slow-before (before-index) (unless edebug-active ;; Debug current function given BEFORE position. ;; Called from functions compiled with edebug-eval-top-level-form. ;; Return the before index. - (setcar edebug-offset-indices edebug-before-index) + (setcar edebug-offset-indices before-index) ;; Increment frequency count - (aset edebug-freq-count edebug-before-index - (1+ (aref edebug-freq-count edebug-before-index))) + (aset edebug-freq-count before-index + (1+ (aref edebug-freq-count before-index))) (if (or (not (memq edebug-execution-mode '(Go-nonstop next))) (edebug-input-pending-p)) - (edebug-debugger edebug-before-index 'before nil))) - edebug-before-index) + (edebug-debugger before-index 'before nil))) + before-index) -(defun edebug-fast-before (edebug-before-index) +(defun edebug-fast-before (_before-index) ;; Do nothing. ) -(defun edebug-slow-after (edebug-before-index edebug-after-index edebug-value) +(defun edebug-slow-after (_before-index after-index value) (if edebug-active - edebug-value + value ;; Debug current function given AFTER position and VALUE. ;; Called from functions compiled with edebug-eval-top-level-form. ;; Return VALUE. - (setcar edebug-offset-indices edebug-after-index) + (setcar edebug-offset-indices after-index) ;; Increment frequency count - (aset edebug-freq-count edebug-after-index - (1+ (aref edebug-freq-count edebug-after-index))) - (if edebug-test-coverage (edebug-update-coverage)) + (aset edebug-freq-count after-index + (1+ (aref edebug-freq-count after-index))) + (if edebug-test-coverage (edebug--update-coverage after-index value)) (if (and (eq edebug-execution-mode 'Go-nonstop) (not (edebug-input-pending-p))) ;; Just return result. - edebug-value - (edebug-debugger edebug-after-index 'after edebug-value) + value + (edebug-debugger after-index 'after value) ))) -(defun edebug-fast-after (edebug-before-index edebug-after-index edebug-value) +(defun edebug-fast-after (_before-index _after-index value) ;; Do nothing but return the value. - edebug-value) + value) (defun edebug-run-slow () (defalias 'edebug-before 'edebug-slow-before) @@ -2387,19 +2383,18 @@ MSG is printed after `::::} '." (edebug-run-slow) -(defun edebug-update-coverage () - (let ((old-result (aref edebug-coverage edebug-after-index))) +(defun edebug--update-coverage (after-index value) + (let ((old-result (aref edebug-coverage after-index))) (cond ((eq 'ok-coverage old-result)) ((eq 'unknown old-result) - (aset edebug-coverage edebug-after-index edebug-value)) + (aset edebug-coverage after-index value)) ;; Test if a different result. - ((not (eq edebug-value old-result)) - (aset edebug-coverage edebug-after-index 'ok-coverage))))) + ((not (eq value old-result)) + (aset edebug-coverage after-index 'ok-coverage))))) ;; Dynamically declared unbound variables. -(defvar edebug-arg-mode) ; the mode, either before, after, or error (defvar edebug-breakpoints) (defvar edebug-break-data) ; break data for current function. (defvar edebug-break) ; whether a break occurred. @@ -2410,16 +2405,16 @@ MSG is printed after `::::} '." (defvar edebug-global-break-result nil) -(defun edebug-debugger (edebug-offset-index edebug-arg-mode edebug-value) +(defun edebug-debugger (offset-index arg-mode value) (if inhibit-redisplay ;; Don't really try to enter edebug within an eval from redisplay. - edebug-value + value ;; Check breakpoints and pending input. - ;; If edebug display should be updated, call edebug-display. - ;; Return edebug-value. + ;; If edebug display should be updated, call edebug--display. + ;; Return value. (let* ( ;; This needs to be here since breakpoints may be changed. (edebug-breakpoints (car (cdr edebug-data))) ; list of breakpoints - (edebug-break-data (assq edebug-offset-index edebug-breakpoints)) + (edebug-break-data (assq offset-index edebug-breakpoints)) (edebug-break-condition (car (cdr edebug-break-data))) (edebug-global-break (if edebug-global-break-condition @@ -2430,7 +2425,7 @@ MSG is printed after `::::} '." (error nil)))) (edebug-break)) -;;; (edebug-trace "exp: %s" edebug-value) + ;;(edebug-trace "exp: %s" value) ;; Test whether we should break. (setq edebug-break (or edebug-global-break @@ -2451,10 +2446,9 @@ MSG is printed after `::::} '." (if (or (not (memq edebug-execution-mode '(go continue Continue-fast))) edebug-break (edebug-input-pending-p)) - (edebug-display)) ; <--------------- display + (edebug--display value offset-index arg-mode)) ; <---------- display - edebug-value - ))) + value))) ;; window-start now stored with each function. @@ -2487,7 +2481,7 @@ MSG is printed after `::::} '." (defalias 'edebug-mark-marker 'mark-marker) -(defun edebug-display () +(defun edebug--display (value offset-index arg-mode) (unless (marker-position edebug-def-mark) ;; The buffer holding the source has been killed. ;; Let's at least show a backtrace so the user can figure out @@ -2496,11 +2490,11 @@ MSG is printed after `::::} '." ;; Setup windows for edebug, determine mode, maybe enter recursive-edit. ;; Uses local variables of edebug-enter, edebug-before, edebug-after ;; and edebug-debugger. - (let ((edebug-active t) ; for minor mode alist + (let ((edebug-active t) ; For minor mode alist. (edebug-with-timeout-suspend (with-timeout-suspend)) - edebug-stop ; should we enter recursive-edit + edebug-stop ; Should we enter recursive-edit? (edebug-point (+ edebug-def-mark - (aref (nth 2 edebug-data) edebug-offset-index))) + (aref (nth 2 edebug-data) offset-index))) edebug-buffer-outside-point ; current point in edebug-buffer ;; window displaying edebug-buffer (edebug-window-data (nth 3 edebug-data)) @@ -2509,12 +2503,12 @@ MSG is printed after `::::} '." (edebug-outside-point (point)) (edebug-outside-mark (edebug-mark)) (edebug-outside-unread-command-events unread-command-events) - edebug-outside-windows ; window or screen configuration + edebug-outside-windows ; Window or screen configuration. edebug-buffer-points - edebug-eval-buffer ; declared here so we can kill it below - (edebug-eval-result-list (and edebug-eval-list - (edebug-eval-result-list))) + edebug-eval-buffer ; Declared here so we can kill it below. + (eval-result-list (and edebug-eval-list + (edebug-eval-result-list))) edebug-trace-window edebug-trace-window-start @@ -2535,9 +2529,9 @@ MSG is printed after `::::} '." (let ((debug-on-error nil)) (error "Buffer defining %s not found" edebug-function))) - (if (eq 'after edebug-arg-mode) + (if (eq 'after arg-mode) ;; Compute result string now before windows are modified. - (edebug-compute-previous-result edebug-value)) + (edebug-compute-previous-result value)) (if edebug-save-windows ;; Save windows now before we modify them. @@ -2561,7 +2555,7 @@ MSG is printed after `::::} '." ;; Now display eval list, if any. ;; This is done after the pop to edebug-buffer ;; so that buffer-window correspondence is correct after quitting. - (edebug-eval-display edebug-eval-result-list) + (edebug-eval-display eval-result-list) ;; The evaluation list better not have deleted edebug-window-data. (select-window (car edebug-window-data)) (set-buffer edebug-buffer) @@ -2569,7 +2563,7 @@ MSG is printed after `::::} '." (setq edebug-buffer-outside-point (point)) (goto-char edebug-point) - (if (eq 'before edebug-arg-mode) + (if (eq 'before arg-mode) ;; Check whether positions are up-to-date. ;; This assumes point is never before symbol. (if (not (memq (following-char) '(?\( ?\# ?\` ))) @@ -2593,14 +2587,14 @@ MSG is printed after `::::} '." (edebug-overlay-arrow) (cond - ((eq 'error edebug-arg-mode) + ((eq 'error arg-mode) ;; Display error message (setq edebug-execution-mode 'step) (edebug-overlay-arrow) (beep) - (if (eq 'quit (car edebug-value)) + (if (eq 'quit (car value)) (message "Quit") - (edebug-report-error edebug-value))) + (edebug-report-error value))) (edebug-break (cond (edebug-global-break @@ -2618,7 +2612,7 @@ MSG is printed after `::::} '." (t (message ""))) (setq unread-command-events nil) - (if (eq 'after edebug-arg-mode) + (if (eq 'after arg-mode) (progn ;; Display result of previous evaluation. (if (and edebug-break @@ -2642,11 +2636,11 @@ MSG is printed after `::::} '." (unwind-protect (if (or edebug-stop (memq edebug-execution-mode '(step next)) - (eq edebug-arg-mode 'error)) + (eq arg-mode 'error)) (progn ;; (setq edebug-execution-mode 'step) ;; (edebug-overlay-arrow) ; This doesn't always show up. - (edebug-recursive-edit))) ; <---------- Recursive edit + (edebug--recursive-edit arg-mode))) ; <----- Recursive edit ;; Reset the edebug-window-data to whatever it is now. (let ((window (if (eq (window-buffer) edebug-buffer) @@ -2775,7 +2769,7 @@ MSG is printed after `::::} '." (defvar edebug-outside-last-nonmenu-event) (defvar edebug-outside-track-mouse) -(defun edebug-recursive-edit () +(defun edebug--recursive-edit (arg-mode) ;; Start up a recursive edit inside of edebug. ;; The current buffer is the edebug-buffer, which is put into edebug-mode. ;; Assume that none of the variables below are buffer-local. @@ -2866,7 +2860,7 @@ MSG is printed after `::::} '." ) (if (and (eq edebug-execution-mode 'go) - (not (memq edebug-arg-mode '(after error)))) + (not (memq arg-mode '(after error)))) (message "Break")) (setq buffer-read-only t) @@ -3082,7 +3076,7 @@ before returning. The default is one second." ;; Joe Wells, here is a start at your idea of adding a buffer to the internal -;; display list. Still need to use this list in edebug-display. +;; display list. Still need to use this list in edebug--display. '(defvar edebug-display-buffer-list nil "List of buffers that edebug will display when it is active.") @@ -3517,11 +3511,10 @@ edebug-mode." ;;; Evaluation of expressions -(def-edebug-spec edebug-outside-excursion t) - (defmacro edebug-outside-excursion (&rest body) "Evaluate an expression list in the outside context. Return the result of the last expression." + (declare (debug t)) `(save-excursion ; of current-buffer (if edebug-save-windows (progn @@ -3555,7 +3548,7 @@ Return the result of the last expression." (pre-command-hook (cdr edebug-outside-pre-command-hook)) (post-command-hook (cdr edebug-outside-post-command-hook)) - ;; See edebug-display + ;; See edebug-display. (overlay-arrow-position edebug-outside-o-a-p) (overlay-arrow-string edebug-outside-o-a-s) (cursor-in-echo-area edebug-outside-c-i-e-a) @@ -3609,18 +3602,18 @@ Return the result of the last expression." (defvar cl-debug-env) ; defined in cl; non-nil when lexical env used. -(defun edebug-eval (edebug-expr) +(defun edebug-eval (expr) ;; Are there cl lexical variables active? (eval (if (bound-and-true-p cl-debug-env) - (cl-macroexpand-all edebug-expr cl-debug-env) - edebug-expr) + (cl-macroexpand-all expr cl-debug-env) + expr) lexical-binding)) -(defun edebug-safe-eval (edebug-expr) +(defun edebug-safe-eval (expr) ;; Evaluate EXPR safely. ;; If there is an error, a string is returned describing the error. (condition-case edebug-err - (edebug-eval edebug-expr) + (edebug-eval expr) (error (edebug-format "%s: %s" ;; could (get (car edebug-err) 'error-message) (car (cdr edebug-err)))))) @@ -3628,17 +3621,17 @@ Return the result of the last expression." ;;; Printing -(defun edebug-report-error (edebug-value) +(defun edebug-report-error (value) ;; Print an error message like command level does. ;; This also prints the error name if it has no error-message. (message "%s: %s" - (or (get (car edebug-value) 'error-message) - (format "peculiar error (%s)" (car edebug-value))) + (or (get (car value) 'error-message) + (format "peculiar error (%s)" (car value))) (mapconcat (function (lambda (edebug-arg) ;; continuing after an error may ;; complain about edebug-arg. why?? (prin1-to-string edebug-arg))) - (cdr edebug-value) ", "))) + (cdr value) ", "))) (defvar print-readably) ; defined by lemacs ;; Alternatively, we could change the definition of @@ -3654,14 +3647,14 @@ Return the result of the last expression." (edebug-prin1-to-string value) (error "#Apparently circular structure#")))) -(defun edebug-compute-previous-result (edebug-previous-value) +(defun edebug-compute-previous-result (previous-value) (if edebug-unwrap-results - (setq edebug-previous-value - (edebug-unwrap* edebug-previous-value))) + (setq previous-value + (edebug-unwrap* previous-value))) (setq edebug-previous-result (concat "Result: " - (edebug-safe-prin1-to-string edebug-previous-value) - (eval-expression-print-format edebug-previous-value)))) + (edebug-safe-prin1-to-string previous-value) + (eval-expression-print-format previous-value)))) (defun edebug-previous-result () "Print the previous result." @@ -3676,7 +3669,7 @@ Return the result of the last expression." (defalias 'edebug-format 'format) (defalias 'edebug-message 'message) -(defun edebug-eval-expression (edebug-expr) +(defun edebug-eval-expression (expr) "Evaluate an expression in the outside environment. If interactive, prompt for the expression. Print result in minibuffer." @@ -3685,7 +3678,7 @@ Print result in minibuffer." 'read-expression-history))) (princ (edebug-outside-excursion - (setq values (cons (edebug-eval edebug-expr) values)) + (setq values (cons (edebug-eval expr) values)) (concat (edebug-safe-prin1-to-string (car values)) (eval-expression-print-format (car values)))))) @@ -3699,14 +3692,14 @@ Print value in minibuffer." "Evaluate sexp before point in outside environment; insert value. This prints the value into current buffer." (interactive) - (let* ((edebug-form (edebug-last-sexp)) - (edebug-result-string + (let* ((form (edebug-last-sexp)) + (result-string (edebug-outside-excursion - (edebug-safe-prin1-to-string (edebug-safe-eval edebug-form)))) + (edebug-safe-prin1-to-string (edebug-safe-eval form)))) (standard-output (current-buffer))) (princ "\n") ;; princ the string to get rid of quotes. - (princ edebug-result-string) + (princ result-string) (princ "\n") )) @@ -3898,20 +3891,17 @@ Options: (edebug-trace nil)) (mapcar 'edebug-safe-eval edebug-eval-list))) -(defun edebug-eval-display-list (edebug-eval-result-list) +(defun edebug-eval-display-list (eval-result-list) ;; Assumes edebug-eval-buffer exists. - (let ((edebug-eval-list-temp edebug-eval-list) - (standard-output edebug-eval-buffer) + (let ((standard-output edebug-eval-buffer) (edebug-comment-line (format ";%s\n" (make-string (- (window-width) 2) ?-)))) (set-buffer edebug-eval-buffer) (erase-buffer) - (while edebug-eval-list-temp - (prin1 (car edebug-eval-list-temp)) (terpri) - (prin1 (car edebug-eval-result-list)) (terpri) - (princ edebug-comment-line) - (setq edebug-eval-list-temp (cdr edebug-eval-list-temp)) - (setq edebug-eval-result-list (cdr edebug-eval-result-list))) + (dolist (exp edebug-eval-list) + (prin1 exp) (terpri) + (prin1 (pop eval-result-list)) (terpri) + (princ edebug-comment-line)) (edebug-pop-to-buffer edebug-eval-buffer) )) @@ -3924,18 +3914,16 @@ Options: ;; Should generalize this to be callable outside of edebug ;; with calls in user functions, e.g. (edebug-eval-display) -(defun edebug-eval-display (edebug-eval-result-list) - "Display expressions and evaluations in EDEBUG-EVAL-RESULT-LIST. +(defun edebug-eval-display (eval-result-list) + "Display expressions and evaluations in EVAL-RESULT-LIST. It modifies the context by popping up the eval display." - (if edebug-eval-result-list - (progn - (edebug-create-eval-buffer) - (edebug-eval-display-list edebug-eval-result-list) - ))) + (when eval-result-list + (edebug-create-eval-buffer) + (edebug-eval-display-list eval-result-list))) (defun edebug-eval-redisplay () "Redisplay eval list in outside environment. -May only be called from within `edebug-recursive-edit'." +May only be called from within `edebug--recursive-edit'." (edebug-create-eval-buffer) (edebug-outside-excursion (edebug-eval-display-list (edebug-eval-result-list)) @@ -3997,8 +3985,8 @@ May only be called from within `edebug-recursive-edit'." (define-key map "\C-c\C-u" 'edebug-update-eval-list) (define-key map "\C-x\C-e" 'edebug-eval-last-sexp) (define-key map "\C-j" 'edebug-eval-print-last-sexp) - map) -"Keymap for Edebug Eval mode. Superset of Lisp Interaction mode.") + map) + "Keymap for Edebug Eval mode. Superset of Lisp Interaction mode.") (put 'edebug-eval-mode 'mode-class 'special) @@ -4025,32 +4013,32 @@ Global commands prefixed by `global-edebug-prefix': ;; since they depend on the backtrace looking a certain way. But ;; edebug is not dependent on this, yet. -(defun edebug (&optional edebug-arg-mode &rest debugger-args) +(defun edebug (&optional arg-mode &rest args) "Replacement for `debug'. If we are running an edebugged function, show where we last were. Otherwise call `debug' normally." -;; (message "entered: %s depth: %s edebug-recursion-depth: %s" -;; edebug-entered (recursion-depth) edebug-recursion-depth) (sit-for 1) + ;;(message "entered: %s depth: %s edebug-recursion-depth: %s" + ;; edebug-entered (recursion-depth) edebug-recursion-depth) (sit-for 1) (if (and edebug-entered ; anything active? (eq (recursion-depth) edebug-recursion-depth)) (let (;; Where were we before the error occurred? - (edebug-offset-index (car edebug-offset-indices)) - ;; Bind variables required by edebug-display - (edebug-value (car debugger-args)) + (offset-index (car edebug-offset-indices)) + (value (car args)) + ;; Bind variables required by edebug--display. edebug-breakpoints edebug-break-data edebug-break-condition edebug-global-break - (edebug-break (null edebug-arg-mode)) ;; if called explicitly + (edebug-break (null arg-mode)) ;; If called explicitly. ) - (edebug-display) - (if (eq edebug-arg-mode 'error) + (edebug--display value offset-index arg-mode) + (if (eq arg-mode 'error) nil - edebug-value)) + value)) ;; Otherwise call debug normally. ;; Still need to remove extraneous edebug calls from stack. - (apply 'debug edebug-arg-mode debugger-args) + (apply 'debug arg-mode args) )) @@ -4061,7 +4049,7 @@ Otherwise call `debug' normally." (null (buffer-name edebug-backtrace-buffer))) (setq edebug-backtrace-buffer (generate-new-buffer "*Backtrace*")) - ;; else, could just display edebug-backtrace-buffer + ;; Else, could just display edebug-backtrace-buffer. ) (with-output-to-temp-buffer (buffer-name edebug-backtrace-buffer) (setq edebug-backtrace-buffer standard-output) @@ -4083,7 +4071,7 @@ Otherwise call `debug' normally." (beginning-of-line) (cond ((looking-at "^ \(edebug-after") - ;; Previous lines may contain code, so just delete this line + ;; Previous lines may contain code, so just delete this line. (setq last-ok-point (point)) (forward-line 1) (delete-region last-ok-point (point))) From 4a4bbad21472cc0ede4691cbdbf8117b655b574f Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 12 Sep 2012 19:21:28 -0700 Subject: [PATCH 06/88] Simplify SIGIO usage. The code that dealt with SIGIO was crufty and confusing, e.g., it played tricks like "#undef SIGIO" but these tricks were not used consistently. Simplify mostly by not #undeffing standard symbols, e.g., use "defined USABLE_SIGIO" (our symbol, which we can define or not as we please) rather than "defined SIGIO" (standard symbol that we probably shouldn't #undef). * configure.ac (NO_TERMIO, BROKEN_FIONREAD, BROKEN_SIGAIO) (BROKEN_SIGPOLL, BROKEN_SIGPTY): Remove. (USABLE_FIONREAD, USABLE_SIGIO): New symbols. All uses of 'defined SIGIO' replaced with 'defined USABLE_SIGIO', with no need to #undef SIGIO now (which was error-prone). Likewise, all uses of 'defined FIONREAD' replaced with 'defined USABLE_FIONREAD'. * src/admin/CPP_DEFINES (BROKEN_SIGAIO, BROKEN_SIGIO, BROKEN_SIGPOLL) (BROKEN_SIGPTY, NO_TERMIO): Remove. * src/conf_post.h [USG5_4]: Do not include here. Modules that need it can include it. [USG5_4 && emacs]: Likewise, do not include the streams stuff here. * src/dispextern.h (ignore_sigio): New decl. * src/emacs.c (shut_down_emacs): Invoke unrequest_sigio unconditionally, since it's now a no-op if !USABLE_SIGIO. * src/emacs.c (shut_down_emacs): * src/keyboard.c (kbd_buffer_store_event_hold): Use ignore_sigio rather than invoking 'signal' directly. * src/keyboard.c (USABLE_FIONREAD && USG5_4): Include , for FIONREAD. (FIONREAD, SIGIO): Do not #undef. (tty_read_avail_input): Use #error rather than a syntax error. * src/process.c [USG5_4]: Include and , for I_PIPE, used by SETUP_SLAVE_PTY. (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD. * src/sysdep.c (croak): Remove; no longer needed. This bit of temporary code, with Fred N. Fish's comment that it's temporary, has been in Emacs since at least 1992! (init_sigio, reset_sigio, request_sigio, unrequest_sigio): Arrange for them to be no-ops in all cases when ! USABLE_SIGIO. * src/syssignal.h (croak): Remove decl. (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile. * src/systty.h [!NO_TERMIO]: Do not include ; no longer needed now that we're termios-only. (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef. * src/term.c (dissociate_if_controlling_tty): Use #error rather than a run-time error. Fixes: debbugs:12408 --- ChangeLog | 10 +++++ admin/CPP-DEFINES | 5 --- admin/ChangeLog | 6 +++ configure.ac | 60 +++++++++++++++++++++-------- src/ChangeLog | 36 +++++++++++++++++ src/blockinput.h | 13 ++----- src/conf_post.h | 16 -------- src/dispextern.h | 1 + src/dispnew.c | 2 +- src/emacs.c | 4 +- src/keyboard.c | 71 +++++++++++++--------------------- src/process.c | 29 +++++++------- src/sound.c | 12 +++--- src/sysdep.c | 98 +++++++++-------------------------------------- src/syssignal.h | 21 ---------- src/systty.h | 13 +------ src/term.c | 3 +- src/xterm.c | 4 +- 18 files changed, 171 insertions(+), 233 deletions(-) diff --git a/ChangeLog b/ChangeLog index a8a7fdc2966..96cb4b2b89c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2012-09-13 Paul Eggert + + Simplify SIGIO usage (Bug#12408). + * configure.ac (NO_TERMIO, BROKEN_FIONREAD, BROKEN_SIGAIO) + (BROKEN_SIGPOLL, BROKEN_SIGPTY): Remove. + (USABLE_FIONREAD, USABLE_SIGIO): New symbols. All uses of + 'defined SIGIO' replaced with 'defined USABLE_SIGIO', with no need + to #undef SIGIO now (which was error-prone). Likewise, all uses + of 'defined FIONREAD' replaced with 'defined USABLE_FIONREAD'. + 2012-09-12 Jan Djärv * configure.ac: No --with-x-toolkit given: Try gtk3 toolkit first diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES index cf6ffee2c63..834695d6c78 100644 --- a/admin/CPP-DEFINES +++ b/admin/CPP-DEFINES @@ -91,10 +91,6 @@ BROKEN_GET_CURRENT_DIR_NAME BROKEN_NON_BLOCKING_CONNECT BROKEN_PTY_READ_AFTER_EAGAIN BROKEN_SA_RESTART -BROKEN_SIGAIO -BROKEN_SIGIO -BROKEN_SIGPOLL -BROKEN_SIGPTY CLASH_DETECTION DATA_SEG_BITS DATA_START @@ -423,7 +419,6 @@ MAIL_USE_SYSTEM_LOCK MAXPATHLEN NLIST_STRUCT NO_EDITRES -NO_TERMIO NSIG NSIG_MINIMUM NULL_DEVICE diff --git a/admin/ChangeLog b/admin/ChangeLog index b70067d7465..25eed8af5e3 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,9 @@ +2012-09-13 Paul Eggert + + Simplify SIGIO usage (Bug#12408). + * CPP_DEFINES (BROKEN_SIGAIO, BROKEN_SIGIO, BROKEN_SIGPOLL) + (BROKEN_SIGPTY, NO_TERMIO): Remove. + 2012-09-11 Paul Eggert Simplify, document, and port floating-point (Bug#12381). diff --git a/configure.ac b/configure.ac index ed1849514c1..3761d814364 100644 --- a/configure.ac +++ b/configure.ac @@ -3271,10 +3271,6 @@ esac case $opsys in - darwin | gnu | hpux* | *bsd ) - AC_DEFINE(NO_TERMIO, 1, [Define if termio.h should not be included.]) - ;; - irix6-5 | sol2* | unixware ) dnl Some SVr4s don't define NSIG in sys/signal.h for ANSI environments; dnl instead, there's a system variable _sys_nsig. Unfortunately, we @@ -3284,26 +3280,16 @@ case $opsys in ;; esac +emacs_broken_SIGIO=no case $opsys in dnl SIGIO exists, but the feature doesn't work in the way Emacs needs. dnl See eg . hpux* | irix6-5 | openbsd | sol2* | unixware ) - AC_DEFINE(BROKEN_SIGIO, 1, [Define if SIGIO should not be used.]) + emacs_broken_SIGIO=yes ;; aix4-2) - dnl BUILD 9008 - FIONREAD problem still exists in X-Windows. - AC_DEFINE(BROKEN_FIONREAD, 1, [Define if FIONREAD should not be used.]) - dnl As we define BROKEN_FIONREAD, SIGIO will be undefined in systty.h. - dnl But, on AIX, SIGAIO, SIGPTY, and SIGPOLL are defined as SIGIO, - dnl which causes compilation error at init_signals in sysdep.c. - dnl So, we define these macros so that syssignal.h detects them - dnl and undefine SIGAIO, SIGPTY and SIGPOLL. - AC_DEFINE(BROKEN_SIGAIO, 1, [Define if SIGAIO should not be used.]) - AC_DEFINE(BROKEN_SIGPOLL,1, [Define if SIGPOLL should not be used.]) - AC_DEFINE(BROKEN_SIGPTY, 1, [Define if SIGPTY should not be used.]) - dnl On AIX Emacs uses the gmalloc.c malloc implementation. But given dnl the way this system works, libc functions that return malloced dnl memory use the libc malloc implementation. Calling xfree or @@ -3379,7 +3365,7 @@ dnl The choice is controlled by the variable interrupt_input. dnl dnl Define INTERRUPT_INPUT to make interrupt_input = 1 the default (use SIGIO) dnl -dnl Emacs uses the presence or absence of the SIGIO and BROKEN_SIGIO macros +dnl Emacs uses the presence of the USABLE_SIGIO macro dnl to indicate whether or not signal-driven I/O is possible. It uses dnl INTERRUPT_INPUT to decide whether to use it by default. dnl @@ -3900,6 +3886,46 @@ case $opsys in ;; esac +AC_CACHE_CHECK([for usable FIONREAD], [emacs_cv_usable_FIONREAD], + [case $opsys in + aix4-2) + dnl BUILD 9008 - FIONREAD problem still exists in X-Windows. + emacs_cv_usable_FIONREAD=no + ;; + + *) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include + #include + #ifdef USG5_4 + # include + #endif + ]], + [[int foo = ioctl (0, FIONREAD, &foo);]])], + [emacs_cv_usable_FIONREAD=yes], + [emacs_cv_usable_FIONREAD=no]) + ;; + esac]) +if test $emacs_cv_usable_FIONREAD = yes; then + AC_DEFINE([USABLE_FIONREAD], [1], [Define to 1 if FIONREAD is usable.]) + + if test $emacs_broken_SIGIO = no; then + AC_CACHE_CHECK([for usable SIGIO], [emacs_cv_usable_SIGIO], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include + #include + ]], + [[int foo = SIGIO | F_SETFL | FASYNC;]])], + [emacs_cv_usable_SIGIO=yes], + [emacs_cv_usable_SIGIO=no])], + [emacs_cv_usable_SIGIO=yes], + [emacs_cv_usable_SIGIO=no]) + if test $emacs_cv_usable_SIGIO = yes; then + AC_DEFINE([USABLE_SIGIO], [1], [Define to 1 if SIGIO is usable.]) + fi + fi +fi + case $opsys in dnl Emacs supplies its own malloc, but glib (part of Gtk+) calls diff --git a/src/ChangeLog b/src/ChangeLog index 29e8ea4232e..c8588b973f8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,41 @@ 2012-09-13 Paul Eggert + Simplify SIGIO usage (Bug#12408). + The code that dealt with SIGIO was crufty and confusing, e.g., it + played tricks like "#undef SIGIO" but these tricks were not used + consistently. Simplify mostly by not #undeffing standard symbols, + e.g., use "defined USABLE_SIGIO" (our symbol, which we can define + or not as we please) rather than "defined SIGIO" (standard symbol + that we probably shouldn't #undef). + * conf_post.h [USG5_4]: Do not include here. + Modules that need it can include it. + [USG5_4 && emacs]: Likewise, do not include the streams stuff here. + * dispextern.h (ignore_sigio): New decl. + * emacs.c (shut_down_emacs): Invoke unrequest_sigio + unconditionally, since it's now a no-op if !USABLE_SIGIO. + * emacs.c (shut_down_emacs): + * keyboard.c (kbd_buffer_store_event_hold): + Use ignore_sigio rather than invoking 'signal' directly. + * keyboard.c (USABLE_FIONREAD && USG5_4): Include , + for FIONREAD. + (FIONREAD, SIGIO): Do not #undef. + (tty_read_avail_input): Use #error rather than a syntax error. + * process.c [USG5_4]: Include and , + for I_PIPE, used by SETUP_SLAVE_PTY. + (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD. + * sysdep.c (croak): Remove; no longer needed. This bit of + temporary code, with Fred N. Fish's comment that it's temporary, + has been in Emacs since at least 1992! + (init_sigio, reset_sigio, request_sigio, unrequest_sigio): + Arrange for them to be no-ops in all cases when ! USABLE_SIGIO. + * syssignal.h (croak): Remove decl. + (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile. + * systty.h [!NO_TERMIO]: Do not include ; no longer needed + now that we're termios-only. + (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef. + * term.c (dissociate_if_controlling_tty): Use #error rather than + a run-time error. + Work around GCC and GNOME bugs when --enable-gcc-warnings. * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify', to work around GNOME bug 683906. diff --git a/src/blockinput.h b/src/blockinput.h index 3f61b2b27b9..7501bfc91a0 100644 --- a/src/blockinput.h +++ b/src/blockinput.h @@ -67,15 +67,10 @@ extern int pending_atimers; If doing signal-driven input, and a signal came in when input was blocked, reinvoke the signal handler now to deal with it. - We used to have two possible definitions of this macro - one for - when SIGIO was #defined, and one for when it wasn't; when SIGIO - wasn't #defined, we wouldn't bother to check if we should re-invoke - the signal handler. But that doesn't work very well; some of the - files which use this macro don't #include the right files to get - SIGIO. - - So, we always test interrupt_input_pending now; that's not too - expensive, and it'll never get set if we don't need to resignal. */ + Always test interrupt_input_pending; that's not too expensive, and + it'll never get set if we don't need to resignal. This is simpler + than dealing here with every configuration option that might affect + whether interrupt_input_pending can be nonzero. */ #define UNBLOCK_INPUT \ do \ diff --git a/src/conf_post.h b/src/conf_post.h index 1bf40af260b..94934ffeadf 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -133,22 +133,6 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */ #endif #endif /* MSDOS */ -#ifdef USG5_4 -/* Get FIONREAD from . Get to get struct tchars. - But get first to make sure ttold.h doesn't interfere. */ -#include - -#ifdef emacs -#include -#include -#include -#include -#include -#include -#include -#endif -#endif /* USG5_4 */ - /* Mac OS X / GNUstep need a bit more pure memory. Of the existing knobs, SYSTEM_PURESIZE_EXTRA seems like the least likely to cause problems. */ #ifdef HAVE_NS diff --git a/src/dispextern.h b/src/dispextern.h index 73f3350713f..365e8bcdcee 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -3193,6 +3193,7 @@ void unrequest_sigio (void); int tabs_safe_p (int); void init_baud_rate (int); void init_sigio (int); +void ignore_sigio (void); /* Defined in xfaces.c */ diff --git a/src/dispnew.c b/src/dispnew.c index fae415dcaf2..f6186e86048 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -5971,7 +5971,7 @@ sit_for (Lisp_Object timeout, bool reading, int do_display) wrong_type_argument (Qnumberp, timeout); -#ifdef SIGIO +#ifdef USABLE_SIGIO gobble_input (0); #endif diff --git a/src/emacs.c b/src/emacs.c index deaed25d9e8..e8150631311 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2035,12 +2035,10 @@ shut_down_emacs (int sig, Lisp_Object stuff) unlock_all_files (); #endif -#ifdef SIGIO /* There is a tendency for a SIGIO signal to arrive within exit, and cause a SIGHUP because the input descriptor is already closed. */ unrequest_sigio (); - signal (SIGIO, SIG_IGN); -#endif + ignore_sigio (); #ifdef WINDOWSNT term_ntproc (); diff --git a/src/keyboard.c b/src/keyboard.c index 7be3e9e118e..aec9028ae94 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -56,6 +56,10 @@ along with GNU Emacs. If not, see . */ #include #endif /* not MSDOS */ +#if defined USABLE_FIONREAD && defined USG5_4 +# include +#endif + #include "syssignal.h" #include @@ -385,19 +389,6 @@ int interrupt_input; /* Nonzero while interrupts are temporarily deferred during redisplay. */ int interrupts_deferred; -/* Allow configure to inhibit use of FIONREAD. */ -#ifdef BROKEN_FIONREAD -#undef FIONREAD -#endif - -/* We are unable to use interrupts if FIONREAD is not available, - so flush SIGIO so we won't try. */ -#if !defined (FIONREAD) -#ifdef SIGIO -#undef SIGIO -#endif -#endif - /* If we support a window system, turn on the code to poll periodically to detect C-g. It isn't actually used when doing interrupt input. */ #if defined (HAVE_WINDOW_SYSTEM) && !defined (USE_ASYNC_EVENTS) @@ -448,7 +439,7 @@ static void restore_getcjmp (jmp_buf); static Lisp_Object apply_modifiers (int, Lisp_Object); static void clear_event (struct input_event *); static Lisp_Object restore_kboard_configuration (Lisp_Object); -#ifdef SIGIO +#ifdef USABLE_SIGIO static void deliver_input_available_signal (int signo); #endif static void handle_interrupt (void); @@ -3646,10 +3637,8 @@ kbd_buffer_store_event_hold (register struct input_event *event, /* Don't read keyboard input until we have processed kbd_buffer. This happens when pasting text longer than KBD_BUFFER_SIZE/2. */ hold_keyboard_input (); -#ifdef SIGIO if (!noninteractive) - signal (SIGIO, SIG_IGN); -#endif + ignore_sigio (); stop_polling (); } #endif /* subprocesses */ @@ -3818,14 +3807,14 @@ kbd_buffer_get_event (KBOARD **kbp, /* Start reading input again, we have processed enough so we can accept new events again. */ unhold_keyboard_input (); -#ifdef SIGIO +#ifdef USABLE_SIGIO if (!noninteractive) { struct sigaction action; emacs_sigaction_init (&action, deliver_input_available_signal); sigaction (SIGIO, &action, 0); } -#endif /* SIGIO */ +#endif start_polling (); } #endif /* subprocesses */ @@ -3867,10 +3856,9 @@ kbd_buffer_get_event (KBOARD **kbp, /* One way or another, wait until input is available; then, if interrupt handlers have not read it, read it now. */ -/* Note SIGIO has been undef'd if FIONREAD is missing. */ -#ifdef SIGIO +#ifdef USABLE_SIGIO gobble_input (0); -#endif /* SIGIO */ +#endif if (kbd_fetch_ptr != kbd_store_ptr) break; #if defined (HAVE_MOUSE) || defined (HAVE_GPM) @@ -6769,7 +6757,7 @@ get_input_pending (int *addr, int flags) void gobble_input (int expected) { -#ifdef SIGIO +#ifdef USABLE_SIGIO if (interrupt_input) { sigset_t blocked, procmask; @@ -6824,7 +6812,7 @@ record_asynch_buffer_change (void) return; /* Make sure no interrupt happens while storing the event. */ -#ifdef SIGIO +#ifdef USABLE_SIGIO if (interrupt_input) { sigset_t blocked, procmask; @@ -7050,7 +7038,7 @@ tty_read_avail_input (struct terminal *terminal, #endif /* HAVE_GPM */ /* Determine how many characters we should *try* to read. */ -#ifdef FIONREAD +#ifdef USABLE_FIONREAD /* Find out how much input is available. */ if (ioctl (fileno (tty->input), FIONREAD, &n_to_read) < 0) { @@ -7063,14 +7051,12 @@ tty_read_avail_input (struct terminal *terminal, return 0; if (n_to_read > sizeof cbuf) n_to_read = sizeof cbuf; -#else /* no FIONREAD */ -#if defined (USG) || defined (CYGWIN) +#elif defined USG || defined CYGWIN /* Read some input if available, but don't wait. */ n_to_read = sizeof cbuf; fcntl (fileno (tty->input), F_SETFL, O_NDELAY); #else - you lose; -#endif +# error "Cannot read without possibly delaying" #endif #ifdef subprocesses @@ -7119,7 +7105,7 @@ tty_read_avail_input (struct terminal *terminal, #endif ); -#ifndef FIONREAD +#ifndef USABLE_FIONREAD #if defined (USG) || defined (CYGWIN) fcntl (fileno (tty->input), F_SETFL, 0); #endif /* USG or CYGWIN */ @@ -7190,7 +7176,7 @@ tty_read_avail_input (struct terminal *terminal, return nread; } -#if defined SYNC_INPUT || defined SIGIO +#if defined SYNC_INPUT || defined USABLE_SIGIO static void handle_async_input (void) { @@ -7217,7 +7203,7 @@ handle_async_input (void) --handling_signal; #endif } -#endif /* SYNC_INPUT || SIGIO */ +#endif /* SYNC_INPUT || USABLE_SIGIO */ #ifdef SYNC_INPUT void @@ -7229,8 +7215,7 @@ process_pending_signals (void) } #endif -#ifdef SIGIO /* for entire page */ -/* Note SIGIO has been undef'd if FIONREAD is missing. */ +#ifdef USABLE_SIGIO static void handle_input_available_signal (int sig) @@ -7253,7 +7238,7 @@ deliver_input_available_signal (int sig) { handle_on_main_thread (sig, handle_input_available_signal); } -#endif /* SIGIO */ +#endif /* USABLE_SIGIO */ /* Send ourselves a SIGIO. @@ -7264,7 +7249,7 @@ deliver_input_available_signal (int sig) void reinvoke_input_signal (void) { -#ifdef SIGIO +#ifdef USABLE_SIGIO handle_async_input (); #endif } @@ -7338,7 +7323,7 @@ handle_user_signal (int sig) } p->npending++; -#ifdef SIGIO +#ifdef USABLE_SIGIO if (interrupt_input) kill (getpid (), SIGIO); else @@ -11007,8 +10992,7 @@ See also `current-input-mode'. */) (Lisp_Object interrupt) { int new_interrupt_input; -#ifdef SIGIO -/* Note SIGIO has been undef'd if FIONREAD is missing. */ +#ifdef USABLE_SIGIO #ifdef HAVE_X_WINDOWS if (x_display_list != NULL) { @@ -11019,9 +11003,9 @@ See also `current-input-mode'. */) else #endif /* HAVE_X_WINDOWS */ new_interrupt_input = !NILP (interrupt); -#else /* not SIGIO */ +#else /* not USABLE_SIGIO */ new_interrupt_input = 0; -#endif /* not SIGIO */ +#endif /* not USABLE_SIGIO */ if (new_interrupt_input != interrupt_input) { @@ -11415,15 +11399,14 @@ init_keyboard (void) sigaction (SIGQUIT, &action, 0); #endif /* not DOS_NT */ } -/* Note SIGIO has been undef'd if FIONREAD is missing. */ -#ifdef SIGIO +#ifdef USABLE_SIGIO if (!noninteractive) { struct sigaction action; emacs_sigaction_init (&action, deliver_input_available_signal); sigaction (SIGIO, &action, 0); } -#endif /* SIGIO */ +#endif /* Use interrupt input by default, if it works and noninterrupt input has deficiencies. */ diff --git a/src/process.c b/src/process.c index f80b5e80c76..b4b05a4b2e2 100644 --- a/src/process.c +++ b/src/process.c @@ -75,6 +75,11 @@ along with GNU Emacs. If not, see . */ #include #endif +#ifdef USG5_4 +# include +# include +#endif + #ifdef HAVE_RES_INIT #include #include @@ -212,17 +217,13 @@ static EMACS_INT update_tick; "non-destructive" select. So we require either native select, or emulation of select using FIONREAD. */ -#ifdef BROKEN_DATAGRAM_SOCKETS -#undef DATAGRAM_SOCKETS -#else -#ifndef DATAGRAM_SOCKETS -#if defined (HAVE_SELECT) || defined (FIONREAD) -#if defined (HAVE_SENDTO) && defined (HAVE_RECVFROM) && defined (EMSGSIZE) -#define DATAGRAM_SOCKETS -#endif /* HAVE_SENDTO && HAVE_RECVFROM && EMSGSIZE */ -#endif /* HAVE_SELECT || FIONREAD */ -#endif /* DATAGRAM_SOCKETS */ -#endif /* BROKEN_DATAGRAM_SOCKETS */ +#ifndef BROKEN_DATAGRAM_SOCKETS +# if defined HAVE_SELECT || defined USABLE_FIONREAD +# if defined HAVE_SENDTO && defined HAVE_RECVFROM && defined EMSGSIZE +# define DATAGRAM_SOCKETS +# endif +# endif +#endif #if defined HAVE_LOCAL_SOCKETS && defined DATAGRAM_SOCKETS # define HAVE_SEQPACKET @@ -251,7 +252,7 @@ static int process_output_skip; #endif static void create_process (Lisp_Object, char **, Lisp_Object); -#ifdef SIGIO +#ifdef USABLE_SIGIO static int keyboard_bit_set (SELECT_TYPE *); #endif static void deactivate_process (Lisp_Object); @@ -4836,7 +4837,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell))) break; -#ifdef SIGIO +#ifdef USABLE_SIGIO /* If we think we have keyboard input waiting, but didn't get SIGIO, go read it. This can happen with X on BSD after logging out. In that case, there really is no input and no SIGIO, @@ -6853,7 +6854,7 @@ delete_gpm_wait_descriptor (int desc) # endif -# ifdef SIGIO +# ifdef USABLE_SIGIO /* Return nonzero if *MASK has a bit set that corresponds to one of the keyboard input descriptors. */ diff --git a/src/sound.c b/src/sound.c index 5729d704b6a..fe48bb277b2 100644 --- a/src/sound.c +++ b/src/sound.c @@ -314,7 +314,7 @@ sound_perror (const char *msg) int saved_errno = errno; turn_on_atimers (1); -#ifdef SIGIO +#ifdef USABLE_SIGIO { sigset_t unblocked; sigemptyset (&unblocked); @@ -732,7 +732,7 @@ static void vox_configure (struct sound_device *sd) { int val; -#ifdef SIGIO +#ifdef USABLE_SIGIO sigset_t blocked; #endif @@ -742,7 +742,7 @@ vox_configure (struct sound_device *sd) interrupted by a signal. Block the ones we know to cause troubles. */ turn_on_atimers (0); -#ifdef SIGIO +#ifdef USABLE_SIGIO sigemptyset (&blocked); sigaddset (&blocked, SIGIO); pthread_sigmask (SIG_BLOCK, &blocked, 0); @@ -778,7 +778,7 @@ vox_configure (struct sound_device *sd) } turn_on_atimers (1); -#ifdef SIGIO +#ifdef USABLE_SIGIO pthread_sigmask (SIG_UNBLOCK, &blocked, 0); #endif } @@ -794,7 +794,7 @@ vox_close (struct sound_device *sd) /* On GNU/Linux, it seems that the device driver doesn't like to be interrupted by a signal. Block the ones we know to cause troubles. */ -#ifdef SIGIO +#ifdef USABLE_SIGIO sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGIO); @@ -806,7 +806,7 @@ vox_close (struct sound_device *sd) ioctl (sd->fd, SNDCTL_DSP_SYNC, NULL); turn_on_atimers (1); -#ifdef SIGIO +#ifdef USABLE_SIGIO pthread_sigmask (SIG_UNBLOCK, &blocked, 0); #endif diff --git a/src/sysdep.c b/src/sysdep.c index 0f16d1a7645..b8f35e79146 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -107,9 +107,6 @@ extern char *getwd (char *); static int emacs_get_tty (int, struct emacs_tty *); static int emacs_set_tty (int, struct emacs_tty *, int); -#if defined TIOCNOTTY || defined USG5 || defined CYGWIN -static _Noreturn void croak (char *); -#endif /* ULLONG_MAX is missing on Red Hat Linux 7.3; see Bug#11781. */ #ifndef ULLONG_MAX @@ -513,7 +510,7 @@ sys_subshell (void) saved_handlers[0].code = SIGINT; saved_handlers[1].code = SIGQUIT; saved_handlers[2].code = SIGTERM; -#ifdef SIGIO +#ifdef USABLE_SIGIO saved_handlers[3].code = SIGIO; saved_handlers[4].code = 0; #else @@ -642,121 +639,75 @@ restore_signal_handlers (struct save_signal *saved_handlers) } } -#ifndef SIGIO -/* If SIGIO is broken, don't do anything. */ -void -init_sigio (int fd) -{ -} - -static void -reset_sigio (int fd) -{ -} - -void -request_sigio (void) -{ -} - -void -unrequest_sigio (void) -{ -} - -#else -#ifdef F_SETFL - +#ifdef USABLE_SIGIO static int old_fcntl_flags[MAXDESC]; +#endif void init_sigio (int fd) { -#ifdef FASYNC +#ifdef USABLE_SIGIO old_fcntl_flags[fd] = fcntl (fd, F_GETFL, 0) & ~FASYNC; fcntl (fd, F_SETFL, old_fcntl_flags[fd] | FASYNC); -#endif interrupts_deferred = 0; +#endif } static void reset_sigio (int fd) { -#ifdef FASYNC +#ifdef USABLE_SIGIO fcntl (fd, F_SETFL, old_fcntl_flags[fd]); #endif } -#ifdef FASYNC /* F_SETFL does not imply existence of FASYNC */ -/* XXX Uhm, FASYNC is not used anymore here. */ -/* XXX Yeah, but you need it for SIGIO, don't you? */ - void request_sigio (void) { +#ifdef USABLE_SIGIO sigset_t unblocked; if (noninteractive) return; sigemptyset (&unblocked); -#ifdef SIGWINCH +# ifdef SIGWINCH sigaddset (&unblocked, SIGWINCH); -#endif +# endif sigaddset (&unblocked, SIGIO); pthread_sigmask (SIG_UNBLOCK, &unblocked, 0); interrupts_deferred = 0; +#endif } void unrequest_sigio (void) { +#ifdef USABLE_SIGIO sigset_t blocked; if (noninteractive) return; -#if 0 /* XXX What's wrong with blocking SIGIO under X? */ - if (x_display_list) - return; -#endif - sigemptyset (&blocked); -#ifdef SIGWINCH +# ifdef SIGWINCH sigaddset (&blocked, SIGWINCH); -#endif +# endif sigaddset (&blocked, SIGIO); pthread_sigmask (SIG_BLOCK, &blocked, 0); interrupts_deferred = 1; -} - -#else /* no FASYNC */ -#ifndef MSDOS - -void -request_sigio (void) -{ - if (noninteractive || read_socket_hook) - return; - - croak ("request_sigio"); +#endif } void -unrequest_sigio (void) +ignore_sigio (void) { - if (noninteractive || read_socket_hook) - return; - - croak ("unrequest_sigio"); +#ifdef USABLE_SIGIO + signal (SIGIO, SIG_IGN); +#endif } -#endif /* MSDOS */ -#endif /* FASYNC */ -#endif /* F_SETFL */ -#endif /* SIGIO */ - /* Getting and setting emacs_tty structures. */ @@ -2051,19 +2002,6 @@ getwd (char *pathname) } #endif /* !defined (HAVE_GETWD) || defined (BROKEN_GETWD) */ - -/* - * This function will go away as soon as all the stubs fixed. (fnf) - */ - -void -croak (char *badfunc) -{ - printf ("%s not yet implemented\r\n", badfunc); - reset_all_sys_modes (); - exit (1); -} - #endif /* USG */ /* Directory routines for systems that don't have them. */ diff --git a/src/syssignal.h b/src/syssignal.h index c5529ae718a..5e733dd812d 100644 --- a/src/syssignal.h +++ b/src/syssignal.h @@ -34,27 +34,6 @@ typedef void (*signal_handler_t) (int); extern void emacs_sigaction_init (struct sigaction *, signal_handler_t); -#if ! (defined TIOCNOTTY || defined USG5 || defined CYGWIN) -_Noreturn void croak (char *); -#endif - -/* Interrupt input is not used if there is no FIONREAD. */ -#include -#if defined BROKEN_SIGIO || ! defined FIONREAD || defined BROKEN_FIONREAD -# undef SIGIO -#endif - -/* These are only used by AIX */ -#if defined (SIGPOLL) && defined (BROKEN_SIGPOLL) -#undef SIGPOLL -#endif -#if defined (SIGAIO) && defined (BROKEN_SIGAIO) -#undef SIGAIO -#endif -#if defined (SIGPTY) && defined (BROKEN_SIGPTY) -#undef SIGPTY -#endif - #if NSIG < NSIG_MINIMUM # undef NSIG # define NSIG NSIG_MINIMUM diff --git a/src/systty.h b/src/systty.h index b660441a91e..b7f36c6c259 100644 --- a/src/systty.h +++ b/src/systty.h @@ -17,10 +17,8 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ /* Include the proper files. */ + #ifndef DOS_NT -#ifndef NO_TERMIO -#include -#endif /* not NO_TERMIO */ #include #include #endif /* not DOS_NT */ @@ -38,15 +36,6 @@ along with GNU Emacs. If not, see . */ #include - -/* Special cases - inhibiting the use of certain features. */ - -/* Allow configure to inhibit use of FIONREAD. */ -#ifdef BROKEN_FIONREAD -#undef FIONREAD -#undef ASYNC -#endif - /* Try to establish the correct character to disable terminal functions in a system-independent manner. Note that USG (at least) define diff --git a/src/term.c b/src/term.c index 0eaf76a13df..47bde5ac240 100644 --- a/src/term.c +++ b/src/term.c @@ -2944,8 +2944,7 @@ dissociate_if_controlling_tty (int fd) emacs_close (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); #else - /* Unknown system. */ - croak (); +# error "Unknown system." #endif /* ! TIOCNOTTY */ #endif /* ! USG */ } diff --git a/src/xterm.c b/src/xterm.c index e5a5932beae..54d4f14bdd0 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -7878,7 +7878,7 @@ For details, see etc/PROBLEMS.\n", { sigset_t unblocked; sigemptyset (&unblocked); -#ifdef SIGIO +#ifdef USABLE_SIGIO sigaddset (&unblocked, SIGIO); #endif sigaddset (&unblocked, SIGALRM); @@ -10421,10 +10421,8 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) fcntl (connection, F_SETOWN, getpid ()); #endif /* ! defined (F_SETOWN) */ -#ifdef SIGIO if (interrupt_input) init_sigio (connection); -#endif /* ! defined (SIGIO) */ #ifdef USE_LUCID { From c0c54fbddf0784b84b04f38aabee47067a920863 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 12 Sep 2012 22:29:05 -0400 Subject: [PATCH 07/88] * lisp/emacs-lisp/edebug.el (edebug-outside-unread-command-events): Fix last change. (edebug-update-eval-list): Use `push'. --- lisp/ChangeLog | 4 ++++ lisp/emacs-lisp/edebug.el | 13 ++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f0bbd7558bc..89cc2106ba0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2012-09-13 Stefan Monnier + * emacs-lisp/edebug.el (edebug-outside-unread-command-events): + Fix last change. + (edebug-update-eval-list): Use `push'. + * emacs-lisp/edebug.el: Use lexical-binding. Remove the "edebug-" prefix from non-dynamically-scoped variables. Mark unused args with underscore. diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 42260d12a82..8f0f24ad092 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -2480,6 +2480,7 @@ MSG is printed after `::::} '." ;; Emacs 19 adds an arg to mark and mark-marker. (defalias 'edebug-mark-marker 'mark-marker) +(defvar edebug-outside-unread-command-events) (defun edebug--display (value offset-index arg-mode) (unless (marker-position edebug-def-mark) @@ -2763,7 +2764,6 @@ MSG is printed after `::::} '." ;; Emacs 19. (defvar edebug-outside-last-command-event) -(defvar edebug-outside-unread-command-events) (defvar edebug-outside-last-input-event) (defvar edebug-outside-last-event-frame) (defvar edebug-outside-last-nonmenu-event) @@ -3906,10 +3906,9 @@ Options: )) (defun edebug-create-eval-buffer () - (if (not (and edebug-eval-buffer (buffer-name edebug-eval-buffer))) - (progn - (set-buffer (setq edebug-eval-buffer (get-buffer-create "*edebug*"))) - (edebug-eval-mode)))) + (unless (and edebug-eval-buffer (buffer-name edebug-eval-buffer)) + (set-buffer (setq edebug-eval-buffer (get-buffer-create "*edebug*"))) + (edebug-eval-mode))) ;; Should generalize this to be callable outside of edebug ;; with calls in user functions, e.g. (edebug-eval-display) @@ -3947,7 +3946,7 @@ May only be called from within `edebug--recursive-edit'." (if (not (eobp)) (progn (forward-sexp 1) - (setq new-list (cons (edebug-last-sexp) new-list)))) + (push (edebug-last-sexp) new-list))) (while (re-search-forward "^;" nil t) (forward-line 1) @@ -3956,7 +3955,7 @@ May only be called from within `edebug--recursive-edit'." (not (eobp))) (progn (forward-sexp 1) - (setq new-list (cons (edebug-last-sexp) new-list))))) + (push (edebug-last-sexp) new-list)))) (setq edebug-eval-list (nreverse new-list)) (edebug-eval-redisplay) From 2168fe4f2ad6ea4320a0da7976294b0cdade1a20 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 12 Sep 2012 22:41:46 -0400 Subject: [PATCH 08/88] byte-compile-warning-prefix tweak * lisp/emacs-lisp/bytecomp.el (byte-compile-warning-prefix): If not compiling a file, try using load-file-name. --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/bytecomp.el | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 89cc2106ba0..41dc46021f6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-09-13 Glenn Morris + + * emacs-lisp/bytecomp.el (byte-compile-warning-prefix): + If not compiling a file, try using load-file-name. + 2012-09-13 Stefan Monnier * emacs-lisp/edebug.el (edebug-outside-unread-command-events): diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 10bc37c6dcd..c42ae21aae5 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1016,6 +1016,10 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." ((bufferp byte-compile-current-file) (format "Buffer %s:" (buffer-name byte-compile-current-file))) + ;; We might be simply loading a file that + ;; contains explicit calls to byte-compile functions. + ((stringp load-file-name) + (format "%s:" (file-relative-name load-file-name dir))) (t ""))) (pos (if (and byte-compile-current-file (integerp byte-compile-read-position)) From 8ea47e3a5073256b30a42d34a2654e4551ce7e78 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 12 Sep 2012 21:14:33 -0700 Subject: [PATCH 09/88] Better workaround for GNOME bug when --enable-gcc-warnings. * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change. Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in . --- src/ChangeLog | 5 +++++ src/emacsgtkfixed.c | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c8588b973f8..2bc041f0435 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2012-09-13 Paul Eggert + Better workaround for GNOME bug when --enable-gcc-warnings. + * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change. + Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in + . + Simplify SIGIO usage (Bug#12408). The code that dealt with SIGIO was crufty and confusing, e.g., it played tricks like "#undef SIGIO" but these tricks were not used diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c index a21d0f8a422..c0d29a640ed 100644 --- a/src/emacsgtkfixed.c +++ b/src/emacsgtkfixed.c @@ -28,9 +28,10 @@ along with GNU Emacs. If not, see . */ #include "xterm.h" /* Silence a bogus diagnostic; see GNOME bug 683906. */ -#include -#undef G_STATIC_ASSERT -#define G_STATIC_ASSERT(x) verify (x) +#if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunused-local-typedefs" +#endif #define EMACS_TYPE_FIXED emacs_fixed_get_type () #define EMACS_FIXED(obj) \ From d59a1afb9acc881201223e7c573e94526b3cd3fc Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Thu, 13 Sep 2012 09:18:26 +0400 Subject: [PATCH 10/88] Function to mark objects and remove killed buffers at once. * alloc.c (discard_killed_buffers): Rename to ... (mark_discard_killed buffers) ... new name. Add marking of remaining objects. Fix comment. Adjust users. (mark_object): Do not touch frame buffer lists here. * frame.c (delete_frame): Reset frame buffer lists here. --- src/ChangeLog | 9 +++++++++ src/alloc.c | 36 +++++++++++++++--------------------- src/frame.c | 5 +++++ 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 2bc041f0435..90f3fc33b59 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2012-09-13 Dmitry Antipov + + Function to mark objects and remove killed buffers at once. + * alloc.c (discard_killed_buffers): Rename to ... + (mark_discard_killed buffers) ... new name. Add marking + of remaining objects. Fix comment. Adjust users. + (mark_object): Do not touch frame buffer lists here. + * frame.c (delete_frame): Reset frame buffer lists here. + 2012-09-13 Paul Eggert Better workaround for GNOME bug when --enable-gcc-warnings. diff --git a/src/alloc.c b/src/alloc.c index 61cb7086c25..77807f6e086 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -5865,16 +5865,16 @@ mark_buffer (struct buffer *buffer) mark_buffer (buffer->base_buffer); } -/* Remove killed buffers or items whose car is a killed buffer - from LIST and return changed LIST. Called during GC. */ +/* Remove killed buffers or items whose car is a killed buffer from + LIST, and mark other items. Return changed LIST, which is marked. */ static Lisp_Object -discard_killed_buffers (Lisp_Object list) +mark_discard_killed_buffers (Lisp_Object list) { - Lisp_Object *prev = &list; - Lisp_Object tail; + Lisp_Object tail, *prev = &list; - for (tail = list; CONSP (tail); tail = XCDR (tail)) + for (tail = list; CONSP (tail) && !CONS_MARKED_P (XCONS (tail)); + tail = XCDR (tail)) { Lisp_Object tem = XCAR (tail); if (CONSP (tem)) @@ -5882,7 +5882,11 @@ discard_killed_buffers (Lisp_Object list) if (BUFFERP (tem) && !BUFFER_LIVE_P (XBUFFER (tem))) *prev = XCDR (tail); else - prev = &XCDR_AS_LVALUE (tail); + { + CONS_MARK (XCONS (tail)); + mark_object (XCAR (tail)); + prev = &XCDR_AS_LVALUE (tail); + } } return list; } @@ -6023,18 +6027,8 @@ mark_object (Lisp_Object arg) break; case PVEC_FRAME: - { - struct frame *f = (struct frame *) ptr; - - /* For live frames, killed buffers are filtered out by - store_frame_param. For dead frames, we do it here in - attempt to help GC to reclaim killed buffers faster. */ - if (!FRAME_LIVE_P (f)) - fset_buffer_list (f, discard_killed_buffers (f->buffer_list)); - - mark_vectorlike (ptr); - mark_face_cache (f->face_cache); - } + mark_vectorlike (ptr); + mark_face_cache (((struct frame *) ptr)->face_cache); break; case PVEC_WINDOW: @@ -6048,9 +6042,9 @@ mark_object (Lisp_Object arg) if (leaf && NILP (w->buffer)) { wset_prev_buffers - (w, discard_killed_buffers (w->prev_buffers)); + (w, mark_discard_killed_buffers (w->prev_buffers)); wset_next_buffers - (w, discard_killed_buffers (w->next_buffers)); + (w, mark_discard_killed_buffers (w->next_buffers)); } mark_vectorlike (ptr); diff --git a/src/frame.c b/src/frame.c index 9b12842bf89..d10969692ee 100644 --- a/src/frame.c +++ b/src/frame.c @@ -1299,6 +1299,11 @@ delete_frame (Lisp_Object frame, Lisp_Object force) structures can still refer to it. */ fset_menu_bar_vector (f, Qnil); + /* If FRAME's buffer lists contains killed + buffers, this helps GC to reclaim them. */ + fset_buffer_list (f, Qnil); + fset_buried_buffer_list (f, Qnil); + free_font_driver_list (f); xfree (f->namebuf); xfree (f->decode_mode_spec_buffer); From 72eac303eabbb403eae650c9dd0c93851b0fec23 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 12 Sep 2012 23:09:45 -0700 Subject: [PATCH 11/88] Fix glitches caused by addition of psec to timers. * etc/NEWS: Document timer format change. * lisp/image.el (image-animate-timer): * lisp/time.el (display-time-world-timer): Use timer--function and timer--args rather than raw access to timer vector. * lisp/gnus/gnus-art.el (gnus-article-stop-animations): Use timer--function rather than raw access to timer vector. Fixes: debbugs:12430 --- etc/ChangeLog | 4 ++++ etc/NEWS | 5 +++++ lisp/ChangeLog | 8 ++++++++ lisp/gnus/ChangeLog | 6 ++++++ lisp/gnus/gnus-art.el | 2 +- lisp/image.el | 4 ++-- lisp/time.el | 3 ++- 7 files changed, 28 insertions(+), 4 deletions(-) diff --git a/etc/ChangeLog b/etc/ChangeLog index 11e7e5ca108..20ded2fd847 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2012-09-13 Paul Eggert + + * NEWS: Document timer format change (Bug#12430). + 2012-09-11 Paul Eggert Simplify, document, and port floating-point (Bug#12381). diff --git a/etc/NEWS b/etc/NEWS index a7388c4e9fa..eb5a2ed6660 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -101,6 +101,11 @@ machines. Other functions that use this format, such as file-attributes and format-time-string, have been changed accordingly. Old-format time stamps are still accepted. +** The format of timers in timer-list and timer-idle-list is now +[HIGH-SECONDS LOW-SECONDS USECS PSECS REPEAT-DELAY FUNCTION ARGS IDLE-DELAY]. +The PSECS slot is new, and uses picosecond resolution. It can be +accessed via the new timer--psecs accessor. + ** Emacs now generates backtraces on fatal errors. On encountering a fatal error, Emacs now outputs a textual description of the fatal signal, and a short backtrace on platforms like glibc diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 41dc46021f6..1bb8f913c20 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2012-09-13 Paul Eggert + + Fix glitches caused by addition of psec to timers (Bug#12430). + * image.el (image-animate-timer): + * time.el (display-time-world-timer): + Use timer--function and timer--args rather than raw access to + timer vector. + 2012-09-13 Glenn Morris * emacs-lisp/bytecomp.el (byte-compile-warning-prefix): diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 5c7f106f6db..3f69a84db88 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,9 @@ +2012-09-13 Paul Eggert + + Fix glitches caused by addition of psec to timers. + * gnus-art.el (gnus-article-stop-animations): Use timer--function + rather than raw access to timer vector. + 2012-09-11 Julien Danjou * gnus-notifications.el (gnus-notifications): Check for nil values in diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index b9020a40b75..4dc004f04d4 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -4554,7 +4554,7 @@ commands: (defun gnus-article-stop-animations () (dolist (timer (and (boundp 'timer-list) timer-list)) - (when (eq (elt timer 5) 'image-animate-timeout) + (when (eq (timer--function timer) 'image-animate-timeout) (cancel-timer timer)))) (defun gnus-stop-downloads () diff --git a/lisp/image.el b/lisp/image.el index 7801923c3fe..99c0a74a512 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -645,8 +645,8 @@ number, play until that number of seconds has elapsed." (while tail (setq timer (car tail) tail (cdr tail)) - (if (and (eq (aref timer 5) 'image-animate-timeout) - (eq (car-safe (aref timer 6)) image)) + (if (and (eq (timer--function timer) 'image-animate-timeout) + (eq (car-safe (timer--args timer)) image)) (setq tail nil) (setq timer nil))) timer)) diff --git a/lisp/time.el b/lisp/time.el index 8d43b565416..fe3cdbb57be 100644 --- a/lisp/time.el +++ b/lisp/time.el @@ -575,7 +575,8 @@ To turn off the world time display, go to that window and type `q'." (let ((list timer-list)) (while list (let ((elt (pop list))) - (when (equal (symbol-name (aref elt 5)) "display-time-world-timer") + (when (equal (symbol-name (timer--function elt)) + "display-time-world-timer") (cancel-timer elt))))))) ;;;###autoload From 1352271a4d2ad5b0b4394af0cf97adab00d13a56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 13 Sep 2012 08:13:26 +0200 Subject: [PATCH 12/88] * etc/NEWS (--with-x-toolkit): Mention Gtk+ 3 is now default. --- etc/ChangeLog | 4 ++++ etc/NEWS | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/etc/ChangeLog b/etc/ChangeLog index 20ded2fd847..26e9ada74da 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2012-09-13 Jan Djärv + + * NEWS (--with-x-toolkit): Mention that Gtk+ 3 is now default. + 2012-09-13 Paul Eggert * NEWS: Document timer format change (Bug#12430). diff --git a/etc/NEWS b/etc/NEWS index eb5a2ed6660..cbf13c2e87d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -65,6 +65,14 @@ renamed to '--enable-check-lisp-object-type', as the resulting Lisp_Object type no longer uses a union to implement the compile time check that this option enables. +--- +** The default toolkit has been changed to Gtk+ version 3. +If you don't pass --with-x-toolkit to configure or if you pass +--with-x-toolkit=gtk or --with-x-toolkit=yes, configure will try to build +with Gtk+ version 3, and if that fails, try Gtk+ version 2. +You can explicitly require a specific version by passing +--with-x-toolkit=gtk2 or --with-x-toolkit=gtk3 to configure. + * Startup Changes in Emacs 24.3 From 2c484e7585ab899ecea4caddf54b468556f3239d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 13 Sep 2012 08:27:21 +0200 Subject: [PATCH 13/88] * configure.ac: Reorder Xaw3d messages. --- ChangeLog | 4 ++++ configure.ac | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 96cb4b2b89c..07558742e86 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2012-09-13 Jan Djärv + + * configure.ac: Reorder Xaw3d messages. + 2012-09-13 Paul Eggert Simplify SIGIO usage (Bug#12408). diff --git a/configure.ac b/configure.ac index 3761d814364..a6395dc18c2 100644 --- a/configure.ac +++ b/configure.ac @@ -2109,7 +2109,6 @@ HAVE_XAW3D=no LUCID_LIBW= if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then if test "$with_xaw3d" != no; then - AC_MSG_CHECKING(for xaw3d) AC_CACHE_VAL(emacs_cv_xaw3d, [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include @@ -2122,6 +2121,7 @@ if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then emacs_cv_xaw3d=no fi if test $emacs_cv_xaw3d = yes; then + AC_MSG_CHECKING(for xaw3d) AC_MSG_RESULT([yes; using Lucid toolkit]) USE_X_TOOLKIT=LUCID HAVE_XAW3D=yes @@ -2129,6 +2129,7 @@ if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then AC_DEFINE(HAVE_XAW3D, 1, [Define to 1 if you have the Xaw3d library (-lXaw3d).]) else + AC_MSG_CHECKING(for xaw3d) AC_MSG_RESULT(no) AC_MSG_CHECKING(for libXaw) AC_CACHE_VAL(emacs_cv_xaw, From 5087f097cd220a82eeeb69de4ef1c642714f3708 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 13 Sep 2012 00:28:15 -0700 Subject: [PATCH 14/88] * texinfo.tex: Merge from gnulib. --- doc/misc/ChangeLog | 4 ++++ doc/misc/texinfo.tex | 37 ++++++++++++++++++++----------------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 408e4665955..8ecaf97a84a 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,7 @@ +2012-09-13 Paul Eggert + + * texinfo.tex: Merge from gnulib. + 2012-09-12 Michael Albinus Sync with Tramp 2.2.6. diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex index 9a2439c815d..f3093d0853f 100644 --- a/doc/misc/texinfo.tex +++ b/doc/misc/texinfo.tex @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2012-09-05.06} +\def\texinfoversion{2012-09-12.16} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, @@ -2272,8 +2272,6 @@ \gdef\markupsetcodequoteleft{\let`\codequoteleft} \gdef\markupsetcodequoteright{\let'\codequoteright} - -\gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft} } \let\markupsetuplqcode \markupsetcodequoteleft @@ -2282,6 +2280,9 @@ \let\markupsetuplqexample \markupsetcodequoteleft \let\markupsetuprqexample \markupsetcodequoteright % +\let\markupsetuplqkbd \markupsetcodequoteleft +\let\markupsetuprqkbd \markupsetcodequoteright +% \let\markupsetuplqsamp \markupsetcodequoteleft \let\markupsetuprqsamp \markupsetcodequoteright % @@ -2291,8 +2292,6 @@ \let\markupsetuplqverbatim \markupsetcodequoteleft \let\markupsetuprqverbatim \markupsetcodequoteright -\let\markupsetuplqkbd \markupsetnoligaturesquoteleft - % Allow an option to not use regular directed right quote/apostrophe % (char 0x27), but instead the undirected quote from cmtt (char 0x0d). % The undirected quote is ugly, so don't make it the default, but it @@ -2382,8 +2381,7 @@ \aftersmartic } -% like \smartslanted except unconditionally uses \ttsl, and no ic. -% @var is set to this for defun arguments. +% Unconditional use \ttsl, and no ic. @var is set to this for defuns. \def\ttslanted#1{{\ttsl #1}} % @cite is like \smartslanted except unconditionally use \sl. We never want @@ -2695,10 +2693,6 @@ \let\email=\uref \fi -% @kbd is like @code, except that if the argument is just one @key command, -% then @kbd has no effect. -\def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}} - % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), % `example' (@kbd uses ttsl only inside of @example and friends), % or `code' (@kbd uses normal tty font always). @@ -2722,11 +2716,17 @@ % Default is `distinct'. \kbdinputstyle distinct +% @kbd is like @code, except that if the argument is just one @key command, +% then @kbd has no effect. +\def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}} + \def\xkey{\key} -\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% -\ifx\one\xkey\ifx\threex\three \key{#2}% -\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi -\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi} +\def\kbdsub#1#2#3\par{% + \def\one{#1}\def\three{#3}\def\threex{??}% + \ifx\one\xkey\ifx\threex\three \key{#2}% + \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi + \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi +} % definition of @key that produces a lozenge. Doesn't adjust to text size. %\setfont\keyrm\rmshape{8}{1000}{OT1} @@ -4257,7 +4257,7 @@ } \def\ifcmddefinedfail{\doignore{ifcommanddefined}} -% @ifcommandnotdefined CMD ... handlded similar to @ifclear above. +% @ifcommandnotdefined CMD ... handled similar to @ifclear above. \makecond{ifcommandnotdefined} \def\ifcommandnotdefined{% \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}} @@ -7072,7 +7072,10 @@ \df \sl \hyphenchar\font=0 % % On the other hand, if an argument has two dashes (for instance), we - % want a way to get ttsl. Let's try @var for that. + % want a way to get ttsl. We used to recommend @var for that, so + % leave the code in, but it's strange for @var to lead to typewriter. + % Nowadays we recommend @code, since the difference between a ttsl hyphen + % and a tt hyphen is pretty tiny. @code also disables ?` !`. \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}% #1% \sl\hyphenchar\font=45 From 4fa924951b55e6b428e852b62d6c8ef3464ea1dd Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 13 Sep 2012 06:17:31 -0400 Subject: [PATCH 15/88] Auto-commit of generated files. --- autogen/config.in | 24 ++------ autogen/configure | 148 ++++++++++++++++++++++++++++++++++------------ 2 files changed, 116 insertions(+), 56 deletions(-) diff --git a/autogen/config.in b/autogen/config.in index 99074bd1bc5..f8e4c2bcce3 100644 --- a/autogen/config.in +++ b/autogen/config.in @@ -50,9 +50,6 @@ along with GNU Emacs. If not, see . */ /* Define to the number of bits in type 'wint_t'. */ #undef BITSIZEOF_WINT_T -/* Define if FIONREAD should not be used. */ -#undef BROKEN_FIONREAD - /* Define if getwd should not be used. */ #undef BROKEN_GETWD @@ -65,18 +62,6 @@ along with GNU Emacs. If not, see . */ /* Define if SA_RESTART should only be used in batch mode. */ #undef BROKEN_SA_RESTART -/* Define if SIGAIO should not be used. */ -#undef BROKEN_SIGAIO - -/* Define if SIGIO should not be used. */ -#undef BROKEN_SIGIO - -/* Define if SIGPOLL should not be used. */ -#undef BROKEN_SIGPOLL - -/* Define if SIGPTY should not be used. */ -#undef BROKEN_SIGPTY - /* Define if the system is compatible with BSD 4.2. */ #undef BSD4_2 @@ -1166,9 +1151,6 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O -/* Define if termio.h should not be included. */ -#undef NO_TERMIO - /* Minimum value of NSIG. */ #undef NSIG_MINIMUM @@ -1353,6 +1335,12 @@ along with GNU Emacs. If not, see . */ /* Define if the system has Unix98 PTYs. */ #undef UNIX98_PTYS +/* Define to 1 if FIONREAD is usable. */ +#undef USABLE_FIONREAD + +/* Define to 1 if SIGIO is usable. */ +#undef USABLE_SIGIO + /* How to get a user's full name. */ #undef USER_FULL_NAME diff --git a/autogen/configure b/autogen/configure index 5f4013e4b88..25391a0469e 100755 --- a/autogen/configure +++ b/autogen/configure @@ -2062,8 +2062,8 @@ Optional Packages: string giving default POP mail host --without-sound don't compile with sound support --without-sync-input process async input synchronously - --with-x-toolkit=KIT use an X toolkit (KIT one of: yes or gtk, gtk3, - lucid or athena, motif, no) + --with-x-toolkit=KIT use an X toolkit (KIT one of: yes or gtk, gtk2, + gtk3, lucid or athena, motif, no) --with-wide-int prefer wide Emacs integers (typically 62-bit) --without-xpm don't compile with XPM image support --without-jpeg don't compile with JPEG image support @@ -3956,11 +3956,13 @@ if test "${with_x_toolkit+set}" = set; then : a | at | ath | athe | athen | athena ) val=athena ;; m | mo | mot | moti | motif ) val=motif ;; g | gt | gtk ) val=gtk ;; + gtk2 ) val=gtk2 ;; gtk3 ) val=gtk3 ;; * ) as_fn_error "\`--with-x-toolkit=$withval' is invalid; -this option's value should be \`yes', \`no', \`lucid', \`athena', \`motif', \`gtk' or -\`gtk3'. \`yes' and \`gtk' are synonyms. \`athena' and \`lucid' are synonyms." "$LINENO" 5 +this option's value should be \`yes', \`no', \`lucid', \`athena', \`motif', \`gtk', +\`gtk2' or \`gtk3'. \`yes' and \`gtk' are synonyms. +\`athena' and \`lucid' are synonyms." "$LINENO" 5 ;; esac with_x_toolkit=$val @@ -9562,6 +9564,9 @@ case "${window_system}" in gtk ) with_gtk=yes term_header=gtkutil.h USE_X_TOOLKIT=none ;; + gtk2 ) with_gtk2=yes + term_header=gtkutil.h + USE_X_TOOLKIT=none ;; gtk3 ) with_gtk3=yes term_header=gtkutil.h USE_X_TOOLKIT=none ;; @@ -10511,7 +10516,9 @@ fi HAVE_GTK=no GTK_OBJ= -if test "${with_gtk3}" = "yes"; then +check_gtk2=no +gtk3_pkg_errors= +if test "${with_gtk3}" = "yes" || test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then GLIB_REQUIRED=2.28 GTK_REQUIRED=3.0 GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED" @@ -10566,19 +10573,22 @@ $as_echo "no" >&6; } pkg_check_gtk=no fi - if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then + if test "$pkg_check_gtk" = "no" && test "$with_gtk3" = "yes"; then as_fn_error "$GTK_PKG_ERRORS" "$LINENO" 5 fi + if test "$pkg_check_gtk" = "yes"; then $as_echo "#define HAVE_GTK3 1" >>confdefs.h - GTK_OBJ=emacsgtkfixed.o - term_header=gtkutil.h + GTK_OBJ=emacsgtkfixed.o + term_header=gtkutil.h + else + check_gtk2=yes + gtk3_pkg_errors="$GTK_PKG_ERRORS " + fi fi -if test "$pkg_check_gtk" != "yes"; then - HAVE_GTK=no -if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then +if test "${with_gtk2}" = "yes" || test "$check_gtk2" = "yes"; then GLIB_REQUIRED=2.10 GTK_REQUIRED=2.10 GTK_MODULES="gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED" @@ -10633,11 +10643,12 @@ $as_echo "no" >&6; } pkg_check_gtk=no fi - if test "$pkg_check_gtk" = "no" && test "$USE_X_TOOLKIT" != "maybe"; then - as_fn_error "$GTK_PKG_ERRORS" "$LINENO" 5 + if test "$pkg_check_gtk" = "no"; then + if test "$USE_X_TOOLKIT" = "maybe" || test "$with_gtk" = "yes" || test "$with_gtk2" = "yes"; then + as_fn_error "$gtk3_pkg_errors$GTK_PKG_ERRORS" "$LINENO" 5 + fi fi fi -fi if test x"$pkg_check_gtk" = xyes; then @@ -11161,8 +11172,6 @@ HAVE_XAW3D=no LUCID_LIBW= if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then if test "$with_xaw3d" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xaw3d" >&5 -$as_echo_n "checking for xaw3d... " >&6; } if test "${emacs_cv_xaw3d+set}" = set; then : $as_echo_n "(cached) " >&6 else @@ -11233,6 +11242,8 @@ fi emacs_cv_xaw3d=no fi if test $emacs_cv_xaw3d = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xaw3d" >&5 +$as_echo_n "checking for xaw3d... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; using Lucid toolkit" >&5 $as_echo "yes; using Lucid toolkit" >&6; } USE_X_TOOLKIT=LUCID @@ -11242,6 +11253,8 @@ $as_echo "yes; using Lucid toolkit" >&6; } $as_echo "#define HAVE_XAW3D 1" >>confdefs.h else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xaw3d" >&5 +$as_echo_n "checking for xaw3d... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libXaw" >&5 @@ -14891,12 +14904,6 @@ esac case $opsys in - darwin | gnu | hpux* | *bsd ) - -$as_echo "#define NO_TERMIO 1" >>confdefs.h - - ;; - irix6-5 | sol2* | unixware ) $as_echo "#define NSIG_MINIMUM 32" >>confdefs.h @@ -14904,29 +14911,15 @@ $as_echo "#define NSIG_MINIMUM 32" >>confdefs.h ;; esac +emacs_broken_SIGIO=no case $opsys in hpux* | irix6-5 | openbsd | sol2* | unixware ) - -$as_echo "#define BROKEN_SIGIO 1" >>confdefs.h - + emacs_broken_SIGIO=yes ;; aix4-2) -$as_echo "#define BROKEN_FIONREAD 1" >>confdefs.h - - -$as_echo "#define BROKEN_SIGAIO 1" >>confdefs.h - - -$as_echo "#define BROKEN_SIGPOLL 1" >>confdefs.h - - -$as_echo "#define BROKEN_SIGPTY 1" >>confdefs.h - - - $as_echo "#define BROKEN_GET_CURRENT_DIR_NAME 1" >>confdefs.h ;; @@ -15637,6 +15630,85 @@ $as_echo "#define SOLARIS2 /**/" >>confdefs.h ;; esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for usable FIONREAD" >&5 +$as_echo_n "checking for usable FIONREAD... " >&6; } +if test "${emacs_cv_usable_FIONREAD+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + case $opsys in + aix4-2) + emacs_cv_usable_FIONREAD=no + ;; + + *) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #ifdef USG5_4 + # include + #endif + +int +main () +{ +int foo = ioctl (0, FIONREAD, &foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + emacs_cv_usable_FIONREAD=yes +else + emacs_cv_usable_FIONREAD=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_usable_FIONREAD" >&5 +$as_echo "$emacs_cv_usable_FIONREAD" >&6; } +if test $emacs_cv_usable_FIONREAD = yes; then + +$as_echo "#define USABLE_FIONREAD 1" >>confdefs.h + + + if test $emacs_broken_SIGIO = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usable SIGIO" >&5 +$as_echo_n "checking for usable SIGIO... " >&6; } +if test "${emacs_cv_usable_SIGIO+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +int foo = SIGIO | F_SETFL | FASYNC; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + emacs_cv_usable_SIGIO=yes +else + emacs_cv_usable_SIGIO=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_usable_SIGIO" >&5 +$as_echo "$emacs_cv_usable_SIGIO" >&6; } + if test $emacs_cv_usable_SIGIO = yes; then + +$as_echo "#define USABLE_SIGIO 1" >>confdefs.h + + fi + fi +fi + case $opsys in cygwin) From 5e2b4ce123bf042b3b719b1f776cce3e4db7eadf Mon Sep 17 00:00:00 2001 From: Katsumi Yamaoka Date: Thu, 13 Sep 2012 11:14:30 +0000 Subject: [PATCH 16/88] gnus-art.el (gnus-article-stop-animations): Use gnus-timer--function that is an alias to timer--function --- lisp/gnus/ChangeLog | 6 ++++++ lisp/gnus/gnus-art.el | 2 +- lisp/gnus/gnus-util.el | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 3f69a84db88..69f0025b524 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,9 @@ +2012-09-13 Katsumi Yamaoka + + * gnus-util.el (gnus-timer--function): New function. + + * gnus-art.el (gnus-article-stop-animations): Use it. + 2012-09-13 Paul Eggert Fix glitches caused by addition of psec to timers. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 4dc004f04d4..7dcbd61316f 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -4554,7 +4554,7 @@ commands: (defun gnus-article-stop-animations () (dolist (timer (and (boundp 'timer-list) timer-list)) - (when (eq (timer--function timer) 'image-animate-timeout) + (when (eq (gnus-timer--function timer) 'image-animate-timeout) (cancel-timer timer)))) (defun gnus-stop-downloads () diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index 4c5eabab723..f5e1077f8c4 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -1964,6 +1964,11 @@ definitions to shadow the loaded ones for use in file byte-compilation." (defun gnus-bound-and-true-p (sym) (and (boundp sym) (symbol-value sym))) +(if (fboundp 'timer--function) + (defalias 'gnus-timer--function 'timer--function) + (defun gnus-timer--function (timer) + (elt timer 5))) + (provide 'gnus-util) ;;; gnus-util.el ends here From fc0c31f839de077683acaf4e3f9ff9643d468f5f Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 13 Sep 2012 13:42:18 +0200 Subject: [PATCH 17/88] Fix typos in ChangeLogs. --- lisp/ChangeLog | 27 +++++++++++++-------------- src/ChangeLog | 30 +++++++++++++++--------------- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1bb8f913c20..af91cfffba4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -96,16 +96,16 @@ 2012-09-11 Bastien Guerry * subr.el (set-temporary-overlay-map): Add a docstring. - (bug#12346) + (Bug#12346) 2012-09-11 Bastien Guerry * minibuffer.el (completion-table-subvert): Fix docstring. - (bug#12347) + (Bug#12347) 2012-09-11 Bastien Guerry - * help-fns.el (describe-variable): Fix typo. (bug#12346) + * help-fns.el (describe-variable): Fix typo. (Bug#12346) 2012-09-10 Michael R. Mauger @@ -125,9 +125,8 @@ 2012-09-10 Stefan Monnier * emacs-lisp/lisp-mode.el (emacs-list-byte-code-comment-re): New var. - (emacs-lisp-byte-code-comment) - (emacs-lisp-byte-code-syntax-propertize, emacs-lisp-byte-code-mode): - New functions. + (emacs-lisp-byte-code-comment, emacs-lisp-byte-code-syntax-propertize) + (emacs-lisp-byte-code-mode): New functions. (eval-sexp-add-defvars): Don't skip defvars in column >0. (eval-defun-2): Remove bogus interactive spec. (lisp-indent-line): Remove redundant whole-exp code, now done in @@ -1614,7 +1613,7 @@ * calc-mode.el (calc-basic-simplification-mode): Rename from `calc-limited-simplification-mode'. (calc-alg-simplification-mode): New function. - (calc-set-simplify-mode): Adjust message. + (calc-set-simplify-mode): Adjust message. * calc.el (calc-set-mode-line): Adjust mode line display for basic simplification mode. @@ -1812,7 +1811,7 @@ * notifications.el (notifications-on-action-signal) (notifications-on-closed-signal): Use also the bus address for the map. (notifications-notify, notifications-close-notification) - (notifications-get-capabilities): Add optional argument BUS. + (notifications-get-capabilities): Add optional argument BUS. 2012-07-27 Tassilo Horn @@ -1932,7 +1931,7 @@ ses-cell-set-formula or ses-set-cell to change the cell and handle the undo at the same time, but rather use lower level new macros `ses-cell-formula-aset' and `ses-cell-references-aset' and handle - the undo directly. Refresh the mode line. + the undo directly. Refresh the mode line. 2012-07-21 Leo Liu @@ -5348,13 +5347,13 @@ * progmodes/verilog-mode.el (font-lock-keywords): Fix mis-highligting auto. Reported by Craig Barner. (verilog-auto, verilog-auto-undef): Add AUTOUNDEF to remove - defines from global name space. Reported by Dan Dever. + defines from global name space. Reported by Dan Dever. (verilog-auto-reset, verilog-auto-reset-widths) (verilog-auto-tieoff): Support using unbased numbers for AUTORESET and AUTOTIEOFF. (verilog-submit-bug-report): Update variable list. (verilog-read-auto-params): Fix AUTOINPUT regexps containing - parenthesis from not matching. Reported by Michael Rytting. + parenthesis from not matching. Reported by Michael Rytting. (verilog-auto-template-lint): Fix hash error when linting modules with no used templates. (verilog-warn, verilog-warn-error) @@ -5364,12 +5363,12 @@ (verilog-read-auto-template): Add `verilog-auto-template-warn-unused' to report unused template errors. Reported by Brad Dobbie. (verilog-read-decls): Fix AUTOWIRE etc on supply0, supply1 type - nets, bug438. Reported by Vns Blore. + nets, bug438. Reported by Vns Blore. (verilog-auto-inout-module, verilog-auto-reg) (verilog-read-decls, verilog-read-sub-decls-sig) (verilog-signals-edit-wire-reg, verilog-signals-with): Fix passing of Verilog data types in ANSI input/output ports - such as "output logic" into the AUTOs. Special case "wire" and + such as "output logic" into the AUTOs. Special case "wire" and "reg" for backwards compatibility presuming Verilog 2001. (verilog-auto-ascii-enum): Add "auto enum" as alias. (verilog-preprocess): Fix replication of preprocess output. @@ -5390,7 +5389,7 @@ (verilog-read-decls): Fix 'parameter type' not appearing in AUTOINSTPARAM, bug340. Reported by Jonathan Greenlaw. (verilog-auto-logic): Fix when AUTOLOGIC present to properly do - AUTOINPUTs, bug411. Reported by Jonathan Greenlaw. + AUTOINPUTs, bug411. Reported by Jonathan Greenlaw. (verilog-read-auto-lisp): Avoid syntax-ppss warning on AUTOLISP. Reported by David Kravitz. diff --git a/src/ChangeLog b/src/ChangeLog index 90f3fc33b59..153a0b59c62 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -287,7 +287,7 @@ (ns_maybe_dumpglyphs_background): Remove fringe/internal border adjustment. (ns_dumpglyphs_image): Ditto. - (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal + (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal border adjustment. (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and their usage. Add fringe_extended_p and its use as in other terms. @@ -368,7 +368,7 @@ * conf_post.h [SIGNAL_H_AHB]: Do not include ; no longer needed here. * emacs.c (main): Inspect existing signal handler with sigaction, - so that there's no need to block and unblock SIGHUP. + so that there's no need to block and unblock SIGHUP. * sysdep.c (struct save_signal): New member 'action', replacing old member 'handler'. (save_signal_handlers, restore_signal_handlers): @@ -895,18 +895,18 @@ 2012-08-28 Jan Djärv * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize - button_values to NULL. Call setStykeMask so dialogs get a close button. + button_values to NULL. Call setStykeMask so dialogs get a close button. (windowShouldClose:): Set window_closed. (dealloc): New member, free button_values. - (process_dialog:): Make member function. Remove window argument, - replace window with self. Count buttons and allocate and store values + (process_dialog:): Make member function. Remove window argument, + replace window with self. Count buttons and allocate and store values in button_values. (addButton:value:row:): value is int with the name tag. Call setTag - with tag. Remove return self, declare return value as void. + with tag. Remove return self, declare return value as void. (addString:row:): Remove return self, declare return value as void. (addSplit): Remove return self, declare return value as void. (clicked:): Remove return self, declare return value as void. - Set dialog_return to button_values[seltag]. Code formatting change. + Set dialog_return to button_values[seltag]. Code formatting change. (initFromContents:isQuestion:): Adjust call to process_dialog. Code formatting change. (timeout_handler:): Set timer_fired to YES. @@ -1241,7 +1241,7 @@ * fontset.c (FONTSET_ADD): Return void, not Lisp_Object. Otherwise, the compiler complains about (A?B:C) where B is void - and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12. + and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12. (fontset_add): Return void, for FONTSET_ADD. 2012-08-21 Paul Eggert @@ -1757,7 +1757,7 @@ Start main loop and wait for application defined event. Inform select thread to stop selecting after main loop is exited. (ns_term_init): Create selfds pipe and set non-blocking. - Initialize select_mutex. Start the select thread (fd_handler). + Initialize select_mutex. Start the select thread (fd_handler). (fd_handler:): Loop forever, wait for info from the main thread to either start or stop selecting. When select returns, send and appdefined event. @@ -1889,7 +1889,7 @@ (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info if not present. (update_frame_tool_bar): Return early if data in xg_frame_tb_info - is up to date. Otherwise store new data. + is up to date. Otherwise store new data. (free_frame_tool_bar): Free xg_frame_tb_info if present. 2012-08-13 Dmitry Antipov @@ -1916,7 +1916,7 @@ 2012-08-11 Jan Djärv * nsterm.m (not_in_argv): New function. - (application:openFile, application:openTempFile:): + (application:openFile, application:openTempFile:): (application:openFileWithoutUI:, application:openFiles:): Open file if not_in_argv returns non-zero (bug#12171). @@ -3103,7 +3103,7 @@ 2012-07-21 Jan Djärv - * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134). + * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134). (conversationIdentifier): Return value is NSInteger. * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA. @@ -5613,7 +5613,7 @@ * lisp.h (struct vectorlike_header): New field `nbytes', adjust comment accordingly. * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK' - to denote vector blocks. Adjust users (live_vector_p, + to denote vector blocks. Adjust users (live_vector_p, mark_maybe_pointer, valid_lisp_object_p) accordingly. (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG. (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES), @@ -5627,7 +5627,7 @@ (allocate_vector_from_block, init_vectors, allocate_vector_from_block) (sweep_vectors): New functions. (allocate_vectorlike): Return `zero_vector' as the only vector of - 0 items. Allocate new vector from block if vector size is less than + 0 items. Allocate new vector from block if vector size is less than or equal to VBLOCK_BYTES_MAX. (Fgarbage_collect): Move all vector sweeping code to sweep_vectors. (init_alloc_once): Add call to init_vectors. @@ -5717,7 +5717,7 @@ change it's type from Lisp_Object to bitfield. Change type of 'force_start', 'optional_new_start', 'last_had_star', 'update_mode_line' and 'start_at_line_beg' - fields from Lisp_Object to bitfield. Adjust users accordingly. + fields from Lisp_Object to bitfield. Adjust users accordingly. 2012-05-31 Paul Eggert From 4d0b77fc572d0b8e834f5241f39f1b4ce2e6bd63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Thu, 13 Sep 2012 14:02:00 +0200 Subject: [PATCH 18/88] * configure.ac: Report Gtk+ 3 as GTK. --- ChangeLog | 1 + configure.ac | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 07558742e86..e46fbef7113 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2012-09-13 Jan Djärv * configure.ac: Reorder Xaw3d messages. + Report Gtk+ 3 as GTK. 2012-09-13 Paul Eggert diff --git a/configure.ac b/configure.ac index a6395dc18c2..ce65f07522d 100644 --- a/configure.ac +++ b/configure.ac @@ -4384,11 +4384,7 @@ End: #### It makes printing result more understandable as using GTK sets #### toolkit_scroll_bars to yes by default. if test "${HAVE_GTK}" = "yes"; then - if test "${with_gtk3}" = "yes"; then - USE_X_TOOLKIT=GTK3 - else - USE_X_TOOLKIT=GTK - fi + USE_X_TOOLKIT=GTK fi echo " From d607d303028dca3d7d6ba21b4013f08dd2b0a1d6 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 14 Sep 2012 00:21:58 +0900 Subject: [PATCH 19/88] language/chinese.el ("Chinese-GB", "Chinese-BIG5", "Chinese-CNS", "Chinese-EUC-TW"): Add chinese-gbk to coding-priority property of these language environment. --- lisp/ChangeLog | 6 ++++++ lisp/language/chinese.el | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index af91cfffba4..6b132bb9134 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-09-13 Kenichi Handa + + * language/chinese.el ("Chinese-GB", "Chinese-BIG5") + ("Chinese-CNS", "Chinese-EUC-TW"): Add chinese-gbk to + `coding-priority' property of these language environment. + 2012-09-13 Paul Eggert Fix glitches caused by addition of psec to timers (Bug#12430). diff --git a/lisp/language/chinese.el b/lisp/language/chinese.el index ac2afa373c4..782b5a363ad 100644 --- a/lisp/language/chinese.el +++ b/lisp/language/chinese.el @@ -110,7 +110,8 @@ (use-cjk-char-width-table 'zh_CN))) (exit-function . use-default-char-width-table) (coding-system chinese-iso-8bit iso-2022-cn chinese-hz) - (coding-priority chinese-iso-8bit chinese-big5 iso-2022-cn) + (coding-priority chinese-iso-8bit chinese-gbk chinese-big5 + iso-2022-cn) (input-method . "chinese-py-punct") (features china-util) (sample-text . "Chinese ($AVPND(B,$AFUM(;0(B,$A::So(B) $ADc:C(B") @@ -140,7 +141,8 @@ (use-cjk-char-width-table 'zh_HK))) (exit-function . use-default-char-width-table) (coding-system chinese-big5 chinese-iso-7bit) - (coding-priority chinese-big5 iso-2022-cn chinese-iso-8bit) + (coding-priority chinese-big5 iso-2022-cn chinese-iso-8bit + chinese-gbk) (input-method . "chinese-py-punct-b5") (ctext-non-standard-encodings "big5-0") (features china-util) @@ -196,7 +198,7 @@ (exit-function . use-default-char-width-table) (coding-system iso-2022-cn euc-tw) (coding-priority iso-2022-cn euc-tw chinese-big5 - chinese-iso-8bit) + chinese-iso-8bit chinese-gbk) (features china-util) (input-method . "chinese-cns-quick") ;; Fixme: presumably it won't accept big5 now. @@ -216,7 +218,7 @@ accepts Big5 for input also (which is then converted to CNS).")) (exit-function . use-default-char-width-table) (coding-system euc-tw iso-2022-cn) (coding-priority euc-tw chinese-big5 iso-2022-cn - chinese-iso-8bit) + chinese-iso-8bit chinese-gbk) (features china-util) (input-method . "chinese-cns-quick") (documentation . "\ From c18e885bdd2607ec1784c3e1585e581459408932 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 13 Sep 2012 09:23:06 -0700 Subject: [PATCH 20/88] Use a more backwards-compatible timer format. * etc/NEWS: Document it. * lisp/emacs-lisp/timer.el (timer): PSECS is now at the end, rather than being right after USECS, as that better supports old code that inadvisedly looked directly at the timer vector. * src/keyboard.c (decode_timer): Get PSECS from the 8th (origin-0) vector element, not from the 4th, since PSECS is now at the end. (Fcurrent_idle_time): Doc fix. Fixes: debbugs:12430 --- etc/ChangeLog | 5 +++++ etc/NEWS | 2 +- lisp/ChangeLog | 7 +++++++ lisp/emacs-lisp/timer.el | 6 +++--- src/ChangeLog | 7 +++++++ src/keyboard.c | 4 ++-- 6 files changed, 25 insertions(+), 6 deletions(-) diff --git a/etc/ChangeLog b/etc/ChangeLog index 26e9ada74da..66c229eaf78 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,8 @@ +2012-09-13 Paul Eggert + + Use a more backwards-compatible timer format (Bug#12430). + * NEWS: Document it, plus fix a typo. + 2012-09-13 Jan Djärv * NEWS (--with-x-toolkit): Mention that Gtk+ 3 is now default. diff --git a/etc/NEWS b/etc/NEWS index cbf13c2e87d..4c6ceae1688 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -110,7 +110,7 @@ file-attributes and format-time-string, have been changed accordingly. Old-format time stamps are still accepted. ** The format of timers in timer-list and timer-idle-list is now -[HIGH-SECONDS LOW-SECONDS USECS PSECS REPEAT-DELAY FUNCTION ARGS IDLE-DELAY]. +[TRIGGERED-P HI-SECS LO-SECS USECS REPEAT-DELAY FUNCTION ARGS IDLE-DELAY PSECS]. The PSECS slot is new, and uses picosecond resolution. It can be accessed via the new timer--psecs accessor. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6b132bb9134..5e51c67e8e8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2012-09-13 Paul Eggert + + Use a more backwards-compatible timer format (Bug#12430). + * emacs-lisp/timer.el (timer): PSECS is now at the end, rather than + being right after USECS, as that better supports old code that + inadvisedly looked directly at the timer vector. + 2012-09-13 Kenichi Handa * language/chinese.el ("Chinese-GB", "Chinese-BIG5") diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index a66d5972d82..2248dde8c03 100644 --- a/lisp/emacs-lisp/timer.el +++ b/lisp/emacs-lisp/timer.el @@ -28,8 +28,8 @@ ;;; Code: ;; Layout of a timer vector: -;; [triggered-p high-seconds low-seconds usecs psecs repeat-delay -;; function args idle-delay] +;; [triggered-p high-seconds low-seconds usecs repeat-delay +;; function args idle-delay psecs] ;; triggered-p is nil if the timer is active (waiting to be triggered), ;; t if it is inactive ("already triggered", in theory) @@ -42,7 +42,7 @@ (:type vector) (:conc-name timer--)) (triggered t) - high-seconds low-seconds usecs psecs repeat-delay function args idle-delay) + high-seconds low-seconds usecs repeat-delay function args idle-delay psecs) (defun timerp (object) "Return t if OBJECT is a timer." diff --git a/src/ChangeLog b/src/ChangeLog index 153a0b59c62..a7fe68646d0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2012-09-13 Paul Eggert + + Use a more backwards-compatible timer format (Bug#12430). + * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0) + vector element, not from the 4th, since PSECS is now at the end. + (Fcurrent_idle_time): Doc fix. + 2012-09-13 Dmitry Antipov Function to mark objects and remove killed buffers at once. diff --git a/src/keyboard.c b/src/keyboard.c index aec9028ae94..45638bc412b 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -4330,7 +4330,7 @@ decode_timer (Lisp_Object timer, EMACS_TIME *result) if (! NILP (vector[0])) return 0; - return decode_time_components (vector[1], vector[2], vector[3], vector[4], + return decode_time_components (vector[1], vector[2], vector[3], vector[8], result, 0); } @@ -4532,7 +4532,7 @@ in the same style as (current-time). The value when Emacs is not idle is nil. -NSEC is a multiple of the system clock resolution. */) +PSEC is a multiple of the system clock resolution. */) (void) { if (EMACS_TIME_VALID_P (timer_idleness_start_time)) From b9800ec43b3e7f17cde08dc890afa690185cf9aa Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 13 Sep 2012 14:23:33 -0400 Subject: [PATCH 21/88] * lisp/vc/vc.el: No need to require ediff. (ediff-load-version-control): Declare. (ediff-vc-internal): Fix declaration. (vc-version-ediff): Require ediff. --- lisp/ChangeLog | 7 +++++++ lisp/vc/vc.el | 8 +++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5e51c67e8e8..62ba7017163 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2012-09-13 Glenn Morris + + * vc/vc.el: No need to require ediff. + (ediff-load-version-control): Declare. + (ediff-vc-internal): Fix declaration. + (vc-version-ediff): Require ediff. + 2012-09-13 Paul Eggert Use a more backwards-compatible timer format (Bug#12430). diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 1ef4faaa008..47800bd4aac 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -653,7 +653,6 @@ (require 'vc-hooks) (require 'vc-dispatcher) -(require 'ediff) (declare-function diff-setup-whitespace "diff-mode" ()) @@ -1698,7 +1697,9 @@ saving the buffer." (vc-diff-internal t (vc-deduce-fileset t) nil nil (called-interactively-p 'interactive)))) -(declare-function ediff-vc-internal (rev1 rev2 &optional startup-hooks)) +(declare-function ediff-load-version-control "ediff" (&optional silent)) +(declare-function ediff-vc-internal "ediff-vers" + (rev1 rev2 &optional startup-hooks)) ;;;###autoload (defun vc-version-ediff (files rev1 rev2) @@ -1719,7 +1720,8 @@ repository history using ediff." ;; FIXME We only support running ediff on one file for now. ;; We could spin off an ediff session per file in the file set. ((= (length files) 1) - (ediff-load-version-control) + (require 'ediff) + (ediff-load-version-control) ; loads ediff-vers (find-file (car files)) ;FIXME: find-file from Elisp is bad. (ediff-vc-internal rev1 rev2 nil)) (t From 6a2e6868361c901f5c93f45df84622a1a9dbb889 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 13 Sep 2012 14:41:21 -0400 Subject: [PATCH 22/88] Update some function declarations * lisp/calc/calc-ext.el (math-compose-expr): * lisp/calc/calc.el (math-compose-expr): * lisp/progmodes/cc-defs.el (cl-macroexpand-all): * lisp/progmodes/cc-langs.el (delete-duplicates, mapcan) (cl-macroexpand-all): Update declarations. --- lisp/ChangeLog | 6 ++++++ lisp/calc/calc-ext.el | 2 +- lisp/calc/calc.el | 2 +- lisp/progmodes/cc-defs.el | 2 +- lisp/progmodes/cc-langs.el | 7 ++++--- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 62ba7017163..c5c0c474940 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,11 @@ 2012-09-13 Glenn Morris + * calc/calc.el (math-compose-expr): + * calc/calc-ext.el (math-compose-expr): + * progmodes/cc-defs.el (cl-macroexpand-all): + * progmodes/cc-langs.el (delete-duplicates, mapcan) + (cl-macroexpand-all): Update declarations. + * vc/vc.el: No need to require ediff. (ediff-load-version-control): Declare. (ediff-vc-internal): Fix declaration. diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 7089070df59..2fd5ad6fd9c 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -61,7 +61,7 @@ (declare-function math-vector-is-string "calccomp" (a)) (declare-function math-vector-to-string "calccomp" (a &optional quoted)) (declare-function math-format-radix-float "calc-bin" (a prec)) -(declare-function math-compose-expr "calccomp" (a prec)) +(declare-function math-compose-expr "calccomp" (a prec &optional div)) (declare-function math-abs "calc-arith" (a)) (declare-function math-format-bignum-binary "calc-bin" (a)) (declare-function math-format-bignum-octal "calc-bin" (a)) diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index 3e6ae1c7404..17f0998d30b 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -199,7 +199,7 @@ (declare-function calc-div-fractions "calc-frac" (a b)) (declare-function math-div-objects-fancy "calc-arith" (a b)) (declare-function math-div-symb-fancy "calc-arith" (a b)) -(declare-function math-compose-expr "calccomp" (a prec)) +(declare-function math-compose-expr "calccomp" (a prec &optional div)) (declare-function math-comp-width "calccomp" (c)) (declare-function math-composition-to-string "calccomp" (c &optional width)) (declare-function math-stack-value-offset-fancy "calccomp" ()) diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index 8bccb44f308..0dc596a472b 100644 --- a/lisp/progmodes/cc-defs.el +++ b/lisp/progmodes/cc-defs.el @@ -1829,7 +1829,7 @@ itself is evaluated." (eval form)) ;; Only used at compile time - suppress "might not be defined at runtime". -(declare-function cl-macroexpand-all "cl-extra" (form &optional env)) +(declare-function cl-macroexpand-all "cl" (form &optional env)) (defmacro c-lang-defconst (name &rest args) "Set the language specific values of the language constant NAME. diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 78be8ac2cc4..d5a1be572ba 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -208,9 +208,10 @@ the evaluated constant value at compile time." ;; Suppress "might not be defined at runtime" warning. ;; This file is only used when compiling other cc files. -(declare-function delete-duplicates "cl-seq" (cl-seq &rest cl-keys)) -(declare-function mapcan "cl-extra" (cl-func cl-seq &rest cl-rest)) -(declare-function cl-macroexpand-all "cl-extra" (form &optional env)) +;; These are defined in cl as aliases to the cl- versions. +(declare-function delete-duplicates "cl-seq" (cl-seq &rest cl-keys) t) +(declare-function mapcan "cl-extra" (cl-func cl-seq &rest cl-rest) t) +(declare-function cl-macroexpand-all "cl" (form &optional env)) (eval-and-compile ;; Some helper functions used when building the language constants. From 5b68b3331582c5ee6d49480e5e84c639a4848fec Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Fri, 14 Sep 2012 02:42:39 +0300 Subject: [PATCH 23/88] * lisp/dired-aux.el (dired-do-chxxx): Use `eq' to detect empty input. Fixes: debbugs:12399 --- lisp/ChangeLog | 5 +++++ lisp/dired-aux.el | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c5c0c474940..15039358559 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-09-13 Juri Linkov + + * dired-aux.el (dired-do-chxxx): Use `eq' to detect empty input. + (Bug#12399) + 2012-09-13 Glenn Morris * calc/calc.el (math-compose-expr): diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 1f8e8068de3..b42df954fe5 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -244,7 +244,10 @@ List has a form of (file-name full-file-name (attribute-list))." (function dired-check-process) (append (list operation program) - (unless (string-equal new-attribute "") + (unless (or (string-equal new-attribute "") + ;; Use `eq' instead of `equal' + ;; to detect empty input (bug#12399). + (eq new-attribute default)) (if (eq op-symbol 'touch) (list "-t" new-attribute) (list new-attribute))) From fe5979317f5369ccb9e43f06d0a7dc5e3314f98f Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Fri, 14 Sep 2012 03:09:22 +0200 Subject: [PATCH 24/88] nt/config.nt: Sync with autogen/config.in. (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGIO, BROKEN_SIGPOLL) (BROKEN_SIGPTY, HAVE_CBRT, HAVE_LOGB, NO_TERMIO): Remove. (USABLE_FIONREAD, USABLE_SIGIO): New macros. --- nt/ChangeLog | 7 +++++++ nt/config.nt | 30 ++++++------------------------ 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/nt/ChangeLog b/nt/ChangeLog index 49da46ad946..54e5570072a 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,10 @@ +2012-09-14 Juanma Barranquero + + * config.nt: Sync with autogen/config.in. + (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGIO, BROKEN_SIGPOLL) + (BROKEN_SIGPTY, HAVE_CBRT, HAVE_LOGB, NO_TERMIO): Remove. + (USABLE_FIONREAD, USABLE_SIGIO): New macros. + 2012-09-10 Juanma Barranquero * config.nt: Sync with autogen/config.in. diff --git a/nt/config.nt b/nt/config.nt index ee62b6d2242..5121a013aad 100644 --- a/nt/config.nt +++ b/nt/config.nt @@ -54,9 +54,6 @@ along with GNU Emacs. If not, see . */ /* Define to the number of bits in type 'wint_t'. */ #undef BITSIZEOF_WINT_T -/* Define if FIONREAD should not be used. */ -#undef BROKEN_FIONREAD - /* Define if getwd should not be used. */ #undef BROKEN_GETWD @@ -69,18 +66,6 @@ along with GNU Emacs. If not, see . */ /* Define if SA_RESTART should only be used in batch mode. */ #undef BROKEN_SA_RESTART -/* Define if SIGAIO should not be used. */ -#undef BROKEN_SIGAIO - -/* Define if SIGIO should not be used. */ -#undef BROKEN_SIGIO - -/* Define if SIGPOLL should not be used. */ -#undef BROKEN_SIGPOLL - -/* Define if SIGPTY should not be used. */ -#undef BROKEN_SIGPTY - /* Define if the system is compatible with BSD 4.2. */ #undef BSD4_2 @@ -252,9 +237,6 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if strtold conforms to C99. */ #undef HAVE_C99_STRTOLD -/* Define to 1 if you have the `cbrt' function. */ -#undef HAVE_CBRT - /* Define to 1 if you have the `cfmakeraw' function. */ #undef HAVE_CFMAKERAW @@ -647,9 +629,6 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if you have the `localtime_r' function. */ #undef HAVE_LOCALTIME_R -/* Define to 1 if you have the `logb' function. */ -#define HAVE_LOGB 1 - /* Define to 1 if you support file names longer than 14 characters. */ #define HAVE_LONG_FILE_NAMES 1 @@ -1182,9 +1161,6 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O -/* Define if termio.h should not be included. */ -#undef NO_TERMIO - /* Minimum value of NSIG. */ #undef NSIG_MINIMUM @@ -1369,6 +1345,12 @@ along with GNU Emacs. If not, see . */ /* Define if the system has Unix98 PTYs. */ #undef UNIX98_PTYS +/* Define to 1 if FIONREAD is usable. */ +#define USABLE_FIONREAD 1 + +/* Define to 1 if SIGIO is usable. */ +#undef USABLE_SIGIO + /* How to get a user's full name. */ #define USER_FULL_NAME pw->pw_gecos From 2a7931e3548f730ca1abdc489cc0575a6c4e7cab Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Fri, 14 Sep 2012 03:22:21 +0200 Subject: [PATCH 25/88] src/makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies. --- src/ChangeLog | 4 ++++ src/makefile.w32-in | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index a7fe68646d0..0f741c5c4cf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-09-14 Juanma Barranquero + + * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies. + 2012-09-13 Paul Eggert Use a more backwards-compatible timer format (Bug#12430). diff --git a/src/makefile.w32-in b/src/makefile.w32-in index 7b9c67bf135..24ecb2676da 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in @@ -482,7 +482,6 @@ WINDOW_H = $(SRC)/window.h \ $(BLD)/alloc.$(O) : \ $(SRC)/alloc.c \ $(SRC)/puresize.h \ - $(SRC)/syssignal.h \ $(SRC)/w32.h \ $(NT_INC)/unistd.h \ $(GNU_LIB)/verify.h \ From 2de39f089a464cc265b6c583684226d1a94abbfa Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 13 Sep 2012 23:55:16 -0400 Subject: [PATCH 26/88] * lisp/emacs-lisp/edebug.el: Miscellaneous cleanup. Remove obsolete byte-compiler hack that tried to silence some warnings. (edebug-submit-bug-report): Remove. (edebug-get-buffer-window, edebug-sit-for, edebug-input-pending-p): Remove aliases, use the un-prefixed name instead. (edebug-pop-to-buffer): Consider other frames. (edebug-original-read):: Make it more obvious that it's always defined. (edebug--make-form-data-entry, edebug--form-data-name) (edebug--form-data-begin, edebug--form-data-end): Rename from the single-dashed name, and implement with cl-defstruct. (edebug-set-form-data-entry): Use the standard accessors. (edebug-make-top-form-data-entry): Use push. (edebug-no-match): Drop useless `funcall'. (mapcar, mapconcat, mapatoms, apply, funcall): Don't add debug specs to functions. (defsubst, dont-compile, eval-when-compile, eval-and-compile) (delay-mode-hooks, with-temp-file, with-temp-message, ad-dolist) (with-syntax-table, push, pop, 1value, noreturn, defadvice) (easy-menu-define, with-custom-print): Remove redundant specs. (edebug-outside-overriding-local-map) (edebug-outside-overriding-terminal-local-map): Remove, unused. (edebug--display): Bind unread-command-events directly to nil rather than binding it to unread-command-events and later setting it to nil. (edebug--display): Kill edebug-eval-buffer here... (edebug--recursive-edit): ...rather than here. Bind standard-output and standard-input. (edebug-eval): Check cl-macroexpand-all is fboundp. (edebug-temp-display-freq-count): Fix last change. * lisp/emacs-lisp/easymenu.el (easy-menu-define): Add `debug' spec. * lisp/subr.el (noreturn, 1value): Add `debug' spec. * lisp/emacs-lisp/advice.el: Require cl-lib. (ad-copy-tree): Remove, use copy-tree instead. (ad-dolist): Remove use dolist or cl-dolist instead. (ad-do-return): Remove, use cl-return instead. (defadvice): Add `debug' spec. --- lisp/ChangeLog | 39 ++++++ lisp/dired.el | 2 +- lisp/emacs-lisp/advice.el | 183 ++++++++++--------------- lisp/emacs-lisp/easymenu.el | 2 +- lisp/emacs-lisp/edebug.el | 261 +++++++++--------------------------- lisp/subr.el | 2 + 6 files changed, 180 insertions(+), 309 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 15039358559..7163b4b4989 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,42 @@ +2012-09-14 Stefan Monnier + + * emacs-lisp/edebug.el: Miscellaneous cleanup. + Remove obsolete byte-compiler hack that tried to silence some warnings. + (edebug-submit-bug-report): Remove. + (edebug-get-buffer-window, edebug-sit-for, edebug-input-pending-p): + Remove aliases, use the un-prefixed name instead. + (edebug-pop-to-buffer): Consider other frames. + (edebug-original-read):: Make it more obvious that it's always defined. + (edebug--make-form-data-entry, edebug--form-data-name) + (edebug--form-data-begin, edebug--form-data-end): Rename from the + single-dashed name, and implement with cl-defstruct. + (edebug-set-form-data-entry): Use the standard accessors. + (edebug-make-top-form-data-entry): Use push. + (edebug-no-match): Drop useless `funcall'. + (mapcar, mapconcat, mapatoms, apply, funcall): Don't add debug specs + to functions. + (defsubst, dont-compile, eval-when-compile, eval-and-compile) + (delay-mode-hooks, with-temp-file, with-temp-message, ad-dolist) + (with-syntax-table, push, pop, 1value, noreturn, defadvice) + (easy-menu-define, with-custom-print): Remove redundant specs. + (edebug-outside-overriding-local-map) + (edebug-outside-overriding-terminal-local-map): Remove, unused. + (edebug--display): Bind unread-command-events directly to nil rather + than binding it to unread-command-events and later setting it to nil. + (edebug--display): Kill edebug-eval-buffer here... + (edebug--recursive-edit): ...rather than here. + Bind standard-output and standard-input. + (edebug-eval): Check cl-macroexpand-all is fboundp. + (edebug-temp-display-freq-count): Fix last change. + + * emacs-lisp/easymenu.el (easy-menu-define): Add `debug' spec. + * subr.el (noreturn, 1value): Add `debug' spec. + * emacs-lisp/advice.el: Require cl-lib. + (ad-copy-tree): Remove, use copy-tree instead. + (ad-dolist): Remove use dolist or cl-dolist instead. + (ad-do-return): Remove, use cl-return instead. + (defadvice): Add `debug' spec. + 2012-09-13 Juri Linkov * dired-aux.el (dired-do-chxxx): Use `eq' to detect empty input. diff --git a/lisp/dired.el b/lisp/dired.el index f4ae027181a..ebc8f5da6d5 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3744,7 +3744,7 @@ Ask means pop up a menu for the user to select one of copy, move or link." ;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command ;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown ;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff -;;;;;; dired-diff) "dired-aux" "dired-aux.el" "4b260eda371d319a6c8e8e5ec917e287") +;;;;;; dired-diff) "dired-aux" "dired-aux.el" "22ce64daa7ccb5698cb6b1279aa59ec2") ;;; Generated autoloads from dired-aux.el (autoload 'dired-diff "dired-aux" "\ diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index cac76d2bce1..f0d277a3f69 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -1,4 +1,4 @@ -;;; advice.el --- an overloading mechanism for Emacs Lisp functions +;;; advice.el --- An overloading mechanism for Emacs Lisp functions ;; Copyright (C) 1993-1994, 2000-2012 Free Software Foundation, Inc. @@ -1746,7 +1746,7 @@ (provide 'advice-preload) ;; During a normal load this is a noop: (require 'advice-preload "advice.el") - +(eval-when-compile (require 'cl-lib)) ;; @@ Variable definitions: ;; ======================== @@ -1812,54 +1812,6 @@ generates a copy of TREE." (funcall fUnCtIoN tReE)) (t tReE))) -;; this is just faster than `ad-substitute-tree': -(defun ad-copy-tree (tree) - "Return a copy of the list structure of TREE." - (cond ((consp tree) - (cons (ad-copy-tree (car tree)) - (ad-copy-tree (cdr tree)))) - (t tree))) - -(defmacro ad-dolist (varform &rest body) - "A Common-Lisp-style dolist iterator with the following syntax: - - (ad-dolist (VAR INIT-FORM [RESULT-FORM]) - BODY-FORM...) - -which will iterate over the list yielded by INIT-FORM binding VAR to the -current head at every iteration. If RESULT-FORM is supplied its value will -be returned at the end of the iteration, nil otherwise. The iteration can be -exited prematurely with `(ad-do-return [VALUE])'." - (let ((expansion - `(let ((ad-dO-vAr ,(car (cdr varform))) - ,(car varform)) - (while ad-dO-vAr - (setq ,(car varform) (car ad-dO-vAr)) - ,@body - ;;work around a backquote bug: - ;;(` ((,@ '(foo)) (bar))) => (append '(foo) '(((bar)))) wrong - ;;(` ((,@ '(foo)) (, '(bar)))) => (append '(foo) (list '(bar))) - ,'(setq ad-dO-vAr (cdr ad-dO-vAr))) - ,(car (cdr (cdr varform)))))) - ;;ok, this wastes some cons cells but only during compilation: - (if (catch 'contains-return - (ad-substitute-tree - (function (lambda (subtree) - (cond ((eq (car-safe subtree) 'ad-dolist)) - ((eq (car-safe subtree) 'ad-do-return) - (throw 'contains-return t))))) - 'identity body) - nil) - `(catch 'ad-dO-eXiT ,expansion) - expansion))) - -(defmacro ad-do-return (value) - `(throw 'ad-dO-eXiT ,value)) - -(if (not (get 'ad-dolist 'lisp-indent-hook)) - (put 'ad-dolist 'lisp-indent-hook 1)) - - ;; @@ Save real definitions of subrs used by Advice: ;; ================================================= ;; Advice depends on the real, unmodified functionality of various subrs, @@ -1924,16 +1876,16 @@ exited prematurely with `(ad-do-return [VALUE])'." ad-advised-functions))) (defmacro ad-do-advised-functions (varform &rest body) - "`ad-dolist'-style iterator that maps over `ad-advised-functions'. + "`dolist'-style iterator that maps over `ad-advised-functions'. \(ad-do-advised-functions (VAR [RESULT-FORM]) BODY-FORM...) On each iteration VAR will be bound to the name of an advised function \(a symbol)." - `(ad-dolist (,(car varform) + `(cl-dolist (,(car varform) ad-advised-functions ,(car (cdr varform))) - (setq ,(car varform) (intern (car ,(car varform)))) - ,@body)) + (setq ,(car varform) (intern (car ,(car varform)))) + ,@body)) (if (not (get 'ad-do-advised-functions 'lisp-indent-hook)) (put 'ad-do-advised-functions 'lisp-indent-hook 1)) @@ -1948,7 +1900,7 @@ On each iteration VAR will be bound to the name of an advised function `(put ,function 'ad-advice-info ,advice-info)) (defmacro ad-copy-advice-info (function) - `(ad-copy-tree (get ,function 'ad-advice-info))) + `(copy-tree (get ,function 'ad-advice-info))) (defmacro ad-is-advised (function) "Return non-nil if FUNCTION has any advice info associated with it. @@ -2022,8 +1974,8 @@ either t or nil, and DEFINITION should be a list of the form (defun ad-has-enabled-advice (function class) "True if at least one of FUNCTION's advices in CLASS is enabled." - (ad-dolist (advice (ad-get-advice-info-field function class)) - (if (ad-advice-enabled advice) (ad-do-return t)))) + (cl-dolist (advice (ad-get-advice-info-field function class)) + (if (ad-advice-enabled advice) (cl-return t)))) (defun ad-has-redefining-advice (function) "True if FUNCTION's advice info defines at least 1 redefining advice. @@ -2036,14 +1988,14 @@ Redefining advices affect the construction of an advised definition." (defun ad-has-any-advice (function) "True if the advice info of FUNCTION defines at least one advice." (and (ad-is-advised function) - (ad-dolist (class ad-advice-classes nil) + (cl-dolist (class ad-advice-classes nil) (if (ad-get-advice-info-field function class) - (ad-do-return t))))) + (cl-return t))))) (defun ad-get-enabled-advices (function class) "Return the list of enabled advices of FUNCTION in CLASS." (let (enabled-advices) - (ad-dolist (advice (ad-get-advice-info-field function class)) + (dolist (advice (ad-get-advice-info-field function class)) (if (ad-advice-enabled advice) (push advice enabled-advices))) (reverse enabled-advices))) @@ -2151,7 +2103,7 @@ function at point for which PREDICATE returns non-nil)." (ad-do-advised-functions (function) (if (or (null predicate) (funcall predicate function)) - (ad-do-return function))) + (cl-return function))) (error "ad-read-advised-function: %s" "There are no qualifying advised functions"))) (let* ((ad-pReDiCaTe predicate) @@ -2184,9 +2136,9 @@ be returned on empty input (defaults to the first non-empty advice class of FUNCTION)." (setq default (or default - (ad-dolist (class ad-advice-classes) + (cl-dolist (class ad-advice-classes) (if (ad-get-advice-info-field function class) - (ad-do-return class))) + (cl-return class))) (error "ad-read-advice-class: `%s' has no advices" function))) (let ((class (completing-read (format "%s (default %s): " (or prompt "Class") default) @@ -2255,18 +2207,18 @@ NAME can be a symbol or a regular expression matching part of an advice name. If CLASS is `any' all valid advice classes will be checked." (if (ad-is-advised function) (let (found-advice) - (ad-dolist (advice-class ad-advice-classes) + (cl-dolist (advice-class ad-advice-classes) (if (or (eq class 'any) (eq advice-class class)) (setq found-advice - (ad-dolist (advice (ad-get-advice-info-field + (cl-dolist (advice (ad-get-advice-info-field function advice-class)) (if (or (and (stringp name) (string-match name (symbol-name (ad-advice-name advice)))) (eq name (ad-advice-name advice))) - (ad-do-return advice))))) - (if found-advice (ad-do-return found-advice)))))) + (cl-return advice))))) + (if found-advice (cl-return found-advice)))))) (defun ad-enable-advice-internal (function class name flag) "Set enable FLAG of FUNCTION's advices in CLASS matching NAME. @@ -2277,10 +2229,10 @@ considered. The number of changed advices will be returned (or nil if FUNCTION was not advised)." (if (ad-is-advised function) (let ((matched-advices 0)) - (ad-dolist (advice-class ad-advice-classes) + (dolist (advice-class ad-advice-classes) (if (or (eq class 'any) (eq advice-class class)) - (ad-dolist (advice (ad-get-advice-info-field - function advice-class)) + (dolist (advice (ad-get-advice-info-field + function advice-class)) (cond ((or (and (stringp name) (string-match name (symbol-name (ad-advice-name advice)))) @@ -2868,8 +2820,8 @@ in any of these classes." (if origdoc (setq paragraphs (list origdoc))) (unless (eq style 'plain) (push (concat "This " origtype " is advised.") paragraphs)) - (ad-dolist (class ad-advice-classes) - (ad-dolist (advice (ad-get-enabled-advices function class)) + (dolist (class ad-advice-classes) + (dolist (advice (ad-get-enabled-advices function class)) (setq advice-docstring (ad-make-single-advice-docstring advice class style)) (if advice-docstring @@ -2891,24 +2843,24 @@ in any of these classes." (defun ad-advised-arglist (function) "Find first defined arglist in FUNCTION's redefining advices." - (ad-dolist (advice (append (ad-get-enabled-advices function 'before) + (cl-dolist (advice (append (ad-get-enabled-advices function 'before) (ad-get-enabled-advices function 'around) (ad-get-enabled-advices function 'after))) (let ((arglist (ad-arglist (ad-advice-definition advice)))) (if arglist ;; We found the first one, use it: - (ad-do-return arglist))))) + (cl-return arglist))))) (defun ad-advised-interactive-form (function) "Find first interactive form in FUNCTION's redefining advices." - (ad-dolist (advice (append (ad-get-enabled-advices function 'before) + (cl-dolist (advice (append (ad-get-enabled-advices function 'before) (ad-get-enabled-advices function 'around) (ad-get-enabled-advices function 'after))) (let ((interactive-form (ad-interactive-form (ad-advice-definition advice)))) (if interactive-form ;; We found the first one, use it: - (ad-do-return interactive-form))))) + (cl-return interactive-form))))) ;; @@@ Putting it all together: ;; ============================ @@ -2997,29 +2949,29 @@ and BEFORES, AROUNDS and AFTERS are the lists of advices with which ORIG should be modified. The assembled function will be returned." (let (before-forms around-form around-form-protected after-forms definition) - (ad-dolist (advice befores) - (cond ((and (ad-advice-protected advice) - before-forms) - (setq before-forms - `((unwind-protect - ,(ad-prognify before-forms) - ,@(ad-body-forms - (ad-advice-definition advice)))))) - (t (setq before-forms - (append before-forms - (ad-body-forms (ad-advice-definition advice))))))) + (dolist (advice befores) + (cond ((and (ad-advice-protected advice) + before-forms) + (setq before-forms + `((unwind-protect + ,(ad-prognify before-forms) + ,@(ad-body-forms + (ad-advice-definition advice)))))) + (t (setq before-forms + (append before-forms + (ad-body-forms (ad-advice-definition advice))))))) (setq around-form `(setq ad-return-value ,orig)) - (ad-dolist (advice (reverse arounds)) - ;; If any of the around advices is protected then we - ;; protect the complete around advice onion: - (if (ad-advice-protected advice) - (setq around-form-protected t)) - (setq around-form - (ad-substitute-tree - (function (lambda (form) (eq form 'ad-do-it))) - (function (lambda (form) around-form)) - (ad-prognify (ad-body-forms (ad-advice-definition advice)))))) + (dolist (advice (reverse arounds)) + ;; If any of the around advices is protected then we + ;; protect the complete around advice onion: + (if (ad-advice-protected advice) + (setq around-form-protected t)) + (setq around-form + (ad-substitute-tree + (function (lambda (form) (eq form 'ad-do-it))) + (function (lambda (form) around-form)) + (ad-prognify (ad-body-forms (ad-advice-definition advice)))))) (setq after-forms (if (and around-form-protected before-forms) @@ -3027,17 +2979,17 @@ should be modified. The assembled function will be returned." ,(ad-prognify before-forms) ,around-form)) (append before-forms (list around-form)))) - (ad-dolist (advice afters) - (cond ((and (ad-advice-protected advice) - after-forms) - (setq after-forms - `((unwind-protect - ,(ad-prognify after-forms) - ,@(ad-body-forms - (ad-advice-definition advice)))))) - (t (setq after-forms - (append after-forms - (ad-body-forms (ad-advice-definition advice))))))) + (dolist (advice afters) + (cond ((and (ad-advice-protected advice) + after-forms) + (setq after-forms + `((unwind-protect + ,(ad-prognify after-forms) + ,@(ad-body-forms + (ad-advice-definition advice)))))) + (t (setq after-forms + (append after-forms + (ad-body-forms (ad-advice-definition advice))))))) (setq definition `(,@(if (memq type '(macro special-form)) '(macro)) @@ -3171,11 +3123,11 @@ advised definition from scratch." (nth 2 cache-id))))) (defun ad-verify-cache-class-id (cache-class-id advices) - (ad-dolist (advice advices (null cache-class-id)) + (cl-dolist (advice advices (null cache-class-id)) (if (ad-advice-enabled advice) (if (eq (car cache-class-id) (ad-advice-name advice)) (setq cache-class-id (cdr cache-class-id)) - (ad-do-return nil))))) + (cl-return nil))))) ;; There should be a way to monitor if and why a cache verification failed ;; in order to determine whether a certain preactivation could be used or @@ -3670,7 +3622,16 @@ See Info node `(elisp)Advising Functions' for comprehensive documentation. usage: (defadvice FUNCTION (CLASS NAME [POSITION] [ARGLIST] FLAG...) [DOCSTRING] [INTERACTIVE-FORM] BODY...)" - (declare (doc-string 3)) + (declare (doc-string 3) + (debug (&define name ;; thing being advised. + (name ;; class is [&or "before" "around" "after" + ;; "activation" "deactivation"] + name ;; name of advice + &rest sexp ;; optional position and flags + ) + [&optional stringp] + [&optional ("interactive" interactive)] + def-body))) (if (not (ad-name-p function)) (error "defadvice: Invalid function name: %s" function)) (let* ((class (car args)) diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index 7f9f8a33634..939fab78942 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el @@ -148,7 +148,7 @@ unselectable text. A string consisting solely of hyphens is displayed as a solid horizontal line. A menu item can be a list with the same format as MENU. This is a submenu." - (declare (indent defun)) + (declare (indent defun) (debug (symbolp body))) `(progn ,(if symbol `(defvar ,symbol nil ,doc)) (easy-menu-do-define (quote ,symbol) ,maps ,doc ,menu))) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 8f0f24ad092..d656dcf9526 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -52,10 +52,7 @@ ;;; Code: (require 'macroexp) - -;;; Bug reporting - -(defalias 'edebug-submit-bug-report 'report-emacs-bug) +(eval-when-compile (require 'cl-lib)) ;;; Options @@ -362,6 +359,7 @@ Return the result of the last expression in BODY." ;; Select WINDOW if it is provided and still exists. Otherwise, ;; if buffer is currently shown in several windows, choose one. ;; Otherwise, find a new window, possibly splitting one. + ;; FIXME: We should probably just be using `pop-to-buffer'. (setq window (cond ((and (edebug-window-live-p window) @@ -370,7 +368,7 @@ Return the result of the last expression in BODY." ((eq (window-buffer (selected-window)) buffer) ;; Selected window already displays BUFFER. (selected-window)) - ((edebug-get-buffer-window buffer)) + ((get-buffer-window buffer 0)) ((one-window-p 'nomini) ;; When there's one window only, split it. (split-window)) @@ -443,18 +441,14 @@ Return the result of the last expression in BODY." window-info) (set-window-configuration window-info))) -(defalias 'edebug-get-buffer-window 'get-buffer-window) -(defalias 'edebug-sit-for 'sit-for) -(defalias 'edebug-input-pending-p 'input-pending-p) - - ;;; Redefine read and eval functions ;; read is redefined to maybe instrument forms. ;; eval-defun is redefined to check edebug-all-forms and edebug-all-defs. ;; Save the original read function -(or (fboundp 'edebug-original-read) - (defalias 'edebug-original-read (symbol-function 'read))) +(defalias 'edebug-original-read + (symbol-function (if (fboundp 'edebug-original-read) + 'edebug-original-read 'read))) (defun edebug-read (&optional stream) "Read one Lisp expression as text from STREAM, return as Lisp object. @@ -621,8 +615,8 @@ already is one.)" (defvar-local edebug-form-data nil "A list of entries associating symbols with buffer regions. -This is an automatic buffer local variable. Each entry looks like: -\(SYMBOL BEGIN-MARKER END-MARKER). The markers +Each entry is an `edebug--form-data' struct with fields: +SYMBOL, BEGIN-MARKER, and END-MARKER. The markers are at the beginning and end of an entry level form and SYMBOL is a symbol that holds all edebug related information for the form on its property list. @@ -631,24 +625,17 @@ In the future (haha!), the symbol will be irrelevant and edebug data will be stored in the definitions themselves rather than in the property list of a symbol.") -;; FIXME: Use cl-defstruct. - -(defun edebug-make-form-data-entry (symbol begin end) - (list symbol begin end)) - -(defsubst edebug-form-data-name (entry) - (car entry)) - -(defsubst edebug-form-data-begin (entry) - (nth 1 entry)) - -(defsubst edebug-form-data-end (entry) - (nth 2 entry)) +(cl-defstruct (edebug--form-data + ;; Some callers expect accessors to return nil when passed nil. + (:type list) + (:constructor edebug--make-form-data-entry (name begin end)) + (:predicate nil) (:constructor nil) (:copier nil)) + name begin end) (defsubst edebug-set-form-data-entry (entry name begin end) - (setcar entry name) ;; In case name is changed. - (set-marker (nth 1 entry) begin) - (set-marker (nth 2 entry) end)) + (setf (edebug--form-data-name entry) name) ;; In case name is changed. + (set-marker (edebug--form-data-begin entry) begin) + (set-marker (edebug--form-data-end entry) end)) (defun edebug-get-form-data-entry (pnt &optional end-point) ;; Find the edebug form data entry which is closest to PNT. @@ -656,17 +643,17 @@ list of a symbol.") ;; Return `nil' if none found. (let ((rest edebug-form-data) closest-entry - (closest-dist 999999)) ;; need maxint here + (closest-dist 999999)) ;; Need maxint here. (while (and rest (< 0 closest-dist)) (let* ((entry (car rest)) - (begin (edebug-form-data-begin entry)) + (begin (edebug--form-data-begin entry)) (dist (- pnt begin))) (setq rest (cdr rest)) (if (and (<= 0 dist) (< dist closest-dist) (or (not end-point) - (= end-point (edebug-form-data-end entry))) - (<= pnt (edebug-form-data-end entry))) + (= end-point (edebug--form-data-end entry))) + (<= pnt (edebug--form-data-end entry))) (setq closest-dist dist closest-entry entry)))) closest-entry)) @@ -675,19 +662,19 @@ list of a symbol.") ;; and find an entry given a symbol, which should be just assq. (defun edebug-form-data-symbol () -;; Return the edebug data symbol of the form where point is in. -;; If point is not inside a edebuggable form, cause error. - (or (edebug-form-data-name (edebug-get-form-data-entry (point))) + "Return the edebug data symbol of the form where point is in. +If point is not inside a edebuggable form, cause error." + (or (edebug--form-data-name (edebug-get-form-data-entry (point))) (error "Not inside instrumented form"))) (defun edebug-make-top-form-data-entry (new-entry) ;; Make NEW-ENTRY the first element in the `edebug-form-data' list. (edebug-clear-form-data-entry new-entry) - (setq edebug-form-data (cons new-entry edebug-form-data))) + (push new-entry edebug-form-data)) (defun edebug-clear-form-data-entry (entry) -;; If non-nil, clear ENTRY out of the form data. -;; Maybe clear the markers and delete the symbol's edebug property? + "If non-nil, clear ENTRY out of the form data. +Maybe clear the markers and delete the symbol's edebug property?" (if entry (progn ;; Instead of this, we could just find all contained forms. @@ -1285,7 +1272,7 @@ expressions; a `progn' form will be returned enclosing these forms." ;; Set this marker before parsing. (edebug-form-begin-marker (if form-data-entry - (edebug-form-data-begin form-data-entry) + (edebug--form-data-begin form-data-entry) ;; Buffer must be current-buffer for this to work: (set-marker (make-marker) form-begin)))) @@ -1295,7 +1282,7 @@ expressions; a `progn' form will be returned enclosing these forms." ;; For definitions. ;; (edebug-containing-def-name edebug-def-name) ;; Get name from form-data, if any. - (edebug-old-def-name (edebug-form-data-name form-data-entry)) + (edebug-old-def-name (edebug--form-data-name form-data-entry)) edebug-def-name edebug-def-args edebug-def-interactive @@ -1325,7 +1312,7 @@ expressions; a `progn' form will be returned enclosing these forms." ;; In the latter case, pointers to the entry remain eq. (if (not form-data-entry) (setq form-data-entry - (edebug-make-form-data-entry + (edebug--make-form-data-entry edebug-def-name edebug-form-begin-marker ;; Buffer must be current-buffer. @@ -1522,7 +1509,7 @@ expressions; a `progn' form will be returned enclosing these forms." (if edebug-error-point (goto-char edebug-error-point)) (apply 'edebug-syntax-error args)) - (funcall 'throw 'no-match args))) + (throw 'no-match args))) (defun edebug-match (cursor specs) @@ -2012,11 +1999,6 @@ expressions; a `progn' form will be returned enclosing these forms." ;; (def-edebug-spec anonymous-form ((&or ["lambda" lambda] ["macro" macro]))) ;; Standard functions that take function-forms arguments. -(def-edebug-spec mapcar (function-form form)) -(def-edebug-spec mapconcat (function-form form form)) -(def-edebug-spec mapatoms (function-form &optional form)) -(def-edebug-spec apply (function-form &rest form)) -(def-edebug-spec funcall (function-form &rest form)) ;; FIXME? The manual uses this form (maybe that's just for illustration?): ;; (def-edebug-spec let @@ -2082,49 +2064,12 @@ expressions; a `progn' form will be returned enclosing these forms." &or ("quote" edebug-\`) def-form)) ;; New byte compiler. -(def-edebug-spec defsubst defun) -(def-edebug-spec dont-compile t) -(def-edebug-spec eval-when-compile t) -(def-edebug-spec eval-and-compile t) (def-edebug-spec save-selected-window t) (def-edebug-spec save-current-buffer t) -(def-edebug-spec delay-mode-hooks t) -(def-edebug-spec with-temp-file t) -(def-edebug-spec with-temp-message t) -(def-edebug-spec with-syntax-table t) -(def-edebug-spec push (form sexp)) -(def-edebug-spec pop (sexp)) - -(def-edebug-spec 1value (form)) -(def-edebug-spec noreturn (form)) - ;; Anything else? - -;; Some miscellaneous specs for macros in public packages. -;; Send me yours. - -;; advice.el by Hans Chalupsky (hans@cs.buffalo.edu) - -(def-edebug-spec ad-dolist ((symbolp form &optional form) body)) -(def-edebug-spec defadvice - (&define name ;; thing being advised. - (name ;; class is [&or "before" "around" "after" - ;; "activation" "deactivation"] - name ;; name of advice - &rest sexp ;; optional position and flags - ) - [&optional stringp] - [&optional ("interactive" interactive)] - def-body)) - -(def-edebug-spec easy-menu-define (symbolp body)) - -(def-edebug-spec with-custom-print body) - - ;;; The debugger itself (defvar edebug-active nil) ;; Non-nil when edebug is active @@ -2177,8 +2122,6 @@ expressions; a `progn' form will be returned enclosing these forms." (defvar edebug-outside-debug-on-error) ; the value of debug-on-error outside (defvar edebug-outside-debug-on-quit) ; the value of debug-on-quit outside -(defvar edebug-outside-overriding-local-map) -(defvar edebug-outside-overriding-terminal-local-map) (defvar edebug-outside-pre-command-hook) (defvar edebug-outside-post-command-hook) @@ -2339,7 +2282,7 @@ MSG is printed after `::::} '." (1+ (aref edebug-freq-count before-index))) (if (or (not (memq edebug-execution-mode '(Go-nonstop next))) - (edebug-input-pending-p)) + (input-pending-p)) (edebug-debugger before-index 'before nil))) before-index) @@ -2361,7 +2304,7 @@ MSG is printed after `::::} '." (if edebug-test-coverage (edebug--update-coverage after-index value)) (if (and (eq edebug-execution-mode 'Go-nonstop) - (not (edebug-input-pending-p))) + (not (input-pending-p))) ;; Just return result. value (edebug-debugger after-index 'after value) @@ -2445,7 +2388,7 @@ MSG is printed after `::::} '." ;; or break, or input is pending, (if (or (not (memq edebug-execution-mode '(go continue Continue-fast))) edebug-break - (edebug-input-pending-p)) + (input-pending-p)) (edebug--display value offset-index arg-mode)) ; <---------- display value))) @@ -2522,7 +2465,7 @@ MSG is printed after `::::} '." (let ((overlay-arrow-position overlay-arrow-position) (overlay-arrow-string overlay-arrow-string) (cursor-in-echo-area nil) - (unread-command-events unread-command-events) + (unread-command-events nil) ;; any others?? ) (setq-default cursor-in-non-selected-windows t) @@ -2577,7 +2520,7 @@ MSG is printed after `::::} '." (edebug-adjust-window (cdr edebug-window-data))) ;; Test if there is input, not including keyboard macros. - (if (edebug-input-pending-p) + (if (input-pending-p) (progn (setq edebug-execution-mode 'step edebug-stop t) @@ -2612,27 +2555,26 @@ MSG is printed after `::::} '." (t (message ""))) - (setq unread-command-events nil) (if (eq 'after arg-mode) (progn ;; Display result of previous evaluation. (if (and edebug-break (not (eq edebug-execution-mode 'Continue-fast))) - (edebug-sit-for edebug-sit-for-seconds)) ; Show message. + (sit-for edebug-sit-for-seconds)) ; Show message. (edebug-previous-result))) (cond (edebug-break (cond ((eq edebug-execution-mode 'continue) - (edebug-sit-for edebug-sit-for-seconds)) - ((eq edebug-execution-mode 'Continue-fast) (edebug-sit-for 0)) + (sit-for edebug-sit-for-seconds)) + ((eq edebug-execution-mode 'Continue-fast) (sit-for 0)) (t (setq edebug-stop t)))) ;; not edebug-break ((eq edebug-execution-mode 'trace) - (edebug-sit-for edebug-sit-for-seconds)) ; Force update and pause. + (sit-for edebug-sit-for-seconds)) ; Force update and pause. ((eq edebug-execution-mode 'Trace-fast) - (edebug-sit-for 0))) ; Force update and continue. + (sit-for 0))) ; Force update and continue. (unwind-protect (if (or edebug-stop @@ -2646,7 +2588,7 @@ MSG is printed after `::::} '." ;; Reset the edebug-window-data to whatever it is now. (let ((window (if (eq (window-buffer) edebug-buffer) (selected-window) - (edebug-get-buffer-window edebug-buffer)))) + (get-buffer-window edebug-buffer)))) ;; Remember window-start for edebug-buffer, if still displayed. (if window (progn @@ -2724,6 +2666,8 @@ MSG is printed after `::::} '." (goto-char edebug-buffer-outside-point)) ;; ... nothing more. ) + ;; Could be an option to keep eval display up. + (if edebug-eval-buffer (kill-buffer edebug-eval-buffer)) (with-timeout-unsuspend edebug-with-timeout-suspend) ;; Reset global variables to outside values in case they were changed. (setq @@ -2790,10 +2734,6 @@ MSG is printed after `::::} '." (edebug-outside-map (current-local-map)) - (edebug-outside-overriding-local-map overriding-local-map) - (edebug-outside-overriding-terminal-local-map - overriding-terminal-local-map) - ;; Save the outside value of executing macro. (here??) (edebug-outside-executing-macro executing-kbd-macro) (edebug-outside-pre-command-hook @@ -2832,6 +2772,9 @@ MSG is printed after `::::} '." (last-nonmenu-event nil) (track-mouse nil) + (standard-output t) + (standard-input t) + ;; Don't keep reading from an executing kbd macro ;; within edebug unless edebug-continue-kbd-macro is ;; non-nil. Again, local binding may not be best. @@ -2874,8 +2817,6 @@ MSG is printed after `::::} '." (setq signal-hook-function 'edebug-signal) (if edebug-backtrace-buffer (kill-buffer edebug-backtrace-buffer)) - ;; Could be an option to keep eval display up. - (if edebug-eval-buffer (kill-buffer edebug-eval-buffer)) ;; Remember selected-window after recursive-edit. ;; (setq edebug-inside-window (selected-window)) @@ -2923,8 +2864,8 @@ MSG is printed after `::::} '." (defun edebug-adjust-window (old-start) ;; If pos is not visible, adjust current window to fit following context. -;;; (message "window: %s old-start: %s window-start: %s pos: %s" -;;; (selected-window) old-start (window-start) (point)) (sit-for 5) + ;; (message "window: %s old-start: %s window-start: %s pos: %s" + ;; (selected-window) old-start (window-start) (point)) (sit-for 5) (if (not (pos-visible-in-window-p)) (progn ;; First try old-start @@ -2932,7 +2873,7 @@ MSG is printed after `::::} '." (set-window-start (selected-window) old-start)) (if (not (pos-visible-in-window-p)) (progn -;; (message "resetting window start") (sit-for 2) + ;; (message "resetting window start") (sit-for 2) (set-window-start (selected-window) (save-excursion @@ -3071,7 +3012,7 @@ before returning. The default is one second." (current-buffer) (point) (if (marker-buffer (edebug-mark-marker)) (marker-position (edebug-mark-marker)) "")) - (edebug-sit-for arg) + (sit-for arg) (edebug-pop-to-buffer edebug-buffer (car edebug-window-data))))) @@ -3398,7 +3339,7 @@ function or macro is called, Edebug will be called there as well." (save-excursion (down-list 1) (if (looking-at "\(") - (edebug-form-data-name + (edebug--form-data-name (edebug-get-form-data-entry (point))) (edebug-original-read (current-buffer)))))) (edebug-instrument-function func)))) @@ -3604,7 +3545,8 @@ Return the result of the last expression." (defun edebug-eval (expr) ;; Are there cl lexical variables active? - (eval (if (bound-and-true-p cl-debug-env) + (eval (if (and (bound-and-true-p cl-debug-env) + (fboundp 'cl-macroexpand-all)) (cl-macroexpand-all expr cl-debug-env) expr) lexical-binding)) @@ -4088,15 +4030,15 @@ Otherwise call `debug' normally." "In buffer BUF-NAME, display FMT and ARGS at the end and make it visible. The buffer is created if it does not exist. You must include newlines in FMT to break lines, but one newline is appended." -;; e.g. -;; (edebug-trace-display "*trace-point*" -;; "saving: point = %s window-start = %s" -;; (point) (window-start)) + ;; e.g. + ;; (edebug-trace-display "*trace-point*" + ;; "saving: point = %s window-start = %s" + ;; (point) (window-start)) (let* ((oldbuf (current-buffer)) (selected-window (selected-window)) (buffer (get-buffer-create buf-name)) buf-window) -;; (message "before pop-to-buffer") (sit-for 1) + ;; (message "before pop-to-buffer") (sit-for 1) (edebug-pop-to-buffer buffer) (setq truncate-lines t) (setq buf-window (selected-window)) @@ -4106,8 +4048,8 @@ You must include newlines in FMT to break lines, but one newline is appended." (vertical-motion (- 1 (window-height))) (set-window-start buf-window (point)) (goto-char (point-max)) -;; (set-window-point buf-window (point)) -;; (edebug-sit-for 0) + ;; (set-window-point buf-window (point)) + ;; (sit-for 0) (bury-buffer buffer) (select-window selected-window) (set-buffer oldbuf)) @@ -4170,8 +4112,8 @@ reinstrument it." ;; Insert all the indices for this line. (forward-line 1) (setq start-of-count-line (point) - first-index i ; really last index for line above this one. - last-count -1) ; cause first count to always appear. + first-index i ; Really, last index for line above this one. + last-count -1) ; Cause first count to always appear. (insert ";#") ;; i == first-index still (while (<= (setq i (1+ i)) last-index) @@ -4203,7 +4145,8 @@ It is removed when you hit any char." (let ((buffer-read-only nil)) (undo-boundary) (edebug-display-freq-count) - (setq unread-command-events (append unread-command-events (read-event))) + (setq unread-command-events + (append unread-command-events (list (read-event)))) ;; Yuck! This doesn't seem to work at all for me. (undo))) @@ -4314,80 +4257,6 @@ With prefix argument, make it a temporary breakpoint." (edebug-modify-breakpoint t condition arg)) (easy-menu-define edebug-menu edebug-mode-map "Edebug menus" edebug-mode-menus) - -;;; Byte-compiler - -;; Extension for bytecomp to resolve undefined function references. -;; Requires new byte compiler. - -(eval-when-compile - ;; The body of eval-when-compile seems to get evaluated with eval-defun. - ;; We only want to evaluate when actually byte compiling. - ;; But it is OK to evaluate as long as byte-compiler has been loaded. - (if (featurep 'byte-compile) (progn - - (defun byte-compile-resolve-functions (funcs) - "Say it is OK for the named functions to be unresolved." - (mapc - (function - (lambda (func) - (setq byte-compile-unresolved-functions - (delq (assq func byte-compile-unresolved-functions) - byte-compile-unresolved-functions)))) - funcs) - nil) - - '(defun byte-compile-resolve-free-references (vars) - "Say it is OK for the named variables to be referenced." - (mapcar - (function - (lambda (var) - (setq byte-compile-free-references - (delq var byte-compile-free-references)))) - vars) - nil) - - '(defun byte-compile-resolve-free-assignments (vars) - "Say it is OK for the named variables to be assigned." - (mapcar - (function - (lambda (var) - (setq byte-compile-free-assignments - (delq var byte-compile-free-assignments)))) - vars) - nil) - - (byte-compile-resolve-functions - '(reporter-submit-bug-report - edebug-gensym ;; also in cl.el - ;; Interfaces to standard functions. - edebug-original-eval-defun - edebug-original-read - edebug-get-buffer-window - edebug-mark - edebug-mark-marker - edebug-input-pending-p - edebug-sit-for - edebug-prin1-to-string - edebug-format - ;; lemacs - zmacs-deactivate-region - popup-menu - ;; CL - cl-macroexpand-all - ;; And believe it or not, the byte compiler doesn't know about: - byte-compile-resolve-functions - )) - - '(byte-compile-resolve-free-references - '(read-expression-history - read-expression-map)) - - '(byte-compile-resolve-free-assignments - '(read-expression-history)) - - ))) - ;;; Autoloading of Edebug accessories diff --git a/lisp/subr.el b/lisp/subr.el index aa1b10ce17d..e9b85ff1f38 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -80,6 +80,7 @@ For more information, see Info node `(elisp)Declaring Functions'." (defmacro noreturn (form) "Evaluate FORM, expecting it not to return. If FORM does return, signal an error." + (declare (debug t)) `(prog1 ,form (error "Form marked with `noreturn' did return"))) @@ -87,6 +88,7 @@ If FORM does return, signal an error." "Evaluate FORM, expecting a constant return value. This is the global do-nothing version. There is also `testcover-1value' that complains if FORM ever does return differing values." + (declare (debug t)) form) (defmacro def-edebug-spec (symbol spec) From 6b533e9cb5c66766cbc2a222d86c2d441e7d2e43 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Fri, 14 Sep 2012 08:55:38 +0200 Subject: [PATCH 27/88] In Fformat_mode_line always save/restore current buffer. (Bug#12387) * xdisp.c (Fformat_mode_line): Unconditionally save/restore current buffer. (Bug#12387) --- src/ChangeLog | 5 +++++ src/xdisp.c | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 0f741c5c4cf..5cda8241916 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-09-14 Martin Rudalics + + * xdisp.c (Fformat_mode_line): Unconditionally save/restore + current buffer (Bug#12387). + 2012-09-14 Juanma Barranquero * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies. diff --git a/src/xdisp.c b/src/xdisp.c index e9d9595d91e..320998a5713 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -21039,8 +21039,7 @@ are the selected window and the WINDOW's buffer). */) : EQ (face, Qtool_bar) ? TOOL_BAR_FACE_ID : DEFAULT_FACE_ID; - if (XBUFFER (buffer) != current_buffer) - old_buffer = current_buffer; + old_buffer = current_buffer; /* Save things including mode_line_proptrans_alist, and set that to nil so that we don't alter the outer value. */ @@ -21051,8 +21050,7 @@ are the selected window and the WINDOW's buffer). */) mode_line_proptrans_alist = Qnil; Fselect_window (window, Qt); - if (old_buffer) - set_buffer_internal_1 (XBUFFER (buffer)); + set_buffer_internal_1 (XBUFFER (buffer)); init_iterator (&it, w, -1, -1, NULL, face_id); From 33bd7ff0f66acdab978b5c67e76c3676286ab3e6 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 14 Sep 2012 06:17:31 -0400 Subject: [PATCH 28/88] Auto-commit of generated files. --- autogen/configure | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/autogen/configure b/autogen/configure index 25391a0469e..63295f68db0 100755 --- a/autogen/configure +++ b/autogen/configure @@ -24254,11 +24254,7 @@ fi #### It makes printing result more understandable as using GTK sets #### toolkit_scroll_bars to yes by default. if test "${HAVE_GTK}" = "yes"; then - if test "${with_gtk3}" = "yes"; then - USE_X_TOOLKIT=GTK3 - else - USE_X_TOOLKIT=GTK - fi + USE_X_TOOLKIT=GTK fi echo " From 0fb3cb7c8921f6ad3ac59c24d608384be91d5baa Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 14 Sep 2012 09:44:31 -0400 Subject: [PATCH 29/88] * lisp/emacs-lisp/advice.el (ad-prognify): Remove, use macroexp-progn. --- lisp/ChangeLog | 2 ++ lisp/emacs-lisp/advice.el | 16 ++++++---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7163b4b4989..2b5b5f49b58 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-09-14 Stefan Monnier + * emacs-lisp/advice.el (ad-prognify): Remove, use macroexp-progn. + * emacs-lisp/edebug.el: Miscellaneous cleanup. Remove obsolete byte-compiler hack that tried to silence some warnings. (edebug-submit-bug-report): Remove. diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index f0d277a3f69..d96076d17a6 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -1746,6 +1746,7 @@ (provide 'advice-preload) ;; During a normal load this is a noop: (require 'advice-preload "advice.el") +(require 'macroexp) (eval-when-compile (require 'cl-lib)) ;; @@ Variable definitions: @@ -2538,11 +2539,6 @@ For that it has to be fbound with a non-autoload definition." (byte-compile symbol) (fset function (symbol-function symbol)))))) -(defun ad-prognify (forms) - (cond ((<= (length forms) 1) - (car forms)) - (t (cons 'progn forms)))) - ;; @@@ Accessing argument lists: ;; ============================= @@ -2954,7 +2950,7 @@ should be modified. The assembled function will be returned." before-forms) (setq before-forms `((unwind-protect - ,(ad-prognify before-forms) + ,(macroexp-progn before-forms) ,@(ad-body-forms (ad-advice-definition advice)))))) (t (setq before-forms @@ -2971,12 +2967,12 @@ should be modified. The assembled function will be returned." (ad-substitute-tree (function (lambda (form) (eq form 'ad-do-it))) (function (lambda (form) around-form)) - (ad-prognify (ad-body-forms (ad-advice-definition advice)))))) + (macroexp-progn (ad-body-forms (ad-advice-definition advice)))))) (setq after-forms (if (and around-form-protected before-forms) `((unwind-protect - ,(ad-prognify before-forms) + ,(macroexp-progn before-forms) ,around-form)) (append before-forms (list around-form)))) (dolist (advice afters) @@ -2984,7 +2980,7 @@ should be modified. The assembled function will be returned." after-forms) (setq after-forms `((unwind-protect - ,(ad-prognify after-forms) + ,(macroexp-progn after-forms) ,@(ad-body-forms (ad-advice-definition advice)))))) (t (setq after-forms @@ -3013,7 +3009,7 @@ should be modified. The assembled function will be returned." (ad-body-forms (ad-advice-definition advice)))) (ad-get-enabled-advices function hook-name)))) (if hook-forms - (ad-prognify (apply 'append hook-forms))))) + (macroexp-progn (apply 'append hook-forms))))) ;; @@ Caching: From 2f294edf3a601c612e0a4c208539e842d790a894 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Fri, 14 Sep 2012 18:23:50 +0400 Subject: [PATCH 30/88] Avoid out-of-range marker position (Bug#12426). * insdel.c (replace_range, replace_range_2): Adjust markers before overlays, as suggested by comments. (insert_1_both, insert_from_buffer_1, adjust_after_replace): Remove redundant check before calling offset_intervals. --- src/ChangeLog | 8 ++++++++ src/insdel.c | 31 ++++++++++++++----------------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5cda8241916..27698886079 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2012-09-14 Dmitry Antipov + + Avoid out-of-range marker position (Bug#12426). + * insdel.c (replace_range, replace_range_2): Adjust + markers before overlays, as suggested by comments. + (insert_1_both, insert_from_buffer_1, adjust_after_replace): + Remove redundant check before calling offset_intervals. + 2012-09-14 Martin Rudalics * xdisp.c (Fformat_mode_line): Unconditionally save/restore diff --git a/src/insdel.c b/src/insdel.c index b12a390633e..bfb2327a696 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -840,8 +840,7 @@ insert_1_both (const char *string, PT + nchars, PT_BYTE + nbytes, before_markers); - if (buffer_intervals (current_buffer)) - offset_intervals (current_buffer, PT, nchars); + offset_intervals (current_buffer, PT, nchars); if (!inherit && buffer_intervals (current_buffer)) set_text_properties (make_number (PT), make_number (PT + nchars), @@ -1153,8 +1152,7 @@ insert_from_buffer_1 (struct buffer *buf, PT_BYTE + outgoing_nbytes, 0); - if (buffer_intervals (current_buffer)) - offset_intervals (current_buffer, PT, nchars); + offset_intervals (current_buffer, PT, nchars); /* Get the intervals for the part of the string we are inserting. */ intervals = buffer_intervals (buf); @@ -1222,8 +1220,7 @@ adjust_after_replace (ptrdiff_t from, ptrdiff_t from_byte, else if (len < nchars_del) adjust_overlays_for_delete (from, nchars_del - len); - if (buffer_intervals (current_buffer)) - offset_intervals (current_buffer, from, len - nchars_del); + offset_intervals (current_buffer, from, len - nchars_del); if (from < PT) adjust_point (len - nchars_del, len_byte - nbytes_del); @@ -1394,16 +1391,16 @@ replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new, eassert (GPT <= GPT_BYTE); - /* Adjust the overlay center as needed. This must be done after - adjusting the markers that bound the overlays. */ - adjust_overlays_for_delete (from, nchars_del); - adjust_overlays_for_insert (from, inschars); - /* Adjust markers for the deletion and the insertion. */ if (markers) adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del, inschars, outgoing_insbytes); + /* Adjust the overlay center as needed. This must be done after + adjusting the markers that bound the overlays. */ + adjust_overlays_for_delete (from, nchars_del); + adjust_overlays_for_insert (from, inschars); + offset_intervals (current_buffer, from, inschars - nchars_del); /* Get the intervals for the part of the string we are inserting-- @@ -1510,6 +1507,12 @@ replace_range_2 (ptrdiff_t from, ptrdiff_t from_byte, eassert (GPT <= GPT_BYTE); + /* Adjust markers for the deletion and the insertion. */ + if (markers + && ! (nchars_del == 1 && inschars == 1 && nbytes_del == insbytes)) + adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del, + inschars, insbytes); + /* Adjust the overlay center as needed. This must be done after adjusting the markers that bound the overlays. */ if (nchars_del != inschars) @@ -1518,12 +1521,6 @@ replace_range_2 (ptrdiff_t from, ptrdiff_t from_byte, adjust_overlays_for_delete (from + inschars, nchars_del); } - /* Adjust markers for the deletion and the insertion. */ - if (markers - && ! (nchars_del == 1 && inschars == 1 && nbytes_del == insbytes)) - adjust_markers_for_replace (from, from_byte, nchars_del, nbytes_del, - inschars, insbytes); - offset_intervals (current_buffer, from, inschars - nchars_del); /* Relocate point as if it were a marker. */ From e3141fcf8456dc1ec7455e34437ac09f0c812ac9 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 14 Sep 2012 11:56:19 -0700 Subject: [PATCH 31/88] * configure.ac: Port to hosts lacking gtk. (PKG_CHECK_MODULES): Capture pkg-config diagnostics better, in particular, problems in invoking pkg-config itself. This is useful on hosts that don't have pkg-config. (GTK_MODULES): Do not exit 'configure' simply because gtk3 and gtk2 are both missing. Problem found on Solaris 8. --- ChangeLog | 9 +++++++++ configure.ac | 15 ++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index e46fbef7113..b0f6ab6e984 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2012-09-14 Paul Eggert + + * configure.ac: Port to hosts lacking gtk. + (PKG_CHECK_MODULES): Capture pkg-config diagnostics + better, in particular, problems in invoking pkg-config itself. + This is useful on hosts that don't have pkg-config. + (GTK_MODULES): Do not exit 'configure' simply because gtk3 + and gtk2 are both missing. Problem found on Solaris 8. + 2012-09-13 Jan Djärv * configure.ac: Reorder Xaw3d messages. diff --git a/configure.ac b/configure.ac index ce65f07522d..accbb68e7b0 100644 --- a/configure.ac +++ b/configure.ac @@ -1189,9 +1189,10 @@ AC_DEFUN([PKG_CHECK_MODULES], [ $1_CFLAGS="" $1_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - ifelse([$4], ,echo $$1_PKG_ERRORS,) + ## do set a variable so people can do so. Do it in a subshell + ## to capture any diagnostics in invoking pkg-config. + $1_PKG_ERRORS=`($PKG_CONFIG --print-errors "$2") 2>&1` + ifelse([$4], ,echo "$$1_PKG_ERRORS",) fi AC_SUBST($1_CFLAGS) @@ -1934,10 +1935,10 @@ if test "${with_gtk2}" = "yes" || test "$check_gtk2" = "yes"; then dnl Checks for libraries. PKG_CHECK_MODULES(GTK, $GTK_MODULES, pkg_check_gtk=yes, pkg_check_gtk=no) - if test "$pkg_check_gtk" = "no"; then - if test "$USE_X_TOOLKIT" = "maybe" || test "$with_gtk" = "yes" || test "$with_gtk2" = "yes"; then - AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS) - fi + if test "$pkg_check_gtk" = "no" && + { test "$with_gtk" = yes || test "$with_gtk2" = "yes"; } + then + AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS) fi fi From 2af0342954599918f739d981e8151f7e8a46c3c6 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 14 Sep 2012 15:01:19 -0700 Subject: [PATCH 32/88] Fix glitches with 'configure --without-sync-input'. * configure.ac (--without-sync-input): Fix typo in usage message. * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]: Include "syssignal.h", for 'main_thread'. --- ChangeLog | 2 ++ configure.ac | 2 +- src/ChangeLog | 5 +++++ src/alloc.c | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b0f6ab6e984..3e662edb6bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2012-09-14 Paul Eggert + * configure.ac (--without-sync-input): Fix typo in usage message. + * configure.ac: Port to hosts lacking gtk. (PKG_CHECK_MODULES): Capture pkg-config diagnostics better, in particular, problems in invoking pkg-config itself. diff --git a/configure.ac b/configure.ac index accbb68e7b0..382e62a97a1 100644 --- a/configure.ac +++ b/configure.ac @@ -128,7 +128,7 @@ AC_ARG_WITH([mailhost],[AS_HELP_STRING([--with-mailhost=HOSTNAME], OPTION_DEFAULT_ON([sound],[don't compile with sound support]) -OPTION_DEFAULT_ON([sync-input],[process async input synchronously]) +OPTION_DEFAULT_ON([sync-input],[don't process async input synchronously]) if test "$with_sync_input" = yes; then AC_DEFINE(SYNC_INPUT, 1, [Process async input synchronously.]) fi diff --git a/src/ChangeLog b/src/ChangeLog index 27698886079..b1b4dc8bbcd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-09-14 Paul Eggert + + * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]: + Include "syssignal.h", for 'main_thread'. + 2012-09-14 Dmitry Antipov Avoid out-of-range marker position (Bug#12426). diff --git a/src/alloc.c b/src/alloc.c index 77807f6e086..25cf03dfa2e 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -100,6 +100,8 @@ extern void _free_internal (void *); #if ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT #ifdef HAVE_PTHREAD +# include "syssignal.h" + /* When GTK uses the file chooser dialog, different backends can be loaded dynamically. One such a backend is the Gnome VFS backend that gets loaded if you run Gnome. That backend creates several threads and also allocates From cb26b7f5728f68d118c2f1a6694f6cedbf28a0d9 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Sat, 15 Sep 2012 01:58:43 +0300 Subject: [PATCH 33/88] * lisp/dired-aux.el (dired-do-chmod): Use `eq' to detect empty input. Fixes: debbugs:12399 --- lisp/ChangeLog | 5 +++++ lisp/dired-aux.el | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2b5b5f49b58..e27fa53e7b5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-09-14 Juri Linkov + + * dired-aux.el (dired-do-chmod): Use `eq' to detect empty input. + (Bug#12399) + 2012-09-14 Stefan Monnier * emacs-lisp/advice.el (ad-prognify): Remove, use macroexp-progn. diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index b42df954fe5..e5ca463e8d4 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -281,7 +281,10 @@ Symbolic modes like `g+w' are allowed." "Change mode of %s to: " nil 'chmod arg files default)) num-modes) - (cond ((equal modes "") + (cond ((or (equal modes "") + ;; Use `eq' instead of `equal' + ;; to detect empty input (bug#12399). + (eq modes default)) ;; We used to treat empty input as DEFAULT, but that is not ;; such a good idea (Bug#9361). (error "No file mode specified")) From f40a97091f5ae5ba94d46e41dbc072e2e80c1730 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 14 Sep 2012 20:33:40 -0400 Subject: [PATCH 34/88] Improve emacs-bzr-version for lightweight checkouts (bug#12441) * lisp/version.el (emacs-bzr-version): Doc fix. (emacs-bzr-version-dirstate): New function. (emacs-bzr-get-version): For lightweight checkouts, if the parent is local try and check that it matches the branch. If not, just use dirstate information. --- lisp/ChangeLog | 8 ++++++++ lisp/version.el | 47 ++++++++++++++++++++++++++++++++++++----------- 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e27fa53e7b5..34c6d981481 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2012-09-15 Glenn Morris + + * version.el (emacs-bzr-version): Doc fix. + (emacs-bzr-version-dirstate): New function. + (emacs-bzr-get-version): For lightweight checkouts, if the parent + is local try and check that it matches the branch. If not, just + use dirstate information. (Bug#12441) + 2012-09-14 Juri Linkov * dired-aux.el (dired-do-chmod): Use `eq' to detect empty input. diff --git a/lisp/version.el b/lisp/version.el index e63c51d0d26..8ef279828b1 100644 --- a/lisp/version.el +++ b/lisp/version.el @@ -87,23 +87,36 @@ to the system configuration; look at `system-configuration' instead." ;; Set during dumping, this is a defvar so that it can be setq'd. (defvar emacs-bzr-version nil "String giving the bzr revision from which this Emacs was built. -Value is the bzr revision number and a revision ID separated by a blank. +The format is: [revno] revision_id, where revno may be absent. Value is nil if Emacs was not built from a bzr checkout, or if we could not determine the revision.") +(defun emacs-bzr-version-dirstate (dir) + "Try to return as a string the bzr revision ID of directory DIR. +This uses the dirstate file's parent revision entry. +Returns nil if unable to find this information." + (let ((file (expand-file-name ".bzr/checkout/dirstate" dir))) + (when (file-readable-p file) + (with-temp-buffer + (insert-file-contents file) + (and (looking-at "#bazaar dirstate flat format 3") + (forward-line 3) + (looking-at "[0-9]+\0\\([^\0\n]+\\)\0") + (match-string 1)))))) + (defun emacs-bzr-get-version (&optional dir) - "Try to return as a string the bzr revision number of the Emacs sources. -Value is the bzr revision number and a revision ID separated by a blank. + "Try to return as a string the bzr revision of the Emacs sources. +The format is: [revno] revision_id, where revno may be absent. Value is nil if the sources do not seem to be under bzr, or if we could not determine the revision. Note that this reports on the current state of the sources, which may not correspond to the running Emacs. Optional argument DIR is a directory to use instead of `source-directory'." (or dir (setq dir source-directory)) - (when (file-directory-p (setq dir (expand-file-name ".bzr/branch" dir))) - (let (file loc) + (when (file-directory-p dir) + (let (file loc rev) (cond ((file-readable-p - (setq file (expand-file-name "last-revision" dir))) + (setq file (expand-file-name ".bzr/branch/last-revision" dir))) (with-temp-buffer (insert-file-contents file) (goto-char (point-max)) @@ -112,14 +125,26 @@ Optional argument DIR is a directory to use instead of `source-directory'." (buffer-string))) ;; OK, no last-revision. Is it a lightweight checkout? ((file-readable-p - (setq file (expand-file-name "location" dir))) - ;; If the parent branch is local, try looking there for the revid. - (if (setq loc (with-temp-buffer + (setq file (expand-file-name ".bzr/branch/location" dir))) + (setq rev (emacs-bzr-version-dirstate dir)) + ;; If the parent branch is local, try looking there for the rev. + ;; Note: there is no guarantee that the parent branch's rev + ;; corresponds to this branch. This branch could have + ;; been made with a specific -r revno argument, or the + ;; parent could have been updated since this branch was created. + ;; To try and detect this, we check the dirstate revids + ;; to see if they match. + (if (and (setq loc (with-temp-buffer (insert-file-contents file) (if (looking-at "file://\\(.*\\)") (match-string 1)))) - (emacs-bzr-get-version loc))) - ;; Could fall back to eg `bzr testament' at this point. + (equal rev (emacs-bzr-version-dirstate loc))) + (emacs-bzr-get-version loc) + ;; If parent does not match, the best we can do without + ;; calling external commands is to use the dirstate rev. + rev)) + ;; At this point, could fall back to: + ;; bzr version-info --custom --template='{revno} {revision_id}\n' )))) ;; We put version info into the executable in the form that `ident' uses. From fea895b1d20c919021a99d9595248a53bcaff88c Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 14 Sep 2012 20:45:00 -0400 Subject: [PATCH 35/88] Tweak previous emacs-bzr-get-version change --- lisp/version.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/version.el b/lisp/version.el index 8ef279828b1..47476cb268a 100644 --- a/lisp/version.el +++ b/lisp/version.el @@ -113,7 +113,7 @@ of the sources, which may not correspond to the running Emacs. Optional argument DIR is a directory to use instead of `source-directory'." (or dir (setq dir source-directory)) - (when (file-directory-p dir) + (when (file-directory-p (expand-file-name ".bzr/branch" dir)) (let (file loc rev) (cond ((file-readable-p (setq file (expand-file-name ".bzr/branch/last-revision" dir))) From 823751606a90e3850551b43e707d58bbf58033dc Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 14 Sep 2012 21:11:52 -0400 Subject: [PATCH 36/88] Improve vc-bzr-working-revision for lightweight checkouts * lisp/vc/vc-bzr.el (vc-bzr-working-revision): For lightweight local checkouts, check the parent dirstate matches the branch. Add "--tree" to "bzr revno" arguments. Don't try to shorten the empty string. --- lisp/ChangeLog | 5 +++++ lisp/vc/vc-bzr.el | 14 ++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 34c6d981481..c9aa7e99356 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2012-09-15 Glenn Morris + * vc/vc-bzr.el (vc-bzr-working-revision): For lightweight local + checkouts, check the parent dirstate matches the branch. + Add "--tree" to "bzr revno" arguments. Don't try to shorten the + empty string. + * version.el (emacs-bzr-version): Doc fix. (emacs-bzr-version-dirstate): New function. (emacs-bzr-get-version): For lightweight checkouts, if the parent diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index c0dafda57b6..1eb33776f6a 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el @@ -534,7 +534,9 @@ in the branch repository (or whose status not be determined)." ;; FIXME: maybe it's overkill to check if both these ;; files exist. (and (file-exists-p branch-format-file) - (file-exists-p lastrev-file))))) + (file-exists-p lastrev-file) + (equal (emacs-bzr-version-dirstate l-c-parent-dir) + (emacs-bzr-version-dirstate rootdir)))))) t))) (with-temp-buffer (insert-file-contents branch-format-file) @@ -553,13 +555,17 @@ in the branch repository (or whose status not be determined)." (insert-file-contents lastrev-file) (when (re-search-forward "[0-9]+" nil t) (buffer-substring (match-beginning 0) (match-end 0)))))) - ;; fallback to calling "bzr revno" + ;; Fallback to calling "bzr revno --tree". + ;; The "--tree" matters for lightweight checkouts not on the same + ;; revision as the parent. (let* ((result (vc-bzr-command-discarding-stderr - vc-bzr-program "revno" (file-relative-name file))) + vc-bzr-program "revno" "--tree" + (file-relative-name file))) (exitcode (car result)) (output (cdr result))) (cond - ((eq exitcode 0) (substring output 0 -1)) + ((and (eq exitcode 0) (not (zerop (length output)))) + (substring output 0 -1)) (t nil)))))) (defun vc-bzr-create-repo () From ea964864a66828ce2457e44c4c670160d5879ec6 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Sat, 15 Sep 2012 11:24:26 +0900 Subject: [PATCH 37/88] font.c (Ffont_shape_gstring): Don't adjust grapheme cluster here, but just check the validity of glyphs in the glyph-string. --- src/ChangeLog | 5 ++++ src/font.c | 68 +++++++++++++++++++++++++++------------------------ 2 files changed, 41 insertions(+), 32 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5cda8241916..e598d4d465a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-09-15 Kenichi Handa + + * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster + here, but just check the validity of glyphs in the glyph-string. + 2012-09-14 Martin Rudalics * xdisp.c (Fformat_mode_line): Unconditionally save/restore diff --git a/src/font.c b/src/font.c index 49a09bced28..ccbeb9956f4 100644 --- a/src/font.c +++ b/src/font.c @@ -4296,7 +4296,10 @@ to get the correct visual image of character sequences set in the header of the glyph-string. If the shaping was successful, the value is GSTRING itself or a newly -created glyph-string. Otherwise, the value is nil. */) +created glyph-string. Otherwise, the value is nil. + +See the documentation of `composition-get-gstring' for the format of +GSTRING. */) (Lisp_Object gstring) { struct font *font; @@ -4327,44 +4330,45 @@ created glyph-string. Otherwise, the value is nil. */) if (XINT (n) < LGSTRING_GLYPH_LEN (gstring)) LGSTRING_SET_GLYPH (gstring, XINT (n), Qnil); + /* Check FROM_IDX and TO_IDX of each GLYPH in GSTRING to assure that + GLYPHS covers all characters in GSTRING. More formally, provided + that NCHARS is the number of characters in GSTRING, N is the + number of glyphs, and GLYPHS[i] is the ith glyph, FROM_IDX and + TO_IDX of each glyph must satisfy these conditions: + + GLYPHS[0].FROM_IDX == 0 + GLYPHS[i].FROM_IDX <= GLYPHS[i].TO_IDX + if (GLYPHS[i].FROM_IDX == GLYPHS[i-1].FROM_IDX) + ;; GLYPHS[i] and GLYPHS[i-1] belongs to the same grapheme cluster + GLYPHS[i].TO_IDX == GLYPHS[i-1].TO_IDX + else + ;; Be sure to cover all characters. + GLYPHS[i].FROM_IDX == GLYPHS[i-1].TO_IDX + 1 + GLYPHS[N-1].TO_IDX == NCHARS - 1 */ glyph = LGSTRING_GLYPH (gstring, 0); from = LGLYPH_FROM (glyph); to = LGLYPH_TO (glyph); - for (i = 1, j = 0; i < LGSTRING_GLYPH_LEN (gstring); i++) + if (from != 0 || to < from) + goto shaper_error; + for (i = 1; i < LGSTRING_GLYPH_LEN (gstring); i++) { - Lisp_Object this = LGSTRING_GLYPH (gstring, i); - - if (NILP (this)) + glyph = LGSTRING_GLYPH (gstring, i); + if (NILP (glyph)) break; - if (NILP (LGLYPH_ADJUSTMENT (this))) - { - if (j < i - 1) - for (; j < i; j++) - { - glyph = LGSTRING_GLYPH (gstring, j); - LGLYPH_SET_FROM (glyph, from); - LGLYPH_SET_TO (glyph, to); - } - from = LGLYPH_FROM (this); - to = LGLYPH_TO (this); - j = i; - } - else - { - if (from > LGLYPH_FROM (this)) - from = LGLYPH_FROM (this); - if (to < LGLYPH_TO (this)) - to = LGLYPH_TO (this); - } + if (! (LGLYPH_FROM (glyph) <= LGLYPH_TO (glyph) + && (LGLYPH_FROM (glyph) == from + ? LGLYPH_TO (glyph) == to + : LGLYPH_FROM (glyph) == to + 1))) + goto shaper_error; + from = LGLYPH_FROM (glyph); + to = LGLYPH_TO (glyph); } - if (j < i - 1) - for (; j < i; j++) - { - glyph = LGSTRING_GLYPH (gstring, j); - LGLYPH_SET_FROM (glyph, from); - LGLYPH_SET_TO (glyph, to); - } + if (to != LGSTRING_CHAR_LEN (gstring) - 1) + goto shaper_error; return composition_gstring_put_cache (gstring, XINT (n)); + + shaper_error: + return Qnil; } DEFUN ("font-variation-glyphs", Ffont_variation_glyphs, Sfont_variation_glyphs, From 0328b6de4a92676b4ad4616095ce19a4f51d1c4d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 15 Sep 2012 00:06:56 -0700 Subject: [PATCH 38/88] Port better to POSIX hosts lacking _setjmp. * configure.ac (HAVE__SETJMP, HAVE_SIGSETJMP): New symbols. (_setjmp, _longjmp): Remove. * src/lisp.h: Include here, since we use its symbols here. All instances of '#include ' removed, if the only reason for the instance was because "lisp.h" was included. (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols. Unless otherwise specified, replace all uses of jmp_buf, _setjmp, and _longjmp with the new symbols. Emacs already uses _setjmp if available, so this change affects only POSIXish hosts that have sigsetjmp but not _setjmp, such as some versions of Solaris and Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.) * src/image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros. (png_load_body) [HAVE_PNG]: (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]: (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]: Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp, since PNG requires jmp_buf. This is the only exception to the general rule that we now use sys_setjmp and sys_longjmp. This exception is OK since this code does not change the signal mask or longjmp out of a signal handler. Fixes: debbugs:12446 --- ChangeLog | 6 ++++++ configure.ac | 25 ++++++++++++++++++------- src/ChangeLog | 22 ++++++++++++++++++++++ src/alloc.c | 13 ++++++------- src/atimer.c | 2 +- src/bidi.c | 1 - src/buffer.c | 1 - src/bytecode.c | 2 +- src/callint.c | 1 - src/callproc.c | 1 - src/casefiddle.c | 2 +- src/casetab.c | 2 +- src/category.c | 1 - src/ccl.c | 1 - src/character.c | 1 - src/charset.c | 1 - src/chartab.c | 2 +- src/cm.c | 1 - src/cmds.c | 2 +- src/coding.c | 1 - src/composite.c | 1 - src/data.c | 1 - src/dbusbind.c | 2 +- src/dired.c | 1 - src/dispnew.c | 1 - src/doc.c | 1 - src/doprnt.c | 1 - src/dosfns.c | 2 +- src/editfns.c | 1 - src/emacs.c | 1 - src/emacsgtkfixed.c | 2 +- src/eval.c | 15 +++++++-------- src/fileio.c | 1 - src/filelock.c | 1 - src/floatfns.c | 2 +- src/fns.c | 1 - src/font.c | 1 - src/fontset.c | 1 - src/frame.c | 1 - src/fringe.c | 1 - src/ftfont.c | 2 -- src/ftxfont.c | 1 - src/gnutls.c | 1 - src/gtkutil.c | 1 - src/image.c | 21 ++++++++++++++------- src/indent.c | 1 - src/insdel.c | 1 - src/intervals.c | 1 - src/keyboard.c | 20 ++++++++++---------- src/keymap.c | 2 +- src/lisp.h | 20 +++++++++++++++++++- src/lread.c | 1 - src/macros.c | 2 +- src/marker.c | 2 +- src/menu.c | 1 - src/minibuf.c | 1 - src/nsfns.m | 1 - src/nsfont.m | 1 - src/nsimage.m | 1 - src/nsmenu.m | 1 - src/nsselect.m | 1 - src/nsterm.m | 1 - src/print.c | 2 +- src/process.c | 9 +++------ src/ralloc.c | 2 +- src/regex.c | 1 - src/region-cache.c | 1 - src/scroll.c | 2 +- src/search.c | 2 +- src/sheap.c | 3 +-- src/sound.c | 2 +- src/syntax.c | 2 +- src/sysdep.c | 1 - src/term.c | 1 - src/termcap.c | 1 - src/terminal.c | 1 - src/terminfo.c | 1 - src/textprop.c | 2 +- src/tparam.c | 2 +- src/undo.c | 2 +- src/unexaix.c | 1 - src/unexcoff.c | 1 - src/unexcw.c | 1 - src/unexsol.c | 1 - src/vm-limit.c | 1 - src/widget.c | 2 +- src/window.c | 1 - src/xdisp.c | 1 - src/xfaces.c | 1 - src/xfns.c | 1 - src/xfont.c | 1 - src/xftfont.c | 1 - src/xgselect.c | 2 -- src/xmenu.c | 1 - src/xml.c | 1 - src/xrdb.c | 1 - src/xselect.c | 1 - src/xsettings.c | 5 ++--- src/xsmfns.c | 1 - src/xterm.c | 2 -- 100 files changed, 131 insertions(+), 143 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3e662edb6bc..8dfe5f2746b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-09-15 Paul Eggert + + Port better to POSIX hosts lacking _setjmp (Bug#12446). + * configure.ac (HAVE__SETJMP, HAVE_SIGSETJMP): New symbols. + (_setjmp, _longjmp): Remove. + 2012-09-14 Paul Eggert * configure.ac (--without-sync-input): Fix typo in usage message. diff --git a/configure.ac b/configure.ac index 382e62a97a1..f810c839587 100644 --- a/configure.ac +++ b/configure.ac @@ -3774,13 +3774,24 @@ AC_CACHE_CHECK([for _setjmp], [emacs_cv_func__setjmp], _longjmp (j, 1);]])], [emacs_cv_func__setjmp=yes], [emacs_cv_func__setjmp=no])]) -if test $emacs_cv_func__setjmp = no; then - AC_DEFINE([_setjmp], [setjmp], - [Define to setjmp if _setjmp and _longjmp do not work. See _longjmp.]) - AC_DEFINE([_longjmp], [longjmp], - [Define to longjmp if _setjmp and _longjmp do not work. - Because longjmp may alter signal masks, callers of _longjmp - should not assume that it leaves signal masks alone.]) +if test $emacs_cv_func__setjmp = yes; then + AC_DEFINE([HAVE__SETJMP], 1, [Define to 1 if _setjmp and _longjmp work.]) +else + AC_CACHE_CHECK([for sigsetjmp], [emacs_cv_func_sigsetjmp], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[sigjmp_buf j; + if (! sigsetjmp (j, 1)) + siglongjmp (j, 1);]])], + [emacs_cv_func_sigsetjmp=yes], + [emacs_cv_func_sigsetjmp=no])]) + if test $emacs_cv_func_sigsetjmp = yes; then + AC_DEFINE([HAVE_SIGSETJMP], 1, + [Define to 1 if sigsetjmp and siglongjmp work. + The value of this symbol is irrelevant if HAVE__SETJMP is defined.]) + fi fi case $opsys in diff --git a/src/ChangeLog b/src/ChangeLog index b1b4dc8bbcd..fb59e9e24dc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,25 @@ +2012-09-15 Paul Eggert + + Port better to POSIX hosts lacking _setjmp (Bug#12446). + * lisp.h: Include here, since we use its symbols here. + All instances of '#include ' removed, if the + only reason for the instance was because "lisp.h" was included. + (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols. + Unless otherwise specified, replace all uses of jmp_buf, _setjmp, + and _longjmp with the new symbols. Emacs already uses _setjmp if + available, so this change affects only POSIXish hosts that have + sigsetjmp but not _setjmp, such as some versions of Solaris and + Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.) + * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros. + (png_load_body) [HAVE_PNG]: + (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]: + (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]: + Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp, + since PNG requires jmp_buf. This is the only exception to the + general rule that we now use sys_setjmp and sys_longjmp. + This exception is OK since this code does not change the signal + mask or longjmp out of a signal handler. + 2012-09-14 Paul Eggert * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]: diff --git a/src/alloc.c b/src/alloc.c index 25cf03dfa2e..0bfbb0c88b1 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -24,7 +24,6 @@ along with GNU Emacs. If not, see . */ #include #include /* For CHAR_BIT. */ -#include #ifdef ENABLE_CHECKING #include /* For SIGABRT. */ @@ -45,7 +44,7 @@ along with GNU Emacs. If not, see . */ #include "frame.h" #include "blockinput.h" #include "termhooks.h" /* For struct terminal. */ -#include + #include /* GC_CHECK_MARKED_OBJECTS means do sanity checks on allocated objects. @@ -4764,14 +4763,14 @@ test_setjmp (void) { char buf[10]; register int x; - jmp_buf jbuf; + sys_jmp_buf jbuf; /* Arrange for X to be put in a register. */ sprintf (buf, "1"); x = strlen (buf); x = 2 * x - 1; - _setjmp (jbuf); + sys_setjmp (jbuf); if (longjmps_done == 1) { /* Came here after the longjmp at the end of the function. @@ -4796,7 +4795,7 @@ test_setjmp (void) ++longjmps_done; x = 2; if (longjmps_done == 1) - _longjmp (jbuf, 1); + sys_longjmp (jbuf, 1); } #endif /* not GC_SAVE_REGISTERS_ON_STACK && not GC_SETJMP_WORKS */ @@ -4902,7 +4901,7 @@ mark_stack (void) /* jmp_buf may not be aligned enough on darwin-ppc64 */ union aligned_jmpbuf { Lisp_Object o; - jmp_buf j; + sys_jmp_buf j; } j; volatile bool stack_grows_down_p = (char *) &j > (char *) stack_base; #endif @@ -4938,7 +4937,7 @@ mark_stack (void) } #endif /* GC_SETJMP_WORKS */ - _setjmp (j.j); + sys_setjmp (j.j); end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j; #endif /* not GC_SAVE_REGISTERS_ON_STACK */ #endif /* not HAVE___BUILTIN_UNWIND_INIT */ diff --git a/src/atimer.c b/src/atimer.c index 34731920af5..80b813fe4fe 100644 --- a/src/atimer.c +++ b/src/atimer.c @@ -18,7 +18,7 @@ along with GNU Emacs. If not, see . */ #include #include -#include + #include "lisp.h" #include "syssignal.h" #include "systime.h" diff --git a/src/bidi.c b/src/bidi.c index 4186a46e19e..af0209565e2 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -56,7 +56,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include "lisp.h" #include "character.h" diff --git a/src/buffer.c b/src/buffer.c index d512547d34e..b020edb9962 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -26,7 +26,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include #include diff --git a/src/bytecode.c b/src/bytecode.c index 97730636d0e..b151078f60f 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -33,7 +33,7 @@ by Hallvard: */ #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" diff --git a/src/callint.c b/src/callint.c index b11545ddea2..c4c087e83d7 100644 --- a/src/callint.c +++ b/src/callint.c @@ -19,7 +19,6 @@ along with GNU Emacs. If not, see . */ #include -#include #include "lisp.h" #include "character.h" diff --git a/src/callproc.c b/src/callproc.c index a92959a1559..9171337ee76 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include #include diff --git a/src/casefiddle.c b/src/casefiddle.c index 1102054b153..e3654627576 100644 --- a/src/casefiddle.c +++ b/src/casefiddle.c @@ -19,7 +19,7 @@ along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" diff --git a/src/casetab.c b/src/casetab.c index 3e22d0d0b77..a84bc9202d0 100644 --- a/src/casetab.c +++ b/src/casetab.c @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" diff --git a/src/category.c b/src/category.c index 80dc6938d8b..01a6f54ad17 100644 --- a/src/category.c +++ b/src/category.c @@ -32,7 +32,6 @@ along with GNU Emacs. If not, see . */ #define CATEGORY_INLINE EXTERN_INLINE -#include #include "lisp.h" #include "character.h" #include "buffer.h" diff --git a/src/ccl.c b/src/ccl.c index dd37934451d..34cc1c98eea 100644 --- a/src/ccl.c +++ b/src/ccl.c @@ -26,7 +26,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include #include "lisp.h" diff --git a/src/character.c b/src/character.c index 37963d1878c..def1ad090fd 100644 --- a/src/character.c +++ b/src/character.c @@ -36,7 +36,6 @@ along with GNU Emacs. If not, see . */ #ifdef emacs #include -#include #include #include "lisp.h" #include "character.h" diff --git a/src/charset.c b/src/charset.c index 972a0598059..d8c38e5ea3b 100644 --- a/src/charset.c +++ b/src/charset.c @@ -32,7 +32,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include #include "lisp.h" #include "character.h" diff --git a/src/chartab.c b/src/chartab.c index c14df0ebac6..e864514e336 100644 --- a/src/chartab.c +++ b/src/chartab.c @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "character.h" #include "charset.h" diff --git a/src/cm.c b/src/cm.c index 4b17b92eebc..eda6430bafa 100644 --- a/src/cm.c +++ b/src/cm.c @@ -20,7 +20,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include "lisp.h" #include "frame.h" diff --git a/src/cmds.c b/src/cmds.c index 90d3cd6dced..45f7df948ae 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -19,7 +19,7 @@ along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "commands.h" #include "character.h" diff --git a/src/coding.c b/src/coding.c index 94a2d9fea80..4b3d22f956c 100644 --- a/src/coding.c +++ b/src/coding.c @@ -285,7 +285,6 @@ encode_coding_XXX (struct coding_system *coding) #include #include -#include #include "lisp.h" #include "character.h" diff --git a/src/composite.c b/src/composite.c index eddabb66d33..ae46df0a573 100644 --- a/src/composite.c +++ b/src/composite.c @@ -26,7 +26,6 @@ along with GNU Emacs. If not, see . */ #define COMPOSITE_INLINE EXTERN_INLINE -#include #include "lisp.h" #include "character.h" #include "buffer.h" diff --git a/src/data.c b/src/data.c index 5d7f036b70d..72d7c8ccf9a 100644 --- a/src/data.c +++ b/src/data.c @@ -20,7 +20,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include diff --git a/src/dbusbind.c b/src/dbusbind.c index 901820648cb..c2eefd605bb 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -21,7 +21,7 @@ along with GNU Emacs. If not, see . */ #ifdef HAVE_DBUS #include #include -#include + #include "lisp.h" #include "frame.h" #include "termhooks.h" diff --git a/src/dired.c b/src/dired.c index 9af5f76821b..3aa27ecf920 100644 --- a/src/dired.c +++ b/src/dired.c @@ -22,7 +22,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #ifdef HAVE_PWD_H #include diff --git a/src/dispnew.c b/src/dispnew.c index f6186e86048..5827316a7b7 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -22,7 +22,6 @@ along with GNU Emacs. If not, see . */ #define DISPEXTERN_INLINE EXTERN_INLINE #include -#include #include #include "lisp.h" diff --git a/src/doc.c b/src/doc.c index 02a5b4b8143..d2d664df266 100644 --- a/src/doc.c +++ b/src/doc.c @@ -22,7 +22,6 @@ along with GNU Emacs. If not, see . */ #include #include /* Must be after sys/types.h for USG*/ -#include #include #include diff --git a/src/doprnt.c b/src/doprnt.c index 3b7391f07d4..caa56d6ae88 100644 --- a/src/doprnt.c +++ b/src/doprnt.c @@ -102,7 +102,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include #include #include diff --git a/src/dosfns.c b/src/dosfns.c index 21676f4b4f5..3c649f4d534 100644 --- a/src/dosfns.c +++ b/src/dosfns.c @@ -30,7 +30,7 @@ along with GNU Emacs. If not, see . */ #include #undef gettime #undef settime -#include + #include "lisp.h" #include "character.h" #include "buffer.h" diff --git a/src/editfns.c b/src/editfns.c index 299cad07fd7..c6744648bc5 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #ifdef HAVE_PWD_H #include diff --git a/src/emacs.c b/src/emacs.c index e8150631311..1416bf76c43 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -25,7 +25,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include #include "lisp.h" diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c index c0d29a640ed..d10185072cc 100644 --- a/src/emacsgtkfixed.c +++ b/src/emacsgtkfixed.c @@ -22,7 +22,7 @@ along with GNU Emacs. If not, see . */ #include "emacsgtkfixed.h" #include -#include + #include "lisp.h" #include "frame.h" #include "xterm.h" diff --git a/src/eval.c b/src/eval.c index 3c0c65e9366..6cca13a8fda 100644 --- a/src/eval.c +++ b/src/eval.c @@ -19,7 +19,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include #include "lisp.h" #include "blockinput.h" @@ -1072,7 +1071,7 @@ internal_catch (Lisp_Object tag, Lisp_Object (*func) (Lisp_Object), Lisp_Object catchlist = &c; /* Call FUNC. */ - if (! _setjmp (c.jmp)) + if (! sys_setjmp (c.jmp)) c.val = (*func) (arg); /* Throw works by a longjmp that comes right here. */ @@ -1140,7 +1139,7 @@ unwind_to_catch (struct catchtag *catch, Lisp_Object value) backtrace_list = catch->backlist; lisp_eval_depth = catch->lisp_eval_depth; - _longjmp (catch->jmp, 1); + sys_longjmp (catch->jmp, 1); } DEFUN ("throw", Fthrow, Sthrow, 2, 2, 0, @@ -1246,7 +1245,7 @@ internal_lisp_condition_case (volatile Lisp_Object var, Lisp_Object bodyform, c.interrupt_input_blocked = interrupt_input_blocked; c.gcpro = gcprolist; c.byte_stack = byte_stack_list; - if (_setjmp (c.jmp)) + if (sys_setjmp (c.jmp)) { if (!NILP (h.var)) specbind (h.var, c.val); @@ -1301,7 +1300,7 @@ internal_condition_case (Lisp_Object (*bfun) (void), Lisp_Object handlers, c.interrupt_input_blocked = interrupt_input_blocked; c.gcpro = gcprolist; c.byte_stack = byte_stack_list; - if (_setjmp (c.jmp)) + if (sys_setjmp (c.jmp)) { return (*hfun) (c.val); } @@ -1339,7 +1338,7 @@ internal_condition_case_1 (Lisp_Object (*bfun) (Lisp_Object), Lisp_Object arg, c.interrupt_input_blocked = interrupt_input_blocked; c.gcpro = gcprolist; c.byte_stack = byte_stack_list; - if (_setjmp (c.jmp)) + if (sys_setjmp (c.jmp)) { return (*hfun) (c.val); } @@ -1381,7 +1380,7 @@ internal_condition_case_2 (Lisp_Object (*bfun) (Lisp_Object, Lisp_Object), c.interrupt_input_blocked = interrupt_input_blocked; c.gcpro = gcprolist; c.byte_stack = byte_stack_list; - if (_setjmp (c.jmp)) + if (sys_setjmp (c.jmp)) { return (*hfun) (c.val); } @@ -1425,7 +1424,7 @@ internal_condition_case_n (Lisp_Object (*bfun) (ptrdiff_t, Lisp_Object *), c.interrupt_input_blocked = interrupt_input_blocked; c.gcpro = gcprolist; c.byte_stack = byte_stack_list; - if (_setjmp (c.jmp)) + if (sys_setjmp (c.jmp)) { return (*hfun) (c.val, nargs, args); } diff --git a/src/fileio.c b/src/fileio.c index f0b3f0cc2fd..ca71af7ed95 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -23,7 +23,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include #ifdef HAVE_PWD_H diff --git a/src/filelock.c b/src/filelock.c index 1f599c68912..17f3f253249 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -23,7 +23,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #ifdef HAVE_PWD_H #include diff --git a/src/floatfns.c b/src/floatfns.c index 66d7ca4af2c..4fe209fcb61 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -29,7 +29,7 @@ along with GNU Emacs. If not, see . */ */ #include -#include + #include "lisp.h" #include "syssignal.h" diff --git a/src/fns.c b/src/fns.c index 91dc6639150..42c4f817f29 100644 --- a/src/fns.c +++ b/src/fns.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include diff --git a/src/font.c b/src/font.c index 49a09bced28..da8c5ae52fc 100644 --- a/src/font.c +++ b/src/font.c @@ -23,7 +23,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include diff --git a/src/fontset.c b/src/fontset.c index 2b955fe6b11..35d4bfb367e 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -26,7 +26,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include "lisp.h" #include "blockinput.h" diff --git a/src/frame.c b/src/frame.c index d10969692ee..6930dac3ce8 100644 --- a/src/frame.c +++ b/src/frame.c @@ -24,7 +24,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include diff --git a/src/fringe.c b/src/fringe.c index 0c2109a0f8e..6e6deeddb08 100644 --- a/src/fringe.c +++ b/src/fringe.c @@ -18,7 +18,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include "lisp.h" #include "frame.h" diff --git a/src/ftfont.c b/src/ftfont.c index a85773a9a21..f07ad6f33c7 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -21,8 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include - #include #include diff --git a/src/ftxfont.c b/src/ftxfont.c index c705ede62c4..466250bd43f 100644 --- a/src/ftxfont.c +++ b/src/ftxfont.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include #include "lisp.h" diff --git a/src/gnutls.c b/src/gnutls.c index a2573f6bd99..1c4693aee32 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -18,7 +18,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include "lisp.h" #include "process.h" diff --git a/src/gtkutil.c b/src/gtkutil.c index 884574e1062..1eb4b2cabdf 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -22,7 +22,6 @@ along with GNU Emacs. If not, see . */ #ifdef USE_GTK #include #include -#include #include diff --git a/src/image.c b/src/image.c index d4e54fb7dcd..6803dbe8f00 100644 --- a/src/image.c +++ b/src/image.c @@ -5514,6 +5514,13 @@ init_png_functions (Lisp_Object libraries) #endif /* HAVE_NTGUI */ +/* Possibly inefficient/inexact substitutes for _setjmp and _longjmp. + Do not use sys_setjmp, as PNG supports only jmp_buf. The _longjmp + substitute may munge the signal mask, but that should be OK here. */ +#ifndef HAVE__SETJMP +# define _setjmp(j) setjmp (j) +# define _longjmp longjmp +#endif #if (PNG_LIBPNG_VER < 10500) #define PNG_LONGJMP(ptr) (_longjmp ((ptr)->jmpbuf, 1)) @@ -5593,7 +5600,7 @@ png_read_from_file (png_structp png_ptr, png_bytep data, png_size_t length) struct png_load_context { - /* These are members so that _longjmp doesn't munge local variables. */ + /* These are members so that longjmp doesn't munge local variables. */ png_struct *png_ptr; png_info *info_ptr; png_info *end_info; @@ -6129,9 +6136,9 @@ jpeg_resync_to_restart_wrapper (j_decompress_ptr cinfo, int desired) struct my_jpeg_error_mgr { struct jpeg_error_mgr pub; - jmp_buf setjmp_buffer; + sys_jmp_buf setjmp_buffer; - /* The remaining members are so that _longjmp doesn't munge local + /* The remaining members are so that longjmp doesn't munge local variables. */ struct jpeg_decompress_struct cinfo; enum @@ -6151,7 +6158,7 @@ my_error_exit (j_common_ptr cinfo) { struct my_jpeg_error_mgr *mgr = (struct my_jpeg_error_mgr *) cinfo->err; mgr->failure_code = MY_JPEG_ERROR_EXIT; - _longjmp (mgr->setjmp_buffer, 1); + sys_longjmp (mgr->setjmp_buffer, 1); } @@ -6401,7 +6408,7 @@ jpeg_load_body (struct frame *f, struct image *img, error is detected. This function will perform a longjmp. */ mgr->cinfo.err = fn_jpeg_std_error (&mgr->pub); mgr->pub.error_exit = my_error_exit; - if (_setjmp (mgr->setjmp_buffer)) + if (sys_setjmp (mgr->setjmp_buffer)) { switch (mgr->failure_code) { @@ -6460,14 +6467,14 @@ jpeg_load_body (struct frame *f, struct image *img, if (!check_image_size (f, width, height)) { mgr->failure_code = MY_JPEG_INVALID_IMAGE_SIZE; - _longjmp (mgr->setjmp_buffer, 1); + sys_longjmp (mgr->setjmp_buffer, 1); } /* Create X image and pixmap. */ if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap)) { mgr->failure_code = MY_JPEG_CANNOT_CREATE_X; - _longjmp (mgr->setjmp_buffer, 1); + sys_longjmp (mgr->setjmp_buffer, 1); } /* Allocate colors. When color quantization is used, diff --git a/src/indent.c b/src/indent.c index c60315a7f6e..053643e6319 100644 --- a/src/indent.c +++ b/src/indent.c @@ -19,7 +19,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include "lisp.h" #include "character.h" diff --git a/src/insdel.c b/src/insdel.c index bfb2327a696..87010cd8251 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -19,7 +19,6 @@ along with GNU Emacs. If not, see . */ #include -#include #include diff --git a/src/intervals.c b/src/intervals.c index e508f968963..5a47cacb2dd 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -41,7 +41,6 @@ along with GNU Emacs. If not, see . */ #define INTERVALS_INLINE EXTERN_INLINE -#include #include #include "lisp.h" #include "intervals.h" diff --git a/src/keyboard.c b/src/keyboard.c index 45638bc412b..d164083fb86 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -22,7 +22,7 @@ along with GNU Emacs. If not, see . */ #define KEYBOARD_INLINE EXTERN_INLINE #include -#include + #include "lisp.h" #include "termchar.h" #include "termopts.h" @@ -145,7 +145,7 @@ static ptrdiff_t before_command_echo_length; /* For longjmp to where kbd input is being done. */ -static jmp_buf getcjmp; +static sys_jmp_buf getcjmp; /* True while doing kbd input. */ int waiting_for_input; @@ -434,8 +434,8 @@ static Lisp_Object modify_event_symbol (ptrdiff_t, int, Lisp_Object, Lisp_Object *, ptrdiff_t); static Lisp_Object make_lispy_switch_frame (Lisp_Object); static int help_char_p (Lisp_Object); -static void save_getcjmp (jmp_buf); -static void restore_getcjmp (jmp_buf); +static void save_getcjmp (sys_jmp_buf); +static void restore_getcjmp (sys_jmp_buf); static Lisp_Object apply_modifiers (int, Lisp_Object); static void clear_event (struct input_event *); static Lisp_Object restore_kboard_configuration (Lisp_Object); @@ -2315,8 +2315,8 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, { volatile Lisp_Object c; ptrdiff_t jmpcount; - jmp_buf local_getcjmp; - jmp_buf save_jump; + sys_jmp_buf local_getcjmp; + sys_jmp_buf save_jump; volatile int key_already_recorded = 0; Lisp_Object tem, save; volatile Lisp_Object previous_echo_area_message; @@ -2562,7 +2562,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, it *must not* be in effect when we call redisplay. */ jmpcount = SPECPDL_INDEX (); - if (_setjmp (local_getcjmp)) + if (sys_setjmp (local_getcjmp)) { /* Handle quits while reading the keyboard. */ /* We must have saved the outer value of getcjmp here, @@ -3394,13 +3394,13 @@ record_char (Lisp_Object c) See read_process_output. */ static void -save_getcjmp (jmp_buf temp) +save_getcjmp (sys_jmp_buf temp) { memcpy (temp, getcjmp, sizeof getcjmp); } static void -restore_getcjmp (jmp_buf temp) +restore_getcjmp (sys_jmp_buf temp) { memcpy (getcjmp, temp, sizeof getcjmp); } @@ -10979,7 +10979,7 @@ quit_throw_to_read_char (int from_signal) do_switch_frame (make_lispy_switch_frame (internal_last_event_frame), 0, 0, Qnil); - _longjmp (getcjmp, 1); + sys_longjmp (getcjmp, 1); } DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode, diff --git a/src/keymap.c b/src/keymap.c index d79ff89ed67..66fb52061f9 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -40,7 +40,7 @@ along with GNU Emacs. If not, see . */ #include #include -#include + #include "lisp.h" #include "commands.h" #include "character.h" diff --git a/src/lisp.h b/src/lisp.h index ca22ca81228..335ed8ba831 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -20,6 +20,7 @@ along with GNU Emacs. If not, see . */ #ifndef EMACS_LISP_H #define EMACS_LISP_H +#include #include #include #include @@ -1963,7 +1964,24 @@ extern void defvar_kboard (struct Lisp_Kboard_Objfwd *, const char *, int); static struct Lisp_Kboard_Objfwd ko_fwd; \ defvar_kboard (&ko_fwd, lname, offsetof (KBOARD, vname ## _)); \ } while (0) + +/* Save and restore the instruction and environment pointers, + without affecting the signal mask. */ +#ifdef HAVE__SETJMP +typedef jmp_buf sys_jmp_buf; +# define sys_setjmp(j) _setjmp (j) +# define sys_longjmp(j, v) _longjmp (j, v) +#elif defined HAVE_SIGSETJMP +typedef sigjmp_buf sys_jmp_buf; +# define sys_setjmp(j) sigsetjmp (j, 0) +# define sys_longjmp(j, v) siglongjmp (j, v) +#else +/* A non-POSIX platform; assume longjmp does not affect the sigmask. */ +typedef jmp_buf sys_jmp_buf; +# define sys_setjmp(j) setjmp (j) +# define sys_longjmp(j, v) longjmp (j, v) +#endif /* Structure for recording Lisp call stack for backtrace purposes. */ @@ -2056,7 +2074,7 @@ struct catchtag Lisp_Object volatile val; struct catchtag *volatile next; struct gcpro *gcpro; - jmp_buf jmp; + sys_jmp_buf jmp; struct backtrace *backlist; struct handler *handlerlist; EMACS_INT lisp_eval_depth; diff --git a/src/lread.c b/src/lread.c index 08a2e856c00..08d5f97292b 100644 --- a/src/lread.c +++ b/src/lread.c @@ -25,7 +25,6 @@ along with GNU Emacs. If not, see . */ #include #include #include /* For CHAR_BIT. */ -#include #include #include "lisp.h" #include "intervals.h" diff --git a/src/macros.c b/src/macros.c index e81068181b9..a507f12e343 100644 --- a/src/macros.c +++ b/src/macros.c @@ -19,7 +19,7 @@ along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "macros.h" #include "commands.h" diff --git a/src/marker.c b/src/marker.c index bfbb161a71d..0c4e8cb3b55 100644 --- a/src/marker.c +++ b/src/marker.c @@ -18,7 +18,7 @@ along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" diff --git a/src/menu.c b/src/menu.c index bfdc68ca118..7b01d1faefc 100644 --- a/src/menu.c +++ b/src/menu.c @@ -20,7 +20,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include /* for INT_MAX */ #include "lisp.h" diff --git a/src/minibuf.c b/src/minibuf.c index 4ed480a8408..8a1e0ddde86 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include "lisp.h" #include "commands.h" diff --git a/src/nsfns.m b/src/nsfns.m index f73086eeee9..ed8d44014d5 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -31,7 +31,6 @@ Updated by Christian Limpach (chris@nice.ch) #include #include -#include #include #include "lisp.h" diff --git a/src/nsfont.m b/src/nsfont.m index 1c9976ec6cc..eba1eb04765 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -23,7 +23,6 @@ /* This should be the first include, as it may set up #defines affecting interpretation of even the system includes. */ #include -#include #include "lisp.h" #include "dispextern.h" diff --git a/src/nsimage.m b/src/nsimage.m index 8a8a3ddaae4..668664c7a20 100644 --- a/src/nsimage.m +++ b/src/nsimage.m @@ -28,7 +28,6 @@ Updated by Christian Limpach (chris@nice.ch) /* This should be the first include, as it may set up #defines affecting interpretation of even the system includes. */ #include -#include #include "lisp.h" #include "dispextern.h" diff --git a/src/nsmenu.m b/src/nsmenu.m index d0f3e45e939..3057f4f6a20 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -24,7 +24,6 @@ /* This should be the first include, as it may set up #defines affecting interpretation of even the system includes. */ #include -#include #include "lisp.h" #include "window.h" diff --git a/src/nsselect.m b/src/nsselect.m index e0bbfe58636..95bc1a95957 100644 --- a/src/nsselect.m +++ b/src/nsselect.m @@ -28,7 +28,6 @@ Updated by Christian Limpach (chris@nice.ch) /* This should be the first include, as it may set up #defines affecting interpretation of even the system includes. */ #include -#include #include "lisp.h" #include "nsterm.h" diff --git a/src/nsterm.m b/src/nsterm.m index f9611fd1210..f1f23ad4479 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -35,7 +35,6 @@ Updated by Christian Limpach (chris@nice.ch) #include #include #include -#include #include #include diff --git a/src/print.c b/src/print.c index 16116643ad0..aae13bb6764 100644 --- a/src/print.c +++ b/src/print.c @@ -21,7 +21,7 @@ along with GNU Emacs. If not, see . */ #include #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" diff --git a/src/process.c b/src/process.c index b4b05a4b2e2..6dbff6f4b16 100644 --- a/src/process.c +++ b/src/process.c @@ -25,12 +25,9 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include /* Some typedefs are used in sys/file.h. */ #include #include -#include - #include #include @@ -5421,7 +5418,7 @@ read_process_output (Lisp_Object proc, register int channel) /* Sending data to subprocess */ -static jmp_buf send_process_frame; +static sys_jmp_buf send_process_frame; static Lisp_Object process_sent_to; static _Noreturn void @@ -5431,7 +5428,7 @@ handle_pipe_signal (int sig) sigemptyset (&unblocked); sigaddset (&unblocked, SIGPIPE); pthread_sigmask (SIG_UNBLOCK, &unblocked, 0); - _longjmp (send_process_frame, 1); + sys_longjmp (send_process_frame, 1); } static void @@ -5640,7 +5637,7 @@ send_process (volatile Lisp_Object proc, const char *volatile buf, /* 2000-09-21: Emacs 20.7, sparc-sun-solaris-2.6, GCC 2.95.2, CFLAGS="-g -O": The value of the parameter `proc' is clobbered when returning with longjmp despite being declared volatile. */ - if (!_setjmp (send_process_frame)) + if (!sys_setjmp (send_process_frame)) { p = XPROCESS (proc); /* Repair any setjmp clobbering. */ process_sent_to = proc; diff --git a/src/ralloc.c b/src/ralloc.c index 74834333aa3..b0134ea730a 100644 --- a/src/ralloc.c +++ b/src/ralloc.c @@ -25,7 +25,7 @@ along with GNU Emacs. If not, see . */ #ifdef emacs #include -#include + #include "lisp.h" /* Needed for VALBITS. */ #include "blockinput.h" diff --git a/src/regex.c b/src/regex.c index 472ef727979..92264ccae23 100644 --- a/src/regex.c +++ b/src/regex.c @@ -126,7 +126,6 @@ that make sense only in Emacs. */ #ifdef emacs -# include # include "lisp.h" # include "character.h" # include "buffer.h" diff --git a/src/region-cache.c b/src/region-cache.c index c3eb087aade..832f4bfd214 100644 --- a/src/region-cache.c +++ b/src/region-cache.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include "lisp.h" #include "character.h" diff --git a/src/scroll.c b/src/scroll.c index 79dd464b29e..71ce43b2e48 100644 --- a/src/scroll.c +++ b/src/scroll.c @@ -21,7 +21,7 @@ along with GNU Emacs. If not, see . */ #include #include -#include + #include "lisp.h" #include "termchar.h" #include "dispextern.h" diff --git a/src/search.c b/src/search.c index 72bd5605709..99fd7971e4c 100644 --- a/src/search.c +++ b/src/search.c @@ -20,7 +20,7 @@ along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "syntax.h" #include "category.h" diff --git a/src/sheap.c b/src/sheap.c index 3ae14b5daec..f6022ea3ce7 100644 --- a/src/sheap.c +++ b/src/sheap.c @@ -20,7 +20,7 @@ along with GNU Emacs. If not, see . */ #include #include -#include + #include "lisp.h" #include @@ -93,4 +93,3 @@ report_sheap_usage (int die_if_pure_storage_exceeded) bss_sbrk_ptr - bss_sbrk_buffer, STATIC_HEAP_SIZE); message ("%s", buf); } - diff --git a/src/sound.c b/src/sound.c index fe48bb277b2..0ee85312fd3 100644 --- a/src/sound.c +++ b/src/sound.c @@ -44,7 +44,7 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include + #include "lisp.h" #include "dispextern.h" #include "atimer.h" diff --git a/src/syntax.c b/src/syntax.c index fdd9353bb87..91ef4e66663 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -21,7 +21,7 @@ along with GNU Emacs. If not, see . */ #include #include -#include + #include "lisp.h" #include "commands.h" #include "character.h" diff --git a/src/sysdep.c b/src/sysdep.c index b8f35e79146..9065b38d6fc 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -23,7 +23,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #ifdef HAVE_PWD_H #include #include diff --git a/src/term.c b/src/term.c index 47bde5ac240..f4117d67dec 100644 --- a/src/term.c +++ b/src/term.c @@ -25,7 +25,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include "lisp.h" #include "termchar.h" diff --git a/src/termcap.c b/src/termcap.c index d1b05e8df94..e494cd113d9 100644 --- a/src/termcap.c +++ b/src/termcap.c @@ -19,7 +19,6 @@ Boston, MA 02110-1301, USA. */ /* Emacs config.h may rename various library functions such as malloc. */ #include -#include #include #include #include diff --git a/src/terminal.c b/src/terminal.c index c51a18dfa61..719c2a36111 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #define TERMHOOKS_INLINE EXTERN_INLINE #include -#include #include "lisp.h" #include "frame.h" diff --git a/src/terminfo.c b/src/terminfo.c index ca2d89a000b..124c452a4a9 100644 --- a/src/terminfo.c +++ b/src/terminfo.c @@ -19,7 +19,6 @@ along with GNU Emacs. If not, see . */ #include #include "tparam.h" -#include #include "lisp.h" /* Define these variables that serve as global parameters to termcap, diff --git a/src/textprop.c b/src/textprop.c index 2a9efba1c45..872912ea706 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "intervals.h" #include "character.h" diff --git a/src/tparam.c b/src/tparam.c index 58a825c90d7..164f61d471b 100644 --- a/src/tparam.c +++ b/src/tparam.c @@ -19,7 +19,7 @@ Boston, MA 02110-1301, USA. */ /* Emacs config.h may rename various library functions such as malloc. */ #include -#include + #include "lisp.h" /* for xmalloc */ #include "tparam.h" diff --git a/src/undo.c b/src/undo.c index 9cd1d5f9f67..e878ef4dcf9 100644 --- a/src/undo.c +++ b/src/undo.c @@ -18,7 +18,7 @@ along with GNU Emacs. If not, see . */ #include -#include + #include "lisp.h" #include "character.h" #include "buffer.h" diff --git a/src/unexaix.c b/src/unexaix.c index c09156296f7..c01a22a79f6 100644 --- a/src/unexaix.c +++ b/src/unexaix.c @@ -89,7 +89,6 @@ static int adjust_lnnoptrs (int, int, const char *); static int pagemask; -#include #include "lisp.h" static void diff --git a/src/unexcoff.c b/src/unexcoff.c index e83042a379d..966dd58cb6e 100644 --- a/src/unexcoff.c +++ b/src/unexcoff.c @@ -120,7 +120,6 @@ static int pagemask; #define ADDR_CORRECT(x) ((char *)(x) - (char*)0) -#include #include "lisp.h" static void diff --git a/src/unexcw.c b/src/unexcw.c index eae534cf4dd..96c4b4a9aec 100644 --- a/src/unexcw.c +++ b/src/unexcw.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include "unexec.h" -#include #include #include #include diff --git a/src/unexsol.c b/src/unexsol.c index 336f3b4faea..470206d5838 100644 --- a/src/unexsol.c +++ b/src/unexsol.c @@ -4,7 +4,6 @@ #include "unexec.h" #include -#include #include "lisp.h" #include "character.h" diff --git a/src/vm-limit.c b/src/vm-limit.c index cf697b56fdf..8de0acd1bb2 100644 --- a/src/vm-limit.c +++ b/src/vm-limit.c @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ #include -#include #include /* for 'environ', on AIX */ #include "lisp.h" #include "mem-limits.h" diff --git a/src/widget.c b/src/widget.c index 0100acc8143..fd5ad167125 100644 --- a/src/widget.c +++ b/src/widget.c @@ -30,7 +30,7 @@ along with GNU Emacs. If not, see . */ #include #include -#include + #include "lisp.h" #include "xterm.h" diff --git a/src/window.c b/src/window.c index 18a550782e8..b3db1292e5c 100644 --- a/src/window.c +++ b/src/window.c @@ -23,7 +23,6 @@ along with GNU Emacs. If not, see . */ #define WINDOW_INLINE EXTERN_INLINE #include -#include #include "lisp.h" #include "character.h" diff --git a/src/xdisp.c b/src/xdisp.c index 320998a5713..8e0975cf65a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -273,7 +273,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include "lisp.h" #include "keyboard.h" diff --git a/src/xfaces.c b/src/xfaces.c index c113c1a37b7..c240a05c6c0 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -204,7 +204,6 @@ along with GNU Emacs. If not, see . */ #include #include #include /* This needs to be before termchar.h */ -#include #include "lisp.h" #include "character.h" diff --git a/src/xfns.c b/src/xfns.c index 90b54d12345..8304a3df04f 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -20,7 +20,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include /* This makes the fields of a Display accessible, in Xlib header files. */ diff --git a/src/xfont.c b/src/xfont.c index 7755b780815..1f2fd13f1b7 100644 --- a/src/xfont.c +++ b/src/xfont.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include #include "lisp.h" diff --git a/src/xftfont.c b/src/xftfont.c index 404b9124099..9f52eb8b233 100644 --- a/src/xftfont.c +++ b/src/xftfont.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include #include diff --git a/src/xgselect.c b/src/xgselect.c index 5f4c7edfb79..c161564a322 100644 --- a/src/xgselect.c +++ b/src/xgselect.c @@ -19,14 +19,12 @@ along with GNU Emacs. If not, see . */ #include -#include #include "xgselect.h" #if defined (USE_GTK) || defined (HAVE_GCONF) || defined (HAVE_GSETTINGS) #include #include -#include #include "xterm.h" int diff --git a/src/xmenu.c b/src/xmenu.c index 605db13e149..d03a4bc974b 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -33,7 +33,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include "lisp.h" #include "keyboard.h" diff --git a/src/xml.c b/src/xml.c index 7bc6130b8b1..b668525cf26 100644 --- a/src/xml.c +++ b/src/xml.c @@ -20,7 +20,6 @@ along with GNU Emacs. If not, see . */ #ifdef HAVE_LIBXML2 -#include #include #include #include diff --git a/src/xrdb.c b/src/xrdb.c index 624bafa5e92..73672c9617c 100644 --- a/src/xrdb.c +++ b/src/xrdb.c @@ -26,7 +26,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include "lisp.h" diff --git a/src/xselect.c b/src/xselect.c index 5a3b7452c6d..ab199e0b9b9 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -22,7 +22,6 @@ along with GNU Emacs. If not, see . */ #include #include #include /* termhooks.h needs this */ -#include #ifdef HAVE_SYS_TYPES_H #include diff --git a/src/xsettings.c b/src/xsettings.c index a28d75d9422..58c84495489 100644 --- a/src/xsettings.c +++ b/src/xsettings.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include #include "lisp.h" #include "xterm.h" @@ -711,12 +710,12 @@ apply_xft_settings (struct x_display_info *dpyinfo, if (send_event_p) store_config_changed_event (Qfont_render, XCAR (dpyinfo->name_list_element)); - Vxft_settings + Vxft_settings = make_formatted_string (buf, format, oldsettings.aa, oldsettings.hinting, oldsettings.rgba, oldsettings.lcdfilter, oldsettings.hintstyle, oldsettings.dpi); - + } else FcPatternDestroy (pat); diff --git a/src/xsmfns.c b/src/xsmfns.c index cddbb2aae86..8067899f931 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c @@ -29,7 +29,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include "lisp.h" #include "systime.h" diff --git a/src/xterm.c b/src/xterm.c index 54d4f14bdd0..900a1d78b80 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -22,7 +22,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #ifdef HAVE_X_WINDOWS @@ -47,7 +46,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include /* Caused redefinition of DBL_DIG on Netbsd; seems not to be needed. */ /* #include */ From 7105c8cbf3a3226701e4d2ecb0b9c2d207648a98 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 15 Sep 2012 11:03:11 +0300 Subject: [PATCH 39/88] Fix MS-Windows build broken by 2012-09-15T07:06:56Z!eggert@cs.ucla.edu, completing fix for bug #12446. src/w32xfns.c: src/w32uniscribe.c: src/w32term.c: src/w32select.c: src/w32reg.c: src/w32proc.c: src/w32menu.c: src/w32inevt.c: src/w32heap.c: src/w32font.c: src/w32fns.c: src/w32console.c: src/w32.c: src/w16select.c: Remove inclusion of setjmp.h, as it is now included by lisp.h. This completes removal of setjmp.h inclusion erroneously announced in the previous commit. src/lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary more accurate. src/image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is not defined as a macro. The latter happens on MS-Windows. --- src/ChangeLog | 28 +++++++++++++++++++++++++++- src/image.c | 8 ++++++-- src/lisp.h | 3 ++- src/w16select.c | 1 - src/w32.c | 1 - src/w32console.c | 1 - src/w32fns.c | 1 - src/w32font.c | 1 - src/w32heap.c | 1 - src/w32inevt.c | 1 - src/w32menu.c | 1 - src/w32proc.c | 1 - src/w32reg.c | 1 - src/w32select.c | 1 - src/w32term.c | 1 - src/w32uniscribe.c | 1 - src/w32xfns.c | 1 - 17 files changed, 35 insertions(+), 18 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index fb59e9e24dc..f9d31b08abd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,8 +1,34 @@ +2012-09-15 Eli Zaretskii + + * w32xfns.c: + * w32uniscribe.c: + * w32term.c: + * w32select.c: + * w32reg.c: + * w32proc.c: + * w32menu.c: + * w32inevt.c: + * w32heap.c: + * w32font.c: + * w32fns.c: + * w32console.c: + * w32.c: + * w16select.c: Remove inclusion of setjmp.h, as it is now included + by lisp.h. This completes removal of setjmp.h inclusion + erroneously announced in the previous commit. (Bug#12446) + + * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary + more accurate. + + * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is + not defined as a macro. The latter happens on MS-Windows. + (Bug#12446) + 2012-09-15 Paul Eggert Port better to POSIX hosts lacking _setjmp (Bug#12446). * lisp.h: Include here, since we use its symbols here. - All instances of '#include ' removed, if the + Some instances of '#include ' removed, if the only reason for the instance was because "lisp.h" was included. (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols. Unless otherwise specified, replace all uses of jmp_buf, _setjmp, diff --git a/src/image.c b/src/image.c index 6803dbe8f00..02151c500cc 100644 --- a/src/image.c +++ b/src/image.c @@ -5516,9 +5516,13 @@ init_png_functions (Lisp_Object libraries) /* Possibly inefficient/inexact substitutes for _setjmp and _longjmp. Do not use sys_setjmp, as PNG supports only jmp_buf. The _longjmp - substitute may munge the signal mask, but that should be OK here. */ + substitute may munge the signal mask, but that should be OK here. + MinGW (MS-Windows) uses _setjmp and defines setjmp to _setjmp in + the system header setjmp.h; don't mess up that. */ #ifndef HAVE__SETJMP -# define _setjmp(j) setjmp (j) +# ifndef setjmp +# define _setjmp(j) setjmp (j) +# endif # define _longjmp longjmp #endif diff --git a/src/lisp.h b/src/lisp.h index 335ed8ba831..447c6bd296b 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -1977,7 +1977,8 @@ typedef sigjmp_buf sys_jmp_buf; # define sys_setjmp(j) sigsetjmp (j, 0) # define sys_longjmp(j, v) siglongjmp (j, v) #else -/* A non-POSIX platform; assume longjmp does not affect the sigmask. */ +/* A platform that uses neither _longjmp nor siglongjmp; assume + longjmp does not affect the sigmask. */ typedef jmp_buf sys_jmp_buf; # define sys_setjmp(j) setjmp (j) # define sys_longjmp(j, v) longjmp (j, v) diff --git a/src/w16select.c b/src/w16select.c index 2026de7421d..a3f6f1fb9ae 100644 --- a/src/w16select.c +++ b/src/w16select.c @@ -31,7 +31,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include "lisp.h" #include "dispextern.h" /* frame.h seems to want this */ #include "frame.h" /* Need this to get the X window of selected_frame */ diff --git a/src/w32.c b/src/w32.c index 04f7471577c..bcb0511e2fa 100644 --- a/src/w32.c +++ b/src/w32.c @@ -33,7 +33,6 @@ along with GNU Emacs. If not, see . */ #include #include /* for _mbspbrk */ #include -#include #include /* must include CRT headers *before* config.h */ diff --git a/src/w32console.c b/src/w32console.c index 76585851e7f..b22b09af2f2 100644 --- a/src/w32console.c +++ b/src/w32console.c @@ -26,7 +26,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include "lisp.h" #include "character.h" diff --git a/src/w32fns.c b/src/w32fns.c index ec1acbd89d9..be008bb18c8 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -26,7 +26,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include "lisp.h" #include "w32term.h" diff --git a/src/w32font.c b/src/w32font.c index 8b3a0e4312e..833b7cdfb25 100644 --- a/src/w32font.c +++ b/src/w32font.c @@ -21,7 +21,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include "lisp.h" #include "w32term.h" diff --git a/src/w32heap.c b/src/w32heap.c index 26cc9aa0a0f..dc65198f90b 100644 --- a/src/w32heap.c +++ b/src/w32heap.c @@ -22,7 +22,6 @@ along with GNU Emacs. If not, see . */ #include #include -#include #include "w32heap.h" #include "lisp.h" /* for VALMASK */ diff --git a/src/w32inevt.c b/src/w32inevt.c index 731dd6715dc..ee07db5335b 100644 --- a/src/w32inevt.c +++ b/src/w32inevt.c @@ -25,7 +25,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #ifndef MOUSE_MOVED #define MOUSE_MOVED 1 diff --git a/src/w32menu.c b/src/w32menu.c index d4de73a0de7..fa7db64f147 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -22,7 +22,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include "lisp.h" #include "keyboard.h" diff --git a/src/w32proc.c b/src/w32proc.c index 74427e76a4f..26a0925ad87 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -28,7 +28,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include /* must include CRT headers *before* config.h */ #include diff --git a/src/w32reg.c b/src/w32reg.c index 9c727ae5ab7..8a6a3c853b1 100644 --- a/src/w32reg.c +++ b/src/w32reg.c @@ -19,7 +19,6 @@ along with GNU Emacs. If not, see . */ /* Written by Kevin Gallo */ #include -#include #include "lisp.h" #include "w32term.h" #include "blockinput.h" diff --git a/src/w32select.c b/src/w32select.c index 3fb88d4f17f..11c68c9c617 100644 --- a/src/w32select.c +++ b/src/w32select.c @@ -73,7 +73,6 @@ along with GNU Emacs. If not, see . */ */ #include -#include #include "lisp.h" #include "w32term.h" /* for all of the w32 includes */ #include "w32heap.h" /* os_subtype */ diff --git a/src/w32term.c b/src/w32term.c index 28c1c593cf6..69a16e1852b 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -20,7 +20,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include "lisp.h" #include "blockinput.h" #include "w32term.h" diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c index cf99d14dc77..5d160b9d42f 100644 --- a/src/w32uniscribe.c +++ b/src/w32uniscribe.c @@ -27,7 +27,6 @@ along with GNU Emacs. If not, see . */ #define _WIN32_WINNT 0x500 #include #include -#include #include "lisp.h" #include "w32term.h" diff --git a/src/w32xfns.c b/src/w32xfns.c index 820dbcc76c6..33f40fc7c01 100644 --- a/src/w32xfns.c +++ b/src/w32xfns.c @@ -19,7 +19,6 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include "lisp.h" #include "keyboard.h" #include "frame.h" From 39a57ad07b0521dd6dbcae9cd4996366aa59e1ba Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 15 Sep 2012 01:45:27 -0700 Subject: [PATCH 40/88] Port _setjmp fix to POSIXish hosts as well as Microsoft. * nt/config.nt: Attempt to sync with autogen/config.in. (HAVE_SIGSETJMP, HAVE__SETJMP): New macros. (_longjmp, _setjmp): Remove. * src/image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as it's needed on POSIXish hosts that lack _setjmp. Attempt to solve the Microsoft problem in a different way, by altering nt/config.nt. --- nt/ChangeLog | 7 +++++++ nt/config.nt | 15 +++++++-------- src/ChangeLog | 7 +++++++ src/image.c | 4 +--- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/nt/ChangeLog b/nt/ChangeLog index 54e5570072a..197ce0cf850 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,10 @@ +2012-09-15 Paul Eggert + + Port _setjmp fix to POSIXish hosts as well as Microsoft. + * config.nt: Attempt to sync with autogen/config.in. + (HAVE_SIGSETJMP, HAVE__SETJMP): New macros. + (_longjmp, _setjmp): Remove. + 2012-09-14 Juanma Barranquero * config.nt: Sync with autogen/config.in. diff --git a/nt/config.nt b/nt/config.nt index 5121a013aad..82b7da430ab 100644 --- a/nt/config.nt +++ b/nt/config.nt @@ -800,6 +800,10 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if 'wint_t' is a signed integer type. */ #undef HAVE_SIGNED_WINT_T +/* Define to 1 if sigsetjmp and siglongjmp work. The value of this symbol is + irrelevant if HAVE__SETJMP is defined. */ +#undef HAVE_SIGSETJMP + /* Define to 1 if the system has the type `sigset_t'. */ #undef HAVE_SIGSET_T @@ -1084,6 +1088,9 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if you have the `_ftime' function. */ #undef HAVE__FTIME +/* Define to 1 if _setjmp and _longjmp work. */ +#define HAVE__SETJMP 1 + /* Define to 1 if you have the `__builtin_unwind_init' function. */ #undef HAVE___BUILTIN_UNWIND_INIT @@ -1511,14 +1518,6 @@ along with GNU Emacs. If not, see . */ declarations. Define as empty for no equivalent. */ #undef __restrict_arr -/* Define to longjmp if _setjmp and _longjmp do not work. Because longjmp may - alter signal masks, callers of _longjmp should not assume that it leaves - signal masks alone. */ -#undef _longjmp - -/* Define to setjmp if _setjmp and _longjmp do not work. See _longjmp. */ -#undef _setjmp - /* Some platforms that do not use configure define this to include extra configuration information. */ #define config_opsysfile diff --git a/src/ChangeLog b/src/ChangeLog index f9d31b08abd..c6c314b9589 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2012-09-15 Paul Eggert + + Port _setjmp fix to POSIXish hosts as well as Microsoft. + * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as + it's needed on POSIXish hosts that lack _setjmp. Attempt to solve + the Microsoft problem in a different way, by altering ../nt/config.nt. + 2012-09-15 Eli Zaretskii * w32xfns.c: diff --git a/src/image.c b/src/image.c index 02151c500cc..8fc1c8637eb 100644 --- a/src/image.c +++ b/src/image.c @@ -5520,9 +5520,7 @@ init_png_functions (Lisp_Object libraries) MinGW (MS-Windows) uses _setjmp and defines setjmp to _setjmp in the system header setjmp.h; don't mess up that. */ #ifndef HAVE__SETJMP -# ifndef setjmp -# define _setjmp(j) setjmp (j) -# endif +# define _setjmp(j) setjmp (j) # define _longjmp longjmp #endif From e2d8f316d16ddcc7aafa071344a2460d5e7d373d Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 15 Sep 2012 06:17:37 -0400 Subject: [PATCH 41/88] Auto-commit of generated files. --- autogen/config.in | 15 +++--- autogen/configure | 128 +++++++++++++++++++++++++++++++--------------- 2 files changed, 95 insertions(+), 48 deletions(-) diff --git a/autogen/config.in b/autogen/config.in index f8e4c2bcce3..39e948ee228 100644 --- a/autogen/config.in +++ b/autogen/config.in @@ -791,6 +791,10 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if 'wint_t' is a signed integer type. */ #undef HAVE_SIGNED_WINT_T +/* Define to 1 if sigsetjmp and siglongjmp work. The value of this symbol is + irrelevant if HAVE__SETJMP is defined. */ +#undef HAVE_SIGSETJMP + /* Define to 1 if the system has the type `sigset_t'. */ #undef HAVE_SIGSET_T @@ -1074,6 +1078,9 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if you have the `_ftime' function. */ #undef HAVE__FTIME +/* Define to 1 if _setjmp and _longjmp work. */ +#undef HAVE__SETJMP + /* Define to 1 if you have the `__builtin_unwind_init' function. */ #undef HAVE___BUILTIN_UNWIND_INIT @@ -1502,14 +1509,6 @@ along with GNU Emacs. If not, see . */ declarations. Define as empty for no equivalent. */ #undef __restrict_arr -/* Define to longjmp if _setjmp and _longjmp do not work. Because longjmp may - alter signal masks, callers of _longjmp should not assume that it leaves - signal masks alone. */ -#undef _longjmp - -/* Define to setjmp if _setjmp and _longjmp do not work. See _longjmp. */ -#undef _setjmp - /* Some platforms that do not use configure define this to include extra configuration information. */ #undef config_opsysfile diff --git a/autogen/configure b/autogen/configure index 63295f68db0..0cbdd7c732a 100755 --- a/autogen/configure +++ b/autogen/configure @@ -2061,7 +2061,7 @@ Optional Packages: --with-mailhost=HOSTNAME string giving default POP mail host --without-sound don't compile with sound support - --without-sync-input process async input synchronously + --without-sync-input don't process async input synchronously --with-x-toolkit=KIT use an X toolkit (KIT one of: yes or gtk, gtk2, gtk3, lucid or athena, motif, no) --with-wide-int prefer wide Emacs integers (typically 62-bit) @@ -8578,8 +8578,9 @@ $as_echo "no" >&6; } ALSA_CFLAGS="" ALSA_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - ALSA_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$ALSA_MODULES"` + ## do set a variable so people can do so. Do it in a subshell + ## to capture any diagnostics in invoking pkg-config. + ALSA_PKG_ERRORS=`($PKG_CONFIG --print-errors "$ALSA_MODULES") 2>&1` fi @@ -10398,8 +10399,9 @@ $as_echo "no" >&6; } RSVG_CFLAGS="" RSVG_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - RSVG_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$RSVG_MODULE"` + ## do set a variable so people can do so. Do it in a subshell + ## to capture any diagnostics in invoking pkg-config. + RSVG_PKG_ERRORS=`($PKG_CONFIG --print-errors "$RSVG_MODULE") 2>&1` fi @@ -10468,8 +10470,9 @@ $as_echo "no" >&6; } IMAGEMAGICK_CFLAGS="" IMAGEMAGICK_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - IMAGEMAGICK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$IMAGEMAGICK_MODULE"` + ## do set a variable so people can do so. Do it in a subshell + ## to capture any diagnostics in invoking pkg-config. + IMAGEMAGICK_PKG_ERRORS=`($PKG_CONFIG --print-errors "$IMAGEMAGICK_MODULE") 2>&1` fi @@ -10554,8 +10557,9 @@ $as_echo "no" >&6; } GTK_CFLAGS="" GTK_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - GTK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$GTK_MODULES"` + ## do set a variable so people can do so. Do it in a subshell + ## to capture any diagnostics in invoking pkg-config. + GTK_PKG_ERRORS=`($PKG_CONFIG --print-errors "$GTK_MODULES") 2>&1` fi @@ -10624,8 +10628,9 @@ $as_echo "no" >&6; } GTK_CFLAGS="" GTK_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - GTK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$GTK_MODULES"` + ## do set a variable so people can do so. Do it in a subshell + ## to capture any diagnostics in invoking pkg-config. + GTK_PKG_ERRORS=`($PKG_CONFIG --print-errors "$GTK_MODULES") 2>&1` fi @@ -10643,10 +10648,10 @@ $as_echo "no" >&6; } pkg_check_gtk=no fi - if test "$pkg_check_gtk" = "no"; then - if test "$USE_X_TOOLKIT" = "maybe" || test "$with_gtk" = "yes" || test "$with_gtk2" = "yes"; then - as_fn_error "$gtk3_pkg_errors$GTK_PKG_ERRORS" "$LINENO" 5 - fi + if test "$pkg_check_gtk" = "no" && + { test "$with_gtk" = yes || test "$with_gtk2" = "yes"; } + then + as_fn_error "$gtk3_pkg_errors$GTK_PKG_ERRORS" "$LINENO" 5 fi fi @@ -10785,8 +10790,9 @@ $as_echo "no" >&6; } DBUS_CFLAGS="" DBUS_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - DBUS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "dbus-1 >= 1.0"` + ## do set a variable so people can do so. Do it in a subshell + ## to capture any diagnostics in invoking pkg-config. + DBUS_PKG_ERRORS=`($PKG_CONFIG --print-errors "dbus-1 >= 1.0") 2>&1` fi @@ -10865,8 +10871,9 @@ $as_echo "no" >&6; } GSETTINGS_CFLAGS="" GSETTINGS_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - GSETTINGS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gio-2.0 >= 2.26"` + ## do set a variable so people can do so. Do it in a subshell + ## to capture any diagnostics in invoking pkg-config. + GSETTINGS_PKG_ERRORS=`($PKG_CONFIG --print-errors "gio-2.0 >= 2.26") 2>&1` fi @@ -10926,8 +10933,9 @@ $as_echo "no" >&6; } GCONF_CFLAGS="" GCONF_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - GCONF_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gconf-2.0 >= 2.13"` + ## do set a variable so people can do so. Do it in a subshell + ## to capture any diagnostics in invoking pkg-config. + GCONF_PKG_ERRORS=`($PKG_CONFIG --print-errors "gconf-2.0 >= 2.13") 2>&1` fi @@ -10986,8 +10994,9 @@ $as_echo "no" >&6; } GOBJECT_CFLAGS="" GOBJECT_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - GOBJECT_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gobject-2.0 >= 2.0"` + ## do set a variable so people can do so. Do it in a subshell + ## to capture any diagnostics in invoking pkg-config. + GOBJECT_PKG_ERRORS=`($PKG_CONFIG --print-errors "gobject-2.0 >= 2.0") 2>&1` fi @@ -11119,8 +11128,9 @@ $as_echo "no" >&6; } LIBGNUTLS_CFLAGS="" LIBGNUTLS_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - LIBGNUTLS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gnutls >= 2.6.6"` + ## do set a variable so people can do so. Do it in a subshell + ## to capture any diagnostics in invoking pkg-config. + LIBGNUTLS_PKG_ERRORS=`($PKG_CONFIG --print-errors "gnutls >= 2.6.6") 2>&1` fi @@ -11748,8 +11758,9 @@ $as_echo "no" >&6; } FONTCONFIG_CFLAGS="" FONTCONFIG_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - FONTCONFIG_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "fontconfig >= 2.2.0"` + ## do set a variable so people can do so. Do it in a subshell + ## to capture any diagnostics in invoking pkg-config. + FONTCONFIG_PKG_ERRORS=`($PKG_CONFIG --print-errors "fontconfig >= 2.2.0") 2>&1` fi @@ -11806,8 +11817,9 @@ $as_echo "no" >&6; } XFT_CFLAGS="" XFT_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - XFT_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xft >= 0.13.0"` + ## do set a variable so people can do so. Do it in a subshell + ## to capture any diagnostics in invoking pkg-config. + XFT_PKG_ERRORS=`($PKG_CONFIG --print-errors "xft >= 0.13.0") 2>&1` fi @@ -11973,8 +11985,9 @@ $as_echo "no" >&6; } FREETYPE_CFLAGS="" FREETYPE_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - FREETYPE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "freetype2"` + ## do set a variable so people can do so. Do it in a subshell + ## to capture any diagnostics in invoking pkg-config. + FREETYPE_PKG_ERRORS=`($PKG_CONFIG --print-errors "freetype2") 2>&1` fi @@ -12033,8 +12046,9 @@ $as_echo "no" >&6; } LIBOTF_CFLAGS="" LIBOTF_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - LIBOTF_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libotf"` + ## do set a variable so people can do so. Do it in a subshell + ## to capture any diagnostics in invoking pkg-config. + LIBOTF_PKG_ERRORS=`($PKG_CONFIG --print-errors "libotf") 2>&1` fi @@ -12141,8 +12155,9 @@ $as_echo "no" >&6; } M17N_FLT_CFLAGS="" M17N_FLT_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - M17N_FLT_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "m17n-flt"` + ## do set a variable so people can do so. Do it in a subshell + ## to capture any diagnostics in invoking pkg-config. + M17N_FLT_PKG_ERRORS=`($PKG_CONFIG --print-errors "m17n-flt") 2>&1` fi @@ -12830,8 +12845,9 @@ $as_echo "no" >&6; } LIBXML2_CFLAGS="" LIBXML2_LIBS="" ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - LIBXML2_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libxml-2.0 > 2.6.17"` + ## do set a variable so people can do so. Do it in a subshell + ## to capture any diagnostics in invoking pkg-config. + LIBXML2_PKG_ERRORS=`($PKG_CONFIG --print-errors "libxml-2.0 > 2.6.17") 2>&1` fi @@ -15461,13 +15477,45 @@ rm -f core conftest.err conftest.$ac_objext \ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_func__setjmp" >&5 $as_echo "$emacs_cv_func__setjmp" >&6; } -if test $emacs_cv_func__setjmp = no; then +if test $emacs_cv_func__setjmp = yes; then -$as_echo "#define _setjmp setjmp" >>confdefs.h +$as_echo "#define HAVE__SETJMP 1" >>confdefs.h +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigsetjmp" >&5 +$as_echo_n "checking for sigsetjmp... " >&6; } +if test "${emacs_cv_func_sigsetjmp+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include -$as_echo "#define _longjmp longjmp" >>confdefs.h +int +main () +{ +sigjmp_buf j; + if (! sigsetjmp (j, 1)) + siglongjmp (j, 1); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + emacs_cv_func_sigsetjmp=yes +else + emacs_cv_func_sigsetjmp=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_func_sigsetjmp" >&5 +$as_echo "$emacs_cv_func_sigsetjmp" >&6; } + if test $emacs_cv_func_sigsetjmp = yes; then +$as_echo "#define HAVE_SIGSETJMP 1" >>confdefs.h + + fi fi case $opsys in From 830be228cde51f401457d95de0af8152a5a9b75d Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 15 Sep 2012 06:20:56 -0400 Subject: [PATCH 42/88] Auto-commit of loaddefs files. --- lisp/dired.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/dired.el b/lisp/dired.el index ebc8f5da6d5..54921a4ea66 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3744,7 +3744,7 @@ Ask means pop up a menu for the user to select one of copy, move or link." ;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command ;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown ;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff -;;;;;; dired-diff) "dired-aux" "dired-aux.el" "22ce64daa7ccb5698cb6b1279aa59ec2") +;;;;;; dired-diff) "dired-aux" "dired-aux.el" "3c768e470d5d053d0049e0286ce38da7") ;;; Generated autoloads from dired-aux.el (autoload 'dired-diff "dired-aux" "\ From 72aa16e19b24eb73c812c13d4cd77afd7977fc25 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 15 Sep 2012 13:00:45 -0700 Subject: [PATCH 43/88] Add option to ask bzr itself for the emacs bzr revision * lisp/version.el (emacs-bzr-version-bzr): New function. (emacs-bzr-get-version): Add optional EXTERNAL argument. --- lisp/ChangeLog | 3 ++ lisp/version.el | 94 +++++++++++++++++++++++++++++++------------------ 2 files changed, 63 insertions(+), 34 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c9aa7e99356..b436d9e364e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-09-15 Glenn Morris + * version.el (emacs-bzr-version-bzr): New function. + (emacs-bzr-get-version): Add optional EXTERNAL argument. + * vc/vc-bzr.el (vc-bzr-working-revision): For lightweight local checkouts, check the parent dirstate matches the branch. Add "--tree" to "bzr revno" arguments. Don't try to shorten the diff --git a/lisp/version.el b/lisp/version.el index 47476cb268a..1fb3828e15d 100644 --- a/lisp/version.el +++ b/lisp/version.el @@ -104,48 +104,74 @@ Returns nil if unable to find this information." (looking-at "[0-9]+\0\\([^\0\n]+\\)\0") (match-string 1)))))) -(defun emacs-bzr-get-version (&optional dir) +(defun emacs-bzr-version-bzr (dir) + "Ask bzr itself for the version information for directory DIR." + ;; Comments on `bzr version-info': + ;; i) Unknown files also cause clean != 1. + ;; ii) It can be slow, contacting the upstream repo to get the + ;; branch nick if one is not set locally, even with a custom + ;; template that is not asking for the nick (as used here). You'd + ;; think the latter part would be trivial to fix: + ;; https://bugs.launchpad.net/bzr/+bug/882541/comments/3 + ;; https://bugs.launchpad.net/bzr/+bug/629150 + ;; You can set the nick locally with `bzr nick ...', which speeds + ;; things up enormously. `bzr revno' does not have this issue, but + ;; has no way to print the revision_id AFAICS. + (message "Waiting for bzr...") + (with-temp-buffer + (if (zerop + (call-process "bzr" nil '(t nil) nil "version-info" + "--custom" + "--template={revno} {revision_id} (clean = {clean})" + "dir")) + (buffer-string)))) + +(defun emacs-bzr-get-version (&optional dir external) "Try to return as a string the bzr revision of the Emacs sources. The format is: [revno] revision_id, where revno may be absent. Value is nil if the sources do not seem to be under bzr, or if we could not determine the revision. Note that this reports on the current state of the sources, which may not correspond to the running Emacs. -Optional argument DIR is a directory to use instead of `source-directory'." +Optional argument DIR is a directory to use instead of `source-directory'. +Optional argument EXTERNAL non-nil means to maybe ask `bzr' itself, +if the sources appear to be under bzr. If `force', always ask bzr. +Otherwise only ask bzr if we cannot find any information ourselves." (or dir (setq dir source-directory)) (when (file-directory-p (expand-file-name ".bzr/branch" dir)) - (let (file loc rev) - (cond ((file-readable-p - (setq file (expand-file-name ".bzr/branch/last-revision" dir))) - (with-temp-buffer - (insert-file-contents file) - (goto-char (point-max)) - (if (looking-back "\n") - (delete-char -1)) - (buffer-string))) - ;; OK, no last-revision. Is it a lightweight checkout? - ((file-readable-p - (setq file (expand-file-name ".bzr/branch/location" dir))) - (setq rev (emacs-bzr-version-dirstate dir)) - ;; If the parent branch is local, try looking there for the rev. - ;; Note: there is no guarantee that the parent branch's rev - ;; corresponds to this branch. This branch could have - ;; been made with a specific -r revno argument, or the - ;; parent could have been updated since this branch was created. - ;; To try and detect this, we check the dirstate revids - ;; to see if they match. - (if (and (setq loc (with-temp-buffer - (insert-file-contents file) - (if (looking-at "file://\\(.*\\)") - (match-string 1)))) - (equal rev (emacs-bzr-version-dirstate loc))) - (emacs-bzr-get-version loc) - ;; If parent does not match, the best we can do without - ;; calling external commands is to use the dirstate rev. - rev)) - ;; At this point, could fall back to: - ;; bzr version-info --custom --template='{revno} {revision_id}\n' - )))) + (if (eq external 'force) + (emacs-bzr-version-bzr dir) + (let (file loc rev) + (cond ((file-readable-p + (setq file (expand-file-name ".bzr/branch/last-revision" dir))) + (with-temp-buffer + (insert-file-contents file) + (goto-char (point-max)) + (if (looking-back "\n") + (delete-char -1)) + (buffer-string))) + ;; OK, no last-revision. Is it a lightweight checkout? + ((file-readable-p + (setq file (expand-file-name ".bzr/branch/location" dir))) + (setq rev (emacs-bzr-version-dirstate dir)) + ;; If the parent branch is local, try looking there for the rev. + ;; Note: there is no guarantee that the parent branch's rev + ;; corresponds to this branch. This branch could have + ;; been made with a specific -r revno argument, or the + ;; parent could have been updated since this branch was created. + ;; To try and detect this, we check the dirstate revids + ;; to see if they match. + (if (and (setq loc (with-temp-buffer + (insert-file-contents file) + (if (looking-at "file://\\(.*\\)") + (match-string 1)))) + (equal rev (emacs-bzr-version-dirstate loc))) + (emacs-bzr-get-version loc) + ;; If parent does not match, the best we can do without + ;; calling external commands is to use the dirstate rev. + rev)) + (external + (emacs-bzr-version-bzr dir))))))) ;; We put version info into the executable in the form that `ident' uses. (purecopy (concat "\n$Id: " (subst-char-in-string ?\n ?\s (emacs-version)) From c584eaf9c704543845e949acb76d8d591226aa71 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 16 Sep 2012 12:16:51 +0800 Subject: [PATCH 44/88] In compilation-error-regexp-alist, allow more HIGHLIGHT types. * progmodes/compile.el (compilation-parse-errors): Apply any value that is a valid font-lock-face property. (compilation-error-regexp-alist): Doc fix. Fixes: debbugs:12136 --- lisp/ChangeLog | 6 ++++++ lisp/progmodes/compile.el | 11 +++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b436d9e364e..9d5f70eb224 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-09-16 Chong Yidong + + * progmodes/compile.el (compilation-parse-errors): Apply any value + that is a valid font-lock-face property (Bug#12136). + (compilation-error-regexp-alist): Doc fix. + 2012-09-15 Glenn Morris * version.el (emacs-bzr-version-bzr): New function. diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index fbb0c9e204a..ae2f6973fa5 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -488,9 +488,10 @@ What matched the HYPERLINK'th subexpression has `mouse-face' and `compilation-message-face' applied. If this is nil, the text matched by the whole REGEXP becomes the hyperlink. -Additional HIGHLIGHTs take the shape (SUBMATCH FACE), where SUBMATCH is -the number of a submatch that should be highlighted when it matches, -and FACE is an expression returning the face to use for that submatch.." +Additional HIGHLIGHTs take the shape (SUBMATCH FACE), where +SUBMATCH is the number of a submatch and FACE is an expression +which evaluates to a face (more precisely, a valid value for the +`font-lock-face' property) for highlighting the submatch." :type '(repeat (choice (symbol :tag "Predefined symbol") (sexp :tag "Error specification"))) :link `(file-link :tag "example file" @@ -1334,7 +1335,9 @@ to `compilation-error-regexp-alist' if RULES is nil." (let ((face (eval (car extra-item)))) (cond ((null face)) - ((symbolp face) + ((or (symbolp face) + (stringp face) + (listp face)) (put-text-property (match-beginning mn) (match-end mn) 'font-lock-face face)) From f1be615c41027bfc11425c9e62598bc25fa323e1 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 16 Sep 2012 12:31:02 +0800 Subject: [PATCH 45/88] Alter last change to be compatible with Emacs 23. * lisp/progmodes/compile.el (compilation-parse-errors): Accept list values similar to font-lock-keywords. Suggested by Oleksandr Manzyuk. (compilation-error-regexp-alist): Doc fix. Fixes: debbugs:12136 --- lisp/ChangeLog | 5 +++-- lisp/progmodes/compile.el | 21 ++++++++++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9d5f70eb224..2d2ff692309 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,8 @@ 2012-09-16 Chong Yidong - * progmodes/compile.el (compilation-parse-errors): Apply any value - that is a valid font-lock-face property (Bug#12136). + * progmodes/compile.el (compilation-parse-errors): Accept list + values similar to font-lock-keywords (Bug#12136). Suggested by + Oleksandr Manzyuk. (compilation-error-regexp-alist): Doc fix. 2012-09-15 Glenn Morris diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index ae2f6973fa5..f5dedf0cd59 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -490,8 +490,10 @@ matched by the whole REGEXP becomes the hyperlink. Additional HIGHLIGHTs take the shape (SUBMATCH FACE), where SUBMATCH is the number of a submatch and FACE is an expression -which evaluates to a face (more precisely, a valid value for the -`font-lock-face' property) for highlighting the submatch." +which evaluates to a face name (a symbol or string). +Alternatively, FACE can evaluate to a property list of the +form (face FACE PROP1 VAL1 PROP2 VAL2 ...), in which case all the +listed text properties PROP# are given values VAL# as well." :type '(repeat (choice (symbol :tag "Predefined symbol") (sexp :tag "Error specification"))) :link `(file-link :tag "example file" @@ -1329,18 +1331,27 @@ to `compilation-error-regexp-alist' if RULES is nil." (compilation--put-prop end-col 'font-lock-face compilation-column-face) + ;; Obey HIGHLIGHT. (dolist (extra-item (nthcdr 6 item)) (let ((mn (pop extra-item))) (when (match-beginning mn) (let ((face (eval (car extra-item)))) (cond ((null face)) - ((or (symbolp face) - (stringp face) - (listp face)) + ((or (symbolp face) (stringp face)) (put-text-property (match-beginning mn) (match-end mn) 'font-lock-face face)) + ((and (listp face) + (eq (car face) 'face) + (or (symbolp (cadr face)) + (stringp (cadr face)))) + (put-text-property + (match-beginning mn) (match-end mn) + 'font-lock-face (cadr face)) + (add-text-properties + (match-beginning mn) (match-end mn) + (nthcdr 2 face))) (t (error "Don't know how to handle face %S" face))))))) From fdc2806d0b023bc6a3c6c8abf8cfc72b8214a68b Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 16 Sep 2012 12:43:46 +0800 Subject: [PATCH 46/88] * window.el (special-display-popup-frame): Doc fix. Fixes: debbugs:8853 --- lisp/ChangeLog | 2 ++ lisp/window.el | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2d2ff692309..936a451ccb4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-09-16 Chong Yidong + * window.el (special-display-popup-frame): Doc fix (Bug#8853). + * progmodes/compile.el (compilation-parse-errors): Accept list values similar to font-lock-keywords (Bug#12136). Suggested by Oleksandr Manzyuk. diff --git a/lisp/window.el b/lisp/window.el index dd1f55450c3..d9f3ccbd5c2 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4768,8 +4768,8 @@ the selected window. If they contain (same-frame . t), display BUFFER in a window of the selected frame. If ARGS is a list whose car is a symbol, use (car ARGS) as a -function to do the work. Pass it BUFFER as first argument, -and (cdr ARGS) as second." +function to do the work. Pass it BUFFER as first argument, and +pass the elements of (cdr ARGS) as the remaining arguments." (if (and args (symbolp (car args))) (apply (car args) buffer (cdr args)) (let ((window (get-buffer-window buffer 0))) From 71ce58e752dfb8d384eddf2d40ee9d5861ede5e5 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 16 Sep 2012 12:52:38 +0800 Subject: [PATCH 47/88] Mark display-buffer-function as obsolete. * lisp/window.el (display-buffer-function): Mark as obsolete. Fixes: debbugs:12166 --- etc/NEWS | 1 + lisp/ChangeLog | 1 + lisp/window.el | 3 +++ 3 files changed, 5 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index 4c6ceae1688..3344158b73c 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -735,6 +735,7 @@ in Emacs 24.1: **** `special-display-frame-alist' **** `special-display-buffer-names' **** `special-display-function' +**** `display-buffer-function' ** Completion diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 936a451ccb4..a7538e50d82 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,6 +1,7 @@ 2012-09-16 Chong Yidong * window.el (special-display-popup-frame): Doc fix (Bug#8853). + (display-buffer-function): Mark as obsolete. * progmodes/compile.el (compilation-parse-errors): Accept list values similar to font-lock-keywords (Bug#12136). Suggested by diff --git a/lisp/window.el b/lisp/window.el index d9f3ccbd5c2..fccb68bd94a 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4551,6 +4551,9 @@ of the window used." (function :tag "function")) :group 'windows) +(make-obsolete-variable 'display-buffer-function + 'display-buffer-alist "24.3") + ;; Eventually, we want to turn this into a defvar; instead of ;; customizing this, the user should use a `pop-up-frame-parameters' ;; alist entry in `display-buffer-base-action'. From c077c0598d5c3c7982b53946a696ec7a75c7481e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Sun, 16 Sep 2012 11:11:50 +0200 Subject: [PATCH 48/88] Try to fix crashes introduced by 2012-09-10T21:01:45Z!jan.h.d@swipnet.se. * nsfns.m (Fx_open_connection): Move initialization of ns_*_types to ns_term_init to avoid memory leak. * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use explicit retain/release. (ns_term_init): Only allow one display. Initialize outerpool and ns_*_types. --- src/ChangeLog | 10 ++++++++++ src/nsfns.m | 13 ------------ src/nsterm.m | 55 +++++++++++++++++++++++++++++++++------------------ 3 files changed, 46 insertions(+), 32 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index c6c314b9589..92117da8eb0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2012-09-16 Jan Djärv + + * nsfns.m (Fx_open_connection): Move initialization of ns_*_types + to ns_term_init to avoid memory leak. + + * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use + explicit retain/release. + (ns_term_init): Only allow one display. Initialize outerpool and + ns_*_types. + 2012-09-15 Paul Eggert Port _setjmp fix to POSIXish hosts as well as Microsoft. diff --git a/src/nsfns.m b/src/nsfns.m index ed8d44014d5..072005d2d3d 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -1796,19 +1796,6 @@ and GNUstep implementations ("distributor-specific release SSDATA (display)); } - /* Register our external input/output types, used for determining - applicable services and also drag/drop eligibility. */ - ns_send_types = [[NSArray arrayWithObjects: NSStringPboardType, nil] retain]; - ns_return_types = [[NSArray arrayWithObjects: NSStringPboardType, nil] - retain]; - ns_drag_types = [[NSArray arrayWithObjects: - NSStringPboardType, - NSTabularTextPboardType, - NSFilenamesPboardType, - NSURLPboardType, - NSColorPboardType, - NSFontPboardType, nil] retain]; - return Qnil; } diff --git a/src/nsterm.m b/src/nsterm.m index f1f23ad4479..41520ce74d1 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -627,7 +627,7 @@ Free a pool and temporary objects it refers to (callable from C) { NSView *view = FRAME_NS_VIEW (f); NSRect r = [view frame]; - NSBezierPath *bp = [NSBezierPath bezierPath]; + NSBezierPath *bp; NSTRACE (ns_update_begin); ns_update_auto_hide_menu_bar (); @@ -639,8 +639,9 @@ Free a pool and temporary objects it refers to (callable from C) is for the minibuffer. But the display engine may draw more because we have set the frame as garbaged. So reset clip path to the whole view. */ - [bp appendBezierPathWithRect: r]; + bp = [[NSBezierPath bezierPathWithRect: r] retain]; [bp setClip]; + [bp release]; #ifdef NS_IMPL_GNUSTEP uRect = NSMakeRect (0, 0, 0, 0); @@ -3976,33 +3977,35 @@ static Lisp_Object ns_string_to_lispmod (const char *s) static int ns_initialized = 0; Lisp_Object tmp; + if (ns_initialized) return x_display_list; + ns_initialized = 1; + NSTRACE (ns_term_init); + [outerpool release]; + outerpool = [[NSAutoreleasePool alloc] init]; + /* count object allocs (About, click icon); on OS X use ObjectAlloc tool */ /*GSDebugAllocationActive (YES); */ BLOCK_INPUT; handling_signal = 0; - if (!ns_initialized) + baud_rate = 38400; + Fset_input_interrupt_mode (Qnil); + + if (selfds[0] == -1) { - baud_rate = 38400; - Fset_input_interrupt_mode (Qnil); - - if (selfds[0] == -1) + if (pipe (selfds) == -1) { - if (pipe (selfds) == -1) - { - fprintf (stderr, "Failed to create pipe: %s\n", - emacs_strerror (errno)); - emacs_abort (); - } - - fcntl (selfds[0], F_SETFL, O_NONBLOCK|fcntl (selfds[0], F_GETFL)); - FD_ZERO (&select_readfds); - FD_ZERO (&select_writefds); - pthread_mutex_init (&select_mutex, NULL); + fprintf (stderr, "Failed to create pipe: %s\n", + emacs_strerror (errno)); + emacs_abort (); } - ns_initialized = 1; + + fcntl (selfds[0], F_SETFL, O_NONBLOCK|fcntl (selfds[0], F_GETFL)); + FD_ZERO (&select_readfds); + FD_ZERO (&select_writefds); + pthread_mutex_init (&select_mutex, NULL); } ns_pending_files = [[NSMutableArray alloc] init]; @@ -4193,6 +4196,20 @@ Needs to be here because ns_initialize_display_info () uses AppKit classes. } #endif /* MAC OS X menu setup */ + /* Register our external input/output types, used for determining + applicable services and also drag/drop eligibility. */ + ns_send_types = [[NSArray arrayWithObjects: NSStringPboardType, nil] retain]; + ns_return_types = [[NSArray arrayWithObjects: NSStringPboardType, nil] + retain]; + ns_drag_types = [[NSArray arrayWithObjects: + NSStringPboardType, + NSTabularTextPboardType, + NSFilenamesPboardType, + NSURLPboardType, + NSColorPboardType, + NSFontPboardType, nil] retain]; + + [NSApp run]; ns_do_open_file = YES; return dpyinfo; From a8c729af93b08531e5e3f3fff6f16a55c8baac3f Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sun, 16 Sep 2012 12:25:24 +0200 Subject: [PATCH 49/88] Window parameter functions again accept any window as argument (Bug#12452). * window.c (Fwindow_parameter, Fset_window_parameter): Accept any window as argument (Bug#12452). --- src/ChangeLog | 5 +++++ src/window.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 92117da8eb0..3ff1a7287d6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-09-16 Martin Rudalics + + * window.c (Fwindow_parameter, Fset_window_parameter): Accept + any window as argument (Bug#12452). + 2012-09-16 Jan Djärv * nsfns.m (Fx_open_connection): Move initialization of ns_*_types diff --git a/src/window.c b/src/window.c index b3db1292e5c..fbccab8b358 100644 --- a/src/window.c +++ b/src/window.c @@ -1855,23 +1855,23 @@ return value is a list of elements of the form (PARAMETER . VALUE). */) DEFUN ("window-parameter", Fwindow_parameter, Swindow_parameter, 2, 2, 0, doc: /* Return WINDOW's value for PARAMETER. -WINDOW must be a valid window and defaults to the selected one. */) +WINDOW can be any window and defaults to the selected one. */) (Lisp_Object window, Lisp_Object parameter) { Lisp_Object result; - result = Fassq (parameter, decode_valid_window (window)->window_parameters); + result = Fassq (parameter, decode_any_window (window)->window_parameters); return CDR_SAFE (result); } DEFUN ("set-window-parameter", Fset_window_parameter, Sset_window_parameter, 3, 3, 0, doc: /* Set WINDOW's value of PARAMETER to VALUE. -WINDOW must be a valid window and defaults to the selected one. +WINDOW can be any window and defaults to the selected one. Return VALUE. */) (Lisp_Object window, Lisp_Object parameter, Lisp_Object value) { - register struct window *w = decode_valid_window (window); + register struct window *w = decode_any_window (window); Lisp_Object old_alist_elt; old_alist_elt = Fassq (parameter, w->window_parameters); From 1667e065d0720c65efc0c5385b9efb9f75b318c1 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 16 Sep 2012 23:57:28 +0800 Subject: [PATCH 50/88] * files.el (parse-colon-path): Use split-string. Fixes: debbugs:12351 --- lisp/ChangeLog | 2 ++ lisp/files.el | 23 +++++++---------------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a7538e50d82..b444761e55c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-09-16 Chong Yidong + * files.el (parse-colon-path): Use split-string (Bug#12351). + * window.el (special-display-popup-frame): Doc fix (Bug#8853). (display-buffer-function): Mark as obsolete. diff --git a/lisp/files.el b/lisp/files.el index 4acdb542089..289f5c6b0b6 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -658,22 +658,13 @@ Not actually set up until the first time you use it.") (defun parse-colon-path (search-path) "Explode a search path into a list of directory names. -Directories are separated by occurrences of `path-separator' -\(which is colon in GNU and GNU-like systems)." - ;; We could use split-string here. - (and search-path - (let (cd-list (cd-start 0) cd-colon) - (setq search-path (concat search-path path-separator)) - (while (setq cd-colon (string-match path-separator search-path cd-start)) - (setq cd-list - (nconc cd-list - (list (if (= cd-start cd-colon) - nil - (substitute-in-file-name - (file-name-as-directory - (substring search-path cd-start cd-colon))))))) - (setq cd-start (+ cd-colon 1))) - cd-list))) +Directories are separated by `path-separator' (which is colon in +GNU and Unix systems). Substitute environment variables into the +resulting list of directory names." + (when (stringp search-path) + (mapcar (lambda (f) + (substitute-in-file-name (file-name-as-directory f))) + (split-string search-path path-separator t)))) (defun cd-absolute (dir) "Change current directory to given absolute file name DIR." From 85a43e2ea45592610c43a25468aabef921c709f8 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 17 Sep 2012 01:17:31 +0900 Subject: [PATCH 51/88] font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may not covert the last few charactes. --- src/ChangeLog | 5 +++++ src/font.c | 13 +++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index cfcd2b0e2f1..be734134adf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-09-17 Kenichi Handa + + * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may + not covert the last few charactes. + 2012-09-16 Kenichi Handa * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster diff --git a/src/font.c b/src/font.c index 32194d1bb02..fc970254a62 100644 --- a/src/font.c +++ b/src/font.c @@ -4330,10 +4330,10 @@ GSTRING. */) LGSTRING_SET_GLYPH (gstring, XINT (n), Qnil); /* Check FROM_IDX and TO_IDX of each GLYPH in GSTRING to assure that - GLYPHS covers all characters in GSTRING. More formally, provided - that NCHARS is the number of characters in GSTRING, N is the - number of glyphs, and GLYPHS[i] is the ith glyph, FROM_IDX and - TO_IDX of each glyph must satisfy these conditions: + GLYPHS covers all characters (except for the last few ones) in + GSTRING. More formally, provided that NCHARS is the number of + characters in GSTRING and GLYPHS[i] is the ith glyph, FROM_IDX + and TO_IDX of each glyph must satisfy these conditions: GLYPHS[0].FROM_IDX == 0 GLYPHS[i].FROM_IDX <= GLYPHS[i].TO_IDX @@ -4342,8 +4342,7 @@ GSTRING. */) GLYPHS[i].TO_IDX == GLYPHS[i-1].TO_IDX else ;; Be sure to cover all characters. - GLYPHS[i].FROM_IDX == GLYPHS[i-1].TO_IDX + 1 - GLYPHS[N-1].TO_IDX == NCHARS - 1 */ + GLYPHS[i].FROM_IDX == GLYPHS[i-1].TO_IDX + 1 */ glyph = LGSTRING_GLYPH (gstring, 0); from = LGLYPH_FROM (glyph); to = LGLYPH_TO (glyph); @@ -4362,8 +4361,6 @@ GSTRING. */) from = LGLYPH_FROM (glyph); to = LGLYPH_TO (glyph); } - if (to != LGSTRING_CHAR_LEN (gstring) - 1) - goto shaper_error; return composition_gstring_put_cache (gstring, XINT (n)); shaper_error: From 40d70ecb6d11f87363b500db5665d8b433278687 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 17 Sep 2012 00:27:20 +0800 Subject: [PATCH 52/88] Fix marker usage in align-areas. * align.el (align-areas): Call the indication function with positions instead of markers for arguments. Fixes: debbugs:12343 --- lisp/ChangeLog | 3 +++ lisp/align.el | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b444761e55c..9eeba6691c6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-09-16 Chong Yidong + * align.el (align-areas): Call the indication function with + positions instead of markers for arguments (Bug#12343). + * files.el (parse-colon-path): Use split-string (Bug#12351). * window.el (special-display-popup-frame): Doc fix (Bug#8853). diff --git a/lisp/align.el b/lisp/align.el index 4c82d7bea81..b5c4c442f24 100644 --- a/lisp/align.el +++ b/lisp/align.el @@ -1201,7 +1201,10 @@ have been aligned. No changes will be made to the buffer." (gocol col) cur) (when area (if func - (funcall func (car area) (cdr area) change) + (funcall func + (marker-position (car area)) + (marker-position (cdr area)) + change) (if (not (and justify (consp (cdr area)))) (goto-char (cdr area)) From 83da1b5565d518aa02984bf2f474c56eb61f41ef Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 16 Sep 2012 11:49:00 -0700 Subject: [PATCH 53/88] Increase compartmentalization of Nextstep builds rules, and store Emacs version number in fewer versioned files. * configure.ac (ns_appsrc): Use relative names. (ns_frag): Remove. (Info-gnustep.plist, Emacs.desktop, Info.plist, InfoPlist.strings) (nextstep/Makefile): Generate these nextstep files. (SUBDIR_MAKEFILES): Add nextstep. * Makefile.in (clean, distclean, bootstrap-clean): Add nextstep. * make-dist (nextstep/templates): Add directory. (nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj): Remove. (nextstep/Cocoa/Emacs.base/Contents) (nextstep/GNUstep/Emacs.base/Resources): Update contents. * .bzrignore: Add some nextstep files. * admin/admin.el (set-version): No more need to set nextstep versions. (set-copyright): Update for moved nextstep files. * nextstep/Makefile.in: New file. * nextstep/templates: New directory. * nextstep/templates/Emacs.desktop.in, nextstep/templates/Info-gnustep.plist.in: * nextstep/templates/Info.plist.in, nextstep/templates/InfoPlist.strings.in: Move here from various Cocoa/, GNUstep/ locations. Let configure set the version number. * nextstep/Cocoa/Emacs.base/Contents/Info.plist: * nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings: * nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist: * nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop: Move to templates/. * nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj: Remove directory. * src/Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables. (ns_frag): Remove. (ns-app): Move here from ns.mk, and simplify. (clean): Simplify nextstep entry. * src/ns.mk: Remove file. --- ChangeLog | 15 ++++ Makefile.in | 3 + admin/ChangeLog | 5 ++ admin/admin.el | 40 ++--------- configure.ac | 21 ++++-- make-dist | 16 ++--- nextstep/ChangeLog | 14 ++++ nextstep/Makefile.in | 68 +++++++++++++++++++ .../Emacs.desktop.in} | 2 +- .../Info-gnustep.plist.in} | 4 +- .../Info.plist => templates/Info.plist.in} | 4 +- .../InfoPlist.strings.in} | 4 +- src/ChangeLog | 10 ++- src/Makefile.in | 10 ++- src/ns.mk | 39 ----------- 15 files changed, 151 insertions(+), 104 deletions(-) create mode 100644 nextstep/Makefile.in rename nextstep/{GNUstep/Emacs.base/Resources/Emacs.desktop => templates/Emacs.desktop.in} (92%) rename nextstep/{GNUstep/Emacs.base/Resources/Info-gnustep.plist => templates/Info-gnustep.plist.in} (96%) rename nextstep/{Cocoa/Emacs.base/Contents/Info.plist => templates/Info.plist.in} (99%) rename nextstep/{Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings => templates/InfoPlist.strings.in} (56%) delete mode 100644 src/ns.mk diff --git a/ChangeLog b/ChangeLog index 8dfe5f2746b..ab7864578b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2012-09-16 Glenn Morris + + Increase compartmentalization of Nextstep builds rules, + and store Emacs version number in fewer versioned files. + * configure.ac (ns_appsrc): Use relative names. + (ns_frag): Remove. + (Info-gnustep.plist, Emacs.desktop, Info.plist, InfoPlist.strings) + (nextstep/Makefile): Generate these nextstep files. + (SUBDIR_MAKEFILES): Add nextstep. + * Makefile.in (clean, distclean, bootstrap-clean): Add nextstep. + * make-dist (nextstep/templates): Add directory. + (nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj): Remove. + (nextstep/Cocoa/Emacs.base/Contents) + (nextstep/GNUstep/Emacs.base/Resources): Update contents. + 2012-09-15 Paul Eggert Port better to POSIX hosts lacking _setjmp (Bug#12446). diff --git a/Makefile.in b/Makefile.in index 6ed32491a66..9bb85967930 100644 --- a/Makefile.in +++ b/Makefile.in @@ -737,6 +737,7 @@ clean: FRC -(cd doc/lispref && $(MAKE) $(MFLAGS) clean) -(cd doc/lispintro && $(MAKE) $(MFLAGS) clean) (cd leim; $(MAKE) $(MFLAGS) clean) + (cd nextstep && $(MAKE) $(MFLAGS) clean) ### `bootclean' ### Delete all files that need to be remade for a clean bootstrap. @@ -763,6 +764,7 @@ distclean: FRC (cd doc/lispintro && $(MAKE) $(MFLAGS) distclean) (cd leim; $(MAKE) $(MFLAGS) distclean) (cd lisp; $(MAKE) $(MFLAGS) distclean) + (cd nextstep && $(MAKE) $(MFLAGS) distclean) ${top_distclean} ### `bootstrap-clean' @@ -780,6 +782,7 @@ bootstrap-clean: FRC -(cd doc/lispintro && $(MAKE) $(MFLAGS) maintainer-clean) (cd leim; $(MAKE) $(MFLAGS) maintainer-clean) (cd lisp; $(MAKE) $(MFLAGS) bootstrap-clean) + (cd nextstep && $(MAKE) $(MFLAGS) maintainer-clean) [ ! -f config.log ] || mv -f config.log config.log~ ${top_bootclean} diff --git a/admin/ChangeLog b/admin/ChangeLog index 25eed8af5e3..27765a078f6 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,8 @@ +2012-09-16 Glenn Morris + + * admin.el (set-version): No more need to set nextstep versions. + (set-copyright): Update for moved nextstep files. + 2012-09-13 Paul Eggert Simplify SIGIO usage (Bug#12408). diff --git a/admin/admin.el b/admin/admin.el index 6d729214bd0..b076bb67dd1 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -126,39 +126,7 @@ Root must be the root of an Emacs source tree." (set-version-in-file root "nt/emacsclient.rc" comma-space-version (rx (and "\"ProductVersion\"" (0+ space) ?, (0+ space) ?\" (submatch (1+ (in "0-9, "))) - "\\0\"")))) - ;; nextstep. - (set-version-in-file - root "nextstep/Cocoa/Emacs.base/Contents/Info.plist" - version (rx (and "CFBundleGetInfoString" (1+ anything) "Emacs" (1+ space) - (submatch (1+ (in "0-9.")))))) - (set-version-in-file - root "nextstep/Cocoa/Emacs.base/Contents/Info.plist" - version (rx (and "CFBundleShortVersionString" (1+ not-newline) ?\n - (0+ not-newline) "" (0+ space) - (submatch (1+ (in "0-9.")))))) - (set-version-in-file - root "nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings" - version (rx (and "CFBundleShortVersionString" (0+ space) ?= (0+ space) - ?\" (0+ space) "Version" (1+ space) - (submatch (1+ (in "0-9.")))))) - (set-version-in-file - root "nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings" - version (rx (and "CFBundleGetInfoString" (0+ space) ?= (0+ space) - ?\" (0+ space) "Emacs version" (1+ space) - (submatch (1+ (in "0-9.")))))) - (set-version-in-file - root "nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist" - version (rx (and "ApplicationRelease" (0+ space) ?= (0+ space) - ?\" (0+ space) (submatch (1+ (in "0-9.")))))) - (set-version-in-file - root "nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist" - version (rx (and "FullVersionID" (0+ space) ?= (0+ space) - ?\" (0+ space) "Emacs" (1+ space) - (submatch (1+ (in "0-9.")))))) - (set-version-in-file - root "nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop" - version (rx (and "Version=" (submatch (1+ (in "0-9."))))))) + "\\0\""))))) ;; Note this makes some assumptions about form of short copyright. (defun set-copyright (root copyright) @@ -188,16 +156,16 @@ Root must be the root of an Emacs source tree." (string-match "\\(.*[0-9]\\{4\\} *\\)\\(.*\\)" copyright) ;; nextstep. (set-version-in-file - root "nextstep/Cocoa/Emacs.base/Contents/Info.plist" + root "nextstep/templates/Info.plist.in" copyright (rx (and "CFBundleGetInfoString" (1+ anything) "Emacs" (1+ space) (1+ (in "0-9.")) (1+ space) (submatch (1+ (not (in ?\<))))))) (set-version-in-file - root "nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings" + root "nextstep/templates/InfoPlist.strings.in" copyright (rx (and "NSHumanReadableCopyright" (0+ space) ?\= (0+ space) ?\" (submatch (1+ (not (in ?\"))))))) (set-version-in-file - root "nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist" + root "nextstep/templates/Info-gnustep.plist.in" copyright (rx (and "Copyright" (0+ space) ?\= (0+ space) ?\" (submatch (1+ (not (in ?\"))))))) (when (string-match "\\([0-9]\\{4\\}\\)" copyright) diff --git a/configure.ac b/configure.ac index f810c839587..38a7613d84a 100644 --- a/configure.ac +++ b/configure.ac @@ -1461,13 +1461,13 @@ if test "${with_ns}" != no; then ns_appdir=`pwd`/nextstep/Emacs.app ns_appbindir=${ns_appdir}/Contents/MacOS ns_appresdir=${ns_appdir}/Contents/Resources - ns_appsrc=${srcdir}/nextstep/Cocoa/Emacs.base + ns_appsrc=Cocoa/Emacs.base elif test -f $GNUSTEP_CONFIG_FILE; then NS_IMPL_GNUSTEP=yes ns_appdir=`pwd`/nextstep/Emacs.app ns_appbindir=${ns_appdir} ns_appresdir=${ns_appdir}/Resources - ns_appsrc=${srcdir}/nextstep/GNUstep/Emacs.base + ns_appsrc=GNUstep/Emacs.base dnl FIXME sourcing this several times in subshells seems inefficient. GNUSTEP_SYSTEM_HEADERS="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_HEADERS)" GNUSTEP_SYSTEM_LIBRARIES="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_LIBRARIES)" @@ -1521,7 +1521,6 @@ AC_SUBST(TEMACS_LDFLAGS2) INSTALL_ARCH_INDEP_EXTRA=install-etc ns_self_contained=no -ns_frag=/dev/null NS_OBJ= NS_OBJC_OBJ= if test "${HAVE_NS}" = yes; then @@ -1548,7 +1547,6 @@ if test "${HAVE_NS}" = yes; then leimdir="\${ns_appresdir}/leim" INSTALL_ARCH_INDEP_EXTRA= fi - ns_frag=$srcdir/src/ns.mk NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o" fi CFLAGS="$tmp_CFLAGS" @@ -1558,7 +1556,6 @@ AC_SUBST(ns_self_contained) AC_SUBST(NS_OBJ) AC_SUBST(NS_OBJC_OBJ) AC_SUBST(LIB_STANDARD) -AC_SUBST_FILE(ns_frag) ## $window_system is now set to the window system we will ## ultimately use. @@ -4484,6 +4481,16 @@ fi test "${exec_prefix}" != NONE && exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`] +if test "$HAVE_NS" = "yes"; then + if test "$NS_IMPL_GNUSTEP" = yes; then + AC_CONFIG_FILES([nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist:nextstep/templates/Info-gnustep.plist.in \ + nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop:nextstep/templates/Emacs.desktop.in]) + else + AC_CONFIG_FILES([nextstep/Cocoa/Emacs.base/Contents/Info.plist:nextstep/templates/Info.plist.in \ + nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings:nextstep/templates/InfoPlist.strings.in]) + fi +fi + dnl Obviously there is duplication here wrt $SUBDIR_MAKEFILES. dnl You _can_ use that variable in AC_CONFIG_FILES, so long as any directory dnl using automake (ie lib/) is explicitly listed and not "hidden" in a variable @@ -4492,12 +4499,12 @@ dnl This will work, but you get a config.status that is not quite right dnl (see http://lists.gnu.org/archive/html/bug-autoconf/2008-08/msg00028.html). dnl That doesn't have any obvious consequences for Emacs, but on the whole dnl it seems better to just live with the duplication. -SUBDIR_MAKEFILES="lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile" +SUBDIR_MAKEFILES="lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile nextstep/Makefile" AC_CONFIG_FILES([Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile \ doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \ doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile \ - leim/Makefile]) + leim/Makefile nextstep/Makefile]) dnl test/ is not present in release tarfiles. opt_makefile=test/automated/Makefile diff --git a/make-dist b/make-dist index 28d2ec15214..0432d9c9e5f 100755 --- a/make-dist +++ b/make-dist @@ -287,10 +287,10 @@ for subdir in site-lisp \ `find etc lisp admin -type d` \ doc doc/emacs doc/misc doc/man doc/lispref doc/lispintro \ info m4 msdos \ - nextstep nextstep/Cocoa nextstep/Cocoa/Emacs.base \ + nextstep nextstep/templates \ + nextstep/Cocoa nextstep/Cocoa/Emacs.base \ nextstep/Cocoa/Emacs.base/Contents \ nextstep/Cocoa/Emacs.base/Contents/Resources \ - nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj \ nextstep/GNUstep \ nextstep/GNUstep/Emacs.base \ nextstep/GNUstep/Emacs.base/Resources @@ -406,21 +406,21 @@ echo "Making links to \`nextstep'" (cd nextstep ln ChangeLog README INSTALL ../${tempdir}/nextstep) +echo "Making links to \`nextstep/templates'" +(cd nextstep/templates + ln Emacs.desktop.in Info-gnustep.plist.in Info.plist.in InfoPlist.strings.in../../${tempdir}/nextstep/templates) + echo "Making links to \`nextstep/Cocoa/Emacs.base/Contents'" (cd nextstep/Cocoa/Emacs.base/Contents - ln Info.plist PkgInfo ../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents) + ln PkgInfo ../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents) echo "Making links to \`nextstep/Cocoa/Emacs.base/Contents/Resources'" (cd nextstep/Cocoa/Emacs.base/Contents/Resources ln Credits.html *.icns ../../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents/Resources) -echo "Making links to \`nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj'" -(cd nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj - ln InfoPlist.strings ../../../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj) - echo "Making links to \`nextstep/GNUstep/Emacs.base/Resources'" (cd nextstep/GNUstep/Emacs.base/Resources - ln Emacs.desktop Info-gnustep.plist README emacs.tiff ../../../../${tempdir}/nextstep/GNUstep/Emacs.base/Resources ) + ln README emacs.tiff ../../../../${tempdir}/nextstep/GNUstep/Emacs.base/Resources ) echo "Making links to \`oldXMenu'" (cd oldXMenu diff --git a/nextstep/ChangeLog b/nextstep/ChangeLog index 6451f7a7322..be73bc1f168 100644 --- a/nextstep/ChangeLog +++ b/nextstep/ChangeLog @@ -1,3 +1,17 @@ +2012-09-16 Glenn Morris + + * Makefile.in: New file. + * templates: New directory. + * templates/Emacs.desktop.in, templates/Info-gnustep.plist.in: + * templates/Info.plist.in, templates/InfoPlist.strings.in: + Move here from various Cocoa/, GNUstep/ locations. + Let configure set the version number. + * Cocoa/Emacs.base/Contents/Info.plist: + * Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings: + * GNUstep/Emacs.base/Resources/Info-gnustep.plist: + * GNUstep/Emacs.base/Resources/Emacs.desktop: Move to templates/. + * Cocoa/Emacs.base/Contents/Resources/English.lproj: Remove directory. + 2012-04-07 Glenn Morris * Cocoa/Emacs.base/Contents/Info.plist: diff --git a/nextstep/Makefile.in b/nextstep/Makefile.in new file mode 100644 index 00000000000..8efb2b23043 --- /dev/null +++ b/nextstep/Makefile.in @@ -0,0 +1,68 @@ +### nextstep/Makefile for GNU Emacs + +## Copyright (C) 2012 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 . + +### Commentary: + +### Code: +SHELL = /bin/sh + +srcdir = @srcdir@ +EXEEXT = @EXEEXT@ + +@SET_MAKE@ +MKDIR_P = @MKDIR_P@ + +ns_appdir = @ns_appdir@ +ns_appbindir = @ns_appbindir@ +ns_appsrc = @ns_appsrc@ + +${ns_appdir}: ${srcdir}/${ns_appsrc} ${ns_appsrc} + rm -rf ${ns_appdir} + ${MKDIR_P} ${ns_appdir} + ( cd ${srcdir}/${ns_appsrc} ; tar cfh - . ) | \ + ( cd ${ns_appdir} ; umask 022; tar xf - ) + [ `cd ${srcdir} && /bin/pwd` = `/bin/pwd` ] || \ + ( cd ${ns_appsrc} ; tar cfh - . ) | \ + ( cd ${ns_appdir} ; umask 022; tar xf - ) + +${ns_appbindir}/Emacs: ${ns_appdir} ../src/emacs${EXEEXT} + ${MKDIR_P} ${ns_appbindir} + cp -f ../src/emacs${EXEEXT} ${ns_appbindir}/Emacs + +.PHONY: all + +all: ${ns_appdir} ${ns_appbindir}/Emacs + + +.PHONY: clean distclean maintainer-clean + +clean: + rm -rf ${ns_appdir} + +distclean: clean + rm -f Makefile + rm -f GNUstep/Emacs.base/Resources/Info-gnustep.plist \ + GNUstep/Emacs.base/Resources/Emacs.desktop \ + Cocoa/Emacs.base/Contents/Info.plist \ + Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings + [ `cd ${srcdir} && /bin/pwd` = `/bin/pwd` ] || rm -rf ${ns_appsrc} + +maintainer-clean: distclean + +### Makefile.in ends here diff --git a/nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop b/nextstep/templates/Emacs.desktop.in similarity index 92% rename from nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop rename to nextstep/templates/Emacs.desktop.in index a36eafaadb0..170f195f270 100644 --- a/nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop +++ b/nextstep/templates/Emacs.desktop.in @@ -1,7 +1,7 @@ [Desktop Entry] Encoding=UTF-8 Type=Application -Version=24.2.50 +Version=@version@ Categories=GNUstep Name=Emacs Comment=GNU Emacs for NeXT/Open/GNUstep and OS X diff --git a/nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist b/nextstep/templates/Info-gnustep.plist.in similarity index 96% rename from nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist rename to nextstep/templates/Info-gnustep.plist.in index 6cde01b0d05..6da5af489fb 100644 --- a/nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist +++ b/nextstep/templates/Info-gnustep.plist.in @@ -2,7 +2,7 @@ ApplicationDescription = "GNU Emacs for GNUstep / OS X"; ApplicationIcon = emacs.tiff; ApplicationName = Emacs; - ApplicationRelease = "24.2.50"; + ApplicationRelease = "@version@"; Authors = ( "Adrian Robert (GNUstep)", "Christophe de Dinechin (MacOS X)", @@ -13,7 +13,7 @@ ); Copyright = "Copyright (C) 2012 Free Software Foundation, Inc."; CopyrightDescription = "Released under the GNU General Public License Version 3 or later"; - FullVersionID = "Emacs 24.2.50, NS Windowing"; + FullVersionID = "Emacs @version@, NS Windowing"; NSExecutable = Emacs; NSIcon = emacs.tiff; NSPrincipalClass = NSApplication; diff --git a/nextstep/Cocoa/Emacs.base/Contents/Info.plist b/nextstep/templates/Info.plist.in similarity index 99% rename from nextstep/Cocoa/Emacs.base/Contents/Info.plist rename to nextstep/templates/Info.plist.in index f5490f613fd..df9708eae71 100644 --- a/nextstep/Cocoa/Emacs.base/Contents/Info.plist +++ b/nextstep/templates/Info.plist.in @@ -553,7 +553,7 @@ along with GNU Emacs. If not, see . CFBundleExecutable Emacs CFBundleGetInfoString - Emacs 24.2.50 Copyright (C) 2012 Free Software Foundation, Inc. + Emacs @version@ Copyright (C) 2012 Free Software Foundation, Inc. CFBundleIconFile Emacs.icns CFBundleIdentifier @@ -566,7 +566,7 @@ along with GNU Emacs. If not, see . APPL CFBundleShortVersionString - 24.2.50 + @version@ CFBundleSignature EMAx diff --git a/nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings b/nextstep/templates/InfoPlist.strings.in similarity index 56% rename from nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings rename to nextstep/templates/InfoPlist.strings.in index 7655c0ca8ec..ce9779c7ac8 100644 --- a/nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings +++ b/nextstep/templates/InfoPlist.strings.in @@ -1,6 +1,6 @@ /* Localized versions of Info.plist keys */ CFBundleName = "Emacs"; -CFBundleShortVersionString = "Version 24.2.50"; -CFBundleGetInfoString = "Emacs version 24.2.50, NS Windowing"; +CFBundleShortVersionString = "Version @version@"; +CFBundleGetInfoString = "Emacs version @version@, NS Windowing"; NSHumanReadableCopyright = "Copyright (C) 2012 Free Software Foundation, Inc."; diff --git a/src/ChangeLog b/src/ChangeLog index be734134adf..e322406a0e6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,4 +1,12 @@ -2012-09-17 Kenichi Handa +2012-09-16 Glenn Morris + + * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables. + (ns_frag): Remove. + (ns-app): Move here from ns.mk, and simplify. + (clean): Simplify nextstep entry. + * ns.mk: Remove file. + +2012-09-16 Kenichi Handa * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may not covert the last few charactes. diff --git a/src/Makefile.in b/src/Makefile.in index fe4cff5d8cc..5c16b93803e 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -255,9 +255,6 @@ MSDOS_OBJ = ## w16select.o termcap.o if MSDOS && HAVE_X_WINDOWS. MSDOS_X_OBJ = -ns_appdir=@ns_appdir@ -ns_appbindir=@ns_appbindir@ -ns_appsrc=@ns_appsrc@ NS_OBJ=@NS_OBJ@ ## nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o if HAVE_NS. NS_OBJC_OBJ=@NS_OBJC_OBJ@ @@ -501,8 +498,9 @@ $(OLDXMENU): $(OLDXMENU_TARGET) doc.o: buildobj.h -## If HAVE_NS, some ns-specific rules (for OTHER_FILES) are inserted here. -@ns_frag@ +ns-app: emacs$(EXEEXT) + cd ../nextstep && $(MAKE) $(MFLAGS) all + .PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean .PHONY: versionclean extraclean frc @@ -516,7 +514,7 @@ mostlyclean: clean: mostlyclean rm -f emacs-*.*.*$(EXEEXT) emacs$(EXEEXT) -rm -rf $(DEPDIR) - test "X$(ns_appdir)" = "X" || rm -rf $(ns_appdir) + -cd ../nextstep && $(MAKE) $(MFLAGS) clean ## bootstrap-clean is used to clean up just before a bootstrap. ## It should remove all files generated during a compilation/bootstrap, diff --git a/src/ns.mk b/src/ns.mk deleted file mode 100644 index 77fbf5845d9..00000000000 --- a/src/ns.mk +++ /dev/null @@ -1,39 +0,0 @@ -### autodeps.mk --- src/Makefile fragment for GNU Emacs - -## Copyright (C) 2008-2012 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 . - -### Commentary: - -## This is inserted in src/Makefile if HAVE_NS. - -## The only reason this is in a separate file is because $ns_appdir, -## which appears as a target, is empty on non-NS builds. Some makes -## do not like empty targets, even if they are never used. - -${ns_appdir}: ${ns_appsrc} - rm -fr ${ns_appdir} - ${MKDIR_P} ${ns_appdir} - ( cd ${ns_appsrc} ; tar cfh - . ) | ( cd ${ns_appdir} ; umask 022; tar xf - ) - -${ns_appbindir}/Emacs: emacs${EXEEXT} - ${MKDIR_P} ${ns_appbindir} - cp -f emacs${EXEEXT} ${ns_appbindir}/Emacs - -ns-app: ${ns_appdir} ${ns_appbindir}/Emacs - -### ns.mk ends here From 92f7c6f1a320701a5e15d8a3f28e08d1889c81bc Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 16 Sep 2012 11:51:39 -0700 Subject: [PATCH 54/88] Add missing nextstep file from previous change. --- ChangeLog | 2 +- make-dist | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ab7864578b3..5dadc44ebd7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,7 +11,7 @@ * make-dist (nextstep/templates): Add directory. (nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj): Remove. (nextstep/Cocoa/Emacs.base/Contents) - (nextstep/GNUstep/Emacs.base/Resources): Update contents. + (nextstep, nextstep/GNUstep/Emacs.base/Resources): Update contents. 2012-09-15 Paul Eggert diff --git a/make-dist b/make-dist index 0432d9c9e5f..3b2d79e56bc 100755 --- a/make-dist +++ b/make-dist @@ -404,7 +404,7 @@ echo "Making links to \`msdos'" echo "Making links to \`nextstep'" (cd nextstep - ln ChangeLog README INSTALL ../${tempdir}/nextstep) + ln ChangeLog README INSTALL Makefile.in ../${tempdir}/nextstep) echo "Making links to \`nextstep/templates'" (cd nextstep/templates From 164b9bf3ef04371d24bc34ffdbe8800bdcff1f1e Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 16 Sep 2012 11:56:10 -0700 Subject: [PATCH 55/88] (distclean): Remove unnecessary directory deletion. --- nextstep/Makefile.in | 1 - 1 file changed, 1 deletion(-) diff --git a/nextstep/Makefile.in b/nextstep/Makefile.in index 8efb2b23043..27ec5d1556b 100644 --- a/nextstep/Makefile.in +++ b/nextstep/Makefile.in @@ -61,7 +61,6 @@ distclean: clean GNUstep/Emacs.base/Resources/Emacs.desktop \ Cocoa/Emacs.base/Contents/Info.plist \ Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings - [ `cd ${srcdir} && /bin/pwd` = `/bin/pwd` ] || rm -rf ${ns_appsrc} maintainer-clean: distclean From 518650a581ac8716801ae17cc39d83db672ffa2a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 16 Sep 2012 12:17:20 -0700 Subject: [PATCH 56/88] * src/Makefile.in (clean): No longer run nextstep's clean. --- src/ChangeLog | 2 ++ src/Makefile.in | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index e322406a0e6..99921577b07 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2012-09-16 Glenn Morris + * Makefile.in (clean): No longer run nextstep's clean. + * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables. (ns_frag): Remove. (ns-app): Move here from ns.mk, and simplify. diff --git a/src/Makefile.in b/src/Makefile.in index 5c16b93803e..37da170edbd 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -514,7 +514,6 @@ mostlyclean: clean: mostlyclean rm -f emacs-*.*.*$(EXEEXT) emacs$(EXEEXT) -rm -rf $(DEPDIR) - -cd ../nextstep && $(MAKE) $(MFLAGS) clean ## bootstrap-clean is used to clean up just before a bootstrap. ## It should remove all files generated during a compilation/bootstrap, From 634b8cacd6cc0557c1963ad7409db247963046d2 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 16 Sep 2012 14:18:00 -0700 Subject: [PATCH 57/88] * font.c (Ffont_shape_gstring): Remove unused local. --- src/ChangeLog | 4 ++++ src/font.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 99921577b07..32cd7b3e813 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-09-16 Paul Eggert + + * font.c (Ffont_shape_gstring): Remove unused local. + 2012-09-16 Glenn Morris * Makefile.in (clean): No longer run nextstep's clean. diff --git a/src/font.c b/src/font.c index fc970254a62..1f22fee88ee 100644 --- a/src/font.c +++ b/src/font.c @@ -4303,7 +4303,7 @@ GSTRING. */) { struct font *font; Lisp_Object font_object, n, glyph; - ptrdiff_t i, j, from, to; + ptrdiff_t i, from, to; if (! composition_gstring_p (gstring)) signal_error ("Invalid glyph-string: ", gstring); From 0caaedb1c3c9c48980144e41d2a95329d39c399a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 16 Sep 2012 14:43:55 -0700 Subject: [PATCH 58/88] Remove configure's --without-sync-input option. When auditing signal-handling in preparation for cleaning it up, I found that SYNC_INPUT has race conditions and would be a real pain to fix. Since it's an undocumented and deprecated configure-time option, now seems like a good time to remove it. Also see . * configure.ac (SYNC_INPUT, BROKEN_SA_RESTART): Remove. * admin/CPP-DEFINES (BROKEN_SA_RESTART, SA_RESTART): Remove. * etc/TODO (Make SYNC_INPUT the default): Remove, as the code now behaves as if SYNC_INPUT is always true. * src/alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal) (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls. (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]: (malloc_hysteresis): (check_depth) [XMALLOC_OVERRUN_CHECK]: (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED) (dont_register_blocks, bytes_used_when_reconsidered) (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc) (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc): [!SYSTEM_MALLOC && !SYNC_INPUT]: Remove. All uses removed. (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different implementation, one that depends on whether the new macro XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT is defined. * src/atimer.c (run_timers, handle_alarm_signal): * src/keyboard.c (pending_signal, poll_for_input_1, poll_for_input) (handle_async_input, process_pending_signals) (handle_input_available_signal, init_keyboard): * src/nsterm.m (ns_read_socket): * src/process.c (wait_reading_process_output): * src/regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK): * src/sysdep.c (emacs_sigaction_init) [SA_RESTART]: (emacs_write): * src/xterm.c (XTread_socket): Assume SYNC_INPUT. * src/conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef. * src/eval.c (handling_signal): Remove. All uses removed. * src/lisp.h (ELSE_PENDING_SIGNALS): Remove. All uses replaced with the SYNC_INPUT version. (reset_malloc_hooks, uninterrupt_malloc, handling_signal): Remove decls. * src/sysdep.c, src/syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Now static. Fixes: debbugs:12450 --- ChangeLog | 5 + admin/CPP-DEFINES | 2 - admin/ChangeLog | 5 + configure.ac | 10 -- etc/ChangeLog | 6 + etc/TODO | 7 - src/ChangeLog | 42 +++++ src/alloc.c | 424 ++++------------------------------------------ src/atimer.c | 9 - src/bytecode.c | 3 +- src/conf_post.h | 1 - src/emacs.c | 12 +- src/eval.c | 16 +- src/intervals.c | 3 +- src/keyboard.c | 37 +--- src/lisp.h | 13 +- src/nsmenu.m | 5 +- src/nsterm.m | 9 +- src/process.c | 2 - src/regex.c | 6 +- src/sysdep.c | 18 +- src/syssignal.h | 4 - src/xdisp.c | 6 - src/xterm.c | 12 -- 24 files changed, 113 insertions(+), 544 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5dadc44ebd7..4bdca0c914a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-09-16 Paul Eggert + + Remove configure's --without-sync-input option (Bug#12450). + * configure.ac (SYNC_INPUT, BROKEN_SA_RESTART): Remove. + 2012-09-16 Glenn Morris Increase compartmentalization of Nextstep builds rules, diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES index 834695d6c78..661cde9c43e 100644 --- a/admin/CPP-DEFINES +++ b/admin/CPP-DEFINES @@ -90,7 +90,6 @@ BROKEN_GETWD BROKEN_GET_CURRENT_DIR_NAME BROKEN_NON_BLOCKING_CONNECT BROKEN_PTY_READ_AFTER_EAGAIN -BROKEN_SA_RESTART CLASH_DETECTION DATA_SEG_BITS DATA_START @@ -434,7 +433,6 @@ PTY_OPEN PTY_TTY_NAME_SPRINTF PURESIZE RUN_TIME_REMAP -SA_RESTART SETPGRP_RELEASES_CTTY SETUP_SLAVE_PTY SIGALRM diff --git a/admin/ChangeLog b/admin/ChangeLog index 27765a078f6..8fe16b9e766 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,8 @@ +2012-09-16 Paul Eggert + + Remove configure's --without-sync-input option (Bug#12450). + * CPP-DEFINES (BROKEN_SA_RESTART, SA_RESTART): Remove. + 2012-09-16 Glenn Morris * admin.el (set-version): No more need to set nextstep versions. diff --git a/configure.ac b/configure.ac index 38a7613d84a..569b367371a 100644 --- a/configure.ac +++ b/configure.ac @@ -128,11 +128,6 @@ AC_ARG_WITH([mailhost],[AS_HELP_STRING([--with-mailhost=HOSTNAME], OPTION_DEFAULT_ON([sound],[don't compile with sound support]) -OPTION_DEFAULT_ON([sync-input],[don't process async input synchronously]) -if test "$with_sync_input" = yes; then - AC_DEFINE(SYNC_INPUT, 1, [Process async input synchronously.]) -fi - dnl FIXME currently it is not the last. dnl This should be the last --with option, because --with-x is dnl added later on when we find the path of X, and it's best to @@ -3949,11 +3944,6 @@ case $opsys in ;; hpux11) - dnl See comments in sysdep.c:sys_signal. - dnl SA_RESTART resets the timeout of `select' on hpux11. - dnl Defining BROKEN_SA_RESTART is not the same as undef'ing SA_RESTART. - AC_DEFINE(BROKEN_SA_RESTART, 1, [Define if SA_RESTART should only - be used in batch mode.]) dnl It works to open the pty's tty in the parent (Emacs), then dnl close and reopen it in the child. AC_DEFINE(USG_SUBTTY_WORKS, 1, [Define for USG systems where it diff --git a/etc/ChangeLog b/etc/ChangeLog index 66c229eaf78..5a14c523cf3 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,9 @@ +2012-09-16 Paul Eggert + + Remove configure's --without-sync-input option (Bug#12450). + * TODO (Make SYNC_INPUT the default): Remove, as the code now + behaves as if SYNC_INPUT is always true. + 2012-09-13 Paul Eggert Use a more backwards-compatible timer format (Bug#12430). diff --git a/etc/TODO b/etc/TODO index 50e3bd64b9d..be0ef95aed2 100644 --- a/etc/TODO +++ b/etc/TODO @@ -1229,13 +1229,6 @@ systems for HTML/XML files automatically." For use by sml-mode, python-mode, tex-mode, scheme-mode, lisp-mode, haskell-mode, tuareg-mode, ... -** Make SYNC_INPUT the default. [true since 2008-03-11] - All loops using immediate_quit need to be checked to ensure that - C-g can interrupt them, in case of an infinite loop. Once we - switch to using SYNC_INPUT, we can remove the BLOCK_INPUTs in the - allocation functions (allocate_string etc.) without worrying about - data munging. - ** Add "link" button class Add a standard button-class named "link", and make all other link-like button classes inherit from it. Set the default face of the "link" button diff --git a/src/ChangeLog b/src/ChangeLog index 32cd7b3e813..f21395d9632 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,47 @@ 2012-09-16 Paul Eggert + Remove configure's --without-sync-input option (Bug#12450). + When auditing signal-handling in preparation for cleaning it up, + I found that SYNC_INPUT has race conditions and would be a real + pain to fix. Since it's an undocumented and deprecated + configure-time option, now seems like a good time to remove it. + Also see . + * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal) + (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls. + (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]: + (malloc_hysteresis): + (check_depth) [XMALLOC_OVERRUN_CHECK]: + (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): + (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED) + (dont_register_blocks, bytes_used_when_reconsidered) + (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc) + (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc): + [!SYSTEM_MALLOC && !SYNC_INPUT]: + Remove. All uses removed. + (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different + implementation, one that depends on whether the new macro + XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT + is defined. + * atimer.c (run_timers, handle_alarm_signal): + * keyboard.c (pending_signal, poll_for_input_1, poll_for_input) + (handle_async_input, process_pending_signals) + (handle_input_available_signal, init_keyboard): + * nsterm.m (ns_read_socket): + * process.c (wait_reading_process_output): + * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK): + * sysdep.c (emacs_sigaction_init) [SA_RESTART]: + (emacs_write): + * xterm.c (XTread_socket): + Assume SYNC_INPUT. + * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef. + * eval.c (handling_signal): Remove. All uses removed. + * lisp.h (ELSE_PENDING_SIGNALS): Remove. + All uses replaced with the SYNC_INPUT version. + (reset_malloc_hooks, uninterrupt_malloc, handling_signal): + Remove decls. + * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]: + Now static. + * font.c (Ffont_shape_gstring): Remove unused local. 2012-09-16 Glenn Morris diff --git a/src/alloc.c b/src/alloc.c index 0bfbb0c88b1..fb7d35b5590 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -85,68 +85,8 @@ extern void *sbrk (); #define MMAP_MAX_AREAS 100000000 -#else /* not DOUG_LEA_MALLOC */ - -/* The following come from gmalloc.c. */ - -extern size_t _bytes_used; -extern size_t __malloc_extra_blocks; -extern void *_malloc_internal (size_t); -extern void _free_internal (void *); - #endif /* not DOUG_LEA_MALLOC */ -#if ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT -#ifdef HAVE_PTHREAD - -# include "syssignal.h" - -/* When GTK uses the file chooser dialog, different backends can be loaded - dynamically. One such a backend is the Gnome VFS backend that gets loaded - if you run Gnome. That backend creates several threads and also allocates - memory with malloc. - - Also, gconf and gsettings may create several threads. - - If Emacs sets malloc hooks (! SYSTEM_MALLOC) and the emacs_blocked_* - functions below are called from malloc, there is a chance that one - of these threads preempts the Emacs main thread and the hook variables - end up in an inconsistent state. So we have a mutex to prevent that (note - that the backend handles concurrent access to malloc within its own threads - but Emacs code running in the main thread is not included in that control). - - When UNBLOCK_INPUT is called, reinvoke_input_signal may be called. If this - happens in one of the backend threads we will have two threads that tries - to run Emacs code at once, and the code is not prepared for that. - To prevent that, we only call BLOCK/UNBLOCK from the main thread. */ - -static pthread_mutex_t alloc_mutex; - -#define BLOCK_INPUT_ALLOC \ - do \ - { \ - if (pthread_equal (pthread_self (), main_thread)) \ - BLOCK_INPUT; \ - pthread_mutex_lock (&alloc_mutex); \ - } \ - while (0) -#define UNBLOCK_INPUT_ALLOC \ - do \ - { \ - pthread_mutex_unlock (&alloc_mutex); \ - if (pthread_equal (pthread_self (), main_thread)) \ - UNBLOCK_INPUT; \ - } \ - while (0) - -#else /* ! defined HAVE_PTHREAD */ - -#define BLOCK_INPUT_ALLOC BLOCK_INPUT -#define UNBLOCK_INPUT_ALLOC UNBLOCK_INPUT - -#endif /* ! defined HAVE_PTHREAD */ -#endif /* ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT */ - /* Mark, unmark, query mark bit of a Lisp string. S must be a pointer to a struct Lisp_String. */ @@ -205,10 +145,6 @@ static char *spare_memory[7]; #define SPARE_MEMORY (1 << 14) -/* Number of extra blocks malloc should get when it needs more core. */ - -static int malloc_hysteresis; - /* Initialize it to a nonzero value to force it into data space (rather than bss space). That way unexec will remap it into text space (pure), on some systems. We have not implemented the @@ -413,12 +349,12 @@ static void mark_memory (void *, void *); static void mem_init (void); static struct mem_node *mem_insert (void *, void *, enum mem_type); static void mem_insert_fixup (struct mem_node *); -#endif static void mem_rotate_left (struct mem_node *); static void mem_rotate_right (struct mem_node *); static void mem_delete (struct mem_node *); static void mem_delete_fixup (struct mem_node *); static inline struct mem_node *mem_find (void *); +#endif #if GC_MARK_STACK == GC_MARK_STACK_CHECK_GCPROS @@ -587,39 +523,17 @@ xmalloc_get_size (unsigned char *ptr) } -/* The call depth in overrun_check functions. For example, this might happen: - xmalloc() - overrun_check_malloc() - -> malloc -> (via hook)_-> emacs_blocked_malloc - -> overrun_check_malloc - call malloc (hooks are NULL, so real malloc is called). - malloc returns 10000. - add overhead, return 10016. - <- (back in overrun_check_malloc) - add overhead again, return 10032 - xmalloc returns 10032. - - (time passes). - - xfree(10032) - overrun_check_free(10032) - decrease overhead - free(10016) <- crash, because 10000 is the original pointer. */ - -static ptrdiff_t check_depth; - /* Like malloc, but wraps allocated block with header and trailer. */ static void * overrun_check_malloc (size_t size) { register unsigned char *val; - int overhead = ++check_depth == 1 ? XMALLOC_OVERRUN_CHECK_OVERHEAD : 0; - if (SIZE_MAX - overhead < size) + if (SIZE_MAX - XMALLOC_OVERRUN_CHECK_OVERHEAD < size) emacs_abort (); - val = malloc (size + overhead); - if (val && check_depth == 1) + val = malloc (size + XMALLOC_OVERRUN_CHECK_OVERHEAD); + if (val) { memcpy (val, xmalloc_overrun_check_header, XMALLOC_OVERRUN_CHECK_SIZE); val += XMALLOC_OVERRUN_CHECK_SIZE + XMALLOC_OVERRUN_SIZE_SIZE; @@ -627,7 +541,6 @@ overrun_check_malloc (size_t size) memcpy (val + size, xmalloc_overrun_check_trailer, XMALLOC_OVERRUN_CHECK_SIZE); } - --check_depth; return val; } @@ -639,12 +552,10 @@ static void * overrun_check_realloc (void *block, size_t size) { register unsigned char *val = (unsigned char *) block; - int overhead = ++check_depth == 1 ? XMALLOC_OVERRUN_CHECK_OVERHEAD : 0; - if (SIZE_MAX - overhead < size) + if (SIZE_MAX - XMALLOC_OVERRUN_CHECK_OVERHEAD < size) emacs_abort (); if (val - && check_depth == 1 && memcmp (xmalloc_overrun_check_header, val - XMALLOC_OVERRUN_CHECK_SIZE - XMALLOC_OVERRUN_SIZE_SIZE, XMALLOC_OVERRUN_CHECK_SIZE) == 0) @@ -658,9 +569,9 @@ overrun_check_realloc (void *block, size_t size) memset (val, 0, XMALLOC_OVERRUN_CHECK_SIZE + XMALLOC_OVERRUN_SIZE_SIZE); } - val = realloc (val, size + overhead); + val = realloc (val, size + XMALLOC_OVERRUN_CHECK_OVERHEAD); - if (val && check_depth == 1) + if (val) { memcpy (val, xmalloc_overrun_check_header, XMALLOC_OVERRUN_CHECK_SIZE); val += XMALLOC_OVERRUN_CHECK_SIZE + XMALLOC_OVERRUN_SIZE_SIZE; @@ -668,7 +579,6 @@ overrun_check_realloc (void *block, size_t size) memcpy (val + size, xmalloc_overrun_check_trailer, XMALLOC_OVERRUN_CHECK_SIZE); } - --check_depth; return val; } @@ -679,9 +589,7 @@ overrun_check_free (void *block) { unsigned char *val = (unsigned char *) block; - ++check_depth; if (val - && check_depth == 1 && memcmp (xmalloc_overrun_check_header, val - XMALLOC_OVERRUN_CHECK_SIZE - XMALLOC_OVERRUN_SIZE_SIZE, XMALLOC_OVERRUN_CHECK_SIZE) == 0) @@ -701,7 +609,6 @@ overrun_check_free (void *block) } free (val); - --check_depth; } #undef malloc @@ -712,14 +619,33 @@ overrun_check_free (void *block) #define free overrun_check_free #endif -#ifdef SYNC_INPUT -/* When using SYNC_INPUT, we don't call malloc from a signal handler, so - there's no need to block input around malloc. */ -#define MALLOC_BLOCK_INPUT ((void)0) -#define MALLOC_UNBLOCK_INPUT ((void)0) +/* If compiled with XMALLOC_BLOCK_INPUT_CHECK, define a symbol + BLOCK_INPUT_IN_MEMORY_ALLOCATORS that is visible to the debugger. + If that variable is set, block input while in one of Emacs's memory + allocation functions. There should be no need for this debugging + option, since signal handlers do not allocate memory, but Emacs + formerly allocated memory in signal handlers and this compile-time + option remains as a way to help debug the issue should it rear its + ugly head again. */ +#ifdef XMALLOC_BLOCK_INPUT_CHECK +bool block_input_in_memory_allocators EXTERNALLY_VISIBLE; +static void +malloc_block_input (void) +{ + if (block_input_in_memory_allocators) + BLOCK_INPUT; +} +static void +malloc_unblock_input (void) +{ + if (block_input_in_memory_allocators) + UNBLOCK_INPUT; +} +# define MALLOC_BLOCK_INPUT malloc_block_input () +# define MALLOC_UNBLOCK_INPUT malloc_unblock_input () #else -#define MALLOC_BLOCK_INPUT BLOCK_INPUT -#define MALLOC_UNBLOCK_INPUT UNBLOCK_INPUT +# define MALLOC_BLOCK_INPUT ((void) 0) +# define MALLOC_UNBLOCK_INPUT ((void) 0) #endif /* Like malloc but check for no memory and block interrupt input.. */ @@ -788,8 +714,7 @@ xfree (void *block) free (block); MALLOC_UNBLOCK_INPUT; /* We don't call refill_memory_reserve here - because that duplicates doing so in emacs_blocked_free - and the criterion should go there. */ + because in practice the call in r_alloc_free seems to suffice. */ } @@ -1215,256 +1140,6 @@ lisp_align_free (void *block) MALLOC_UNBLOCK_INPUT; } - -#ifndef SYSTEM_MALLOC - -/* Arranging to disable input signals while we're in malloc. - - This only works with GNU malloc. To help out systems which can't - use GNU malloc, all the calls to malloc, realloc, and free - elsewhere in the code should be inside a BLOCK_INPUT/UNBLOCK_INPUT - pair; unfortunately, we have no idea what C library functions - might call malloc, so we can't really protect them unless you're - using GNU malloc. Fortunately, most of the major operating systems - can use GNU malloc. */ - -#ifndef SYNC_INPUT -/* When using SYNC_INPUT, we don't call malloc from a signal handler, so - there's no need to block input around malloc. */ - -#ifndef DOUG_LEA_MALLOC -extern void * (*__malloc_hook) (size_t, const void *); -extern void * (*__realloc_hook) (void *, size_t, const void *); -extern void (*__free_hook) (void *, const void *); -/* Else declared in malloc.h, perhaps with an extra arg. */ -#endif /* DOUG_LEA_MALLOC */ -static void * (*old_malloc_hook) (size_t, const void *); -static void * (*old_realloc_hook) (void *, size_t, const void*); -static void (*old_free_hook) (void*, const void*); - -#ifdef DOUG_LEA_MALLOC -# define BYTES_USED (mallinfo ().uordblks) -#else -# define BYTES_USED _bytes_used -#endif - -#ifdef GC_MALLOC_CHECK -static bool dont_register_blocks; -#endif - -static size_t bytes_used_when_reconsidered; - -/* Value of _bytes_used, when spare_memory was freed. */ - -static size_t bytes_used_when_full; - -/* This function is used as the hook for free to call. */ - -static void -emacs_blocked_free (void *ptr, const void *ptr2) -{ - BLOCK_INPUT_ALLOC; - -#ifdef GC_MALLOC_CHECK - if (ptr) - { - struct mem_node *m; - - m = mem_find (ptr); - if (m == MEM_NIL || m->start != ptr) - { - fprintf (stderr, - "Freeing `%p' which wasn't allocated with malloc\n", ptr); - emacs_abort (); - } - else - { - /* fprintf (stderr, "free %p...%p (%p)\n", m->start, m->end, ptr); */ - mem_delete (m); - } - } -#endif /* GC_MALLOC_CHECK */ - - __free_hook = old_free_hook; - free (ptr); - - /* If we released our reserve (due to running out of memory), - and we have a fair amount free once again, - try to set aside another reserve in case we run out once more. */ - if (! NILP (Vmemory_full) - /* Verify there is enough space that even with the malloc - hysteresis this call won't run out again. - The code here is correct as long as SPARE_MEMORY - is substantially larger than the block size malloc uses. */ - && (bytes_used_when_full - > ((bytes_used_when_reconsidered = BYTES_USED) - + max (malloc_hysteresis, 4) * SPARE_MEMORY))) - refill_memory_reserve (); - - __free_hook = emacs_blocked_free; - UNBLOCK_INPUT_ALLOC; -} - - -/* This function is the malloc hook that Emacs uses. */ - -static void * -emacs_blocked_malloc (size_t size, const void *ptr) -{ - void *value; - - BLOCK_INPUT_ALLOC; - __malloc_hook = old_malloc_hook; -#ifdef DOUG_LEA_MALLOC - /* Segfaults on my system. --lorentey */ - /* mallopt (M_TOP_PAD, malloc_hysteresis * 4096); */ -#else - __malloc_extra_blocks = malloc_hysteresis; -#endif - - value = malloc (size); - -#ifdef GC_MALLOC_CHECK - { - struct mem_node *m = mem_find (value); - if (m != MEM_NIL) - { - fprintf (stderr, "Malloc returned %p which is already in use\n", - value); - fprintf (stderr, "Region in use is %p...%p, %td bytes, type %d\n", - m->start, m->end, (char *) m->end - (char *) m->start, - m->type); - emacs_abort (); - } - - if (!dont_register_blocks) - { - mem_insert (value, (char *) value + max (1, size), allocated_mem_type); - allocated_mem_type = MEM_TYPE_NON_LISP; - } - } -#endif /* GC_MALLOC_CHECK */ - - __malloc_hook = emacs_blocked_malloc; - UNBLOCK_INPUT_ALLOC; - - /* fprintf (stderr, "%p malloc\n", value); */ - return value; -} - - -/* This function is the realloc hook that Emacs uses. */ - -static void * -emacs_blocked_realloc (void *ptr, size_t size, const void *ptr2) -{ - void *value; - - BLOCK_INPUT_ALLOC; - __realloc_hook = old_realloc_hook; - -#ifdef GC_MALLOC_CHECK - if (ptr) - { - struct mem_node *m = mem_find (ptr); - if (m == MEM_NIL || m->start != ptr) - { - fprintf (stderr, - "Realloc of %p which wasn't allocated with malloc\n", - ptr); - emacs_abort (); - } - - mem_delete (m); - } - - /* fprintf (stderr, "%p -> realloc\n", ptr); */ - - /* Prevent malloc from registering blocks. */ - dont_register_blocks = 1; -#endif /* GC_MALLOC_CHECK */ - - value = realloc (ptr, size); - -#ifdef GC_MALLOC_CHECK - dont_register_blocks = 0; - - { - struct mem_node *m = mem_find (value); - if (m != MEM_NIL) - { - fprintf (stderr, "Realloc returns memory that is already in use\n"); - emacs_abort (); - } - - /* Can't handle zero size regions in the red-black tree. */ - mem_insert (value, (char *) value + max (size, 1), MEM_TYPE_NON_LISP); - } - - /* fprintf (stderr, "%p <- realloc\n", value); */ -#endif /* GC_MALLOC_CHECK */ - - __realloc_hook = emacs_blocked_realloc; - UNBLOCK_INPUT_ALLOC; - - return value; -} - - -#ifdef HAVE_PTHREAD -/* Called from Fdump_emacs so that when the dumped Emacs starts, it has a - normal malloc. Some thread implementations need this as they call - malloc before main. The pthread_self call in BLOCK_INPUT_ALLOC then - calls malloc because it is the first call, and we have an endless loop. */ - -void -reset_malloc_hooks (void) -{ - __free_hook = old_free_hook; - __malloc_hook = old_malloc_hook; - __realloc_hook = old_realloc_hook; -} -#endif /* HAVE_PTHREAD */ - - -/* Called from main to set up malloc to use our hooks. */ - -void -uninterrupt_malloc (void) -{ -#ifdef HAVE_PTHREAD -#ifdef DOUG_LEA_MALLOC - pthread_mutexattr_t attr; - - /* GLIBC has a faster way to do this, but let's keep it portable. - This is according to the Single UNIX Specification. */ - pthread_mutexattr_init (&attr); - pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE); - pthread_mutex_init (&alloc_mutex, &attr); -#else /* !DOUG_LEA_MALLOC */ - /* Some systems such as Solaris 2.6 don't have a recursive mutex, - and the bundled gmalloc.c doesn't require it. */ - pthread_mutex_init (&alloc_mutex, NULL); -#endif /* !DOUG_LEA_MALLOC */ -#endif /* HAVE_PTHREAD */ - - if (__free_hook != emacs_blocked_free) - old_free_hook = __free_hook; - __free_hook = emacs_blocked_free; - - if (__malloc_hook != emacs_blocked_malloc) - old_malloc_hook = __malloc_hook; - __malloc_hook = emacs_blocked_malloc; - - if (__realloc_hook != emacs_blocked_realloc) - old_realloc_hook = __realloc_hook; - __realloc_hook = emacs_blocked_realloc; -} - -#endif /* not SYNC_INPUT */ -#endif /* not SYSTEM_MALLOC */ - - /*********************************************************************** Interval Allocation @@ -1511,8 +1186,6 @@ make_interval (void) { INTERVAL val; - /* eassert (!handling_signal); */ - MALLOC_BLOCK_INPUT; if (interval_free_list) @@ -1896,8 +1569,6 @@ allocate_string (void) { struct Lisp_String *s; - /* eassert (!handling_signal); */ - MALLOC_BLOCK_INPUT; /* If the free-list is empty, allocate a new string_block, and @@ -2589,8 +2260,6 @@ make_float (double float_value) { register Lisp_Object val; - /* eassert (!handling_signal); */ - MALLOC_BLOCK_INPUT; if (float_free_list) @@ -2698,8 +2367,6 @@ DEFUN ("cons", Fcons, Scons, 2, 2, 0, { register Lisp_Object val; - /* eassert (!handling_signal); */ - MALLOC_BLOCK_INPUT; if (cons_free_list) @@ -3205,9 +2872,6 @@ allocate_vectorlike (ptrdiff_t len) MALLOC_BLOCK_INPUT; - /* This gets triggered by code which I haven't bothered to fix. --Stef */ - /* eassert (!handling_signal); */ - if (len == 0) p = XVECTOR (zero_vector); else @@ -3492,8 +3156,6 @@ Its value and function definition are void, and its property list is nil. */) CHECK_STRING (name); - /* eassert (!handling_signal); */ - MALLOC_BLOCK_INPUT; if (symbol_free_list) @@ -3578,8 +3240,6 @@ allocate_misc (enum Lisp_Misc_Type type) { Lisp_Object val; - /* eassert (!handling_signal); */ - MALLOC_BLOCK_INPUT; if (marker_free_list) @@ -3799,12 +3459,6 @@ memory_full (size_t nbytes) lisp_free (spare_memory[i]); spare_memory[i] = 0; } - - /* Record the space now used. When it decreases substantially, - we can refill the memory reserve. */ -#if !defined SYSTEM_MALLOC && !defined SYNC_INPUT - bytes_used_when_full = BYTES_USED; -#endif } /* This used to call error, but if we've run out of memory, we could @@ -3942,7 +3596,7 @@ mem_insert (void *start, void *end, enum mem_type type) /* Create a new node. */ #ifdef GC_MALLOC_CHECK - x = _malloc_internal (sizeof *x); + x = malloc (sizeof *x); if (x == NULL) emacs_abort (); #else @@ -4166,7 +3820,7 @@ mem_delete (struct mem_node *z) mem_delete_fixup (x); #ifdef GC_MALLOC_CHECK - _free_internal (y); + free (y); #else xfree (y); #endif @@ -6767,12 +6421,6 @@ init_alloc_once (void) init_strings (); init_vectors (); -#ifdef REL_ALLOC - malloc_hysteresis = 32; -#else - malloc_hysteresis = 0; -#endif - refill_memory_reserve (); gc_cons_threshold = GC_DEFAULT_THRESHOLD; } diff --git a/src/atimer.c b/src/atimer.c index 80b813fe4fe..5dbd807872a 100644 --- a/src/atimer.c +++ b/src/atimer.c @@ -369,7 +369,6 @@ run_timers (void) if (! atimers) pending_atimers = 0; -#ifdef SYNC_INPUT if (pending_atimers) pending_signals = 1; else @@ -377,10 +376,6 @@ run_timers (void) pending_signals = interrupt_input_pending; set_alarm (); } -#else - if (! pending_atimers) - set_alarm (); -#endif } @@ -391,11 +386,7 @@ static void handle_alarm_signal (int sig) { pending_atimers = 1; -#ifdef SYNC_INPUT pending_signals = 1; -#else - run_timers (); -#endif } static void diff --git a/src/bytecode.c b/src/bytecode.c index b151078f60f..5f4fdcc5eff 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -458,7 +458,8 @@ unmark_byte_stack (void) Fsignal (Qquit, Qnil); \ AFTER_POTENTIAL_GC (); \ } \ - ELSE_PENDING_SIGNALS \ + else if (pending_signals) \ + process_pending_signals (); \ } while (0) diff --git a/src/conf_post.h b/src/conf_post.h index 94934ffeadf..0c4d029bc5d 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -90,7 +90,6 @@ along with GNU Emacs. If not, see . */ char *_getpty(); #endif -#undef SA_RESTART /* not the same as defining BROKEN_SA_RESTART */ #endif /* IRIX6_5 */ #ifdef MSDOS diff --git a/src/emacs.c b/src/emacs.c index 1416bf76c43..233c0e68a14 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -848,14 +848,10 @@ main (int argc, char **argv) /* Arrange to get warning messages as memory fills up. */ memory_warnings (0, malloc_warning); - /* Call malloc at least once, to run the initial __malloc_hook. + /* Call malloc at least once, to run malloc_initialize_hook. Also call realloc and free for consistency. */ free (realloc (malloc (4), 4)); -# ifndef SYNC_INPUT - /* Arrange to disable interrupt input inside malloc etc. */ - uninterrupt_malloc (); -# endif /* not SYNC_INPUT */ #endif /* not SYSTEM_MALLOC */ #if defined (MSDOS) || defined (WINDOWSNT) @@ -2143,12 +2139,6 @@ You must run Emacs in batch mode in order to dump it. */) memory_warnings (my_edata, malloc_warning); } #endif /* not WINDOWSNT */ -#if defined (HAVE_PTHREAD) && !defined SYNC_INPUT - /* Pthread may call malloc before main, and then we will get an endless - loop, because pthread_self (see alloc.c) calls malloc the first time - it is called on some systems. */ - reset_malloc_hooks (); -#endif #endif /* not SYSTEM_MALLOC */ #ifdef DOUG_LEA_MALLOC malloc_state_ptr = malloc_get_state (); diff --git a/src/eval.c b/src/eval.c index 6cca13a8fda..1c565e233c6 100644 --- a/src/eval.c +++ b/src/eval.c @@ -117,12 +117,6 @@ static EMACS_INT when_entered_debugger; Lisp_Object Vsignaling_function; -/* Set to non-zero while processing X events. Checked in Feval to - make sure the Lisp interpreter isn't called from a signal handler, - which is unsafe because the interpreter isn't reentrant. */ - -int handling_signal; - /* If non-nil, Lisp code must not be run since some part of Emacs is in an inconsistent state. Currently, x-create-frame uses this to avoid triggering window-configuration-change-hook while the new @@ -1106,7 +1100,6 @@ unwind_to_catch (struct catchtag *catch, Lisp_Object value) /* Restore certain special C variables. */ set_poll_suppress_count (catch->poll_suppress_count); UNBLOCK_INPUT_TO (catch->interrupt_input_blocked); - handling_signal = 0; immediate_quit = 0; do @@ -1486,7 +1479,7 @@ See also the function `condition-case'. */) struct handler *h; struct backtrace *bp; - immediate_quit = handling_signal = 0; + immediate_quit = 0; abort_on_gc = 0; if (gc_in_progress || waiting_for_input) emacs_abort (); @@ -2039,9 +2032,6 @@ eval_sub (Lisp_Object form) struct backtrace backtrace; struct gcpro gcpro1, gcpro2, gcpro3; - if (handling_signal) - emacs_abort (); - if (SYMBOLP (form)) { /* Look up its binding in the lexical environment. @@ -3104,8 +3094,6 @@ specbind (Lisp_Object symbol, Lisp_Object value) { struct Lisp_Symbol *sym; - eassert (!handling_signal); - CHECK_SYMBOL (symbol); sym = XSYMBOL (symbol); if (specpdl_ptr == specpdl + specpdl_size) @@ -3199,8 +3187,6 @@ specbind (Lisp_Object symbol, Lisp_Object value) void record_unwind_protect (Lisp_Object (*function) (Lisp_Object), Lisp_Object arg) { - eassert (!handling_signal); - if (specpdl_ptr == specpdl + specpdl_size) grow_specpdl (); specpdl_ptr->func = function; diff --git a/src/intervals.c b/src/intervals.c index 5a47cacb2dd..584ee1e923d 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -673,8 +673,7 @@ find_interval (register INTERVAL tree, register ptrdiff_t position) eassert (relative_position <= TOTAL_LENGTH (tree)); - if (!handling_signal) - tree = balance_possible_root_interval (tree); + tree = balance_possible_root_interval (tree); while (1) { diff --git a/src/keyboard.c b/src/keyboard.c index d164083fb86..01644b3832d 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -84,9 +84,7 @@ int interrupt_input_pending; pending_atimers separately, to reduce code size. So, any code that changes interrupt_input_pending or pending_atimers should update this too. */ -#ifdef SYNC_INPUT int pending_signals; -#endif #define KBD_BUFFER_SIZE 4096 @@ -2010,17 +2008,9 @@ static struct atimer *poll_timer; void poll_for_input_1 (void) { -/* Tell ns_read_socket() it is being called asynchronously so it can avoid - doing anything dangerous. */ -#ifdef HAVE_NS - ++handling_signal; -#endif if (interrupt_input_blocked == 0 && !waiting_for_input) read_avail_input (0); -#ifdef HAVE_NS - --handling_signal; -#endif } /* Timer callback function for poll_timer. TIMER is equal to @@ -2031,12 +2021,8 @@ poll_for_input (struct atimer *timer) { if (poll_suppress_count == 0) { -#ifdef SYNC_INPUT interrupt_input_pending = 1; pending_signals = 1; -#else - poll_for_input_1 (); -#endif } } @@ -7176,19 +7162,12 @@ tty_read_avail_input (struct terminal *terminal, return nread; } -#if defined SYNC_INPUT || defined USABLE_SIGIO static void handle_async_input (void) { interrupt_input_pending = 0; -#ifdef SYNC_INPUT pending_signals = pending_atimers; -#endif -/* Tell ns_read_socket() it is being called asynchronously so it can avoid - doing anything dangerous. */ -#ifdef HAVE_NS - ++handling_signal; -#endif + while (1) { int nread; @@ -7199,13 +7178,8 @@ handle_async_input (void) if (nread <= 0) break; } -#ifdef HAVE_NS - --handling_signal; -#endif } -#endif /* SYNC_INPUT || USABLE_SIGIO */ -#ifdef SYNC_INPUT void process_pending_signals (void) { @@ -7213,24 +7187,17 @@ process_pending_signals (void) handle_async_input (); do_pending_atimers (); } -#endif #ifdef USABLE_SIGIO static void handle_input_available_signal (int sig) { -#ifdef SYNC_INPUT interrupt_input_pending = 1; pending_signals = 1; -#endif if (input_available_clear_time) *input_available_clear_time = make_emacs_time (0, 0); - -#ifndef SYNC_INPUT - handle_async_input (); -#endif } static void @@ -11365,9 +11332,7 @@ init_keyboard (void) input_pending = 0; interrupt_input_blocked = 0; interrupt_input_pending = 0; -#ifdef SYNC_INPUT pending_signals = 0; -#endif /* This means that command_loop_1 won't try to select anything the first time through. */ diff --git a/src/lisp.h b/src/lisp.h index 447c6bd296b..3a473a60b48 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2107,22 +2107,16 @@ extern char *stack_bottom; If quit-flag is set to `kill-emacs' the SIGINT handler has received a request to exit Emacs when it is safe to do. */ -#ifdef SYNC_INPUT extern void process_pending_signals (void); extern int pending_signals; -#define ELSE_PENDING_SIGNALS \ - else if (pending_signals) \ - process_pending_signals (); -#else /* not SYNC_INPUT */ -#define ELSE_PENDING_SIGNALS -#endif /* not SYNC_INPUT */ extern void process_quit_flag (void); #define QUIT \ do { \ if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \ process_quit_flag (); \ - ELSE_PENDING_SIGNALS \ + else if (pending_signals) \ + process_pending_signals (); \ } while (0) @@ -2846,8 +2840,6 @@ extern void memory_warnings (void *, void (*warnfun) (const char *)); /* Defined in alloc.c. */ extern void check_pure_size (void); extern void allocate_string_data (struct Lisp_String *, EMACS_INT, EMACS_INT); -extern void reset_malloc_hooks (void); -extern void uninterrupt_malloc (void); extern void malloc_warning (const char *); extern _Noreturn void memory_full (size_t); extern _Noreturn void buffer_memory_full (ptrdiff_t); @@ -3043,7 +3035,6 @@ extern Lisp_Object Qand_rest; extern Lisp_Object Vautoload_queue; extern Lisp_Object Vsignaling_function; extern Lisp_Object inhibit_lisp_code; -extern int handling_signal; #if BYTE_MARK_STACK extern struct catchtag *catchlist; extern struct handler *handlerlist; diff --git a/src/nsmenu.m b/src/nsmenu.m index 3057f4f6a20..907d3eac622 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -588,10 +588,7 @@ - (void)menuNeedsUpdate: (NSMenu *)menu From 10.6 on, we could also use -[NSMenu propertiesToUpdate]: In the key press case, NSMenuPropertyItemImage (e.g.) won't be set. */ - if (trackingMenu == 0 - /* Also, don't try this if from an event picked up asynchronously, - as lots of lisp evaluation happens in ns_update_menubar. */ - || handling_signal != 0) + if (trackingMenu == 0) return; /*fprintf (stderr, "Updating menu '%s'\n", [[self title] UTF8String]); NSLog (@"%@\n", event); */ ns_update_menubar (frame, 1, self); diff --git a/src/nsterm.m b/src/nsterm.m index 41520ce74d1..0b26508dbd0 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -3355,16 +3355,12 @@ overwriting cursor (usually when cursor on a tab) */ if (interrupt_input_blocked) { interrupt_input_pending = 1; -#ifdef SYNC_INPUT pending_signals = 1; -#endif return -1; } interrupt_input_pending = 0; -#ifdef SYNC_INPUT pending_signals = pending_atimers; -#endif BLOCK_INPUT; n_emacs_events_pending = 0; @@ -3726,7 +3722,7 @@ overwriting cursor (usually when cursor on a tab) */ removed = YES; } - if (removed) + if (removed) [eview updateFrameSize: NO]; } @@ -3988,7 +3984,6 @@ static Lisp_Object ns_string_to_lispmod (const char *s) /* count object allocs (About, click icon); on OS X use ObjectAlloc tool */ /*GSDebugAllocationActive (YES); */ BLOCK_INPUT; - handling_signal = 0; baud_rate = 38400; Fset_input_interrupt_mode (Qnil); @@ -6239,7 +6234,7 @@ - (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen NSRect r = [super constrainFrameRect:frameRect toScreen:screen]; return r; } - + if (f->output_data.ns->dont_constrain || ns_menu_bar_should_be_hidden ()) return frameRect; diff --git a/src/process.c b/src/process.c index 6dbff6f4b16..a371dece250 100644 --- a/src/process.c +++ b/src/process.c @@ -4395,10 +4395,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, Otherwise, do pending quit if requested. */ if (read_kbd >= 0) QUIT; -#ifdef SYNC_INPUT else process_pending_signals (); -#endif /* Exit now if the cell we're waiting for became non-nil. */ if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell))) diff --git a/src/regex.c b/src/regex.c index 92264ccae23..17562043df1 100644 --- a/src/regex.c +++ b/src/regex.c @@ -1831,9 +1831,9 @@ typedef struct /* The next available element. */ #define COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail]) -/* Explicit quit checking is only used on NTemacs and whenever we - use polling to process input events. */ -#if defined emacs && (defined WINDOWSNT || defined SYNC_INPUT) && defined QUIT +/* Explicit quit checking is needed for Emacs, which uses polling to + process input events. */ +#ifdef emacs extern int immediate_quit; # define IMMEDIATE_QUIT_CHECK \ do { \ diff --git a/src/sysdep.c b/src/sysdep.c index 9065b38d6fc..dbfd9efc7d4 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -1447,27 +1447,21 @@ emacs_sigaction_init (struct sigaction *action, signal_handler_t handler) action->sa_handler = handler; action->sa_flags = 0; #if defined (SA_RESTART) - /* Emacs mostly works better with restartable system services. If this - flag exists, we probably want to turn it on here. - However, on some systems (only hpux11 at present) this resets the - timeout of `select' which means that `select' never finishes if - it keeps getting signals. - We define BROKEN_SA_RESTART on those systems. */ - /* It's not clear why the comment above says "mostly works better". --Stef - When SYNC_INPUT is set, we don't want SA_RESTART because we need to poll + /* SA_RESTART causes interruptible functions with timeouts (e.g., + 'select') to reset their timeout on some platforms (e.g., + HP-UX 11), which is not what we want. Also, when Emacs is + interactive, we don't want SA_RESTART because we need to poll for pending input so we need long-running syscalls to be interrupted after a signal that sets the interrupt_input_pending flag. */ /* Non-interactive keyboard input goes through stdio, where we always want restartable system calls. */ -# if defined (BROKEN_SA_RESTART) || defined (SYNC_INPUT) if (noninteractive) -# endif action->sa_flags = SA_RESTART; #endif } #ifdef FORWARD_SIGNAL_TO_MAIN_THREAD -pthread_t main_thread; +static pthread_t main_thread; #endif /* If we are on the main thread, handle the signal SIG with HANDLER. @@ -1914,11 +1908,9 @@ emacs_write (int fildes, const char *buf, ptrdiff_t nbyte) { if (errno == EINTR) { -#ifdef SYNC_INPUT /* I originally used `QUIT' but that might causes files to be truncated if you hit C-g in the middle of it. --Stef */ process_pending_signals (); -#endif continue; } else diff --git a/src/syssignal.h b/src/syssignal.h index 5e733dd812d..e309e6725b7 100644 --- a/src/syssignal.h +++ b/src/syssignal.h @@ -64,8 +64,4 @@ extern void emacs_sigaction_init (struct sigaction *, signal_handler_t); char *strsignal (int); #endif -#ifdef FORWARD_SIGNAL_TO_MAIN_THREAD -extern pthread_t main_thread; -#endif - void handle_on_main_thread (int, signal_handler_t); diff --git a/src/xdisp.c b/src/xdisp.c index 8e0975cf65a..5ee5a46601c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -9290,12 +9290,6 @@ add_to_log (const char *format, Lisp_Object arg1, Lisp_Object arg2) struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; USE_SAFE_ALLOCA; - /* Do nothing if called asynchronously. Inserting text into - a buffer may call after-change-functions and alike and - that would means running Lisp asynchronously. */ - if (handling_signal) - return; - fmt = msg = Qnil; GCPRO4 (fmt, msg, arg1, arg2); diff --git a/src/xterm.c b/src/xterm.c index 900a1d78b80..9ab53dc087a 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -7129,25 +7129,17 @@ XTread_socket (struct terminal *terminal, int expected, struct input_event *hold if (interrupt_input_blocked) { interrupt_input_pending = 1; -#ifdef SYNC_INPUT pending_signals = 1; -#endif return -1; } interrupt_input_pending = 0; -#ifdef SYNC_INPUT pending_signals = pending_atimers; -#endif BLOCK_INPUT; /* So people can tell when we have read the available input. */ input_signal_count++; -#ifndef SYNC_INPUT - ++handling_signal; -#endif - /* For debugging, this gives a way to fake an I/O error. */ if (terminal->display_info.x == XTread_socket_fake_io_error) { @@ -7236,9 +7228,6 @@ XTread_socket (struct terminal *terminal, int expected, struct input_event *hold pending_autoraise_frame = 0; } -#ifndef SYNC_INPUT - --handling_signal; -#endif UNBLOCK_INPUT; return count; @@ -7788,7 +7777,6 @@ x_connection_closed (Display *dpy, const char *error_message) error_msg = alloca (strlen (error_message) + 1); strcpy (error_msg, error_message); - handling_signal = 0; /* Inhibit redisplay while frames are being deleted. */ specbind (Qinhibit_redisplay, Qt); From 48093eb9bca47488b6867e53a12e7cac37d6f5a6 Mon Sep 17 00:00:00 2001 From: Katsumi Yamaoka Date: Sun, 16 Sep 2012 23:16:15 +0000 Subject: [PATCH 59/88] mail/mailabbrev.el (mail-abbrev-expand-hook): Work for a mail aliasee that holds many addresses. --- lisp/ChangeLog | 5 +++++ lisp/mail/mailabbrev.el | 47 ++++++++++++++++------------------------- 2 files changed, 23 insertions(+), 29 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9eeba6691c6..7700763cf25 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-09-16 Katsumi Yamaoka + + * mail/mailabbrev.el (mail-abbrev-expand-hook): Work for a mail aliasee + that holds many addresses. + 2012-09-16 Chong Yidong * align.el (align-areas): Call the indication function with diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el index 290c57c1c55..2e4ffec1383 100644 --- a/lisp/mail/mailabbrev.el +++ b/lisp/mail/mailabbrev.el @@ -391,35 +391,24 @@ double-quotes." (defun mail-abbrev-expand-hook () "For use as the fourth arg to `define-abbrev'. After expanding a mail-abbrev, if Auto Fill mode is on and we're past the -fill-column, break the line at the previous comma, and indent the next line." - ;; Disable abbrev mode to avoid recursion in indent-relative expanding - ;; part of the abbrev expansion as an abbrev itself. - (let ((abbrev-mode nil)) - (save-excursion - (let ((p (point)) - bol comma fp) - (beginning-of-line) - (setq bol (point)) - (goto-char p) - (while (and auto-fill-function - (>= (current-column) fill-column) - (search-backward "," bol t)) - (setq comma (point)) - (forward-char 1) ; Now we are just past the comma. - (insert "\n") - (delete-horizontal-space) - (setq p (point)) - (indent-relative) - (setq fp (buffer-substring p (point))) - ;; Go to the end of the new line. - (end-of-line) - (if (> (current-column) fill-column) - ;; It's still too long; do normal auto-fill. - (let ((fill-prefix (or fp "\t"))) - (do-auto-fill))) - ;; Resume the search. - (goto-char comma) - ))))) +fill-column, break the line at the previous comma, and indent the next line +with a space." + (when auto-fill-function + (let (p) + (save-excursion + (while (>= (current-column) fill-column) + (while (and (search-backward "," (point-at-bol) 'move) + (>= (current-column) (1- fill-column)) + (setq p (point)))) + (when (or (not (bolp)) + (and p (goto-char p))) + (setq p nil) + (forward-char 1) + (insert "\n") + (when (looking-at "[\t ]+") + (delete-region (point) (match-end 0))) + (insert " ") + (end-of-line))))))) ;;; Syntax tables and abbrev-expansion From 78f83752f50a2aa9944e60a5aceac4015eb3ca58 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 16 Sep 2012 17:56:08 -0700 Subject: [PATCH 60/88] Reduce the number of versioned files storing the short copyright string * configure.ac (copyright): New output variable. (COPYRIGHT): New AC_DEFINE. * admin/admin.el (set-copyright): No more need to set copyrights for nextstep, or .c files. Add configure.ac and config.nt. * lib-src/ebrowse.c (version): * lib-src/etags.c (print_version): Use COPYRIGHT. * nextstep/templates/Info-gnustep.plist.in: * nextstep/templates/InfoPlist.strings.in: * nextstep/templates/Info.plist.in: Let configure set copyright. * nt/config.nt (COPYRIGHT): New. * src/emacs.c: Use COPYRIGHT. --- ChangeLog | 5 +++++ admin/ChangeLog | 5 +++++ admin/admin.el | 28 +++++------------------- configure.ac | 5 +++++ lib-src/ChangeLog | 5 +++++ lib-src/ebrowse.c | 3 +-- lib-src/etags.c | 3 +-- nextstep/ChangeLog | 5 +++++ nextstep/templates/Info-gnustep.plist.in | 2 +- nextstep/templates/Info.plist.in | 2 +- nextstep/templates/InfoPlist.strings.in | 2 +- nt/ChangeLog | 4 ++++ nt/config.nt | 3 +++ src/ChangeLog | 4 ++++ src/emacs.c | 2 +- 15 files changed, 48 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4bdca0c914a..5edcd767b27 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-09-17 Glenn Morris + + * configure.ac (copyright): New output variable. + (COPYRIGHT): New AC_DEFINE. + 2012-09-16 Paul Eggert Remove configure's --without-sync-input option (Bug#12450). diff --git a/admin/ChangeLog b/admin/ChangeLog index 8fe16b9e766..6d3118d8ba6 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,8 @@ +2012-09-17 Glenn Morris + + * admin.el (set-copyright): No more need to set copyrights for + nextstep, or .c files. Add configure.ac and config.nt. + 2012-09-16 Paul Eggert Remove configure's --without-sync-input option (Bug#12450). diff --git a/admin/admin.el b/admin/admin.el index b076bb67dd1..4d68fca97b2 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -140,34 +140,18 @@ Root must be the root of an Emacs source tree." (format-time-string "%Y"))))) (unless (file-exists-p (expand-file-name "src/emacs.c" root)) (error "%s doesn't seem to be the root of an Emacs source tree" root)) - (set-version-in-file root "src/emacs.c" copyright - (rx (and "emacs_copyright" (0+ (not (in ?\"))) - ?\" (submatch (1+ (not (in ?\")))) ?\"))) - (set-version-in-file root "lib-src/ebrowse.c" copyright - (rx (and "emacs_copyright" (0+ (not (in ?\"))) - ?\" (submatch (1+ (not (in ?\")))) ?\"))) - (set-version-in-file root "lib-src/etags.c" copyright - (rx (and "emacs_copyright" (0+ (not (in ?\"))) + (set-version-in-file root "configure.ac" copyright + (rx (and bol "copyright" (0+ (not (in ?\"))) ?\" (submatch (1+ (not (in ?\")))) ?\"))) + (set-version-in-file root "nt/config.nt" copyright + (rx (and bol "#" (0+ blank) "define" (1+ blank) + "COPYRIGHT" (1+ blank) + ?\" (submatch (1+ (not (in ?\")))) ?\"))) (set-version-in-file root "lib-src/rcs2log" copyright (rx (and "Copyright" (0+ space) ?= (0+ space) ?\' (submatch (1+ nonl))))) ;; This one is a nuisance, as it needs to be split over two lines. (string-match "\\(.*[0-9]\\{4\\} *\\)\\(.*\\)" copyright) - ;; nextstep. - (set-version-in-file - root "nextstep/templates/Info.plist.in" - copyright (rx (and "CFBundleGetInfoString" (1+ anything) "Emacs" (1+ space) - (1+ (in "0-9.")) (1+ space) - (submatch (1+ (not (in ?\<))))))) - (set-version-in-file - root "nextstep/templates/InfoPlist.strings.in" - copyright (rx (and "NSHumanReadableCopyright" (0+ space) ?\= (0+ space) - ?\" (submatch (1+ (not (in ?\"))))))) - (set-version-in-file - root "nextstep/templates/Info-gnustep.plist.in" - copyright (rx (and "Copyright" (0+ space) ?\= (0+ space) - ?\" (submatch (1+ (not (in ?\"))))))) (when (string-match "\\([0-9]\\{4\\}\\)" copyright) (setq copyright (match-string 1 copyright)) (dolist (file (directory-files (expand-file-name "etc/refcards" root) diff --git a/configure.ac b/configure.ac index 569b367371a..d09d22bcbbd 100644 --- a/configure.ac +++ b/configure.ac @@ -3978,6 +3978,11 @@ fi version=$PACKAGE_VERSION +copyright="Copyright (C) 2012 Free Software Foundation, Inc." +AC_DEFINE_UNQUOTED(COPYRIGHT, ["$copyright"], + [Short copyright string for this version of Emacs.]) +AC_SUBST(copyright) + ### Specify what sort of things we'll be editing into Makefile and config.h. ### Use configuration here uncanonicalized to avoid exceeding size limits. AC_SUBST(version) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index f5846657707..3f1e287db34 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,8 @@ +2012-09-17 Glenn Morris + + * ebrowse.c (version): + * etags.c (print_version): Use COPYRIGHT. + 2012-09-11 Paul Eggert * pop.c (socket_connection) [HAVE_GETADDRINFO]: diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c index f8569fe3747..056ed471fde 100644 --- a/lib-src/ebrowse.c +++ b/lib-src/ebrowse.c @@ -3516,8 +3516,7 @@ usage (int error) static _Noreturn void version (void) { - /* Makes it easier to update automatically. */ - char emacs_copyright[] = "Copyright (C) 2012 Free Software Foundation, Inc."; + char emacs_copyright[] = COPYRIGHT; printf ("ebrowse %s\n", VERSION); puts (emacs_copyright); diff --git a/lib-src/etags.c b/lib-src/etags.c index e65082de534..ec415e9905f 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -836,8 +836,7 @@ etags --help --lang=ada."); static void print_version (void) { - /* Makes it easier to update automatically. */ - char emacs_copyright[] = "Copyright (C) 2012 Free Software Foundation, Inc."; + char emacs_copyright[] = COPYRIGHT; printf ("%s (%s %s)\n", (CTAGS) ? "ctags" : "etags", EMACS_NAME, VERSION); puts (emacs_copyright); diff --git a/nextstep/ChangeLog b/nextstep/ChangeLog index be73bc1f168..53f42c97716 100644 --- a/nextstep/ChangeLog +++ b/nextstep/ChangeLog @@ -1,3 +1,8 @@ +2012-09-17 Glenn Morris + + * templates/Info-gnustep.plist.in, templates/InfoPlist.strings.in: + * templates/Info.plist.in: Let configure set copyright. + 2012-09-16 Glenn Morris * Makefile.in: New file. diff --git a/nextstep/templates/Info-gnustep.plist.in b/nextstep/templates/Info-gnustep.plist.in index 6da5af489fb..4ac97e5cde6 100644 --- a/nextstep/templates/Info-gnustep.plist.in +++ b/nextstep/templates/Info-gnustep.plist.in @@ -11,7 +11,7 @@ "Carl Edman (NeXTstep)", "..see etc/NEXTSTEP" ); - Copyright = "Copyright (C) 2012 Free Software Foundation, Inc."; + Copyright = "@copyright@"; CopyrightDescription = "Released under the GNU General Public License Version 3 or later"; FullVersionID = "Emacs @version@, NS Windowing"; NSExecutable = Emacs; diff --git a/nextstep/templates/Info.plist.in b/nextstep/templates/Info.plist.in index df9708eae71..25c73916e58 100644 --- a/nextstep/templates/Info.plist.in +++ b/nextstep/templates/Info.plist.in @@ -553,7 +553,7 @@ along with GNU Emacs. If not, see . CFBundleExecutable Emacs CFBundleGetInfoString - Emacs @version@ Copyright (C) 2012 Free Software Foundation, Inc. + Emacs @version@ @copyright@ CFBundleIconFile Emacs.icns CFBundleIdentifier diff --git a/nextstep/templates/InfoPlist.strings.in b/nextstep/templates/InfoPlist.strings.in index ce9779c7ac8..f38d8925017 100644 --- a/nextstep/templates/InfoPlist.strings.in +++ b/nextstep/templates/InfoPlist.strings.in @@ -3,4 +3,4 @@ CFBundleName = "Emacs"; CFBundleShortVersionString = "Version @version@"; CFBundleGetInfoString = "Emacs version @version@, NS Windowing"; -NSHumanReadableCopyright = "Copyright (C) 2012 Free Software Foundation, Inc."; +NSHumanReadableCopyright = "@copyright@"; diff --git a/nt/ChangeLog b/nt/ChangeLog index 197ce0cf850..f2a5281d1f8 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,7 @@ +2012-09-17 Glenn Morris + + * config.nt (COPYRIGHT): New. + 2012-09-15 Paul Eggert Port _setjmp fix to POSIXish hosts as well as Microsoft. diff --git a/nt/config.nt b/nt/config.nt index 82b7da430ab..96217a8c580 100644 --- a/nt/config.nt +++ b/nt/config.nt @@ -86,6 +86,9 @@ along with GNU Emacs. If not, see . */ his/her Emacs. */ #undef CLASH_DETECTION +/* Short copyright string for this version of Emacs. */ +#define COPYRIGHT "Copyright (C) 2012 Free Software Foundation, Inc." + /* Define to one of '_getb67', 'GETB67', 'getb67' for Cray-2 and Cray-YMP systems. This function is required for 'alloca.c' support on those systems. */ diff --git a/src/ChangeLog b/src/ChangeLog index f21395d9632..3c0799d14b3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-09-17 Glenn Morris + + * emacs.c: Use COPYRIGHT. + 2012-09-16 Paul Eggert Remove configure's --without-sync-input option (Bug#12450). diff --git a/src/emacs.c b/src/emacs.c index 233c0e68a14..d4b52ab64ea 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -88,7 +88,7 @@ extern void moncontrol (int mode); #endif static const char emacs_version[] = VERSION; -static const char emacs_copyright[] = "Copyright (C) 2012 Free Software Foundation, Inc."; +static const char emacs_copyright[] = COPYRIGHT; /* Empty lisp strings. To avoid having to build any others. */ Lisp_Object empty_unibyte_string, empty_multibyte_string; From eeceac9312792b15bbafea16dec45a6b7d1312cc Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 16 Sep 2012 18:02:11 -0700 Subject: [PATCH 61/88] Remove no-longer-needed Solaris 2.4 vfork bug workaround. The workaround was for improving performance on Solaris 2.4, but is getting in the way now. Emacs will still work if someone is still running Solaris 2.4 in a museum somewhere; Sun dropped support for Solaris 2.4 in 2003. * configure.ac (ac_cv_func_vfork_works): Default to 'no' on Solaris 2.4, so that AC_FUNC_VFORK doesn't think vfork works. * src/callproc.c (Fcall_process) [HAVE_WORKING_VFORK]: * src/process.c (create_process) [HAVE_WORKING_VFORK]: Omit now-unnecessary workaround for the Solaris 2.4 vfork bug, since Emacs no longer uses vfork on that platform. --- ChangeLog | 6 ++++++ configure.ac | 8 ++++++++ src/ChangeLog | 12 ++++++++++++ src/callproc.c | 25 ------------------------- src/process.c | 39 ++++++++------------------------------- 5 files changed, 34 insertions(+), 56 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5edcd767b27..7b9da902551 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-09-17 Paul Eggert + + Remove no-longer-needed Solaris 2.4 vfork bug workaround. + * configure.ac (ac_cv_func_vfork_works): Default to 'no' on + Solaris 2.4, so that AC_FUNC_VFORK doesn't think vfork works. + 2012-09-17 Glenn Morris * configure.ac (copyright): New output variable. diff --git a/configure.ac b/configure.ac index d09d22bcbbd..d0cbabf3d3d 100644 --- a/configure.ac +++ b/configure.ac @@ -3155,6 +3155,14 @@ else AC_MSG_RESULT(no) fi +dnl Check for a Solaris 2.4 vfork bug that Autoconf misses (through 2.69). +dnl This can be removed once we assume Autoconf 2.70. +case $canonical in + *-solaris2.4 | *-solaris2.4.*) + dnl Disable the Autoconf-generated vfork test. + : ${ac_cv_func_vfork_works=no};; +esac + AC_FUNC_FORK AC_CHECK_FUNCS(snprintf) diff --git a/src/ChangeLog b/src/ChangeLog index 3c0799d14b3..daabdd7613e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,15 @@ +2012-09-17 Paul Eggert + + Remove no-longer-needed Solaris 2.4 vfork bug workaround. + The workaround was for improving performance on Solaris 2.4, but + is getting in the way now. Emacs will still work if someone is + still running Solaris 2.4 in a museum somewhere; Sun dropped + support for Solaris 2.4 in 2003. + * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]: + * process.c (create_process) [HAVE_WORKING_VFORK]: + Omit now-unnecessary workaround for the Solaris 2.4 vfork bug, + since Emacs no longer uses vfork on that platform. + 2012-09-17 Glenn Morris * emacs.c: Use COPYRIGHT. diff --git a/src/callproc.c b/src/callproc.c index 9171337ee76..2604d295f3e 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -496,11 +496,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) register char **save_environ = environ; register int fd1 = fd[1]; int fd_error = fd1; -#ifdef HAVE_WORKING_VFORK - sigset_t procmask; - sigset_t blocked; - struct sigaction sigpipe_action; -#endif if (fd_output >= 0) fd1 = fd_output; @@ -587,17 +582,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) 0, current_dir); #else /* not WINDOWSNT */ -#ifdef HAVE_WORKING_VFORK - /* On many hosts (e.g. Solaris 2.4), if a vforked child calls `signal', - this sets the parent's signal handlers as well as the child's. - So delay all interrupts whose handlers the child might munge, - and record the current handlers so they can be restored later. */ - sigemptyset (&blocked); - sigaddset (&blocked, SIGPIPE); - sigaction (SIGPIPE, 0, &sigpipe_action); - pthread_sigmask (SIG_BLOCK, &blocked, &procmask); -#endif - BLOCK_INPUT; /* vfork, and prevent local vars from being clobbered by the vfork. */ @@ -645,9 +629,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) /* GConf causes us to ignore SIGPIPE, make sure it is restored in the child. */ signal (SIGPIPE, SIG_DFL); -#ifdef HAVE_WORKING_VFORK - pthread_sigmask (SIG_SETMASK, &procmask, 0); -#endif child_setup (filefd, fd1, fd_error, (char **) new_argv, 0, current_dir); @@ -655,12 +636,6 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) UNBLOCK_INPUT; -#ifdef HAVE_WORKING_VFORK - /* Restore the signal state. */ - sigaction (SIGPIPE, &sigpipe_action, 0); - pthread_sigmask (SIG_SETMASK, &procmask, 0); -#endif - #endif /* not WINDOWSNT */ /* The MSDOS case did this already. */ diff --git a/src/process.c b/src/process.c index a371dece250..c654369627d 100644 --- a/src/process.c +++ b/src/process.c @@ -1609,14 +1609,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) #if !defined (WINDOWSNT) && defined (FD_CLOEXEC) int wait_child_setup[2]; #endif +#ifdef SIGCHLD sigset_t blocked, procmask; - struct sigaction sigint_action; - struct sigaction sigquit_action; - struct sigaction sigpipe_action; -#ifdef AIX - struct sigaction sighup_action; #endif - /* Use volatile to protect variables from being clobbered by longjmp. */ + /* Use volatile to protect variables from being clobbered by vfork. */ volatile int forkin, forkout; volatile int pty_flag = 0; @@ -1708,25 +1704,13 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) XPROCESS (process)->pty_flag = pty_flag; pset_status (XPROCESS (process), Qrun); +#ifdef SIGCHLD /* Delay interrupts until we have a chance to store the new fork's pid in its process structure */ sigemptyset (&blocked); -#ifdef SIGCHLD sigaddset (&blocked, SIGCHLD); -#endif -#ifdef HAVE_WORKING_VFORK - /* On many hosts (e.g. Solaris 2.4), if a vforked child calls `signal', - this sets the parent's signal handlers as well as the child's. - So delay all interrupts whose handlers the child might munge, - and record the current handlers so they can be restored later. */ - sigaddset (&blocked, SIGINT ); sigaction (SIGINT , 0, &sigint_action ); - sigaddset (&blocked, SIGQUIT); sigaction (SIGQUIT, 0, &sigquit_action); - sigaddset (&blocked, SIGPIPE); sigaction (SIGPIPE, 0, &sigpipe_action); -#ifdef AIX - sigaddset (&blocked, SIGHUP ); sigaction (SIGHUP , 0, &sighup_action ); -#endif -#endif /* HAVE_WORKING_VFORK */ pthread_sigmask (SIG_BLOCK, &blocked, &procmask); +#endif FD_SET (inchannel, &input_wait_mask); FD_SET (inchannel, &non_keyboard_wait_mask); @@ -1879,8 +1863,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) in the child. */ signal (SIGPIPE, SIG_DFL); +#ifdef SIGCHLD /* Stop blocking signals in the child. */ pthread_sigmask (SIG_SETMASK, &procmask, 0); +#endif if (pty_flag) child_setup_tty (xforkout); @@ -1959,19 +1945,10 @@ create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) #endif } - /* Restore the signal state whether vfork succeeded or not. - (We will signal an error, below, if it failed.) */ -#ifdef HAVE_WORKING_VFORK - /* Restore the parent's signal handlers. */ - sigaction (SIGINT, &sigint_action, 0); - sigaction (SIGQUIT, &sigquit_action, 0); - sigaction (SIGPIPE, &sigpipe_action, 0); -#ifdef AIX - sigaction (SIGHUP, &sighup_action, 0); -#endif -#endif /* HAVE_WORKING_VFORK */ +#ifdef SIGCHLD /* Stop blocking signals in the parent. */ pthread_sigmask (SIG_SETMASK, &procmask, 0); +#endif /* Now generate the error if vfork failed. */ if (pid < 0) From 9e9da873897ad87e167fce1cb12cdcfaa2024e21 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 17 Sep 2012 11:24:32 +0800 Subject: [PATCH 62/88] Doc fix for removed var gdb-use-separate-io-buffer. * building.texi (GDB User Interface Layout): Remove reference to removed variable gdb-use-separate-io-buffer. Fixes: debbugs:12454 --- doc/emacs/ChangeLog | 5 +++++ doc/emacs/building.texi | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 508dbbf8021..35e635eec28 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,8 @@ +2012-09-17 Chong Yidong + + * building.texi (GDB User Interface Layout): Remove reference to + removed variable gdb-use-separate-io-buffer (Bug#12454). + 2012-09-08 Jambunathan K * regs.texi (Text Registers): `C-x r +' can now be used instead of diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index 05ea667e5f7..21948f181fb 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi @@ -888,10 +888,6 @@ displays the following frame layout: @end group @end smallexample - However, if @code{gdb-use-separate-io-buffer} is @code{nil}, the I/O -buffer does not appear and the primary source buffer occupies the full -width of the frame. - @findex gdb-restore-windows @findex gdb-many-windows If you ever change the window layout, you can restore the ``many From d079ee5ffed33aa3cc4e02470ff84519ecdc844f Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 17 Sep 2012 13:01:10 +0800 Subject: [PATCH 63/88] Convert several shell.el defvars to defcustoms. * shell.el (shell-file-name-chars, shell-file-name-quote-list) (shell-dynamic-complete-functions): Convert to defcustom. (shell-prompt-pattern, shell-completion-fignore): Doc fix. --- lisp/ChangeLog | 6 ++++++ lisp/shell.el | 34 ++++++++++++++-------------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7700763cf25..217187c5e88 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-09-17 Chong Yidong + + * shell.el (shell-file-name-chars, shell-file-name-quote-list) + (shell-dynamic-complete-functions): Convert to defcustom. + (shell-prompt-pattern, shell-completion-fignore): Doc fix. + 2012-09-16 Katsumi Yamaoka * mail/mailabbrev.el (mail-abbrev-expand-hook): Work for a mail aliasee diff --git a/lisp/shell.el b/lisp/shell.el index b98efceefbf..8c80712eed6 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -136,9 +136,7 @@ how Shell mode treats paragraphs. The pattern should probably not match more than one line. If it does, Shell mode may become confused trying to distinguish prompt from input -on lines which don't start with a prompt. - -This is a fine thing to set in your `.emacs' file." +on lines which don't start with a prompt." :type 'regexp :group 'shell) @@ -146,9 +144,7 @@ This is a fine thing to set in your `.emacs' file." "List of suffixes to be disregarded during file/command completion. This variable is used to initialize `comint-completion-fignore' in the shell buffer. The default is nil, for compatibility with most shells. -Some people like (\"~\" \"#\" \"%\"). - -This is a fine thing to set in your `.emacs' file." +Some people like (\"~\" \"#\" \"%\")." :type '(repeat (string :tag "Suffix")) :group 'shell) @@ -158,31 +154,29 @@ This variable is used to initialize `comint-delimiter-argument-list' in the shell buffer. The value may depend on the operating system or shell." :type '(choice (const nil) (repeat :tag "List of characters" character)) - ;; Reverted. -;; :version "24.1" ; changed to nil (bug#8027) :group 'shell) -(defvar shell-file-name-chars +(defcustom shell-file-name-chars (if (memq system-type '(ms-dos windows-nt cygwin)) "~/A-Za-z0-9_^$!#%&{}@`'.,:()-" "[]~/A-Za-z0-9+@:_.$#%,={}-") "String of characters valid in a file name. This variable is used to initialize `comint-file-name-chars' in the -shell buffer. The value may depend on the operating system or shell. +shell buffer. The value may depend on the operating system or shell." + :type 'string + :group 'shell) -This is a fine thing to set in your `.emacs' file.") - -(defvar shell-file-name-quote-list +(defcustom shell-file-name-quote-list (if (memq system-type '(ms-dos windows-nt)) nil (append shell-delimiter-argument-list '(?\s ?$ ?\* ?\! ?\" ?\' ?\` ?\# ?\\))) "List of characters to quote when in a file name. This variable is used to initialize `comint-file-name-quote-list' in the -shell buffer. The value may depend on the operating system or shell. +shell buffer. The value may depend on the operating system or shell." + :type '(repeat character) + :group 'shell) -This is a fine thing to set in your `.emacs' file.") - -(defvar shell-dynamic-complete-functions +(defcustom shell-dynamic-complete-functions '(comint-c-a-p-replace-by-expanded-history shell-environment-variable-completion shell-command-completion @@ -192,9 +186,9 @@ This is a fine thing to set in your `.emacs' file.") comint-filename-completion) "List of functions called to perform completion. This variable is used to initialize `comint-dynamic-complete-functions' in the -shell buffer. - -This is a fine thing to set in your `.emacs' file.") +shell buffer." + :type '(repeat function) + :group 'shell) (defcustom shell-command-regexp "[^;&|\n]+" "Regexp to match a single command within a pipeline. From 865fe16fd25fb066c3da1f71a2bb115aa807af8d Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 17 Sep 2012 13:41:04 +0800 Subject: [PATCH 64/88] Update docstrings and comments to use "init file" terminology. * bookmark.el (bookmark-bmenu-toggle-filenames): Doc fixes. * comint.el (comint-prompt-read-only): * custom.el (defcustom): * hi-lock.el (hi-lock-mode): * ibuffer.el (ibuffer-formats): * ielm.el (ielm-prompt-read-only): * novice.el (disable-command): * saveplace.el (toggle-save-place): * speedbar.el (speedbar-supported-extension-expressions): * startup.el (auto-save-list-file-prefix, init-file-user) (after-init-hook, inhibit-startup-echo-area-message): * strokes.el (strokes-help): * time-stamp.el (time-stamp): * calendar/calendar.el (calendar, diary-file): * calendar/diary-lib.el (diary-mail-entries, diary) (diary-list-entries-hook): * calendar/holidays.el (holidays, calendar-holidays): * calendar/lunar.el (lunar-phases): * calendar/solar.el (sunrise-sunset): * emulation/edt.el (edt-load-keys): * emulation/viper.el (viper-mode): * eshell/em-alias.el (eshell-command-aliases-list): * eshell/esh-util.el (eshell-convert-numeric-arguments): * international/ogonek.el (ogonek-information): * net/tramp-cmds.el (tramp-bug): * net/quickurl.el (quickurl-reread-hook-postfix): * play/decipher.el (decipher-font-lock-keywords): * progmodes/cc-styles.el (c-set-style): * progmodes/idlw-shell.el (idlwave-shell-prompt-pattern): * progmodes/inf-lisp.el (inferior-lisp-prompt): * progmodes/octave-mod.el (octave-mode): * progmodes/sql.el (sql-mode, sql-interactive-mode, sql-password): * progmodes/verilog-mode.el (verilog-read-defines): * textmodes/two-column.el (2C-mode): Likewise. --- lisp/ChangeLog | 35 +++++++++++++++++++++++ lisp/align.el | 2 +- lisp/autoinsert.el | 2 +- lisp/bookmark.el | 5 +--- lisp/calc/calc-ext.el | 2 +- lisp/calc/calc-forms.el | 2 +- lisp/calendar/calendar.el | 4 +-- lisp/calendar/diary-lib.el | 24 +++++++++------- lisp/calendar/holidays.el | 6 ++-- lisp/calendar/lunar.el | 2 +- lisp/calendar/solar.el | 2 +- lisp/calendar/timeclock.el | 4 +-- lisp/comint.el | 2 +- lisp/custom.el | 2 +- lisp/desktop.el | 2 +- lisp/emacs-lisp/byte-run.el | 2 +- lisp/emacs-lisp/cl-lib.el | 2 +- lisp/emulation/edt-mapper.el | 4 +-- lisp/emulation/edt.el | 10 +++---- lisp/emulation/tpu-edt.el | 6 ++-- lisp/emulation/tpu-extras.el | 2 +- lisp/emulation/tpu-mapper.el | 2 +- lisp/emulation/vi.el | 2 +- lisp/emulation/viper.el | 4 +-- lisp/erc/ChangeLog | 6 ++++ lisp/erc/erc-button.el | 2 +- lisp/erc/erc-capab.el | 2 +- lisp/erc/erc-match.el | 2 +- lisp/erc/erc-netsplit.el | 2 +- lisp/erc/erc-page.el | 2 +- lisp/erc/erc-replace.el | 2 +- lisp/erc/erc-stamp.el | 2 +- lisp/erc/erc-track.el | 2 +- lisp/eshell/em-alias.el | 8 +++--- lisp/eshell/esh-util.el | 2 +- lisp/ffap.el | 4 +-- lisp/filesets.el | 2 +- lisp/flow-ctrl.el | 2 +- lisp/font-lock.el | 2 +- lisp/frame.el | 2 +- lisp/generic-x.el | 2 +- lisp/hi-lock.el | 6 ++-- lisp/ibuffer.el | 12 ++++---- lisp/ielm.el | 2 +- lisp/international/ogonek.el | 7 +++-- lisp/locate.el | 2 +- lisp/mail/feedmail.el | 5 ++-- lisp/mail/mail-hist.el | 2 +- lisp/mail/uce.el | 2 +- lisp/mouse-copy.el | 2 +- lisp/mouse-drag.el | 2 +- lisp/net/ange-ftp.el | 14 ++++----- lisp/net/browse-url.el | 3 +- lisp/net/goto-addr.el | 2 +- lisp/net/newsticker.el | 2 +- lisp/net/quickurl.el | 2 +- lisp/net/tramp-cmds.el | 2 +- lisp/net/webjump.el | 2 +- lisp/novice.el | 4 +-- lisp/pcomplete.el | 2 +- lisp/play/bubbles.el | 2 +- lisp/play/decipher.el | 14 +-------- lisp/play/handwrite.el | 2 +- lisp/printing.el | 10 +++---- lisp/progmodes/antlr-mode.el | 2 +- lisp/progmodes/cc-styles.el | 4 +-- lisp/progmodes/cmacexp.el | 2 +- lisp/progmodes/ebnf2ps.el | 4 +-- lisp/progmodes/f90.el | 5 ++-- lisp/progmodes/hideshow.el | 2 +- lisp/progmodes/idlw-complete-structtag.el | 4 +-- lisp/progmodes/idlw-shell.el | 6 ++-- lisp/progmodes/idlwave.el | 4 +-- lisp/progmodes/inf-lisp.el | 4 +-- lisp/progmodes/mixal-mode.el | 2 +- lisp/progmodes/octave-mod.el | 4 +-- lisp/progmodes/perl-mode.el | 4 +-- lisp/progmodes/prolog.el | 4 +-- lisp/progmodes/sql.el | 15 +++++----- lisp/progmodes/verilog-mode.el | 4 +-- lisp/ps-print.el | 2 +- lisp/saveplace.el | 12 ++++---- lisp/shell.el | 2 +- lisp/speedbar.el | 2 +- lisp/startup.el | 27 ++++++++++------- lisp/strokes.el | 9 +----- lisp/term/iris-ansi.el | 2 +- lisp/term/lk201.el | 2 +- lisp/term/rxvt.el | 2 +- lisp/term/tvi970.el | 2 +- lisp/term/wyse50.el | 2 +- lisp/term/xterm.el | 2 +- lisp/textmodes/flyspell.el | 6 ++-- lisp/textmodes/ispell.el | 5 ++-- lisp/textmodes/reftex.el | 4 +-- lisp/textmodes/rst.el | 2 +- lisp/textmodes/sgml-mode.el | 2 +- lisp/textmodes/table.el | 10 +++---- lisp/textmodes/two-column.el | 5 ++-- lisp/time-stamp.el | 4 +-- lisp/url/url-methods.el | 2 +- lisp/vc/pcvs-defs.el | 4 --- lisp/vc/vc-git.el | 2 +- lisp/windmove.el | 2 +- 104 files changed, 238 insertions(+), 225 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 217187c5e88..275f7908f5d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -4,6 +4,41 @@ (shell-dynamic-complete-functions): Convert to defcustom. (shell-prompt-pattern, shell-completion-fignore): Doc fix. + * bookmark.el (bookmark-bmenu-toggle-filenames): Doc fixes. + * comint.el (comint-prompt-read-only): + * custom.el (defcustom): + * hi-lock.el (hi-lock-mode): + * ibuffer.el (ibuffer-formats): + * ielm.el (ielm-prompt-read-only): + * novice.el (disable-command): + * saveplace.el (toggle-save-place): + * speedbar.el (speedbar-supported-extension-expressions): + * startup.el (auto-save-list-file-prefix, init-file-user) + (after-init-hook, inhibit-startup-echo-area-message): + * strokes.el (strokes-help): + * time-stamp.el (time-stamp): + * calendar/calendar.el (calendar, diary-file): + * calendar/diary-lib.el (diary-mail-entries, diary) + (diary-list-entries-hook): + * calendar/holidays.el (holidays, calendar-holidays): + * calendar/lunar.el (lunar-phases): + * calendar/solar.el (sunrise-sunset): + * emulation/edt.el (edt-load-keys): + * emulation/viper.el (viper-mode): + * eshell/em-alias.el (eshell-command-aliases-list): + * eshell/esh-util.el (eshell-convert-numeric-arguments): + * international/ogonek.el (ogonek-information): + * net/tramp-cmds.el (tramp-bug): + * net/quickurl.el (quickurl-reread-hook-postfix): + * play/decipher.el (decipher-font-lock-keywords): + * progmodes/cc-styles.el (c-set-style): + * progmodes/idlw-shell.el (idlwave-shell-prompt-pattern): + * progmodes/inf-lisp.el (inferior-lisp-prompt): + * progmodes/octave-mod.el (octave-mode): + * progmodes/sql.el (sql-mode, sql-interactive-mode, sql-password): + * progmodes/verilog-mode.el (verilog-read-defines): + * textmodes/two-column.el (2C-mode): Likewise. + 2012-09-16 Katsumi Yamaoka * mail/mailabbrev.el (mail-abbrev-expand-hook): Work for a mail aliasee diff --git a/lisp/align.el b/lisp/align.el index b5c4c442f24..0af5e56c668 100644 --- a/lisp/align.el +++ b/lisp/align.el @@ -74,7 +74,7 @@ ;; align-?-modes variables (for example, `align-dq-string-modes'), use ;; `add-to-list', or some similar function which checks first to see ;; if the value is already there. Since the user may customize that -;; mode list, and then write your mode name into their .emacs file, +;; mode list, and then write your mode name into their init file, ;; causing the symbol already to be present the next time they load ;; your package. diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el index fbf8c466585..21c35811ac3 100644 --- a/lisp/autoinsert.el +++ b/lisp/autoinsert.el @@ -36,7 +36,7 @@ ;; setq auto-insert-directory to an appropriate slash-terminated value ;; ;; You can also customize the variable `auto-insert-mode' to load the -;; package. Alternatively, add the following to your .emacs file: +;; package. Alternatively, add the following to your init file: ;; (auto-insert-mode 1) ;; ;; Author: Charlie Martin diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 75a8d9f59dc..31bbc13acf9 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -144,10 +144,7 @@ You can toggle whether files are shown with \\\\[bookma (defcustom bookmark-bmenu-toggle-filenames t "Non-nil means show filenames when listing bookmarks. -This may result in truncated bookmark names. To disable this, put the -following in your `.emacs' file: - -\(setq bookmark-bmenu-toggle-filenames nil)" +A non-nil value may result in truncated bookmark names." :type 'boolean :group 'bookmark) diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 2fd5ad6fd9c..c7d93530fd7 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -3483,7 +3483,7 @@ If X is not an error form, return 1." (substring str i)))) str)) -;;; Users can redefine this in their .emacs files. +;;; Users can redefine this in their init files. (defvar calc-keypad-user-menu nil "If non-nil, this describes an additional menu for calc-keypad. It should contain a list of three rows. diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el index dfc5dfc6588..bd748158d66 100644 --- a/lisp/calc/calc-forms.el +++ b/lisp/calc/calc-forms.el @@ -494,7 +494,7 @@ (car res)))))))) -;;; It is safe to redefine these in your .emacs file to use a different +;;; It is safe to redefine these in your init file to use a different ;;; language. (defvar math-long-weekday-names '( "Sunday" "Monday" "Tuesday" "Wednesday" diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index d5514d14a32..cdbf8d7aa86 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -593,7 +593,7 @@ You can customize `diary-date-forms' to your preferred format. Three default styles are provided: `diary-american-date-forms', `diary-european-date-forms', and `diary-iso-date-forms'. You can choose between these by setting `calendar-date-style' in your -.emacs file, or by using `calendar-set-date-style' when in the calendar. +init file, or by using `calendar-set-date-style' when in the calendar. A diary entry can be preceded by the character `diary-nonmarking-symbol' \(ordinarily `&') to make that entry nonmarking--that is, it will not be @@ -1276,7 +1276,7 @@ Runs the following hooks: generating a calendar, if today's date is visible or not, respectively `calendar-initial-window-hook' - after first creating a calendar -This function is suitable for execution in a .emacs file." +This function is suitable for execution in an init file." (interactive "P") ;; Avoid loading cal-x unless it will be used. (if (and (memq calendar-setup '(one-frame two-frames calendar-only)) diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 8fa5b0ddb07..4bce8ec0927 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -200,19 +200,21 @@ holidays), or hard copy output." 'diary-list-entries-hook "23.1") (defcustom diary-list-entries-hook nil - "List of functions called after diary file is culled for relevant entries. -You might wish to add `diary-include-other-diary-files', in which case -you will probably also want to add `diary-mark-included-diary-files' to -`diary-mark-entries-hook'. For example, you could use + "Hook run after diary file is culled for relevant entries. + +If you add `diary-include-other-diary-files' to this hook, you +will probably also want to add `diary-mark-included-diary-files' +to `diary-mark-entries-hook'. For example, to cause the fancy +diary buffer to be displayed with diary entries from various +included files, each day's entries sorted into lexicographic +order, add the following to your init file: (setq diary-display-function 'diary-fancy-display) (add-hook 'diary-list-entries-hook 'diary-include-other-diary-files) (add-hook 'diary-list-entries-hook 'diary-sort-entries t) -in your `.emacs' file to cause the fancy diary buffer to be displayed with -diary entries from various included files, each day's entries sorted into -lexicographic order. Note how the sort function is placed last, -so that it can sort the entries included from other files. +Note how the sort function is placed last, so that it can sort +the entries included from other files. This hook runs after `diary-nongregorian-listing-hook'. These two hooks differ only if you are using included diary files. In that case, @@ -532,7 +534,7 @@ If so, return the expanded file name, otherwise signal an error." "Generate the diary window for ARG days starting with the current date. If no argument is provided, the number of days of diary entries is governed by the variable `diary-number-of-entries'. A value of ARG less than 1 -does nothing. This function is suitable for execution in a `.emacs' file." +does nothing. This function is suitable for execution in an init file." (interactive "P") (diary-check-diary-file) (diary-list-entries (calendar-current-date) @@ -1230,8 +1232,8 @@ Mail is sent to the address specified by `diary-mail-addr'. Here is an example of a script to call `diary-mail-entries', suitable for regular scheduling using cron (or at). Note that -since `emacs -script' does not load your `.emacs' file, you -should ensure that all relevant variables are set. +since `emacs -script' does not load your init file, you should +ensure that all relevant variables are set. #!/usr/bin/emacs -script ;; diary-rem.el - run the Emacs diary-reminder diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el index 9643a1e2905..b94815f98ea 100644 --- a/lisp/calendar/holidays.el +++ b/lisp/calendar/holidays.el @@ -343,12 +343,12 @@ See the documentation for `calendar-holidays' for details." "List of notable days for the command \\[holidays]. Additional holidays are easy to add to the list, just put them in the -list `holiday-other-holidays' in your .emacs file. Similarly, by setting +list `holiday-other-holidays' in your init file. Similarly, by setting any of `holiday-general-holidays', `holiday-local-holidays', `holiday-christian-holidays', `holiday-hebrew-holidays', `holiday-islamic-holidays', `holiday-bahai-holidays', `holiday-oriental-holidays', or `holiday-solar-holidays' to nil in your -.emacs file, you can eliminate unwanted categories of holidays. +init file, you can eliminate unwanted categories of holidays. The aforementioned variables control the holiday choices offered by the function `holiday-list' when it is called interactively. @@ -523,7 +523,7 @@ use instead of point." (defun holidays (&optional arg) "Display the holidays for last month, this month, and next month. If called with an optional prefix argument ARG, prompts for month and year. -This function is suitable for execution in a .emacs file." +This function is suitable for execution in a init file." (interactive "P") (save-excursion (let* ((completion-ignore-case t) diff --git a/lisp/calendar/lunar.el b/lisp/calendar/lunar.el index 8f09d20f50e..2761df0bdb1 100644 --- a/lisp/calendar/lunar.el +++ b/lisp/calendar/lunar.el @@ -236,7 +236,7 @@ use instead of point." (defun lunar-phases (&optional arg) "Display the quarters of the moon for last month, this month, and next month. If called with an optional prefix argument ARG, prompts for month and year. -This function is suitable for execution in a .emacs file." +This function is suitable for execution in an init file." (interactive "P") (save-excursion (let* ((date (if arg (calendar-read-date t) diff --git a/lisp/calendar/solar.el b/lisp/calendar/solar.el index a8d7d44af3b..3ccdf135fb6 100644 --- a/lisp/calendar/solar.el +++ b/lisp/calendar/solar.el @@ -797,7 +797,7 @@ If called with an optional prefix argument ARG, prompt for date. If called with an optional double prefix argument, prompt for longitude, latitude, time zone, and date, and always use standard time. -This function is suitable for execution in a .emacs file." +This function is suitable for execution in an init file." (interactive "p") (or arg (setq arg 1)) (if (and (< arg 16) diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el index 2ebb8c7c3ae..3151ce145de 100644 --- a/lisp/calendar/timeclock.el +++ b/lisp/calendar/timeclock.el @@ -49,7 +49,7 @@ ;; If you want Emacs to display the amount of time "left" to your ;; workday in the mode-line, you can either set the value of ;; `timeclock-mode-line-display' to t using M-x customize, or you can -;; add this code to your .emacs file: +;; add this code to your init file: ;; ;; (require 'timeclock) ;; (timeclock-mode-line-display) @@ -60,7 +60,7 @@ ;; You may also want Emacs to ask you before exiting, if you are ;; currently working on a project. This can be done either by setting ;; `timeclock-ask-before-exiting' to t using M-x customize (this is -;; the default), or by adding the following to your .emacs file: +;; the default), or by adding the following to your init file: ;; ;; (add-hook 'kill-emacs-query-functions 'timeclock-query-out) diff --git a/lisp/comint.el b/lisp/comint.el index 5b0eb3027e6..638ef73d53d 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -181,7 +181,7 @@ override the read-only-ness of comint prompts is to call `comint-kill-whole-line' or `comint-kill-region' with no narrowing in effect. This way you will be certain that none of the remaining prompts will be accidentally messed up. You may -wish to put something like the following in your `.emacs' file: +wish to put something like the following in your init file: \(add-hook 'comint-mode-hook (lambda () diff --git a/lisp/custom.el b/lisp/custom.el index 1f0729cfd97..01b0e6d1650 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -237,7 +237,7 @@ The following keywords are meaningful: is `default-value'. :require VALUE should be a feature symbol. If you save a value - for this option, then when your `.emacs' file loads the value, + for this option, then when your init file loads the value, it does (require VALUE) first. :set-after VARIABLES Specifies that SYMBOL should be set after the list of variables diff --git a/lisp/desktop.el b/lisp/desktop.el index a873a6b63bf..75deb58b4d8 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -34,7 +34,7 @@ ;; - some local variables ;; To use this, use customize to turn on desktop-save-mode or add the -;; following line somewhere in your .emacs file: +;; following line somewhere in your init file: ;; ;; (desktop-save-mode 1) ;; diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index d1382f42b19..93e890a20c9 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -312,7 +312,7 @@ This uses `defvaralias' and `make-obsolete-variable' (which see). See the Info node `(elisp)Variable Aliases' for more details. If CURRENT-NAME is a defcustom (more generally, any variable -where OBSOLETE-NAME may be set, e.g. in a .emacs file, before the +where OBSOLETE-NAME may be set, e.g. in an init file, before the alias is defined), then the define-obsolete-variable-alias statement should be evaluated before the defcustom, if user customizations are to be respected. The simplest way to achieve diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index 532c81c502c..5749ff91b40 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el @@ -121,7 +121,7 @@ a future Emacs interpreter will be able to use it.") ;;; Generalized variables. ;; These macros are defined here so that they -;; can safely be used in .emacs files. +;; can safely be used in init files. (defmacro cl-incf (place &optional x) "Increment PLACE by X (1 by default). diff --git a/lisp/emulation/edt-mapper.el b/lisp/emulation/edt-mapper.el index 7fc24773b9e..87b6bcf0aa9 100644 --- a/lisp/emulation/edt-mapper.el +++ b/lisp/emulation/edt-mapper.el @@ -61,7 +61,7 @@ ;; emacs -q -l edt-mapper.el -;; The "-q" option prevents loading of your .emacs file (commands +;; The "-q" option prevents loading of your init file (commands ;; therein might confuse this program). ;; An instruction screen showing the typical LK-201 terminal @@ -74,7 +74,7 @@ ;; and loaded automatically when the EDT emulation is started. If ;; you specify a different file name, you will need to set the ;; variable "edt-keys-file" before starting the EDT emulation. -;; Here's how you might go about doing that in your .emacs file. +;; Here's how you might go about doing that in your init file: ;; (setq edt-keys-file (expand-file-name "~/.my-emacs-keys")) diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el index dbd13a01a8b..3810dcccbb3 100644 --- a/lisp/emulation/edt.el +++ b/lisp/emulation/edt.el @@ -48,7 +48,7 @@ ;; You can have the EDT Emulation start up automatically, each time ;; you initiate a GNU Emacs session, by adding the following line to -;; your .emacs file: +;; your init file: ;; ;; (add-hook term-setup-hook 'edt-emulation-on) @@ -75,7 +75,7 @@ ;; default, this feature is enabled, with the top margin set to ;; 10% of the window and the bottom margin set to 15% of the ;; window. To change these settings, you can invoke the function -;; edt-set-scroll-margins in your .emacs file. For example, the +;; edt-set-scroll-margins in your init file. For example, the ;; following line ;; ;; (edt-set-scroll-margins "20%" "25%") @@ -363,7 +363,7 @@ This means that an edt-user.el file was found in the user's `load-path'.") ;;; ;;; (setq edt-keep-current-page-delimiter t) ;;; -;;; in your .emacs file. +;;; in your init file. (defun edt-page-forward (num) "Move forward to just after next page delimiter. @@ -1961,14 +1961,14 @@ created." Ack!! You're running the Enhanced EDT Emulation without loading an EDT key mapping file. To create an EDT key mapping file, run the edt-mapper program. It is safest to run it from an Emacs loaded - without any of your own customizations found in your .emacs file, etc. + without any of your own customizations found in your init file, etc. The reason for this is that some user customizations confuse edt-mapper. You can do this by quitting Emacs and then invoking Emacs again as follows: emacs -q -l edt-mapper - [NOTE: If you do nothing out of the ordinary in your .emacs file, and + [NOTE: If you do nothing out of the ordinary in your init file, and the search for edt-mapper is successful, you can try running it now.] The library edt-mapper includes these same directions on how to diff --git a/lisp/emulation/tpu-edt.el b/lisp/emulation/tpu-edt.el index b8d07e8b744..d375725af56 100644 --- a/lisp/emulation/tpu-edt.el +++ b/lisp/emulation/tpu-edt.el @@ -163,8 +163,8 @@ ;; and type `tpu-edt' followed by a carriage return. ;; If you like TPU-edt and want to use it all the time, you can start -;; TPU-edt using the Emacs initialization file, .emacs. Simply create -;; a .emacs file in your home directory containing the line: +;; TPU-edt using the Emacs initialization file, .emacs. Simply add +;; the following line to your init file: ;; (tpu-edt) @@ -2440,7 +2440,7 @@ If FILE is nil, try to load a default file. The default file names are ;;;### (autoloads (tpu-set-cursor-bound tpu-set-cursor-free tpu-set-scroll-margins -;;;;;; tpu-cursor-free-mode) "tpu-extras" "tpu-extras.el" "76f06905db4c5bfb3b86491a51512a0e") +;;;;;; tpu-cursor-free-mode) "tpu-extras" "tpu-extras.el" "bf5e7322f9a2c324a3bb306415813374") ;;; Generated autoloads from tpu-extras.el (autoload 'tpu-cursor-free-mode "tpu-extras" "\ diff --git a/lisp/emulation/tpu-extras.el b/lisp/emulation/tpu-extras.el index 521b189e3bc..4cf9eee037b 100644 --- a/lisp/emulation/tpu-extras.el +++ b/lisp/emulation/tpu-extras.el @@ -26,7 +26,7 @@ ;; Use the functions defined here to customize TPU-edt to your tastes by ;; setting scroll margins and/or turning on free cursor mode. Here's an -;; example for your .emacs file. +;; example for your init file. ;; (tpu-set-cursor-free) ; Set cursor free. ;; (tpu-set-scroll-margins "10%" "15%") ; Set scroll margins. diff --git a/lisp/emulation/tpu-mapper.el b/lisp/emulation/tpu-mapper.el index ef4e9b305fc..9cced60816c 100644 --- a/lisp/emulation/tpu-mapper.el +++ b/lisp/emulation/tpu-mapper.el @@ -81,7 +81,7 @@ Finally, you will be prompted for the name of the file to store the key definitions. If you chose the default, TPU-edt will find it and load it automatically. If you specify a different file name, you will need to set the variable ``tpu-xkeys-file'' before starting TPU-edt. Here's how -you might go about doing that in your .emacs file. +you might go about doing that in your init file. (setq tpu-xkeys-file (expand-file-name \"~/.my-emacs-x-keys\")) (tpu-edt) diff --git a/lisp/emulation/vi.el b/lisp/emulation/vi.el index 9bf108c8c38..a59dd610c21 100644 --- a/lisp/emulation/vi.el +++ b/lisp/emulation/vi.el @@ -28,7 +28,7 @@ ;; (if (not (or (eq major-mode 'Info-mode) ;; (eq major-mode 'vi-mode))) ;; (vi-mode)))))) -;; 3) In your .emacs file you can define the command "vi-mode" to be "autoload" +;; 3) In your init file you can define the command "vi-mode" to be "autoload" ;; or you can execute the "load" command to load "vi" directly. ;; 4) Read the comments for command "vi-mode" before you start using it. diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index 81fbfb0394c..8de253d19b0 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el @@ -351,7 +351,7 @@ user decide when to invoke Viper in a major mode." If t, viperize Emacs. If nil -- don't. If `ask', ask the user. This variable is used primarily when Viper is being loaded. -Must be set in `~/.emacs' before Viper is loaded. +Must be set in your init file before Viper is loaded. DO NOT set this variable interactively, unless you are using the customization widget." :type '(choice (const nil) (const t) (const ask)) @@ -1173,7 +1173,7 @@ If you wish to Viperize AND make this your way of life, please put (setq viper-mode t) (require 'viper) -in your .emacs file (preferably, close to the top). +in your init file (preferably, close to the top). These two lines must come in the order given. ** Viper users: diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 37e755e7655..674a6c97eec 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,9 @@ +2012-09-17 Chong Yidong + + * erc-page.el (erc-page-function): + + * erc-stamp.el (erc-stamp): Doc fix. + 2012-08-21 Josh Feinstein * erc-join.el (erc-autojoin-timing): Fix defcustom type. diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index c8a7fec32bd..a0593dcb743 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -25,7 +25,7 @@ ;; Heavily borrowed from gnus-art.el. Thanks to the original authors. ;; This buttonizes nicks and other stuff to make it all clickable. -;; To enable, add to your ~/.emacs: +;; To enable, add to your init file: ;; (require 'erc-button) ;; (erc-button-mode 1) ;; diff --git a/lisp/erc/erc-capab.el b/lisp/erc/erc-capab.el index 4f6361ee923..c7103d6dc61 100644 --- a/lisp/erc/erc-capab.el +++ b/lisp/erc/erc-capab.el @@ -48,7 +48,7 @@ ;;; Usage: -;; Put the following in your ~/.emacs file. +;; Put the following in your init file. ;; (require 'erc-capab) ;; (erc-capab-identify-mode 1) diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el index cac042c0298..de7f2137197 100644 --- a/lisp/erc/erc-match.el +++ b/lisp/erc/erc-match.el @@ -29,7 +29,7 @@ ;; customizable variables. ;; Usage: -;; Put (erc-match-mode 1) into your ~/.emacs file. +;; Put (erc-match-mode 1) into your init file. ;;; Code: diff --git a/lisp/erc/erc-netsplit.el b/lisp/erc/erc-netsplit.el index 44fbc9563d6..355b345492c 100644 --- a/lisp/erc/erc-netsplit.el +++ b/lisp/erc/erc-netsplit.el @@ -23,7 +23,7 @@ ;;; Commentary: ;; This module hides quit/join messages if a netsplit occurs. -;; To enable, add the following to your ~/.emacs: +;; To enable, add the following to your init file: ;; (require 'erc-netsplit) ;; (erc-netsplit-mode 1) diff --git a/lisp/erc/erc-page.el b/lisp/erc/erc-page.el index e6b670c91ba..51ddc33e1c0 100644 --- a/lisp/erc/erc-page.el +++ b/lisp/erc/erc-page.el @@ -45,7 +45,7 @@ If nil, this prints the page message in the minibuffer and calls `beep'. If non-nil, it must be a function that takes two arguments: SENDER and MSG, both strings. -Example for your ~/.emacs file: +Example for your init file: \(setq erc-page-function (lambda (sender msg) diff --git a/lisp/erc/erc-replace.el b/lisp/erc/erc-replace.el index 04c5885bc3e..6c5804c62a4 100644 --- a/lisp/erc/erc-replace.el +++ b/lisp/erc/erc-replace.el @@ -25,7 +25,7 @@ ;; This module allows you to systematically replace text in incoming ;; messages. Load erc-replace, and customize `erc-replace-alist'. -;; Then add to your ~/.emacs: +;; Then add to your init file: ;; (require 'erc-replace) ;; (erc-replace-mode 1) diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el index 5831233affe..4ce2f18e041 100644 --- a/lisp/erc/erc-stamp.el +++ b/lisp/erc/erc-stamp.el @@ -43,7 +43,7 @@ group provides settings related to the format and display of timestamp information in `erc-mode' buffer. For timestamping to be activated, you just need to load `erc-stamp' -in your .emacs file or interactively using `load-library'." +in your init file or interactively using `load-library'." :group 'erc) (defcustom erc-timestamp-format "[%H:%M]" diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el index 9c56c724224..88a3285730d 100644 --- a/lisp/erc/erc-track.el +++ b/lisp/erc/erc-track.el @@ -24,7 +24,7 @@ ;;; Commentary: ;; Highlights keywords and pals (friends), and hides or highlights fools -;; (using a dark color). Add to your ~/.emacs: +;; (using a dark color). Add to your init file: ;; (require 'erc-track) ;; (erc-track-mode 1) diff --git a/lisp/eshell/em-alias.el b/lisp/eshell/em-alias.el index 4b62fec95e6..940056b6438 100644 --- a/lisp/eshell/em-alias.el +++ b/lisp/eshell/em-alias.el @@ -133,10 +133,10 @@ Each element of this alias is a list of the form: Where NAME is the textual name of the alias, and DEFINITION is the command string to replace that command with. -Note: this list should not be modified in your '.emacs' file. Rather, -any desired alias definitions should be declared using the `alias' -command, which will automatically write them to the file named by -`eshell-aliases-file'.") +Note: this list should not be modified in your init file. +Rather, any desired alias definitions should be declared using +the `alias' command, which will automatically write them to the +file named by `eshell-aliases-file'.") (put 'eshell-command-aliases-list 'risky-local-variable t) diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el index 8218e91ddc7..fa0336232f9 100644 --- a/lisp/eshell/esh-util.el +++ b/lisp/eshell/esh-util.el @@ -84,7 +84,7 @@ Numeric form is tested using the regular expression NOTE: If you find that numeric conversions are interfering with the specification of filenames (for example, in calling `find-file', or some other Lisp function that deals with files, not numbers), add the -following in your .emacs file: +following in your init file: (put 'find-file 'eshell-no-numeric-conversions t) diff --git a/lisp/ffap.el b/lisp/ffap.el index ebe8b6dee94..f3e8d4c194e 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -34,7 +34,7 @@ ;; README's, MANIFEST's, and so on. Submit bugs or suggestions with ;; M-x ffap-bug. ;; -;; For the default installation, add this line to your .emacs file: +;; For the default installation, add this line to your init file: ;; ;; (ffap-bindings) ; do default key bindings ;; @@ -206,7 +206,7 @@ Sensible values are nil, \"news\", or \"mailto\"." ;; those features interesting but not clear winners (a matter of ;; personal taste) I try to leave options to enable them. Read ;; through this section for features that you like, put an appropriate -;; enabler in your .emacs file. +;; enabler in your init file. (defcustom ffap-dired-wildcards "[*?][^/]*\\'" "A regexp matching filename wildcard characters, or nil. diff --git a/lisp/filesets.el b/lisp/filesets.el index 6c24a4f43d6..a91d8cf0fcb 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -35,7 +35,7 @@ ;; inclusion group (i.e. a base file including other files). ;; Usage: -;; 1. Put (require 'filesets) and (filesets-init) in your .emacs file. +;; 1. Put (require 'filesets) and (filesets-init) in your init file. ;; 2. Type ;; M-x filesets-edit or choose "Edit Filesets" from the menu. ;; 3. Save your customizations. diff --git a/lisp/flow-ctrl.el b/lisp/flow-ctrl.el index 747a4ca018c..b301886de5b 100644 --- a/lisp/flow-ctrl.el +++ b/lisp/flow-ctrl.el @@ -31,7 +31,7 @@ ;; ;; To invoke these adjustments, a user need only invoke the function ;; enable-flow-control-on with a list of terminal types in his/her own -;; .emacs file. As arguments, give it the names of one or more terminal +;; init file. As arguments, give it the names of one or more terminal ;; types in use by that user which require flow control adjustments. ;; Here's an example: ;; diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 77c21d26535..6404af7703a 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -37,7 +37,7 @@ ;; When this minor mode is on, the faces of the current line are updated with ;; every insertion or deletion. ;; -;; To turn Font Lock mode on automatically, add this to your ~/.emacs file: +;; To turn Font Lock mode on automatically, add this to your init file: ;; ;; (add-hook 'emacs-lisp-mode-hook 'turn-on-font-lock) ;; diff --git a/lisp/frame.el b/lisp/frame.el index c182a964820..0bef358ecfb 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -301,7 +301,7 @@ there (in decreasing order of priority)." ;; existing frame. We need to explicitly include ;; default-frame-alist in the parameters of the screen we ;; create here, so that its new value, gleaned from the user's - ;; .emacs file, will be applied to the existing screen. + ;; init file, will be applied to the existing screen. (if (not (eq (cdr (or (assq 'minibuffer initial-frame-alist) (assq 'minibuffer window-system-frame-alist) (assq 'minibuffer default-frame-alist) diff --git a/lisp/generic-x.el b/lisp/generic-x.el index cc7963b1711..a97c5649c95 100644 --- a/lisp/generic-x.el +++ b/lisp/generic-x.el @@ -28,7 +28,7 @@ ;; ;; INSTALLATION: ;; -;; Add this line to your .emacs file: +;; Add this line to your init file: ;; ;; (require 'generic-x) ;; diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index 644024a4b86..f92e2ab0af2 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -52,14 +52,14 @@ ;; ;; Setup: ;; -;; Put the following code in your .emacs file. This turns on +;; Put the following code in your init file. This turns on ;; hi-lock mode and adds a "Regexp Highlighting" entry ;; to the edit menu. ;; ;; (global-hi-lock-mode 1) ;; ;; To enable the use of patterns found in files (presumably placed -;; there by hi-lock) include the following in your .emacs file: +;; there by hi-lock) include the following in your init file: ;; ;; (setq hi-lock-file-patterns-policy 'ask) ;; @@ -356,7 +356,7 @@ Hi-lock: end is found. A mode is excluded if it's in the list "Possible archaic use of (hi-lock-mode). Use (global-hi-lock-mode 1) in .emacs to enable hi-lock for all buffers, use (hi-lock-mode 1) for individual buffers. For compatibility with Emacs -versions before 22 use the following in your .emacs file: +versions before 22 use the following in your init file: (if (functionp 'global-hi-lock-mode) (global-hi-lock-mode 1) diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index c6e799252a2..77461469044 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -123,13 +123,13 @@ own!): no upper limit on its size. The size will also be aligned to the right. -Thus, if you wanted to use these two formats, add +Thus, if you wanted to use these two formats, the appropriate +value for this variable would be - (setq ibuffer-formats '((mark \" \" name) - (mark modified read-only - (name 16 16 :left) (size 6 -1 :right)))) - -to your ~/.emacs file. + '((mark \" \" name) + (mark modified read-only + (name 16 16 :left) + (size 6 -1 :right))) Using \\[ibuffer-switch-format], you can rotate the display between the specified formats in the list." diff --git a/lisp/ielm.el b/lisp/ielm.el index c93f235d81f..ba05bbcfc0f 100644 --- a/lisp/ielm.el +++ b/lisp/ielm.el @@ -59,7 +59,7 @@ override the read-only-ness of IELM prompts is to call `comint-kill-whole-line' or `comint-kill-region' with no narrowing in effect. This way you will be certain that none of the remaining prompts will be accidentally messed up. You may -wish to put something like the following in your `.emacs' file: +wish to put something like the following in your init file: \(add-hook 'ielm-mode-hook (lambda () diff --git a/lisp/international/ogonek.el b/lisp/international/ogonek.el index 39a88001112..3c34e5d9a2a 100644 --- a/lisp/international/ogonek.el +++ b/lisp/international/ogonek.el @@ -224,13 +224,14 @@ The functions come in the following groups. ogonek-prefix-to-encoding iso8859-2 The above default values can be changed by placing appropriate settings - in the '~/.emacs' file: + in your init file: (setq ogonek-prefix-char ?/) (setq ogonek-prefix-to-encoding \"iso8859-2\") - Instead of loading the whole library `ogonek' it may be better to - autoload the needed functions, for example by placing in `~/.emacs': + Instead of loading the whole library `ogonek' it may be better + to autoload the needed functions, for example by adding the + following lines to your init file: (autoload 'ogonek-how \"ogonek\") (autoload 'ogonek-recode-region \"ogonek\") diff --git a/lisp/locate.el b/lisp/locate.el index 29d7c75cbb2..d172ce3d6c4 100644 --- a/lisp/locate.el +++ b/lisp/locate.el @@ -34,7 +34,7 @@ ;; ;; SHELLPROGRAM Name-to-find ;; -;; set the variable `locate-command' in your .emacs file. +;; set the variable `locate-command' in your init file. ;; ;; To use a more complicated expression, create a function which ;; takes a string (the name to find) as input and returns a list. diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el index 520271940f2..4305094611a 100644 --- a/lisp/mail/feedmail.el +++ b/lisp/mail/feedmail.el @@ -139,9 +139,8 @@ ;; feedmail-send-it. Hers's the best way to use the stuff in this ;; file: ;; -;; Save this file as feedmail.el somewhere on your elisp -;; loadpath; byte-compile it. Put the following lines somewhere in -;; your ~/.emacs stuff: +;; Save this file as feedmail.el somewhere on your elisp loadpath; +;; byte-compile it. Put the following lines in your init file: ;; ;; (setq send-mail-function 'feedmail-send-it) ;; (autoload 'feedmail-send-it "feedmail") diff --git a/lisp/mail/mail-hist.el b/lisp/mail/mail-hist.el index dd489e3c6a9..40d67b4e904 100644 --- a/lisp/mail/mail-hist.el +++ b/lisp/mail/mail-hist.el @@ -28,7 +28,7 @@ ;; time. ;; ;; To use this package, put it in a directory in your load-path, and -;; put this in your .emacs file: +;; put this in your init file: ;; ;; (load "mail-hist" nil t) ;; diff --git a/lisp/mail/uce.el b/lisp/mail/uce.el index fdfe17a1a07..3d7495ffd1a 100644 --- a/lisp/mail/uce.el +++ b/lisp/mail/uce.el @@ -63,7 +63,7 @@ ;; Usage: ;; Place uce.el in your load-path (and optionally byte-compile it). -;; Add the following line to your ~/.emacs: +;; Add the following line to your init file: ;; (autoload 'uce-reply-to-uce "uce" "Reply to UCEs" t nil) ;; If you want to use it with Gnus rather than Rmail: ;; (setq uce-mail-reader 'gnus) diff --git a/lisp/mouse-copy.el b/lisp/mouse-copy.el index 8d043b4495f..a8e32bec1ae 100644 --- a/lisp/mouse-copy.el +++ b/lisp/mouse-copy.el @@ -35,7 +35,7 @@ ;; If you like mouse-copy, you should also check out mouse-drag ;; for ``one-click scrolling''. ;; -;; To use mouse-copy, place the following in your .emacs file: +;; To use mouse-copy, place the following in your init file: ;; (require 'mouse-copy) ;; (global-set-key [M-down-mouse-1] 'mouse-drag-secondary-pasting) ;; (global-set-key [M-S-down-mouse-1] 'mouse-drag-secondary-moving) diff --git a/lisp/mouse-drag.el b/lisp/mouse-drag.el index 7fb10505355..acdad9a42cf 100644 --- a/lisp/mouse-drag.el +++ b/lisp/mouse-drag.el @@ -46,7 +46,7 @@ ;; If you like mouse-drag, you should also check out mouse-copy ;; for ``one-click text copy and move''. ;; -;; To use mouse-drag, place the following in your .emacs file: +;; To use mouse-drag, place the following in your init file: ;; -either- ;; (global-set-key [down-mouse-2] 'mouse-drag-throw) ;; -or- diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 1501fa41baa..265a855b842 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -79,7 +79,7 @@ ;; that this change will take effect for the current GNU Emacs session only. ;; See below for a discussion of non-UNIX hosts. If a large number of ;; machines with similar hostnames have this problem then it is easier to set -;; the value of ange-ftp-dumb-unix-host-regexp in your .emacs file. ange-ftp +;; the value of ange-ftp-dumb-unix-host-regexp in your init file. ange-ftp ;; is unable to automatically recognize dumb unix hosts. ;; File name completion: @@ -275,10 +275,10 @@ ;; VMS support: ;; -;; Ange-ftp has full support for VMS hosts. It -;; should be able to automatically recognize any VMS machine. However, if it -;; fails to do this, you can use the command ange-ftp-add-vms-host. As well, -;; you can set the variable ange-ftp-vms-host-regexp in your .emacs file. We +;; Ange-ftp has full support for VMS hosts. It should be able to +;; automatically recognize any VMS machine. However, if it fails to do +;; this, you can use the command ange-ftp-add-vms-host. Also, you can +;; set the variable ange-ftp-vms-host-regexp in your init file. We ;; would be grateful if you would report any failures to automatically ;; recognize a VMS host as a bug. ;; @@ -332,7 +332,7 @@ ;; the Michigan terminal system. It should be able to automatically ;; recognize any MTS machine. However, if it fails to do this, you can use ;; the command ange-ftp-add-mts-host. As well, you can set the variable -;; ange-ftp-mts-host-regexp in your .emacs file. We would be grateful if you +;; ange-ftp-mts-host-regexp in your init file. We would be grateful if you ;; would report any failures to automatically recognize a MTS host as a bug. ;; ;; Filename syntax: @@ -358,7 +358,7 @@ ;; CMS. It should be able to automatically recognize any CMS machine. ;; However, if it fails to do this, you can use the command ;; ange-ftp-add-cms-host. As well, you can set the variable -;; ange-ftp-cms-host-regexp in your .emacs file. We would be grateful if you +;; ange-ftp-cms-host-regexp in your init file. We would be grateful if you ;; would report any failures to automatically recognize a CMS host as a bug. ;; ;; Filename syntax: diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index d1d33bfe566..c1c83d2245e 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -122,8 +122,7 @@ ;; the buffer, use: ;; M-x browse-url -;; To display a URL by shift-clicking on it, put this in your ~/.emacs -;; file: +;; To display a URL by shift-clicking on it, put this in your init file: ;; (global-set-key [S-mouse-2] 'browse-url-at-mouse) ;; (Note that using Shift-mouse-1 is not desirable because ;; that event has a standard meaning in Emacs.) diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el index 6a9d80f9672..f9e31788527 100644 --- a/lisp/net/goto-addr.el +++ b/lisp/net/goto-addr.el @@ -33,7 +33,7 @@ ;; INSTALLATION ;; ;; To use goto-address in a particular mode (for example, while -;; reading mail in mh-e), add something like this in your .emacs file: +;; reading mail in mh-e), add this to your init file: ;; ;; (add-hook 'mh-show-mode-hook 'goto-address) ;; diff --git a/lisp/net/newsticker.el b/lisp/net/newsticker.el index 5d673faf0db..91eca84ce53 100644 --- a/lisp/net/newsticker.el +++ b/lisp/net/newsticker.el @@ -87,7 +87,7 @@ ;; If you are using Newsticker as part of GNU Emacs there is no need to ;; perform any installation steps in order to use Newsticker. Otherwise ;; place Newsticker in a directory where Emacs can find it. Add the -;; following line to your Emacs startup file (`~/.emacs'). +;; following line to your init file: ;; (add-to-list 'load-path "/path/to/newsticker/") ;; (autoload 'newsticker-start "newsticker" "Emacs Newsticker" t) ;; (autoload 'newsticker-show-news "newsticker" "Emacs Newsticker" t) diff --git a/lisp/net/quickurl.el b/lisp/net/quickurl.el index f3b0e372de4..f7d41fcd97a 100644 --- a/lisp/net/quickurl.el +++ b/lisp/net/quickurl.el @@ -164,7 +164,7 @@ To make use of this do something like: (setq quickurl-postfix quickurl-reread-hook-postfix) -in your ~/.emacs (after loading/requiring quickurl).") +in your init file (after loading/requiring quickurl).") ;; Non-customize variables. diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index 06aae1f6af2..abca6b3ea01 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -204,7 +204,7 @@ useful thing to do is to put (setq tramp-verbose 9) -in the ~/.emacs file and to repeat the bug. Then, include the +in your init file and to repeat the bug. Then, include the contents of the *tramp/foo* buffer and the *debug tramp/foo* buffer in your bug report. diff --git a/lisp/net/webjump.el b/lisp/net/webjump.el index 232e5ca581a..d5de2f410c5 100644 --- a/lisp/net/webjump.el +++ b/lisp/net/webjump.el @@ -38,7 +38,7 @@ ;; example sites. You'll probably want to override it with your own favorite ;; sites. The documentation for the variable describes the syntax. -;; You may wish to add something like the following to your `.emacs' file: +;; You may wish to add something like the following to your init file: ;; ;; (require 'webjump) ;; (global-set-key "\C-cj" 'webjump) diff --git a/lisp/novice.el b/lisp/novice.el index bcc94c86c9d..c621ac4b692 100644 --- a/lisp/novice.el +++ b/lisp/novice.el @@ -159,8 +159,8 @@ to future sessions." (defun disable-command (command) "Require special confirmation to execute COMMAND from now on. COMMAND must be a symbol. -This command alters the user's .emacs file so that this will apply -to future sessions." +This command alters your init file so that this choice applies to +future sessions." (interactive "CDisable command: ") (en/disable-command command t)) diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index d357da685e5..97d8b4652a9 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -28,7 +28,7 @@ ;; argument position. ;; ;; To use pcomplete with shell-mode, for example, you will need the -;; following in your .emacs file: +;; following in your init file: ;; ;; (add-hook 'shell-mode-hook 'pcomplete-shell-setup) ;; diff --git a/lisp/play/bubbles.el b/lisp/play/bubbles.el index 1f04099a6ae..3b6035473fd 100644 --- a/lisp/play/bubbles.el +++ b/lisp/play/bubbles.el @@ -33,7 +33,7 @@ ;; Installation ;; ------------ -;; Add the following lines to your Emacs startup file (`~/.emacs'). +;; Add the following lines to your init file: ;; (add-to-list 'load-path "/path/to/bubbles/") ;; (autoload 'bubbles "bubbles" "Play Bubbles" t) diff --git a/lisp/play/decipher.el b/lisp/play/decipher.el index 8d9506a1614..ade0d15006a 100644 --- a/lisp/play/decipher.el +++ b/lisp/play/decipher.el @@ -138,19 +138,7 @@ the tail of the list." ("^)\\([A-Z ]+\\)\\([a-z ]+\\)" (1 font-lock-keyword-face) (2 font-lock-string-face))) - "Expressions to fontify in Decipher mode. - -Ciphertext uses `font-lock-keyword-face', plaintext uses -`font-lock-string-face', comments use `font-lock-comment-face', and -checkpoints use `font-lock-constant-face'. You can customize the -display by changing these variables. For best results, I recommend -that all faces use the same background color. - -For example, to display ciphertext in the `bold' face, use - (add-hook 'decipher-mode-hook - (lambda () (set (make-local-variable 'font-lock-keyword-face) - 'bold))) -in your `.emacs' file.") + "Font Lock keywords for Decipher mode.") (defvar decipher-mode-map (let ((map (make-keymap))) diff --git a/lisp/play/handwrite.el b/lisp/play/handwrite.el index d2e307c0145..85c128b08e2 100644 --- a/lisp/play/handwrite.el +++ b/lisp/play/handwrite.el @@ -45,7 +45,7 @@ ;; Installation ;; ;; type at your prompt "emacs -l handwrite.el" or put this file on your -;; Emacs-Lisp load path, add the following into your ~/.emacs startup file +;; Emacs-Lisp load path, add the following into your init file: ;; ;; (require 'handwrite) ;; diff --git a/lisp/printing.el b/lisp/printing.el index 0152ed63dbb..02b2fb0139c 100644 --- a/lisp/printing.el +++ b/lisp/printing.el @@ -139,10 +139,9 @@ Please send all bug fixes and enhancements to ;; ;; One way to set variables is by calling `pr-customize', customize all ;; variables and save the customization by future sessions (see Options -;; section). Other way is by coding your settings on Emacs init file (that is, -;; ~/.emacs file), see below for a first setting template that it should be -;; inserted on your ~/.emacs file (or c:/_emacs, if you're using Windows 9x/NT -;; or MS-DOS): +;; section). Other way is by adding code to your init file; see below +;; for a first setting template that it should be inserted on your +;; init file: ;; ;; * Example of setting for Windows system: ;; @@ -297,8 +296,7 @@ Please send all bug fixes and enhancements to ;; Using `printing' ;; ---------------- ;; -;; To use `printing' insert in your ~/.emacs file (or c:/_emacs, if you're -;; using Windows 9x/NT or MS-DOS): +;; To use `printing' insert in your init file: ;; ;; (require 'printing) ;; ;; ...some user settings... diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el index 4062646c967..5a054af9883 100644 --- a/lisp/progmodes/antlr-mode.el +++ b/lisp/progmodes/antlr-mode.el @@ -69,7 +69,7 @@ ;; This file requires Emacs-20.3, XEmacs-20.4 or higher and package cc-mode. ;; If antlr-mode is not part of your distribution, put this file into your -;; load-path and the following into your ~/.emacs: +;; load-path and the following into your init file: ;; (autoload 'antlr-mode "antlr-mode" nil t) ;; (setq auto-mode-alist (cons '("\\.g\\'" . antlr-mode) auto-mode-alist)) ;; (add-hook 'speedbar-load-hook ; would be too late in antlr-mode.el diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el index cf628e44de0..20aa2bc2775 100644 --- a/lisp/progmodes/cc-styles.el +++ b/lisp/progmodes/cc-styles.el @@ -352,8 +352,8 @@ might get set too. If DONT-OVERRIDE is neither nil nor t, style variables whose default values have been set (more precisely, whose default values are not the symbol `set-from-style') will not be changed. This avoids overriding global settings -done in ~/.emacs. It is useful to call c-set-style from a mode hook in this -way. +done in your init file. It is useful to call c-set-style from a mode hook +in this way. If DONT-OVERRIDE is t, style variables that already have values (i.e., whose values are not the symbol `set-from-style') will not be overridden. CC Mode diff --git a/lisp/progmodes/cmacexp.el b/lisp/progmodes/cmacexp.el index 943b5c6a067..525b1c9671e 100644 --- a/lisp/progmodes/cmacexp.el +++ b/lisp/progmodes/cmacexp.el @@ -49,7 +49,7 @@ ;; INSTALLATION ====================================================== -;; Put the following in your ~/.emacs file. +;; Put the following in your init file. ;; If you want the *Macroexpansion* window to be not higher than ;; necessary: diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el index cdbaf4708a7..0f18cffc3de 100644 --- a/lisp/progmodes/ebnf2ps.el +++ b/lisp/progmodes/ebnf2ps.el @@ -43,7 +43,7 @@ Please send all bug fixes and enhancements to ;; ;; This package translates an EBNF to a syntactic chart on PostScript. ;; -;; To use ebnf2ps, insert in your ~/.emacs: +;; To use ebnf2ps, insert in your init file: ;; ;; (require 'ebnf2ps) ;; @@ -772,7 +772,7 @@ Please send all bug fixes and enhancements to ;; ;; To set the above options you may: ;; -;; a) insert the code in your ~/.emacs, like: +;; a) insert the code in your init file, like: ;; ;; (setq ebnf-terminal-shape 'bevel) ;; diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index cc1251f6a75..f42952685d0 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -102,10 +102,9 @@ ;; (abbrev-mode 1) ; turn on abbreviation mode ;; (f90-add-imenu-menu) ; extra menu with functions etc. ;; (if f90-auto-keyword-case ; change case of all keywords on startup -;; (f90-change-keywords f90-auto-keyword-case)) -;; )) +;; (f90-change-keywords f90-auto-keyword-case)))) ;; -;; in your .emacs file. You can also customize the lists +;; in your init file. You can also customize the lists ;; f90-font-lock-keywords, etc. ;; ;; The auto-fill and abbreviation minor modes are accessible from the F90 menu, diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index 233b9a5212e..2a77ad013c7 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el @@ -52,7 +52,7 @@ ;; ;; First make sure hideshow.el is in a directory in your `load-path'. ;; You can optionally byte-compile it using `M-x byte-compile-file'. -;; Then, add the following to your ~/.emacs: +;; Then, add the following to your init file: ;; ;; (load-library "hideshow") ;; (add-hook 'X-mode-hook ; other modes similarly diff --git a/lisp/progmodes/idlw-complete-structtag.el b/lisp/progmodes/idlw-complete-structtag.el index 246ba8f29cd..24613d14634 100644 --- a/lisp/progmodes/idlw-complete-structtag.el +++ b/lisp/progmodes/idlw-complete-structtag.el @@ -53,8 +53,8 @@ ;; ;; INSTALLATION ;; ============ -;; Put this file on the emacs load path and load it with the following -;; line in your .emacs file: +;; Put this file on the emacs load path and load it with the following +;; line in your init file: ;; ;; (add-hook 'idlwave-load-hook ;; (lambda () (require 'idlw-complete-structtag))) diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el index 4f9109284ae..08d1461c008 100644 --- a/lisp/progmodes/idlw-shell.el +++ b/lisp/progmodes/idlw-shell.el @@ -48,7 +48,7 @@ ;; ;; Follow the instructions in the INSTALL file of the distribution. ;; In short, put this file on your load path and add the following -;; lines to your .emacs file: +;; lines to your init file: ;; ;; (autoload 'idlwave-shell "idlw-shell" "IDLWAVE Shell" t) ;; @@ -111,9 +111,7 @@ For example, \"^\r?IDL> \" or \"^\r?WAVE> \". The \"^\r?\" is needed, to indicate the beginning of the line, with optional return character (which IDL seems to output randomly). This variable is used to initialize `comint-prompt-regexp' in the -process buffer. - -This is a fine thing to set in your `.emacs' file." +process buffer." :group 'idlwave-shell-general-setup :type 'regexp) diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index a35ffd3e45d..9b634328fa7 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -51,7 +51,7 @@ ;; ;; Follow the instructions in the INSTALL file of the distribution. ;; In short, put this file on your load path and add the following -;; lines to your .emacs file: +;; lines to your init file: ;; ;; (autoload 'idlwave-mode "idlwave" "IDLWAVE Mode" t) ;; (autoload 'idlwave-shell "idlw-shell" "IDLWAVE Shell" t) @@ -746,7 +746,7 @@ or even '?'. '.' is not a good choice because it can make structure field names act like abbrevs in certain circumstances. Changes to this in `idlwave-mode-hook' will have no effect. Instead a user -must set it directly using `setq' in the .emacs file before idlwave.el +must set it directly using `setq' in the init file before idlwave.el is loaded." :group 'idlwave-abbrev-and-indent-action :type 'string) diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el index cd6c8869d9f..401970b2ce8 100644 --- a/lisp/progmodes/inf-lisp.el +++ b/lisp/progmodes/inf-lisp.el @@ -168,9 +168,7 @@ This variable is only used if the variable More precise choices: Lucid Common Lisp: \"^\\\\(>\\\\|\\\\(->\\\\)+\\\\) *\" franz: \"^\\\\(->\\\\|<[0-9]*>:\\\\) *\" -kcl: \"^>+ *\" - -This is a fine thing to set in your .emacs file or through Custom." +kcl: \"^>+ *\"" :type 'regexp :group 'inferior-lisp) diff --git a/lisp/progmodes/mixal-mode.el b/lisp/progmodes/mixal-mode.el index 54d857dd4b1..a59176a5aa6 100644 --- a/lisp/progmodes/mixal-mode.el +++ b/lisp/progmodes/mixal-mode.el @@ -32,7 +32,7 @@ ;; GNU MDK from `https://savannah.gnu.org/projects/mdk/' and ;; `ftp://ftp.gnu.org/pub/gnu/mdk'. ;; -;; To use this mode, place the following in your .emacs file: +;; To use this mode, place the following in your init file: ;; `(load-file "/PATH-TO-FILE/mixal-mode.el")'. ;; When you load a file with the extension .mixal the mode will be started ;; automatic. If you want to start the mode manual, use `M-x mixal-mode'. diff --git a/lisp/progmodes/octave-mod.el b/lisp/progmodes/octave-mod.el index 79b3fcee720..ab5a19f8a2f 100644 --- a/lisp/progmodes/octave-mod.el +++ b/lisp/progmodes/octave-mod.el @@ -585,12 +585,12 @@ Variables you can use to customize Octave mode Turning on Octave mode runs the hook `octave-mode-hook'. To begin using this mode for all `.m' files that you edit, add the -following lines to your `.emacs' file: +following lines to your init file: (add-to-list 'auto-mode-alist '(\"\\\\.m\\\\'\" . octave-mode)) To automatically turn on the abbrev and auto-fill features, -add the following lines to your `.emacs' file as well: +add the following lines to your init file as well: (add-hook 'octave-mode-hook (lambda () diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index e13b67e596d..3dd9a48bb33 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -28,14 +28,14 @@ ;;; Commentary: ;; To enter perl-mode automatically, add (autoload 'perl-mode "perl-mode") -;; to your .emacs file and change the first line of your perl script to: +;; to your init file and change the first line of your perl script to: ;; #!/usr/bin/perl -- # -*-Perl-*- ;; With arguments to perl: ;; #!/usr/bin/perl -P- # -*-Perl-*- ;; To handle files included with do 'filename.pl';, add something like ;; (setq auto-mode-alist (append (list (cons "\\.pl\\'" 'perl-mode)) ;; auto-mode-alist)) -;; to your .emacs file; otherwise the .pl suffix defaults to prolog-mode. +;; to your init file; otherwise the .pl suffix defaults to prolog-mode. ;; This code is based on the 18.53 version c-mode.el, with extensive ;; rewriting. Most of the features of c-mode survived intact. diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el index 16d85cb2d79..33d43cb3d5a 100644 --- a/lisp/progmodes/prolog.el +++ b/lisp/progmodes/prolog.el @@ -60,9 +60,7 @@ ;;; Installation: ;; -;; Insert the following lines in your init file--typically ~/.emacs -;; (GNU Emacs and XEmacs <21.4), or ~/.xemacs/init.el (XEmacs -;; 21.4)--to use this mode when editing Prolog files under Emacs: +;; Insert the following lines in your init file: ;; ;; (setq load-path (cons "/usr/lib/xemacs/site-lisp" load-path)) ;; (autoload 'run-prolog "prolog" "Start a Prolog sub-process." t) diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index f3ecbe3fc3d..3d5abc4df62 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -268,9 +268,8 @@ (defcustom sql-password "" "Default password. - -Storing your password in a textfile such as ~/.emacs could be dangerous. -Customizing your password will store it in your ~/.emacs file." +If you customize this, the value will be stored in your init +file. Since that is a plaintext file, this could be dangerous." :type 'string :group 'SQL :risky t) @@ -1285,8 +1284,8 @@ Based on `comint-mode-map'.") ["List all objects" sql-list-all (sql-get-product-feature sql-product :list-all)] ["List table details" sql-list-table (sql-get-product-feature sql-product :list-table)])) -;; Abbreviations -- if you want more of them, define them in your -;; ~/.emacs file. Abbrevs have to be enabled in your ~/.emacs, too. +;; Abbreviations -- if you want more of them, define them in your init +;; file. Abbrevs have to be enabled in your init file, too. (defvar sql-mode-abbrev-table nil "Abbrev table used in `sql-mode' and `sql-interactive-mode'.") @@ -3715,8 +3714,8 @@ For information on how to create multiple SQLi buffers, see `sql-interactive-mode'. Note that SQL doesn't have an escape character unless you specify -one. If you specify backslash as escape character in SQL, -you must tell Emacs. Here's how to do that in your `~/.emacs' file: +one. If you specify backslash as escape character in SQL, you +must tell Emacs. Here's how to do that in your init file: \(add-hook 'sql-mode-hook (lambda () @@ -3806,7 +3805,7 @@ cause the window to scroll to the end of the buffer. If you want to make SQL buffers limited in length, add the function `comint-truncate-buffer' to `comint-output-filter-functions'. -Here is an example for your .emacs file. It keeps the SQLi buffer a +Here is an example for your init file. It keeps the SQLi buffer a certain length. \(add-hook 'sql-interactive-mode-hook diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index c072754e66d..835d548c19f 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -8790,7 +8790,7 @@ Note these are only read when the file is first visited, you must use \\[find-alternate-file] RET to have these take effect after editing them! If you want to disable the \"Process `eval' or hook local variables\" -warning message, you need to add to your .emacs file: +warning message, you need to add to your init file: (setq enable-local-eval t)" (let ((origbuf (current-buffer))) @@ -11756,7 +11756,7 @@ An example: // For this example we declare the function in the // module's file itself. Often you'd define it instead - // in a site-start.el or .emacs file. + // in a site-start.el or init file. /* Local Variables: eval: diff --git a/lisp/ps-print.el b/lisp/ps-print.el index addf2975c5f..930e750ab27 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -1042,7 +1042,7 @@ Please send all bug fixes and enhancements to ;; variables `ps-bold-faces', `ps-italic-faces' and `ps-underlined-faces'. ;; These variables contain lists of faces that ps-print should consider bold, ;; italic or underline; to set them, put code like the following into your -;; .emacs file: +;; init file: ;; ;; (setq ps-bold-faces '(my-blue-face)) ;; (setq ps-italic-faces '(my-red-face)) diff --git a/lisp/saveplace.el b/lisp/saveplace.el index 43dad63a140..0c082169462 100644 --- a/lisp/saveplace.el +++ b/lisp/saveplace.el @@ -56,13 +56,12 @@ This means when you visit a file, point goes to the last place where it was when you previously visited the same file. This variable is automatically buffer-local. -If you wish your place in any file to always be automatically saved, -simply put this in your `~/.emacs' file: +If you wish your place in any file to always be automatically +saved, set this to t using the Customize facility, or put the +following code in your init file: \(setq-default save-place t) -\(require 'saveplace) - -or else use the Custom facility to set this option." +\(require 'saveplace)" :type 'boolean :require 'saveplace :group 'save-place) @@ -148,7 +147,8 @@ even in a later Emacs session. If called with a prefix arg, the mode is enabled if and only if the argument is positive. -To save places automatically in all files, put this in your `.emacs' file: +To save places automatically in all files, put this in your init +file: \(setq-default save-place t\)" (interactive "P") diff --git a/lisp/shell.el b/lisp/shell.el index 8c80712eed6..77a42389785 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -46,7 +46,7 @@ ;; YOUR .EMACS FILE ;;============================================================================= -;; Some suggestions for your .emacs file. +;; Some suggestions for your init file. ;; ;; ;; Define M-# to run some strange command: ;; (eval-after-load "shell" diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 90cdea63e85..25a6fbfd998 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -706,7 +706,7 @@ will be stripped by a simplified optimizer when compiled into a singular expression. This variable will be turned into `speedbar-file-regexp' for use with speedbar. You should use the function `speedbar-add-supported-extension' to add a new extension at -runtime, or use the configuration dialog to set it in your .emacs file. +runtime, or use the configuration dialog to set it in your init file. If you add an extension to this list, and it does not appear, you may need to also modify `completion-ignored-extension' which will also help file completion." diff --git a/lisp/startup.el b/lisp/startup.el index 348e653dd28..db5efb89eed 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -71,12 +71,13 @@ once you are familiar with the contents of the startup screen." "Non-nil inhibits the initial startup echo area message. Setting this variable takes effect only if you do it with the customization buffer -or if your `.emacs' file contains a line of this form: +or if your init file contains a line of this form: (setq inhibit-startup-echo-area-message \"YOUR-USER-NAME\") -If your `.emacs' file is byte-compiled, use the following form instead: +If your init file is byte-compiled, use the following form +instead: (eval '(setq inhibit-startup-echo-area-message \"YOUR-USER-NAME\")) -Thus, someone else using a copy of your `.emacs' file will see -the startup message unless he personally acts to inhibit it." +Thus, someone else using a copy of your init file will see the +startup message unless he personally acts to inhibit it." :type '(choice (const :tag "Don't inhibit") (string :tag "Enter your user name, to inhibit")) :group 'initialization) @@ -261,10 +262,14 @@ and VALUE is the value which is given to that frame parameter "Normal hook run after handling urgent options but before loading init files.") (defvar after-init-hook nil - "Normal hook run after loading the init files, `~/.emacs' and `default.el'. -There is no `condition-case' around the running of these functions; -therefore, if you set `debug-on-error' non-nil in `.emacs', -an error in one of these functions will invoke the debugger.") + "Normal hook run after initializing the Emacs session. +It is run after Emacs loads the init file, `default' library, the +abbrevs file, and additional Lisp packages (if any), and setting +the value of `after-init-time'. + +There is no `condition-case' around the running of this hook; +therefore, if `debug-on-error' is non-nil, an error in one of +these functions will invoke the debugger.") (defvar emacs-startup-hook nil "Normal hook run after loading init files and handling the command line.") @@ -296,7 +301,7 @@ the user's init file.") :group 'initialization) (defvar init-file-user nil - "Identity of user whose `.emacs' file is or was read. + "Identity of user whose init file is or was read. The value is nil if `-q' or `--no-init-file' was specified, meaning do not load any init file. @@ -306,7 +311,7 @@ or it may be a string containing a user's name meaning use that person's init file. In either of the latter cases, `(concat \"~\" init-file-user \"/\")' -evaluates to the name of the directory where the `.emacs' file was +evaluates to the name of the directory where the init file was looked for. Setting `init-file-user' does not prevent Emacs from loading @@ -365,7 +370,7 @@ init file is read, in case it sets `mail-host-address'." (t (concat user-emacs-directory "auto-save-list/.saves-"))) "Prefix for generating `auto-save-list-file-name'. -This is used after reading your `.emacs' file to initialize +This is used after reading your init file to initialize `auto-save-list-file-name', by appending Emacs's pid and the system name, if you have not already set `auto-save-list-file-name' yourself. Directories in the prefix will be created if necessary. diff --git a/lisp/strokes.el b/lisp/strokes.el index dfd0e95f61a..62a8528f25d 100644 --- a/lisp/strokes.el +++ b/lisp/strokes.el @@ -933,14 +933,7 @@ and then safely save them for later use, send letters to friends extracting the strokes for editing use once again, so the editing cycle can continue. -Strokes are easy to program and fun to use. To start strokes going, -you'll want to put the following line in your .emacs file as mentioned -in the commentary to strokes.el. - -This will load strokes when and only when you start Emacs on a window -system, with a mouse or other pointer device defined. - -To toggle strokes-mode, you just do +To toggle strokes-mode, invoke the command > M-x strokes-mode diff --git a/lisp/term/iris-ansi.el b/lisp/term/iris-ansi.el index 9a9a31f4253..aea2e8c1092 100644 --- a/lisp/term/iris-ansi.el +++ b/lisp/term/iris-ansi.el @@ -322,7 +322,7 @@ "Terminal initialization function for iris-ansi." ;; Use inheritance to let the main keymap override these defaults. ;; This way we don't override terminfo-derived settings or settings - ;; made in the .emacs file. + ;; made in the init file. (let ((m (copy-keymap iris-function-map))) (set-keymap-parent m (keymap-parent input-decode-map)) (set-keymap-parent input-decode-map m))) diff --git a/lisp/term/lk201.el b/lisp/term/lk201.el index 76a3a31cedc..6b9e1301003 100644 --- a/lisp/term/lk201.el +++ b/lisp/term/lk201.el @@ -75,7 +75,7 @@ (defun terminal-init-lk201 () ;; Use inheritance to let the main keymap override these defaults. ;; This way we don't override terminfo-derived settings or settings - ;; made in the .emacs file. + ;; made in the init file. (let ((m (copy-keymap lk201-function-map))) (set-keymap-parent m (keymap-parent input-decode-map)) (set-keymap-parent input-decode-map m))) diff --git a/lisp/term/rxvt.el b/lisp/term/rxvt.el index 481d6b498cf..98141563006 100644 --- a/lisp/term/rxvt.el +++ b/lisp/term/rxvt.el @@ -166,7 +166,7 @@ ;; Use inheritance to let the main keymap override those defaults. ;; This way we don't override terminfo-derived settings or settings - ;; made in the .emacs file. + ;; made in the init file. (let ((m (copy-keymap rxvt-function-map))) (set-keymap-parent m (keymap-parent input-decode-map)) (set-keymap-parent input-decode-map m)) diff --git a/lisp/term/tvi970.el b/lisp/term/tvi970.el index b02d39c1e0f..f1b6eea8875 100644 --- a/lisp/term/tvi970.el +++ b/lisp/term/tvi970.el @@ -93,7 +93,7 @@ "Terminal initialization function for tvi970." ;; Use inheritance to let the main keymap override these defaults. ;; This way we don't override terminfo-derived settings or settings - ;; made in the .emacs file. + ;; made in the init file. (let ((m (copy-keymap tvi970-terminal-map))) (set-keymap-parent m (keymap-parent input-decode-map)) (set-keymap-parent input-decode-map m)) diff --git a/lisp/term/wyse50.el b/lisp/term/wyse50.el index d037962af19..ce148b62dba 100644 --- a/lisp/term/wyse50.el +++ b/lisp/term/wyse50.el @@ -109,7 +109,7 @@ "Terminal initialization function for wyse50." ;; Use inheritance to let the main keymap override these defaults. ;; This way we don't override terminfo-derived settings or settings - ;; made in the .emacs file. + ;; made in the init file. (let ((m (copy-keymap wyse50-terminal-map))) (set-keymap-parent m (keymap-parent input-decode-map)) (set-keymap-parent input-decode-map m)) diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 28fb9da0b9d..e4871658b98 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -480,7 +480,7 @@ The relevant features are: ;; Use inheritance to let the main keymap override those defaults. ;; This way we don't override terminfo-derived settings or settings - ;; made in the .emacs file. + ;; made in the init file. (set-keymap-parent map (keymap-parent input-decode-map)) (set-keymap-parent input-decode-map map))) diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index a9320d945ef..42f0418b690 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -290,9 +290,9 @@ If this variable is nil, all regions are treated as small." ;;* Mode specific options enable users to disable flyspell on */ ;;* certain word depending of the emacs mode. For instance, when */ ;;* using flyspell with mail-mode add the following expression */ -;;* in your .emacs file: */ +;;* in your init file: */ ;;* (add-hook 'mail-mode */ -;;* (lambda () (setq flyspell-generic-check-word-predicate */ +;;* (lambda () (setq flyspell-generic-check-word-predicate */ ;;* 'mail-mode-flyspell-verify))) */ ;;*---------------------------------------------------------------------*/ (defvar flyspell-generic-check-word-predicate nil @@ -488,7 +488,7 @@ invoking `ispell-change-dictionary'. Consider using the `ispell-parser' to check your text. For instance consider adding: \(add-hook 'tex-mode-hook (function (lambda () (setq ispell-parser 'tex)))) -in your .emacs file. +in your init file. \\[flyspell-region] checks all words inside a region. \\[flyspell-buffer] checks the whole buffer." diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 0c7966f22d3..51a4800de52 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -1127,7 +1127,8 @@ aspell is used along with Emacs).") ;; If Emacs flavor supports [:alpha:] use it for global dicts. If ;; spellchecker also supports UTF-8 via command-line option use it - ;; in communication. This does not affect definitions in ~/.emacs. + ;; in communication. This does not affect definitions in your + ;; init file. (if ispell-emacs-alpha-regexp (let (tmp-dicts-alist) (dolist (adict ispell-dictionary-alist) @@ -3680,7 +3681,7 @@ use the `x' command. (Any subsequent regions will be checked.) The `X' command aborts sending the message so that you can edit the buffer. To spell-check whenever a message is sent, include the appropriate lines -in your .emacs file: +in your init file: (add-hook 'message-send-hook 'ispell-message) ;; GNUS 5 (add-hook 'news-inews-hook 'ispell-message) ;; GNUS 4 (add-hook 'mail-send-hook 'ispell-message) diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el index d8afb3e5544..8584c496a97 100644 --- a/lisp/textmodes/reftex.el +++ b/lisp/textmodes/reftex.el @@ -47,7 +47,7 @@ ;; To turn RefTeX Mode on and off in a buffer, use `M-x reftex-mode'. ;; ;; To turn on RefTeX Mode for all LaTeX files, add the following lines -;; to your .emacs file: +;; to your init file: ;; ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; AUCTeX LaTeX mode ;; (add-hook 'latex-mode-hook 'turn-on-reftex) ; Emacs latex mode @@ -99,7 +99,7 @@ ;; ;; To turn RefTeX Mode on and off in a particular buffer, use `M-x ;; reftex-mode'. To turn on RefTeX Mode for all LaTeX files, add the -;; following lines to your `.emacs' file: +;; following lines to your init file: ;; ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode ;; (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index 767f8f360bb..e2647a98770 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -81,7 +81,7 @@ ;;; INSTALLATION -;; Add the following lines to your `.emacs' file: +;; Add the following lines to your init file: ;; ;; (require 'rst) ;; diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 5bcd87ede68..67d7f8c01f9 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -451,7 +451,7 @@ the next N words. In Transient Mark mode, when the mark is active, N defaults to -1, which means to wrap it around the current region. If you like upcased tags, put (setq sgml-transformation-function 'upcase) -in your `.emacs' file. +in your init file. Use \\[sgml-validate] to validate your document with an SGML parser. diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el index 2664a89855f..459e884d45d 100644 --- a/lisp/textmodes/table.el +++ b/lisp/textmodes/table.el @@ -126,7 +126,7 @@ ;; again. ;; ;; To use the package regularly place this file in the site library -;; directory and add the next expression in your .emacs file. Make +;; directory and add the next expression in your init file. Make ;; sure that directory is included in the `load-path'. ;; ;; (require 'table) @@ -342,10 +342,10 @@ ;; (function (lambda () ;; (local-set-key [] ')))) ;; -;; Above code is well known ~/.emacs idiom for customizing a mode -;; specific keymap however it does not work for this package. This is -;; because there is no table mode in effect. This package does not -;; use a local map therefore you must modify `table-cell-map' +;; Adding the above to your init file is a common way to customize a +;; mode specific keymap. However it does not work for this package. +;; This is because there is no table mode in effect. This package +;; does not use a local map therefore you must modify `table-cell-map' ;; explicitly. The correct way of achieving above task is: ;; ;; (add-hook 'table-cell-map-hook diff --git a/lisp/textmodes/two-column.el b/lisp/textmodes/two-column.el index 8a4fe4f87fd..b21e72639fd 100644 --- a/lisp/textmodes/two-column.el +++ b/lisp/textmodes/two-column.el @@ -276,8 +276,9 @@ You have the following commands at your disposal: \\[2C-merge] Merge both buffers \\[2C-dissociate] Dissociate the two buffers -These keybindings can be customized in your ~/.emacs by `2C-mode-map', -`2C-minor-mode-map' and by binding `2C-command' to some prefix. +These keybindings can be customized in your init file by +`2C-mode-map', `2C-minor-mode-map' and by binding `2C-command' to +some prefix. The appearance of the screen can be customized by the variables `2C-window-width', `2C-beyond-fill-column', `2C-mode-line-format' and diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el index 13963121e2b..c2ac1035dfe 100644 --- a/lisp/time-stamp.el +++ b/lisp/time-stamp.el @@ -29,7 +29,7 @@ ;; static char *ts = "sdmain.c Time-stamp: <2001-08-13 10:20:51 gildea>"; ;; See the top of `time-stamp.el' for another example. -;; To use time-stamping, add this line to your .emacs file: +;; To use time-stamping, add this line to your init file: ;; (add-hook 'before-save-hook 'time-stamp) ;; Now any time-stamp templates in your files will be updated automatically. @@ -254,7 +254,7 @@ time-stamped file itself.") (defun time-stamp () "Update the time stamp string(s) in the buffer. A template in a file can be automatically updated with a new time stamp -every time you save the file. Add this line to your .emacs file: +every time you save the file. Add this line to your init file: (add-hook 'before-save-hook 'time-stamp) or customize `before-save-hook' through Custom. Normally the template must appear in the first 8 lines of a file and diff --git a/lisp/url/url-methods.el b/lisp/url/url-methods.el index bd7d8e33922..26fe72014f7 100644 --- a/lisp/url/url-methods.el +++ b/lisp/url/url-methods.el @@ -79,7 +79,7 @@ ;; Store any proxying information - this will not overwrite an old ;; entry, so that people can still set this information in their - ;; .emacs file + ;; init file (cond (cur-proxy nil) ; Keep their old settings ((null env-proxy) nil) ; No proxy setup diff --git a/lisp/vc/pcvs-defs.el b/lisp/vc/pcvs-defs.el index 0f71b7b82e7..fc65d62c67d 100644 --- a/lisp/vc/pcvs-defs.el +++ b/lisp/vc/pcvs-defs.el @@ -57,11 +57,7 @@ versions, such as the one in SunOS-4.") ;;;; END OF THINGS TO CHECK WHEN INSTALLING ;;;; -------------------------------------------------------- -;;;; ;;;; User configuration variables: -;;;; -;;;; NOTE: these should be set in your ~/.emacs (or site-lisp/default.el) file. -;;;; (defgroup pcl-cvs nil "Special support for the CVS versioning system." diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index b48ea1afd95..ea9ce949ccb 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -31,7 +31,7 @@ ;; To install: put this file on the load-path and add Git to the list ;; of supported backends in `vc-handled-backends'; the following line, -;; placed in your ~/.emacs, will accomplish this: +;; placed in your init file, will accomplish this: ;; ;; (add-to-list 'vc-handled-backends 'Git) diff --git a/lisp/windmove.el b/lisp/windmove.el index 3a1afec38ee..1181e409dff 100644 --- a/lisp/windmove.el +++ b/lisp/windmove.el @@ -94,7 +94,7 @@ ;; Installation: ;; -;; Put the following line in your `.emacs' file: +;; Put the following line in your init file: ;; ;; (windmove-default-keybindings) ; shifted arrow keys ;; From dcf8834baca7d4e1761483b9ea74206cadb8b114 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 17 Sep 2012 00:22:17 -0700 Subject: [PATCH 65/88] Reduce version number duplication in etc/refcards * etc/refcards/emacsver.tex: New file. * etc/refcards/calccard.tex, etc/refcards/cs-dired-ref.tex: * etc/refcards/cs-refcard.tex, etc/refcards/cs-survival.tex: * etc/refcards/de-refcard.tex, etc/refcards/dired-ref.tex: * refcards/emacsver.tex, etc/refcards/fr-dired-ref.tex: * etc/refcards/fr-refcard.tex, etc/refcards/fr-survival.tex: * etc/refcards/orgcard.tex, etc/refcards/pl-refcard.tex: * etc/refcards/pt-br-refcard.tex, etc/refcards/refcard.tex: * etc/refcards/sk-dired-ref.tex, etc/refcards/sk-refcard.tex: * etc/refcards/sk-survival.tex, etc/refcards/survival.tex: * etc/refcards/vipcard.tex, etc/refcards/viperCard.tex: Include emacsver.tex. * refcards/calccard.tex (\emacsversionnumber): Rename to \versionemacs, same as all the other refcards. * etc/refcards/Makefile (ENVADD): New variable. (sk-dired-ref.pdf, sk-survival.pdf, pl-refcard.pdf) (%.pdf, %,dvi, sk-dired-ref.dvi, sk-survival.dvi, pl-refcard.dvi): Depend on emacsver.tex. Add "." to TEXINPUTS for TeX commands. * admin/admin.el (set-version): Set major version in etc/refcards/ru-refcard.tex and etc/refcards/emacsver.tex. (set-copyright): In etc/refcards, only change ru-refcard.tex and emacsver.tex. * admin.el (cusver-scan, cusver-check): Bind local variables. * .bzrignore: Add etc/refcards TeX intermediate files. --- admin/ChangeLog | 7 +++++++ admin/admin.el | 32 ++++++++++++++++++-------------- etc/ChangeLog | 20 ++++++++++++++++++++ etc/refcards/Makefile | 27 ++++++++++++++------------- etc/refcards/calccard.tex | 5 ++--- etc/refcards/cs-dired-ref.tex | 3 +-- etc/refcards/cs-refcard.tex | 3 +-- etc/refcards/cs-survival.tex | 3 +-- etc/refcards/de-refcard.tex | 3 +-- etc/refcards/dired-ref.tex | 3 +-- etc/refcards/emacsver.tex | 4 ++++ etc/refcards/fr-dired-ref.tex | 3 +-- etc/refcards/fr-refcard.tex | 3 +-- etc/refcards/fr-survival.tex | 3 +-- etc/refcards/orgcard.tex | 2 +- etc/refcards/pl-refcard.tex | 3 +-- etc/refcards/pt-br-refcard.tex | 3 +-- etc/refcards/refcard.tex | 3 +-- etc/refcards/sk-dired-ref.tex | 3 +-- etc/refcards/sk-refcard.tex | 3 +-- etc/refcards/sk-survival.tex | 3 +-- etc/refcards/survival.tex | 3 +-- etc/refcards/vipcard.tex | 2 +- etc/refcards/viperCard.tex | 2 +- 24 files changed, 83 insertions(+), 63 deletions(-) create mode 100644 etc/refcards/emacsver.tex diff --git a/admin/ChangeLog b/admin/ChangeLog index 6d3118d8ba6..cef27f3f52e 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,5 +1,12 @@ 2012-09-17 Glenn Morris + * admin.el (cusver-scan, cusver-check): Bind local variables. + + * admin.el (set-version): Set major version in + etc/refcards/ru-refcard.tex and etc/refcards/emacsver.tex. + (set-copyright): In etc/refcards, only change ru-refcard.tex + and emacsver.tex. + * admin.el (set-copyright): No more need to set copyrights for nextstep, or .c files. Add configure.ac and config.nt. diff --git a/admin/admin.el b/admin/admin.el index 4d68fca97b2..536236c3f70 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -126,7 +126,16 @@ Root must be the root of an Emacs source tree." (set-version-in-file root "nt/emacsclient.rc" comma-space-version (rx (and "\"ProductVersion\"" (0+ space) ?, (0+ space) ?\" (submatch (1+ (in "0-9, "))) - "\\0\""))))) + "\\0\""))) + (when (string-match "\\([0-9]\\{2,\\}\\)" version) + (setq version (match-string 1 version)) + (set-version-in-file root "etc/refcards/ru-refcard.tex" version + "\\\\newcommand{\\\\versionemacs}\\[0\\]\ +{\\([0-9]\\{2,\\}\\)}.+%.+version of Emacs") + (set-version-in-file root "etc/refcards/emacsver.tex" version + "\\\\def\\\\versionemacs\ +{\\([0-9]\\{2,\\}\\)}.+%.+version of Emacs")))) + ;; Note this makes some assumptions about form of short copyright. (defun set-copyright (root copyright) @@ -150,19 +159,14 @@ Root must be the root of an Emacs source tree." (set-version-in-file root "lib-src/rcs2log" copyright (rx (and "Copyright" (0+ space) ?= (0+ space) ?\' (submatch (1+ nonl))))) - ;; This one is a nuisance, as it needs to be split over two lines. - (string-match "\\(.*[0-9]\\{4\\} *\\)\\(.*\\)" copyright) (when (string-match "\\([0-9]\\{4\\}\\)" copyright) (setq copyright (match-string 1 copyright)) - (dolist (file (directory-files (expand-file-name "etc/refcards" root) - t "\\.tex\\'")) - (unless (string-match "gnus-refcard\\.tex" file) - (set-version-in-file - root file copyright - (concat (if (string-match "ru-refcard\\.tex" file) - "\\\\newcommand{\\\\cyear}\\[0\\]{" - "\\\\def\\\\year{") - "\\([0-9]\\{4\\}\\)}.+%.+copyright year")))))) + (set-version-in-file root "etc/refcards/ru-refcard.tex" copyright + "\\\\newcommand{\\\\cyear}\\[0\\]\ +{\\([0-9]\\{4\\}\\)}.+%.+copyright year") + (set-version-in-file root "etc/refcards/emacsver.tex" copyright + "\\\\def\\\\year\ +{\\([0-9]\\{4\\}\\)}.+%.+copyright year"))) ;;; Various bits of magic for generating the web manuals @@ -443,7 +447,7 @@ If optional argument OLD is non-nil, also scan for defvars." (let ((m (format "Scanning %s..." file)) (re (format "^[ \t]*\\((def%s\\)[ \t\n]" (if old "\\(?:custom\\|var\\)" "custom"))) - alist var ver) + alist var ver form) (message "%s" m) (with-temp-buffer (insert-file-contents file) @@ -502,7 +506,7 @@ changes (in a non-trivial way). This function does not check for that." (mapcar (lambda (file) (cons file (cusver-scan file))) newfiles))) - oldcus result thisfile) + oldcus result thisfile file) (message "Reading old defcustoms...") (dolist (file oldfiles) (setq oldcus (append oldcus (cusver-scan file t)))) diff --git a/etc/ChangeLog b/etc/ChangeLog index 5a14c523cf3..6f2b178fcd7 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,23 @@ +2012-09-17 Glenn Morris + + * refcards/emacsver.tex: New file. + * refcards/calccard.tex, refcards/cs-dired-ref.tex: + * refcards/cs-refcard.tex, refcards/cs-survival.tex: + * refcards/de-refcard.tex, refcards/dired-ref.tex: + * refcards/emacsver.tex, refcards/fr-dired-ref.tex: + * refcards/fr-refcard.tex, refcards/fr-survival.tex: + * refcards/orgcard.tex, refcards/pl-refcard.tex: + * refcards/pt-br-refcard.tex, refcards/refcard.tex: + * refcards/sk-dired-ref.tex, refcards/sk-refcard.tex: + * refcards/sk-survival.tex, refcards/survival.tex: + * refcards/vipcard.tex, refcards/viperCard.tex: Include emacsver.tex. + * refcards/calccard.tex (\emacsversionnumber): + Rename to \versionemacs, same as all the other refcards. + * refcards/Makefile (ENVADD): New variable. + (sk-dired-ref.pdf, sk-survival.pdf, pl-refcard.pdf) + (%.pdf, %,dvi, sk-dired-ref.dvi, sk-survival.dvi, pl-refcard.dvi): + Depend on emacsver.tex. Add "." to TEXINPUTS for TeX commands. + 2012-09-16 Paul Eggert Remove configure's --without-sync-input option (Bug#12450). diff --git a/etc/refcards/Makefile b/etc/refcards/Makefile index 64e2d8638f8..ef810da6022 100644 --- a/etc/refcards/Makefile +++ b/etc/refcards/Makefile @@ -47,26 +47,27 @@ VIPER_CARDS_PDF = vipcard.pdf viperCard.pdf viper-cards_pdf: ${VIPER_CARDS_PDF} viper-cards_ps: ${VIPER_CARDS_PDF:.pdf=.ps} +ENVADD = TEXINPUTS=".:" ## PDF files. ## The page layouts (a4/letter) are written directly in the .tex files. cs-refcard.pdf cs-dired-ref.pdf cs-survival.pdf sk-refcard.pdf \ -sk-dired-ref.pdf sk-survival.pdf: %.pdf: %.tex +sk-dired-ref.pdf sk-survival.pdf: %.pdf: %.tex emacsver.tex if pdfcsplain --version > /dev/null 2> /dev/null; then \ - pdfcsplain $<; \ + ${ENVADD} pdfcsplain $<; \ else \ - csplain "\pdfoutput=1\input $<"; \ + ${ENVADD} csplain "\pdfoutput=1\input $<"; \ fi ## Some versions of pdfmex seem to create dvi by default, hence output-format. -pl-refcard.pdf: %.pdf: %.tex +pl-refcard.pdf: %.pdf: %.tex emacsver.tex if ! kpsewhich -format=fmt mex > /dev/null && \ ! pdfmex --version > /dev/null 2> /dev/null; then \ echo "No mex format found."; false; \ fi - pdftex -output-format=pdf $< + ${ENVADD} pdftex -output-format=pdf $< ru-refcard.pdf: %.pdf: %.tex pdflatex $< @@ -81,21 +82,21 @@ gnus-booklet.pdf: gnus-refcard.tex gnus-logo.pdf pdflatex -jobname=gnus-booklet '\def\booklettrue{}\def\letterpapertrue{}\input{gnus-refcard}' ## Everything not explicitly listed above. -%.pdf: %.tex - pdftex $< +%.pdf: %.tex emacsver.tex + ${ENVADD} pdftex $< ## dvi files. cs-refcard.dvi cs-dired-ref.dvi cs-survival.dvi sk-refcard.dvi \ -sk-dired-ref.dvi sk-survival.dvi: %.dvi: %.tex - csplain $< +sk-dired-ref.dvi sk-survival.dvi: %.dvi: %.tex emacsver.tex + ${ENVADD} csplain $< -pl-refcard.dvi: %.dvi: %.tex +pl-refcard.dvi: %.dvi: %.tex emacsver.tex if ! kpsewhich -format=fmt mex > /dev/null; then \ echo "No mex format found."; false; \ fi - tex $< + ${ENVADD} tex $< ru-refcard.dvi gnus-refcard.dvi: %.dvi: %.tex latex $< @@ -105,8 +106,8 @@ gnus-booklet.dvi: gnus-refcard.tex mv gnus-refcard.dvi $@ ## Everything not explicitly listed above. -%.dvi: %.tex - tex $< +%.dvi: %.tex emacsver.tex + ${ENVADD} tex $< ## PostScript files. diff --git a/etc/refcards/calccard.tex b/etc/refcards/calccard.tex index fd3d45b8da4..04c88befeea 100644 --- a/etc/refcards/calccard.tex +++ b/etc/refcards/calccard.tex @@ -63,8 +63,7 @@ % UUCP: mit-erl!gildea % Internet: gildea@stop.mail-abuse.org -\def\emacsversionnumber{24} -\def\year{2012} % latest copyright year +\input emacsver.tex \def\shortcopyrightnotice{\vskip 1ex plus 2 fill \centerline{\small \copyright\ \year\ Free Software Foundation, Inc. @@ -276,7 +275,7 @@ \title{GNU Calc Reference Card} -\centerline{(for GNU Emacs version \emacsversionnumber)} +\centerline{(for GNU Emacs version \versionemacs)} \section{Starting and Stopping} diff --git a/etc/refcards/cs-dired-ref.tex b/etc/refcards/cs-dired-ref.tex index ee7acaf416d..45867e11d44 100644 --- a/etc/refcards/cs-dired-ref.tex +++ b/etc/refcards/cs-dired-ref.tex @@ -41,8 +41,7 @@ \input pdflayout.sty \pdflayout=(0) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed. diff --git a/etc/refcards/cs-refcard.tex b/etc/refcards/cs-refcard.tex index d17e5c6ddeb..98842dd08e0 100644 --- a/etc/refcards/cs-refcard.tex +++ b/etc/refcards/cs-refcard.tex @@ -59,8 +59,7 @@ \input pdflayout.sty \pdflayout=(0) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed. diff --git a/etc/refcards/cs-survival.tex b/etc/refcards/cs-survival.tex index 5aa111c0297..4050cf0a1ab 100644 --- a/etc/refcards/cs-survival.tex +++ b/etc/refcards/cs-survival.tex @@ -54,8 +54,7 @@ % Czech hyphenation rules applied \chyph -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex \def\copyrightnotice{\penalty-1\vfill \vbox{\smallfont\baselineskip=0.8\baselineskip\raggedcenter diff --git a/etc/refcards/de-refcard.tex b/etc/refcards/de-refcard.tex index ca3141b8390..906895b358a 100644 --- a/etc/refcards/de-refcard.tex +++ b/etc/refcards/de-refcard.tex @@ -60,8 +60,7 @@ \input german.sty \mdqoff % deactivates the "-char -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed below this line. diff --git a/etc/refcards/dired-ref.tex b/etc/refcards/dired-ref.tex index 9ccf57682ff..b85bef1ce0b 100644 --- a/etc/refcards/dired-ref.tex +++ b/etc/refcards/dired-ref.tex @@ -43,8 +43,7 @@ \input pdflayout.sty \pdflayout=(1) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed. diff --git a/etc/refcards/emacsver.tex b/etc/refcards/emacsver.tex new file mode 100644 index 00000000000..620ee8ef9e0 --- /dev/null +++ b/etc/refcards/emacsver.tex @@ -0,0 +1,4 @@ +%% This file is not generated by configure, because then the provided +%% pdf files would always appear out-of-date. +\def\versionemacs{24} % major version of emacs +\def\year{2012} % latest copyright year diff --git a/etc/refcards/fr-dired-ref.tex b/etc/refcards/fr-dired-ref.tex index 2819bbaa25b..457ee2db472 100644 --- a/etc/refcards/fr-dired-ref.tex +++ b/etc/refcards/fr-dired-ref.tex @@ -35,8 +35,7 @@ \input pdflayout.sty \pdflayout=(0) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed. diff --git a/etc/refcards/fr-refcard.tex b/etc/refcards/fr-refcard.tex index ed82f00a85d..4fe94d79075 100644 --- a/etc/refcards/fr-refcard.tex +++ b/etc/refcards/fr-refcard.tex @@ -56,8 +56,7 @@ \input pdflayout.sty \pdflayout=(0l) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed below this line. diff --git a/etc/refcards/fr-survival.tex b/etc/refcards/fr-survival.tex index 1cd9cc4cf05..16d67f6b1cd 100644 --- a/etc/refcards/fr-survival.tex +++ b/etc/refcards/fr-survival.tex @@ -49,8 +49,7 @@ \input pdflayout.sty \pdflayout=(0) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex \def\copyrightnotice{\penalty-1\vfill \vbox{\smallfont\baselineskip=0.8\baselineskip\raggedcenter diff --git a/etc/refcards/orgcard.tex b/etc/refcards/orgcard.tex index 3c0584d6db4..60e81f36d3e 100644 --- a/etc/refcards/orgcard.tex +++ b/etc/refcards/orgcard.tex @@ -1,7 +1,7 @@ % Reference Card for Org Mode \def\orgversionnumber{7.8.11} \def\versionyear{2012} % latest update -\def\year{2012} % latest copyright year +\input emacsver.tex %**start of header \newcount\columnsperpage diff --git a/etc/refcards/pl-refcard.tex b/etc/refcards/pl-refcard.tex index 9cc6fc6a6cd..db814cfa8c2 100644 --- a/etc/refcards/pl-refcard.tex +++ b/etc/refcards/pl-refcard.tex @@ -69,8 +69,7 @@ \input pdflayout.sty \pdflayout=(0) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed. diff --git a/etc/refcards/pt-br-refcard.tex b/etc/refcards/pt-br-refcard.tex index c16d5096f30..d3fbe54ce87 100644 --- a/etc/refcards/pt-br-refcard.tex +++ b/etc/refcards/pt-br-refcard.tex @@ -62,8 +62,7 @@ \input pdflayout.sty \pdflayout=(0l) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed below this line. diff --git a/etc/refcards/refcard.tex b/etc/refcards/refcard.tex index 70788e8c67b..6ca9856085d 100644 --- a/etc/refcards/refcard.tex +++ b/etc/refcards/refcard.tex @@ -63,8 +63,7 @@ % Nothing else needs to be changed below this line. -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % copyright year +\input emacsver.tex \def\shortcopyrightnotice{\vskip 1ex plus 2 fill \centerline{\small \copyright\ \year\ Free Software Foundation, Inc. diff --git a/etc/refcards/sk-dired-ref.tex b/etc/refcards/sk-dired-ref.tex index 4b12b0b42eb..50d17409072 100644 --- a/etc/refcards/sk-dired-ref.tex +++ b/etc/refcards/sk-dired-ref.tex @@ -42,8 +42,7 @@ \input pdflayout.sty \pdflayout=(0) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed. diff --git a/etc/refcards/sk-refcard.tex b/etc/refcards/sk-refcard.tex index 5105e8ca986..e617387fad1 100644 --- a/etc/refcards/sk-refcard.tex +++ b/etc/refcards/sk-refcard.tex @@ -60,8 +60,7 @@ \input pdflayout.sty \pdflayout=(0) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex % Nothing else needs to be changed. diff --git a/etc/refcards/sk-survival.tex b/etc/refcards/sk-survival.tex index 7597c63f5c7..2e7ac9b9298 100644 --- a/etc/refcards/sk-survival.tex +++ b/etc/refcards/sk-survival.tex @@ -55,8 +55,7 @@ % Slovak hyphenation rules applied \shyph -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex \def\copyrightnotice{\penalty-1\vfill \vbox{\smallfont\baselineskip=0.8\baselineskip\raggedcenter diff --git a/etc/refcards/survival.tex b/etc/refcards/survival.tex index 92d178a130a..09151e9801c 100644 --- a/etc/refcards/survival.tex +++ b/etc/refcards/survival.tex @@ -44,8 +44,7 @@ \input pdflayout.sty \pdflayout=(1) -\def\versionemacs{24} % version of Emacs this is for -\def\year{2012} % latest copyright year +\input emacsver.tex \def\copyrightnotice{\penalty-1\vfill \vbox{\smallfont\baselineskip=0.8\baselineskip\raggedcenter diff --git a/etc/refcards/vipcard.tex b/etc/refcards/vipcard.tex index 13b43dbab73..2a709dc79f2 100644 --- a/etc/refcards/vipcard.tex +++ b/etc/refcards/vipcard.tex @@ -49,8 +49,8 @@ \input pdflayout.sty \pdflayout=(1) +\input emacsver.tex \def\versionemacs{18} % version of Emacs this is for -\def\year{2012} % latest copyright year \def\versionvip{3.5} % Nothing else needs to be changed. diff --git a/etc/refcards/viperCard.tex b/etc/refcards/viperCard.tex index a8694dd3bed..c6ab31cdb83 100644 --- a/etc/refcards/viperCard.tex +++ b/etc/refcards/viperCard.tex @@ -52,8 +52,8 @@ \input pdflayout.sty \pdflayout=(1) +\input emacsver.tex \def\versionemacs{21} % version of Emacs this is for -\def\year{2012} % latest copyright year \def\versionxemacs{20} % version of XEmacs this is for \def\versionviper{3.0} % version of Viper this is for From dcddaabb77402bba100322b05831ee5b54d6116b Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 17 Sep 2012 00:35:17 -0700 Subject: [PATCH 66/88] * admin/admin.el (add-log-time-format): Declare. --- admin/ChangeLog | 2 ++ admin/admin.el | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/admin/ChangeLog b/admin/ChangeLog index cef27f3f52e..7f30fe8fc0f 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,5 +1,7 @@ 2012-09-17 Glenn Morris + * admin.el (add-log-time-format): Declare. + * admin.el (cusver-scan, cusver-check): Bind local variables. * admin.el (set-version): Set major version in diff --git a/admin/admin.el b/admin/admin.el index 536236c3f70..862e5aed6c1 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -26,6 +26,8 @@ ;;; Code: +(defvar add-log-time-format) ; in add-log + (defun add-release-logs (root version) "Add \"Version VERSION released.\" change log entries in ROOT. Root must be the root of an Emacs source tree." @@ -415,7 +417,7 @@ Also generate PostScript output in PS-DEST." (setq done t)) (t (if (eobp) - (error "Parse error in %s" f)) + (error "Parse error in %s" f)) ; f is bound in manual-html-node (unless open-td (setq done t)))) (forward-line 1)))) From 45ba16c706cf9f009997550f5a3de6ea96643a92 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 17 Sep 2012 10:54:32 +0300 Subject: [PATCH 67/88] Fix the value of __malloc_extra_blocks. src/ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize __malloc_extra_blocks to 32 instead of 64, like alloc.c did in emacs_blocked_malloc, now deleted. --- src/ChangeLog | 6 ++++++ src/ralloc.c | 12 +++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index daabdd7613e..68c30dbe19e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-09-17 Eli Zaretskii + + * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize + __malloc_extra_blocks to 32 instead of 64, like alloc.c did in + emacs_blocked_malloc, now deleted. + 2012-09-17 Paul Eggert Remove no-longer-needed Solaris 2.4 vfork bug workaround. diff --git a/src/ralloc.c b/src/ralloc.c index b0134ea730a..6b03c50ab21 100644 --- a/src/ralloc.c +++ b/src/ralloc.c @@ -1204,9 +1204,15 @@ r_alloc_init (void) UNBLOCK_INPUT; #else #ifndef SYSTEM_MALLOC - /* Give GNU malloc's morecore some hysteresis - so that we move all the relocatable blocks much less often. */ - __malloc_extra_blocks = 64; + /* Give GNU malloc's morecore some hysteresis so that we move all + the relocatable blocks much less often. The number used to be + 64, but alloc.c would override that with 32 in code that was + removed when SYNC_INPUT became the only input handling mode. + That code was condition on !DOUG_LEA_MALLOC, so the call to + mallopt above is left unchanged. (Actually, I think there's no + system nowadays that uses DOUG_LEA_MALLOC and also uses + REL_ALLOC.) */ + __malloc_extra_blocks = 32; #endif #endif From b4c932a221c656c23b3c81518c3b5bc3223a7e48 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 17 Sep 2012 10:56:20 +0300 Subject: [PATCH 68/88] Set pending_signals to 1 in w32term.c's read-socket hook. src/w32term.c (w32_read_socket): Set pending_signals to 1, like xterm.c does. Reported by Daniel Colascione . --- src/ChangeLog | 3 +++ src/w32term.c | 1 + 2 files changed, 4 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 68c30dbe19e..36df05c25ae 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2012-09-17 Eli Zaretskii + * w32term.c (w32_read_socket): Set pending_signals to 1, like + xterm.c does. Reported by Daniel Colascione . + * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize __malloc_extra_blocks to 32 instead of 64, like alloc.c did in emacs_blocked_malloc, now deleted. diff --git a/src/w32term.c b/src/w32term.c index 69a16e1852b..6244728b264 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -4162,6 +4162,7 @@ w32_read_socket (struct terminal *terminal, int expected, if (interrupt_input_blocked) { interrupt_input_pending = 1; + pending_signals = 1; return -1; } From 9b318728ab4f6fce5c0f5449e80bd8c4bf3bf3a4 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 17 Sep 2012 11:22:32 +0300 Subject: [PATCH 69/88] Fix a typo in a comment. --- src/ralloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ralloc.c b/src/ralloc.c index 6b03c50ab21..9a4b1ada229 100644 --- a/src/ralloc.c +++ b/src/ralloc.c @@ -1208,7 +1208,7 @@ r_alloc_init (void) the relocatable blocks much less often. The number used to be 64, but alloc.c would override that with 32 in code that was removed when SYNC_INPUT became the only input handling mode. - That code was condition on !DOUG_LEA_MALLOC, so the call to + That code was conditioned on !DOUG_LEA_MALLOC, so the call to mallopt above is left unchanged. (Actually, I think there's no system nowadays that uses DOUG_LEA_MALLOC and also uses REL_ALLOC.) */ From 69de3ec61f1d6b2cea9d614c8f273dd01cc8bf64 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 17 Sep 2012 05:49:55 -0400 Subject: [PATCH 70/88] Fix bug when a name has no key. --- lisp/ChangeLog | 4 ++++ lisp/epa-mail.el | 38 ++++++++++++++++++++------------------ 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 275f7908f5d..d56e0e88f91 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-09-17 Richard Stallman + + * epa-mail.el (epa-mail-encrypt): Fix bug when a name has no key. + 2012-09-17 Chong Yidong * shell.el (shell-file-name-chars, shell-file-name-quote-list) diff --git a/lisp/epa-mail.el b/lisp/epa-mail.el index be5b849651c..a16fa5abdd4 100644 --- a/lisp/epa-mail.el +++ b/lisp/epa-mail.el @@ -170,24 +170,26 @@ Don't use this command in Lisp programs!" If no one is selected, symmetric encryption will be performed. " recipients) (if recipients - (mapcar - (lambda (recipient) - (setq recipient-key - (epa-mail--find-usable-key - (epg-list-keys - (epg-make-context epa-protocol) - (if (string-match "@" recipient) - (concat "<" recipient ">") - recipient)) - 'encrypt)) - (unless (or recipient-key - (y-or-n-p - (format - "No public key for %s; skip it? " - recipient))) - (error "No public key for %s" recipient)) - recipient-key) - recipients))) + (apply + 'nconc + (mapcar + (lambda (recipient) + (setq recipient-key + (epa-mail--find-usable-key + (epg-list-keys + (epg-make-context epa-protocol) + (if (string-match "@" recipient) + (concat "<" recipient ">") + recipient)) + 'encrypt)) + (unless (or recipient-key + (y-or-n-p + (format + "No public key for %s; skip it? " + recipient))) + (error "No public key for %s" recipient)) + (if recipient-key (list recipient-key))) + recipients)))) (setq sign (if verbose (y-or-n-p "Sign? "))) (if sign (epa-select-keys context From bb7dce392f6d9d5fc4b9d7de09ff920a52f07669 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 17 Sep 2012 06:17:50 -0400 Subject: [PATCH 71/88] Auto-commit of generated files. --- autogen/Makefile.in | 1 + autogen/config.in | 9 +++---- autogen/configure | 62 +++++++++++++++++++++++++-------------------- 3 files changed, 38 insertions(+), 34 deletions(-) diff --git a/autogen/Makefile.in b/autogen/Makefile.in index dbedb5d12e5..103a2e94ef3 100644 --- a/autogen/Makefile.in +++ b/autogen/Makefile.in @@ -787,6 +787,7 @@ builddir = @builddir@ cache_file = @cache_file@ canonical = @canonical@ configuration = @configuration@ +copyright = @copyright@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ diff --git a/autogen/config.in b/autogen/config.in index 39e948ee228..2f2555c75c9 100644 --- a/autogen/config.in +++ b/autogen/config.in @@ -59,9 +59,6 @@ along with GNU Emacs. If not, see . */ /* Define on FreeBSD to work around an issue when reading from a PTY. */ #undef BROKEN_PTY_READ_AFTER_EAGAIN -/* Define if SA_RESTART should only be used in batch mode. */ -#undef BROKEN_SA_RESTART - /* Define if the system is compatible with BSD 4.2. */ #undef BSD4_2 @@ -82,6 +79,9 @@ along with GNU Emacs. If not, see . */ his/her Emacs. */ #undef CLASH_DETECTION +/* Short copyright string for this version of Emacs. */ +#undef COPYRIGHT + /* Define to one of '_getb67', 'GETB67', 'getb67' for Cray-2 and Cray-YMP systems. This function is required for 'alloca.c' support on those systems. */ @@ -1295,9 +1295,6 @@ along with GNU Emacs. If not, see . */ /* Define to 1 on System V Release 4. */ #undef SVR4 -/* Process async input synchronously. */ -#undef SYNC_INPUT - /* Define to use system malloc. */ #undef SYSTEM_MALLOC diff --git a/autogen/configure b/autogen/configure index 0cbdd7c732a..4c6fa8b5cf7 100755 --- a/autogen/configure +++ b/autogen/configure @@ -1143,6 +1143,7 @@ srcdir canonical configuration version +copyright KRB4LIB DESLIB KRB5LIB @@ -1330,8 +1331,7 @@ PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='deps_frag -lisp_frag -ns_frag' +lisp_frag' ac_user_opts=' enable_option_checking with_all @@ -1343,7 +1343,6 @@ with_mmdf with_mail_unlink with_mailhost with_sound -with_sync_input with_x_toolkit with_wide_int with_xpm @@ -2061,7 +2060,6 @@ Optional Packages: --with-mailhost=HOSTNAME string giving default POP mail host --without-sound don't compile with sound support - --without-sync-input don't process async input synchronously --with-x-toolkit=KIT use an X toolkit (KIT one of: yes or gtk, gtk2, gtk3, lucid or athena, motif, no) --with-wide-int prefer wide Emacs integers (typically 62-bit) @@ -3933,20 +3931,6 @@ fi -# Check whether --with-sync-input was given. -if test "${with_sync_input+set}" = set; then : - withval=$with_sync_input; -else - with_sync_input=$with_features -fi - -if test "$with_sync_input" = yes; then - -$as_echo "#define SYNC_INPUT 1" >>confdefs.h - -fi - - # Check whether --with-x-toolkit was given. if test "${with_x_toolkit+set}" = set; then : withval=$with_x_toolkit; case "${withval}" in @@ -9414,13 +9398,13 @@ if test "${with_ns}" != no; then ns_appdir=`pwd`/nextstep/Emacs.app ns_appbindir=${ns_appdir}/Contents/MacOS ns_appresdir=${ns_appdir}/Contents/Resources - ns_appsrc=${srcdir}/nextstep/Cocoa/Emacs.base + ns_appsrc=Cocoa/Emacs.base elif test -f $GNUSTEP_CONFIG_FILE; then NS_IMPL_GNUSTEP=yes ns_appdir=`pwd`/nextstep/Emacs.app ns_appbindir=${ns_appdir} ns_appresdir=${ns_appdir}/Resources - ns_appsrc=${srcdir}/nextstep/GNUstep/Emacs.base + ns_appsrc=GNUstep/Emacs.base GNUSTEP_SYSTEM_HEADERS="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_HEADERS)" GNUSTEP_SYSTEM_LIBRARIES="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_SYSTEM_LIBRARIES)" GNUSTEP_LOCAL_HEADERS="$(. $GNUSTEP_CONFIG_FILE; echo $GNUSTEP_LOCAL_HEADERS)" @@ -9510,7 +9494,6 @@ fi INSTALL_ARCH_INDEP_EXTRA=install-etc ns_self_contained=no -ns_frag=/dev/null NS_OBJ= NS_OBJC_OBJ= if test "${HAVE_NS}" = yes; then @@ -9534,7 +9517,6 @@ if test "${HAVE_NS}" = yes; then leimdir="\${ns_appresdir}/leim" INSTALL_ARCH_INDEP_EXTRA= fi - ns_frag=$srcdir/src/ns.mk NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o" fi CFLAGS="$tmp_CFLAGS" @@ -9545,7 +9527,6 @@ CPPFLAGS="$tmp_CPPFLAGS" - ## $window_system is now set to the window system we will ## ultimately use. @@ -14508,6 +14489,11 @@ else $as_echo "no" >&6; } fi +case $canonical in + *-solaris2.4 | *-solaris2.4.*) + : ${ac_cv_func_vfork_works=no};; +esac + ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = x""yes; then : @@ -15767,9 +15753,6 @@ $as_echo "#define G_SLICE_ALWAYS_MALLOC 1" >>confdefs.h hpux11) -$as_echo "#define BROKEN_SA_RESTART 1" >>confdefs.h - - $as_echo "#define USG_SUBTTY_WORKS 1" >>confdefs.h ;; @@ -15804,6 +15787,14 @@ fi version=$PACKAGE_VERSION +copyright="Copyright (C) 2012 Free Software Foundation, Inc." + +cat >>confdefs.h <<_ACEOF +#define COPYRIGHT "$copyright" +_ACEOF + + + ### Specify what sort of things we'll be editing into Makefile and config.h. ### Use configuration here uncanonicalized to avoid exceeding size limits. @@ -24391,9 +24382,19 @@ test "${prefix}" != NONE && test "${exec_prefix}" != NONE && exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'` -SUBDIR_MAKEFILES="lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile" +if test "$HAVE_NS" = "yes"; then + if test "$NS_IMPL_GNUSTEP" = yes; then + ac_config_files="$ac_config_files nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist:nextstep/templates/Info-gnustep.plist.in nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop:nextstep/templates/Emacs.desktop.in" -ac_config_files="$ac_config_files Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile" + else + ac_config_files="$ac_config_files nextstep/Cocoa/Emacs.base/Contents/Info.plist:nextstep/templates/Info.plist.in nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings:nextstep/templates/InfoPlist.strings.in" + + fi +fi + +SUBDIR_MAKEFILES="lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile nextstep/Makefile" + +ac_config_files="$ac_config_files Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile doc/lispref/Makefile src/Makefile lwlib/Makefile lisp/Makefile leim/Makefile nextstep/Makefile" opt_makefile=test/automated/Makefile @@ -25233,6 +25234,10 @@ do case $ac_config_target in "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h:src/config.in" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist") CONFIG_FILES="$CONFIG_FILES nextstep/GNUstep/Emacs.base/Resources/Info-gnustep.plist:nextstep/templates/Info-gnustep.plist.in" ;; + "nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop") CONFIG_FILES="$CONFIG_FILES nextstep/GNUstep/Emacs.base/Resources/Emacs.desktop:nextstep/templates/Emacs.desktop.in" ;; + "nextstep/Cocoa/Emacs.base/Contents/Info.plist") CONFIG_FILES="$CONFIG_FILES nextstep/Cocoa/Emacs.base/Contents/Info.plist:nextstep/templates/Info.plist.in" ;; + "nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings") CONFIG_FILES="$CONFIG_FILES nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings:nextstep/templates/InfoPlist.strings.in" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "lib-src/Makefile") CONFIG_FILES="$CONFIG_FILES lib-src/Makefile" ;; @@ -25245,6 +25250,7 @@ do "lwlib/Makefile") CONFIG_FILES="$CONFIG_FILES lwlib/Makefile" ;; "lisp/Makefile") CONFIG_FILES="$CONFIG_FILES lisp/Makefile" ;; "leim/Makefile") CONFIG_FILES="$CONFIG_FILES leim/Makefile" ;; + "nextstep/Makefile") CONFIG_FILES="$CONFIG_FILES nextstep/Makefile" ;; "test/automated/Makefile") CONFIG_FILES="$CONFIG_FILES test/automated/Makefile" ;; "admin/unidata/Makefile") CONFIG_FILES="$CONFIG_FILES admin/unidata/Makefile" ;; "mkdirs") CONFIG_COMMANDS="$CONFIG_COMMANDS mkdirs" ;; From 2e8efb2f47b90edd393bde33bf048333b3bde279 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 17 Sep 2012 07:39:41 -0400 Subject: [PATCH 72/88] Handle Mail mode correctly. Some code cleanup. --- lisp/gnus/ChangeLog | 9 ++++++ lisp/gnus/mml.el | 68 ++++++++++++++++++++++++++------------------- 2 files changed, 49 insertions(+), 28 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 69f0025b524..924e8ea95d8 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,12 @@ +2012-09-17 Richard Stallman + + * mml.el (mml-attach-file): Doc fix. + (mml-attach-external, mml-attach-buffer, mml-attach-file): + Set mail-encode-mml when in Mail mode. + Simplify code to set HEAD and move back to HEAD. + (mml-insert-multipart, mml-insert-part): + Set mail-encode-mml when in Mail mode. + 2012-09-13 Katsumi Yamaoka * gnus-util.el (gnus-timer--function): New function. diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el index cc1aedf1b97..a72962aae0d 100644 --- a/lisp/gnus/mml.el +++ b/lisp/gnus/mml.el @@ -1305,7 +1305,8 @@ to specify options." (defun mml-attach-file (file &optional type description disposition) "Attach a file to the outgoing MIME message. The file is not inserted or encoded until you send the message with -`\\[message-send-and-exit]' or `\\[message-send]'. +`\\[message-send-and-exit]' or `\\[message-send]' in Message mode, +or `\\[mail-send-and-exit]' or `\\[mail-send]' in Mail mode. FILE is the name of the file to attach. TYPE is its content-type, a string of the form \"type/subtype\". DESCRIPTION @@ -1319,11 +1320,9 @@ body) or \"attachment\" (separate from the body)." (description (mml-minibuffer-read-description)) (disposition (mml-minibuffer-read-disposition type nil file))) (list file type description disposition))) - ;; Don't move point if this command is invoked inside the message header. - (let ((head (unless (message-in-body-p) - (prog1 - (point) - (goto-char (point-max)))))) + ;; If in the message header, attach at the end and leave point unchanged. + (let ((head (unless (message-in-body-p) (point)))) + (if head (goto-char (point-max))) (mml-insert-empty-tag 'part 'type type ;; icicles redefines read-file-name and returns a @@ -1331,12 +1330,15 @@ body) or \"attachment\" (separate from the body)." 'filename (mm-substring-no-properties file) 'disposition (or disposition "attachment") 'description description) + ;; When using Mail mode, make sure it does the mime encoding + ;; when you send the message. + (or (eq mail-user-agent 'message-user-agent) + (setq mail-encode-mml t)) (when head - (unless (prog1 - (pos-visible-in-window-p) - (goto-char head)) + (unless (pos-visible-in-window-p) (message "The file \"%s\" has been attached at the end of the message" - (file-name-nondirectory file)))))) + (file-name-nondirectory file))) + (goto-char head)))) (defun mml-dnd-attach-file (uri action) "Attach a drag and drop file. @@ -1372,21 +1374,22 @@ BUFFER is the name of the buffer to attach. See (description (mml-minibuffer-read-description)) (disposition (mml-minibuffer-read-disposition type nil))) (list buffer type description disposition))) - ;; Don't move point if this command is invoked inside the message header. - (let ((head (unless (message-in-body-p) - (prog1 - (point) - (goto-char (point-max)))))) + ;; If in the message header, attach at the end and leave point unchanged. + (let ((head (unless (message-in-body-p) (point)))) + (if head (goto-char (point-max))) (mml-insert-empty-tag 'part 'type type 'buffer buffer 'disposition disposition 'description description) + ;; When using Mail mode, make sure it does the mime encoding + ;; when you send the message. + (or (eq mail-user-agent 'message-user-agent) + (setq mail-encode-mml t)) (when head - (unless (prog1 - (pos-visible-in-window-p) - (goto-char head)) + (unless (pos-visible-in-window-p) (message "The buffer \"%s\" has been attached at the end of the message" - buffer))))) + buffer)) + (goto-char head)))) (defun mml-attach-external (file &optional type description) "Attach an external file into the buffer. @@ -1397,19 +1400,20 @@ TYPE is the MIME type to use." (type (mml-minibuffer-read-type file)) (description (mml-minibuffer-read-description))) (list file type description))) - ;; Don't move point if this command is invoked inside the message header. - (let ((head (unless (message-in-body-p) - (prog1 - (point) - (goto-char (point-max)))))) + ;; If in the message header, attach at the end and leave point unchanged. + (let ((head (unless (message-in-body-p) (point)))) + (if head (goto-char (point-max))) (mml-insert-empty-tag 'external 'type type 'name file 'disposition "attachment" 'description description) + ;; When using Mail mode, make sure it does the mime encoding + ;; when you send the message. + (or (eq mail-user-agent 'message-user-agent) + (setq mail-encode-mml t)) (when head - (unless (prog1 - (pos-visible-in-window-p) - (goto-char head)) + (unless (pos-visible-in-window-p) (message "The file \"%s\" has been attached at the end of the message" - (file-name-nondirectory file)))))) + (file-name-nondirectory file))) + (goto-char head)))) (defun mml-insert-multipart (&optional type) (interactive (if (message-in-body-p) @@ -1422,12 +1426,20 @@ TYPE is the MIME type to use." (or type (setq type "mixed")) (mml-insert-empty-tag "multipart" 'type type) + ;; When using Mail mode, make sure it does the mime encoding + ;; when you send the message. + (or (eq mail-user-agent 'message-user-agent) + (setq mail-encode-mml t)) (forward-line -1)) (defun mml-insert-part (&optional type) (interactive (if (message-in-body-p) (list (mml-minibuffer-read-type "")) (error "Use this command in the message body"))) + ;; When using Mail mode, make sure it does the mime encoding + ;; when you send the message. + (or (eq mail-user-agent 'message-user-agent) + (setq mail-encode-mml t)) (mml-insert-tag 'part 'type type 'disposition "inline")) (declare-function message-subscribed-p "message" ()) From cdfca592b027544972e92c7d0ae804581e925433 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 17 Sep 2012 07:41:39 -0400 Subject: [PATCH 73/88] message-in-body-p should not alter anything. --- lisp/gnus/ChangeLog | 2 ++ lisp/gnus/message.el | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 924e8ea95d8..45f23a6d99c 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,5 +1,7 @@ 2012-09-17 Richard Stallman + * message.el (message-in-body-p): Don't set mark or modify buffer. + * mml.el (mml-attach-file): Doc fix. (mml-attach-external, mml-attach-buffer, mml-attach-file): Set mail-encode-mml when in Mail mode. diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 42911ce0648..5360f008432 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -3160,8 +3160,12 @@ M-RET `message-newline-and-reformat' (break the line and reformat)." (defun message-in-body-p () "Return t if point is in the message body." - (let ((body (save-excursion (message-goto-body)))) - (>= (point) body))) + (>= (point) + (save-excursion + (goto-char (point-min)) + (or (search-forward (concat "\n" mail-header-separator "\n") nil t) + (search-forward-regexp "[^:]+:\\([^\n]\\|\n[ \t]\\)+\n\n" nil t)) + (point)))) (defun message-goto-eoh () "Move point to the end of the headers." From acb1c47be040b8e532716ae976ccfaaa69792f23 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 17 Sep 2012 07:44:48 -0400 Subject: [PATCH 74/88] rmail-retry-failure must avoid mime processing. --- lisp/ChangeLog | 2 ++ lisp/mail/rmail.el | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d56e0e88f91..6232886b88b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-09-17 Richard Stallman + * mail/rmail.el (rmail-retry-failure): Turn off mime processing first. + * epa-mail.el (epa-mail-encrypt): Fix bug when a name has no key. 2012-09-17 Chong Yidong diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index d88862b2d47..5606e71dea4 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -4068,6 +4068,13 @@ The variable `rmail-retry-ignored-headers' is a regular expression specifying headers which should not be copied into the new message." (interactive) (require 'mail-utils) + (if rmail-enable-mime + (with-current-buffer rmail-buffer + (if (rmail-mime-message-p) + (let ((rmail-mime-mbox-buffer rmail-view-buffer) + (rmail-mime-view-buffer rmail-buffer)) + (rmail-mime-toggle-raw 'raw))))) + (let ((rmail-this-buffer (current-buffer)) (msgnum rmail-current-message) bounce-start bounce-end bounce-indent resending @@ -4598,7 +4605,7 @@ With prefix argument N moves forward N messages with these labels. ;;;*** -;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "cd7656f82944d0b92b0d093a5f3a4c36") +;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "0c18b83f914803d1216e1a9df7ea5275") ;;; Generated autoloads from rmailmm.el (autoload 'rmail-mime "rmailmm" "\ From 0dee970c8850ab1c6334500011e36d530fc636c9 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 17 Sep 2012 07:49:10 -0400 Subject: [PATCH 75/88] When toggling mime processing off, just don't do mime processing. --- lisp/ChangeLog | 5 +++++ lisp/mail/rmailmm.el | 35 +++++++++++++++++++---------------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6232886b88b..e89320a3c9a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2012-09-17 Richard Stallman + * mail/rmailmm.el (rmail-mime-toggle-raw): Do rmail-mime-insert + only in the mime-shown mode, not in raw mode. + (rmail-mime): Toggle off mime by displaying the message without + mime processing. + * mail/rmail.el (rmail-retry-failure): Turn off mime processing first. * epa-mail.el (epa-mail-encrypt): Fix bug when a name has no key. diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el index 67b2e62275f..2cc57963ef7 100644 --- a/lisp/mail/rmailmm.el +++ b/lisp/mail/rmailmm.el @@ -389,13 +389,13 @@ Use `raw' for raw mode, and any other non-nil value for decoded mode." ;; Enter the raw mode. (rmail-mime-raw-mode entity) ;; Enter the shown mode. - (rmail-mime-shown-mode entity)) - (let ((inhibit-read-only t) - (modified (buffer-modified-p))) - (save-excursion - (goto-char (aref segment 1)) - (rmail-mime-insert entity) - (restore-buffer-modified-p modified))))) + (rmail-mime-shown-mode entity) + (let ((inhibit-read-only t) + (modified (buffer-modified-p))) + (save-excursion + (goto-char (aref segment 1)) + (rmail-mime-insert entity) + (restore-buffer-modified-p modified)))))) (defun rmail-mime-toggle-hidden () "Hide or show the body of the MIME-entity at point." @@ -1212,7 +1212,7 @@ available." (if (rmail-mime-display-header current) (delete-char (- (aref segment 2) (aref segment 1)))) (insert-buffer-substring rmail-mime-mbox-buffer - (aref header 0) (aref header 1))) + (aref header 0) (aref header 1))) ;; tagline (if (rmail-mime-display-tagline current) (delete-char (- (aref segment 3) (aref segment 2)))) @@ -1261,14 +1261,17 @@ The arguments ARG and STATE have no effect in this case." (interactive (list current-prefix-arg nil)) (if rmail-enable-mime (with-current-buffer rmail-buffer - (if (rmail-mime-message-p) - (let ((rmail-mime-mbox-buffer rmail-view-buffer) - (rmail-mime-view-buffer rmail-buffer) - (entity (get-text-property - (progn - (or arg (goto-char (point-min))) - (point)) 'rmail-mime-entity))) - (if (or (not arg) entity) (rmail-mime-toggle-raw state))) + (if (or (rmail-mime-message-p) + (get-text-property (point-min) 'rmail-mime-hidden)) + (let* ((hidden (get-text-property (point-min) 'rmail-mime-hidden)) + (desired-hidden (if state (eq state 'raw) (not hidden)))) + (unless (eq hidden desired-hidden) + (if (not desired-hidden) + (rmail-show-message rmail-current-message) + (let ((rmail-enable-mime nil) + (inhibit-read-only t)) + (rmail-show-message rmail-current-message) + (add-text-properties (point-min) (point-max) '(rmail-mime-hidden t)))))) (message "Not a MIME message, just toggling headers") (rmail-toggle-header))) (let* ((data (rmail-apply-in-message rmail-current-message 'buffer-string)) From caf4040f9efbad61940651fc19cd8f931a007ffc Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 17 Sep 2012 15:22:45 +0200 Subject: [PATCH 76/88] nt/config.nt: Sync with autogen/config.in. (BROKEN_SA_RESTART, SYNC_INPUT): Remove. --- nt/ChangeLog | 5 +++++ nt/config.nt | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/nt/ChangeLog b/nt/ChangeLog index f2a5281d1f8..106f0e91695 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,3 +1,8 @@ +2012-09-17 Juanma Barranquero + + * config.nt: Sync with autogen/config.in. + (BROKEN_SA_RESTART, SYNC_INPUT): Remove. + 2012-09-17 Glenn Morris * config.nt (COPYRIGHT): New. diff --git a/nt/config.nt b/nt/config.nt index 96217a8c580..23b33731a36 100644 --- a/nt/config.nt +++ b/nt/config.nt @@ -63,9 +63,6 @@ along with GNU Emacs. If not, see . */ /* Define on FreeBSD to work around an issue when reading from a PTY. */ #undef BROKEN_PTY_READ_AFTER_EAGAIN -/* Define if SA_RESTART should only be used in batch mode. */ -#undef BROKEN_SA_RESTART - /* Define if the system is compatible with BSD 4.2. */ #undef BSD4_2 @@ -1308,9 +1305,6 @@ along with GNU Emacs. If not, see . */ /* Define to 1 on System V Release 4. */ #undef SVR4 -/* Process async input synchronously. */ -#undef SYNC_INPUT - /* Define to use system malloc. */ #undef SYSTEM_MALLOC From 580bd8683bd69caaf131137d977dc189ed822134 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 17 Sep 2012 22:45:51 +0800 Subject: [PATCH 77/88] Make pcomplete less eager to add an extra space. * comint.el (comint--complete-file-name-data): Don't add a space if the status is `sole'; that adds a gratuitous space in the completion-cycling case. * pcomplete.el (pcomplete-completions-at-point): Likewise. Fixes: debbugs:12092 --- lisp/ChangeLog | 8 ++++++++ lisp/comint.el | 4 ++-- lisp/pcomplete.el | 7 +++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e89320a3c9a..9f964cd6647 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2012-09-17 Chong Yidong + + * comint.el (comint--complete-file-name-data): Don't add a space + if the status is `sole'; that adds a gratuitous space in the + completion-cycling case (Bug#12092). + + * pcomplete.el (pcomplete-completions-at-point): Likewise. + 2012-09-17 Richard Stallman * mail/rmailmm.el (rmail-mime-toggle-raw): Do rmail-mime-insert diff --git a/lisp/comint.el b/lisp/comint.el index 638ef73d53d..994d81a375a 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -3161,8 +3161,8 @@ See `completion-table-with-quoting' and `comint-unquote-function'.") (complete-with-action action table string pred)))) (unless (zerop (length filesuffix)) (list :exit-function - (lambda (_s finished) - (when (memq finished '(sole finished)) + (lambda (_s status) + (when (eq status 'finished) (if (looking-at (regexp-quote filesuffix)) (goto-char (match-end 0)) (insert filesuffix))))))))) diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index 97d8b4652a9..3f120961486 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -451,9 +451,12 @@ Same as `pcomplete' but using the standard completion UI." (list beg (point) table :predicate pred :exit-function + ;; If completion is finished, add a terminating space. + ;; We used to also do this if STATUS is `sole', but + ;; that does not work right when completion cycling. (unless (zerop (length pcomplete-termination-string)) - (lambda (_s finished) - (when (memq finished '(sole finished)) + (lambda (_s status) + (when (eq status 'finished) (if (looking-at (regexp-quote pcomplete-termination-string)) (goto-char (match-end 0)) From 6b250df6149155f30391fda3e18658410800867d Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 17 Sep 2012 13:15:27 -0400 Subject: [PATCH 78/88] Add ChangeLog bug refs --- lisp/ChangeLog | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9f964cd6647..5c556697cb0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -11,9 +11,10 @@ * mail/rmailmm.el (rmail-mime-toggle-raw): Do rmail-mime-insert only in the mime-shown mode, not in raw mode. (rmail-mime): Toggle off mime by displaying the message without - mime processing. + mime processing. (Bug#12305) - * mail/rmail.el (rmail-retry-failure): Turn off mime processing first. + * mail/rmail.el (rmail-retry-failure): + Turn off mime processing first. (Bug#12037) * epa-mail.el (epa-mail-encrypt): Fix bug when a name has no key. From 64f6a73693f25b2f59a4474bea86cb92bd05bf8e Mon Sep 17 00:00:00 2001 From: Stefan Merten Date: Mon, 17 Sep 2012 19:38:09 +0200 Subject: [PATCH 79/88] 2012-09-17 Stefan Merten * rst.el: Add support for `testcover'. (rst-defcustom-testcover, rst-testcover-add-compose) (rst-testcover-add-1value): New functions. (rst-portable-mark-active-p): Replace by `use-region-p'. (rst-update-section, rst-classify-adornment) (rst-find-title-line): Mark `1value' forms. (rst-classify-adornment): Remove superfluous form. (rst-update-section, rst-get-adornments-around) (rst-adornment-complete-p, rst-get-next-adornment) (rst-adjust, rst-promote-region) (rst-display-adornments-hierarchy, rst-straighten-adornments) (rst-find-pfx-in-region, rst-section-tree-rec) (rst-section-tree-point, rst-toc-insert, rst-toc-insert-node) (rst-toc-node, rst-toc, rst-forward-section) (rst-iterate-leftmost-paragraphs) (rst-iterate-leftmost-paragraphs-2, rst-enumerate-region) (rst-bullet-list-region) (rst-convert-bullets-to-enumeration, rst-font-lock-keywords) (rst-compile-find-conf, rst-compile) (rst-repeat-last-character): Fix style. --- lisp/ChangeLog | 23 ++++ lisp/textmodes/rst.el | 262 +++++++++++++++++++++++------------------- 2 files changed, 166 insertions(+), 119 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5c556697cb0..7ceacc5291d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,26 @@ +2012-09-17 Stefan Merten + + * rst.el: Add support for `testcover'. + (rst-defcustom-testcover, rst-testcover-add-compose) + (rst-testcover-add-1value): New functions. + (rst-portable-mark-active-p): Replace by `use-region-p'. + (rst-update-section, rst-classify-adornment) + (rst-find-title-line): Mark `1value' forms. + (rst-classify-adornment): Remove superfluous form. + (rst-update-section, rst-get-adornments-around) + (rst-adornment-complete-p, rst-get-next-adornment) + (rst-adjust, rst-promote-region) + (rst-display-adornments-hierarchy, rst-straighten-adornments) + (rst-find-pfx-in-region, rst-section-tree-rec) + (rst-section-tree-point, rst-toc-insert, rst-toc-insert-node) + (rst-toc-node, rst-toc, rst-forward-section) + (rst-iterate-leftmost-paragraphs) + (rst-iterate-leftmost-paragraphs-2, rst-enumerate-region) + (rst-bullet-list-region) + (rst-convert-bullets-to-enumeration, rst-font-lock-keywords) + (rst-compile-find-conf, rst-compile) + (rst-repeat-last-character): Fix style. + 2012-09-17 Chong Yidong * comint.el (comint--complete-file-name-data): Don't add a space diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index e2647a98770..47a821c0148 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -103,11 +103,51 @@ ;;; Code: +;; FIXME: Check through major mode conventions again. + ;; FIXME: Add proper ";;;###autoload" comments. ;; FIXME: When 24.1 is common place remove use of `lexical-let' and put "-*- ;; lexical-binding: t -*-" in the first line. +;; FIXME: Use `testcover'. + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Support for `testcover' + +(when (boundp 'testcover-1value-functions) + ;; Below `lambda' is used in a loop with varying parameters and is thus not + ;; 1valued. + (setq testcover-1value-functions + (delq 'lambda testcover-1value-functions)) + (add-to-list 'testcover-compose-functions 'lambda)) + +(defun rst-testcover-defcustom () + "Remove all customized variables from `testcover-module-constants'. +This seems to be a bug in `testcover': `defcustom' variables are +considered constants. Revert it with this function after each `defcustom'." + (when (boundp 'testcover-module-constants) + (setq testcover-module-constants + (delq nil + (mapcar + (lambda (sym) + (if (not (plist-member (symbol-plist sym) 'standard-value)) + sym)) + testcover-module-constants))))) + +(defun rst-testcover-add-compose (fun) + "Add FUN to `testcover-compose-functions'." + (when (boundp 'testcover-compose-functions) + (add-to-list 'testcover-compose-functions fun))) + +(defun rst-testcover-add-1value (fun) + "Add FUN to `testcover-1value-functions'." + (when (boundp 'testcover-1value-functions) + (add-to-list 'testcover-1value-functions fun))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Common Lisp stuff + ;; Only use of macros is allowed - may be replaced by `cl-lib' some time. (eval-when-compile (require 'cl)) @@ -160,6 +200,7 @@ Comparison done with `equal'." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Versions +;; testcover: ok. (defun rst-extract-version (delim-re head-re re tail-re var &optional default) "Extract the version from a variable according to the given regexes. Return the version after regex DELIM-RE and HEAD-RE matching RE @@ -173,7 +214,7 @@ and before TAIL-RE and DELIM-RE in VAR or DEFAULT for no match." ;; Use CVSHeader to really get information from CVS and not other version ;; control systems. (defconst rst-cvs-header - "$CVSHeader: sm/rst_el/rst.el,v 1.301 2012-07-30 19:29:46 stefan Exp $") + "$CVSHeader: sm/rst_el/rst.el,v 1.309.2.1 2012-09-17 17:30:49 stefan Exp $") (defconst rst-cvs-rev (rst-extract-version "\\$" "CVSHeader: \\S + " "[0-9]+\\(?:\\.[0-9]+\\)+" " .*" rst-cvs-header "0.0") @@ -483,6 +524,8 @@ argument list for `rst-re'.") (defvar rst-re-alist) ; Forward declare to use it in `rst-re'. ;; FIXME: Use `sregex` or `rx` instead of re-inventing the wheel. +(rst-testcover-add-compose 'rst-re) +;; testcover: ok. (defun rst-re (&rest args) "Interpret ARGS as regular expressions and return a regex string. Each element of ARGS may be one of the following: @@ -556,6 +599,7 @@ After interpretation of ARGS the results are concatenated as for ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Mode definition +;; testcover: ok. (defun rst-define-key (keymap key def &rest deprecated) "Bind like `define-key' but add deprecated key definitions. KEYMAP, KEY, and DEF are as in `define-key'. DEPRECATED key @@ -734,6 +778,7 @@ This inherits from Text mode.") The hook for `text-mode' is run before this one." :group 'rst :type '(hook)) +(rst-testcover-defcustom) ;; Pull in variable definitions silencing byte-compiler. (require 'newcomment) @@ -949,6 +994,7 @@ file." (const :tag "Underline only" simple)) (integer :tag "Indentation for overline and underline type" :value 0)))) +(rst-testcover-defcustom) (defcustom rst-default-indent 1 "Number of characters to indent the section title. @@ -958,7 +1004,7 @@ from a simple adornment style to a over-and-under adornment style." :group 'rst-adjust :type '(integer)) - +(rst-testcover-defcustom) (defun rst-compare-adornments (ado1 ado2) "Compare adornments. @@ -979,7 +1025,8 @@ not found." (setq cur (cdr cur))) cur)) - +;; testcover: FIXME: Test with `rst-preferred-adornments' == nil. Add test +;; `rst-adjust-no-preference'. (defun rst-suggest-new-adornment (allados &optional prev) "Suggest a new, different adornment from all that have been seen. @@ -1032,7 +1079,7 @@ requested adornment." len) ;; Fixup whitespace at the beginning and end of the line. - (if (or (null indent) (eq style 'simple)) + (if (or (null indent) (eq style 'simple)) ;; testcover: ok. (setq indent 0)) (beginning-of-line) (delete-horizontal-space) @@ -1046,7 +1093,8 @@ requested adornment." ;; Remove previous line if it is an adornment. (save-excursion - (forward-line -1) + (forward-line -1) ;; testcover: FIXME: Doesn't work when in first line + ;; of buffer. (if (and (looking-at (rst-re 'ado-beg-2-1)) ;; Avoid removing the underline of a title right above us. (save-excursion (forward-line -1) @@ -1055,7 +1103,8 @@ requested adornment." ;; Remove following line if it is an adornment. (save-excursion - (forward-line +1) + (forward-line +1) ;; testcover: FIXME: Doesn't work when in last line + ;; of buffer. (if (looking-at (rst-re 'ado-beg-2-1)) (rst-delete-entire-line)) ;; Add a newline if we're at the end of the buffer, for the subsequence @@ -1071,13 +1120,14 @@ requested adornment." (insert (make-string len char)))) ;; Insert underline. - (forward-line +1) + (1value ;; Line has been inserted above. + (forward-line +1)) (open-line 1) (insert (make-string len char)) - (forward-line +1) - (goto-char marker) - )) + (1value ;; Line has been inserted above. + (forward-line +1)) + (goto-char marker))) (defun rst-classify-adornment (adornment end) "Classify adornment for section titles and transitions. @@ -1104,11 +1154,14 @@ Return nil if no syntactically valid adornment is found." (ado-re (rst-re ado-ch 'adorep3-hlp)) (end-pnt (point)) (beg-pnt (progn - (forward-line 0) + (1value ;; No lines may be left to move. + (forward-line 0)) (point))) (nxt-emp ; Next line nonexistent or empty (save-excursion (or (not (zerop (forward-line 1))) + ;; testcover: FIXME: Add test classifying at the end of + ;; buffer. (looking-at (rst-re 'lin-end))))) (prv-emp ; Previous line nonexistent or empty (save-excursion @@ -1117,7 +1170,9 @@ Return nil if no syntactically valid adornment is found." (ttl-blw ; Title found below starting here. (save-excursion (and - (zerop (forward-line 1)) + (zerop (forward-line 1)) ;; testcover: FIXME: Add test + ;; classifying at the end of + ;; buffer. (looking-at (rst-re 'ttl-beg)) (point)))) (ttl-abv ; Title found above starting here. @@ -1129,7 +1184,9 @@ Return nil if no syntactically valid adornment is found." (und-fnd ; Matching underline found starting here. (save-excursion (and ttl-blw - (zerop (forward-line 2)) + (zerop (forward-line 2)) ;; testcover: FIXME: Add test + ;; classifying at the end of + ;; buffer. (looking-at (rst-re ado-re 'lin-end)) (point)))) (ovr-fnd ; Matching overline found starting here. @@ -1174,8 +1231,8 @@ Return nil if no syntactically valid adornment is found." (setq key nil))) (if key (list key - (or beg-ovr beg-txt beg-und) - (or end-und end-txt end-ovr) + (or beg-ovr beg-txt) + (or end-und end-txt) beg-ovr end-ovr beg-txt end-txt beg-und end-und))))))) (defun rst-find-title-line () @@ -1193,7 +1250,8 @@ in the first element. If there is no adornment around the title CHARACTER is also nil and match groups for overline and underline are nil." (save-excursion - (forward-line 0) + (1value ;; No lines may be left to move. + (forward-line 0)) (let ((orig-pnt (point)) (orig-end (line-end-position))) (cond @@ -1253,6 +1311,7 @@ t when no section adornments were found. Value depends on `rst-all-sections'.") (make-variable-buffer-local 'rst-section-hierarchy) +(rst-testcover-add-1value 'rst-reset-section-caches) (defun rst-reset-section-caches () "Reset all section cache variables. Should be called by interactive functions which deal with sections." @@ -1354,9 +1413,7 @@ Return a list of the previous and next adornments." (if (and cur (caar cur)) (setq next (if (= curline (caar cur)) (cdr cur) cur))) - (mapcar 'cdar (list prev next)) - )) - + (mapcar 'cdar (list prev next)))) (defun rst-adornment-complete-p (ado) "Return true if the adornment ADO around point is complete." @@ -1369,8 +1426,7 @@ Return a list of the previous and next adornments." (let* ((char (car ado)) (style (cadr ado)) (indent (caddr ado)) - (endcol (save-excursion (end-of-line) (current-column))) - ) + (endcol (save-excursion (end-of-line) (current-column)))) (if char (let ((exps (rst-re "^" char (format "\\{%d\\}" (+ endcol indent)) "$"))) (and @@ -1380,9 +1436,7 @@ Return a list of the previous and next adornments." (or (not (eq style 'over-and-under)) (save-excursion (forward-line -1) (beginning-of-line) - (looking-at exps)))) - )) - )) + (looking-at exps)))))))) (defun rst-get-next-adornment @@ -1414,8 +1468,7 @@ REVERSE-DIRECTION is used to reverse the cycling order." cur)) ;; If not found, take the first of all adornments. - suggestion - ))) + suggestion))) ;; FIXME: A line "``/`` full" is not accepted as a section title. @@ -1456,7 +1509,7 @@ b. a negative numerical argument, which generally inverts the (reverse-direction (and pfxarg (< (prefix-numeric-value pfxarg) 0))) (toggle-style (and pfxarg (not reverse-direction)))) - (if (rst-portable-mark-active-p) + (if (use-region-p) ;; Adjust adornments within region. (rst-promote-region (and pfxarg t)) ;; Adjust adornment around point. @@ -1466,15 +1519,14 @@ b. a negative numerical argument, which generally inverts the (run-hooks 'rst-adjust-hook) ;; Make sure to reset the cursor position properly after we're done. - (goto-char origpt) - - )) + (goto-char origpt))) (defcustom rst-adjust-hook nil "Hooks to be run after running `rst-adjust'." :group 'rst-adjust :type '(hook) :package-version '(rst . "1.1.0")) +(rst-testcover-defcustom) (defcustom rst-new-adornment-down nil "Controls level of new adornment for section headers." @@ -1483,6 +1535,7 @@ b. a negative numerical argument, which generally inverts the (const :tag "Same level as previous one" nil) (const :tag "One level down relative to the previous one" t)) :package-version '(rst . "1.1.0")) +(rst-testcover-defcustom) (defun rst-adjust-adornment (pfxarg) "Call `rst-adjust-adornment-work' interactively. @@ -1741,8 +1794,7 @@ hierarchy is similar to that used by `rst-adjust-adornment-work'." (region-begin-line (line-number-at-pos (region-beginning))) (region-end-line (line-number-at-pos (region-end))) - marker-list - ) + marker-list) ;; Skip the markers that come before the region beginning. (while (and cur (< (caar cur) region-begin-line)) @@ -1771,8 +1823,7 @@ hierarchy is similar to that used by `rst-adjust-adornment-work'." ;; Clear marker to avoid slowing down the editing after we're done. (set-marker (car p) nil)) - (setq deactivate-mark nil) - ))) + (setq deactivate-mark nil)))) @@ -1792,9 +1843,7 @@ in ADORNMENTS." (apply 'rst-update-section x) (goto-char (point-max)) (insert "\n") - (incf level) - )) - ))) + (incf level)))))) (defun rst-straighten-adornments () "Redo all the adornments in the current buffer. @@ -1822,10 +1871,7 @@ in order to adapt it to our preferred style." (apply 'rst-update-section (nth (car lm) rst-preferred-adornments)) ;; Reset the marker to avoid slowing down editing until it gets GC'ed. - (set-marker (cdr lm) nil) - ) - ))) - + (set-marker (cdr lm) nil))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -1906,7 +1952,7 @@ and the column of the point." (looking-at pfx-re)))))) ; ...pfx at same level. (push (cons (point) (current-column)) pfx)) - (forward-line 1)) ) + (forward-line 1))) (nreverse pfx))) (defun rst-insert-list-pos (newitem) @@ -2005,6 +2051,7 @@ starting item, for example 'e' for 'A)' style. The position is also arranged by :tag (char-to-string char) char)) rst-bullets))) :package-version '(rst . "1.1.0")) +(rst-testcover-defcustom) (defun rst-insert-list-continue (curitem prefer-roman) "Insert a list item with list start CURITEM including its indentation level. @@ -2206,8 +2253,7 @@ list destructively." (setq node (cons nil (cdaar children)))) ;; Return this node with its children. - (cons node children) - )) + (cons node children))) (defun rst-section-tree-point (node &optional point) @@ -2241,11 +2287,8 @@ container subtree node that we're returning." (let ((sub (rst-section-tree-point (car last) curpoint))) (setq path (car sub) outtree (cdr sub))) - (setq outtree node)) - - ))) - (cons (cons (car node) path) outtree) - )) + (setq outtree node))))) + (cons (cons (car node) path) outtree))) (defgroup rst-toc nil @@ -2257,6 +2300,7 @@ container subtree node that we're returning." "Indentation for table-of-contents display. Also used for formatting insertion, when numbering is disabled." :group 'rst-toc) +(rst-testcover-defcustom) (defcustom rst-toc-insert-style 'fixed "Insertion style for table-of-contents. @@ -2267,10 +2311,12 @@ indentation style: - aligned: numbering, titles aligned under each other - listed: numbering, with dashes like list items (EXPERIMENTAL)" :group 'rst-toc) +(rst-testcover-defcustom) (defcustom rst-toc-insert-number-separator " " "Separator that goes between the TOC number and the title." :group 'rst-toc) +(rst-testcover-defcustom) ;; This is used to avoid having to change the user's mode. (defvar rst-toc-insert-click-keymap @@ -2282,7 +2328,7 @@ indentation style: (defcustom rst-toc-insert-max-level nil "If non-nil, maximum depth of the inserted TOC." :group 'rst-toc) - +(rst-testcover-defcustom) (defun rst-toc-insert (&optional pfxarg) "Insert a simple text rendering of the table of contents. @@ -2316,8 +2362,7 @@ The TOC is inserted indented at the current column." (delete-region init-point (+ init-point (length initial-indent))) ;; Delete the last newline added. - (delete-char -1) - ))) + (delete-char -1)))) (defun rst-toc-insert-node (node level indent pfx) "Insert tree node NODE in table-of-contents. @@ -2343,9 +2388,7 @@ level to align." ;; is generated automatically. (put-text-property b (point) 'mouse-face 'highlight) (put-text-property b (point) 'rst-toc-target (cadar node)) - (put-text-property b (point) 'keymap rst-toc-insert-click-keymap) - - ) + (put-text-property b (point) 'keymap rst-toc-insert-click-keymap)) (insert "\n") ;; Prepare indent for children. @@ -2362,9 +2405,7 @@ level to align." ((eq rst-toc-insert-style 'listed) (concat (substring indent 0 -3) - (concat (make-string (+ (length pfx) 2) ? ) " - "))) - )) - ) + (concat (make-string (+ (length pfx) 2) ? ) " - ")))))) (if (or (eq rst-toc-insert-max-level nil) (< level rst-toc-insert-max-level)) @@ -2382,8 +2423,7 @@ level to align." (if (cdr node) (setq fmt (format "%%-%dd" (1+ (floor (log10 (length - (cdr node)))))))) - )) + (cdr node)))))))))) (dolist (child (cdr node)) (rst-toc-insert-node child @@ -2391,9 +2431,7 @@ level to align." indent (if do-child-numbering (concat pfx (format fmt count)) pfx)) - (incf count))) - - ))) + (incf count)))))) (defun rst-toc-update () @@ -2468,8 +2506,7 @@ file-write hook to always make it up-to-date automatically." ;; Add link on lines. (put-text-property b (point) 'rst-toc-target (cadar node)) - (insert "\n") - )) + (insert "\n"))) (dolist (child (cdr node)) (rst-toc-node child (1+ level)))) @@ -2517,8 +2554,7 @@ brings the cursor in that section." line ;; Create a temporary buffer. - (buf (get-buffer-create rst-toc-buffer-name)) - ) + (buf (get-buffer-create rst-toc-buffer-name))) (with-current-buffer buf (let ((inhibit-read-only t)) @@ -2531,8 +2567,7 @@ brings the cursor in that section." ;; Count the lines to our found node. (let ((linefound (rst-toc-count-lines sectree our-node))) - (setq line (if (cdr linefound) (car linefound) 0))) - )) + (setq line (if (cdr linefound) (car linefound) 0))))) (display-buffer buf) (pop-to-buffer buf) @@ -2541,8 +2576,7 @@ brings the cursor in that section." ;; Move the cursor near the right section in the TOC. (goto-char (point-min)) - (forward-line (1- line)) - )) + (forward-line (1- line)))) (defun rst-toc-mode-find-section () @@ -2644,8 +2678,7 @@ backwards in the file (default is to use 1)." (curline (line-number-at-pos)) (cur allados) - (idx 0) - ) + (idx 0)) ;; Find the index of the "next" adornment w.r.t. to the current line. (while (and cur (< (caar cur) curline)) @@ -2666,8 +2699,7 @@ backwards in the file (default is to use 1)." (progn (goto-char (point-min)) (forward-line (1- (car cur)))) - (if (> offset 0) (goto-char (point-max)) (goto-char (point-min)))) - )) + (if (> offset 0) (goto-char (point-max)) (goto-char (point-min)))))) (defun rst-backward-section () "Like `rst-forward-section', except move back one title." @@ -2686,7 +2718,7 @@ for negative COUNT." (error "Cannot mark zero sections")) (cond ((and allow-extend (or (and (eq last-command this-command) (mark t)) - (rst-portable-mark-active-p))) + (use-region-p))) (set-mark (save-excursion (goto-char (mark)) @@ -2742,17 +2774,14 @@ of each paragraph only." (valid (and (= curcol leftcol) (not (looking-at (rst-re 'lin-end)))) (and (= curcol leftcol) - (not (looking-at (rst-re 'lin-end))))) - ) + (not (looking-at (rst-re 'lin-end)))))) ((>= (point) endm)) (if (if ,first-only (and valid (not previous)) valid) ,body-consequent - ,body-alternative) - - )))) + ,body-alternative))))) ;; FIXME: This needs to be refactored. Probably this is simply a function ;; applying BODY rather than a macro. @@ -2785,13 +2814,10 @@ first of a paragraph." (,isleftmost (and (not ,isempty) (= (current-column) ,leftmost)) (and (not ,isempty) - (= (current-column) ,leftmost))) - ) + (= (current-column) ,leftmost)))) ((>= (point) endm)) - (progn ,@body) - - ))))) + (progn ,@body)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Indentation @@ -2817,26 +2843,31 @@ here." "Indentation when there is no more indentation point given." :group 'rst-indent :type '(integer)) +(rst-testcover-defcustom) (defcustom rst-indent-field 3 "Indentation for first line after a field or 0 to always indent for content." :group 'rst-indent :type '(integer)) +(rst-testcover-defcustom) (defcustom rst-indent-literal-normal 3 "Default indentation for literal block after a markup on an own line." :group 'rst-indent :type '(integer)) +(rst-testcover-defcustom) (defcustom rst-indent-literal-minimized 2 "Default indentation for literal block after a minimized markup." :group 'rst-indent :type '(integer)) +(rst-testcover-defcustom) (defcustom rst-indent-comment 3 "Default indentation for first line of a comment." :group 'rst-indent :type '(integer)) +(rst-testcover-defcustom) ;; FIXME: Must consider other tabs: ;; * Line blocks @@ -3116,8 +3147,7 @@ do all lines instead of just paragraphs." (let ((ins-string (format "%d. " (incf count)))) (setq last-insert-len (length ins-string)) (insert ins-string)) - (insert (make-string last-insert-len ?\ )) - ))) + (insert (make-string last-insert-len ?\ ))))) (defun rst-bullet-list-region (beg end all) "Add bullets to all the leftmost paragraphs in the given region. @@ -3127,8 +3157,7 @@ do all lines instead of just paragraphs." (rst-iterate-leftmost-paragraphs beg end (not all) (insert (car rst-preferred-bullets) " ") - (insert " ") - )) + (insert " "))) ;; FIXME: Does not deal with a varying number of digits appropriately. ;; FIXME: Does not deal with multiple levels independently. @@ -3143,18 +3172,13 @@ Renumber as necessary. Region is from BEG to END." (cons (copy-marker (car x)) (cdr x))) (rst-find-pfx-in-region beg end (rst-re 'itmany-sta-1)))) - (count 1) - ) + (count 1)) (save-excursion (dolist (x items) (goto-char (car x)) (looking-at (rst-re 'itmany-beg-1)) (replace-match (format "%d." count) nil nil nil 1) - (incf count) - )) - )) - - + (incf count))))) ;;------------------------------------------------------------------------------ @@ -3202,6 +3226,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too." :version "24.1" :group 'rst-faces :type '(face)) +(rst-testcover-defcustom) (make-obsolete-variable 'rst-block-face "customize the face `rst-block' instead." "24.1") @@ -3216,6 +3241,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too." :version "24.1" :group 'rst-faces :type '(face)) +(rst-testcover-defcustom) (make-obsolete-variable 'rst-external-face "customize the face `rst-external' instead." "24.1") @@ -3230,6 +3256,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too." :version "24.1" :group 'rst-faces :type '(face)) +(rst-testcover-defcustom) (make-obsolete-variable 'rst-definition-face "customize the face `rst-definition' instead." "24.1") @@ -3246,6 +3273,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too." "Directives and roles." :group 'rst-faces :type '(face)) +(rst-testcover-defcustom) (make-obsolete-variable 'rst-directive-face "customize the face `rst-directive' instead." "24.1") @@ -3260,6 +3288,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too." :version "24.1" :group 'rst-faces :type '(face)) +(rst-testcover-defcustom) (make-obsolete-variable 'rst-comment-face "customize the face `rst-comment' instead." "24.1") @@ -3274,6 +3303,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too." :version "24.1" :group 'rst-faces :type '(face)) +(rst-testcover-defcustom) (make-obsolete-variable 'rst-emphasis1-face "customize the face `rst-emphasis1' instead." "24.1") @@ -3287,6 +3317,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too." "Double emphasis." :group 'rst-faces :type '(face)) +(rst-testcover-defcustom) (make-obsolete-variable 'rst-emphasis2-face "customize the face `rst-emphasis2' instead." "24.1") @@ -3301,6 +3332,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too." :version "24.1" :group 'rst-faces :type '(face)) +(rst-testcover-defcustom) (make-obsolete-variable 'rst-literal-face "customize the face `rst-literal' instead." "24.1") @@ -3315,6 +3347,7 @@ Region is from RBEG to REND. With PFXARG set the empty lines too." :version "24.1" :group 'rst-faces :type '(face)) +(rst-testcover-defcustom) (make-obsolete-variable 'rst-reference-face "customize the face `rst-reference' instead." "24.1") @@ -3368,6 +3401,7 @@ Recompute the faces. VAL is the value to set." :group 'rst-faces-defaults :type '(integer) :set 'rst-set-level-default) +(rst-testcover-defcustom) ;; FIXME: It should be possible to give "#RRGGBB" type of color values. ;; Together with a `rst-level-face-end-light' this could be used for ;; computing steps. @@ -3378,6 +3412,7 @@ Recompute the faces. VAL is the value to set." :group 'rst-faces-defaults :type '(string) :set 'rst-set-level-default) +(rst-testcover-defcustom) ;; FIXME LEVEL-FACE: This needs to be done differently: The faces must specify ;; how they behave for dark and light background using the ;; relevant options explained in `defface'. @@ -3391,12 +3426,14 @@ The default depends on whether the value of `frame-background-mode' is :group 'rst-faces-defaults :type '(integer) :set 'rst-set-level-default) +(rst-testcover-defcustom) (defcustom rst-level-face-format-light "%2d" "The format for the lightness factor appended to the base name of the color. This value is expanded by `format' with an integer." :group 'rst-faces-defaults :type '(string) :set 'rst-set-level-default) +(rst-testcover-defcustom) ;; FIXME LEVEL-FACE: This needs to be done differently: The faces must specify ;; how they behave for dark and light background using the ;; relevant options explained in `defface'. @@ -3420,6 +3457,7 @@ This color is used as background for section title text on level :group 'rst-faces-defaults :type '(integer) :set 'rst-set-level-default) +(rst-testcover-defcustom) (defcustom rst-adornment-faces-alist ;; FIXME LEVEL-FACE: Must be redone if `rst-level-face-max' is changed @@ -3447,6 +3485,7 @@ group." (const :tag "section title adornment" nil)) :value-type (face)) :set-after '(rst-level-face-max)) +(rst-testcover-defcustom) (defun rst-define-level-faces () "Define the faces for the section title text faces from the values." @@ -3663,8 +3702,7 @@ variable of the `rst-faces-defaults' group is customized. Use ;; Indentation is not required for doctest blocks. (,(rst-re 'lin-beg '(:grp (:alt ">>>" ell-tag)) '(:grp ".+")) (1 rst-block-face) - (2 rst-literal-face)) - ) + (2 rst-literal-face))) "Keywords to highlight in rst mode.") (defvar font-lock-beg) @@ -3974,6 +4012,7 @@ string)) to be used for converting the document." (string :tag "Options")))) :group 'rst :package-version "1.2.0") +(rst-testcover-defcustom) ;; FIXME: Must be `defcustom`. (defvar rst-compile-primary-toolset 'html @@ -3999,11 +4038,8 @@ string)) to be used for converting the document." (setq prevdir dir) (setq dir (expand-file-name (file-name-directory (directory-file-name - (file-name-directory dir))))) - ) - (or (and dir (concat dir file-name)) nil) - ))) - + (file-name-directory dir)))))) + (or (and dir (concat dir file-name)) nil)))) (require 'compile) @@ -4041,8 +4077,7 @@ select the alternative tool-set." ;; Invoke the compile command. (if (or compilation-read-command use-alt) (call-interactively 'compile) - (compile compile-command)) - )) + (compile compile-command)))) (defun rst-compile-alt-toolset () "Compile command with the alternative tool-set." @@ -4166,8 +4201,7 @@ column is used (fill-column vs. end of previous/next line)." (cond ((equal last-command 'rst-repeat-last-character) (if (= curcol fill-column) prevcol fill-column)) (t (save-excursion - (if (zerop prevcol) fill-column prevcol))) - )) ) + (if (zerop prevcol) fill-column prevcol)))))) (end-of-line) (if (> (current-column) rightmost-column) ;; Shave characters off the end. @@ -4176,17 +4210,7 @@ column is used (fill-column vs. end of previous/next line)." (point)) ;; Fill with last characters. (insert-char (preceding-char) - (- rightmost-column (current-column)))) - )) - - -(defun rst-portable-mark-active-p () - "Return non-nil if the mark is active. -This is a portable function." - (cond - ((fboundp 'region-active-p) (region-active-p)) - ((boundp 'transient-mark-mode) (and transient-mark-mode mark-active)) - (t mark-active))) + (- rightmost-column (current-column)))))) From 51eed9b88f82fed4dff2ced44852fe0fd4851233 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 17 Sep 2012 15:53:27 -0400 Subject: [PATCH 80/88] Fix typo in previous --- make-dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make-dist b/make-dist index 3b2d79e56bc..7a17fa02372 100755 --- a/make-dist +++ b/make-dist @@ -408,7 +408,7 @@ echo "Making links to \`nextstep'" echo "Making links to \`nextstep/templates'" (cd nextstep/templates - ln Emacs.desktop.in Info-gnustep.plist.in Info.plist.in InfoPlist.strings.in../../${tempdir}/nextstep/templates) + ln Emacs.desktop.in Info-gnustep.plist.in Info.plist.in InfoPlist.strings.in ../../${tempdir}/nextstep/templates) echo "Making links to \`nextstep/Cocoa/Emacs.base/Contents'" (cd nextstep/Cocoa/Emacs.base/Contents From c8b9f1bcbf98ba65fd8a311befd9df99cd143875 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 17 Sep 2012 23:11:34 +0300 Subject: [PATCH 81/88] Fix bug #12196 with infloop when cache-long-line-scans is non-nil. src/search.c (scan_buffer): Use character positions in calls to region_cache_forward and region_cache_backward, not byte positions. --- src/ChangeLog | 4 ++++ src/search.c | 24 ++++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 36df05c25ae..6c3041105f5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2012-09-17 Eli Zaretskii + * search.c (scan_buffer): Use character positions in calls to + region_cache_forward and region_cache_backward, not byte + positions. (Bug#12196) + * w32term.c (w32_read_socket): Set pending_signals to 1, like xterm.c does. Reported by Daniel Colascione . diff --git a/src/search.c b/src/search.c index 99fd7971e4c..1735ade5d8a 100644 --- a/src/search.c +++ b/src/search.c @@ -674,7 +674,7 @@ scan_buffer (register int target, ptrdiff_t start, ptrdiff_t end, obstacle --- the last character the dumb search loop should examine. */ ptrdiff_t ceiling_byte = CHAR_TO_BYTE (end) - 1; - ptrdiff_t start_byte = CHAR_TO_BYTE (start); + ptrdiff_t start_byte; ptrdiff_t tem; /* If we're looking for a newline, consult the newline cache @@ -684,18 +684,22 @@ scan_buffer (register int target, ptrdiff_t start, ptrdiff_t end, ptrdiff_t next_change; immediate_quit = 0; while (region_cache_forward - (current_buffer, newline_cache, start_byte, &next_change)) - start_byte = next_change; + (current_buffer, newline_cache, start, &next_change)) + start = next_change; immediate_quit = allow_quit; + start_byte = CHAR_TO_BYTE (start); + /* START should never be after END. */ if (start_byte > ceiling_byte) start_byte = ceiling_byte; /* Now the text after start is an unknown region, and next_change is the position of the next known region. */ - ceiling_byte = min (next_change - 1, ceiling_byte); + ceiling_byte = min (CHAR_TO_BYTE (next_change) - 1, ceiling_byte); } + else + start_byte = CHAR_TO_BYTE (start); /* The dumb loop can only scan text stored in contiguous bytes. BUFFER_CEILING_OF returns the last character @@ -747,7 +751,7 @@ scan_buffer (register int target, ptrdiff_t start, ptrdiff_t end, { /* The last character to check before the next obstacle. */ ptrdiff_t ceiling_byte = CHAR_TO_BYTE (end); - ptrdiff_t start_byte = CHAR_TO_BYTE (start); + ptrdiff_t start_byte; ptrdiff_t tem; /* Consult the newline cache, if appropriate. */ @@ -756,18 +760,22 @@ scan_buffer (register int target, ptrdiff_t start, ptrdiff_t end, ptrdiff_t next_change; immediate_quit = 0; while (region_cache_backward - (current_buffer, newline_cache, start_byte, &next_change)) - start_byte = next_change; + (current_buffer, newline_cache, start, &next_change)) + start = next_change; immediate_quit = allow_quit; + start_byte = CHAR_TO_BYTE (start); + /* Start should never be at or before end. */ if (start_byte <= ceiling_byte) start_byte = ceiling_byte + 1; /* Now the text before start is an unknown region, and next_change is the position of the next known region. */ - ceiling_byte = max (next_change, ceiling_byte); + ceiling_byte = max (CHAR_TO_BYTE (next_change), ceiling_byte); } + else + start_byte = CHAR_TO_BYTE (start); /* Stop scanning before the gap. */ tem = BUFFER_FLOOR_OF (start_byte - 1); From 50bfc8243c7385f7e795bca26b539f57c167170c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 17 Sep 2012 14:33:14 -0700 Subject: [PATCH 82/88] * Makefile.in: Fix build error on FreeBSD. ($(MAKEFILE_NAME)): Pass MAKE='$(MAKE)' to config.status's env. Suggested by Wolfgang Jenker in . (MAKE_CONFIG_STATUS): Remove. Remaining use expanded. This undoes part of the 2012-09-10 patch. (bootstrap): Run ./configure, rather than trying to run config.status if it exists. That builds src/epaths.h more reliably. --- ChangeLog | 9 +++++++++ Makefile.in | 8 +++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7b9da902551..48d1e52e2cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2012-09-17 Paul Eggert + * Makefile.in: Fix build error on FreeBSD. + ($(MAKEFILE_NAME)): Pass MAKE='$(MAKE)' to config.status's env. + Suggested by Wolfgang Jenker in + . + (MAKE_CONFIG_STATUS): Remove. Remaining use expanded. + This undoes part of the 2012-09-10 patch. + (bootstrap): Run ./configure, rather than trying to run config.status + if it exists. That builds src/epaths.h more reliably. + Remove no-longer-needed Solaris 2.4 vfork bug workaround. * configure.ac (ac_cv_func_vfork_works): Default to 'no' on Solaris 2.4, so that AC_FUNC_VFORK doesn't think vfork works. diff --git a/Makefile.in b/Makefile.in index 9bb85967930..386c4c135be 100644 --- a/Makefile.in +++ b/Makefile.in @@ -358,19 +358,17 @@ blessmail: Makefile src FRC MAKEFILE_NAME = Makefile $(MAKEFILE_NAME): config.status $(srcdir)/src/config.in \ $(srcdir)/Makefile.in $(SUBDIR_MAKEFILES_IN) - ./config.status + MAKE='$(MAKE)' ./config.status # Don't erase these files if make is interrupted while refreshing them. .PRECIOUS: Makefile config.status -MAKE_CONFIG_STATUS = \ +config.status: ${srcdir}/configure ${srcdir}/lisp/version.el if [ -x ./config.status ]; then \ ./config.status --recheck; \ else \ ./configure $(CONFIGURE_FLAGS); \ fi -config.status: ${srcdir}/configure ${srcdir}/lisp/version.el - $(MAKE_CONFIG_STATUS) AUTOCONF_INPUTS = $(srcdir)/configure.ac $(srcdir)/aclocal.m4 @@ -897,7 +895,7 @@ dvi: # * Do the actual build. bootstrap: bootstrap-clean FRC cd $(srcdir) && { ./autogen.sh || test $$? -eq 101; } - $(MAKE_CONFIG_STATUS) + ./configure $(CONFIGURE_FLAGS) $(MAKE) $(MFLAGS) info all .PHONY: check-declare From dee26dfa11ac3936c84f42b83a0e1ec7ae2b15f9 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 17 Sep 2012 15:35:28 -0700 Subject: [PATCH 83/88] * Makefile.in: Run autogen/copy_autogen if autogen.sh fails, to create 'configure'; problem reported by Andreas Schwab in . * autogen.sh: Exit with status 1 when failing due to missing tools, reverting the 2012-09-10 change to this file. * autogen/copy_autogen: Fail if one of the subsidiary actions fail. Use 'cp -f' for the build-aux files, since the destinations are typically read-only. --- ChangeLog | 8 ++++++++ Makefile.in | 4 ++-- autogen.sh | 2 +- autogen/copy_autogen | 15 ++++++++------- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 48d1e52e2cd..3b5b6862a15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,14 @@ This undoes part of the 2012-09-10 patch. (bootstrap): Run ./configure, rather than trying to run config.status if it exists. That builds src/epaths.h more reliably. + Run autogen/copy_autogen if autogen.sh fails, + to create 'configure'; problem reported by Andreas Schwab in + . + * autogen.sh: Exit with status 1 when failing due to missing tools, + reverting the 2012-09-10 change to this file. + * autogen/copy_autogen: Fail if one of the subsidiary actions fail. + Use 'cp -f' for the build-aux files, since the destinations are + typically read-only. Remove no-longer-needed Solaris 2.4 vfork bug workaround. * configure.ac (ac_cv_func_vfork_works): Default to 'no' on diff --git a/Makefile.in b/Makefile.in index 386c4c135be..56a54403ef3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -890,11 +890,11 @@ dvi: # Bootstrapping does the following: # * Remove files to start from a clean slate. -# * Run autogen.sh, but don't worry about exit status 101 (missing tools). +# * Run autogen.sh, falling back on copy_autogen if autogen.sh fails. # * Build Makefile, to build the build procedure itself. # * Do the actual build. bootstrap: bootstrap-clean FRC - cd $(srcdir) && { ./autogen.sh || test $$? -eq 101; } + cd $(srcdir) && { ./autogen.sh || autogen/copy_autogen; } ./configure $(CONFIGURE_FLAGS) $(MAKE) $(MFLAGS) info all diff --git a/autogen.sh b/autogen.sh index dc8d53eec97..9cfaa40eee5 100755 --- a/autogen.sh +++ b/autogen.sh @@ -201,7 +201,7 @@ This is not recommended - see the comments in \`copy_autogen'. Please report any problems with this script to bug-gnu-emacs@gnu.org . EOF - exit 101 # Exit status 101 means tools were missing. + exit 1 fi echo "Your system has the required tools, running autoreconf..." diff --git a/autogen/copy_autogen b/autogen/copy_autogen index b6af9b6eb35..8aacd4d399a 100755 --- a/autogen/copy_autogen +++ b/autogen/copy_autogen @@ -8,7 +8,7 @@ ## regenerate configure and will fail if you do not have the required ## tools. You will have to run this script again. -test -d autogen && cd autogen +test ! -d autogen || cd autogen || exit if test ! -e config.in; then echo "Cannot find autogen/ directory." @@ -16,11 +16,12 @@ if test ! -e config.in; then fi ## Order implied by top-level Makefile's rules, for time-stamps. -cp compile config.guess config.sub depcomp install-sh missing ../build-aux -cp aclocal.m4 ../ -cp configure ../ -touch ../src/stamp-h.in -cp config.in ../src/ -cp Makefile.in ../lib/ +cp -f compile config.guess config.sub depcomp install-sh missing \ + ../build-aux && +cp aclocal.m4 ../ && +cp configure ../ && +touch ../src/stamp-h.in && +cp config.in ../src/ && +cp Makefile.in ../lib/ && echo "You can now run configure" From d3612ac370d4b1378997d1c8344b24cf34add8fe Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Tue, 18 Sep 2012 00:43:12 +0200 Subject: [PATCH 84/88] * Makefile.in (bootstrap): Revert last change. Run config.status after config.status --recheck, run configure from $(srcdir). (config.status): Run configure from $(srcdir). --- ChangeLog | 6 ++++++ Makefile.in | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3b5b6862a15..d6260f6c228 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-09-17 Andreas Schwab + + * Makefile.in (bootstrap): Revert last change. Run config.status + after config.status --recheck, run configure from $(srcdir). + (config.status): Run configure from $(srcdir). + 2012-09-17 Paul Eggert * Makefile.in: Fix build error on FreeBSD. diff --git a/Makefile.in b/Makefile.in index 56a54403ef3..7a38abeca1c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -367,7 +367,7 @@ config.status: ${srcdir}/configure ${srcdir}/lisp/version.el if [ -x ./config.status ]; then \ ./config.status --recheck; \ else \ - ./configure $(CONFIGURE_FLAGS); \ + $(srcdir)/configure $(CONFIGURE_FLAGS); \ fi AUTOCONF_INPUTS = $(srcdir)/configure.ac $(srcdir)/aclocal.m4 @@ -895,7 +895,12 @@ dvi: # * Do the actual build. bootstrap: bootstrap-clean FRC cd $(srcdir) && { ./autogen.sh || autogen/copy_autogen; } - ./configure $(CONFIGURE_FLAGS) + if [ -x config.status ]; then \ + ./config.status --recheck && \ + ./config.status; \ + else \ + $(srcdir)/configure $(CONFIGURE_FLAGS); \ + fi $(MAKE) $(MFLAGS) info all .PHONY: check-declare From a11035b8cd0ef80bc118cc97be53373b36475da0 Mon Sep 17 00:00:00 2001 From: Martin Blais Date: Tue, 18 Sep 2012 00:18:36 -0400 Subject: [PATCH 85/88] * lisp/progmodes/compile.el (compilation-start): Use compilation-always-kill to initialize query-on-exit; then test that instead. Fixes: debbugs:12288 --- lisp/ChangeLog | 7 +++++- lisp/progmodes/compile.el | 51 ++++++++++++++++++++++----------------- 2 files changed, 35 insertions(+), 23 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7ceacc5291d..c1c9e5ee1c8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-09-18 Martin Blais (tiny change) + + * progmodes/compile.el (compilation-start): Use compilation-always-kill + to initialize query-on-exit; then test that instead (bug#12288). + 2012-09-17 Stefan Merten * rst.el: Add support for `testcover'. @@ -1702,7 +1707,7 @@ :local as the address. (list-processes): Doc fix. -2012-08-04 Michal Nazarewicz (tiny change) +2012-08-04 Michal Nazarewicz * lisp/mpc.el: Support password in host argument. (mpc--proc-connect): Parse and use new password element. diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index f5dedf0cd59..95b8758ba80 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1556,20 +1556,20 @@ Returns the compilation buffer created." (get-buffer-create (compilation-buffer-name name-of-mode mode name-function))) (let ((comp-proc (get-buffer-process (current-buffer)))) - (if comp-proc - (if (or (not (eq (process-status comp-proc) 'run)) - compilation-always-kill - (yes-or-no-p - (format "A %s process is running; kill it? " - name-of-mode))) - (condition-case () - (progn - (interrupt-process comp-proc) - (sit-for 1) - (delete-process comp-proc)) - (error nil)) - (error "Cannot have two processes in `%s' at once" - (buffer-name))))) + (if comp-proc + (if (or (not (eq (process-status comp-proc) 'run)) + (eq (process-query-on-exit-flag comp-proc) nil) + (yes-or-no-p + (format "A %s process is running; kill it? " + name-of-mode))) + (condition-case () + (progn + (interrupt-process comp-proc) + (sit-for 1) + (delete-process comp-proc)) + (error nil)) + (error "Cannot have two processes in `%s' at once" + (buffer-name))))) ;; first transfer directory from where M-x compile was called (setq default-directory thisdir) ;; Make compilation buffer read-only. The filter can still write it. @@ -1624,7 +1624,7 @@ Returns the compilation buffer created." (let ((process-environment (append compilation-environment - (if (if (boundp 'system-uses-terminfo) ; `if' for compiler warning + (if (if (boundp 'system-uses-terminfo);`If' for compiler warning. system-uses-terminfo) (list "TERM=dumb" "TERMCAP=" (format "COLUMNS=%d" (window-width))) @@ -1674,13 +1674,20 @@ Returns the compilation buffer created." nil `("-c" ,command)))) (start-file-process-shell-command (downcase mode-name) outbuf command)))) - ;; Make the buffer's mode line show process state. - (setq mode-line-process - '(:propertize ":%s" face compilation-mode-line-run)) - (set-process-sentinel proc 'compilation-sentinel) - (unless (eq mode t) - ;; Keep the comint filter, since it's needed for proper handling - ;; of the prompts. + ;; Make the buffer's mode line show process state. + (setq mode-line-process + '(:propertize ":%s" face compilation-mode-line-run)) + + ;; Set the process as killable without query by default. + ;; This allows us to start a new compilation without + ;; getting prompted. + (when compilation-always-kill + (set-process-query-on-exit-flag proc nil)) + + (set-process-sentinel proc 'compilation-sentinel) + (unless (eq mode t) + ;; Keep the comint filter, since it's needed for proper + ;; handling of the prompts. (set-process-filter proc 'compilation-filter)) ;; Use (point-max) here so that output comes in ;; after the initial text, From ed1f0bd388e83e5ee065f7dde0f52bbfe9031933 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 18 Sep 2012 13:14:42 +0800 Subject: [PATCH 86/88] Doc fixes for defface and friends. * lisp/cus-edit.el (custom-unlispify-remove-prefixes): Add warning. * lisp/custom.el (defface): Doc fix. * doc/lispref/customize.texi (Customization): Define customization more carefully. (Common Keywords): Add xref to Constant Variables. * doc/lispref/display.texi (Faces): Discuss anonymous faces. (Face Attributes): Tweak intro. (Defining Faces): Move after the Face Attributes node. Copyedits. (Displaying Faces): Describe role of inheritance. * doc/lispref/variables.texi (Defining Variables): Link to defcustom's node instead of the higher-level Customization chapter. Fixes: debbugs:11440 --- doc/lispref/ChangeLog | 14 ++ doc/lispref/customize.texi | 71 ++++--- doc/lispref/display.texi | 374 +++++++++++++++++++------------------ doc/lispref/elisp.texi | 2 +- doc/lispref/text.texi | 11 +- doc/lispref/variables.texi | 3 +- lisp/ChangeLog | 6 + lisp/cus-edit.el | 5 +- lisp/custom.el | 96 +++++----- 9 files changed, 322 insertions(+), 260 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index ce99c81a912..329c194f45a 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,17 @@ +2012-09-18 Chong Yidong + + * display.texi (Faces): Discuss anonymous faces. + (Face Attributes): Tweak intro. + (Defining Faces): Move after the Face Attributes node. Copyedits. + (Displaying Faces): Describe role of inheritance. + + * customize.texi (Customization): Define customization more + carefully (Bug#11440). + (Common Keywords): Add xref to Constant Variables. + + * variables.texi (Defining Variables): Link to defcustom's node + instead of the higher-level Customization chapter. + 2012-09-11 Paul Eggert Simplify, document, and port floating-point (Bug#12381). diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi index 38dfc949264..c9d22851ed2 100644 --- a/doc/lispref/customize.texi +++ b/doc/lispref/customize.texi @@ -6,13 +6,30 @@ @chapter Customization Settings @cindex customization item - This chapter describes how to declare customizable variables and -customization groups for classifying them. We use the term -@dfn{customization item} to include customizable variables, -customization groups, as well as faces. + Users of Emacs can customize variables and faces without writing +Lisp code, by using the Customize interface. @xref{Easy +Customization,,, emacs, The GNU Emacs Manual}. This chapter describes +how to define @dfn{customization items} that users can interact with +through the Customize interface. - @xref{Defining Faces}, for the @code{defface} macro, which is used -for declaring customizable faces. + Customization items include customizable variables, which are +defined with the +@ifinfo +@code{defcustom} macro (@pxref{Variable Definitions}); +@end ifinfo +@ifnotinfo +@code{defcustom} macro; +@end ifnotinfo +customizable faces, which are defined with @code{defface} (described +separately in @ref{Defining Faces}); and @dfn{customization groups}, +defined with +@ifinfo +@code{defgroup} (@pxref{Group Definitions}), +@end ifinfo +@ifnotinfo +@code{defgroup}, +@end ifnotinfo +which act as containers for groups of related customization items. @menu * Common Keywords:: Common keyword arguments for all kinds of @@ -29,9 +46,10 @@ for declaring customizable faces. @cindex customization keywords The customization declarations that we will describe in the next few -sections (@code{defcustom}, @code{defgroup}, etc.) all accept keyword -arguments for specifying various information. This section describes -keywords that apply to all types of customization declarations. +sections---@code{defcustom}, @code{defgroup}, etc.---all accept +keyword arguments (@pxref{Constant Variables}) for specifying various +information. This section describes keywords that apply to all types +of customization declarations. All of these keywords, except @code{:tag}, can be used more than once in a given item. Each use of the keyword has an independent effect. @@ -188,14 +206,14 @@ choice is the official name of the package, such as MH-E or Gnus. @cindex define customization group @cindex customization groups, defining - Each Emacs Lisp package should have one main customization group which -contains all the options, faces and other groups in the package. If the -package has a small number of options and faces, use just one group and -put everything in it. When there are more than twelve or so options and -faces, then you should structure them into subgroups, and put the -subgroups under the package's main customization group. It is OK to -put some of the options and faces in the package's main group alongside -the subgroups. + Each Emacs Lisp package should have one main customization group +which contains all the options, faces and other groups in the package. +If the package has a small number of options and faces, use just one +group and put everything in it. When there are more than twenty or so +options and faces, then you should structure them into subgroups, and +put the subgroups under the package's main customization group. It is +OK to put some of the options and faces in the package's main group +alongside the subgroups. The package's main or only group should be a member of one or more of the standard customization groups. (To display the full list of them, @@ -251,7 +269,17 @@ confusing names for options and faces. @node Variable Definitions @section Defining Customization Variables @cindex define customization options -@cindex customization variables, how to define +@cindex customizable variables, how to define +@cindex user options, how to define + + @dfn{Customizable variables}, also called @dfn{user options}, are +global Lisp variables whose values can be set through the Customize +interface. Unlike other global variables, which are defined with +@code{defvar} (@pxref{Defining Variables}), customizable variables are +defined using the @code{defcustom} macro. In addition to calling +@code{defvar} as a subroutine, @code{defcustom} states how the +variable should be displayed in the Customize interface, the values it +is allowed to take, etc. @defmac defcustom option standard doc [keyword value]@dots{} This macro declares @var{option} as a user option (i.e.@: a @@ -291,13 +319,14 @@ has not been assigned the right value yet. In that case, use standard value after Emacs starts up. @end defmac - @code{defcustom} accepts the following additional keywords: + In addition to the keywords listed in @ref{Common Keywords}, this +macro accepts the following keywords: @table @code @item :type @var{type} Use @var{type} as the data type for this option. It specifies which -values are legitimate, and how to display the value. -@xref{Customization Types}, for more information. +values are legitimate, and how to display the value +(@pxref{Customization Types}). @item :options @var{value-list} @kindex options@r{, @code{defcustom} keyword} diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 64aa891e56b..11a86f3c1c5 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -1863,20 +1863,36 @@ height. A @dfn{face} is a collection of graphical @dfn{attributes} for displaying text: font, foreground color, background color, optional -underlining, and so on. Faces control how Emacs displays text in -buffers, as well as other parts of the frame such as the mode line. -@xref{Standard Faces,,, emacs, The GNU Emacs Manual}, for the list of -faces Emacs normally comes with. +underlining, etc. Faces control how Emacs displays text in buffers, +as well as other parts of the frame such as the mode line. -@cindex face id - For most purposes, you refer to a face in Lisp programs using its -@dfn{face name}, which is usually a Lisp symbol. For backward -compatibility, a face name can also be a string, which is equivalent -to a Lisp symbol of the same name. +@cindex anonymous face + One way to represent a face is as a property list of attributes, +like @code{(:foreground "red" :weight bold)}. For example, you can +assign such an @dfn{anonymous face} as the value of the @code{face} +text property; this causes Emacs to display the underlying text with +the specified attributes. @xref{Special Properties}. + +@cindex face name + More commonly, a face is referred to via a @dfn{face name}: a Lisp +symbol which is associated with a set of face attributes. Named faces +are defined using the @code{defface} macro (@pxref{Defining Faces}). +Emacs defines several standard named faces; @xref{Standard Faces,,, +emacs, The GNU Emacs Manual}. + + Many parts of Emacs require named faces, and do not accept anonymous +faces. These include the functions documented in @ref{Attribute +Functions}, and the variable @code{font-lock-keywords} +(@pxref{Search-based Fontification}). Unless otherwise stated, we +will use the term @dfn{face} to refer only to named faces. + + For backward compatibility, you can also use a string to specify a +face name; that is equivalent to a Lisp symbol with the same name. @defun facep object -This function returns a non-@code{nil} value if @var{object} is a Lisp -symbol or string that names a face. Otherwise, it returns @code{nil}. +This function returns a non-@code{nil} value if @var{object} is a +named face: a Lisp symbol or string which serves as a face name. +Otherwise, it returns @code{nil}. @end defun By default, each face name corresponds to the same set of attributes @@ -1884,8 +1900,8 @@ in all frames. But you can also assign a face name a special set of attributes in one frame (@pxref{Attribute Functions}). @menu -* Defining Faces:: How to define a face. * Face Attributes:: What is in a face? +* Defining Faces:: How to define a face. * Attribute Functions:: Functions to examine and set face attributes. * Displaying Faces:: How Emacs combines the faces specified for a character. * Face Remapping:: Remapping faces to alternative definitions. @@ -1900,161 +1916,21 @@ attributes in one frame (@pxref{Attribute Functions}). * Low-Level Font:: Lisp representation for character display fonts. @end menu -@node Defining Faces -@subsection Defining Faces - - The @code{defface} macro defines a face and specifies its default -appearance. The user can subsequently customize the face using the -Customize interface (@pxref{Customization}). - -@defmac defface face spec doc [keyword value]@dots{} -This macro declares @var{face} as a customizable face whose default -attributes are given by @var{spec}. You should not quote the symbol -@var{face}, and it should not end in @samp{-face} (that would be -redundant). The argument @var{doc} is a documentation string for the -face. The additional @var{keyword} arguments have the same meanings -as in @code{defgroup} and @code{defcustom} (@pxref{Common Keywords}). - -When @code{defface} executes, it defines the face according to -@var{spec}, then uses any customizations that were read from the -init file (@pxref{Init File}) to override that specification. - -When you evaluate a @code{defface} form with @kbd{C-M-x} in Emacs -Lisp mode (@code{eval-defun}), a special feature of @code{eval-defun} -overrides any customizations of the face. This way, the face reflects -exactly what the @code{defface} says. - -@cindex face specification -The @var{spec} argument is a @dfn{face specification}, which states -how the face should appear on different kinds of terminals. It should -be an alist whose elements each have the form - -@example -(@var{display} . @var{plist}) -@end example - -@noindent -@var{display} specifies a class of terminals (see below), while -@var{plist} is a property list of face attributes and their values, -specifying how the face appears on such terminals -@iftex -(see the next section for details about face attributes). -@end iftex -@ifnottex -(@pxref{Face Attributes}, for details about face attributes). -@end ifnottex - -The @var{display} part of an element of @var{spec} determines which -frames the element matches. If more than one element of @var{spec} -matches a given frame, the first element that matches is the one used -for that frame. There are three possibilities for @var{display}: - -@table @asis -@item @code{default} -This element of @var{spec} doesn't match any frames; instead, it -specifies defaults that apply to all frames. This element, if used, -must be the first element of @var{spec}. Each of the following -elements can override any or all of these defaults. - -@item @code{t} -This element of @var{spec} matches all frames. Therefore, any -subsequent elements of @var{spec} are never used. Normally -@code{t} is used in the last (or only) element of @var{spec}. - -@item a list -If @var{display} is a list, each element should have the form -@code{(@var{characteristic} @var{value}@dots{})}. Here -@var{characteristic} specifies a way of classifying frames, and the -@var{value}s are possible classifications which @var{display} should -apply to. Here are the possible values of @var{characteristic}: - -@table @code -@item type -The kind of window system the frame uses---either @code{graphic} (any -graphics-capable display), @code{x}, @code{pc} (for the MS-DOS console), -@code{w32} (for MS Windows 9X/NT/2K/XP), or @code{tty} -(a non-graphics-capable display). -@xref{Window Systems, window-system}. - -@item class -What kinds of colors the frame supports---either @code{color}, -@code{grayscale}, or @code{mono}. - -@item background -The kind of background---either @code{light} or @code{dark}. - -@item min-colors -An integer that represents the minimum number of colors the frame -should support. This matches a frame if its -@code{display-color-cells} value is at least the specified integer. - -@item supports -Whether or not the frame can display the face attributes given in -@var{value}@dots{} (@pxref{Face Attributes}). @xref{Display Face -Attribute Testing}, for more information on exactly how this testing -is done. -@end table - -If an element of @var{display} specifies more than one @var{value} for a -given @var{characteristic}, any of those values is acceptable. If -@var{display} has more than one element, each element should specify a -different @var{characteristic}; then @emph{each} characteristic of the -frame must match one of the @var{value}s specified for it in -@var{display}. -@end table -@end defmac - - Here's how the standard face @code{highlight} is defined: - -@example -(defface highlight - '((((class color) (min-colors 88) (background light)) - :background "darkseagreen2") - (((class color) (min-colors 88) (background dark)) - :background "darkolivegreen") - (((class color) (min-colors 16) (background light)) - :background "darkseagreen2") - (((class color) (min-colors 16) (background dark)) - :background "darkolivegreen") - (((class color) (min-colors 8)) - :background "green" :foreground "black") - (t :inverse-video t)) - "Basic face for highlighting." - :group 'basic-faces) -@end example - - Internally, Emacs stores the face's default specification in its -@code{face-defface-spec} symbol property (@pxref{Property Lists}). -The @code{saved-face} property stores the face specification saved by -the user, using the customization buffer; the @code{customized-face} -property stores the face specification customized for the current -session, but not saved; and the @code{theme-face} property stores an -alist associating the active customization settings and Custom themes -with their specifications for that face. The face's documentation -string is stored in the @code{face-documentation} property. But -normally you should not try to set any of these properties directly. -@xref{Applying Customizations}, for the @code{custom-set-faces} -function, which is used to apply customized face settings. - - People are sometimes tempted to create variables whose values -specify a face to use. In the vast majority of cases, this is not -necessary; it is preferable to simply use faces directly. - @node Face Attributes @subsection Face Attributes @cindex face attributes - The effect of using a face is determined by a fixed set of @dfn{face -attributes}. This table lists all the face attributes, their possible -values, and their effects. You can specify more than one face for a -given piece of text; Emacs merges the attributes of all the faces to -determine how to display the text. @xref{Displaying Faces}. + @dfn{Face attributes} determine the visual appearance of a face. +The following table lists all the face attributes, their possible +values, and their effects. - In addition to the values given below, each face attribute can also -have the value @code{unspecified}. This special value means the face -doesn't specify that attribute. In face merging, when the first face -fails to specify a particular attribute, the next face gets a chance. -However, the @code{default} face must specify all attributes. + Apart from the values given below, each face attribute can have the +value @code{unspecified}. This special value means that the face +doesn't specify that attribute directly. An @code{unspecified} +attribute tells Emacs to refer instead to a parent face (see the +description @code{:inherit} attribute below); or, failing that, to an +underlying face (@pxref{Displaying Faces}). The @code{default} face +must specify all attributes. Some of these attributes are meaningful only on certain kinds of displays. If your display cannot handle a certain attribute, the @@ -2063,7 +1939,7 @@ attribute is ignored. @table @code @item :family Font family or fontset (a string). @xref{Fonts,,, emacs, The GNU -Emacs Manual}, for more information about font families; the function +Emacs Manual}, for more information about font families. The function @code{font-family-list} (see below) returns a list of available family names. @xref{Fontsets}, for information about fontsets. @@ -2083,9 +1959,8 @@ The height of the font. In the simplest case, this is an integer in units of 1/10 point. The value can also be a floating point number or a function, which -specifies the height relative to an @dfn{underlying face} (i.e., a -face that has a lower priority in the list described in -@ref{Displaying Faces}). If the value is a floating point number, +specifies the height relative to an @dfn{underlying face} +(@pxref{Displaying Faces}). If the value is a floating point number, that specifies the amount by which to scale the height of the underlying face. If the value is a function, that function is called with one argument, the height of the underlying face, and returns the @@ -2261,11 +2136,147 @@ suitable for use with @code{:stipple} (see above). It returns @code{nil} otherwise. @end defun +@node Defining Faces +@subsection Defining Faces + + The usual way to define a face is through the @code{defface} macro. +This macro defines a face name, and associates that name with a set of +face attributes. It also sets up the face so that the user can +customize it via the Customize interface (@pxref{Customization}). + +@defmac defface face spec doc [keyword value]@dots{} +This macro declares @var{face} as a customizable face whose default +attributes are given by @var{spec}. You should not quote the symbol +@var{face}, and it should not end in @samp{-face} (that would be +redundant). The argument @var{doc} is a documentation string for the +face. The additional @var{keyword} arguments have the same meanings +as in @code{defgroup} and @code{defcustom} (@pxref{Common Keywords}). + +When @code{defface} executes, it defines the face according to +@var{spec}, then uses any customizations that were read from the +init file (@pxref{Init File}) to override that specification. + +When you evaluate a @code{defface} form with @kbd{C-M-x} in Emacs +Lisp mode (@code{eval-defun}), a special feature of @code{eval-defun} +overrides any customizations of the face. This way, the face reflects +exactly what the @code{defface} says. + +@cindex face specification +The @var{spec} argument is a @dfn{face specification}, which states +how the face should appear on different kinds of terminals. It should +be an alist whose elements each have the form + +@example +(@var{display} . @var{plist}) +@end example + +@noindent +@var{display} specifies a class of terminals (see below). @var{plist} +is a property list of face attributes and their values, specifying how +the face appears on such terminals. For backward compatibility, you +can also write an element as @code{(@var{display} @var{plist})}. + +The @var{display} part of an element of @var{spec} determines which +terminals the element matches. If more than one element of @var{spec} +matches a given terminal, the first element that matches is the one +used for that terminal. There are three possibilities for +@var{display}: + +@table @asis +@item @code{default} +This element of @var{spec} doesn't match any terminal; instead, it +specifies defaults that apply to all terminals. This element, if +used, must be the first element of @var{spec}. Each of the following +elements can override any or all of these defaults. + +@item @code{t} +This element of @var{spec} matches all terminals. Therefore, any +subsequent elements of @var{spec} are never used. Normally @code{t} +is used in the last (or only) element of @var{spec}. + +@item a list +If @var{display} is a list, each element should have the form +@code{(@var{characteristic} @var{value}@dots{})}. Here +@var{characteristic} specifies a way of classifying terminals, and the +@var{value}s are possible classifications which @var{display} should +apply to. Here are the possible values of @var{characteristic}: + +@table @code +@item type +The kind of window system the terminal uses---either @code{graphic} +(any graphics-capable display), @code{x}, @code{pc} (for the MS-DOS +console), @code{w32} (for MS Windows 9X/NT/2K/XP), or @code{tty} (a +non-graphics-capable display). @xref{Window Systems, window-system}. + +@item class +What kinds of colors the terminal supports---either @code{color}, +@code{grayscale}, or @code{mono}. + +@item background +The kind of background---either @code{light} or @code{dark}. + +@item min-colors +An integer that represents the minimum number of colors the terminal +should support. This matches a terminal if its +@code{display-color-cells} value is at least the specified integer. + +@item supports +Whether or not the terminal can display the face attributes given in +@var{value}@dots{} (@pxref{Face Attributes}). @xref{Display Face +Attribute Testing}, for more information on exactly how this testing +is done. +@end table + +If an element of @var{display} specifies more than one @var{value} for +a given @var{characteristic}, any of those values is acceptable. If +@var{display} has more than one element, each element should specify a +different @var{characteristic}; then @emph{each} characteristic of the +terminal must match one of the @var{value}s specified for it in +@var{display}. +@end table +@end defmac + + Here's how the standard face @code{highlight} is defined: + +@example +(defface highlight + '((((class color) (min-colors 88) (background light)) + :background "darkseagreen2") + (((class color) (min-colors 88) (background dark)) + :background "darkolivegreen") + (((class color) (min-colors 16) (background light)) + :background "darkseagreen2") + (((class color) (min-colors 16) (background dark)) + :background "darkolivegreen") + (((class color) (min-colors 8)) + :background "green" :foreground "black") + (t :inverse-video t)) + "Basic face for highlighting." + :group 'basic-faces) +@end example + + Internally, Emacs stores the face's default specification in its +@code{face-defface-spec} symbol property (@pxref{Property Lists}). +The @code{saved-face} property stores the face specification saved by +the user, using the customization buffer; the @code{customized-face} +property stores the face specification customized for the current +session, but not saved; and the @code{theme-face} property stores an +alist associating the active customization settings and Custom themes +with their specifications for that face. The face's documentation +string is stored in the @code{face-documentation} property. But +normally you should not try to set any of these properties directly. +@xref{Applying Customizations}, for the @code{custom-set-faces} +function, which is used to apply customized face settings. + + People are sometimes tempted to create variables whose values +specify a face to use. In the vast majority of cases, this is not +necessary; it is preferable to simply use faces directly. + @node Attribute Functions @subsection Face Attribute Functions This section describes the functions for accessing and modifying the -attributes of an existing face. +attributes of an existing named face. @defun set-face-attribute face frame &rest arguments This function sets one or more attributes of @var{face} for @@ -2467,8 +2478,12 @@ This function returns the @code{:inverse-video} attribute of face @var{face}. @node Displaying Faces @subsection Displaying Faces - Here is how Emacs determines the face to use for displaying any -given piece of text: + When Emacs displays a given piece of text, the visual appearance of +the text may be determined by faces drawn from different sources. If +these various sources together specify more than one face for a +particular character, Emacs merges the attributes of the various +faces. Here is the order in which Emacs merges the faces, from +highest to lowest priority: @itemize @bullet @item @@ -2482,11 +2497,11 @@ Manual}. @item If the text lies within an overlay with a non-@code{nil} @code{face} -property, Emacs applies the face or face attributes specified by that -property. If the overlay has a @code{mouse-face} property and the -mouse is ``near enough'' to the overlay, Emacs applies the face or -face attributes specified by the @code{mouse-face} property instead. -@xref{Overlay Properties}. +property, Emacs applies the face(s) specified by that property. If +the overlay has a @code{mouse-face} property and the mouse is ``near +enough'' to the overlay, Emacs applies the face or face attributes +specified by the @code{mouse-face} property instead. @xref{Overlay +Properties}. When multiple overlays cover one character, an overlay with higher priority overrides those with lower priority. @xref{Overlays}. @@ -2508,11 +2523,12 @@ If any given attribute has not been specified during the preceding steps, Emacs applies the attribute of the @code{default} face. @end itemize - If these various sources together specify more than one face for a -particular character, Emacs merges the attributes of the various faces -specified. For each attribute, Emacs tries using the above order -(i.e.@: first the face of any special glyph; then the face for region -highlighting, if appropriate; and so on). + At each stage, if a face has a valid @code{:inherit} attribute, +Emacs treats any attribute with an @code{unspecified} value as having +the corresponding value drawn from the parent face(s). @pxref{Face +Attributes}. Note that the parent face(s) may also leave the +attribute unspecified; in that case, the attribute remains unspecified +at the next level of face merging. @node Face Remapping @subsection Face Remapping diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index caa5185dec3..db770616820 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi @@ -1366,8 +1366,8 @@ Overlays Faces -* Defining Faces:: How to define a face. * Face Attributes:: What is in a face? +* Defining Faces:: How to define a face. * Attribute Functions:: Functions to examine and set face attributes. * Displaying Faces:: How Emacs combines the faces specified for a character. diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index fe7f24e42cd..a5910ea921b 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -2999,12 +2999,11 @@ can be the following: A face name (a symbol or string). @item -A property list of face attributes. This has the -form (@var{keyword} @var{value} @dots{}), where each @var{keyword} is a -face attribute name and @var{value} is a meaningful value for that -attribute. With this feature, you do not need to create a face each -time you want to specify a particular attribute for certain text. -@xref{Face Attributes}. +A property list of face attributes. This has the form (@var{keyword} +@var{value} @dots{}), where each @var{keyword} is a face attribute +name and @var{value} is a meaningful value for that attribute. With +this feature, you do not need to create a face each time you want to +specify a particular attribute for certain text. @item A list of faces. This specifies a face which is an aggregate of the diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index c5b66757ace..1c0abcb8e66 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -403,7 +403,8 @@ unconditionally initializes the variable, whereas @code{defvar} initializes it only if it is originally void. To define a customizable variable, you should use @code{defcustom} -(which calls @code{defvar} as a subroutine). @xref{Customization}. +(which calls @code{defvar} as a subroutine). @xref{Variable +Definitions}. @defspec defvar symbol [value [doc-string]] This special form defines @var{symbol} as a variable. Note that diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c1c9e5ee1c8..7ed5f6af14b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-09-18 Chong Yidong + + * custom.el (defface): Doc fix. + + * cus-edit.el (custom-unlispify-remove-prefixes): Add warning. + 2012-09-18 Martin Blais (tiny change) * progmodes/compile.el (compilation-start): Use compilation-always-kill diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 86a19131569..2e6f2b14625 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -526,7 +526,10 @@ WIDGET is the widget to apply the filter entries of MENU on." :type 'boolean) (defcustom custom-unlispify-remove-prefixes nil - "Non-nil means remove group prefixes from option names in buffer." + "Non-nil means remove group prefixes from option names in buffer. +Discarding prefixes often leads to confusing names for options +and faces in Customize buffers, so do not set this to a non-nil +value unless you are sure you know what it does." :group 'custom-menu :group 'custom-buffer :type 'boolean) diff --git a/lisp/custom.el b/lisp/custom.el index 01b0e6d1650..dfc8e631152 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -350,68 +350,62 @@ FACE does not need to be quoted. Third argument DOC is the face documentation. -If FACE has been set with `custom-set-faces', set the face attributes -as specified by that function, otherwise set the face attributes -according to SPEC. - -The remaining arguments should have the form - - [KEYWORD VALUE]... +If FACE has been set with `custom-set-faces', set the face +attributes as specified by that function, otherwise set the face +attributes according to SPEC. +The remaining arguments should have the form [KEYWORD VALUE]... For a list of valid keywords, see the common keywords listed in `defcustom'. -SPEC should be an alist of the form ((DISPLAY ATTS)...). +SPEC should be an alist of the form -In the first element, DISPLAY can be `default'. The ATTS in that -element then act as defaults for all the following elements. + ((DISPLAY . ATTS)...) -Aside from that, DISPLAY specifies conditions to match some or -all frames. For each frame, the first element of SPEC where the -DISPLAY conditions are satisfied is the one that applies to that -frame. The ATTRs in this element take effect, and the following -elements are ignored, on that frame. +where DISPLAY is a form specifying conditions to match certain +terminals and ATTS is a property list (ATTR VALUE ATTR VALUE...) +specifying face attributes and values for frames on those +terminals. On each terminal, the first element with a matching +DISPLAY specification takes effect, and the remaining elements in +SPEC are disregarded. -In the last element, DISPLAY can be t. That element applies to a -frame if none of the previous elements (except the `default' if -any) did. +As a special exception, in the first element of SPEC, DISPLAY can +be the special value `default'. Then the ATTS in that element +act as defaults for all the following elements. -ATTS is a list of face attributes followed by their values: - (ATTR VALUE ATTR VALUE...) +For backward compatibility, elements of SPEC can be written +as (DISPLAY ATTS) instead of (DISPLAY . ATTS). -The possible attributes are `:family', `:width', `:height', `:weight', -`:slant', `:underline', `:overline', `:strike-through', `:box', -`:foreground', `:background', `:stipple', `:inverse-video', and `:inherit'. +Each DISPLAY can have the following values: + - `default' (only in the first element). + - The symbol t, which matches all terminals. + - An alist of conditions. Each alist element must have the form + (REQ ITEM...). A matching terminal must satisfy each + specified condition by matching one of its ITEMs. Each REQ + must be one of the following: + - `type' (the terminal type). + Each ITEM must be one of the values returned by + `window-system'. Under X, additional allowed values are + `motif', `lucid', `gtk' and `x-toolkit'. + - `class' (the terminal's color support). + Each ITEM should be one of `color', `grayscale', or `mono'. + - `background' (what color is used for the background text) + Each ITEM should be one of `light' or `dark'. + - `min-colors' (the minimum number of supported colors) + Each ITEM should be an integer, which is compared with the + result of `display-color-cells'. + - `supports' (match terminals supporting certain attributes). + Each ITEM should be a list of face attributes. See + `display-supports-face-attributes-p' for more information on + exactly how testing is done. -DISPLAY can be `default' (only in the first element), the symbol -t (only in the last element) to match all frames, or an alist of -conditions of the form \(REQ ITEM...). For such an alist to -match a frame, each of the conditions must be satisfied, meaning -that the REQ property of the frame must match one of the -corresponding ITEMs. These are the defined REQ values: +In the ATTS property list, possible attributes are `:family', +`:width', `:height', `:weight', `:slant', `:underline', +`:overline', `:strike-through', `:box', `:foreground', +`:background', `:stipple', `:inverse-video', and `:inherit'. -`type' (the value of `window-system') - Under X, in addition to the values `window-system' can take, - `motif', `lucid', `gtk' and `x-toolkit' are allowed, and match when - the Motif toolkit, Lucid toolkit, GTK toolkit or any X toolkit is in use. - -`class' (the frame's color support) - Should be one of `color', `grayscale', or `mono'. - -`background' (what color is used for the background text) - Should be one of `light' or `dark'. - -`min-colors' (the minimum number of colors the frame should support) - Should be an integer, it is compared with the result of - `display-color-cells'. - -`supports' (only match frames that support the specified face attributes) - Should be a list of face attributes. See the documentation for - the function `display-supports-face-attributes-p' for more - information on exactly how testing is done. - -See Info node `(elisp) Customization' in the Emacs Lisp manual -for more information." +See Info node `(elisp) Faces' in the Emacs Lisp manual for more +information." (declare (doc-string 3)) ;; It is better not to use backquote in this file, ;; because that makes a bootstrapping problem From 37ab5092e96c705aff371ca6203cdcb2d2fe3cd3 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Tue, 18 Sep 2012 09:07:13 +0200 Subject: [PATCH 87/88] Fix some recent changes in debug.el. * emacs-lisp/debug.el (debugger-bury-or-kill): Fix customization value. (debug): Don't remove debugger window when debugger is expected to be back. --- lisp/ChangeLog | 7 +++++++ lisp/emacs-lisp/debug.el | 9 +++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7ed5f6af14b..e8986acdd1f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2012-09-18 Martin Rudalics + + * emacs-lisp/debug.el (debugger-bury-or-kill): Fix customization + value. + (debug): Don't remove debugger window when debugger is expected + to be back. + 2012-09-18 Chong Yidong * custom.el (defface): Doc fix. diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 774b4d3d600..e002dbabe49 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -75,9 +75,9 @@ window previously showing the debugger buffer. The value used here is passed to `quit-restore-window'." :type '(choice (const :tag "Keep alive" nil) - (const :tag "Append" 'append) - (const :tag "Bury" 'bury) - (const :tag "Kill" 'kill)) + (const :tag "Append" append) + (const :tag "Bury" bury) + (const :tag "Kill" kill)) :group 'debugger :version "24.2") @@ -265,7 +265,8 @@ first will be printed into the backtrace buffer." ;; Make sure we unbind buffer-read-only in the right buffer. (save-excursion (recursive-edit)))) - (when (and (window-live-p debugger-window) + (when (and (not debugger-will-be-back) + (window-live-p debugger-window) (eq (window-buffer debugger-window) debugger-buffer)) ;; Record height of debugger window. (setq debugger-previous-window-height From fefa299077c02a931e5e72f7646e3dfa28f5e8ff Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 18 Sep 2012 00:19:25 -0700 Subject: [PATCH 88/88] rmailedit comment --- lisp/mail/rmailedit.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/mail/rmailedit.el b/lisp/mail/rmailedit.el index 0b837a43d94..e4e066bd642 100644 --- a/lisp/mail/rmailedit.el +++ b/lisp/mail/rmailedit.el @@ -111,6 +111,8 @@ This function runs the hooks `text-mode-hook' and `rmail-edit-mode-hook'. ;; Even if the message is in `raw' state, boundaries etc ;; are still missing. All we can do is insert the real ;; raw message. (Bug#9840) + ;; FIXME? Since the 2012-09-17 changes to rmail-mime, + ;; can we just use that function now? (when (and entity (not (equal "text/plain" (car (rmail-mime-entity-type entity)))))