From f4b5ff20a663db483ee4bb3e60c34ce4cd2d6d70 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 2 May 2018 11:14:07 -0700 Subject: [PATCH 01/10] Port collation tests to glibc 2.27 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test/src/fns-tests.el (fns-tests-collate-strings) (fns-tests-collate-sort): Don’t make unportable assumptions about how en_US.UTF-8 collation works. These assumptions are not true on Fedora 28, which ships with glibc 2.27. --- test/src/fns-tests.el | 48 +++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el index f8554636bac3..641947d66a0f 100644 --- a/test/src/fns-tests.el +++ b/test/src/fns-tests.el @@ -119,10 +119,9 @@ ;; In POSIX or C locales, collation order is lexicographic. (should (string-collate-lessp "XYZZY" "xyzzy" "POSIX")) - ;; In a language specific locale, collation order is different. - (should (string-collate-lessp - "xyzzy" "XYZZY" - (if (eq system-type 'windows-nt) "enu_USA" "en_US.UTF-8"))) + ;; In a language specific locale on MS-Windows, collation order is different. + (when (eq system-type 'windows-nt) + (should (string-collate-lessp "xyzzy" "XYZZY" "enu_USA"))) ;; Ignore case. (should (string-collate-equalp "xyzzy" "XYZZY" nil t)) @@ -154,8 +153,6 @@ (9 . "aaa") (9 . "zzz") (9 . "ppp") (9 . "fff")]))) (ert-deftest fns-tests-collate-sort () - ;; See https://lists.gnu.org/r/emacs-devel/2015-10/msg02505.html. - :expected-result (if (eq system-type 'cygwin) :failed :passed) (skip-unless (fns-tests--collate-enabled-p)) ;; Punctuation and whitespace characters are relevant for POSIX. @@ -165,15 +162,16 @@ (lambda (a b) (string-collate-lessp a b "POSIX"))) '("1 1" "1 2" "1.1" "1.2" "11" "12"))) ;; Punctuation and whitespace characters are not taken into account - ;; for collation in other locales. - (should - (equal - (sort '("11" "12" "1 1" "1 2" "1.1" "1.2") - (lambda (a b) - (let ((w32-collate-ignore-punctuation t)) - (string-collate-lessp - a b (if (eq system-type 'windows-nt) "enu_USA" "en_US.UTF-8"))))) - '("11" "1 1" "1.1" "12" "1 2" "1.2"))) + ;; for collation in other locales, on MS-Windows systems. + (when (eq system-type 'windows-nt) + (should + (equal + (sort '("11" "12" "1 1" "1 2" "1.1" "1.2") + (lambda (a b) + (let ((w32-collate-ignore-punctuation t)) + (string-collate-lessp + a b "enu_USA")))) + '("11" "1 1" "1.1" "12" "1 2" "1.2")))) ;; Diacritics are different letters for POSIX, they sort lexicographical. (should @@ -181,15 +179,17 @@ (sort '("Ævar" "Agustín" "Adrian" "Eli") (lambda (a b) (string-collate-lessp a b "POSIX"))) '("Adrian" "Agustín" "Eli" "Ævar"))) - ;; Diacritics are sorted between similar letters for other locales. - (should - (equal - (sort '("Ævar" "Agustín" "Adrian" "Eli") - (lambda (a b) - (let ((w32-collate-ignore-punctuation t)) - (string-collate-lessp - a b (if (eq system-type 'windows-nt) "enu_USA" "en_US.UTF-8"))))) - '("Adrian" "Ævar" "Agustín" "Eli")))) + ;; Diacritics are sorted between similar letters for other locales, + ;; on MS-Windows systems. + (when (eq system-type 'windows-nt) + (should + (equal + (sort '("Ævar" "Agustín" "Adrian" "Eli") + (lambda (a b) + (let ((w32-collate-ignore-punctuation t)) + (string-collate-lessp + a b "enu_USA")))) + '("Adrian" "Ævar" "Agustín" "Eli"))))) (ert-deftest fns-tests-string-version-lessp () (should (string-version-lessp "foo2.png" "foo12.png")) From 91de88bfeb759fb36ca12ee829b6d0c6e84fa4ce Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 3 May 2018 21:04:17 +0300 Subject: [PATCH 02/10] Fix report-emacs-bug via mailclient on MS-Windows * lisp/net/browse-url.el (browse-url-default-windows-browser): On MS-Windows, call url-unhex-string only for file:// URLs. (Bug#31351) --- lisp/net/browse-url.el | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 98b0acfc0c62..a84a7b1c7162 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -878,7 +878,21 @@ The optional NEW-WINDOW argument is not used." (error "Browsing URLs is not supported on this system"))) ((eq system-type 'cygwin) (call-process "cygstart" nil nil nil url)) - (t (w32-shell-execute "open" (url-unhex-string url))))) + (t + (w32-shell-execute "open" + ;; w32-shell-execute passes file:// URLs + ;; to APIs that expect file names, so we + ;; need to unhex any %nn encoded + ;; characters in the URL. We don't do + ;; that for other URLs; in particular, + ;; default Windows mail client barfs on + ;; quotes in the MAILTO URLs, so we prefer + ;; to leave the URL with its embedded %nn + ;; encoding intact. + (if (eq t (compare-strings url nil 7 + "file://" nil nil)) + (url-unhex-string url) + url))))) (defun browse-url-default-macosx-browser (url &optional _new-window) "Invoke the macOS system's default Web browser. From 79ad0b3b2d4313d85e3fa1ff1e8658637bea43e2 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 3 May 2018 21:19:07 +0300 Subject: [PATCH 03/10] ; * INSTALL: Fix Emacs version number. (Bug#31358) --- INSTALL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL b/INSTALL index 22abf7fd8456..ab2e800e6766 100644 --- a/INSTALL +++ b/INSTALL @@ -34,7 +34,7 @@ some of the steps manually. The more detailed description in the other sections of this guide will help you do that, so please refer to those sections if you need to. - 1. Unpacking the Emacs 25 release requires about 200 MB of free + 1. Unpacking the Emacs release requires about 200 MB of free disk space. Building Emacs uses about another 200 MB of space. The final installed Emacs uses about 150 MB of disk space. This includes the space-saving that comes from automatically From b90ce66d32ede14a9191008096e596f6dfb9a48b Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Thu, 3 May 2018 20:54:25 -0400 Subject: [PATCH 04/10] Handle selected_window change in prepare_menu_bars (Bug#31312) * src/xdisp.c (redisplay_internal): Check selected_window after calling prepare_menu_bars, since it can call lisp hooks. --- src/xdisp.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index fb6729c36aa2..d6aabd06189c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13924,11 +13924,6 @@ redisplay_internal (void) /* Notice any pending interrupt request to change frame size. */ do_pending_window_change (true); - /* do_pending_window_change could change the selected_window due to - frame resizing which makes the selected window too small. */ - if (WINDOWP (selected_window) && (w = XWINDOW (selected_window)) != sw) - sw = w; - /* Clear frames marked as garbaged. */ clear_garbaged_frames (); @@ -13936,6 +13931,13 @@ redisplay_internal (void) if (NILP (Vmemory_full)) prepare_menu_bars (); + /* do_pending_window_change could change the selected_window due to + frame resizing which makes the selected window too small. + prepare_menu_bars may call lisp hooks and hence also change the + selected_window. */ + if (WINDOWP (selected_window) && (w = XWINDOW (selected_window)) != sw) + sw = w; + reconsider_clip_changes (w); /* In most cases selected window displays current buffer. */ From d0d75f9b4ecbaa7e49aaad8802ca2f0e3de7e480 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 4 May 2018 17:25:33 +0300 Subject: [PATCH 05/10] Make 'ispell-initialize-spellchecker-hook' work again * lisp/textmodes/ispell.el (ispell-base-dicts-override-alist): Defvar it to allow dynamic binding. (Bug#31341) --- lisp/textmodes/ispell.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 9288a77ba3e9..88ab7fe1e959 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -1237,6 +1237,10 @@ If LANG is omitted, get the extra word characters for the default language." (defvar ispell-last-program-name nil "Last value of `ispell-program-name'. Internal use.") +;; Allow dynamically binding ispell-base-dicts-override-alist as +;; advertised in the doc string of ispell-initialize-spellchecker-hook. +(defvar ispell-base-dicts-override-alist) + (defvar ispell-initialize-spellchecker-hook nil "Normal hook run on spellchecker initialization. This hook is run when a spellchecker is used for the first From 45904142652a11ad48cb365f0c1530dc013bee20 Mon Sep 17 00:00:00 2001 From: Daniel Pittman Date: Fri, 4 May 2018 17:37:10 +0300 Subject: [PATCH 06/10] Avoid errors in ispell.el when Enchant returns empty extra chars * lisp/textmodes/ispell.el (ispell--get-extra-word-characters): Handle the case of empty extra characters returned by the Enchant '-lsmod' command. (Bug#31344) Copyright-paperwork-exempt: yes --- lisp/textmodes/ispell.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 88ab7fe1e959..3674a7080be8 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -1206,8 +1206,10 @@ Internal use.") (defun ispell--get-extra-word-characters (&optional lang) "Get the extra word characters for LANG as a character class. If LANG is omitted, get the extra word characters for the default language." - (concat "[" (string-trim-right (apply 'ispell--call-enchant-lsmod - (append '("-word-chars") (if lang `(,lang))))) "]")) + (let ((extra (string-trim-right + (apply 'ispell--call-enchant-lsmod + (append '("-word-chars") (if lang `(,lang))))))) + (if (string= extra "") "" (concat "[" extra "]")))) (defun ispell-find-enchant-dictionaries () "Find Enchant's dictionaries, and record in `ispell-enchant-dictionary-alist'." From 58f9e15a49efc3148359ad4c889b8105183d27bc Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 4 May 2018 17:43:29 +0300 Subject: [PATCH 07/10] A minor addition to etc/DEBUG * etc/DEBUG: Add a note for macOS users who get error messages when trying to run GDB. --- etc/DEBUG | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/etc/DEBUG b/etc/DEBUG index ac95c7c8dc64..bd6ea74fa72b 100644 --- a/etc/DEBUG +++ b/etc/DEBUG @@ -78,6 +78,14 @@ described in the node "Auto-loading safe path" in the GDB user manual. If nothing else helps, type "source /path/to/.gdbinit RET" at the GDB prompt, to unconditionally load the GDB init file. +Running GDB on macOS sometimes brings an error message like this: + + Unable to find Mach task port for process-id NNN: (os/kern) failure (0x5). + +To overcome this, search the Internet for the phrase "Unable to find +Mach task port for process-id", and you will find detailed +instructions to follow. + *** Use the Emacs GDB UI front-end We recommend using the GUI front-end for GDB provided by Emacs. With From 7ddcc9ab1a862414b9481af7a587c4add2b60abe Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 4 May 2018 18:00:02 +0300 Subject: [PATCH 08/10] Document 'custom-group' * doc/lispref/customize.texi (Group Definitions): Document the 'custom-group' property. --- doc/lispref/customize.texi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi index 7fea507fd032..4d88d7c8c98d 100644 --- a/doc/lispref/customize.texi +++ b/doc/lispref/customize.texi @@ -257,6 +257,13 @@ customizable variable @code{custom-unlispify-remove-prefixes} is non-@code{nil}, the item's tag will omit @var{prefix}. A group can have any number of prefixes. @end table + +@cindex @code{custom-group} property +The variables and subgroups of a group are stored in the +@code{custom-group} property of the group's symbol. @xref{Symbol +Plists}. The value of that property is a list of pairs whose +@code{car} is the variable or subgroup symbol and the @code{cdr} is +either @code{custom-variable} or @code{custom-group}. @end defmac @defopt custom-unlispify-remove-prefixes From 91a68b5f61db50344c6a5df497f55370d54a7b15 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 4 May 2018 18:12:32 +0300 Subject: [PATCH 09/10] ; * msdos/INSTALL: Add info about GCC versions. --- msdos/INSTALL | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/msdos/INSTALL b/msdos/INSTALL index 3b343f145636..3707f436625f 100644 --- a/msdos/INSTALL +++ b/msdos/INSTALL @@ -19,6 +19,15 @@ the necessary utilities; search for "MS-DOS". The configuration step (see below) will test for these utilities and will refuse to continue if any of them isn't found. +You should carefully choose the version of GCC you use to build Emacs, +because recent versions of GCC don't support building Emacs very well. +The main issue is the debug info: the DJGPP build of Emacs must use +the COFF debug info. GCC support for COFF debug info was steadily +deteriorating since GCC 5, and GCC 8.1 officially stopped supporting +the -gcoff switch, which the Emacs build process needs. We recommend +using GCC 3.4.X and Binutils 2.26; GDB 7.2 is capable to debug an +Emacs binary built by this combination. + Bootstrapping Emacs or recompiling Lisp files in the `lisp' subdirectory using the various targets in the lisp/Makefile file requires additional utilities: `find' (from Findutils), GNU `echo' and @@ -70,15 +79,15 @@ Running "config msdos" checks for several programs that are required to configure and build Emacs; if one of those programs is not found, CONFIG.BAT stops and prints an error message. -On Windows NT and Windows 2000/XP/Vista/7, running "config msdos" +On Windows NT and Windows 2000/XP and later, running "config msdos" might print an error message like "VDM has been already loaded". This is because those systems have a program called `redir.exe' which is incompatible with a program by the same name supplied with DJGPP, which is used by config.bat. To resolve this, move the DJGPP's `bin' subdirectory to the front of your PATH environment variable. -Windows Vista/7 has several bugs in its DPMI server related to memory -allocation: it fails DPMI resize memory block function, and it +Windows Vista and later has several bugs in its DPMI server related to +memory allocation: it fails DPMI resize memory block function, and it arbitrarily limits the default amount of DPMI memory to 32MB. To work around these bugs, first configure Emacs to use the `malloc' function from the DJGPP library. To this end, run CONFIG.BAT with the From 1d732d699d63b5dbfa7d0a0f44e6119d58f852bc Mon Sep 17 00:00:00 2001 From: Xu Chunyang Date: Sun, 6 May 2018 22:46:04 +0300 Subject: [PATCH 10/10] Fix gud-statement for pdb * lisp/progmodes/gud.el (pdb): Fix the gud-print implementation. (Bug#31363) --- lisp/progmodes/gud.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 15b428bb68b9..9cf818e99ea9 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -1694,8 +1694,7 @@ and source-file directory for your debugger." (gud-def gud-up "up" "<" "Up one stack frame.") (gud-def gud-down "down" ">" "Down one stack frame.") (gud-def gud-print "p %e" "\C-p" "Evaluate Python expression at point.") - ;; Is this right? - (gud-def gud-statement "! %e" "\C-e" "Execute Python statement at point.") + (gud-def gud-statement "!%e" "\C-e" "Execute Python statement at point.") ;; (setq comint-prompt-regexp "^(.*pdb[+]?) *") (setq comint-prompt-regexp "^(Pdb) *")