commit d599dce1353ce59d134fcff21cde02c70025253d (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Tue Feb 20 13:42:20 2018 -0800 Port recent MAX_RW_COUNT checks to POSIX * src/sysdep.c (MAX_RW_COUNT): Verify that it fits in POSIX standard types, to go along with already-existing checks for MS-Windows types. (emacs_intr_read): eassert on all platforms, not just MS-Windows. diff --git a/src/sysdep.c b/src/sysdep.c index 08db376b26..c59034ce5c 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -2554,6 +2554,22 @@ emacs_close (int fd) #define MAX_RW_COUNT (INT_MAX >> 18 << 18) #endif +/* Verify that MAX_RW_COUNT fits in the relevant standard types. */ +#ifndef SSIZE_MAX +# define SSIZE_MAX TYPE_MAXIMUM (ssize_t) +#endif +verify (MAX_RW_COUNT <= PTRDIFF_MAX); +verify (MAX_RW_COUNT <= SIZE_MAX); +verify (MAX_RW_COUNT <= SSIZE_MAX); + +#ifdef WINDOWSNT +/* Verify that Emacs read requests cannot cause trouble, even in + 64-bit builds. The last argument of 'read' is 'unsigned int', and + the return value's type (see 'sys_read') is 'int'. */ +verify (MAX_RW_COUNT <= INT_MAX); +verify (MAX_RW_COUNT <= UINT_MAX); +#endif + /* Read from FD to a buffer BUF with size NBYTE. If interrupted, process any quits and pending signals immediately if INTERRUPTIBLE, and then retry the read unless quitting. @@ -2562,18 +2578,11 @@ emacs_close (int fd) static ptrdiff_t emacs_intr_read (int fd, void *buf, ptrdiff_t nbyte, bool interruptible) { + /* No caller should ever pass a too-large size to emacs_read. */ + eassert (nbyte <= MAX_RW_COUNT); + ssize_t result; - /* There is no need to check against MAX_RW_COUNT, since no caller ever - passes a size that large to emacs_read. */ -#ifdef WINDOWSNT - /* On MS-Windows, 'read's last argument is declared as 'unsigned - int', and the return value's type (see 'sys_read') is 'int'. - This might cause trouble, especially in 64-bit builds, if the - above comment ever becomes incorrect. The following assertion - should make us more future-proof. */ - eassert (nbyte <= INT_MAX); -#endif do { if (interruptible) commit 630da78a3cc2a5df2d61e1edf0c209b806b336e2 Author: Paul Eggert Date: Tue Feb 20 13:42:19 2018 -0800 Update from gnulib This includes: 2018-02-18 warnings: Add support for Objective C 2018-02-03 stdlib: Fix compilation error on OpenIndiana * lib/gnulib.mk.in: Regenerate. * lib/stdlib.in.h, m4/getloadavg.m4, m4/stdlib_h.m4, m4/warnings.m4: Copy from gnulib. diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index 451c1572fd..ce47b9de66 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in @@ -548,6 +548,8 @@ KQUEUE_CFLAGS = @KQUEUE_CFLAGS@ KQUEUE_LIBS = @KQUEUE_LIBS@ KRB4LIB = @KRB4LIB@ KRB5LIB = @KRB5LIB@ +LCMS2_CFLAGS = @LCMS2_CFLAGS@ +LCMS2_LIBS = @LCMS2_LIBS@ LDFLAGS = @LDFLAGS@ LD_SWITCH_SYSTEM = @LD_SWITCH_SYSTEM@ LD_SWITCH_SYSTEM_TEMACS = @LD_SWITCH_SYSTEM_TEMACS@ @@ -562,7 +564,6 @@ LIBGPM = @LIBGPM@ LIBHESIOD = @LIBHESIOD@ LIBINTL = @LIBINTL@ LIBJPEG = @LIBJPEG@ -LIBLCMS2 = @LIBLCMS2@ LIBMODULES = @LIBMODULES@ LIBOBJS = @LIBOBJS@ LIBOTF_CFLAGS = @LIBOTF_CFLAGS@ @@ -672,6 +673,7 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ PNG_CFLAGS = @PNG_CFLAGS@ +PNG_LIBS = @PNG_LIBS@ POST_ALLOC_OBJ = @POST_ALLOC_OBJ@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ @@ -1984,8 +1986,8 @@ signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \ - -e 's|@''GNULIB_PTHREAD_SIGMASK''@|$(GNULIB_PTHREAD_SIGMASK)|g' \ - -e 's|@''GNULIB_RAISE''@|$(GNULIB_RAISE)|g' \ + -e 's/@''GNULIB_PTHREAD_SIGMASK''@/$(GNULIB_PTHREAD_SIGMASK)/g' \ + -e 's/@''GNULIB_RAISE''@/$(GNULIB_RAISE)/g' \ -e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GNULIB_SIGNAL_H_SIGPIPE)/g' \ -e 's/@''GNULIB_SIGPROCMASK''@/$(GNULIB_SIGPROCMASK)/g' \ -e 's/@''GNULIB_SIGACTION''@/$(GNULIB_SIGACTION)/g' \ diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index b9701d5b28..c8a5d0d0c6 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -47,6 +47,9 @@ /* Solaris declares getloadavg() in . */ #if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@ +/* OpenIndiana has a bug: must be included before + . */ +# include # include #endif diff --git a/m4/getloadavg.m4 b/m4/getloadavg.m4 index acc266531e..7b6a09a5c5 100644 --- a/m4/getloadavg.m4 +++ b/m4/getloadavg.m4 @@ -7,7 +7,7 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -#serial 6 +#serial 7 # Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent. # New applications should use gl_GETLOADAVG instead. @@ -92,6 +92,9 @@ else fi AC_CHECK_DECL([getloadavg], [], [HAVE_DECL_GETLOADAVG=0], [[#if HAVE_SYS_LOADAVG_H + /* OpenIndiana has a bug: must be included before + . */ + # include # include #endif #include ]]) diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4 index eff6f9e685..49dc5d59cb 100644 --- a/m4/stdlib_h.m4 +++ b/m4/stdlib_h.m4 @@ -1,4 +1,4 @@ -# stdlib_h.m4 serial 44 +# stdlib_h.m4 serial 45 dnl Copyright (C) 2007-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -14,6 +14,9 @@ AC_DEFUN([gl_STDLIB_H], dnl guaranteed by C89. gl_WARN_ON_USE_PREPARE([[#include #if HAVE_SYS_LOADAVG_H +/* OpenIndiana has a bug: must be included before + . */ +# include # include #endif #if HAVE_RANDOM_H diff --git a/m4/warnings.m4 b/m4/warnings.m4 index eb1c795c59..07edda1cca 100644 --- a/m4/warnings.m4 +++ b/m4/warnings.m4 @@ -1,4 +1,4 @@ -# warnings.m4 serial 13 +# warnings.m4 serial 14 dnl Copyright (C) 2008-2018 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -76,6 +76,15 @@ m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)], AC_LANG_POP([C++]) ]) +# Specialization for _AC_LANG = Objective C. This macro can be AC_REQUIREd. +# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b. +m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(Objective C)], +[ + AC_LANG_PUSH([Objective C]) + gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL + AC_LANG_POP([Objective C]) +]) + AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL], [gl_COMPILER_OPTION_IF([-Werror -Wunknown-warning-option], [gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'], commit 3d38ab8f1fbfaeb1f3eddbc79ef6ded1d9a87841 Author: Sam Steingold Date: Tue Feb 20 15:30:51 2018 -0500 command-history-mode inherits from special-mode (command-history-mode-map): Add `special-mode-map' to parents. (command-history-mode): Parent is `special-mode', not `fundamental-mode', set `revert-buffer-function'. (command-history-revert): Define for `revert-buffer-function'. diff --git a/lisp/chistory.el b/lisp/chistory.el index d557c9f4ee..b4a8b6e72f 100644 --- a/lisp/chistory.el +++ b/lisp/chistory.el @@ -125,8 +125,8 @@ The buffer is left in Command History mode." 'command-history-mode-map "24.1") (defvar command-history-mode-map (let ((map (make-sparse-keymap))) - (set-keymap-parent map lisp-mode-shared-map) - (suppress-keymap map) + (set-keymap-parent map (make-composed-keymap lisp-mode-shared-map + special-mode-map)) (define-key map "x" 'command-history-repeat) (define-key map "\n" 'next-line) (define-key map "\r" 'next-line) @@ -134,20 +134,23 @@ The buffer is left in Command History mode." map) "Keymap for `command-history-mode'.") -(define-derived-mode command-history-mode fundamental-mode "Command History" +(define-derived-mode command-history-mode special-mode "Command History" "Major mode for listing and repeating recent commands. Keybindings: \\{command-history-mode-map}" (lisp-mode-variables nil) - (set-syntax-table emacs-lisp-mode-syntax-table) - (setq buffer-read-only t)) + (set (make-local-variable 'revert-buffer-function) 'command-history-revert) + (set-syntax-table emacs-lisp-mode-syntax-table)) (defcustom command-history-hook nil "If non-nil, its value is called on entry to `command-history-mode'." :type 'hook :group 'chistory) +(defun command-history-revert (_ignore-auto _noconfirm) + (list-command-history)) + (defun command-history-repeat () "Repeat the command shown on the current line. The buffer for that command is the previous current buffer." commit 3efd6aec6e8427f4e1952711a93ccec4aa83abdf Author: Eli Zaretskii Date: Tue Feb 20 21:25:52 2018 +0200 Fix reference in Emacs manual * doc/emacs/custom.texi (Early Init File): Fix reference to ELisp manual. (Bug#30552) diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 07ddd1f23b..3a66f21602 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -2583,5 +2583,5 @@ you can customize variables that affect the initialization process, such as @code{package-enable-at-startup} and @code{package-load-list}. @xref{Package Installation}. - For more information on the early init file, @pxref{Early Init -File,,, elisp, The Emacs Lisp Reference Manual}. + For more information on the early init file, @pxref{Init File,,, +elisp, The Emacs Lisp Reference Manual}. commit 240df54e24785cc23d365699bcdbb5cd6fd0bb9f Author: Paul Eggert Date: Tue Feb 20 09:15:27 2018 -0800 Fix false alarm with recent GCC x86 * src/lread.c (Fload): Use UNINIT to pacify -Wmaybe-uninitialized false alarm on Fedora 27 x86 with GCC 7.3.1 20180130 (Red Hat 7.3.1-2). diff --git a/src/lread.c b/src/lread.c index d009bd0cd2..0ea7677300 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1123,7 +1123,7 @@ Return t if the file exists and loads successfully. */) (Lisp_Object file, Lisp_Object noerror, Lisp_Object nomessage, Lisp_Object nosuffix, Lisp_Object must_suffix) { - FILE *stream; + FILE *stream UNINIT; int fd; int fd_index UNINIT; ptrdiff_t count = SPECPDL_INDEX (); commit 9ce10e893dcdec1a5d3d7ef985408b79cd5ecd69 Author: Sam Steingold Date: Tue Feb 20 11:18:24 2018 -0500 ns_appsrc is not disjoint with srcdir/ns_appsrc (links): Avoid "file already exists" errors by removing the existing file. diff --git a/nextstep/Makefile.in b/nextstep/Makefile.in index 0763e63f93..cb69898737 100644 --- a/nextstep/Makefile.in +++ b/nextstep/Makefile.in @@ -76,7 +76,7 @@ links: ../src/emacs${EXEEXT} for d in $(shell cd ${srcdir}/${ns_appsrc}; find . -type d); do ${MKDIR_P} ${ns_appdir}/$$d; done for f in $(shell cd ${srcdir}/${ns_appsrc}; find . -type f); do ln -s $(shell cd ${srcdir}; pwd -P)/${ns_appsrc}/$$f ${ns_appdir}/$$f; done for d in $(shell cd ${ns_appsrc}; find . -type d); do ${MKDIR_P} ${ns_appdir}/$$d; done - for f in $(shell cd ${ns_appsrc}; find . -type f); do ln -s $(shell cd ${ns_appsrc}; pwd -P)/$$f ${ns_appdir}/$$f; done + for f in $(shell cd ${ns_appsrc}; find . -type f); do rm -f ${ns_appdir}/$$f; ln -s $(shell cd ${ns_appsrc}; pwd -P)/$$f ${ns_appdir}/$$f; done ln -s $(top_srcdir_abs)/lisp ${ns_appdir}/Contents/Resources ln -s $(top_srcdir_abs)/info ${ns_appdir}/Contents/Resources ${MKDIR_P} ${ns_appbindir} commit 650febcd3ec1cfe0c686414c9c8f1a7caaeefe71 Merge: 3d42272754 226aca32a7 Author: Glenn Morris Date: Tue Feb 20 07:50:29 2018 -0800 Merge from origin/emacs-26 226aca3 (origin/emacs-26) Fix documentation of 'flyspell-auto-correct... a8c8434 * doc/emacs/misc.texi (Saving Emacs Sessions): Fix markup. 275e735 More changes in the Emacs manuals d962be5 More fixes in the Emacs manual 6dc2846 * src/data.c (Faref): Fix a typo in the doc string. (Bug#30510) 36e729f Minor edit in tramp.texi 6537f99 ; Fix oversight from last commit eb94588 ; * doc/emacs/maintaining.texi: Fix two typos. 258135f More improvements in the Emacs manual f138bca Improve documentation of 'electric-pair-mode' f74ab96 ; Spelling and grammar fixes. 42f9dc4 ; * lisp/textmodes/flyspell.el (flyspell-auto-correct-word): ... commit 226aca32a784c4edebdec6a16eb90930aae64c06 Author: Eli Zaretskii Date: Tue Feb 20 06:22:57 2018 +0200 Fix documentation of 'flyspell-auto-correct-word' * lisp/textmodes/flyspell.el (flyspell-get-word): Elaborate in the doc string on how the function looks for the word to spell-check. (flyspell-word, flyspell-auto-correct-word): Refer to 'flyspell-get-word' for details about finding the word. (Bug#30462) diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index d7f0b0a7c1..aaa8ebfd48 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -1103,7 +1103,10 @@ If the optional argument FOLLOWING, or, when called interactively `ispell-following-word', is non-nil, checks the following (rather than preceding) word when the cursor is not over a word. If optional argument KNOWN-MISSPELLING is non nil considers word a -misspelling and skips redundant spell-checking step." +misspelling and skips redundant spell-checking step. + +See `flyspell-get-word' for details of how this finds the word to +spell-check." (interactive (list ispell-following-word)) (ispell-set-spellchecker-params) ; Initialize variables and dicts alists (save-excursion @@ -1302,7 +1305,13 @@ misspelling and skips redundant spell-checking step." Optional argument FOLLOWING non-nil means to get the following \(rather than preceding) word when the cursor is not over a word. Optional second argument EXTRA-OTHERCHARS is a regexp of characters -that may be included as part of a word (see `ispell-dictionary-alist')." +that may be included as part of a word (see `ispell-dictionary-alist'). + +This finds the word to spell-check by searching for CASECHARS defined +in `ispell-dictionary-alist' for the current dictionary. Thus, the +word could be far away of point if point is inside whitespace or +punctuation characters, or in text that belongs to a different +language." (let* ((flyspell-casechars (flyspell-get-casechars)) (flyspell-not-casechars (flyspell-get-not-casechars)) (ispell-otherchars (ispell-get-otherchars)) @@ -1919,8 +1928,10 @@ before point that's highlighted as misspelled." "Correct the current word. This command proposes various successive corrections for the current word. If invoked repeatedly on the same position, it -cycles through the possible corrections of the word at or near -that position." +cycles through the possible corrections of the current word. + +See `flyspell-get-word' for details of how this finds the word to +spell-check." (interactive) ;; If we are not in the construct where flyspell should be active, ;; invoke the original binding of M-TAB, if that was recorded. commit a8c843478c2152186b2ff438c0b891e575300411 Author: Robert Pluim Date: Mon Feb 19 18:16:15 2018 +0200 * doc/emacs/misc.texi (Saving Emacs Sessions): Fix markup. diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index cfc689e464..9610ed4dd8 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -2475,7 +2475,7 @@ seconds, if that is non-@code{nil} and non-zero. If you turn on @code{desktop-save-mode} in your init file, then when Emacs starts, it looks for a saved desktop in the current directory. (More precisely, it looks in the directories specified by -@var{desktop-path}, and uses the first desktop it finds.) +@code{desktop-path}, and uses the first desktop it finds.) Thus, you can have separate saved desktops in different directories, and the starting directory determines which one Emacs reloads. You can save the current desktop and reload one saved in another directory commit 275e735dc390ecaaad79c92f25009091c4261623 Author: Eli Zaretskii Date: Mon Feb 19 18:14:08 2018 +0200 More changes in the Emacs manuals * doc/emacs/custom.texi (Customization Groups, Browsing Custom) (Custom Themes, Keymaps, Prefix Keymaps, Modifier Keys) (Function Keys, Named ASCII Chars, Mouse Buttons, Init Examples): Fix punctuation. Suggested by Stefan Kamphausen in emacs-manual-bugs@gnu.org. * doc/emacs/basic.texi (Arguments, Repeating): Avoid breaking commands between lines. Reported by Wojciech Politarczyk in emacs-manual-bugs@gnu.org. * doc/emacs/custom.texi (Init Rebinding): Move index entries about rebinding keys from "Init File". (Bug#30528) diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi index 4db3855dd9..aa91f0555e 100644 --- a/doc/emacs/basic.texi +++ b/doc/emacs/basic.texi @@ -778,12 +778,12 @@ lines). You can use a numeric argument before a self-inserting character to insert multiple copies of it. This is straightforward when the -character is not a digit; for example, @kbd{C-u 6 4 a} inserts 64 +character is not a digit; for example, @w{@kbd{C-u 6 4 a}} inserts 64 copies of the character @samp{a}. But this does not work for -inserting digits; @kbd{C-u 6 4 1} specifies an argument of 641. You -can separate the argument from the digit to insert with another -@kbd{C-u}; for example, @kbd{C-u 6 4 C-u 1} does insert 64 copies of -the character @samp{1}. +inserting digits; @w{@kbd{C-u 6 4 1}} specifies an argument of 641. +You can separate the argument from the digit to insert with another +@kbd{C-u}; for example, @w{@kbd{C-u 6 4 C-u 1}} does insert 64 copies +of the character @samp{1}. Some commands care whether there is an argument, but ignore its value. For example, the command @kbd{M-q} (@code{fill-paragraph}) @@ -822,7 +822,7 @@ invoking the command. @cindex repeating a command Many simple commands, such as those invoked with a single key or -with @kbd{M-x @var{command-name} @key{RET}}, can be repeated by +with @w{@kbd{M-x @var{command-name} @key{RET}}}, can be repeated by invoking them with a numeric argument that serves as a repeat count (@pxref{Arguments}). However, if the command you want to repeat prompts for input, or uses a numeric argument in another way, that diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 2726690f09..1fa47634d4 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -109,7 +109,7 @@ group, which contains several other groups (@samp{Editing}, listed here, only one line of documentation each. The @dfn{state} of the group indicates whether setting in that group -has been edited, set or saved. @xref{Changing a Variable}. +has been edited, set, or saved. @xref{Changing a Variable}. @cindex editable fields (customization buffer) @cindex buttons (customization buffer) @@ -168,7 +168,7 @@ search field, except that it reads the search term(s) using the minibuffer. @xref{Specific Customization}. @kbd{M-x customize-browse} is another way to browse the available -settings. This command creates a special customization buffer which +settings. This command creates a special customization buffer, which shows only the names of groups and settings, in a structured layout. You can show the contents of a group, in the same buffer, by invoking the @samp{[+]} button next to the group name. When the group contents @@ -580,7 +580,7 @@ directory specified by the variable @code{custom-theme-directory} (which defaults to @file{~/.emacs.d/}), and a directory named @file{etc/themes} in your Emacs installation (see the variable @code{data-directory}). The latter contains several Custom themes -which are distributed with Emacs, which customize Emacs's faces to fit +distributed with Emacs that customize Emacs's faces to fit various color schemes. (Note, however, that Custom themes need not be restricted to this purpose; they can be used to customize variables too.) @@ -663,7 +663,7 @@ to insert some common Emacs faces into the theme (a convenience, since Custom themes are often used to customize faces). If you answer no, the theme will initially contain no settings. - Near the top of the @file{*Custom Theme*} buffer are editable fields + Near the top of the @file{*Custom Theme*} buffer, there are editable fields where you can enter the theme's name and description. The name can be anything except @samp{user}. The description is the one that will be shown when you invoke @kbd{M-x describe-theme} for the theme. Its @@ -1427,7 +1427,7 @@ of lower-case letters and hyphens. A @dfn{key sequence} (@dfn{key}, for short) is a sequence of @dfn{input events} that have a meaning as a unit. Input events -include characters, function keys and mouse buttons---all the inputs +include characters, function keys, and mouse buttons---all the inputs that you can send to the computer. A key sequence gets its meaning from its @dfn{binding}, which says what command it runs. @@ -1460,7 +1460,7 @@ can even mix mouse events with keyboard events, such as @kbd{S-down-mouse-1}. On text terminals, typing a function key actually sends the computer -a sequence of characters; the precise details of the sequence depends +a sequence of characters; the precise details of the sequence depend on the function key and on the terminal type. (Often the sequence starts with @kbd{@key{ESC} [}.) If Emacs understands your terminal type properly, it automatically handles such sequences as single input @@ -1484,7 +1484,7 @@ the same, but it provides a command name for the prefix key that can be used as a description of what the prefix key is for. Thus, the binding of @kbd{C-x} is the symbol @code{Control-X-prefix}, whose function definition is the keymap for @kbd{C-x} commands. The definitions of -@kbd{C-c}, @kbd{C-x}, @kbd{C-h} and @key{ESC} as prefix keys appear in +@kbd{C-c}, @kbd{C-x}, @kbd{C-h}, and @key{ESC} as prefix keys appear in the global map, so these prefix keys are always available. Aside from ordinary prefix keys, there is a fictitious ``prefix key'' @@ -1669,6 +1669,8 @@ command is less work to invoke when you really want to. @node Init Rebinding @subsection Rebinding Keys in Your Init File @cindex rebinding major mode keys +@cindex key rebinding, permanent +@cindex rebinding keys, permanently @c This node is referenced in the tutorial. When renaming or deleting @c it, the tutorial needs to be adjusted. (TUTORIAL.de) @@ -1795,7 +1797,7 @@ could make @kbd{M-a} and @kbd{M-A} run different commands. Although only the @key{Control} and @key{META} modifier keys are commonly used, Emacs supports three other modifier keys. These are -called @key{Super}, @key{Hyper} and @key{Alt}. Few terminals provide +called @key{Super}, @key{Hyper}, and @key{Alt}. Few terminals provide ways to use these modifiers; the key labeled @key{Alt} on most keyboards usually issues the @key{META} modifier, not @key{Alt}. The standard key bindings in Emacs do not include any characters with @@ -1856,7 +1858,7 @@ key. @xref{Init Rebinding}, for examples of binding function keys. @cindex keypad - Many keyboards have a numeric keypad on the right hand side. + Many keyboards have a numeric keypad on the right-hand side. The numeric keys in the keypad double up as cursor motion keys, toggled by a key labeled @samp{Num Lock}. By default, Emacs translates these keys to the corresponding keys on the main keyboard. @@ -1882,7 +1884,7 @@ prefix arguments. @node Named ASCII Chars @subsection Named @acronym{ASCII} Control Characters - @key{TAB}, @key{RET}, @key{BS}, @key{LFD}, @key{ESC} and @key{DEL} + @key{TAB}, @key{RET}, @key{BS}, @key{LFD}, @key{ESC}, and @key{DEL} started out as names for certain @acronym{ASCII} control characters, used so often that they have special keys of their own. For instance, @key{TAB} was another name for @kbd{C-i}. Later, users found it @@ -1999,7 +2001,7 @@ units of 1/8 of a character cell on text-mode terminals; the default is The symbols for mouse events also indicate the status of the modifier keys, with the usual prefixes @samp{C-}, @samp{M-}, @samp{H-}, -@samp{s-}, @samp{A-} and @samp{S-}. These always precede @samp{double-} +@samp{s-}, @samp{A-}, and @samp{S-}. These always precede @samp{double-} or @samp{triple-}, which always precede @samp{drag-} or @samp{down-}. A frame includes areas that don't show text from the buffer, such as @@ -2099,8 +2101,6 @@ as a function from Lisp programs. @cindex .emacs file @cindex ~/.emacs file @cindex Emacs initialization file -@cindex key rebinding, permanent -@cindex rebinding keys, permanently @cindex startup (init file) When Emacs is started, it normally tries to load a Lisp program from @@ -2310,7 +2310,7 @@ name. @need 1500 @item -Set up defaults for the Latin-1 character set +Set up defaults for the Latin-1 character set, which supports most of the languages of Western Europe. @example commit d962be5a562221802b738cc98142a4e838ddfa97 Author: Eli Zaretskii Date: Sun Feb 18 20:52:21 2018 +0200 More fixes in the Emacs manual * doc/emacs/abbrevs.texi (Defining Abbrevs, Expanding Abbrevs) (Editing Abbrevs, Saving Abbrevs): Insert blank lines between @item's. (Expanding Abbrevs): Add 'unexpand-abbrev' to the list of commands. Suggested by Michael Albinus in emacs-manual-bugs@gnu.org. diff --git a/doc/emacs/abbrevs.texi b/doc/emacs/abbrevs.texi index 9349d2d5ba..00b9e560ac 100644 --- a/doc/emacs/abbrevs.texi +++ b/doc/emacs/abbrevs.texi @@ -72,18 +72,24 @@ use in later sessions. @item C-x a g Define an abbrev, using one or more words before point as its expansion (@code{add-global-abbrev}). + @item C-x a l Similar, but define an abbrev specific to the current major mode (@code{add-mode-abbrev}). + @item C-x a i g Define a word in the buffer as an abbrev (@code{inverse-add-global-abbrev}). + @item C-x a i l Define a word in the buffer as a mode-specific abbrev (@code{inverse-add-mode-abbrev}). + @item M-x define-global-abbrev @key{RET} @var{abbrev} @key{RET} @var{exp} @key{RET} Define @var{abbrev} as an abbrev expanding into @var{exp}. + @item M-x define-mode-abbrev @key{RET} @var{abbrev} @key{RET} @var{exp} @key{RET} Define @var{abbrev} as a mode-specific abbrev expanding into @var{exp}. + @item M-x kill-all-abbrevs Discard all abbrev definitions, leaving a blank slate. @end table @@ -160,10 +166,16 @@ to @samp{FIND OUTER OTTER}. @item M-' Separate a prefix from a following abbrev to be expanded (@code{abbrev-prefix-mark}). + @item C-x a e @findex expand-abbrev Expand the abbrev before point (@code{expand-abbrev}). This is effective even when Abbrev mode is not enabled. + +@item M-x unexpand-abbrev +@findex unexpand-abbrev +Undo the expansion of the last expanded abbrev. + @item M-x expand-region-abbrevs Expand some or all abbrevs found in the region. @end table @@ -188,7 +200,6 @@ its expansion, you can accomplish this by inserting the following punctuation with @kbd{C-q}. Thus, @kbd{foo C-q ,} leaves @samp{foo,} in the buffer, not expanding it. -@findex unexpand-abbrev If you expand an abbrev by mistake, you can undo the expansion by typing @kbd{C-/} (@code{undo}). @xref{Undo}. This undoes the insertion of the abbrev expansion and brings back the abbrev text. If @@ -219,6 +230,7 @@ Reference Manual}. @item M-x list-abbrevs Display a list of all abbrev definitions. With a numeric argument, list only local abbrevs. + @item M-x edit-abbrevs Edit a list of abbrevs; you can add, alter or remove definitions. @end table @@ -278,10 +290,13 @@ sessions. @table @kbd @item M-x write-abbrev-file @key{RET} @var{file} @key{RET} Write a file @var{file} describing all defined abbrevs. + @item M-x read-abbrev-file @key{RET} @var{file} @key{RET} Read the file @var{file} and define abbrevs as specified therein. + @item M-x define-abbrevs Define abbrevs from definitions in current buffer. + @item M-x insert-abbrevs Insert all abbrevs and their expansions into current buffer. @end table commit 6dc2846a2d6432648e88f76ab0946a4534b81bc0 Author: Eli Zaretskii Date: Sun Feb 18 18:36:11 2018 +0200 * src/data.c (Faref): Fix a typo in the doc string. (Bug#30510) diff --git a/src/data.c b/src/data.c index 53a92ac03b..45b2bf7302 100644 --- a/src/data.c +++ b/src/data.c @@ -2272,8 +2272,8 @@ function chain of symbols. */) /* Extract and set vector and string elements. */ DEFUN ("aref", Faref, Saref, 2, 2, 0, - doc: /* Return the element of ARG at index IDX. -ARG may be a vector, a string, a char-table, a bool-vector, a record, + doc: /* Return the element of ARRAY at index IDX. +ARRAY may be a vector, a string, a char-table, a bool-vector, a record, or a byte-code object. IDX starts at 0. */) (register Lisp_Object array, Lisp_Object idx) { commit 36e729f06cddd2a02fba15516f43f4c1a53bab55 Author: Michael Albinus Date: Sun Feb 18 10:52:30 2018 +0100 Minor edit in tramp.texi * doc/misc/tramp.texi (Remote shell setup, Windows setup hints): Improve @cindex entries. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index e264298efc..f82c9b5003 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -1878,8 +1878,8 @@ Similar localization may be necessary for handling wrong password prompts, for which @value{tramp} uses @option{tramp-wrong-passwd-regexp}. @item @command{tset} and other questions -@cindex unix command tset -@cindex tset unix command +@cindex unix command @command{tset} +@cindex @command{tset} unix command @vindex tramp-terminal-type To suppress inappropriate prompts for terminal type, @value{tramp} @@ -2227,12 +2227,12 @@ Some older versions of Cygwin's @command{ssh} work with the @option{sshx} access method. Consult Cygwin's FAQ at @uref{https://cygwin.com/faq/} for details. -@cindex cygwin and fakecygpty -@cindex fakecygpty and cygwin +@cindex cygwin and @command{fakecygpty} +@cindex @command{fakecygpty} and cygwin On @uref{https://www.emacswiki.org/emacs/SshWithNTEmacs, the Emacs -Wiki} it is explained how to use the helper program @code{fakecygpty} -to fix this problem. +Wiki} it is explained how to use the helper program +@command{fakecygpty} to fix this problem. @cindex method scpx with cygwin @cindex scpx method with cygwin @@ -2246,8 +2246,8 @@ for a host named @code{c}. A workaround: write a wrapper script for @option{scp} to convert Windows file names to Cygwin file names. -@cindex cygwin and ssh-agent -@cindex SSH_AUTH_SOCK and emacs on ms windows +@cindex cygwin and @command{ssh-agent} +@cindex @env{SSH_AUTH_SOCK} and emacs on ms windows When using the @command{ssh-agent} on MS Windows for password-less interaction, @option{ssh} methods depend on the environment variable commit 6537f996c1115ac5debee8ea1653a1bedf65d597 Author: Michael Albinus Date: Sat Feb 17 19:43:13 2018 +0100 ; Fix oversight from last commit * doc/emacs/maintaining.texi (Select Tags Table): Use proper "~/.emacs.d" directory. diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index aa3ac3b992..23e08a58e8 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -2621,13 +2621,13 @@ current list, it is used @emph{as well as} the others. @example @group (setq tags-table-list - '("~/emacs.d/init.el" "/usr/local/lib/emacs/src")) + '("~/.emacs.d" "/usr/local/lib/emacs/src")) @end group @end example @noindent This tells the tags commands to look at the @file{TAGS} files in your -@file{~/emacs} directory and in the @file{/usr/local/lib/emacs/src} +@file{~/.emacs.d} directory and in the @file{/usr/local/lib/emacs/src} directory. The order depends on which file you are in and which tags table mentions that file. commit eb94588e3ca7b63f57d0aa1cd4938c8e988a6d04 Author: Eli Zaretskii Date: Sat Feb 17 19:52:50 2018 +0200 ; * doc/emacs/maintaining.texi: Fix two typos. diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 7712fb2d69..aa3ac3b992 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1827,7 +1827,7 @@ If the specified identifier has only one definition, the command jumps to it. If the identifier has more than one possible definition (e.g., in an object-oriented language, or if there's a function and a variable by the same name), the command shows the candidate -definitions in a @file{*xref*} buffer, together with the files in +definitions in the @file{*xref*} buffer, together with the files in which these definitions are found. Selecting one of these candidates by typing @kbd{@key{RET}} or clicking @kbd{mouse-2} will pop a buffer showing the corresponding definition. @@ -1953,7 +1953,7 @@ Restart one of the last 2 commands above, from the current location of point. @kbd{M-?} finds all the references for the identifier at point. If there's no identifier at point, or when invoked with a prefix argument, the command prompts for the identifier, with completion. It -then presents a @file{*xref*} buffer with all the references to the +then presents the @file{*xref*} buffer with all the references to the identifier, showing the file name and the line where the identifier is referenced. The XREF mode commands are available in this buffer, see @ref{Xref Commands}. commit 258135ff5d9d3f41a6d98a5d04484646824db035 Author: Eli Zaretskii Date: Sat Feb 17 19:48:23 2018 +0200 More improvements in the Emacs manual * doc/emacs/maintaining.texi (Xref Commands, Identifier Search) (List Identifiers): Insert blank lines between @item's in a @table. (Etags Regexps): More accurate description of escape sequences. (Select Tags Table): Prefer "~/emacs.d/init.el" to "~/.emacs". Suggested by Michael Albinus in emacs-manual-bugs@gnu.org. diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index 541bf9708b..7712fb2d69 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1611,7 +1611,7 @@ To change this, customize @code{change-log-directory-files}. @vindex add-log-keep-changes-together When the variable @code{add-log-keep-changes-together} is -non-@code{nil}, @kbd{C-x 4 a} adds to any existing item for the file +non-@code{nil}, @kbd{C-x 4 a} adds to any existing item for the file, rather than starting a new item. You can combine multiple changes of the same nature. If you don't @@ -1883,28 +1883,34 @@ the special XREF mode: @item @key{RET} @itemx mouse-2 Display the reference on the current line. + @item n @itemx . @findex xref-next-line Move to the next reference and display it in the other window (@code{xref-next-line}). + @item p @itemx , @findex xref-prev-line Move to the previous reference and display it in the other window (@code{xref-prev-line}). + @item C-o @findex xref-show-location-at-point Display the reference on the current line in the other window (@code{xref-show-location-at-point}). + @item @key{TAB} @findex xref-quit-and-goto-xref Display the reference on the current line and bury the @file{*xref*} buffer (@code{xref-quit-and-goto-xref}). + @item r @var{pattern} @key{RET} @var{replacement} @key{RET} Perform interactive query-replace on references that match @var{pattern} (@code{xref-query-replace-in-results}), replacing the match with @var{replacement}. @xref{Identifier Search}. + @findex xref-quit @item q Quit the window showing the @file{*xref*} buffer (@code{xref-quit}). @@ -1926,14 +1932,18 @@ them. @table @kbd @item M-? Find all the references for the identifier at point. + @item M-x xref-query-replace-in-results @key{RET} @var{regexp} @key{RET} @var{replacement} @key{RET} Interactively replace @var{regexp} with @var{replacement} in the names of all the identifiers shown in the @file{*xref*} buffer. + @item M-x tags-search @key{RET} @var{regexp} @key{RET} Search for @var{regexp} through the files in the selected tags table. + @item M-x tags-query-replace @key{RET} @var{regexp} @key{RET} @var{replacement} @key{RET} Perform a @code{query-replace-regexp} on each file in the selected tags table. + @item M-x tags-loop-continue Restart one of the last 2 commands above, from the current location of point. @end table @@ -1967,7 +1977,7 @@ available (@pxref{Tags Tables}). @findex tags-loop-continue Having found one match with @code{tags-search}, you probably want to -find all the rest. Type @kbd{M-x tags-loop-continue} to resume the +find all the rest. @kbd{M-x tags-loop-continue} resumes the @code{tags-search}, finding one more match. This searches the rest of the current buffer, followed by the remaining files of the tags table. @@ -2017,11 +2027,14 @@ Searching}. @itemx M-@key{TAB} Perform completion on the text around point, possibly using the selected tags table if one is loaded (@code{completion-at-point}). + @item M-x xref-find-apropos @key{RET} @var{regexp} @key{RET} Display a list of all known identifiers matching @var{regexp}. + @item M-x list-tags @key{RET} @var{file} @key{RET} Display a list of the identifiers defined in the program file @var{file}. + @item M-x next-file Visit files recorded in the selected tags table. @end table @@ -2435,11 +2448,12 @@ matches at the beginning of a line. If you want to allow indented tags, use a regexp that matches initial whitespace; start it with @samp{[ \t]*}. - In these regular expressions, @samp{\} quotes the next character, and -all the GCC character escape sequences are supported (@samp{\a} for -bell, @samp{\b} for back space, @samp{\d} for delete, @samp{\e} for -escape, @samp{\f} for formfeed, @samp{\n} for newline, @samp{\r} for -carriage return, @samp{\t} for tab, and @samp{\v} for vertical tab). + In these regular expressions, @samp{\} quotes the next character, +and all the C character escape sequences are supported: @samp{\a} for +bell, @samp{\b} for back space, @samp{\e} for escape, @samp{\f} for +formfeed, @samp{\n} for newline, @samp{\r} for carriage return, +@samp{\t} for tab, and @samp{\v} for vertical tab. In addition, +@samp{\d} stands for the @code{DEL} character. Ideally, @var{tagregexp} should not match more characters than are needed to recognize what you want to tag. If the syntax requires you @@ -2607,7 +2621,7 @@ current list, it is used @emph{as well as} the others. @example @group (setq tags-table-list - '("~/emacs" "/usr/local/lib/emacs/src")) + '("~/emacs.d/init.el" "/usr/local/lib/emacs/src")) @end group @end example commit f138bca8ca2db89d663a2cf8d80e6368437e4e3c Author: Eli Zaretskii Date: Sat Feb 17 19:28:01 2018 +0200 Improve documentation of 'electric-pair-mode' * lisp/elec-pair.el (electric-pair-mode): * doc/emacs/programs.texi (Matching): Document the operation of electric-pair-mode when there's an active region. (Bug#30502) diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index bafe5cc87b..b6bd173e4d 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi @@ -877,12 +877,17 @@ or the last, non-whitespace position on the line. @cindex inserting matching parentheses @findex electric-pair-mode Electric Pair mode, a global minor mode, provides a way to easily -insert matching delimiters. Whenever you insert an opening delimiter, -the matching closing delimiter is automatically inserted as well, -leaving point between the two. Conversely, when you insert a closing -delimiter over an existing one, no inserting takes places and that -position is simply skipped over. These variables control additional -features of Electric Pair mode: +insert matching delimiters: parentheses, braces, brackets, etc. +Whenever you insert an opening delimiter, the matching closing +delimiter is automatically inserted as well, leaving point between the +two. Conversely, when you insert a closing delimiter over an existing +one, no insertion takes places, and that position is simply skipped +over. If the region is active (@pxref{Mark}), insertion of a +delimiter operates on the region: the characters in the region are +enclosed in a pair of matching delimiters, leaving point after the +delimiter you typed. + +These variables control additional features of Electric Pair mode: @itemize @bullet @item diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el index af9a44c844..97049a7d9d 100644 --- a/lisp/elec-pair.el +++ b/lisp/elec-pair.el @@ -580,8 +580,11 @@ the mode if ARG is omitted or nil. Electric Pair mode is a global minor mode. When enabled, typing an open parenthesis automatically inserts the corresponding -closing parenthesis. (Likewise for brackets, etc.). To toggle -the mode in a single buffer, use `electric-pair-local-mode'." +closing parenthesis, and vice versa. (Likewise for brackets, etc.). +If the region is active, the parentheses (brackets, etc.) are +inserted around the region instead. + +To toggle the mode in a single buffer, use `electric-pair-local-mode'." :global t :group 'electricity (if electric-pair-mode (progn commit f74ab96483166fdc32a047eebc98916dd5981eb4 Author: Paul Eggert Date: Sat Feb 17 09:16:44 2018 -0800 ; Spelling and grammar fixes. diff --git a/ChangeLog.2 b/ChangeLog.2 index 22c7e0116b..eab9e3d018 100644 --- a/ChangeLog.2 +++ b/ChangeLog.2 @@ -26364,7 +26364,7 @@ (verilog-calc-1): Detect 'pure virtual method' declarations which exist in abstract classes. Reported by Enzo Chi and Kaushal Modi. (verilog-backward-ws&directives): When moving back to the start of - a line and the preceeding line ended with an escaped-newline, then + a line and the preceding line ended with an escaped-newline, then jump up one line. This properly consumes a multi-line pre-processor directive. Reported by Kaushal Modi. (verilog-dpi-import-export-re, verilog-extended-complete-re) diff --git a/ChangeLog.3 b/ChangeLog.3 index 1c630f7fd2..f68ba58cac 100644 --- a/ChangeLog.3 +++ b/ChangeLog.3 @@ -9905,7 +9905,7 @@ * lisp/man.el (Man-see-also-regexp): Add support for SEE ALSO section detection in several langages: French, German, Spanish, - Portugese, Italian, Polish, Turkish, Japanese, Chinese. (Bug#28142) + Portuguese, Italian, Polish, Turkish, Japanese, Chinese. (Bug#28142) 2017-08-26 Paul Eggert diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 709e9836c9..bf85b00e93 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -3124,12 +3124,11 @@ machines, but will fail if the machine's arithmetic is extremely unusual, e.g., decimal. @end defun -Since true Common Lisp supports up to four different floating-point -precisions, it has families of constants like +Since true Common Lisp supports up to four different kinds of floating-point +numbers, it has families of constants like @code{most-positive-single-float}, @code{most-positive-double-float}, @code{most-positive-long-float}, and so on. Emacs has only one -floating-point precision, so this package omits the precision word -from the constants' names. +kind of floating-point number, so this package just uses single constants. @defvar cl-most-positive-float This constant equals the largest value a Lisp float can hold. diff --git a/lisp/ChangeLog.6 b/lisp/ChangeLog.6 index 3a6d60dfbc..0d0df58f58 100644 --- a/lisp/ChangeLog.6 +++ b/lisp/ChangeLog.6 @@ -3506,7 +3506,7 @@ (sgml-beginning-of-tag, sgml-value): New functions. (html-*): All these functions and variables are new. - Mostly they parametrize everything preceding. + Mostly they parameterize everything preceding. * autoinsert.el (auto-insert-alist): For html-mode, use `sgml-tag'. diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 62e6dd2084..c90509d131 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1399,7 +1399,7 @@ (setq offset (- offset #x80))) ((eq bytedecomp-op 'byte-switch) (cl-assert (hash-table-p last-constant) nil - "byte-switch used without preceeding hash table") + "byte-switch used without preceding hash table") ;; We cannot use the original hash table referenced in the op, ;; so we create a copy of it, and replace the addresses with ;; TAGs. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index e039020d36..317968aafd 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -2576,7 +2576,7 @@ comment at the start of cc-engine.el for more info." ;; or the car of the list is the "position element" of ELT, the position ;; where ELT is valid. ;; - ;; POINT is left at the postition for which the returned state is valid. It + ;; POINT is left at the position for which the returned state is valid. It ;; will be either the position element of ELT, or one character before ;; that. (The latter happens in Emacs <= 25 and XEmacs, when ELT indicates ;; its position element directly follows a potential first character of a @@ -2647,7 +2647,7 @@ comment at the start of cc-engine.el for more info." ((nth 3 state) ; A string (list (point) (nth 3 state) (nth 8 state))) ((and (nth 4 state) ; A comment - (not (eq (nth 7 state) 'syntax-table))) ; but not a psuedo comment. + (not (eq (nth 7 state) 'syntax-table))) ; but not a pseudo comment. (list (point) (if (eq (nth 7 state) 1) 'c++ 'c) (nth 8 state))) commit 42f9dc4473d91654c9641da6d0c0fcba026d6db4 Author: Eli Zaretskii Date: Sat Feb 17 18:12:23 2018 +0200 ; * lisp/textmodes/flyspell.el (flyspell-auto-correct-word): Fix a typo. diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 5568bbb1d9..d7f0b0a7c1 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -2000,7 +2000,7 @@ that position." (let ((new-word replace)) (if (not (equal new-word (car poss))) (progn - ;; the save the current replacements + ;; then save the current replacements (setq flyspell-auto-correct-region (cons start (length new-word))) (let ((l replacements))