From 0071d45b616f0e533818e65cc7307fbe4bd2a282 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 11 Jun 2014 13:03:46 -0700 Subject: [PATCH 01/12] Backport fcntl.h AIX fix from the trunk. This fixes a bug with the shell freezing. See: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17598#185 Merge from gnulib, incorporating: 2014-05-31 dup2, fcntl, fcntl-h: port to AIX 7.1 * lib/fcntl.in.h, m4/dup2.m4, m4/fcntl.m4: Update from gnulib. --- ChangeLog | 10 ++++++++++ lib/fcntl.in.h | 16 ++++++++++++++++ m4/dup2.m4 | 12 ++++++++++-- m4/fcntl.m4 | 12 +++++++++++- 4 files changed, 47 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 77e54096116..d13c8aeabe9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2014-06-11 Paul Eggert + + Backport fcntl.h AIX fix from the trunk (Bug#17598). + This fixes a bug with the shell freezing. See: + http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17598#185 + Merge from gnulib, incorporating: + 2014-05-31 dup2, fcntl, fcntl-h: port to AIX 7.1 + * lib/fcntl.in.h, m4/dup2.m4, m4/fcntl.m4: + Update from gnulib. + 2014-06-07 Paul Eggert Port better to AIX (Bug#17598). diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h index 99f75e60fd4..e23b4b2bcdd 100644 --- a/lib/fcntl.in.h +++ b/lib/fcntl.in.h @@ -186,6 +186,22 @@ _GL_WARN_ON_USE (openat, "openat is not portable - " /* Fix up the O_* macros. */ +/* AIX 7.1 with XL C 12.1 defines O_CLOEXEC, O_NOFOLLOW, and O_TTY_INIT + to values outside 'int' range, so omit these misdefinitions. + But avoid namespace pollution on non-AIX systems. */ +#ifdef _AIX +# include +# if defined O_CLOEXEC && ! (INT_MIN <= O_CLOEXEC && O_CLOEXEC <= INT_MAX) +# undef O_CLOEXEC +# endif +# if defined O_NOFOLLOW && ! (INT_MIN <= O_NOFOLLOW && O_NOFOLLOW <= INT_MAX) +# undef O_NOFOLLOW +# endif +# if defined O_TTY_INIT && ! (INT_MIN <= O_TTY_INIT && O_TTY_INIT <= INT_MAX) +# undef O_TTY_INIT +# endif +#endif + #if !defined O_DIRECT && defined O_DIRECTIO /* Tru64 spells it 'O_DIRECTIO'. */ # define O_DIRECT O_DIRECTIO diff --git a/m4/dup2.m4 b/m4/dup2.m4 index 89638a0bfe3..6498fc20245 100644 --- a/m4/dup2.m4 +++ b/m4/dup2.m4 @@ -8,6 +8,7 @@ AC_DEFUN([gl_FUNC_DUP2], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CHECK_FUNCS_ONCE([getdtablesize]) m4_ifdef([gl_FUNC_DUP2_OBSOLETE], [ AC_CHECK_FUNCS_ONCE([dup2]) if test $ac_cv_func_dup2 = no; then @@ -23,6 +24,11 @@ AC_DEFUN([gl_FUNC_DUP2], #include #include ]], [int result = 0; +#ifdef HAVE_GETDTABLESIZE + int bad_fd = getdtablesize (); +#else + int bad_fd = 1000000; +#endif #ifdef FD_CLOEXEC if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1) result |= 1; @@ -37,7 +43,7 @@ AC_DEFUN([gl_FUNC_DUP2], if (dup2 (0, 0) != -1) result |= 8; /* Many gnulib modules require POSIX conformance of EBADF. */ - if (dup2 (2, 1000000) == -1 && errno != EBADF) + if (dup2 (2, bad_fd) == -1 && errno != EBADF) result |= 16; /* Flush out some cygwin core dumps. */ if (dup2 (2, -1) != -1 || errno != EBADF) @@ -56,7 +62,9 @@ AC_DEFUN([gl_FUNC_DUP2], linux*) # On linux between 2008-07-27 and 2009-05-11, dup2 of a # closed fd may yield -EBADF instead of -1 / errno=EBADF. gl_cv_func_dup2_works="guessing no" ;; - freebsd*) # on FreeBSD 6.1, dup2(1,1000000) gives EMFILE, not EBADF. + aix* | freebsd*) + # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE, + # not EBADF. gl_cv_func_dup2_works="guessing no" ;; haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC. gl_cv_func_dup2_works="guessing no" ;; diff --git a/m4/fcntl.m4 b/m4/fcntl.m4 index 4a2771fae35..f824beb6597 100644 --- a/m4/fcntl.m4 +++ b/m4/fcntl.m4 @@ -19,7 +19,7 @@ AC_DEFUN([gl_FUNC_FCNTL], AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) - AC_CHECK_FUNCS_ONCE([fcntl]) + AC_CHECK_FUNCS_ONCE([fcntl getdtablesize]) if test $ac_cv_func_fcntl = no; then gl_REPLACE_FCNTL else @@ -28,11 +28,21 @@ AC_DEFUN([gl_FUNC_FCNTL], AC_CACHE_CHECK([whether fcntl handles F_DUPFD correctly], [gl_cv_func_fcntl_f_dupfd_works], [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +#ifdef HAVE_GETDTABLESIZE +# include +#endif #include #include ]], [[int result = 0; +#ifdef HAVE_GETDTABLESIZE + int bad_fd = getdtablesize (); +#else + int bad_fd = 1000000; +#endif if (fcntl (0, F_DUPFD, -1) != -1) result |= 1; if (errno != EINVAL) result |= 2; + if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4; + if (errno != EINVAL) result |= 8; return result; ]])], [gl_cv_func_fcntl_f_dupfd_works=yes], From 4346235f61172f2c55dfbbd2b830233e005987e7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 13 Jun 2014 16:53:24 +0300 Subject: [PATCH 02/12] Attempt to fix bug #17771 with segfault if "C-h h" is interrupted. src/alloc.c (cleanup_vector): Don't dereference a font driver pointer if it is NULL. --- src/ChangeLog | 5 +++++ src/alloc.c | 13 ++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3468cea6159..87b9b32510e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2014-06-13 Eli Zaretskii + + * alloc.c (cleanup_vector): Don't dereference a font driver + pointer if it is NULL. (Bug#17771) + 2014-06-11 Eli Zaretskii * xdisp.c (set_cursor_from_row): Fix an off-by-one error when diff --git a/src/alloc.c b/src/alloc.c index 12b3d4ba165..a3f3f5478cb 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -2924,9 +2924,16 @@ cleanup_vector (struct Lisp_Vector *vector) && ((vector->header.size & PSEUDOVECTOR_SIZE_MASK) == FONT_OBJECT_MAX)) { - /* Attempt to catch subtle bugs like Bug#16140. */ - eassert (valid_font_driver (((struct font *) vector)->driver)); - ((struct font *) vector)->driver->close ((struct font *) vector); + struct font_driver *drv = ((struct font *) vector)->driver; + + /* The font driver might sometimes be NULL, e.g. if Emacs was + interrupted before it had time to set it up. */ + if (drv) + { + /* Attempt to catch subtle bugs like Bug#16140. */ + eassert (valid_font_driver (drv)); + drv->close ((struct font *) vector); + } } } From 40be983bc68c95ad63f1135da3a82aec1aa32e2a Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 13 Jun 2014 11:06:29 -0400 Subject: [PATCH 03/12] * lisp/term/xterm.el (xterm--version-handler): Work around for OSX Terminal.app. Fixes: debbugs:17607 --- lisp/ChangeLog | 5 +++++ lisp/term/xterm.el | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ca2781b40f2..1ecc6a140ab 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-06-13 Stefan Monnier + + * term/xterm.el (xterm--version-handler): Work around for OSX + Terminal.app (bug#17607). + 2014-06-08 Glenn Morris * startup.el (initial-buffer-choice): Doc fix. diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 52487f3bded..5d4112b24fd 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -509,6 +509,10 @@ The relevant features are: ;; Gnome terminal 3.6.1 reports 1;3406;0 ;; Gnome terminal 2.32.1 reports 1;2802;0 (setq version 200)) + (when (equal (match-string 1 str) "83") + ;; OSX's Terminal.app (version 2.3 (309), which returns 83;40003;0) + ;; seems to also lack support for some of these (bug#17607). + (setq version 240)) ;; If version is 242 or higher, assume the xterm supports ;; reporting the background color (TODO: maybe earlier ;; versions do too...) From bf26b463ea0e7621255f73d22893a93754694800 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 13 Jun 2014 11:31:17 -0400 Subject: [PATCH 04/12] * lisp/emacs-lisp/smie.el (smie-next-sexp): Fix up "other-end" info when bumping forward into a closing paren. Fixes: debbugs:17761 --- lisp/ChangeLog | 3 +++ lisp/emacs-lisp/smie.el | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1ecc6a140ab..db615f68adf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2014-06-13 Stefan Monnier + * emacs-lisp/smie.el (smie-next-sexp): Fix up "other-end" info when + bumping forward into a closing paren (bug#17761). + * term/xterm.el (xterm--version-handler): Work around for OSX Terminal.app (bug#17607). diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el index e65f873b874..3e40d37aacf 100644 --- a/lisp/emacs-lisp/smie.el +++ b/lisp/emacs-lisp/smie.el @@ -709,7 +709,8 @@ Possible return values: (condition-case err (progn (funcall next-sexp 1) nil) (scan-error - (let ((epos (nth 2 err))) + (let* ((epos1 (nth 2 err)) + (epos (if (<= (point) epos1) (nth 3 err) epos1))) (goto-char pos) (throw 'return (list t epos @@ -1832,6 +1833,8 @@ KEYWORDS are additional arguments, which can use the following keywords: (append smie-blink-matching-triggers (delete-dups triggers))))))) +(declare-function edebug-instrument-function "edebug" (func)) + (defun smie-edebug () "Instrument the `smie-rules-function' for Edebug." (interactive) From 340ced7ecbfbc40a5db23eedc25581eb462465df Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 13 Jun 2014 15:41:59 -0400 Subject: [PATCH 05/12] * etc/PROBLEMS: Whitespace fix. --- etc/PROBLEMS | 1 - 1 file changed, 1 deletion(-) diff --git a/etc/PROBLEMS b/etc/PROBLEMS index ae836cf73ec..a1df7eebd18 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -159,7 +159,6 @@ This is due to a bug introduced in ImageMagick 6.8.2-3. The bug should be fixed in ImageMagick 6.8.3-10. See . ** Crashes when displaying GIF images in Emacs built with version - libungif-4.1.0 are resolved by using version libungif-4.1.0b1. Configure checks for the correct version, but this problem could occur if a binary built against a shared libungif is run on a system with an From 78275cd0ed1816e67f0fb331b4ebca4aac5d1cc7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 14 Jun 2014 12:44:20 +0300 Subject: [PATCH 06/12] src/xdisp.c: Enhance commentary. --- src/xdisp.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 64 insertions(+), 3 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index f0eeb9ac601..adcd281334f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -98,7 +98,9 @@ along with GNU Emacs. If not, see . */ This function attempts to redisplay a window by reusing parts of its existing display. It finds and reuses the part that was not - changed, and redraws the rest. + changed, and redraws the rest. (The "id" part in the function's + name stands for "insert/delete", not for "identification" or + somesuch.) . try_window @@ -113,6 +115,19 @@ along with GNU Emacs. If not, see . */ optimizations were successful, redisplay calls redisplay_windows, which performs a full redisplay of all windows. + Note that there's one more important optimization up Emacs's + sleeve, but it is related to actually redrawing the potentially + changed portions of the window/frame, not to reproducing the + desired matrices of those potentially changed portions. Namely, + the function update_frame and its subroutines, which you will find + in dispnew.c, compare the desired matrices with the current + matrices, and only redraw the portions that changed. So it could + happen that the functions in this file for some reason decide that + the entire desired matrix needs to be regenerated from scratch, and + still only parts of the Emacs display, or even nothing at all, will + be actually delivered to the glass, because update_frame has found + that the new and the old screen contents are similar or identical. + Desired matrices. Desired matrices are always built per Emacs window. The function @@ -15757,7 +15772,51 @@ set_vertical_scroll_bar (struct window *w) selected_window is redisplayed. We can return without actually redisplaying the window if fonts has been - changed on window's frame. In that case, redisplay_internal will retry. */ + changed on window's frame. In that case, redisplay_internal will retry. + + As one of the important parts of redisplaying a window, we need to + decide whether the previous window-start position (stored in the + window's w->start marker position) is still valid, and if it isn't, + recompute it. Some details about that: + + . The previous window-start could be in a continuation line, in + which case we need to recompute it when the window width + changes. See compute_window_start_on_continuation_line and its + call below. + + . The text that changed since last redisplay could include the + previous window-start position. In that case, we try to salvage + what we can from the current glyph matrix by calling + try_scrolling, which see. + + . Some Emacs command could force us to use a specific window-start + position by setting the window's force_start flag, or gently + propose doing that by setting the window's optional_new_start + flag. In these cases, we try using the specified start point if + that succeeds (i.e. the window desired matrix is successfully + recomputed, and point location is within the window). In case + of optional_new_start, we first check if the specified start + position is feasible, i.e. if it will allow point to be + displayed in the window. If using the specified start point + fails, e.g., if new fonts are needed to be loaded, we abort the + redisplay cycle and leave it up to the next cycle to figure out + things. + + . Note that the window's force_start flag is sometimes set by + redisplay itself, when it decides that the previous window start + point is fine and should be kept. Search for "goto force_start" + below to see the details. Like the values of window-start + specified outside of redisply, these internally deduced values + are tested for feasibility, and ignored if found to be + unfeasible. + + . Note that the function try_window, used to completely redisplay + a window, accepts the window's start point as its argument. + This is used several times in the redisplay code to control + where the window start will be, according to user options such + as scroll-conservatively, and also to ensure the screen line + showing point will be fully (as opposed to partially) visible on + display. */ static void redisplay_window (Lisp_Object window, bool just_this_one_p) @@ -15803,6 +15862,8 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) eassert (XMARKER (w->start)->buffer == buffer); eassert (XMARKER (w->pointm)->buffer == buffer); + /* We come here again if we need to run window-text-change-functions + below. */ restart: reconsider_clip_changes (w); frame_line_height = default_line_pixel_height (w); @@ -15867,7 +15928,7 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) && !current_buffer->prevent_redisplay_optimizations_p && !window_outdated (w)); - /* Run the window-bottom-change-functions + /* Run the window-text-change-functions if it is possible that the text on the screen has changed (either due to modification of the text, or any other reason). */ if (!current_matrix_up_to_date_p From 5be5f2854a9105e65679ef6af87f4ebb490e9961 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Sat, 14 Jun 2014 12:50:13 +0300 Subject: [PATCH 07/12] * lisp/bindings.el: Put `ascii-character' property on keypad keys mapped to characters. Fixes: debbugs:17759 --- lisp/ChangeLog | 5 +++++ lisp/bindings.el | 12 ++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index db615f68adf..b489b5a50d6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-06-14 Juri Linkov + + * bindings.el: Put `ascii-character' property on keypad keys + mapped to characters. (Bug#17759) + 2014-06-13 Stefan Monnier * emacs-lisp/smie.el (smie-next-sexp): Fix up "other-end" info when diff --git a/lisp/bindings.el b/lisp/bindings.el index 7093b8e662f..59aa3dfb3d3 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -1075,10 +1075,14 @@ if `inhibit-field-text-motion' is non-nil." (kp-5 ?5) (kp-6 ?6) (kp-7 ?7) (kp-8 ?8) (kp-9 ?9) (kp-add ?+) (kp-subtract ?-) (kp-multiply ?*) (kp-divide ?/)))) (dolist (pair keys) - (dolist (mod modifiers) - (define-key function-key-map - (vector (append mod (list (nth 0 pair)))) - (vector (append mod (list (nth 1 pair)))))))) + (let ((keypad (nth 0 pair)) + (normal (nth 1 pair))) + (when (characterp normal) + (put keypad 'ascii-character normal)) + (dolist (mod modifiers) + (define-key function-key-map + (vector (append mod (list keypad))) + (vector (append mod (list normal)))))))) (define-key function-key-map [backspace] [?\C-?]) (define-key function-key-map [delete] [?\C-?]) From 59579a97d870807c635292178a2697f20d8720bd Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 14 Jun 2014 14:09:10 +0300 Subject: [PATCH 08/12] Fix bug #17777 with keyboard macros and visual-order cursor movement. src/xdisp.c (Fmove_point_visually): Don't use the glyph matrix information if we are in the middle of executing a keyboard macro, since redisplay doesn't update the screen until the macro is finished. --- src/ChangeLog | 7 +++++++ src/xdisp.c | 1 + 2 files changed, 8 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 87b9b32510e..6e312e79d7d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2014-06-14 Eli Zaretskii + + * xdisp.c (Fmove_point_visually): Don't use the glyph matrix + information if we are in the middle of executing a keyboard macro, + since redisplay doesn't update the screen until the macro is + finished. (Bug#17777) + 2014-06-13 Eli Zaretskii * alloc.c (cleanup_vector): Don't dereference a font driver diff --git a/src/xdisp.c b/src/xdisp.c index adcd281334f..cb92ab7c952 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -20757,6 +20757,7 @@ Value is the new character position of point. */) recorded in the glyphs, at least as long as the goal is on the screen. */ if (w->window_end_valid + && NILP (Vexecuting_kbd_macro) && !windows_or_buffers_changed && b && !b->clip_changed From 859488bf227da300a4d1f90a51222b163165dfae Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 14 Jun 2014 19:37:15 +0300 Subject: [PATCH 09/12] Fix documentation mentioned in bug #17768. lisp/subr.el (posn-col-row): Doc fix. doc/lispref/commands.texi (Accessing Mouse): Improve the wording of the posn-col-row documentation. --- doc/lispref/ChangeLog | 5 +++++ doc/lispref/commands.texi | 21 +++++++++++---------- lisp/ChangeLog | 4 ++++ lisp/subr.el | 2 +- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 2b00d9743b7..c20a20409a2 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,8 @@ +2014-06-14 Eli Zaretskii + + * commands.texi (Accessing Mouse): Improve the wording of the + posn-col-row documentation. (Bug#17768) + 2014-06-08 Glenn Morris * os.texi (Startup Summary): Small fix for initial-buffer-choice. diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 38a6970e6f4..c478b7847d2 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -2049,23 +2049,24 @@ POSITION is assumed to lie in a window text area." @defun posn-col-row position This function returns a cons cell @code{(@var{col} . @var{row})}, containing the estimated column and row corresponding to buffer -position @var{position}. The return value is given in units of the -frame's default character width and height, as computed from the -@var{x} and @var{y} values corresponding to @var{position}. (So, if -the actual characters have non-default sizes, the actual row and -column may differ from these computed values.) +position in @var{position}. The return value is given in units of the +frame's default character width and default line height (including +spacing), as computed from the @var{x} and @var{y} values +corresponding to @var{position}. (So, if the actual characters have +non-default sizes, the actual row and column may differ from these +computed values.) Note that @var{row} is counted from the top of the text area. If the -window possesses a header line (@pxref{Header Lines}), it is -@emph{not} counted as the first line. +window given by @var{position} possesses a header line (@pxref{Header +Lines}), it is @emph{not} included in the @var{row} count. @end defun @defun posn-actual-col-row position Return the actual row and column in @var{position}, as a cons cell @code{(@var{col} . @var{row})}. The values are the actual row and -column numbers in the window. @xref{Click Events}, for details. It -returns @code{nil} if @var{position} does not include actual positions -values. +column numbers in the window given by @var{position}. @xref{Click +Events}, for details. The function returns @code{nil} if +@var{position} does not include actual position values. @end defun @defun posn-string position diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b489b5a50d6..b4c51f7bb23 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2014-06-14 Eli Zaretskii + + * subr.el (posn-col-row): Doc fix. (Bug#17768) + 2014-06-14 Juri Linkov * bindings.el: Put `ascii-character' property on keypad keys diff --git a/lisp/subr.el b/lisp/subr.el index c8dcfc8df97..700c072a81b 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1117,7 +1117,7 @@ pixels. POSITION should be a list of the form returned by "Return the nominal column and row in POSITION, measured in characters. The column and row values are approximations calculated from the x and y coordinates in POSITION and the frame's default character width -and height. +and default line height, including spacing. For a scroll-bar event, the result column is 0, and the row corresponds to the vertical position of the click in the scroll bar. POSITION should be a list of the form returned by the `event-start' From 50bee071548758300c40d0c5f8871ec9f3075289 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 14 Jun 2014 13:24:08 -0700 Subject: [PATCH 10/12] Port part of the AIX fix to Solaris. * configure.ac (_REENTRANT): Define on Solaris if HAVE_PTHREAD. This ports part of the recent AIX fix to Solaris. It is needed for the same reason that _THREAD_SAFE is needed on AIX, e.g., to make sure that each thread has its own 'errno'. Fixes: debbugs:17598 --- ChangeLog | 8 ++++++++ configure.ac | 12 ++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d13c8aeabe9..fd87a78c7c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2014-06-14 Paul Eggert + + Port part of the AIX fix to Solaris (Bug#17598). + * configure.ac (_REENTRANT): Define on Solaris if HAVE_PTHREAD. + This ports part of the recent AIX fixes to Solaris. It is needed + for the same reason that _THREAD_SAFE is needed on AIX, e.g., to + make sure that each thread has its own 'errno'. + 2014-06-11 Paul Eggert Backport fcntl.h AIX fix from the trunk (Bug#17598). diff --git a/configure.ac b/configure.ac index 600271d1119..702b8570577 100644 --- a/configure.ac +++ b/configure.ac @@ -2079,10 +2079,14 @@ if test "$HAVE_PTHREAD" = yes; then # Some systems optimize for single-threaded programs by default, and # need special flags to disable these optimizations. For example, the # definition of 'errno' in . - if test "$opsys" = aix4-2; then - AC_DEFINE([_THREAD_SAFE], [1], - [Define to 1 if your system requires this in multithreaded code.]) - fi + case $opsys in + sol*) + AC_DEFINE([_REENTRANT], 1, + [Define to 1 if your system requires this in multithreaded code.]);; + aix4-2) + AC_DEFINE([_THREAD_SAFE], 1, + [Define to 1 if your system requires this in multithreaded code.]);; + esac fi AC_SUBST([LIB_PTHREAD]) From cd7d4e9b383ae4bd56619f344ba4e73d0063e773 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 14 Jun 2014 16:54:39 -0700 Subject: [PATCH 11/12] Stop cc-mode loading cl at runtime * lisp/progmodes/cc-langs.el: Require cl-lib. Replace delete-duplicates and mapcan by cl- versions throughout. And cl-macroexpand-all by macroexpand-all. (delete-duplicates, mapcan, cl-macroexpand-all): No need to declare. Fixes: debbugs:17463 --- lisp/ChangeLog | 7 +++++++ lisp/progmodes/cc-langs.el | 36 +++++++++++++++++++----------------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b4c51f7bb23..3990d4d0106 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2014-06-14 Glenn Morris + + * progmodes/cc-langs.el: Require cl-lib. (Bug#17463) + Replace delete-duplicates and mapcan by cl- versions throughout. + And cl-macroexpand-all by macroexpand-all. + (delete-duplicates, mapcan, cl-macroexpand-all): No need to declare. + 2014-06-14 Eli Zaretskii * subr.el (posn-col-row): Doc fix. (Bug#17768) diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 29dff4a6394..d2d2de8801a 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -130,7 +130,9 @@ ;; This file is not always loaded. See note above. -(cc-external-require 'cl) +;; Except it is always loaded - see bug#17463. +;;;(cc-external-require 'cl) +(require 'cl-lib) ;;; Setup for the `c-lang-defvar' system. @@ -209,9 +211,9 @@ 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. ;; 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)) +;(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. @@ -252,14 +254,14 @@ the evaluated constant value at compile time." (unless xlate (setq xlate 'identity)) (c-with-syntax-table (c-lang-const c-mode-syntax-table) - (delete-duplicates - (mapcan (lambda (opgroup) + (cl-delete-duplicates + (cl-mapcan (lambda (opgroup) (when (if (symbolp (car opgroup)) (when (funcall opgroup-filter (car opgroup)) (setq opgroup (cdr opgroup)) t) t) - (mapcan (lambda (op) + (cl-mapcan (lambda (op) (when (funcall op-filter op) (let ((res (funcall xlate op))) (if (listp res) res (list res))))) @@ -1147,7 +1149,7 @@ operators." (c-lang-defconst c-all-op-syntax-tokens ;; List of all tokens in the punctuation and parenthesis syntax ;; classes. - t (delete-duplicates (append (c-lang-const c-other-op-syntax-tokens) + t (cl-delete-duplicates (append (c-lang-const c-other-op-syntax-tokens) (c-lang-const c-operator-list)) :test 'string-equal)) @@ -1700,7 +1702,7 @@ not the type face." (c-lang-defconst c-type-start-kwds ;; All keywords that can start a type (i.e. are either a type prefix ;; or a complete type). - t (delete-duplicates (append (c-lang-const c-primitive-type-kwds) + t (cl-delete-duplicates (append (c-lang-const c-primitive-type-kwds) (c-lang-const c-type-prefix-kwds) (c-lang-const c-type-modifier-kwds)) :test 'string-equal)) @@ -1943,7 +1945,7 @@ one of `c-type-list-kwds', `c-ref-list-kwds', ;; something is a type or just some sort of macro in front of the ;; declaration. They might be ambiguous with types or type ;; prefixes. - t (delete-duplicates (append (c-lang-const c-class-decl-kwds) + t (cl-delete-duplicates (append (c-lang-const c-class-decl-kwds) (c-lang-const c-brace-list-decl-kwds) (c-lang-const c-other-block-decl-kwds) (c-lang-const c-typedef-decl-kwds) @@ -2136,7 +2138,7 @@ type identifiers separated by arbitrary tokens." pike '("array" "function" "int" "mapping" "multiset" "object" "program")) (c-lang-defconst c-paren-any-kwds - t (delete-duplicates (append (c-lang-const c-paren-nontype-kwds) + t (cl-delete-duplicates (append (c-lang-const c-paren-nontype-kwds) (c-lang-const c-paren-type-kwds)) :test 'string-equal)) @@ -2162,7 +2164,7 @@ assumed to be set if this isn't nil." (c-lang-defconst c-<>-sexp-kwds ;; All keywords that can be followed by an angle bracket sexp. - t (delete-duplicates (append (c-lang-const c-<>-type-kwds) + t (cl-delete-duplicates (append (c-lang-const c-<>-type-kwds) (c-lang-const c-<>-arglist-kwds)) :test 'string-equal)) @@ -2222,7 +2224,7 @@ Keywords here should also be in `c-block-stmt-1-kwds'." (c-lang-defconst c-block-stmt-kwds ;; Union of `c-block-stmt-1-kwds' and `c-block-stmt-2-kwds'. - t (delete-duplicates (append (c-lang-const c-block-stmt-1-kwds) + t (cl-delete-duplicates (append (c-lang-const c-block-stmt-1-kwds) (c-lang-const c-block-stmt-2-kwds)) :test 'string-equal)) @@ -2326,7 +2328,7 @@ This construct is \" :\"." (c-lang-defconst c-expr-kwds ;; Keywords that can occur anywhere in expressions. Built from ;; `c-primary-expr-kwds' and all keyword operators in `c-operators'. - t (delete-duplicates + t (cl-delete-duplicates (append (c-lang-const c-primary-expr-kwds) (c-filter-ops (c-lang-const c-operator-list) t @@ -2430,7 +2432,7 @@ Note that Java specific rules are currently applied to tell this from (c-lang-defconst c-keywords ;; All keywords as a list. - t (delete-duplicates + t (cl-delete-duplicates (c-lang-defconst-eval-immediately `(append ,@(mapcar (lambda (kwds-lang-const) `(c-lang-const ,kwds-lang-const)) @@ -3193,10 +3195,10 @@ accomplish that conveniently." ;; `c-lang-const' will expand to the evaluated ;; constant immediately in `cl-macroexpand-all' ;; below. - (mapcan + (cl-mapcan (lambda (init) `(current-var ',(car init) - ,(car init) ,(cl-macroexpand-all + ,(car init) ,(macroexpand-all (elt init 1)))) ;; Note: The following `append' copies the ;; first argument. That list is small, so From 27433ff85f21f108e84a6e8966c9461cf66c2015 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 14 Jun 2014 16:57:24 -0700 Subject: [PATCH 12/12] NEWS copyedits --- etc/NEWS | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 1e7eee43513..c9af6348aac 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -154,16 +154,7 @@ removed. *** The function `quail-help' is no longer an interactive command. Use `C-h C-\' (`describe-input-method') instead. -** ImageMagick - -*** ImageMagick images now support the :max-width and :max-height keywords. - -*** When using `create-image' with image data, you can pass a :format -attribute (via the property-list argument) in order to help -ImageMagick detect the image type. The value should be a MIME -content-type that is found in the new variable `image-format-suffixes'. - -** Frame and window changes +** Frame and window handling *** New commands `toggle-frame-fullscreen' and `toggle-frame-maximized', bound to and M-, respectively. @@ -261,7 +252,7 @@ bottom of the selected frame. caller of `display-buffer' is ready to handle the case of not displaying the buffer in a window. -** Lisp evaluation changes +** Lisp evaluation *** `eval-defun' on an already defined defcustom calls the :set function, if there is one. @@ -295,7 +286,7 @@ simply disabling Transient Mark mode does the same thing. * Editing Changes in Emacs 24.4 -** Indentation changes +** Indentation *** `electric-indent-mode' is now enabled by default. Typing RET reindents the current line and indents the new line. @@ -553,8 +544,7 @@ the symbol near point. *** New option `hi-lock-auto-select-face'. When non-nil, hi-lock commands will cycle through faces in `hi-lock-face-defaults' without prompting. -** Icomplete -Icomplete is now more similar to Ido. +** Icomplete is now more similar to Ido. *** Icomplete by default now applies to all forms of minibuffer completion. The variable `icomplete-with-completion-tables' (now a user option) @@ -911,8 +901,8 @@ Also the following files used by the now obsolete otodo-mode.el: * New Modes and Packages in Emacs 24.4 -** New package `eww' is a built-in web browser. -(It is only available if Emacs is compiled with libxml2 support.) +** New package eww.el provides a built-in web browser. +This requires Emacs to have been compiled with libxml2 support. ** New package nadvice.el offers lighter-weight advice facilities. It is layered as: @@ -923,11 +913,10 @@ any function-carrying place, such as process filters or `-function' hooks. *** `advice-add'/`advice-remove' to add/remove a piece of advice on a named function, much like `defadvice' does. -** New package frameset.el. -It provides a set of operations to save a frameset (the state of all -or a subset of the existing frames and windows, somewhat similar to a -frame configuration), both in-session and persistently, and restore it -at some point in the future. +** New package frameset.el provides a set of operations to save a frameset +(the state of all or a subset of the existing frames and windows, somewhat +similar to a frame configuration), both in-session and persistently, and +restore it at some point in the future. ** New package filenotify.el provides an interface for file system notifications. It requires that Emacs be compiled with one of the @@ -937,9 +926,9 @@ low-level libraries gfilenotify.c, inotify.c or w32notify.c. display specified symbols as composed characters. E.g., in Emacs Lisp mode, this replaces the string "lambda" with the Greek lambda character. -** New minor mode `superword-mode'. -This overrides the default word motion commands to treat "symbol_words" -as a single word, similar to what `subword-mode' does. +** New minor mode `superword-mode', which overrides the default word motion +commands to treat "symbol_words" as a single word, similar to what +`subword-mode' does. * Incompatible Lisp Changes in Emacs 24.4 @@ -1177,6 +1166,15 @@ animated images which do not specify a frame delay. *** New functions `image-current-frame' and `image-show-frame' for getting and setting the current frame of a multi-frame image. +** ImageMagick + +*** ImageMagick images now support the :max-width and :max-height keywords. + +*** When using `create-image' with image data, you can pass a :format +attribute (via the property-list argument) in order to help +ImageMagick detect the image type. The value should be a MIME +content-type that is found in the new variable `image-format-suffixes'. + ** Revert and Autorevert *** If Emacs is compiled with file notification support, it uses notifications