From f2819241bc93b641f13e1a04f3520fadb8ed53a8 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 23 Sep 2016 17:25:55 +0300 Subject: [PATCH 1/3] Fix display of cursor when 'blink-cursor-delay' has small value * lisp/frame.el (blink-cursor-check, blink-cursor-mode): Protect ourselves against too small values of blink-cursor-delay. This avoids erratic display of the cursor, or even failure to display it, when user types text at high speed or leans on a key to invoke the keyboard auto-repeat feature. (Bug#24372) --- lisp/frame.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lisp/frame.el b/lisp/frame.el index 09738d1e2ed..291150b591b 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -2115,7 +2115,11 @@ This is done when a frame gets focus. Blink timers may be stopped by (not blink-cursor-idle-timer)) (remove-hook 'post-command-hook 'blink-cursor-check) (setq blink-cursor-idle-timer - (run-with-idle-timer blink-cursor-delay + ;; The 0.2 sec limitation from below is to avoid erratic + ;; behavior (or downright failure to display the cursor + ;; during command execution) if they set blink-cursor-delay + ;; to a very small or even zero value. + (run-with-idle-timer (max 0.2 blink-cursor-delay) blink-cursor-delay 'blink-cursor-start)))) @@ -2149,7 +2153,11 @@ terminals, cursor blinking is controlled by the terminal." (add-hook 'focus-in-hook #'blink-cursor-check) (add-hook 'focus-out-hook #'blink-cursor-suspend) (setq blink-cursor-idle-timer - (run-with-idle-timer blink-cursor-delay + ;; The 0.2 sec limitation from below is to avoid erratic + ;; behavior (or downright failure to display the cursor + ;; during command execution) if they set blink-cursor-delay + ;; to a very small or even zero value. + (run-with-idle-timer (max 0.2 blink-cursor-delay) blink-cursor-delay #'blink-cursor-start)))) From c14a1d4580b831bb1c62f273a11cee90d6ee283e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 25 Sep 2016 18:16:07 +0300 Subject: [PATCH 2/3] Minor copyedits of MS-Windows installation instructions * nt/INSTALL: * nt/README.W32: Add URL of Emacs dependencies on alpha.gnu.org. --- nt/INSTALL | 22 ++++++++++++++++------ nt/README.W32 | 18 +++++++++++------- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/nt/INSTALL b/nt/INSTALL index fff0eb6f8d9..cd726cbecbb 100644 --- a/nt/INSTALL +++ b/nt/INSTALL @@ -633,11 +633,13 @@ build will run on Windows 9X and newer systems). To support XPM images (required for color tool-bar icons), you will need the libXpm library. It is available from the ezwinports site, - http://sourceforge.net/projects/ezwinports/files/. + http://sourceforge.net/projects/ezwinports/files/ and from + http://alpha.gnu.org/gnu/emacs/pretest/windows/. For PNG images, we recommend to use versions 1.4.x and later of libpng, because previous versions had security issues. You can find - precompiled libraries and headers on the ezwinports site. + precompiled libraries and headers on the ezwinports site and on + alpha.gnu. Versions 1.4.0 and later of libpng are binary incompatible with earlier versions, so Emacs will only look for libpng libraries which @@ -654,7 +656,8 @@ build will run on Windows 9X and newer systems). For GIF images, we recommend to use versions 5.0.0 or later of giflib, as it is much enhanced wrt previous versions. You can find precompiled binaries and headers for giflib on the ezwinports site, - http://sourceforge.net/projects/ezwinports/files/. + http://sourceforge.net/projects/ezwinports/files/ and on + http://alpha.gnu.org/gnu/emacs/pretest/windows/. Version 5.0.0 and later of giflib are binary incompatible with previous versions (the signatures of several functions have @@ -668,7 +671,7 @@ build will run on Windows 9X and newer systems). For JPEG images, you will need libjpeg 6b or later, which will be called libjpeg-N.dll, jpeg62.dll, libjpeg.dll, or jpeg.dll. You can - find these on the ezwinports site. + find these on the ezwinports site and on alpha.gnu. TIFF images require libTIFF 3.0 or later, which will be called libtiffN.dll or libtiff-N.dll or libtiff.dll. These can be found on @@ -695,6 +698,10 @@ build will run on Windows 9X and newer systems). because the compiler needs to see their header files when building Emacs. + http://alpha.gnu.org/gnu/emacs/pretest/windows/ + + More fat ports, from the MSYS2 project. + To use librsvg at runtime, ensure that librsvg and its dependencies are on your PATH, or in the same directory as the emacs.exe binary. If you are downloading from the ezwinports site, you only need to @@ -751,7 +758,8 @@ build will run on Windows 9X and newer systems). session. You can get pre-built binaries (including any required DLL and the - header files) at http://sourceforge.net/projects/ezwinports/files/. + header files) at http://sourceforge.net/projects/ezwinports/files/ + and on http://alpha.gnu.org/gnu/emacs/pretest/windows/. * Optional libxml2 support @@ -773,6 +781,7 @@ build will run on Windows 9X and newer systems). (including any required DLL and the header files) is here: http://sourceforge.net/projects/ezwinports/files/ + http://alpha.gnu.org/gnu/emacs/pretest/windows/ For runtime support of libxml2, you will also need to install the libiconv "development" tarball, because the libiconv headers need to @@ -788,7 +797,8 @@ build will run on Windows 9X and newer systems). Emacs can decompress text if compiled with the zlib library. Prebuilt binaries of zlib DLL (for 32-bit builds of Emacs) are - available from the ezwinports site; see above for the URL. + available from the ezwinports site and on alpha.gnu; see above for + the URLs. (This library is also a prerequisite for several image libraries, so you may already have it; look for zlib1.dll or libz-1.dll.) diff --git a/nt/README.W32 b/nt/README.W32 index a061596da55..e3f6094f9be 100644 --- a/nt/README.W32 +++ b/nt/README.W32 @@ -140,10 +140,12 @@ See the end of the file for license conditions. 1. http://sourceforge.net/projects/ezwinports/files/ -- up-to-date builds, self-contained archives, only for 32-bit Emacs - 2. The MSYS2 project -- for 64-bit Emacs: + 2. Libraries from the MSYS2 project on alpha.gnu.org: + http://alpha.gnu.org/gnu/emacs/pretest/windows/. + 3. The MSYS2 project -- for 64-bit Emacs: http://msys2.github.io/ https://sourceforge.net/projects/msys2/files/REPOS/MINGW/x86_64/ - 3. GnuWin32 project -- very old 32-bit builds, not recommended + 4. GnuWin32 project -- very old 32-bit builds, not recommended The libraries to download are mentioned below. Some libraries depend on others that need to be downloaded separately from the same @@ -197,7 +199,8 @@ See the end of the file for license conditions. but GnuTLS won't be available to the running session. You can get pre-built binaries (including any dependency DLLs) at - http://sourceforge.net/projects/ezwinports/files/. + http://sourceforge.net/projects/ezwinports/files/ and on + http://alpha.gnu.org/gnu/emacs/pretest/windows/. * libxml2 support @@ -210,7 +213,8 @@ See the end of the file for license conditions. running session. You can get pre-built binaries (including any required DLL and the - header files) at http://sourceforge.net/projects/ezwinports/files/. + header files) at http://sourceforge.net/projects/ezwinports/files/ and + http://alpha.gnu.org/gnu/emacs/pretest/windows/. * zlib support @@ -219,9 +223,9 @@ See the end of the file for license conditions. the zlib-decompress-region primitive. Prebuilt binaries of zlib DLL (for 32-bit builds of Emacs) are - available from the ezwinports site; see above for the URL. For the - 64-bit DLL, see the instructions below for installing from MSYS2 - site. + available from the ezwinports site and on alpha.gnu; see above for + the URLs. For the 64-bit DLL, see the instructions below for + installing from MSYS2 site. (This library is also a prerequisite for several image libraries, so you may already have it; look for zlib1.dll or libz-1.dll.) From 9fc9988d4d08028fb37c588f5e0483ac85b713d3 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 26 Sep 2016 19:02:01 +0300 Subject: [PATCH 3/3] Improve documentation of 'expand-abbrev' and wrapper hooks * lisp/simple.el (filter-buffer-substring-functions) (buffer-substring--filter): Add a link to 'with-wrapper-hook' as the place to look for documentation of wrapper hooks. * lisp/minibuffer.el (completion-in-region-functions) (completion--in-region): Add a link to 'with-wrapper-hook' as the place to look for documentation of wrapper hooks. * lisp/abbrev.el (expand-abbrev, abbrev--default-expand): Clarify the doc strings. (Bug#24540) * doc/lispref/text.texi (Buffer Contents): Mention 'with-wrapper-hook's doc string as the place to learn about that obsolete facility. --- doc/lispref/text.texi | 4 +++- lisp/abbrev.el | 9 +++++---- lisp/minibuffer.el | 6 ++++-- lisp/simple.el | 6 ++++-- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 0445d68ef9e..f37f75f0c7b 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -232,7 +232,9 @@ using a function specified by the variable @code{filter-buffer-substring-function}, and returns the result. The default filter function consults the obsolete wrapper hook -@code{filter-buffer-substring-functions}, and the obsolete variable +@code{filter-buffer-substring-functions} (see the documentation string +of the macro @code{with-wrapper-hook} for the details about this +obsolete facility), and the obsolete variable @code{buffer-substring-filters}. If both of these are @code{nil}, it returns the unaltered text from the buffer, i.e., what @code{buffer-substring} would return. diff --git a/lisp/abbrev.el b/lisp/abbrev.el index d181d97703e..8c4f6eb01b2 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -837,16 +837,17 @@ Takes no argument and should return the abbrev symbol if expansion took place.") "Expand the abbrev before point, if there is an abbrev there. Effective when explicitly called even when `abbrev-mode' is nil. Before doing anything else, runs `pre-abbrev-expand-hook'. -Calls `abbrev-expand-function' with no argument to do the work, -and returns whatever it does. (This should be the abbrev symbol -if expansion occurred, else nil.)" +Calls the value of `abbrev-expand-function' with no argument to do +the work, and returns whatever it does. (That return value should +be the abbrev symbol if expansion occurred, else nil.)" (interactive) (run-hooks 'pre-abbrev-expand-hook) (funcall abbrev-expand-function)) (defun abbrev--default-expand () "Default function to use for `abbrev-expand-function'. -This respects the wrapper hook `abbrev-expand-functions'. +This also respects the obsolete wrapper hook `abbrev-expand-functions'. +\(See `with-wrapper-hook' for details about wrapper hooks.) Calls `abbrev-insert' to insert any expansion, and returns what it does." (with-wrapper-hook abbrev-expand-functions () (pcase-let ((`(,sym ,name ,wordstart ,wordend) (abbrev--before-point))) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 1ee05d32de5..c7f7c4122c3 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1925,7 +1925,8 @@ variables.") (exit-minibuffer)) (defvar completion-in-region-functions nil - "Wrapper hook around `completion--in-region'.") + "Wrapper hook around `completion--in-region'. +\(See `with-wrapper-hook' for details about wrapper hooks.)") (make-obsolete-variable 'completion-in-region-functions 'completion-in-region-function "24.4") @@ -1969,7 +1970,8 @@ if there was no valid completion, else t." (defun completion--in-region (start end collection &optional predicate) "Default function to use for `completion-in-region-function'. Its arguments and return value are as specified for `completion-in-region'. -This respects the wrapper hook `completion-in-region-functions'." +Also respects the obsolete wrapper hook `completion-in-region-functions'. +\(See `with-wrapper-hook' for details about wrapper hooks.)" (with-wrapper-hook ;; FIXME: Maybe we should use this hook to provide a "display ;; completions" operation as well. diff --git a/lisp/simple.el b/lisp/simple.el index 5dbaebb9355..c7d3b2e6b0b 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4009,7 +4009,8 @@ These commands include \\[set-mark-command] and \\[start-kbd-macro]." (defvar filter-buffer-substring-functions nil - "This variable is a wrapper hook around `buffer-substring--filter'.") + "This variable is a wrapper hook around `buffer-substring--filter'. +\(See `with-wrapper-hook' for details about wrapper hooks.)") (make-obsolete-variable 'filter-buffer-substring-functions 'filter-buffer-substring-function "24.4") @@ -4050,7 +4051,8 @@ that are special to a buffer, and should not be copied into other buffers." (defun buffer-substring--filter (beg end &optional delete) "Default function to use for `filter-buffer-substring-function'. Its arguments and return value are as specified for `filter-buffer-substring'. -This respects the wrapper hook `filter-buffer-substring-functions', +Also respects the obsolete wrapper hook `filter-buffer-substring-functions' +\(see `with-wrapper-hook' for details about wrapper hooks), and the abnormal hook `buffer-substring-filters'. No filtering is done unless a hook says to." (with-wrapper-hook filter-buffer-substring-functions (beg end delete)