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
This commit is contained in:
Noam Postavsky 2018-01-26 20:45:38 -05:00
commit f5357b1ca4
17 changed files with 167 additions and 29 deletions

View file

@ -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
@ -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}
@ -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
@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
@ -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
@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
@ -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}).

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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.

View file

@ -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) .

View file

@ -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")

View file

@ -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"

View file

@ -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;

View file

@ -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)

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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.)

View file

@ -0,0 +1 @@
Some file data

View file

@ -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

View file

@ -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