commit ebaf39e3f2c8e7bfc01746adec9ffbe945efca23 (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Sat Nov 5 10:21:23 2016 +0200 Enlarge DUMPED_HEAP_SIZE * src/w32heap.c (DUMPED_HEAP_SIZE) [_WIN64 || WIDE_EMACS_INT]: Enlarge to 21MB. Reported by Richard Copley . diff --git a/src/w32heap.c b/src/w32heap.c index 443472b..43b5f35 100644 --- a/src/w32heap.c +++ b/src/w32heap.c @@ -114,7 +114,7 @@ typedef struct _RTL_HEAP_PARAMETERS { to build only the first bootstrap-emacs.exe with the large size, and reset that to a lower value afterwards. */ #if defined _WIN64 || defined WIDE_EMACS_INT -# define DUMPED_HEAP_SIZE (20*1024*1024) +# define DUMPED_HEAP_SIZE (21*1024*1024) #else # define DUMPED_HEAP_SIZE (12*1024*1024) #endif commit 44c34c2ed30007fbcb4d33f3c2b390cc17a5b520 Author: Paul Eggert Date: Fri Nov 4 15:12:09 2016 -0700 Update from gnulib This incorporates: 2016-11-03 intprops: port to older XL C * lib/intprops.h: Copy from gnulib. diff --git a/lib/intprops.h b/lib/intprops.h index f057105..8add5de 100644 --- a/lib/intprops.h +++ b/lib/intprops.h @@ -105,7 +105,8 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH); /* Does the __typeof__ keyword work? This could be done by 'configure', but for now it's easier to do it by hand. */ -#if (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ +#if (2 <= __GNUC__ \ + || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \ || (0x5110 <= __SUNPRO_C && !__STDC__)) # define _GL_HAVE___TYPEOF__ 1 #else commit a59f4bb5b8f1e702901d166ce44c4dcddc262b62 Author: Paul Eggert Date: Fri Nov 4 15:07:01 2016 -0700 ; Spelling fixes diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index d8a2bea..0e09cf7 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -2459,7 +2459,7 @@ local @file{.emacs} file: Setting the @env{ENV} environment variable instructs some shells to read an initialization file. Per default, @value{tramp} has disabled -this. You could overwrite this behaviour by evaluating +this. You could overwrite this behavior by evaluating @lisp @group diff --git a/etc/NEWS b/etc/NEWS index f34ee2d..4bf5332 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -87,7 +87,7 @@ the output buffer is not erased; this variable also controls where to set the point in the output buffer: beginning of the output, end of the buffer or save the point. When 'shell-command-dont-erase-buffer' is nil, the default value, -the behaviour of 'shell-command', 'shell-command-on-region' and +the behavior of 'shell-command', 'shell-command-on-region' and 'async-shell-command' is as usual. +++ @@ -234,7 +234,7 @@ all call stack frames in a Lisp backtrace buffer as lists. Both debug.el and edebug.el have been updated to heed to this variable. +++ -** The new variable `x-ctrl-keysym` has been added to the existing +** The new variable 'x-ctrl-keysym' has been added to the existing roster of X keysyms. It can be used in combination with another variable of this kind to swap modifiers in Emacs. @@ -372,7 +372,7 @@ also available in 'image-mode'. +++ *** A new library for creating and manipulating SVG images has been -added. See the "SVG Images" section in the lispref manual for +added. See the "SVG Images" section in the Lisp reference manual for details. +++ @@ -543,9 +543,10 @@ function 'check-declare-errmsg' has been removed. ** New function 'undo-amalgamate-change-group' to get rid of undo-boundaries between two states. -** New var 'definition-prefixes' is a hashtable mapping prefixes to the -files where corresponding definitions can be found. This can be used -to fetch definitions that are not yet loaded, for example for 'C-h f'. +** New var 'definition-prefixes' is a hash table mapping prefixes to +the files where corresponding definitions can be found. This can be +used to fetch definitions that are not yet loaded, for example for +'C-h f'. ** New var 'syntax-ppss-table' to control the syntax-table used in 'syntax-ppss'. diff --git a/lisp/registry.el b/lisp/registry.el index e8bc6f5..3aaa8e8 100644 --- a/lisp/registry.el +++ b/lisp/registry.el @@ -35,11 +35,11 @@ ;; tracked: a list of symbols -;; tracker: a hashtable tuned for 100 symbols to track (you should +;; tracker: a hash table tuned for 100 symbols to track (you should ;; only access this with the :lookup2-function and the ;; :lookup2+-function) -;; data: a hashtable with default size 10K and resize threshold 2.0 +;; data: a hash table with default size 10K and resize threshold 2.0 ;; (this reflects the expected usage so override it if you know better) ;; ...plus methods to do all the work: `registry-search', @@ -124,10 +124,10 @@ :documentation "The precious fields, a list of symbols.") (tracker :initarg :tracker :type hash-table - :documentation "The field tracking hashtable.") + :documentation "The field tracking hash table.") (data :initarg :data :type hash-table - :documentation "The data hashtable."))) + :documentation "The data hash table."))) (cl-defmethod initialize-instance :before ((this registry-db) slots) "Check whether a registry object needs to be upgraded." @@ -178,7 +178,7 @@ Returns an alist of the key followed by the entry in a list, not a cons cell." (cl-defmethod registry-lookup-secondary ((db registry-db) tracksym &optional create) "Search for TRACKSYM in the registry-db THIS. -When CREATE is not nil, create the secondary index hashtable if needed." +When CREATE is not nil, create the secondary index hash table if needed." (let ((h (gethash tracksym (oref db tracker)))) (if h h diff --git a/test/lisp/thingatpt-tests.el b/test/lisp/thingatpt-tests.el index 9d72db4..6d73d90 100644 --- a/test/lisp/thingatpt-tests.el +++ b/test/lisp/thingatpt-tests.el @@ -84,7 +84,7 @@ position to retrieve THING.") (goto-char (nth 1 test)) (should (equal (thing-at-point (nth 2 test)) (nth 3 test)))))) -;; These tests reflect the actual behaviour of +;; These tests reflect the actual behavior of ;; `thing-at-point-bounds-of-list-at-point'. (ert-deftest thing-at-point-bug24627 () "Test for http://debbugs.gnu.org/24627 ." commit ae0a1a890ec7b885e85cd945a21ca42fed80df3d Merge: 66b5222 acae275 Author: Paul Eggert Date: Fri Nov 4 15:02:03 2016 -0700 Merge from origin/emacs-25 acae275 ; Spelling fixes d8fac73 Update README for precompiled windows Emacs. 23570fd Clarify documentation of 'vc-responsible-backend' wrt symlinks f708cb2 Clarify doc string of 'transpose-sexps' cd05b1d Fix docstring of 'browse-url-firefox-new-window-is-tab' bdc89eb Improve documentation of 'font-lock-remove-keywords' 4a0c590 Fix documentation of the command summary key 0221b7a Mark relocation workarounds with REL_ALLOC commit 66b5222c3cd72839bf72e0b2a03912719c930451 Merge: 6a20bd3 5043e0a Author: Paul Eggert Date: Fri Nov 4 15:02:03 2016 -0700 ; Merge from origin/emacs-25 The following commits were skipped: 5043e0a Fix documentation for 'eudc-options-file' 26038aa Fix documentation of 'eudc-inline-expansion-format' commit 6a20bd3579ef87103d5ea37e6b8193dc6385e547 Merge: 2955936 dbb3410 Author: Paul Eggert Date: Fri Nov 4 15:01:17 2016 -0700 Merge from origin/emacs-25 dbb3410 python.el: Fix detection of native completion in Python 3 (bu... 91c97b6 * Makefile.in (install-arch-indep): Skip etc/refcards/emacsve... 9c1cb8d * lisp/subr.el (set-transient-map): Exit for unbound events (... 9c247d2 Update category-table for Chinese characters 43986d1 Inhibit buffer relocation during regex searches fee4cef Revert fixes to allocation of regex matching commit acae275b2752357497a2411876b83240ce7c8aec Author: Paul Eggert Date: Fri Nov 4 14:50:09 2016 -0700 ; Spelling fixes diff --git a/ChangeLog.2 b/ChangeLog.2 index 79f44fd..42ea75f 100644 --- a/ChangeLog.2 +++ b/ChangeLog.2 @@ -15098,7 +15098,7 @@ * lisp/files.el: Don't allow customization of dir-locals sorting. In retrospect, this is not a good idea for the same reason that `dir-locals-file' is a defconst, because it is important that this - behaviour be "uniform across different environments and users". + behavior be "uniform across different environments and users". Sure, the user can still change the sorting with a hack, but we shouldn't encourage them to change it. (dir-locals--all-files): Return list in the order returned by diff --git a/doc/misc/ChangeLog.1 b/doc/misc/ChangeLog.1 index eb16d4a..93aacb5 100644 --- a/doc/misc/ChangeLog.1 +++ b/doc/misc/ChangeLog.1 @@ -5331,7 +5331,7 @@ 2010-07-09 Michael Albinus - * dbus.texi (Top): Introduce Index. Emphasize "nil" whereever + * dbus.texi (Top): Introduce Index. Emphasize "nil" wherever forgotten. (Type Conversion): Precise conversion of natural numbers. (Errors and Events): Add "debugging" to concept index. Add variable diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index 13827c6..69b8468 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -1077,7 +1077,7 @@ major changes for implementers, and module writers: corresponding hook variables. The mapping of server commands to hook variables is no longer - done via `erc-event-to-hook', but through an #'equal hashtable, + done via `erc-event-to-hook', but through an #'equal hash table, `erc-server-responses'. In order to find a hook you do: (erc-get-hook command) diff --git a/etc/NEWS.23 b/etc/NEWS.23 index d92bf23..f74141d 100644 --- a/etc/NEWS.23 +++ b/etc/NEWS.23 @@ -551,7 +551,7 @@ System (CLOS). It is used by the other CEDET packages. ** js.el is a new major mode for JavaScript files. -** imap-hash.el is a new library to address IMAP mailboxes as hashtables. +** imap-hash.el is a new library to address IMAP mailboxes as hash tables. * Incompatible Lisp Changes in Emacs 23.2 diff --git a/etc/TODO b/etc/TODO index fe0e2ac..48c1654 100644 --- a/etc/TODO +++ b/etc/TODO @@ -38,7 +38,7 @@ stay within exec_byte_code. ** Add new 'switch' byte-code This byte-code would take one argument from the stack (the object to test) and one argument from the constant-pool (a switch table, implemented as an -eq-hashtable) and would jump to the "label" contained in the hashtable. +'eq' hash table) and would jump to the "label" contained in the hash table. Then add a 'case' special-form that can be compiled to this byte-code. This would behave just like cl-case, but instead of expanding to cond+eq it diff --git a/lisp/cedet/ede/locate.el b/lisp/cedet/ede/locate.el index 38d2388..8564719 100644 --- a/lisp/cedet/ede/locate.el +++ b/lisp/cedet/ede/locate.el @@ -124,12 +124,12 @@ based on `ede-locate-setup-options'." t) (cl-defmethod ede-locate-flush-hash ((loc ede-locate-base)) - "For LOC, flush hashtable and start from scratch." + "For LOC, flush hash table and start from scratch." (oset loc hash (make-hash-table :test 'equal))) (cl-defmethod ede-locate-file-in-hash ((loc ede-locate-base) filestring) - "For LOC, is the file FILESTRING in our hashtable?" + "For LOC, is the file FILESTRING in our hash table?" (gethash filestring (oref loc hash))) (cl-defmethod ede-locate-add-file-to-hash ((loc ede-locate-base) diff --git a/lisp/cedet/semantic/db-typecache.el b/lisp/cedet/semantic/db-typecache.el index 366af60..76382a3 100644 --- a/lisp/cedet/semantic/db-typecache.el +++ b/lisp/cedet/semantic/db-typecache.el @@ -56,7 +56,7 @@ (stream :initform nil :documentation "The searchable tag stream for this cache. -NOTE: Can I get rid of this? Use a hashtable instead?") +NOTE: Can I get rid of this? Use a hash table instead?") (dependants :initform nil :documentation "Any other object that is dependent on typecache results. diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el index 223c2a6..5454dfc 100644 --- a/lisp/emacs-lisp/eieio-core.el +++ b/lisp/emacs-lisp/eieio-core.el @@ -459,7 +459,7 @@ See `defclass' for more information." (cl--slot-descriptor-initform (aref slots i))))) (setf (eieio--class-class-allocation-values newc) v)) - ;; Attach slot symbols into a hashtable, and store the index of + ;; Attach slot symbols into a hash table, and store the index of ;; this slot as the value this table. (let* ((slots (eieio--class-slots newc)) ;; (cslots (eieio--class-class-slots newc)) diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el index 6bda15b..f408ff7 100644 --- a/lisp/emulation/edt.el +++ b/lisp/emulation/edt.el @@ -497,7 +497,7 @@ Argument NUM is the number of EOL marks to move." ;;; of line, etc.) it takes a bit of special handling. ;;; ;;; The variable edt-word-entities contains a list of characters which -;;; are to be viewed as distinct words where ever they appear in the +;;; are to be viewed as distinct words wherever they appear in the ;;; buffer. This emulates the EDT line mode command SET ENTITY WORD. diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 6d508e2..012b5b5 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -108,7 +108,7 @@ ;;;; Variables and options (defvar erc-server-responses (make-hash-table :test #'equal) - "Hashtable mapping server responses to their handler hooks.") + "Hash table mapping server responses to their handler hooks.") (cl-defstruct (erc-response (:conc-name erc-response.)) (unparsed "" :type string) @@ -1064,7 +1064,7 @@ See also `erc-server-responses'." (defun erc-call-hooks (process message) "Call hooks associated with MESSAGE in PROCESS. -Finds hooks by looking in the `erc-server-responses' hashtable." +Finds hooks by looking in the `erc-server-responses' hash table." (let ((hook (or (erc-get-hook (erc-response.command message)) 'erc-default-server-functions))) (run-hook-with-args-until-success hook process message) @@ -1220,7 +1220,7 @@ add things to `%s' instead." (put ',fn-name 'definition-name ',name) (put ',hook-name 'definition-name ',name) - ;; Hashtable map of responses to hook variables + ;; Hash table map of responses to hook variables ,@(cl-loop for response in (cons name aliases) for var in (cons hook-name var-alternates) collect `(puthash ,(format "%s" response) ',var diff --git a/lisp/international/ucs-normalize.el b/lisp/international/ucs-normalize.el index 74978ce..1e247c5 100644 --- a/lisp/international/ucs-normalize.el +++ b/lisp/international/ucs-normalize.el @@ -227,7 +227,7 @@ table)) (defvar ucs-normalize-decomposition-pair-to-primary-composite nil - "Hashtable of decomposed pair to primary composite. + "Hash table of decomposed pair to primary composite. Note that Hangul are excluded.") (setq ucs-normalize-decomposition-pair-to-primary-composite (ucs-normalize-make-hash-table-from-alist diff --git a/lisp/isearch.el b/lisp/isearch.el index 0181951..ff77930 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -562,7 +562,7 @@ The symbol property `isearch-message-prefix' put on this function specifies the prefix string displayed in the search message. This variable is set and changed during isearch. To change the -default behaviour used for searches, see `search-default-mode' +default behavior used for searches, see `search-default-mode' instead.") ;; We still support setting this to t for backwards compatibility. (define-obsolete-variable-alias 'isearch-word diff --git a/lisp/language/ind-util.el b/lisp/language/ind-util.el index deea489..f7424ec 100644 --- a/lisp/language/ind-util.el +++ b/lisp/language/ind-util.el @@ -39,7 +39,7 @@ (eval-and-compile (defun indian-regexp-of-hashtbl-keys (hashtbl) - "Returns the regular expression of hashtable keys." + "Return the regular expression of hash table keys." (let (keys) (maphash (lambda (key val) (push key keys)) hashtbl) (regexp-opt keys))) diff --git a/lisp/mh-e/mh-search.el b/lisp/mh-e/mh-search.el index 6e60744..d5a2d77 100644 --- a/lisp/mh-e/mh-search.el +++ b/lisp/mh-e/mh-search.el @@ -1859,7 +1859,7 @@ PROC is used to convert the value to actual data." (defun mh-index-update-maps (folder &optional origin-map) "Annotate all as yet unannotated messages in FOLDER with their MD5 hash. As a side effect msg -> checksum map is updated. Optional -argument ORIGIN-MAP is a hashtable which maps each message in the +argument ORIGIN-MAP is a hash table which maps each message in the index folder to the original folder and message from whence it was copied. If present the checksum -> (origin-folder, origin-index) map is updated too." @@ -1913,7 +1913,7 @@ origin-index) map is updated too." (defun mh-index-update-single-msg (msg checksum origin-map) "Update various maps for one message. MSG is a index folder message, CHECKSUM its MD5 hash and -ORIGIN-MAP, if non-nil, a hashtable containing which maps each +ORIGIN-MAP, if non-nil, a hash table containing which maps each message in the index folder to the folder and message that it was copied from. The function updates the hash tables `mh-index-msg-checksum-map' and `mh-index-checksum-origin-map'. diff --git a/lisp/mh-e/mh-thread.el b/lisp/mh-e/mh-thread.el index e6acdba..2a37cfc 100644 --- a/lisp/mh-e/mh-thread.el +++ b/lisp/mh-e/mh-thread.el @@ -89,11 +89,11 @@ (real-child-p t)) (defvar mh-thread-id-hash nil - "Hashtable used to canonicalize message identifiers.") + "Hash table used to canonicalize message identifiers.") (make-variable-buffer-local 'mh-thread-id-hash) (defvar mh-thread-subject-hash nil - "Hashtable used to canonicalize subject strings.") + "Hash table used to canonicalize subject strings.") (make-variable-buffer-local 'mh-thread-subject-hash) (defvar mh-thread-id-table nil @@ -109,11 +109,11 @@ (make-variable-buffer-local 'mh-thread-id-index-map) (defvar mh-thread-subject-container-hash nil - "Hashtable used to group messages by subject.") + "Hash table used to group messages by subject.") (make-variable-buffer-local 'mh-thread-subject-container-hash) (defvar mh-thread-duplicates nil - "Hashtable used to associate messages with the same message identifier.") + "Hash table used to associate messages with the same message identifier.") (make-variable-buffer-local 'mh-thread-duplicates) (defvar mh-thread-history () diff --git a/lisp/subr.el b/lisp/subr.el index 07909b8..efea412 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -903,7 +903,7 @@ KEY is a string or vector representing a sequence of keystrokes." (defun substitute-key-definition (olddef newdef keymap &optional oldmap prefix) "Replace OLDDEF with NEWDEF for any keys in KEYMAP now defined as OLDDEF. -In other words, OLDDEF is replaced with NEWDEF where ever it appears. +In other words, OLDDEF is replaced with NEWDEF wherever it appears. Alternatively, if optional fourth argument OLDMAP is specified, we redefine in KEYMAP as NEWDEF those keys which are defined as OLDDEF in OLDMAP. diff --git a/nt/README.W32 b/nt/README.W32 index 4149c3b..d866d9f 100644 --- a/nt/README.W32 +++ b/nt/README.W32 @@ -50,7 +50,7 @@ See the end of the file for license conditions. page. Emacs is completely portable. You can create your own shortcut to - runemacs.exe and place this where ever you find it convienient, or + runemacs.exe and place this wherever you find it convenient, or run it from a USB or network drive without copying or installing anything on the machine itself. diff --git a/src/emacs.c b/src/emacs.c index 2480dfc..f8d5dfa 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1167,7 +1167,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem /* Called before syms_of_fileio, because it sets up Qerror_condition. */ syms_of_data (); - syms_of_fns (); /* Before syms_of_charset which uses hashtables. */ + syms_of_fns (); /* Before syms_of_charset which uses hash tables. */ syms_of_fileio (); /* Before syms_of_coding to initialize Vgc_cons_threshold. */ syms_of_alloc (); diff --git a/src/lread.c b/src/lread.c index 8a36880..0bc34b2 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2500,7 +2500,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) c = READCHAR; if (c == '(') { - /* Accept extended format for hashtables (extensible to + /* Accept extended format for hash tables (extensible to other types), e.g. #s(hash-table size 2 test equal data (k1 v1 k2 v2)) */ Lisp_Object tmp = read_list (0, readcharfun); @@ -2546,10 +2546,10 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) if (!NILP (params[param_count + 1])) param_count += 2; - /* This is the hashtable data. */ + /* This is the hash table data. */ data = Fplist_get (tmp, Qdata); - /* Now use params to make a new hashtable and fill it. */ + /* Now use params to make a new hash table and fill it. */ ht = Fmake_hash_table (param_count, params); while (CONSP (data)) @@ -2557,7 +2557,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) key = XCAR (data); data = XCDR (data); if (!CONSP (data)) - error ("Odd number of elements in hashtable data"); + error ("Odd number of elements in hash table data"); val = XCAR (data); data = XCDR (data); Fputhash (key, val, ht); commit d8fac734e563df1169e3d8d715cca3481dfec8ac Author: Phillip Lord Date: Fri Nov 4 20:50:55 2016 +0000 Update README for precompiled windows Emacs. * nt/README.W32: Describe 64 and 32-bit downloads, optional dependencies bundle. Remove old material on sourcing dependencies. Remove references to Windows 95. Update GUI references to recent Windows. Remove references to Usenet. diff --git a/nt/README.W32 b/nt/README.W32 index 5bd8796..4149c3b 100644 --- a/nt/README.W32 +++ b/nt/README.W32 @@ -3,24 +3,30 @@ See the end of the file for license conditions. Emacs for Windows - This README.W32 file describes how to set up and run a precompiled + This README file describes how to set up and run a precompiled distribution of GNU Emacs for Windows. You can find the precompiled distribution on the ftp.gnu.org server and its mirrors: - ftp://ftp.gnu.org/gnu/emacs/windows/ + ftp://ftp.gnu.org/gnu/emacs/windows/ This server contains other distributions, including the full Emacs source distribution, as well as older releases of Emacs for Windows. Information on how to compile Emacs from sources on Windows is in the files README and INSTALL in the nt/ sub-directory of the - top-level Emacs directory in the source distribution. If you - received this file as part of the Emacs source distribution, and are - looking for information on how to build Emacs on MS-Windows, please - read those 2 files and not this one. + top-level Emacs directory in the source distribution, as is this + file as README.precompiled. If you received this file as part of + the Emacs source distribution, and are looking for information on + how to build Emacs on MS-Windows, please read those 2 files and not + this one. * Preliminaries + There are two binary distributions named + emacs-n-x86_64-w64-mingw32.zip and + emacs-n-i686-w64-mingw32.zip. These are for 64-bit and 32-bit + machines respectively. + The binary distribution has these top-level directories: + bin + libexec @@ -30,33 +36,24 @@ See the end of the file for license conditions. * Setting up Emacs To install Emacs, simply unpack the binary package into a directory - of your choice. To complete the installation process, you can - optionally run the program addpm.exe in the bin subdirectory. This - will put an icon for Emacs in the Start Menu under - "Start -> Programs -> Gnu Emacs". - - Some users have reported that the Start Menu item is not created for - them. If this happens, just create your own shortcut to runemacs.exe, - eg. by dragging it on to the desktop or the Start button. - - Note that running addpm is now an optional step; Emacs is able to - locate all of its files without needing any information to be set in - the environment or the registry, although such settings will still - be obeyed if present. This is convenient for running Emacs on a - machine which disallows registry changes, or on which software - should not be installed. For instance, you can now run Emacs - directly from a CD or USB flash drive without copying or installing + of your choice. If you use File Explorer and "Extract" by default + this will be in a top-level directory with the same name as the zip + file. + + We also provide a set of optional dependencies, in + emacs-25-x86_64-deps.zip or emacs-25-i686-deps.zip respectively, + which provide Emacs with an number of additional capabilities. To + add these, unpack them directly over the emacs directory structure. + + Finally, and also optionally, you can run the program addpm.exe in + the bin subdirectory which will place an icon for Emacs on the start + page. + + Emacs is completely portable. You can create your own shortcut to + runemacs.exe and place this where ever you find it convienient, or + run it from a USB or network drive without copying or installing anything on the machine itself. -* Prerequisites for Windows 9X - - To run Emacs on Windows 9X (Windows 95/98/Me), you will need to have - the Microsoft Layer for Unicode (MSLU) installed. It can be - downloaded from the Microsoft site, and comes in a form of a single - dynamic library called UNICOWS.DLL. If this library is not - accessible to Emacs, it will pop up a dialog saying that it cannot - find the library, and will refuse to start up. - * Starting Emacs To run Emacs, simply select Emacs from the Start Menu, or invoke @@ -93,8 +90,7 @@ See the end of the file for license conditions. + emacsclientw.exe - A version of emacsclient that does not open a command-line window. - + addpm.exe - A basic installer that creates Start Menu icons for Emacs. - Running this is optional. + + addpm.exe - The installer that adds Emacs to "Start". + ctags.exe, etags.exe - Tools for generating tag files. See the `Tags' node of the Emacs manual. @@ -128,128 +124,26 @@ See the end of the file for license conditions. + update-game-score.exe - A utility for updating the score files of Emacs games. -* Image support +* Optional Dependencies Emacs has built in support for XBM and PPM/PGM/PBM images, and the libXpm library is bundled, providing XPM support (required for color - toolbar icons and splash screen). Source for libXpm should be available - from the same place from which you got this binary distribution. - - Emacs can also support some other image formats with appropriate - libraries. These libraries are all available on the following sites: - - 1. http://sourceforge.net/projects/ezwinports/files/ - -- up-to-date builds, self-contained archives, only for 32-bit Emacs - 2. Libraries from the MSYS2 project on ftp.gnu.org: - http://ftp.gnu.org/gnu/emacs/windows/emacs-NN-i686-deps.zip (32-bit) - http://ftp.gnu.org/gnu/emacs/windows/emacs-NN-x86_64-deps.zip (64-bit) - where NN is the Emacs version to which the libraries correspond. - 3. The MSYS2 project -- for 64-bit Emacs: - http://msys2.github.io/ - https://sourceforge.net/projects/msys2/files/REPOS/MINGW/x86_64/ - 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 - site; please consult the download instructions on each site for the - details. In general, the ezwinports site mentioned above has all - the dependencies bundled in the same zip archive, so installing from - there is the easiest. For MSYS2 builds, we recommend that you - install and use the 'pacman' utility (available from the MSYS2 - site), see the instructions below -- it will automatically install - all the dependencies. - - Emacs will find these libraries if the directory they are installed - in is on the PATH or in the same directory where you have emacs.exe. - Here are some specific comments about each image type: - - PNG: requires the PNG reference library 1.4 or later, which will - be named libpngNN.dll or libpngNN-NN.dll. LibPNG requires zlib, - which should come from the same source as you got libpng. - Starting with Emacs 23.3, the precompiled Emacs binaries are - built with libpng 1.4.x and later, and are incompatible with - earlier versions of libpng DLLs. So if you have libpng 1.2.x, - the PNG support will not work, and you will have to download - newer versions. - - JPEG: requires the Independent JPEG Group's libjpeg 6b or later, - which will be called jpeg62.dll, libjpeg.dll, jpeg-62.dll or jpeg.dll. - - TIFF: requires libTIFF 3.0 or later, which will be called libtiffN.dll - or libtiff-N.dll or libtiff.dll. - - GIF: requires libungif or giflib 4.1 or later, which will be - called libgif-6.dll, giflib4.dll, libungif4.dll or libungif.dll. - - SVG: requires librsvg 2.x whose DLL will be called - librsvg-2-2.dll. SVG also requires several dependency DLLs, - such as Pango, Cairo, and Glib, all of them found on the - above-mentioned sites. If you download from the ezwinports - site, you need only librsvg-2.nn.mm-x-w32-bin.zip, it comes with - all the other dependencies bundled. - - If you have image support DLLs under different names, customize the - value of `dynamic-library-alist'. - -* GnuTLS support - - GnuTLS provides SSL/TLS network support for Emacs (https, imaps and - so on.) - - In order to support GnuTLS at runtime, Emacs must be able to find - the relevant DLLs during startup; failure to do so is not an error, - 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/ and on - http://ftp.gnu.org/gnu/emacs/windows/ - -* libxml2 support - - libxml2 provides HTML parsing support for Emacs, which is necessary - to use the built-in eww browser. - - In order to support libxml2 at runtime, a libxml2-enabled Emacs must - be able to find the relevant DLLs during startup; failure to do so - is not an error, but libxml2 features won't be available to the - running session. - - You can get pre-built binaries (including any required DLL and the - header files) at http://sourceforge.net/projects/ezwinports/files/ and - http://ftp.gnu.org/gnu/emacs/windows/ - -* zlib support - - zlib provides support for decompressing text, which is necessary for - the zlib-decompress-region primitive. + toolbar icons and splash screen). Source for libXpm should be + available from the same place from which you got this binary + distribution. - Prebuilt binaries of zlib DLL (for 32-bit builds of Emacs) are - available from the ezwinports site and on ftp.gnu.org; see above for - the URLs. For the 64-bit DLL, see the instructions below for - installing from MSYS2 site. + In addition, as described, there is a separate dependency bundle + providing support for many images formats, TLS, XML parsing and + compression. - (This library is also a prerequisite for several image libraries, so - you may already have it; look for zlib1.dll or libz-1.dll.) +* Installing with an existing MSYS2 installation. -* Installing 64-bit optional libraries from the MSYS2 site - - We recommend that you use the 'pacman' utility to download the - libraries you need and all of their dependencies. If you don't have - 'pacman' installed, proceed as follows: - - . Install the MSYS2 64-bit (x86_64) installer, named - msys2-x86_64-YYYYMMDD.exe (where "YYYYMMDD" is the release date, - like 20160205) from http://msys2.github.io/. - - . Run the installer, select the installation directory, make sure - "Run MSYS2 now" checkbox is checked, and click "Finish". A Bash - window will open. - - . Type into the Bash window the following command: - - pacman -Sy pacman - - When asked whether to proceed with installation, type Y. + You may also use Emacs with an existing MSYS2 installation by simply + unpacking the Emacs distribution over MSYS2. You can then use the + 'pacman' utility to install dependencies. You should not use the + optional dependencies bundle, as this will overwrite MSYS2 files + (the dependency bundle derives from MSYS2, but may be a different + version). To install the optional libraries, start the MSYS2 Bash window and type the following command: @@ -259,72 +153,36 @@ See the end of the file for license conditions. where PACKAGES is the list of packages you want to install. The full list is as follows: - mingw-w64-x86_64-xpm-nox mingw-w64-x86_64-libtiff mingw-w64-x86_64-giflib - mingw-w64-x86_64-libpng mingw-w64-x86_64-libjpeg-turbo - mingw-w64-x86_64-librsvg mingw-w64-x86_64-libxml2 mingw-w64-x86_64-gnutls - mingw-w64-x86_64-zlib + mingw-w64-x86_64-giflib + mingw-w64-x86_64-gnutls + mingw-w64-x86_64-libjpeg-turbo + mingw-w64-x86_64-libpng + mingw-w64-x86_64-librsvg + mingw-w64-x86_64-libtiff + mingw-w64-x86_64-libxml2 + mingw-w64-x86_64-xpm-nox You can type any subset of this list. Once again, when asked whether to proceed with installation, answer Y. - Alternatively, you could install the packages manually from this - page: - - https://sourceforge.net/projects/msys2/files/REPOS/MINGW/x86_64/ - - However, the packages there are not self-contained, so you will need - to download all their dependencies as well. - - After the installation, if you will be installing Emacs in a - directory different from where the DLLs were installed, we recommend - to add the directory with DLLs to your PATH, so that Emacs will be - able to find those DLLs. - * Uninstalling Emacs If you should need to uninstall Emacs, simply delete all the files and subdirectories from the directory where it was unpacked (Emacs does not install or update any files in system directories or - anywhere else). If you ran the addpm.exe program to create the - registry entries and the Start menu icon, then you can remove the - registry entries using regedit. All of the settings are written - under the Software\GNU\Emacs key in HKEY_LOCAL_MACHINE, or if you - didn't have administrator privileges when you installed, the same - key in HKEY_CURRENT_USER. Just delete the whole Software\GNU\Emacs - key. - - The Start menu entry can be removed by right-clicking on the Taskbar - and selecting Properties, then using the Remove option on the Start - Menu Programs page. (If you installed under an account with - administrator privileges, then you need to click the Advanced button - and look for the Gnu Emacs menu item under All Users.) + anywhere else). -* Troubleshooting - - Unpacking the distributions - - If you encounter trouble trying to run Emacs, there are a number of - possible causes. Check the following for indications that the - distribution was not corrupted by the tools used to unpack it: - - * Be sure to disable CR/LF translation or the executables will - be unusable. Older versions of WinZipNT would enable this - translation by default. If you are using WinZipNT, disable it. - (I don't have WinZipNT myself, and I do not know the specific - commands necessary to disable it.) - - * Check that filenames were not truncated to 8.3. For example, - there should be a file lisp\abbrevlist.elc; if this has been - truncated to abbrevli.elc, your distribution has been corrupted - while unpacking and Emacs will not start. + If you ran the addpm.exe program to create the Start menu icon, this + can be removed by right-clicking and "Uninstall". - * On Windows 9X, make sure you have the UNICOWS.DLL library either - in the same directory where you have emacs.exe or in the - directory where system-wide DLLs are kept. + Finally, addpm.exe also creates a few registry entries; these can be + safely left, but if you really wish to remove them, all of the + settings are written under the Software\GNU\Emacs key in + HKEY_LOCAL_MACHINE, or if you didn't have administrator privileges + when you installed, the same key in HKEY_CURRENT_USER. Just delete + the whole Software\GNU\Emacs key. - If you believe you have unpacked the distributions correctly and are - still encountering problems, see the section on Further Information - below. +* Troubleshooting Virus scanners @@ -345,31 +203,21 @@ See the end of the file for license conditions. http://www.gnu.org/software/emacs/manual/html_mono/emacs.html#Microsoft-Windows - In addition to the manual, there is a mailing list for discussing - issues related to the Windows port of Emacs. For information about - the list, see this Web page: + In addition to the manual, there is a mailing list for help with + Emacs here: - http://lists.gnu.org/mailman/listinfo/help-emacs-windows + https://lists.gnu.org/mailman/listinfo/help-gnu-emacs To ask questions on the mailing list, send email to - help-emacs-windows@gnu.org. (You don't need to subscribe for that.) - To subscribe to the list or unsubscribe from it, fill the form you - find at http://lists.gnu.org/mailman/listinfo/help-emacs-windows as - explained there. - - Another valuable source of information and help which should not be - overlooked is the various Usenet news groups dedicated to Emacs. - These are particularly good for help with general issues which aren't - specific to the Windows port of Emacs. The main news groups to use - for seeking help are: + help-gnu-emacs@gnu.org. - gnu.emacs.help - comp.emacs + And a more specific one for issues related to the Windows port of + Emacs. For information about the list, see this Web page: - There are also fairly regular postings and announcements of new or - updated Emacs packages on this group: + http://lists.gnu.org/mailman/listinfo/help-emacs-windows - gnu.emacs.sources + To ask questions on the mailing list, send email to + help-emacs-windows@gnu.org. * Reporting bugs commit 29559361f56c9398dcb69db7396dcfc0887843a2 Author: Mark Oteiza Date: Fri Nov 4 14:22:05 2016 -0400 ; Restore nixed comments diff --git a/lisp/auth-source.el b/lisp/auth-source.el index 13836aa..c59ebf4 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -812,7 +812,9 @@ Returns the deleted entries." "Forget all cached auth-source data." (interactive) (cl-do-symbols (sym password-data) + ;; when the symbol name starts with auth-source-magic (when (string-match (concat "^" auth-source-magic) (symbol-name sym)) + ;; remove that key (password-cache-remove (symbol-name sym)))) (setq auth-source-netrc-cache nil)) commit 2c6920a3650b07f597ceb22c883710f464a41d94 Author: Mark Oteiza Date: Fri Nov 4 12:45:51 2016 -0400 Fix references to long obsoleted functions/aliases * doc/lispintro/emacs-list-intro.texi (Miscellaneous): * doc/misc/cl.texi (Conditionals): * doc/misc/speedbar.texi (Major Display Modes): Use string-to-number, not string-to-int. * lisp/emulation/viper.el (viper-go-away): Use major-mode, not default-major-mode. * lisp/textmodes/reftex-toc.el (reftex-toc-visit-location): show-window here is not a function call, but shorten the binding names anyways. Also, use pop-to-buffer-same-window instead of switch-to-buffer cf Bug#22244. * lisp/textmodes/sgml-mode.el (html-tag-alist): Use read-string, not read-input. diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index 86c8da0..958dba1 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -17647,7 +17647,7 @@ Set the shape and color of the mouse cursor: (setq mpointer "132")) ; top_left_arrow @end group @group - (setq x-pointer-shape (string-to-int mpointer)) + (setq x-pointer-shape (string-to-number mpointer)) (set-mouse-color "white")) @end group @end smallexample diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index c62fa72..4f15cf5 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -1486,7 +1486,7 @@ for a description of type specifiers. For example, (cl-typecase x (integer (munch-integer x)) (float (munch-float x)) - (string (munch-integer (string-to-int x))) + (string (munch-integer (string-to-number x))) (t (munch-anything x))) @end example diff --git a/doc/misc/speedbar.texi b/doc/misc/speedbar.texi index d43c521..27b57c0 100644 --- a/doc/misc/speedbar.texi +++ b/doc/misc/speedbar.texi @@ -1030,7 +1030,7 @@ it is not provided, you can derive it like this: (progn (beginning-of-line) (looking-at "^\\([0-9]+\\):") - (setq depth (string-to-int (match-string 1))))) + (setq depth (string-to-number (match-string 1))))) @end example @noindent diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index 1ee1464..04a7c22 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el @@ -683,7 +683,7 @@ It also can't undo some Viper settings." (delq 'viper-mode-string global-mode-string)) (setq-default major-mode - (viper-standard-value 'default-major-mode + (viper-standard-value 'major-mode viper-saved-non-viper-variables)) (if (featurep 'emacs) diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el index 915acc8..5df4178 100644 --- a/lisp/textmodes/reftex-toc.el +++ b/lisp/textmodes/reftex-toc.el @@ -942,17 +942,17 @@ label prefix determines the wording of a reference." (with-selected-window toc-window (reftex-unhighlight 0))) ((eq final 'hide) - (let ((show-window (selected-window)) - (show-buffer (window-buffer))) - (unless (eq show-window toc-window) ;FIXME: Can this happen? + (let ((window (selected-window)) + (buffer (window-buffer))) + (unless (eq window toc-window) ;FIXME: Can this happen? (with-selected-window toc-window (reftex-unhighlight 0) (or (one-window-p) (delete-window)))) - ;; If `show-window' is still live, show-buffer is already visible + ;; If window is still live, buffer is already visible ;; so let's not make it visible in yet-another-window. - (unless (window-live-p show-window) - ;; FIXME: How could show-window not be live? - (switch-to-buffer show-buffer)) + (unless (window-live-p window) + ;; FIXME: How could window not be live? + (pop-to-buffer-same-window buffer)) (reftex-re-enlarge))) (t (unless (eq (selected-frame) (window-frame toc-window)) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 43effef..13c3cfb 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -1926,7 +1926,7 @@ This takes effect when first loading the library.") ("hgroup" \n) ("html" (\n "\n" - "" (setq str (read-input "Title: ")) "\n" + "" (setq str (read-string "Title: ")) "\n" "\n" "\n

" str "

\n" _ "\n
\n Date: Fri Nov 4 10:23:46 2016 -0400 * lisp/emacs-lisp/pcase.el (pcase-dolist): Add a docstring. diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index 0b8dddf..896ad92 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -298,6 +298,8 @@ any kind of error." ;;;###autoload (defmacro pcase-dolist (spec &rest body) + "Like `dolist' but where the binding can be a `pcase' pattern. +\n(fn (PATTERN LIST) BODY...)" (declare (indent 1) (debug ((pcase-PAT form) body))) (if (pcase--trivial-upat-p (car spec)) `(dolist ,spec ,@body) commit 6a4158022e3eefccd76a1c1e9a87eb69e223b29e Author: Mark Oteiza Date: Fri Nov 4 10:14:01 2016 -0400 ; Fix warnings diff --git a/lisp/net/eww.el b/lisp/net/eww.el index a5b3ce3..7672bf0 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -2024,7 +2024,7 @@ Otherwise, the restored buffer will contain a prompt to do so by using (list :url (plist-get misc-data :uri)))) (unless file-name (when (plist-get eww-data :url) - (case eww-restore-desktop + (cl-case eww-restore-desktop ((t auto) (eww (plist-get eww-data :url))) ((zerop (buffer-size)) (let ((inhibit-read-only t)) commit 6ccb5f19f68689186002b817be7be25d929f5677 Author: Katsumi Yamaoka Date: Fri Nov 4 10:33:26 2016 +0000 * lisp/net/shr.el (shr-collect-extra-strings-in-table) New function that gathers extra strings in an invalid html. (bug#24831) (shr-tag-table): Use it. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 7ea33fb..73886bf 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1897,11 +1897,48 @@ The preference is a float determined from `shr-prefer-media-type'." (when (zerop shr-table-depth) (save-excursion (shr-expand-alignments start (point))) + ;; Insert also non-td/th strings excluding comments and styles. + (save-restriction + (narrow-to-region (point) (point)) + (insert (mapconcat #'identity + (shr-collect-extra-strings-in-table dom) + "\n")) + (shr-fill-lines (point-min) (point-max))) (dolist (elem (dom-by-tag dom 'object)) (shr-tag-object elem)) (dolist (elem (dom-by-tag dom 'img)) (shr-tag-img elem))))) +(defun shr-collect-extra-strings-in-table (dom &optional flags) + "Return extra strings in DOM of which the root is a table clause. +FLAGS is a cons of two flags that control whether to collect strings." + ;; If and only if the cdr is not set, the car will be set to t when + ;; a or a clause is found in the children of DOM, and reset + ;; to nil when a clause is found in the children of DOM. + ;; The cdr will be set to t when a
clause is found if the car + ;; is not set then, and will never be reset. + ;; This function collects strings if the car of FLAGS is not set. + (unless flags (setq flags (cons nil nil))) + (cl-loop for child in (dom-children dom) + if (stringp child) + when (and (not (car flags)) + (string-match "\\(?:[^\t\n\r ]+[\t\n\r ]+\\)*[^\t\n\r ]+" + child)) + collect (match-string 0 child) + end + else + unless (let ((tag (dom-tag child))) + (or (memq tag '(comment style)) + (progn + (cond ((memq tag '(td th)) + (unless (cdr flags) (setcar flags t))) + ((eq tag 'table) + (if (car flags) + (unless (cdr flags) (setcar flags nil)) + (setcdr flags t)))) + nil))) + append (shr-collect-extra-strings-in-table child flags))) + (defun shr-insert-table (table widths) (let* ((collapse (equal (cdr (assq 'border-collapse shr-stylesheet)) "collapse")) commit 23570fd995a1a5586c85b440d552ec5b6077ed39 Author: Hong Xu Date: Fri Nov 4 12:06:00 2016 +0200 Clarify documentation of 'vc-responsible-backend' wrt symlinks * lisp/vc/vc.el (vc-responsible-backend): Clarify that symlinks are not resolved when the VC backend is reported. * doc/lispref/files.texi (Truenames): Document 'vc-responsible-backend'. (Bug#23436) * doc/emacs/maintaining.texi (Version Control Systems): Fix a typo. diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index aca2991..0a47b4c 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -223,7 +223,7 @@ basic editing operations under Bazaar. @cindex SRC @cindex src @item -SRC (src) is RCS, reloaded - a specialized version-control system +SRC (src) is RCS, reloaded---a specialized version-control system designed for single-file projects worked on by only one person. It allows multiple files with independent version-control histories to exist in one directory, and is thus particularly well suited for diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 6b7ee19..544992d 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi @@ -1138,6 +1138,21 @@ compares the truenames of the two directories. If @var{dir} does not name an existing directory, the return value is @code{nil}. @end defun +@defun vc-responsible-backend file +This function determines the responsible VC backend of the given +@var{file}. For example, if @file{emacs.c} is a file tracked by Git, +@w{@code{(vc-responsible-backend "emacs.c")}} returns @samp{Git}. +Note that if @var{file} is a symbolic link, +@code{vc-responsible-backend} will not resolve it---the backend of the +symbolic link file itself is reported. To get the backend VC of the +file to which @var{file} refers, wrap @var{file} with a symbolic link +resolving function such as @code{file-chase-links}: + +@smallexample +(vc-responsible-backend (file-chase-links "emacs.c")) +@end smallexample +@end defun + @node File Attributes @subsection File Attributes @cindex file attributes diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index ac020d0..2ddf4e1 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -959,7 +959,11 @@ use." If FILE is already registered, return the backend of FILE. If FILE is not registered, then the first backend in `vc-handled-backends' that declares itself -responsible for FILE is returned." +responsible for FILE is returned. + +Note that if FILE is a symbolic link, it will not be resolved -- +the responsible backend system for the symbolic link itself will +be reported." (or (and (not (file-directory-p file)) (vc-backend file)) (catch 'found ;; First try: find a responsible backend. If this is for registration, commit f708cb22a1608f8a5aea671afebea44d216d9496 Author: Eli Zaretskii Date: Fri Nov 4 11:50:48 2016 +0200 Clarify doc string of 'transpose-sexps' * lisp/simple.el (transpose-sexps): Clarify the conditions for transposing sexps that are lists or strings. Mention the effect of the prefix argument. (Bug#24860) diff --git a/lisp/simple.el b/lisp/simple.el index 8f5324f..ff5774e 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -6663,9 +6663,13 @@ are interchanged." (transpose-subr 'forward-word arg)) (defun transpose-sexps (arg) - "Like \\[transpose-words] but applies to sexps. -Does not work on a sexp that point is in the middle of -if it is a list or string." + "Like \\[transpose-chars] (`transpose-chars'), but applies to sexps. +Unlike `transpose-words', point must be between the two sexps and not +in the middle of a sexp to be transposed. +With non-zero prefix arg ARG, effect is to take the sexp before point +and drag it forward past ARG other sexps (backward if ARG is negative). +If ARG is zero, the sexps ending at or after point and at or after mark +are interchanged." (interactive "*p") (transpose-subr (lambda (arg) commit cd05b1db33e9518a0ffce7bfe2e7421a0509492e Author: Tibor Csögör Date: Fri Nov 4 11:24:21 2016 +0200 Fix docstring of 'browse-url-firefox-new-window-is-tab' * lisp/net/browse-url.el (browse-url-firefox-new-window-is-tab): Remove obsolete note from docstring (obsoleted by previous commits). (Bug#24843) Copyright-paperwork-exempt: yes diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index c0b3591..be85928 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -356,10 +356,7 @@ If non-nil, then open the URL in a new tab rather than a new window if (defcustom browse-url-firefox-new-window-is-tab nil "Whether to open up new windows in a tab or a new window. If non-nil, then open the URL in a new tab rather than a new window if -`browse-url-firefox' is asked to open it in a new window. - -This option is currently ignored on MS-Windows, since the necessary -functionality is not available there." +`browse-url-firefox' is asked to open it in a new window." :type 'boolean :group 'browse-url) commit bdc89eb4a6fa977f050551b43a299999aa3dda57 Author: Eli Zaretskii Date: Fri Nov 4 11:16:40 2016 +0200 Improve documentation of 'font-lock-remove-keywords' * doc/lispref/modes.texi (Customizing Keywords): Clarify the 'keywords' argument of 'font-lock-remove-keywords'. Suggested by Hong Xu . (Bug#24830) diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 32baa27..7bbb5e6 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -2916,7 +2916,9 @@ This function removes @var{keywords} from @code{font-lock-keywords} for the current buffer or for major mode @var{mode}. As in @code{font-lock-add-keywords}, @var{mode} should be a major mode command name or @code{nil}. All the caveats and requirements for -@code{font-lock-add-keywords} apply here too. +@code{font-lock-add-keywords} apply here too. The argument +@var{keywords} must exactly match the one used by the corresponding +@code{font-lock-add-keywords}. @end defun For example, the following code adds two fontification patterns for C commit 0adefe7ef9f4c23a5c8fef1503bc2b02ea6db8f5 Author: Vasilij Schneidermann Date: Fri Nov 4 11:09:31 2016 +0200 Add 'x-ctrl-keysym' support on X window system * src/xterm.c (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Support 'x-ctrl-keysym'. (syms_of_xterm): DEFSYM "ctrl" and put a proper modifier-value property on it. : New DEFVAR_LISP. : Doc fix. (Bug#24822) * etc/NEWS: Mention the addition of 'x-ctrl-keysym'. * doc/lispref/os.texi (X11 Keysyms): Document 'x-ctrl-keysym'. diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 277abb1..97b086c 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -2254,14 +2254,16 @@ The variable is always local to the current terminal, and cannot be buffer-local. @xref{Multiple Terminals}. @end defvar -You can specify which keysyms Emacs should use for the Meta, Alt, Hyper, and Super modifiers by setting these variables: +You can specify which keysyms Emacs should use for the Control, Meta, +Alt, Hyper, and Super modifiers by setting these variables: -@defvar x-alt-keysym +@defvar x-ctrl-keysym +@defvarx x-alt-keysym @defvarx x-meta-keysym @defvarx x-hyper-keysym @defvarx x-super-keysym -The name of the keysym that should stand for the Alt modifier -(respectively, for Meta, Hyper, and Super). For example, here is +The name of the keysym that should stand for the Control modifier +(respectively, for Alt, Meta, Hyper, and Super). For example, here is how to swap the Meta and Alt modifiers within Emacs: @lisp (setq x-alt-keysym 'meta) diff --git a/etc/NEWS b/etc/NEWS index 9a671f2..f34ee2d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -233,6 +233,11 @@ questions, with a handy way to display help texts. all call stack frames in a Lisp backtrace buffer as lists. Both debug.el and edebug.el have been updated to heed to this variable. ++++ +** The new variable `x-ctrl-keysym` has been added to the existing +roster of X keysyms. It can be used in combination with another +variable of this kind to swap modifiers in Emacs. + * Editing Changes in Emacs 26.1 diff --git a/src/xterm.c b/src/xterm.c index f0dd0ca..d6e1fe2 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -4701,12 +4701,15 @@ x_find_modifier_meanings (struct x_display_info *dpyinfo) int x_x_to_emacs_modifiers (struct x_display_info *dpyinfo, int state) { + int mod_ctrl = ctrl_modifier; int mod_meta = meta_modifier; int mod_alt = alt_modifier; int mod_hyper = hyper_modifier; int mod_super = super_modifier; Lisp_Object tem; + tem = Fget (Vx_ctrl_keysym, Qmodifier_value); + if (INTEGERP (tem)) mod_ctrl = XINT (tem) & INT_MAX; tem = Fget (Vx_alt_keysym, Qmodifier_value); if (INTEGERP (tem)) mod_alt = XINT (tem) & INT_MAX; tem = Fget (Vx_meta_keysym, Qmodifier_value); @@ -4717,7 +4720,7 @@ x_x_to_emacs_modifiers (struct x_display_info *dpyinfo, int state) if (INTEGERP (tem)) mod_super = XINT (tem) & INT_MAX; return ( ((state & (ShiftMask | dpyinfo->shift_lock_mask)) ? shift_modifier : 0) - | ((state & ControlMask) ? ctrl_modifier : 0) + | ((state & ControlMask) ? mod_ctrl : 0) | ((state & dpyinfo->meta_mod_mask) ? mod_meta : 0) | ((state & dpyinfo->alt_mod_mask) ? mod_alt : 0) | ((state & dpyinfo->super_mod_mask) ? mod_super : 0) @@ -4727,6 +4730,7 @@ x_x_to_emacs_modifiers (struct x_display_info *dpyinfo, int state) static int x_emacs_to_x_modifiers (struct x_display_info *dpyinfo, EMACS_INT state) { + EMACS_INT mod_ctrl = ctrl_modifier; EMACS_INT mod_meta = meta_modifier; EMACS_INT mod_alt = alt_modifier; EMACS_INT mod_hyper = hyper_modifier; @@ -4734,6 +4738,8 @@ x_emacs_to_x_modifiers (struct x_display_info *dpyinfo, EMACS_INT state) Lisp_Object tem; + tem = Fget (Vx_ctrl_keysym, Qmodifier_value); + if (INTEGERP (tem)) mod_ctrl = XINT (tem); tem = Fget (Vx_alt_keysym, Qmodifier_value); if (INTEGERP (tem)) mod_alt = XINT (tem); tem = Fget (Vx_meta_keysym, Qmodifier_value); @@ -4748,7 +4754,7 @@ x_emacs_to_x_modifiers (struct x_display_info *dpyinfo, EMACS_INT state) | ((state & mod_super) ? dpyinfo->super_mod_mask : 0) | ((state & mod_hyper) ? dpyinfo->hyper_mod_mask : 0) | ((state & shift_modifier) ? ShiftMask : 0) - | ((state & ctrl_modifier) ? ControlMask : 0) + | ((state & mod_ctrl) ? ControlMask : 0) | ((state & mod_meta) ? dpyinfo->meta_mod_mask : 0)); } @@ -12863,6 +12869,8 @@ With MS Windows or Nextstep, the value is t. */); #endif DEFSYM (Qmodifier_value, "modifier-value"); + DEFSYM (Qctrl, "ctrl"); + Fput (Qctrl, Qmodifier_value, make_number (ctrl_modifier)); DEFSYM (Qalt, "alt"); Fput (Qalt, Qmodifier_value, make_number (alt_modifier)); DEFSYM (Qhyper, "hyper"); @@ -12872,32 +12880,39 @@ With MS Windows or Nextstep, the value is t. */); DEFSYM (Qsuper, "super"); Fput (Qsuper, Qmodifier_value, make_number (super_modifier)); + DEFVAR_LISP ("x-ctrl-keysym", Vx_ctrl_keysym, + doc: /* Which keys Emacs uses for the ctrl modifier. +This should be one of the symbols `ctrl', `alt', `hyper', `meta', +`super'. For example, `ctrl' means use the Ctrl_L and Ctrl_R keysyms. +The default is nil, which is the same as `ctrl'. */); + Vx_ctrl_keysym = Qnil; + DEFVAR_LISP ("x-alt-keysym", Vx_alt_keysym, doc: /* Which keys Emacs uses for the alt modifier. -This should be one of the symbols `alt', `hyper', `meta', `super'. -For example, `alt' means use the Alt_L and Alt_R keysyms. The default -is nil, which is the same as `alt'. */); +This should be one of the symbols `ctrl', `alt', `hyper', `meta', +`super'. For example, `alt' means use the Alt_L and Alt_R keysyms. +The default is nil, which is the same as `alt'. */); Vx_alt_keysym = Qnil; DEFVAR_LISP ("x-hyper-keysym", Vx_hyper_keysym, doc: /* Which keys Emacs uses for the hyper modifier. -This should be one of the symbols `alt', `hyper', `meta', `super'. -For example, `hyper' means use the Hyper_L and Hyper_R keysyms. The -default is nil, which is the same as `hyper'. */); +This should be one of the symbols `ctrl', `alt', `hyper', `meta', +`super'. For example, `hyper' means use the Hyper_L and Hyper_R +keysyms. The default is nil, which is the same as `hyper'. */); Vx_hyper_keysym = Qnil; DEFVAR_LISP ("x-meta-keysym", Vx_meta_keysym, doc: /* Which keys Emacs uses for the meta modifier. -This should be one of the symbols `alt', `hyper', `meta', `super'. -For example, `meta' means use the Meta_L and Meta_R keysyms. The -default is nil, which is the same as `meta'. */); +This should be one of the symbols `ctrl', `alt', `hyper', `meta', +`super'. For example, `meta' means use the Meta_L and Meta_R keysyms. +The default is nil, which is the same as `meta'. */); Vx_meta_keysym = Qnil; DEFVAR_LISP ("x-super-keysym", Vx_super_keysym, doc: /* Which keys Emacs uses for the super modifier. -This should be one of the symbols `alt', `hyper', `meta', `super'. -For example, `super' means use the Super_L and Super_R keysyms. The -default is nil, which is the same as `super'. */); +This should be one of the symbols `ctrl', `alt', `hyper', `meta', +`super'. For example, `super' means use the Super_L and Super_R +keysyms. The default is nil, which is the same as `super'. */); Vx_super_keysym = Qnil; DEFVAR_LISP ("x-keysym-table", Vx_keysym_table, commit 4a0c590cbf4db96fb62877dd662c6bdeef7aeab1 Author: Eli Zaretskii Date: Fri Nov 4 10:56:11 2016 +0200 Fix documentation of the command summary key * doc/misc/info.texi (Help-^L, Help-Xref, Top): Emacs Info uses '?' for the summary of commands, whereas the stand-alone reader uses 'H'. (Bug#24825) diff --git a/doc/misc/info.texi b/doc/misc/info.texi index 0a8100f..1b964e6 100644 --- a/doc/misc/info.texi +++ b/doc/misc/info.texi @@ -70,7 +70,8 @@ To read about advanced Info commands, type @kbd{n} twice. This brings you to @cite{Advanced Info Commands}, skipping over the ``Getting Started'' chapter. -Type @kbd{H} to see a summary of all available commands. +If you are using Emacs, type @kbd{?} to see a summary of all available +commands. In the stand-alone Info reader, type @kbd{H} instead. @end ifinfo @end ifnottex @@ -393,16 +394,18 @@ the @key{BACKSPACE} key (or @key{DEL}) many times. You can also type @end format @kindex ? @r{(Info mode)} +@kindex H @r{(stand-alone Info reader)} @findex Info-summary You have just learned a considerable number of commands. If you want to use one but have trouble remembering which, you should type -@kbd{?}, which displays a brief list of commands. When you are -finished looking at the list, make it go away by typing @key{SPC} -repeatedly. +@kbd{?} (@kbd{H} in the stand-alone Info reader), which displays a +brief list of commands. When you are finished looking at the list, +make it go away by typing @key{SPC} repeatedly. @format ->> Type a @key{?} now. Press @key{SPC} to see consecutive screenfuls of - the list until finished. Then type @key{SPC} several times. If +>> Type a @key{?} (or @key{H} in the stand-alone Info reader) now. + Press @key{SPC} to see consecutive screenfuls of the list + until finished. Then type @key{SPC} several times. If you are using Emacs, the help will then go away automatically. If you are using the stand-alone Info reader, type @kbd{x} to return here. commit e5d0efe8fc4130593a899a9699ed8a95b953df3a Author: Alexander Gramiak Date: Fri Nov 4 10:41:21 2016 +0200 Improve autoload error reporting * src/eval.c (Fautoload_do_load): Include the absolute file name in the error message. diff --git a/src/eval.c b/src/eval.c index a9bad24..caeb791 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1988,7 +1988,8 @@ it defines a macro. */) Lisp_Object fun = Findirect_function (funname, Qnil); if (!NILP (Fequal (fun, fundef))) - error ("Autoloading failed to define function %s", + error ("Autoloading file %s failed to define function %s", + SDATA (Fcar (Fcar (Vload_history))), SDATA (SYMBOL_NAME (funname))); else return fun; commit 0221b7a9b511db2ebcbe5f41c1fa20d2f3d70599 Author: Eli Zaretskii Date: Fri Nov 4 10:36:02 2016 +0200 Mark relocation workarounds with REL_ALLOC * src/search.c (boyer_moore): Mark workarounds for ralloc.c relocation of buffer text with "#ifdef REL_ALLOC". diff --git a/src/search.c b/src/search.c index 15504be..9f55d72 100644 --- a/src/search.c +++ b/src/search.c @@ -2029,20 +2029,27 @@ boyer_moore (EMACS_INT n, unsigned char *base_pat, cursor += dirlen - i - direction; /* fix cursor */ if (i + direction == 0) { - ptrdiff_t position, start, end, cursor_off; + ptrdiff_t position, start, end; +#ifdef REL_ALLOC + ptrdiff_t cursor_off; +#endif cursor -= direction; position = pos_byte + cursor - p2 + ((direction > 0) ? 1 - len_byte : 0); +#ifdef REL_ALLOC /* set_search_regs might call malloc, which could cause ralloc.c relocate buffer text. We need to update pointers into buffer text due to that. */ cursor_off = cursor - p2; +#endif set_search_regs (position, len_byte); +#ifdef REL_ALLOC p_limit = BYTE_POS_ADDR (limit); p2 = BYTE_POS_ADDR (pos_byte); cursor = p2 + cursor_off; +#endif if (NILP (Vinhibit_changing_match_data)) { commit 5043e0a7e06dbf6507a59736e55bdde69d9a2a4e Author: Thomas Fitzsimmons Date: Tue Nov 1 05:00:25 2016 -0400 Fix documentation for 'eudc-options-file' * doc/misc/eudc.texi (The Server Hotlist): Update the default value of 'eudc-options-file'. Backport: (cherry picked from commit 0575fd95d0b92a9a0ebff8df183a449190f74dbc) diff --git a/doc/misc/eudc.texi b/doc/misc/eudc.texi index 87cfab6..1bbb108 100644 --- a/doc/misc/eudc.texi +++ b/doc/misc/eudc.texi @@ -783,12 +783,11 @@ Add the current server to the hotlist of servers @end deffn @defvar eudc-options-file -The name of a file where EUDC stores its internal variables -(the hotlist and the current server). EUDC will try to load -that file upon initialization so, if you choose a file name -different from the defaults @file{~/.eudc-options}, be sure to set this -variable to the appropriate value @emph{before} EUDC is itself -loaded. +The name of a file where EUDC stores its internal variables (the +hotlist and the current server). EUDC will try to load that file upon +initialization so, if you choose a file name different from the +defaults @file{~/.emacs.d/eudc-options}, be sure to set this variable +to the appropriate value @emph{before} EUDC is itself loaded. @end defvar @menu commit 26038aa676afd867a5e194590f673351a3da0f64 Author: Tibor Csögör Date: Tue Nov 1 04:57:53 2016 -0400 Fix documentation of 'eudc-inline-expansion-format' * doc/misc/eudc.texi (Inline Query Expansion): Fix the default value of 'eudc-inline-expansion-format'. (Bug#24840) Backport: (cherry picked from commit 1fef1387c387d80f8ece326621539b89a6965702) diff --git a/doc/misc/eudc.texi b/doc/misc/eudc.texi index 53f1beb..87cfab6 100644 --- a/doc/misc/eudc.texi +++ b/doc/misc/eudc.texi @@ -733,8 +733,7 @@ upon an inline expansion request. It is a list whose first element is a string passed to @code{format}. Remaining elements are symbols corresponding to directory attribute names. The corresponding attribute values are passed as additional arguments to @code{format}. Default is -@code{("%s" email)} but you may want to consider a value like @code{("%s -<%s>" name email)} +@code{("%s %s <%s>" firstname name email)}. @end defvar @defvar eudc-multiple-match-handling-method commit dbb341022870ecad4c9177485a6770a355633cc0 Author: Clément Pit--Claudel Date: Wed Oct 26 22:46:28 2016 -0400 python.el: Fix detection of native completion in Python 3 (bug #24401) With Python 3.5, (python-shell-completion-native-get-completions ... "") would return an empty list, causing python.el to think that native completion was unavailable (the difference between Python 2 and Python 3 is due to https://bugs.python.org/issue25660). * lisp/progmodes/python.el (python-shell-completion-native-try): Use "_" to check whether native completion is available instead of "". diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 49f7bcf..3fae398 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3296,7 +3296,7 @@ When a match is found, native completion is disabled." python-shell-completion-native-try-output-timeout)) (python-shell-completion-native-get-completions (get-buffer-process (current-buffer)) - nil ""))) + nil "_"))) (defun python-shell-completion-native-setup () "Try to setup native completion, return non-nil on success." commit 91c97b6eed708f5a1f34478b52f42ef9e51efcb5 Author: Glenn Morris Date: Wed Oct 26 15:47:54 2016 -0400 * Makefile.in (install-arch-indep): Skip etc/refcards/emacsver.tex.in. diff --git a/Makefile.in b/Makefile.in index b212c91..b3f7edb 100644 --- a/Makefile.in +++ b/Makefile.in @@ -584,7 +584,7 @@ install-arch-indep: lisp install-info install-man ${INSTALL_ARCH_INDEP_EXTRA} if [ "$${dir}" = "${srcdir}/etc" ]; then \ rm -f "$${dest}/DOC"* ; \ rm -f "$${dest}/refcards"/*.aux "$${dest}/refcards"/*.dvi; \ - rm -f "$${dest}/refcards"/*.log; \ + rm -f "$${dest}/refcards"/*.log "$${dest}/refcards"/*.in; \ else true; \ fi; \ (cd "$${dest}" || exit 1; \ commit 9c1cb8d595c827031f55a7ef23d083d9ec4a028c Author: Stefan Monnier Date: Wed Oct 26 15:29:02 2016 -0400 * lisp/subr.el (set-transient-map): Exit for unbound events (bug#24755). diff --git a/lisp/subr.el b/lisp/subr.el index 573f238..07909b8 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4507,8 +4507,10 @@ to deactivate this transient map, regardless of KEEP-PRED." ;; exit C-u. t) ((eq t keep-pred) - (eq this-command - (lookup-key map (this-command-keys-vector)))) + (let ((mc (lookup-key map (this-command-keys-vector)))) + ;; If the key is unbound `this-command` is + ;; nil and so is `mc`. + (and mc (eq this-command mc)))) (t (funcall keep-pred))) (funcall exitfun))))) (add-hook 'pre-command-hook clearfun) commit 9c247d200b2b06dbfee84d22a03d559df119a23e Author: Eli Zaretskii Date: Wed Oct 26 15:58:07 2016 +0300 Update category-table for Chinese characters * lisp/international/characters.el (standard-category-table): Update the ranges of Han and Chinese characters. (Bug#24798) diff --git a/lisp/international/characters.el b/lisp/international/characters.el index e7f2ce0..ab058a5 100644 --- a/lisp/international/characters.el +++ b/lisp/international/characters.el @@ -141,10 +141,10 @@ with L, LRE, or LRO Unicode bidi character type.") ;; Chinese characters (Unicode) (modify-category-entry '(#x2E80 . #x312F) ?|) (modify-category-entry '(#x3190 . #x33FF) ?|) -(modify-category-entry '(#x3400 . #x4DBF) ?C) -(modify-category-entry '(#x4E00 . #x9FAF) ?C) -(modify-category-entry '(#x3400 . #x9FAF) ?c) -(modify-category-entry '(#x3400 . #x9FAF) ?|) +(modify-category-entry '(#x3400 . #x4DB5) ?C) +(modify-category-entry '(#x4E00 . #x9FD5) ?C) +(modify-category-entry '(#x3400 . #x9FD5) ?c) +(modify-category-entry '(#x3400 . #x9FD5) ?|) (modify-category-entry '(#xF900 . #xFAFF) ?C) (modify-category-entry '(#xF900 . #xFAFF) ?c) (modify-category-entry '(#xF900 . #xFAFF) ?|) commit 43986d16fb6ad78a627250e14570ea70bdb1f23a Author: Noam Postavsky Date: Mon Oct 24 21:22:07 2016 -0400 Inhibit buffer relocation during regex searches * src/search.c (looking_at_1, fast_looking_at, search_buffer): Prevent relocation of buffer contents during calls to re_search_2. This ensures the pointers into buffer text won't be invalidated by r_alloc_sbrk (called from malloc with configurations where REL_ALLOC=yes). diff --git a/src/search.c b/src/search.c index fa5ac44..15504be 100644 --- a/src/search.c +++ b/src/search.c @@ -308,12 +308,20 @@ looking_at_1 (Lisp_Object string, bool posix) re_match_object = Qnil; +#ifdef REL_ALLOC + /* Prevent ralloc.c from relocating the current buffer while + searching it. */ + r_alloc_inhibit_buffer_relocation (1); +#endif i = re_match_2 (bufp, (char *) p1, s1, (char *) p2, s2, PT_BYTE - BEGV_BYTE, (NILP (Vinhibit_changing_match_data) ? &search_regs : NULL), ZV_BYTE - BEGV_BYTE); immediate_quit = 0; +#ifdef REL_ALLOC + r_alloc_inhibit_buffer_relocation (0); +#endif if (i == -2) matcher_overflow (); @@ -561,8 +569,16 @@ fast_looking_at (Lisp_Object regexp, ptrdiff_t pos, ptrdiff_t pos_byte, buf = compile_pattern (regexp, 0, Qnil, 0, multibyte); immediate_quit = 1; +#ifdef REL_ALLOC + /* Prevent ralloc.c from relocating the current buffer while + searching it. */ + r_alloc_inhibit_buffer_relocation (1); +#endif len = re_match_2 (buf, (char *) p1, s1, (char *) p2, s2, pos_byte, NULL, limit_byte); +#ifdef REL_ALLOC + r_alloc_inhibit_buffer_relocation (0); +#endif immediate_quit = 0; return len; @@ -1213,6 +1229,12 @@ search_buffer (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte, } re_match_object = Qnil; +#ifdef REL_ALLOC + /* Prevent ralloc.c from relocating the current buffer while + searching it. */ + r_alloc_inhibit_buffer_relocation (1); +#endif + while (n < 0) { ptrdiff_t val; @@ -1254,6 +1276,9 @@ search_buffer (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte, else { immediate_quit = 0; +#ifdef REL_ALLOC + r_alloc_inhibit_buffer_relocation (0); +#endif return (n); } n++; @@ -1296,11 +1321,17 @@ search_buffer (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte, else { immediate_quit = 0; +#ifdef REL_ALLOC + r_alloc_inhibit_buffer_relocation (0); +#endif return (0 - n); } n--; } immediate_quit = 0; +#ifdef REL_ALLOC + r_alloc_inhibit_buffer_relocation (0); +#endif return (pos); } else /* non-RE case */ commit fee4cef7d720e98922858e19b3161358041ec141 Author: Noam Postavsky Date: Mon Oct 24 19:54:29 2016 -0400 Revert fixes to allocation of regex matching The fix was not complete, and completing it was proving too complicated. - Revert "* src/regex.c (re_search_2): Make new code safe for -Wjump-misses-init." This reverts commit c2a17924a57483d14692c8913edbe8ad24b5ffbb. - Revert "Port to GCC 6.2.1 + --enable-gcc-warnings" This reverts commit f6134bbda259c115c06d4a9a3ab5c39340a15949. - Revert "Fix handling of allocation in regex matching" This reverts commit ad66b3fadb7ae22a4cbb82bb1507c39ceadf3897. - Revert "Fix handling of buffer relocation in regex.c functions" This reverts commit ee04aedc723b035eedaf975422d4eb242894121b. diff --git a/src/dired.c b/src/dired.c index 006f74c..dba575c 100644 --- a/src/dired.c +++ b/src/dired.c @@ -259,11 +259,9 @@ directory_files_internal (Lisp_Object directory, Lisp_Object full, QUIT; bool wanted = (NILP (match) - || (re_match_object = name, - re_search (bufp, SSDATA (name), len, 0, len, 0) >= 0)); + || re_search (bufp, SSDATA (name), len, 0, len, 0) >= 0); immediate_quit = 0; - re_match_object = Qnil; /* Stop protecting name from GC. */ if (wanted) { diff --git a/src/regex.c b/src/regex.c index b12e95b..56b18e6 100644 --- a/src/regex.c +++ b/src/regex.c @@ -1438,62 +1438,11 @@ typedef struct #define NEXT_FAILURE_HANDLE(h) fail_stack.stack[(h) - 3].integer #define TOP_FAILURE_HANDLE() fail_stack.frame -#ifdef emacs -# define STR_BASE_PTR(obj) \ - (NILP (obj) ? current_buffer->text->beg \ - : STRINGP (obj) ? SDATA (obj) \ - : NULL) -#else -# define STR_BASE_PTR(obj) NULL -#endif #define ENSURE_FAIL_STACK(space) \ while (REMAINING_AVAIL_SLOTS <= space) { \ - re_char *orig_base = STR_BASE_PTR (re_match_object); \ - bool might_relocate = orig_base != NULL; \ - ptrdiff_t string1_off, end1_off, end_match_1_off; \ - ptrdiff_t string2_off, end2_off, end_match_2_off; \ - ptrdiff_t d_off, dend_off, dfail_off; \ - if (might_relocate) \ - { \ - if (string1) \ - { \ - string1_off = string1 - orig_base; \ - end1_off = end1 - orig_base; \ - end_match_1_off = end_match_1 - orig_base; \ - } \ - if (string2) \ - { \ - string2_off = string2 - orig_base; \ - end2_off = end2 - orig_base; \ - end_match_2_off = end_match_2 - orig_base; \ - } \ - d_off = d - orig_base; \ - dend_off = dend - orig_base; \ - dfail_off = dfail - orig_base; \ - } \ if (!GROW_FAIL_STACK (fail_stack)) \ return -2; \ - /* In Emacs, GROW_FAIL_STACK might relocate string pointers. */ \ - if (might_relocate) \ - { \ - re_char *new_base = STR_BASE_PTR (re_match_object); \ - if (string1) \ - { \ - string1 = new_base + string1_off; \ - end1 = new_base + end1_off; \ - end_match_1 = new_base + end_match_1_off; \ - } \ - if (string2) \ - { \ - string2 = new_base + string2_off; \ - end2 = new_base + end2_off; \ - end_match_2 = new_base + end_match_2_off; \ - } \ - d = new_base + d_off; \ - dend = new_base + dend_off; \ - dfail = new_base + dfail_off; \ - } \ DEBUG_PRINT ("\n Doubled stack; size now: %zd\n", (fail_stack).size);\ DEBUG_PRINT (" slots available: %zd\n", REMAINING_AVAIL_SLOTS);\ } @@ -4380,10 +4329,6 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *str1, size_t size1, /* Loop through the string, looking for a place to start matching. */ for (;;) { - ptrdiff_t offset1, offset2; - re_char *orig_base; - bool might_relocate; - /* If the pattern is anchored, skip quickly past places we cannot match. We don't bother to treat startpos == 0 specially @@ -4500,17 +4445,6 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *str1, size_t size1, && !bufp->can_be_null) return -1; - /* re_match_2_internal may allocate, relocating the Lisp text - object that we're searching. */ - IF_LINT (offset2 = 0); /* Work around GCC bug 78081. */ - orig_base = STR_BASE_PTR (re_match_object); - might_relocate = orig_base != NULL; - if (might_relocate) - { - if (string1) offset1 = string1 - orig_base; - if (string2) offset2 = string2 - orig_base; - } - val = re_match_2_internal (bufp, string1, size1, string2, size2, startpos, regs, stop); @@ -4520,13 +4454,6 @@ re_search_2 (struct re_pattern_buffer *bufp, const char *str1, size_t size1, if (val == -2) return -2; - if (might_relocate) - { - re_char *new_base = STR_BASE_PTR (re_match_object); - if (string1) string1 = offset1 + new_base; - if (string2) string2 = offset2 + new_base; - } - advance: if (!range) break; diff --git a/src/regex.h b/src/regex.h index 61c771c..51f4424 100644 --- a/src/regex.h +++ b/src/regex.h @@ -169,9 +169,7 @@ extern reg_syntax_t re_syntax_options; #ifdef emacs # include "lisp.h" /* In Emacs, this is the string or buffer in which we are matching. - It is used for looking up syntax properties, and also to recompute - pointers in case the object is relocated as a side effect of - calling malloc (if it calls r_alloc_sbrk in ralloc.c). + It is used for looking up syntax properties. If the value is a Lisp string object, we are matching text in that string; if it's nil, we are matching text in the current buffer; if diff --git a/src/search.c b/src/search.c index b50e7f0..fa5ac44 100644 --- a/src/search.c +++ b/src/search.c @@ -287,10 +287,8 @@ looking_at_1 (Lisp_Object string, bool posix) immediate_quit = 1; QUIT; /* Do a pending quit right away, to avoid paradoxical behavior */ - /* Get pointers and sizes of the two strings that make up the - visible portion of the buffer. Note that we can use pointers - here, unlike in search_buffer, because we only call re_match_2 - once, after which we never use the pointers again. */ + /* Get pointers and sizes of the two strings + that make up the visible portion of the buffer. */ p1 = BEGV_ADDR; s1 = GPT_BYTE - BEGV_BYTE; @@ -409,7 +407,6 @@ string_match_1 (Lisp_Object regexp, Lisp_Object string, Lisp_Object start, (NILP (Vinhibit_changing_match_data) ? &search_regs : NULL)); immediate_quit = 0; - re_match_object = Qnil; /* Stop protecting string from GC. */ /* Set last_thing_searched only when match data is changed. */ if (NILP (Vinhibit_changing_match_data)) @@ -480,7 +477,6 @@ fast_string_match_internal (Lisp_Object regexp, Lisp_Object string, SBYTES (string), 0, SBYTES (string), 0); immediate_quit = 0; - re_match_object = Qnil; /* Stop protecting string from GC. */ return val; } @@ -568,7 +564,6 @@ fast_looking_at (Lisp_Object regexp, ptrdiff_t pos, ptrdiff_t pos_byte, len = re_match_2 (buf, (char *) p1, s1, (char *) p2, s2, pos_byte, NULL, limit_byte); immediate_quit = 0; - re_match_object = Qnil; /* Stop protecting string from GC. */ return len; } @@ -1183,8 +1178,8 @@ search_buffer (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte, if (RE && !(trivial_regexp_p (string) && NILP (Vsearch_spaces_regexp))) { - unsigned char *base; - ptrdiff_t off1, off2, s1, s2; + unsigned char *p1, *p2; + ptrdiff_t s1, s2; struct re_pattern_buffer *bufp; bufp = compile_pattern (string, @@ -1198,19 +1193,16 @@ search_buffer (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte, can take too long. */ QUIT; /* Do a pending quit right away, to avoid paradoxical behavior */ - /* Get offsets and sizes of the two strings that make up the - visible portion of the buffer. We compute offsets instead of - pointers because re_search_2 may call malloc and therefore - change the buffer text address. */ + /* Get pointers and sizes of the two strings + that make up the visible portion of the buffer. */ - base = current_buffer->text->beg; - off1 = BEGV_ADDR - base; + p1 = BEGV_ADDR; s1 = GPT_BYTE - BEGV_BYTE; - off2 = GAP_END_ADDR - base; + p2 = GAP_END_ADDR; s2 = ZV_BYTE - GPT_BYTE; if (s1 < 0) { - off2 = off1; + p2 = p1; s2 = ZV_BYTE - BEGV_BYTE; s1 = 0; } @@ -1225,16 +1217,12 @@ search_buffer (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte, { ptrdiff_t val; - val = re_search_2 (bufp, - (char*) (base + off1), s1, - (char*) (base + off2), s2, + val = re_search_2 (bufp, (char *) p1, s1, (char *) p2, s2, pos_byte - BEGV_BYTE, lim_byte - pos_byte, (NILP (Vinhibit_changing_match_data) ? &search_regs : &search_regs_1), /* Don't allow match past current point */ pos_byte - BEGV_BYTE); - /* Update 'base' due to possible relocation inside re_search_2. */ - base = current_buffer->text->beg; if (val == -2) { matcher_overflow (); @@ -1274,15 +1262,11 @@ search_buffer (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte, { ptrdiff_t val; - val = re_search_2 (bufp, - (char*) (base + off1), s1, - (char*) (base + off2), s2, - pos_byte - BEGV_BYTE, lim_byte - pos_byte, + val = re_search_2 (bufp, (char *) p1, s1, (char *) p2, s2, + pos_byte - BEGV_BYTE, lim_byte - pos_byte, (NILP (Vinhibit_changing_match_data) ? &search_regs : &search_regs_1), lim_byte - BEGV_BYTE); - /* Update 'base' due to possible relocation inside re_search_2. */ - base = current_buffer->text->beg; if (val == -2) { matcher_overflow ();