commit d1cfe4641d89259210304cf75011a22cc765e2ed (HEAD, refs/remotes/origin/master) Author: Martin Rudalics Date: Sat Jan 27 08:29:18 2018 +0100 In bindings.el fix check whether mode line can be dragged * lisp/bindings.el (mode-line-default-help-echo): Use check whether mode line can be dragged from 'mouse-drag-mode-line'. diff --git a/lisp/bindings.el b/lisp/bindings.el index 9960ba615a..60823445b9 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -125,15 +125,18 @@ corresponding to the mode line clicked." ;;; Mode line contents (defun mode-line-default-help-echo (window) - "Return default help echo text for WINDOW's mode-line." + "Return default help echo text for WINDOW's mode line." (let* ((frame (window-frame window)) (line-1a ;; Show text to select window only if the window is not ;; selected. (not (eq window (frame-selected-window frame)))) (line-1b - ;; Show text to drag modeline if and only if it can be done. - (or (window-in-direction 'below window) + ;; Show text to drag mode line if either the window is not + ;; at the bottom of its frame or the minibuffer window of + ;; this frame can be resized. This matches a corresponding + ;; check in `mouse-drag-mode-line'. + (or (not (window-at-side-p window 'bottom)) (let ((mini-window (minibuffer-window frame))) (and (eq frame (window-frame mini-window)) (or (minibuffer-window-active-p mini-window) @@ -166,7 +169,7 @@ corresponding to the mode line clicked." If the value is a string, it specifies the tooltip or echo area message to display when the mouse is moved over the mode line. If the value is a function, call that function with one argument -- the window whose mode-line to display. If the text at the +- the window whose mode line to display. If the text at the mouse position has a `help-echo' text property, that overrides this variable." :type '(choice commit 2ce56c51a83f6658cc6c79e4cc3716cfddbb03ff Author: Glenn Morris Date: Fri Jan 26 19:53:20 2018 -0800 Workaround a libotf crash with Kannada font (bug#30193) * configure.ac (HAVE_OTF_KANNADA_BUG): New define. * src/xfaces.c (syms_of_xfaces) : Add problematic Kannada font if necessary. diff --git a/configure.ac b/configure.ac index 1c4255da3f..eb7e5ee260 100644 --- a/configure.ac +++ b/configure.ac @@ -3303,6 +3303,11 @@ if test "${HAVE_X11}" = "yes"; then AC_DEFINE(HAVE_OTF_GET_VARIATION_GLYPHS, 1, [Define to 1 if libotf has OTF_get_variation_glyphs.]) fi + EMACS_CHECK_MODULES([OTFOK], [libotf >= 0.9.16]) + if test "$HAVE_OTFOK" != "yes"; then + AC_DEFINE(HAVE_OTF_KANNADA_BUG, 1, +[Define to 1 if libotf is affected by https://debbugs.gnu.org/28110.]) + fi fi fi dnl FIXME should there be an error if HAVE_FREETYPE != yes? diff --git a/src/xfaces.c b/src/xfaces.c index 34797994c3..77afee4587 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -6526,7 +6526,12 @@ other font of the appropriate family and registry is available. */); doc: /* List of ignored fonts. Each element is a regular expression that matches names of fonts to ignore. */); +#ifdef HAVE_OTF_KANNADA_BUG + /* https://debbugs.gnu.org/30193 */ + Vface_ignored_fonts = list1 (build_string ("Noto Serif Kannada")); +#else Vface_ignored_fonts = Qnil; +#endif DEFVAR_LISP ("face-remapping-alist", Vface_remapping_alist, doc: /* Alist of face remappings. commit e3b46f0b9ea75d80d6cdd85e9f801304b285ee6d Author: Glenn Morris Date: Fri Jan 26 19:18:23 2018 -0800 ; * test/lisp/textmodes/fill-tests.el: Fix copyright years. diff --git a/test/lisp/textmodes/fill-tests.el b/test/lisp/textmodes/fill-tests.el index 03323090f9..a2bcde44b9 100644 --- a/test/lisp/textmodes/fill-tests.el +++ b/test/lisp/textmodes/fill-tests.el @@ -1,6 +1,6 @@ ;;; fill-test.el --- ERT tests for fill.el -*- lexical-binding: t -*- -;; Copyright (C) 2017 Free Software Foundation, Inc. +;; Copyright (C) 2017-2018 Free Software Foundation, Inc. ;; Author: Marcin Borkowski ;; Keywords: text, wp commit 42a184ac534f7ab3ac314423f92f0f87b75f26ae Author: Noah Friedman Date: Fri Jan 26 18:52:19 2018 -0800 Bring emacs-buffer.gdb up to date with recent lisp.h changes. diff --git a/etc/emacs-buffer.gdb b/etc/emacs-buffer.gdb index 8a4d6485bf..6bb37f3c8d 100644 --- a/etc/emacs-buffer.gdb +++ b/etc/emacs-buffer.gdb @@ -81,7 +81,7 @@ set $yfile_buffers_only = 0 define ygetptr set $ptr = $arg0 - set $ptr = (CHECK_LISP_OBJECT_TYPE ? $ptr.i : $ptr) & VALMASK + set $ptr = (EMACS_INT) (CHECK_LISP_OBJECT_TYPE ? $ptr.i : $ptr) & VALMASK end # Get the value of Qnil for comparison. Needed when @@ -103,12 +103,12 @@ define ybuffer-list ygetptr $alist set $alist = $ptr while $alist != $qnil - set $this = ((struct Lisp_Cons *) $ptr)->car - set $alist = ((struct Lisp_Cons *) $ptr)->u.cdr + set $this = ((struct Lisp_Cons *) $ptr)->u.s.car + set $alist = ((struct Lisp_Cons *) $ptr)->u.s.u.cdr # Vbuffer_alist elts are pairs of the form (name . buffer) ygetptr $this - set $buf = ((struct Lisp_Cons *) $ptr)->u.cdr + set $buf = ((struct Lisp_Cons *) $ptr)->u.s.u.cdr ygetptr $buf set $buf = (struct buffer *) $ptr @@ -116,17 +116,17 @@ define ybuffer-list set $fname = $ptr if ! ($files_only && $fname == $qnil) ygetptr $buf->name_ - set $name = ((struct Lisp_String *) $ptr)->data + set $name = ((struct Lisp_String *) $ptr)->u.s.data set $modp = ($buf->text->modiff > $buf->text->save_modiff) ? '*' : ' ' ygetptr $buf->mode_name_ - set $mode = ((struct Lisp_String *) $ptr)->data + set $mode = ((struct Lisp_String *) $ptr)->u.s.data if $fname != $qnil ygetptr $buf->filename_ printf "%2d %c %9d %-20s %-10s %s\n", \ $i, $modp, ($buf->text->z_byte - 1), $name, $mode, \ - ((struct Lisp_String *) $fname)->data + ((struct Lisp_String *) $fname)->u.s.data else printf "%2d %c %9d %-20s %-10s\n", \ $i, $modp, ($buf->text->z_byte - 1), $name, $mode @@ -161,18 +161,18 @@ define yset-buffer ygetptr $alist set $alist = $ptr while ($alist != $qnil && $i > 0) - set $alist = ((struct Lisp_Cons *) $ptr)->u.cdr + set $alist = ((struct Lisp_Cons *) $ptr)->u.s.u.cdr ygetptr $alist set $alist = $ptr set $i-- end # Get car of alist; this is a pair (name . buffer) - set $this = ((struct Lisp_Cons *) $alist)->car + set $this = ((struct Lisp_Cons *) $alist)->u.s.car # Get the buffer object ygetptr $this - set $this = ((struct Lisp_Cons *) $ptr)->u.cdr + set $this = ((struct Lisp_Cons *) $ptr)->u.s.u.cdr ygetptr $this set $ycurrent_buffer = (struct buffer *) $ptr @@ -206,7 +206,7 @@ end define yget-current-buffer-name set $this = $ycurrent_buffer->name_ ygetptr $this - set $ycurrent_buffer_name = ((struct Lisp_String *) $ptr)->data + set $ycurrent_buffer_name = ((struct Lisp_String *) $ptr)->u.s.data end document yget-current-buffer-name Set $ycurrent_buffer_name to the name of the currently selected buffer. commit 559f1606166822394df3988c18c0ad02984ac675 Author: Noam Postavsky Date: Mon Dec 11 18:53:34 2017 -0500 Raise limit of regexp repetition (Bug#24914) * src/regex.h (RE_DUP_MAX): Raise limit to 2^16-1. * etc/NEWS: Announce it. * doc/lispref/searching.texi (Regexp Backslash): Document it. * test/src/regex-tests.el (regex-repeat-limit): Test it. * src/regex.h (reg_errcode_t): Add REG_ESIZEBR code. * src/regex.c (re_error_msgid): Add corresponding entry. (GET_INTERVAL_COUNT): Return it instead of the more generic REG_EBADBR when encountering a repetition greater than RE_DUP_MAX. * lisp/isearch.el (isearch-search): Don't convert errors starting with "Invalid" into "incomplete". Such errors are not incomplete, in the sense that they cannot be corrected by appending more characters to the end of the regexp. The affected error messages are: - REG_BADPAT "Invalid regular expression" - \\(?X:\\) where X is not a legal group number - \\_X where X is not < or > - REG_ECOLLATE "Invalid collation character" - There is no code to throw this. - REG_ECTYPE "Invalid character class name" - [[:foo:] where foo is not a valid class name - REG_ESUBREG "Invalid back reference" - \N where N is referenced before matching group N - REG_BADBR "Invalid content of \\{\\}" - \\{N,M\\} where N < 0, M < N, M or N larger than max - \\{NX where X is not a digit or backslash - \\{N\\X where X is not a } - REG_ERANGE "Invalid range end" - There is no code to throw this. - REG_BADRPT "Invalid preceding regular expression" - We never throw this. It would usually indicate a "*" with no preceding regexp text, but Emacs allows that to match a literal "*". diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index e759967aa8..26985b5d26 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -642,10 +642,10 @@ is omitted, the minimum is 0; if @var{n} is omitted, there is no maximum. For both forms, @var{m} and @var{n}, if specified, may be no larger than @ifnottex -2**15 @minus{} 1 +2**16 @minus{} 1 @end ifnottex @tex -@math{2^{15}-1} +@math{2^{16}-1} @end tex . diff --git a/etc/NEWS b/etc/NEWS index ad31553603..27bde2d147 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -80,6 +80,13 @@ indirectly, e.g., by checking that functions like It blocks line breaking after a one-letter word, also in the case when this word is preceded by a non-space, but non-alphanumeric character. ++++ +** The limit on repetitions in regexps has been raised to 2^16-1. +It was previously limited to 2^15-1. For example, the following +regular expression was previously invalid, but is now accepted: + + x\{32768\} + * Editing Changes in Emacs 27.1 diff --git a/lisp/isearch.el b/lisp/isearch.el index 23dd9afccd..9297c0f95b 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2858,7 +2858,7 @@ Optional third argument, if t, means if fail just return nil (no error). (setq isearch-error (car (cdr lossage))) (cond ((string-match - "\\`Premature \\|\\`Unmatched \\|\\`Invalid " + "\\`Premature \\|\\`Unmatched " isearch-error) (setq isearch-error "incomplete input")) ((and (not isearch-regexp) diff --git a/src/regex.c b/src/regex.c index 2185fc97d3..122cf71242 100644 --- a/src/regex.c +++ b/src/regex.c @@ -1194,7 +1194,8 @@ static const char *re_error_msgid[] = gettext_noop ("Premature end of regular expression"), /* REG_EEND */ gettext_noop ("Regular expression too big"), /* REG_ESIZE */ gettext_noop ("Unmatched ) or \\)"), /* REG_ERPAREN */ - gettext_noop ("Range striding over charsets") /* REG_ERANGEX */ + gettext_noop ("Range striding over charsets"), /* REG_ERANGEX */ + gettext_noop ("Invalid content of \\{\\}, repetitions too big") /* REG_ESIZEBR */ }; /* Whether to allocate memory during matching. */ @@ -1915,7 +1916,7 @@ struct range_table_work_area if (num < 0) \ num = 0; \ if (RE_DUP_MAX / 10 - (RE_DUP_MAX % 10 < c - '0') < num) \ - FREE_STACK_RETURN (REG_BADBR); \ + FREE_STACK_RETURN (REG_ESIZEBR); \ num = num * 10 + c - '0'; \ if (p == pend) \ FREE_STACK_RETURN (REG_EBRACE); \ diff --git a/src/regex.h b/src/regex.h index b4aad6daac..6974951f57 100644 --- a/src/regex.h +++ b/src/regex.h @@ -270,8 +270,10 @@ extern ptrdiff_t emacs_re_safe_alloca; #ifdef RE_DUP_MAX # undef RE_DUP_MAX #endif -/* If sizeof(int) == 2, then ((1 << 15) - 1) overflows. */ -#define RE_DUP_MAX (0x7fff) +/* Repeat counts are stored in opcodes as 2 byte integers. This was + previously limited to 7fff because the parsing code uses signed + ints. But Emacs only runs on 32 bit platforms anyway. */ +#define RE_DUP_MAX (0xffff) /* POSIX `cflags' bits (i.e., information for `regcomp'). */ @@ -337,7 +339,8 @@ typedef enum REG_EEND, /* Premature end. */ REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */ REG_ERPAREN, /* Unmatched ) or \); not returned from regcomp. */ - REG_ERANGEX /* Range striding over charsets. */ + REG_ERANGEX, /* Range striding over charsets. */ + REG_ESIZEBR /* n or m too big in \{n,m\} */ } reg_errcode_t; /* This data structure represents a compiled pattern. Before calling diff --git a/test/src/regex-tests.el b/test/src/regex-tests.el index 86aa7d2635..083ed5c4c8 100644 --- a/test/src/regex-tests.el +++ b/test/src/regex-tests.el @@ -677,4 +677,10 @@ This evaluates the PTESTS test cases from glibc." This evaluates the TESTS test cases from glibc." (should-not (regex-tests-TESTS))) +(ert-deftest regex-repeat-limit () + "Test the #xFFFF repeat limit." + (should (string-match "\\`x\\{65535\\}" (make-string 65535 ?x))) + (should-not (string-match "\\`x\\{65535\\}" (make-string 65534 ?x))) + (should-error (string-match "\\`x\\{65536\\}" "X") :type 'invalid-regexp)) + ;;; regex-tests.el ends here commit f5357b1ca4ae90e7ad6d8321884319cfdf828508 Merge: c9a268552c 463f96b481 Author: Noam Postavsky Date: Fri Jan 26 20:45:38 2018 -0500 Merge from emacs-26 463f96b481 * doc/lispref/searching.texi: Document regexp repetition l... 08a6195571 ; test/README: Document TEST_LOAD_EL parameter. 7bbea90b1a * src/syntax.c (char-syntax): Warn about ignoring text pro... 50fcbb5f61 ; * src/process.c (Fprocess_contact): Fix docstring typo. 81ae9c8c05 Load mm-util as needed for url-file and url-data (Bug#30258) 5a1ee67ae1 Another minor copyedit in the manual's "Scroll Bars" 226a651e9e Minor fix in documentation of 'equal' b26786c8d9 * lisp/dired-x.el (dired-guess-shell-alist-user): Doc fix.... 5699a824f0 Minor rewording in Emacs manual's "Help Mode" node f35ff0156e Fixes for Emacs manual in frames.texi 6cd4e8dcc5 * doc/misc/cl.texi (Efficiency Concerns): Fix 2012-10-27 t... 1412cf3edd Fix a few issues with latest GTK scaling changes 59db8dca03 Use scaled coordinates when calling into GTK 2892f05792 Scale monitor dimensions obtained from GTK commit 463f96b4813fb77d88a7b0fa93f94aa08d71689f Author: Noam Postavsky Date: Mon Dec 11 18:52:52 2017 -0500 * doc/lispref/searching.texi: Document regexp repetition limit. diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 552001e890..e759967aa8 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -639,7 +639,15 @@ and nothing else. @samp{c[ad]\@{3\@}r} matches string such as is a more general postfix operator that specifies repetition with a minimum of @var{m} repeats and a maximum of @var{n} repeats. If @var{m} is omitted, the minimum is 0; if @var{n} is omitted, there is no -maximum. +maximum. For both forms, @var{m} and @var{n}, if specified, may be no +larger than +@ifnottex +2**15 @minus{} 1 +@end ifnottex +@tex +@math{2^{15}-1} +@end tex +. For example, @samp{c[ad]\@{1,2\@}r} matches the strings @samp{car}, @samp{cdr}, @samp{caar}, @samp{cadr}, @samp{cdar}, and @samp{cddr}, and commit 08a6195571194f961fb898ebbf307c0aa13785a6 Author: Noam Postavsky Date: Wed Jan 3 19:14:05 2018 -0500 ; test/README: Document TEST_LOAD_EL parameter. diff --git a/test/README b/test/README index 7f4afb32bd..1cd9db3bb8 100644 --- a/test/README +++ b/test/README @@ -44,6 +44,12 @@ If your test file contains the tests "test-foo", "test2-foo" and "test-foo-remote", and you want to run only the former two tests, you could use a selector regexp: "make SELECTOR='\"foo$$\"'". +Note that although the test files are always compiled (unless they set +no-byte-compile), the source files will be run by default, to give +nicer backtraces. To run the compiled version of a test use + + make TEST_LOAD_EL=no ... + (Also, see etc/compilation.txt for compilation mode font lock tests.) commit 7bbea90b1a82c09a6bb218ac9b50d39027757b31 Author: Noam Postavsky Date: Wed Apr 5 20:16:30 2017 -0400 * src/syntax.c (char-syntax): Warn about ignoring text properties (Bug#22765). diff --git a/src/syntax.c b/src/syntax.c index 6386679618..e6a21e5433 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -1087,7 +1087,12 @@ DEFUN ("char-syntax", Fchar_syntax, Schar_syntax, 1, 1, 0, For example, if CHARACTER is a word constituent, the character `w' (119) is returned. The characters that correspond to various syntax codes -are listed in the documentation of `modify-syntax-entry'. */) +are listed in the documentation of `modify-syntax-entry'. + +If you're trying to determine the syntax of characters in the buffer, +this is probably the wrong function to use, because it can't take +`syntax-table' text properties into account. Consider using +`syntax-after' instead. */) (Lisp_Object character) { int char_int; commit 50fcbb5f610bfc4f990e841d917a5bccd9bb4175 Author: Noam Postavsky Date: Thu Dec 14 07:46:51 2017 -0500 ; * src/process.c (Fprocess_contact): Fix docstring typo. diff --git a/src/process.c b/src/process.c index 36fb8a70cf..8a438cfeb8 100644 --- a/src/process.c +++ b/src/process.c @@ -1440,7 +1440,7 @@ optional KEY arg. If KEY is nil, value is a cons cell of the form connection; it is t for a pipe connection. If KEY is t, the complete contact information for the connection is returned, else the specific value for the keyword KEY is returned. See `make-network-process', -`make-serial-process', or `make pipe-process' for the list of keywords. +`make-serial-process', or `make-pipe-process' for the list of keywords. If PROCESS is a non-blocking network process that hasn't been fully set up yet, this function will block until socket setup has completed. */) (Lisp_Object process, Lisp_Object key) commit 81ae9c8c058d17d276a4443f6938aa3b57a40ca4 Author: Noam Postavsky Date: Fri Jan 26 09:04:47 2018 -0500 Load mm-util as needed for url-file and url-data (Bug#30258) * lisp/url/url-file.el (url-file): * lisp/url/url-misc.el (url-data): Require `mm-util' before calling `mm-disable-multibyte'. * test/lisp/url/url-file-resources/file.txt: * test/lisp/url/url-file-tests.el: * test/lisp/url/url-misc-tests.el: New tests. diff --git a/lisp/url/url-file.el b/lisp/url/url-file.el index f6446c0816..4fac406023 100644 --- a/lisp/url/url-file.el +++ b/lisp/url/url-file.el @@ -188,6 +188,7 @@ to them." (url-find-file-dired filename) (with-current-buffer (setq buffer (generate-new-buffer " *url-file*")) + (require 'mm-util) (mm-disable-multibyte) (setq url-current-object url) (insert "Content-type: " (or content-type "application/octet-stream") "\n") diff --git a/lisp/url/url-misc.el b/lisp/url/url-misc.el index 9a13732b7a..e794786f3a 100644 --- a/lisp/url/url-misc.el +++ b/lisp/url/url-misc.el @@ -99,6 +99,7 @@ (eq ?\; (aref mediatype 0))) (setq mediatype (concat "text/plain" mediatype)))) (set-buffer (generate-new-buffer " *url-data*")) + (require 'mm-util) (mm-disable-multibyte) (insert (format "Content-Length: %d\n" (length data)) "Content-Type: " mediatype "\n" diff --git a/test/lisp/url/url-file-resources/file.txt b/test/lisp/url/url-file-resources/file.txt new file mode 100644 index 0000000000..b0b4e38e5f --- /dev/null +++ b/test/lisp/url/url-file-resources/file.txt @@ -0,0 +1 @@ +Some file data diff --git a/test/lisp/url/url-file-tests.el b/test/lisp/url/url-file-tests.el new file mode 100644 index 0000000000..969bca7f8d --- /dev/null +++ b/test/lisp/url/url-file-tests.el @@ -0,0 +1,50 @@ +;;; url-file-tests.el --- Test suite for url-file. -*- lexical-binding: t -*- + +;; Copyright (C) 2018 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;;; Code: + +(require 'url-file) +(require 'ert) + +(defconst url-file-tests-data-directory + (expand-file-name "lisp/url/url-file-resources" + (or (getenv "EMACS_TEST_DIRECTORY") + (expand-file-name "../../.." + (or load-file-name + buffer-file-name)))) + "Directory for url-file test files.") + +(ert-deftest url-file () + "Test reading file via file:// URL." + (let ((file (expand-file-name "file.txt" url-file-tests-data-directory))) + (should (equal + (with-current-buffer + (url-file (url-generic-parse-url (concat "file://" file)) + #'ignore nil) + (prog1 (buffer-substring (point) (point-max)) + (kill-buffer))) + (with-temp-buffer + (insert-file-contents-literally file) + (buffer-string)))))) + +(provide 'url-file-tests) + +;;; url-file-tests.el ends here diff --git a/test/lisp/url/url-misc-tests.el b/test/lisp/url/url-misc-tests.el new file mode 100644 index 0000000000..fec2609bb7 --- /dev/null +++ b/test/lisp/url/url-misc-tests.el @@ -0,0 +1,41 @@ +;;; url-misc-tests.el --- Test suite for url-misc. -*- lexical-binding: t -*- + +;; Copyright (C) 2018 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;;; Code: + +(require 'url-misc) +(require 'ert) + +(ert-deftest url-misc-data () + "Test reading data: URL." + (should (equal + (with-current-buffer + (url-data (url-generic-parse-url "data:;,some%20text")) + (goto-char (point-min)) + (forward-paragraph) + (forward-line) + (prog1 (buffer-substring (point) (point-max)) + (kill-buffer))) + "some text"))) + +(provide 'url-misc-tests) + +;;; url-misc-tests.el ends here commit c9a268552c8294bbca607da239528e6b89f8fb5b Author: Stefan Monnier Date: Fri Jan 26 16:37:29 2018 -0500 * lisp/emacs-lisp/cl-preloaded.el: Update cl-slot-descriptor name. diff --git a/lisp/emacs-lisp/cl-preloaded.el b/lisp/emacs-lisp/cl-preloaded.el index 4e73a4a31b..92d29996f9 100644 --- a/lisp/emacs-lisp/cl-preloaded.el +++ b/lisp/emacs-lisp/cl-preloaded.el @@ -61,7 +61,7 @@ (fset 'cl--make-slot-desc ;; To break circularity, we pre-define the slot constructor by hand. ;; It's redefined a bit further down as part of the cl-defstruct of - ;; cl--slot-descriptor. + ;; cl-slot-descriptor. ;; BEWARE: Obviously, it's important to keep the two in sync! (lambda (name &optional initform type props) (record 'cl-slot-descriptor @@ -194,7 +194,7 @@ (name nil :type symbol) ;The type name. (docstring nil :type string) (parents nil :type (list-of cl--class)) ;The included struct. - (slots nil :type (vector cl--slot-descriptor)) + (slots nil :type (vector cl-slot-descriptor)) (index-table nil :type hash-table) (tag nil :type symbol) ;Placed in cl-tag-slot. Holds the struct-class object. (type nil :type (memq (vector list))) commit 606c94f47ddef5a5a3dcff13048369253bbdcb3c Author: Francesco Potortì Date: Fri Jan 26 16:11:33 2018 +0200 Fix a typo in rmail.el * lisp/mail/rmail.el (rmail-simplified-subject): Fix a typo in the regexp. (Bug#29659) diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 4e18252551..4e5873c06e 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -3403,7 +3403,7 @@ whitespace, replacing whitespace runs with a single space and removing prefixes such as Re:, Fwd: and so on and mailing list tags such as [tag]." (let ((subject (or (rmail-get-header "Subject" msgnum) "")) - (regexp "\`[ \t\n]*\\(\\(\\w\\{1,3\\}:\\|\\[[^]]+]\\)[ \t\n]+\\)*")) + (regexp "\\`[ \t\n]*\\(\\(\\w\\{1,3\\}:\\|\\[[^]]+]\\)[ \t\n]+\\)*")) (setq subject (rfc2047-decode-string subject)) (setq subject (replace-regexp-in-string regexp "" subject)) (replace-regexp-in-string "[ \t\n]+" " " subject))) commit 5a1ee67ae18bf992a7aa77b1b06cfa85950ba458 Author: Eli Zaretskii Date: Fri Jan 26 15:48:30 2018 +0200 Another minor copyedit in the manual's "Scroll Bars" * doc/emacs/frames.texi (Scroll Bars): Mention that up/down and left/right buttons may be absent from the toolkit scroll bars. Reported by Robert Pluim in emacs-manual-bugs@gnu.org. diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index bd836b2db6..1b63ee58de 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi @@ -949,11 +949,12 @@ that. On graphical displays, there is a @dfn{vertical scroll bar} on the side of each Emacs window. Clicking @kbd{mouse-1} on the scroll bar's -up and down buttons scrolls the window by one line at a time. Clicking -@kbd{mouse-1} above or below the scroll bar's inner box scrolls the -window by nearly the entire height of the window, like @kbd{M-v} and -@kbd{C-v} respectively (@pxref{Moving Point}). Dragging the inner box -scrolls continuously. +up and down buttons scrolls the window by one line at a time (but some +toolkits allow you to customize the scroll bars to not have those +buttons). Clicking @kbd{mouse-1} above or below the scroll bar's +inner box scrolls the window by nearly the entire height of the +window, like @kbd{M-v} and @kbd{C-v} respectively (@pxref{Moving +Point}). Dragging the inner box scrolls continuously. If Emacs is compiled on the X Window System without X toolkit support, the scroll bar behaves differently. Clicking @kbd{mouse-1} @@ -1020,10 +1021,12 @@ Manual}. @cindex Horizontal Scroll Bar mode On graphical displays with toolkit support, Emacs may also supply a @dfn{horizontal scroll bar} on the bottom of each window. Clicking -@kbd{mouse-1} on that scroll bar's left and right buttons scrolls -the window horizontally by one column at a time. Clicking @kbd{mouse-1} -on the left or right of the scroll bar's inner box scrolls the window by -four columns. Dragging the inner box scrolls the window continuously. +@kbd{mouse-1} on that scroll bar's left and right buttons scrolls the +window horizontally by one column at a time. (Note that some toolkits +allow customizations of the scroll bar that cause these buttons not to +be shown.) Clicking @kbd{mouse-1} on the left or right of the scroll +bar's inner box scrolls the window by four columns. Dragging the +inner box scrolls the window continuously. Note that such horizontal scrolling can make the window's position of point disappear on the left or the right. Typing a character to insert commit 226a651e9ed3dd3d94ae0722e59719ba949be316 Author: Eli Zaretskii Date: Fri Jan 26 12:38:07 2018 +0200 Minor fix in documentation of 'equal' * doc/lispref/objects.texi (Equality Predicates): Correct the conditions for equality of unibyte and multibyte strings. (Bug#30218) diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi index 7cbc61dc8e..af740625ad 100644 --- a/doc/lispref/objects.texi +++ b/doc/lispref/objects.texi @@ -2208,9 +2208,8 @@ text properties---it compares only the characters in the strings. @xref{Text Properties}. Use @code{equal-including-properties} to also compare text properties. For technical reasons, a unibyte string and a multibyte string are @code{equal} if and only if they contain the -same sequence of character codes and all these codes are either in the -range 0 through 127 (@acronym{ASCII}) or 160 through 255 -(@code{eight-bit-graphic}). (@pxref{Text Representations}). +same sequence of character codes and all these codes are in the range +0 through 127 (@acronym{ASCII}). @example @group commit 2b46ac7cee61b966fb7b07e297be4cb601e006e9 Author: Eli Zaretskii Date: Fri Jan 26 12:18:25 2018 +0200 Minor fix for "M-x pdb" * lisp/progmodes/gud.el (gud-pdb-marker-regexp): Add @ and SPC to the regexp. (Bug#30208) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 15b428bb68..72f5769558 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -1605,7 +1605,7 @@ and source-file directory for your debugger." ;; Last group is for return value, e.g. "> test.py(2)foo()->None" ;; Either file or function name may be omitted: "> (0)?()" (defvar gud-pdb-marker-regexp - "^> \\([-a-zA-Z0-9_/.:\\]*\\|\\)(\\([0-9]+\\))\\([a-zA-Z0-9_]*\\|\\?\\|\\)()\\(->[^\n\r]*\\)?[\n\r]") + "^> \\([-a-zA-Z0-9_/.:@ \\]*\\|\\)(\\([0-9]+\\))\\([a-zA-Z0-9_]*\\|\\?\\|\\)()\\(->[^\n\r]*\\)?[\n\r]") (defvar gud-pdb-marker-regexp-file-group 1) (defvar gud-pdb-marker-regexp-line-group 2) commit e08f241658667a328bade89ab479fc5f7389bb9b Author: Andy Moreton Date: Fri Jan 26 12:09:42 2018 +0200 Fix emacs-module-tests to work out of build tree * test/Makefile.in (test_module_dir): Build the test module library in a subdirectory of the build directory (not the source tree). (MODULE_CFLAGS): Fix location of emacs-module.h header file. (test_module): Move built library out of the source tree. * test/src/emacs-module-tests.el (mod-test-file): Locate the test module library relative to the running Emacs executable. diff --git a/test/Makefile.in b/test/Makefile.in index 3f4f8e7836..a85d491d2d 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -120,7 +120,7 @@ emacs = EMACSLOADPATH= LC_ALL=$(TEST_LOCALE) \ EMACS_TEST_DIRECTORY=$(abspath $(srcdir)) \ $(GDB) "$(EMACS)" $(MODULES_EMACSOPT) $(EMACSOPT) -test_module_dir := $(srcdir)/data/emacs-module +test_module_dir := data/emacs-module .PHONY: all check @@ -223,12 +223,13 @@ else FPIC_CFLAGS = -fPIC endif -MODULE_CFLAGS = -I$(srcdir)/../src $(FPIC_CFLAGS) $(PROFILING_CFLAGS) \ +MODULE_CFLAGS = -I../src $(FPIC_CFLAGS) $(PROFILING_CFLAGS) \ $(WARN_CFLAGS) $(WERROR_CFLAGS) $(CFLAGS) test_module = $(test_module_dir)/mod-test${SO} src/emacs-module-tests.log: $(test_module) $(test_module): $(test_module:${SO}=.c) $(srcdir)/../src/emacs-module.h + $(AM_V_at)${MKDIR_P} $(dir $@) $(AM_V_CCLD)$(CC) -shared $(CPPFLAGS) $(MODULE_CFLAGS) $(LDFLAGS) \ -o $@ $< endif diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el index d9406a9609..85d6305386 100644 --- a/test/src/emacs-module-tests.el +++ b/test/src/emacs-module-tests.el @@ -25,8 +25,7 @@ (eval-and-compile (defconst mod-test-file - (substitute-in-file-name - "$EMACS_TEST_DIRECTORY/data/emacs-module/mod-test") + (expand-file-name "../test/data/emacs-module/mod-test" invocation-directory) "File name of the module test file.")) (require 'mod-test mod-test-file) commit b26786c8d92e65a129d29d2c18c935965ac3a45a Author: Eli Zaretskii Date: Fri Jan 26 11:51:50 2018 +0200 * lisp/dired-x.el (dired-guess-shell-alist-user): Doc fix. (Bug#30192) diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 74e5fb4dd2..a90f1f4adc 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -1128,7 +1128,9 @@ Each element of this list looks like (REGEXP COMMAND...) where each COMMAND can either be a string or a Lisp expression that evaluates -to a string. This expression can access the file name as the variable `file'. +to a string. If this expression needs to consult the name of the file for +which the shell commands are being requested, it can access that file name +as the variable `file'. If several COMMANDs are given, the first one will be the default and the rest will be added temporarily to the history and can be retrieved with \\[previous-history-element] (M-p) . commit 5699a824f08e662a95377e357ae8dea8d5a9c938 Author: Eli Zaretskii Date: Fri Jan 26 11:43:05 2018 +0200 Minor rewording in Emacs manual's "Help Mode" node * doc/emacs/help.texi (Help Mode): Minor rewording of description of 'help-follow-symbol'. Suggested by Richard Stallman in emacs-manual-bugs@gnu.org. diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi index d4a03c746d..2ed264258e 100644 --- a/doc/emacs/help.texi +++ b/doc/emacs/help.texi @@ -468,8 +468,8 @@ last hyperlink moves back to the first hyperlink. To view all documentation about any symbol in the text, move point to the symbol and type @kbd{C-c C-c} (@code{help-follow-symbol}). -This shows all available documentation about the symbol---as a -variable, function and/or face. +This shows the documentation for all the meanings of the symbol---as a +variable, as a function, and/or as a face. @node Package Keywords @section Keyword Search for Packages commit f35ff0156e6db3ab675f3566a6ee8cb2285e4e37 Author: Eli Zaretskii Date: Fri Jan 26 11:25:24 2018 +0200 Fixes for Emacs manual in frames.texi * doc/emacs/frames.texi (Scroll Bars, Mouse Commands) (Window Dividers): Minor clarifications and spelling/markup changes. Suggested by Robert Pluim in emacs-manual-bugs@gnu.org. diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index 06e93438ed..bd836b2db6 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi @@ -98,7 +98,7 @@ invoked by clicking with the left mouse button, @kbd{mouse-1}, in the text area of a window. This moves point to the position where you clicked. If that window was not the selected window, it becomes the selected window. You can also activate a region by double-clicking -mouse-1 (@pxref{Word and Line Mouse}). +@kbd{mouse-1} (@pxref{Word and Line Mouse}). @vindex x-mouse-click-focus-ignore-position Normally, if the frame you clicked in was not the selected frame, it @@ -998,7 +998,9 @@ when the entire buffer is visible. @cindex scroll-bar face The visual appearance of the scroll bars is controlled by the -@code{scroll-bar} face. +@code{scroll-bar} face. (Some toolkits, such as GTK and MS-Windows, +ignore this face; the scroll-bar appearance there can only be +customized system-wide, for GTK @pxref{GTK resources}). @cindex vertical border On graphical frames, vertical scroll bars implicitly serve to separate @@ -1073,7 +1075,7 @@ customize the options @code{window-divider-default-bottom-width} and @code{window-divider-default-right-width}. When vertical scroll bars are disabled, dividers can be also useful to -make the first pixel column of a window visible which would be otherwise +make the first pixel column of a window visible, which would be otherwise covered by the vertical border used to separate side-by-side windows (@pxref{Scroll Bars}). commit 6cd4e8dcc50b2072e4eccba111dbb188eb61ebb7 Author: Glenn Morris Date: Wed Jan 24 17:20:41 2018 -0500 * doc/misc/cl.texi (Efficiency Concerns): Fix 2012-10-27 typo. diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 76f739f1ed..709e9836c9 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -4395,7 +4395,7 @@ is expanded at compile-time to the Lisp form @end example @noindent -which is the most efficient ways of doing this operation +which is the most efficient way of doing this operation in Lisp. Thus, there is no performance penalty for using the more readable @code{cl-incf} form in your compiled code. commit 1412cf3edd65103649cd7318c39ee4adeea43416 Author: Robert Pluim Date: Wed Jan 24 20:08:35 2018 +0100 Fix a few issues with latest GTK scaling changes * src/xfns.c (Fx_display_monitor_attributes_list): Call gdk_screen_get_monitor_scale_factor only for GTK versions 3.10..3.21. * src/xterm.c (x_set_offset): Call xg_get_scale for GTK only. diff --git a/src/xfns.c b/src/xfns.c index 4ea5113265..20fe61bffd 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -4940,7 +4940,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */) gint width_mm = -1, height_mm = -1; GdkRectangle rec, work; struct MonitorInfo *mi = &monitors[i]; - int scale; + int scale = 1; #if GTK_CHECK_VERSION (3, 22, 0) GdkMonitor *monitor = gdk_display_get_monitor (gdpy, i); @@ -4989,7 +4989,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */) /* GTK returns scaled sizes for the workareas. */ #if GTK_CHECK_VERSION (3, 22, 0) scale = gdk_monitor_get_scale_factor (monitor); -#else +#elif GTK_CHECK_VERSION (3, 10, 0) scale = gdk_screen_get_monitor_scale_factor (gscreen, i); #endif rec.width *= scale; diff --git a/src/xterm.c b/src/xterm.c index f05ac6147e..364a8a8db0 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10310,7 +10310,9 @@ void x_set_offset (struct frame *f, register int xoff, register int yoff, int change_gravity) { int modified_top, modified_left; +#ifdef USE_GTK int scale = xg_get_scale (f); +#endif if (change_gravity > 0) { commit 59db8dca030ba6a34d143c3cc6715f02beba1068 Author: Robert Pluim Date: Wed Jan 24 08:55:34 2018 +0100 Use scaled coordinates when calling into GTK This is part two of a two part fix for the GTK scaling problems. See the thread starting at http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00372.html for an explanation of why it has been added to Emacs 26. * src/gtkutil.c (xg_set_geometry): Scale down the coordinates that we pass to gtk_window_move and to gtk_window_parse_geometry. * src/xterm.c (x_set_offset): Likewise. diff --git a/src/gtkutil.c b/src/gtkutil.c index 123236f5f0..83b306a730 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -823,6 +823,7 @@ xg_set_geometry (struct frame *f) { if (f->size_hint_flags & (USPosition | PPosition)) { + int scale = xg_get_scale (f); #if ! GTK_CHECK_VERSION (3, 22, 0) if (x_gtk_use_window_move) { @@ -838,8 +839,9 @@ xg_set_geometry (struct frame *f) f->top_pos = (x_display_pixel_height (FRAME_DISPLAY_INFO (f)) - FRAME_PIXEL_HEIGHT (f) + f->top_pos); + /* GTK works in scaled pixels, so convert from X pixels. */ gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), - f->left_pos, f->top_pos); + f->left_pos / scale, f->top_pos / scale); /* Reset size hint flags. */ f->size_hint_flags &= ~ (XNegative | YNegative); @@ -847,9 +849,10 @@ xg_set_geometry (struct frame *f) } else { - int left = f->left_pos; + /* GTK works in scaled pixels, so convert from X pixels. */ + int left = f->left_pos / scale; int xneg = f->size_hint_flags & XNegative; - int top = f->top_pos; + int top = f->top_pos / scale; int yneg = f->size_hint_flags & YNegative; char geom_str[sizeof "=x--" + 4 * INT_STRLEN_BOUND (int)]; guint id; diff --git a/src/xterm.c b/src/xterm.c index f771631daf..f05ac6147e 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10310,6 +10310,7 @@ void x_set_offset (struct frame *f, register int xoff, register int yoff, int change_gravity) { int modified_top, modified_left; + int scale = xg_get_scale (f); if (change_gravity > 0) { @@ -10332,11 +10333,12 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_ if (x_gtk_use_window_move) { /* When a position change was requested and the outer GTK widget - has been realized already, leave it to gtk_window_move to DTRT - and return. Used for Bug#25851 and Bug#25943. */ + has been realized already, leave it to gtk_window_move to + DTRT and return. Used for Bug#25851 and Bug#25943. Convert + from X pixels to GTK scaled pixels. */ if (change_gravity != 0 && FRAME_GTK_OUTER_WIDGET (f)) gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), - f->left_pos, f->top_pos); + f->left_pos / scale, f->top_pos / scale); unblock_input (); return; } @@ -10355,8 +10357,9 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_ } #ifdef USE_GTK + /* Make sure we adjust for possible scaling. */ gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), - modified_left, modified_top); + modified_left / scale, modified_top / scale); #else XMoveWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), modified_left, modified_top); commit 2892f05792e1f52b0966f92c5ed1aa75dcdd66a3 Author: Robert Pluim Date: Wed Jan 24 08:53:59 2018 +0100 Scale monitor dimensions obtained from GTK This is part one of a two part fix for the GTK scaling problems. See the thread starting at http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00372.html for an explanation of why it has been added to Emacs 26. * src/xfns.c (Fx_display_monitor_attributes_list): Take scaling factor into account when using GTK to query the monitor dimensions, which allows frameset-restore to position frames correctly. diff --git a/src/xfns.c b/src/xfns.c index dd3b36c133..4ea5113265 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -4940,6 +4940,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */) gint width_mm = -1, height_mm = -1; GdkRectangle rec, work; struct MonitorInfo *mi = &monitors[i]; + int scale; #if GTK_CHECK_VERSION (3, 22, 0) GdkMonitor *monitor = gdk_display_get_monitor (gdpy, i); @@ -4985,6 +4986,16 @@ Internal use only, use `display-monitor-attributes-list' instead. */) } #endif + /* GTK returns scaled sizes for the workareas. */ +#if GTK_CHECK_VERSION (3, 22, 0) + scale = gdk_monitor_get_scale_factor (monitor); +#else + scale = gdk_screen_get_monitor_scale_factor (gscreen, i); +#endif + rec.width *= scale; + rec.height *= scale; + work.width *= scale; + work.height *= scale; mi->geom.x = rec.x; mi->geom.y = rec.y;