aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoam Postavsky2018-01-26 20:45:38 -0500
committerNoam Postavsky2018-01-26 20:45:38 -0500
commitf5357b1ca4ae90e7ad6d8321884319cfdf828508 (patch)
tree5706d28900dd4f7441bae1629242a2ca029d645b
parentc9a268552c8294bbca607da239528e6b89f8fb5b (diff)
parent463f96b4813fb77d88a7b0fa93f94aa08d71689f (diff)
downloademacs-f5357b1ca4ae90e7ad6d8321884319cfdf828508.tar.gz
emacs-f5357b1ca4ae90e7ad6d8321884319cfdf828508.zip
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
-rw-r--r--doc/emacs/frames.texi29
-rw-r--r--doc/emacs/help.texi4
-rw-r--r--doc/lispref/objects.texi5
-rw-r--r--doc/lispref/searching.texi10
-rw-r--r--doc/misc/cl.texi2
-rw-r--r--lisp/dired-x.el4
-rw-r--r--lisp/url/url-file.el1
-rw-r--r--lisp/url/url-misc.el1
-rw-r--r--src/gtkutil.c9
-rw-r--r--src/process.c2
-rw-r--r--src/syntax.c7
-rw-r--r--src/xfns.c11
-rw-r--r--src/xterm.c13
-rw-r--r--test/README6
-rw-r--r--test/lisp/url/url-file-resources/file.txt1
-rw-r--r--test/lisp/url/url-file-tests.el50
-rw-r--r--test/lisp/url/url-misc-tests.el41
17 files changed, 167 insertions, 29 deletions
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index 06e93438ed2..1b63ee58de2 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
98text area of a window. This moves point to the position where you 98text area of a window. This moves point to the position where you
99clicked. If that window was not the selected window, it becomes the 99clicked. If that window was not the selected window, it becomes the
100selected window. You can also activate a region by double-clicking 100selected window. You can also activate a region by double-clicking
101mouse-1 (@pxref{Word and Line Mouse}). 101@kbd{mouse-1} (@pxref{Word and Line Mouse}).
102 102
103@vindex x-mouse-click-focus-ignore-position 103@vindex x-mouse-click-focus-ignore-position
104 Normally, if the frame you clicked in was not the selected frame, it 104 Normally, if the frame you clicked in was not the selected frame, it
@@ -949,11 +949,12 @@ that.
949 949
950 On graphical displays, there is a @dfn{vertical scroll bar} on the 950 On graphical displays, there is a @dfn{vertical scroll bar} on the
951side of each Emacs window. Clicking @kbd{mouse-1} on the scroll bar's 951side of each Emacs window. Clicking @kbd{mouse-1} on the scroll bar's
952up and down buttons scrolls the window by one line at a time. Clicking 952up and down buttons scrolls the window by one line at a time (but some
953@kbd{mouse-1} above or below the scroll bar's inner box scrolls the 953toolkits allow you to customize the scroll bars to not have those
954window by nearly the entire height of the window, like @kbd{M-v} and 954buttons). Clicking @kbd{mouse-1} above or below the scroll bar's
955@kbd{C-v} respectively (@pxref{Moving Point}). Dragging the inner box 955inner box scrolls the window by nearly the entire height of the
956scrolls continuously. 956window, like @kbd{M-v} and @kbd{C-v} respectively (@pxref{Moving
957Point}). Dragging the inner box scrolls continuously.
957 958
958 If Emacs is compiled on the X Window System without X toolkit 959 If Emacs is compiled on the X Window System without X toolkit
959support, the scroll bar behaves differently. Clicking @kbd{mouse-1} 960support, the scroll bar behaves differently. Clicking @kbd{mouse-1}
@@ -998,7 +999,9 @@ when the entire buffer is visible.
998 999
999@cindex scroll-bar face 1000@cindex scroll-bar face
1000 The visual appearance of the scroll bars is controlled by the 1001 The visual appearance of the scroll bars is controlled by the
1001@code{scroll-bar} face. 1002@code{scroll-bar} face. (Some toolkits, such as GTK and MS-Windows,
1003ignore this face; the scroll-bar appearance there can only be
1004customized system-wide, for GTK @pxref{GTK resources}).
1002 1005
1003@cindex vertical border 1006@cindex vertical border
1004 On graphical frames, vertical scroll bars implicitly serve to separate 1007 On graphical frames, vertical scroll bars implicitly serve to separate
@@ -1018,10 +1021,12 @@ Manual}.
1018@cindex Horizontal Scroll Bar mode 1021@cindex Horizontal Scroll Bar mode
1019 On graphical displays with toolkit support, Emacs may also supply a 1022 On graphical displays with toolkit support, Emacs may also supply a
1020@dfn{horizontal scroll bar} on the bottom of each window. Clicking 1023@dfn{horizontal scroll bar} on the bottom of each window. Clicking
1021@kbd{mouse-1} on that scroll bar's left and right buttons scrolls 1024@kbd{mouse-1} on that scroll bar's left and right buttons scrolls the
1022the window horizontally by one column at a time. Clicking @kbd{mouse-1} 1025window horizontally by one column at a time. (Note that some toolkits
1023on the left or right of the scroll bar's inner box scrolls the window by 1026allow customizations of the scroll bar that cause these buttons not to
1024four columns. Dragging the inner box scrolls the window continuously. 1027be shown.) Clicking @kbd{mouse-1} on the left or right of the scroll
1028bar's inner box scrolls the window by four columns. Dragging the
1029inner box scrolls the window continuously.
1025 1030
1026 Note that such horizontal scrolling can make the window's position of 1031 Note that such horizontal scrolling can make the window's position of
1027point disappear on the left or the right. Typing a character to insert 1032point 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
1073@code{window-divider-default-right-width}. 1078@code{window-divider-default-right-width}.
1074 1079
1075 When vertical scroll bars are disabled, dividers can be also useful to 1080 When vertical scroll bars are disabled, dividers can be also useful to
1076make the first pixel column of a window visible which would be otherwise 1081make the first pixel column of a window visible, which would be otherwise
1077covered by the vertical border used to separate side-by-side windows 1082covered by the vertical border used to separate side-by-side windows
1078(@pxref{Scroll Bars}). 1083(@pxref{Scroll Bars}).
1079 1084
diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi
index d4a03c746db..2ed264258eb 100644
--- a/doc/emacs/help.texi
+++ b/doc/emacs/help.texi
@@ -468,8 +468,8 @@ last hyperlink moves back to the first hyperlink.
468 468
469 To view all documentation about any symbol in the text, move point 469 To view all documentation about any symbol in the text, move point
470to the symbol and type @kbd{C-c C-c} (@code{help-follow-symbol}). 470to the symbol and type @kbd{C-c C-c} (@code{help-follow-symbol}).
471This shows all available documentation about the symbol---as a 471This shows the documentation for all the meanings of the symbol---as a
472variable, function and/or face. 472variable, as a function, and/or as a face.
473 473
474@node Package Keywords 474@node Package Keywords
475@section Keyword Search for Packages 475@section Keyword Search for Packages
diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi
index 7cbc61dc8e4..af740625adb 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.
2208@xref{Text Properties}. Use @code{equal-including-properties} to also 2208@xref{Text Properties}. Use @code{equal-including-properties} to also
2209compare text properties. For technical reasons, a unibyte string and 2209compare text properties. For technical reasons, a unibyte string and
2210a multibyte string are @code{equal} if and only if they contain the 2210a multibyte string are @code{equal} if and only if they contain the
2211same sequence of character codes and all these codes are either in the 2211same sequence of character codes and all these codes are in the range
2212range 0 through 127 (@acronym{ASCII}) or 160 through 255 22120 through 127 (@acronym{ASCII}).
2213(@code{eight-bit-graphic}). (@pxref{Text Representations}).
2214 2213
2215@example 2214@example
2216@group 2215@group
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index 552001e8904..e759967aa8a 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
639is a more general postfix operator that specifies repetition with a 639is a more general postfix operator that specifies repetition with a
640minimum of @var{m} repeats and a maximum of @var{n} repeats. If @var{m} 640minimum of @var{m} repeats and a maximum of @var{n} repeats. If @var{m}
641is omitted, the minimum is 0; if @var{n} is omitted, there is no 641is omitted, the minimum is 0; if @var{n} is omitted, there is no
642maximum. 642maximum. For both forms, @var{m} and @var{n}, if specified, may be no
643larger than
644@ifnottex
6452**15 @minus{} 1
646@end ifnottex
647@tex
648@math{2^{15}-1}
649@end tex
650.
643 651
644For example, @samp{c[ad]\@{1,2\@}r} matches the strings @samp{car}, 652For example, @samp{c[ad]\@{1,2\@}r} matches the strings @samp{car},
645@samp{cdr}, @samp{caar}, @samp{cadr}, @samp{cdar}, and @samp{cddr}, and 653@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 76f739f1ed6..709e9836c90 100644
--- a/doc/misc/cl.texi
+++ b/doc/misc/cl.texi
@@ -4395,7 +4395,7 @@ is expanded at compile-time to the Lisp form
4395@end example 4395@end example
4396 4396
4397@noindent 4397@noindent
4398which is the most efficient ways of doing this operation 4398which is the most efficient way of doing this operation
4399in Lisp. Thus, there is no performance penalty for using the more 4399in Lisp. Thus, there is no performance penalty for using the more
4400readable @code{cl-incf} form in your compiled code. 4400readable @code{cl-incf} form in your compiled code.
4401 4401
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 74e5fb4dd25..a90f1f4adcd 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -1128,7 +1128,9 @@ Each element of this list looks like
1128 (REGEXP COMMAND...) 1128 (REGEXP COMMAND...)
1129 1129
1130where each COMMAND can either be a string or a Lisp expression that evaluates 1130where each COMMAND can either be a string or a Lisp expression that evaluates
1131to a string. This expression can access the file name as the variable `file'. 1131to a string. If this expression needs to consult the name of the file for
1132which the shell commands are being requested, it can access that file name
1133as the variable `file'.
1132If several COMMANDs are given, the first one will be the default 1134If several COMMANDs are given, the first one will be the default
1133and the rest will be added temporarily to the history and can be retrieved 1135and the rest will be added temporarily to the history and can be retrieved
1134with \\[previous-history-element] (M-p) . 1136with \\[previous-history-element] (M-p) .
diff --git a/lisp/url/url-file.el b/lisp/url/url-file.el
index f6446c08161..4fac4060237 100644
--- a/lisp/url/url-file.el
+++ b/lisp/url/url-file.el
@@ -188,6 +188,7 @@ to them."
188 (url-find-file-dired filename) 188 (url-find-file-dired filename)
189 (with-current-buffer 189 (with-current-buffer
190 (setq buffer (generate-new-buffer " *url-file*")) 190 (setq buffer (generate-new-buffer " *url-file*"))
191 (require 'mm-util)
191 (mm-disable-multibyte) 192 (mm-disable-multibyte)
192 (setq url-current-object url) 193 (setq url-current-object url)
193 (insert "Content-type: " (or content-type "application/octet-stream") "\n") 194 (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 9a13732b7a2..e794786f3ad 100644
--- a/lisp/url/url-misc.el
+++ b/lisp/url/url-misc.el
@@ -99,6 +99,7 @@
99 (eq ?\; (aref mediatype 0))) 99 (eq ?\; (aref mediatype 0)))
100 (setq mediatype (concat "text/plain" mediatype)))) 100 (setq mediatype (concat "text/plain" mediatype))))
101 (set-buffer (generate-new-buffer " *url-data*")) 101 (set-buffer (generate-new-buffer " *url-data*"))
102 (require 'mm-util)
102 (mm-disable-multibyte) 103 (mm-disable-multibyte)
103 (insert (format "Content-Length: %d\n" (length data)) 104 (insert (format "Content-Length: %d\n" (length data))
104 "Content-Type: " mediatype "\n" 105 "Content-Type: " mediatype "\n"
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 825651cf083..3f21288f461 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -825,6 +825,7 @@ xg_set_geometry (struct frame *f)
825{ 825{
826 if (f->size_hint_flags & (USPosition | PPosition)) 826 if (f->size_hint_flags & (USPosition | PPosition))
827 { 827 {
828 int scale = xg_get_scale (f);
828#if ! GTK_CHECK_VERSION (3, 22, 0) 829#if ! GTK_CHECK_VERSION (3, 22, 0)
829 if (x_gtk_use_window_move) 830 if (x_gtk_use_window_move)
830 { 831 {
@@ -840,8 +841,9 @@ xg_set_geometry (struct frame *f)
840 f->top_pos = (x_display_pixel_height (FRAME_DISPLAY_INFO (f)) 841 f->top_pos = (x_display_pixel_height (FRAME_DISPLAY_INFO (f))
841 - FRAME_PIXEL_HEIGHT (f) + f->top_pos); 842 - FRAME_PIXEL_HEIGHT (f) + f->top_pos);
842 843
844 /* GTK works in scaled pixels, so convert from X pixels. */
843 gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), 845 gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
844 f->left_pos, f->top_pos); 846 f->left_pos / scale, f->top_pos / scale);
845 847
846 /* Reset size hint flags. */ 848 /* Reset size hint flags. */
847 f->size_hint_flags &= ~ (XNegative | YNegative); 849 f->size_hint_flags &= ~ (XNegative | YNegative);
@@ -849,9 +851,10 @@ xg_set_geometry (struct frame *f)
849 } 851 }
850 else 852 else
851 { 853 {
852 int left = f->left_pos; 854 /* GTK works in scaled pixels, so convert from X pixels. */
855 int left = f->left_pos / scale;
853 int xneg = f->size_hint_flags & XNegative; 856 int xneg = f->size_hint_flags & XNegative;
854 int top = f->top_pos; 857 int top = f->top_pos / scale;
855 int yneg = f->size_hint_flags & YNegative; 858 int yneg = f->size_hint_flags & YNegative;
856 char geom_str[sizeof "=x--" + 4 * INT_STRLEN_BOUND (int)]; 859 char geom_str[sizeof "=x--" + 4 * INT_STRLEN_BOUND (int)];
857 guint id; 860 guint id;
diff --git a/src/process.c b/src/process.c
index daa0dc68ae6..ff3edbb11a0 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
1437connection; it is t for a pipe connection. If KEY is t, the complete 1437connection; it is t for a pipe connection. If KEY is t, the complete
1438contact information for the connection is returned, else the specific 1438contact information for the connection is returned, else the specific
1439value for the keyword KEY is returned. See `make-network-process', 1439value for the keyword KEY is returned. See `make-network-process',
1440`make-serial-process', or `make pipe-process' for the list of keywords. 1440`make-serial-process', or `make-pipe-process' for the list of keywords.
1441If PROCESS is a non-blocking network process that hasn't been fully 1441If PROCESS is a non-blocking network process that hasn't been fully
1442set up yet, this function will block until socket setup has completed. */) 1442set up yet, this function will block until socket setup has completed. */)
1443 (Lisp_Object process, Lisp_Object key) 1443 (Lisp_Object process, Lisp_Object key)
diff --git a/src/syntax.c b/src/syntax.c
index a7977666593..52cec23cd7e 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1108,7 +1108,12 @@ DEFUN ("char-syntax", Fchar_syntax, Schar_syntax, 1, 1, 0,
1108For example, if CHARACTER is a word constituent, the 1108For example, if CHARACTER is a word constituent, the
1109character `w' (119) is returned. 1109character `w' (119) is returned.
1110The characters that correspond to various syntax codes 1110The characters that correspond to various syntax codes
1111are listed in the documentation of `modify-syntax-entry'. */) 1111are listed in the documentation of `modify-syntax-entry'.
1112
1113If you're trying to determine the syntax of characters in the buffer,
1114this is probably the wrong function to use, because it can't take
1115`syntax-table' text properties into account. Consider using
1116`syntax-after' instead. */)
1112 (Lisp_Object character) 1117 (Lisp_Object character)
1113{ 1118{
1114 int char_int; 1119 int char_int;
diff --git a/src/xfns.c b/src/xfns.c
index 43c55cca643..92cd12be164 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -4938,6 +4938,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */)
4938 gint width_mm = -1, height_mm = -1; 4938 gint width_mm = -1, height_mm = -1;
4939 GdkRectangle rec, work; 4939 GdkRectangle rec, work;
4940 struct MonitorInfo *mi = &monitors[i]; 4940 struct MonitorInfo *mi = &monitors[i];
4941 int scale = 1;
4941 4942
4942#if GTK_CHECK_VERSION (3, 22, 0) 4943#if GTK_CHECK_VERSION (3, 22, 0)
4943 GdkMonitor *monitor = gdk_display_get_monitor (gdpy, i); 4944 GdkMonitor *monitor = gdk_display_get_monitor (gdpy, i);
@@ -4983,6 +4984,16 @@ Internal use only, use `display-monitor-attributes-list' instead. */)
4983 } 4984 }
4984#endif 4985#endif
4985 4986
4987 /* GTK returns scaled sizes for the workareas. */
4988#if GTK_CHECK_VERSION (3, 22, 0)
4989 scale = gdk_monitor_get_scale_factor (monitor);
4990#elif GTK_CHECK_VERSION (3, 10, 0)
4991 scale = gdk_screen_get_monitor_scale_factor (gscreen, i);
4992#endif
4993 rec.width *= scale;
4994 rec.height *= scale;
4995 work.width *= scale;
4996 work.height *= scale;
4986 4997
4987 mi->geom.x = rec.x; 4998 mi->geom.x = rec.x;
4988 mi->geom.y = rec.y; 4999 mi->geom.y = rec.y;
diff --git a/src/xterm.c b/src/xterm.c
index 0a2068d7f30..7603e4f3991 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10301,6 +10301,9 @@ void
10301x_set_offset (struct frame *f, register int xoff, register int yoff, int change_gravity) 10301x_set_offset (struct frame *f, register int xoff, register int yoff, int change_gravity)
10302{ 10302{
10303 int modified_top, modified_left; 10303 int modified_top, modified_left;
10304#ifdef USE_GTK
10305 int scale = xg_get_scale (f);
10306#endif
10304 10307
10305 if (change_gravity > 0) 10308 if (change_gravity > 0)
10306 { 10309 {
@@ -10323,11 +10326,12 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_
10323 if (x_gtk_use_window_move) 10326 if (x_gtk_use_window_move)
10324 { 10327 {
10325 /* When a position change was requested and the outer GTK widget 10328 /* When a position change was requested and the outer GTK widget
10326 has been realized already, leave it to gtk_window_move to DTRT 10329 has been realized already, leave it to gtk_window_move to
10327 and return. Used for Bug#25851 and Bug#25943. */ 10330 DTRT and return. Used for Bug#25851 and Bug#25943. Convert
10331 from X pixels to GTK scaled pixels. */
10328 if (change_gravity != 0 && FRAME_GTK_OUTER_WIDGET (f)) 10332 if (change_gravity != 0 && FRAME_GTK_OUTER_WIDGET (f))
10329 gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), 10333 gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
10330 f->left_pos, f->top_pos); 10334 f->left_pos / scale, f->top_pos / scale);
10331 unblock_input (); 10335 unblock_input ();
10332 return; 10336 return;
10333 } 10337 }
@@ -10346,8 +10350,9 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_
10346 } 10350 }
10347 10351
10348#ifdef USE_GTK 10352#ifdef USE_GTK
10353 /* Make sure we adjust for possible scaling. */
10349 gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), 10354 gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
10350 modified_left, modified_top); 10355 modified_left / scale, modified_top / scale);
10351#else 10356#else
10352 XMoveWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), 10357 XMoveWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
10353 modified_left, modified_top); 10358 modified_left, modified_top);
diff --git a/test/README b/test/README
index 7f4afb32bd3..1cd9db3bb88 100644
--- a/test/README
+++ b/test/README
@@ -44,6 +44,12 @@ If your test file contains the tests "test-foo", "test2-foo" and
44"test-foo-remote", and you want to run only the former two tests, you 44"test-foo-remote", and you want to run only the former two tests, you
45could use a selector regexp: "make <filename> SELECTOR='\"foo$$\"'". 45could use a selector regexp: "make <filename> SELECTOR='\"foo$$\"'".
46 46
47Note that although the test files are always compiled (unless they set
48no-byte-compile), the source files will be run by default, to give
49nicer backtraces. To run the compiled version of a test use
50
51 make TEST_LOAD_EL=no ...
52
47 53
48(Also, see etc/compilation.txt for compilation mode font lock tests.) 54(Also, see etc/compilation.txt for compilation mode font lock tests.)
49 55
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 00000000000..b0b4e38e5fd
--- /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 00000000000..969bca7f8d0
--- /dev/null
+++ b/test/lisp/url/url-file-tests.el
@@ -0,0 +1,50 @@
1;;; url-file-tests.el --- Test suite for url-file. -*- lexical-binding: t -*-
2
3;; Copyright (C) 2018 Free Software Foundation, Inc.
4
5;; This file is part of GNU Emacs.
6
7;; GNU Emacs is free software: you can redistribute it and/or modify
8;; it under the terms of the GNU General Public License as published by
9;; the Free Software Foundation, either version 3 of the License, or
10;; (at your option) any later version.
11
12;; GNU Emacs is distributed in the hope that it will be useful,
13;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;; GNU General Public License for more details.
16
17;; You should have received a copy of the GNU General Public License
18;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
19
20;;; Commentary:
21
22;;; Code:
23
24(require 'url-file)
25(require 'ert)
26
27(defconst url-file-tests-data-directory
28 (expand-file-name "lisp/url/url-file-resources"
29 (or (getenv "EMACS_TEST_DIRECTORY")
30 (expand-file-name "../../.."
31 (or load-file-name
32 buffer-file-name))))
33 "Directory for url-file test files.")
34
35(ert-deftest url-file ()
36 "Test reading file via file:// URL."
37 (let ((file (expand-file-name "file.txt" url-file-tests-data-directory)))
38 (should (equal
39 (with-current-buffer
40 (url-file (url-generic-parse-url (concat "file://" file))
41 #'ignore nil)
42 (prog1 (buffer-substring (point) (point-max))
43 (kill-buffer)))
44 (with-temp-buffer
45 (insert-file-contents-literally file)
46 (buffer-string))))))
47
48(provide 'url-file-tests)
49
50;;; 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 00000000000..fec2609bb7f
--- /dev/null
+++ b/test/lisp/url/url-misc-tests.el
@@ -0,0 +1,41 @@
1;;; url-misc-tests.el --- Test suite for url-misc. -*- lexical-binding: t -*-
2
3;; Copyright (C) 2018 Free Software Foundation, Inc.
4
5;; This file is part of GNU Emacs.
6
7;; GNU Emacs is free software: you can redistribute it and/or modify
8;; it under the terms of the GNU General Public License as published by
9;; the Free Software Foundation, either version 3 of the License, or
10;; (at your option) any later version.
11
12;; GNU Emacs is distributed in the hope that it will be useful,
13;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;; GNU General Public License for more details.
16
17;; You should have received a copy of the GNU General Public License
18;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
19
20;;; Commentary:
21
22;;; Code:
23
24(require 'url-misc)
25(require 'ert)
26
27(ert-deftest url-misc-data ()
28 "Test reading data: URL."
29 (should (equal
30 (with-current-buffer
31 (url-data (url-generic-parse-url "data:;,some%20text"))
32 (goto-char (point-min))
33 (forward-paragraph)
34 (forward-line)
35 (prog1 (buffer-substring (point) (point-max))
36 (kill-buffer)))
37 "some text")))
38
39(provide 'url-misc-tests)
40
41;;; url-misc-tests.el ends here