[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master f5357b1 1/2: Merge from emacs-26
From: |
Noam Postavsky |
Subject: |
[Emacs-diffs] master f5357b1 1/2: Merge from emacs-26 |
Date: |
Fri, 26 Jan 2018 21:01:52 -0500 (EST) |
branch: master
commit f5357b1ca4ae90e7ad6d8321884319cfdf828508
Merge: c9a2685 463f96b
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
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
---
doc/emacs/frames.texi | 29 ++++++++++--------
doc/emacs/help.texi | 4 +--
doc/lispref/objects.texi | 5 ++--
doc/lispref/searching.texi | 10 ++++++-
doc/misc/cl.texi | 2 +-
lisp/dired-x.el | 4 ++-
lisp/url/url-file.el | 1 +
lisp/url/url-misc.el | 1 +
src/gtkutil.c | 9 ++++--
src/process.c | 2 +-
src/syntax.c | 7 ++++-
src/xfns.c | 11 +++++++
src/xterm.c | 13 +++++---
test/README | 6 ++++
test/lisp/url/url-file-resources/file.txt | 1 +
test/lisp/url/url-file-tests.el | 50 +++++++++++++++++++++++++++++++
test/lisp/url/url-misc-tests.el | 41 +++++++++++++++++++++++++
17 files changed, 167 insertions(+), 29 deletions(-)
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index 06e9343..1b63ee5 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}).
address@hidden (@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
@@ -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
address@hidden 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
address@hidden 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}
@@ -998,7 +999,9 @@ when the entire buffer is visible.
@cindex scroll-bar face
The visual appearance of the scroll bars is controlled by the
address@hidden face.
address@hidden 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
@@ -1018,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
address@hidden 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.
address@hidden 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
@@ -1073,7 +1078,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}).
diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi
index d4a03c7..2ed2642 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
diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi
index 7cbc61d..af74062 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
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index 552001e..e759967 100644
--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -639,7 +639,15 @@ and nothing else. @address@hidden@}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
address@hidden
+2**15 @minus{} 1
address@hidden ifnottex
address@hidden
address@hidden
address@hidden tex
+.
For example, @address@hidden,address@hidden matches the strings @samp{car},
@samp{cdr}, @samp{caar}, @samp{cadr}, @samp{cdar}, and @samp{cddr}, and
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi
index 76f739f..709e983 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.
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 74e5fb4..a90f1f4 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) .
diff --git a/lisp/url/url-file.el b/lisp/url/url-file.el
index f6446c0..4fac406 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 9a13732..e794786 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/src/gtkutil.c b/src/gtkutil.c
index 825651c..3f21288 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -825,6 +825,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)
{
@@ -840,8 +841,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);
@@ -849,9 +851,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/process.c b/src/process.c
index daa0dc6..ff3edbb 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1437,7 +1437,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)
diff --git a/src/syntax.c b/src/syntax.c
index a797766..52cec23 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1108,7 +1108,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;
diff --git a/src/xfns.c b/src/xfns.c
index 43c55cc..92cd12b 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -4938,6 +4938,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 = 1;
#if GTK_CHECK_VERSION (3, 22, 0)
GdkMonitor *monitor = gdk_display_get_monitor (gdpy, i);
@@ -4983,6 +4984,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);
+#elif GTK_CHECK_VERSION (3, 10, 0)
+ 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;
diff --git a/src/xterm.c b/src/xterm.c
index 0a2068d..7603e4f 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10301,6 +10301,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)
{
@@ -10323,11 +10326,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;
}
@@ -10346,8 +10350,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);
diff --git a/test/README b/test/README
index 7f4afb3..1cd9db3 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 <filename> 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.)
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 0000000..b0b4e38e
--- /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 0000000..969bca7
--- /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 <https://www.gnu.org/licenses/>.
+
+;;; 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 0000000..fec2609
--- /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 <https://www.gnu.org/licenses/>.
+
+;;; 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