emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 60d5a13 3/3: Merge from origin/emacs-26


From: Glenn Morris
Subject: [Emacs-diffs] master 60d5a13 3/3: Merge from origin/emacs-26
Date: Sat, 20 Jan 2018 11:28:14 -0500 (EST)

branch: master
commit 60d5a13d28705e116e0a69c48f15d20aab9d3081
Merge: 194c530 cfc94fd
Author: Glenn Morris <address@hidden>
Commit: Glenn Morris <address@hidden>

    Merge from origin/emacs-26
    
    cfc94fd (origin/emacs-26) Don't mention 'vc-stay-local' in the user m...
    8ce430b Fix a typo in calendar.texi
    bb748b3 Minor improvement in wording of the Emacs manual
    b603aff Revert "Fix tempfile creation when byte compiling"
    4fd446e Fix tempfile creation when byte compiling
    7f48a11 Improve the Emacs manual as suggested in emacs-manual-bugs
    728ded0 * lisp/emacs-lisp/bytecomp.el: Tweak last change
    c6c05e2 Unbreak building Emacs on FreeBSD
    a41ad3d Don't unnecessarily use non-ASCII characters in C sources
    c28d4b6 Portability fixes in emacs-module-tests
    1d50c18 Add tests for term.el
---
 doc/emacs/calendar.texi           |   2 +-
 doc/emacs/help.texi               |  16 ++---
 doc/emacs/killing.texi            |  18 ++---
 doc/emacs/maintaining.texi        |   8 +--
 doc/emacs/vc1-xtra.texi           |  19 ++----
 lisp/emacs-lisp/bytecomp.el       |  12 +++-
 lisp/term.el                      |   3 +-
 src/alloc.c                       |   2 +-
 src/emacs-module.c                |   2 +-
 src/gtkutil.c                     |   4 +-
 src/xwidget.c                     |   2 +-
 test/Makefile.in                  |   1 +
 test/data/emacs-module/mod-test.c |  37 ++++++++--
 test/lisp/term-tests.el           | 137 ++++++++++++++++++++++++++++++++++++++
 14 files changed, 215 insertions(+), 48 deletions(-)

diff --git a/doc/emacs/calendar.texi b/doc/emacs/calendar.texi
index dd82678..7ce73a6 100644
--- a/doc/emacs/calendar.texi
+++ b/doc/emacs/calendar.texi
@@ -441,7 +441,7 @@ argument, which specifies how many days, weeks, months or 
years to print
   If the variable @code{cal-tex-holidays} is address@hidden (the default),
 then the printed calendars show the holidays in @code{calendar-holidays}.
 If the variable @code{cal-tex-diary} is address@hidden (the default is
address@hidden), diary entries are included also (in monthly, filofax, and
address@hidden), diary entries are included also (in monthly, Filofax, and
 iso-week calendars only).  If the variable @code{cal-tex-rules} is
 address@hidden (the default is @code{nil}), the calendar displays ruled
 pages in styles that have sufficient room.  Consult the documentation of
diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi
index 0aa4c50..d4a03c7 100644
--- a/doc/emacs/help.texi
+++ b/doc/emacs/help.texi
@@ -462,14 +462,14 @@ command (@pxref{Browse-URL}).
 @findex backward-button
   In a help buffer, @key{TAB} (@code{forward-button}) moves point
 forward to the next hyperlink, while @address@hidden
-(@code{backward-button}) point back to the previous hyperlink.  These
-commands act cyclically; for instance, typing @key{TAB} at the last
-hyperlink moves back to the first hyperlink.
+(@code{backward-button}) moves point back to the previous hyperlink.
+These commands act cyclically; for instance, typing @key{TAB} at the
+last hyperlink moves back to the first hyperlink.
 
   To view all documentation about any symbol in the text, move point
-to there 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.
+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.
 
 @node Package Keywords
 @section Keyword Search for Packages
@@ -495,8 +495,8 @@ buffer (@pxref{Package Menu}).
 package (@pxref{Packages}, and displays a help buffer describing the
 attributes of the package and the features that it implements.  The
 buffer lists the keywords that relate to the package in the form of
-buttons.  Click on a button to see other packages related to that
-keyword.
+buttons.  Click on a button with @kbd{mouse-1} or @kbd{mouse-2} to see
+the list of other packages related to that keyword.
 
 @node Language Help
 @section Help for International Language Support
diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi
index 7d95a44..6efcc9d 100644
--- a/doc/emacs/killing.texi
+++ b/doc/emacs/killing.texi
@@ -33,13 +33,13 @@ killing many different types of syntactic units.
 @cindex cutting text
 @cindex deletion
   Most commands which erase text from the buffer save it in the kill
-ring.  These are known as @dfn{kill} commands, and their names
-normally contain the word @samp{kill} (e.g., @code{kill-line}).  The
-kill ring stores several recent kills, not just the last one, so
-killing is a very safe operation: you don't have to worry much about
-losing text that you previously killed.  The kill ring is shared by
-all buffers, so text that is killed in one buffer can be yanked into
-another buffer.
+ring (@pxref{Kill Ring}).  These are known as @dfn{kill} commands, and
+their names normally contain the word @samp{kill} (e.g.,
address@hidden).  The kill ring stores several recent kills, not
+just the last one, so killing is a very safe operation: you don't have
+to worry much about losing text that you previously killed.  The kill
+ring is shared by all buffers, so text that is killed in one buffer
+can be yanked into another buffer.
 
   When you use @kbd{C-/} (@code{undo}) to undo a kill command
 (@pxref{Undo}), that brings the killed text back into the buffer, but
@@ -909,8 +909,8 @@ any direction.  Normal text you type is inserted to the 
left or right
 of each line in the rectangle (on the same side as the cursor).
 
   You can use this rectangle support without activating CUA by calling the
address@hidden command.  But see also the standard
address@hidden  @xref{Rectangles}.
address@hidden command.  There's also the standard command
address@hidden, see @ref{Rectangles}.
 
   With CUA you can easily copy text and rectangles into and out of
 registers by providing a one-digit numeric prefix to the kill, copy,
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index 0846440..cb53529 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -1206,11 +1206,9 @@ file.  RCS and SCCS show the name of the user locking a 
file as its
 status.
 
 @ifnottex
address@hidden vc-stay-local
-  On CVS and Subversion, the @code{vc-dir} command normally contacts
-the repository, which may be on a remote machine, to check for
-updates.  If you change the variable @code{vc-stay-local} or
address@hidden (for CVS) to @code{nil} (@pxref{CVS
+  On CVS, the @code{vc-dir} command normally contacts the repository,
+which may be on a remote machine, to check for updates.  If you change
+the variable @code{vc-cvs-stay-local} to @code{nil} (@pxref{CVS
 Options}), then Emacs avoids contacting a remote repository when
 generating the VC Directory buffer (it will still contact it when
 necessary, e.g., when doing a commit).  This may be desirable if you
diff --git a/doc/emacs/vc1-xtra.texi b/doc/emacs/vc1-xtra.texi
index 6c4e077..7a4b8e4 100644
--- a/doc/emacs/vc1-xtra.texi
+++ b/doc/emacs/vc1-xtra.texi
@@ -364,18 +364,13 @@ the name of the operation to invoke.
 @cindex remote repositories (CVS)
   When using a CVS repository on a remote machine, VC can try keeping
 network interactions to a minimum.  This is controlled by the variable
address@hidden  There is another variable,
address@hidden, which enables the feature also for other back
-ends that support it, including address@hidden  In the following, we will talk
-only about @code{vc-cvs-stay-local}, but everything applies to
address@hidden as well.
-
-  If @code{vc-cvs-stay-local} is @code{only-file} (the default), VC
-determines the version control status of each file using only the
-entry in the local CVS subdirectory and the information returned by
-previous CVS commands.  As a consequence, if you have modified a file
-and somebody else has checked in other changes, you will not be
-notified of the conflict until you try to commit.
address@hidden  If @code{vc-cvs-stay-local} is
address@hidden (the default), VC determines the version control
+status of each file using only the entry in the local CVS subdirectory
+and the information returned by previous CVS commands.  As a
+consequence, if you have modified a file and somebody else has checked
+in other changes, you will not be notified of the conflict until you
+try to commit.
 
   If you change @code{vc-cvs-stay-local} to @code{nil}, VC queries the
 remote repository @emph{before} it decides what to do in
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index cc3a24e..80eb648 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1933,7 +1933,17 @@ The value is non-nil if there were no errors, nil if 
errors."
                       ;; parallel bootstrap), it does not risk getting a
                       ;; half-finished file.  (Bug#4196)
                       (tempfile
-                        (make-temp-file (file-name-nondirectory target-file)))
+                        (if (file-name-absolute-p target-file)
+                            (make-temp-file target-file)
+                          ;; If target-file is relative and includes
+                          ;; leading directories, make-temp-file will
+                          ;; assume those leading directories exist
+                          ;; under temporary-file-directory, which might
+                          ;; not be true.  So strip leading directories
+                          ;; from relative file names before calling
+                          ;; make-temp-file.
+                          (make-temp-file
+                           (file-name-nondirectory target-file))))
                       (default-modes (default-file-modes))
                       (temp-modes (logand default-modes #o600))
                       (desired-modes (logand default-modes #o666))
diff --git a/lisp/term.el b/lisp/term.el
index 1a37393..c64c64e 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -1117,7 +1117,8 @@ Entry to this mode runs the hooks on `term-mode-hook'."
                 (lambda (size)
                   (when size
                     (term-reset-size (cdr size) (car size)))
-                  size))
+                  size)
+                '((name . term-maybe-reset-size)))
 
   (add-hook 'read-only-mode-hook #'term-line-mode-buffer-read-only-update nil 
t)
 
diff --git a/src/alloc.c b/src/alloc.c
index f7e1346..ea8fdee 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5122,7 +5122,7 @@ typedef union
 #endif
 
 /* Set *P to the address of the top of the stack.  This must be a
-   macro, not a function, so that it is executed in the caller’s
+   macro, not a function, so that it is executed in the caller's
    environment.  It is not inside a do-while so that its storage
    survives the macro.  Callers should be declared NO_INLINE.  */
 #ifdef HAVE___BUILTIN_UNWIND_INIT
diff --git a/src/emacs-module.c b/src/emacs-module.c
index 3a85421..385c308 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -579,7 +579,7 @@ module_make_string (emacs_env *env, const char *str, 
ptrdiff_t length)
   if (! (0 <= length && length <= STRING_BYTES_BOUND))
     xsignal0 (Qoverflow_error);
   /* FIXME: AUTO_STRING_WITH_LEN requires STR to be null-terminated,
-     but we shouldn’t require that.  */
+     but we shouldn't require that.  */
   AUTO_STRING_WITH_LEN (lstr, str, length);
   return lisp_to_value (env,
                         code_convert_string_norecord (lstr, Qutf_8, false));
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 34c0fcc..825651c 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -580,8 +580,8 @@ xg_check_special_colors (struct frame *f,
       {
         GdkRGBA *c;
         /* FIXME: Retrieving the background color is deprecated in
-           GTK+ 3.16.  New versions of GTK+ don’t use the concept of a
-           single background color any more, so we shouldn’t query for
+           GTK+ 3.16.  New versions of GTK+ don't use the concept of a
+           single background color any more, so we shouldn't query for
            it.  */
         gtk_style_context_get (gsty, state,
                                GTK_STYLE_PROPERTY_BACKGROUND_COLOR, &c,
diff --git a/src/xwidget.c b/src/xwidget.c
index 17f7d47..95fa5f1 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -389,7 +389,7 @@ webkit_javascript_finished_cb (GObject      *webview,
     /* Register an xwidget event here, which then runs the callback.
        This ensures that the callback runs in sync with the Emacs
        event loop.  */
-    /* FIXME: This might lead to disaster if LISP_CALLBACK’s object
+    /* FIXME: This might lead to disaster if LISP_CALLBACK's object
        was garbage collected before now.  See the FIXME in
        Fxwidget_webkit_execute_script.  */
     store_xwidget_js_callback_event (xw, XPL (lisp_callback), lisp_value);
diff --git a/test/Makefile.in b/test/Makefile.in
index 341b09b..3f4f8e7 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -31,6 +31,7 @@
 SHELL = @SHELL@
 
 srcdir = @srcdir@
address@hidden@
 VPATH = $(srcdir)
 
 FIND_DELETE = @FIND_DELETE@
diff --git a/test/data/emacs-module/mod-test.c 
b/test/data/emacs-module/mod-test.c
index c1b1cad..a1c115f 100644
--- a/test/data/emacs-module/mod-test.c
+++ b/test/data/emacs-module/mod-test.c
@@ -20,10 +20,35 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <limits.h>
 #include <emacs-module.h>
 
 int plugin_is_GPL_compatible;
 
+#if INTPTR_MAX <= 0
+# error "INTPTR_MAX misconfigured"
+#elif INTPTR_MAX <= INT_MAX || INTPTR_MAX <= LONG_MAX
+# define pT "ld"
+# define pZ "lu"
+# define T_TYPE long
+# define Z_TYPE unsigned long
+#elif INTPTR_MAX <= INT64_MAX
+# ifdef __MINGW32__
+#  define pT "lld"
+#  define pZ "llu"
+#  define T_TYPE long long
+#  define Z_TYPE unsigned long long
+# else
+#  define pT "ld"
+#  define pZ "lu"
+#  define T_TYPE long
+#  define Z_TYPE unsigned long
+# endif
+#else
+# error "INTPTR_MAX too large"
+#endif
+
+
 /* Always return symbol 't'.  */
 static emacs_value
 Fmod_test_return_t (emacs_env *env, ptrdiff_t nargs, emacs_value args[],
@@ -287,9 +312,9 @@ emacs_module_init (struct emacs_runtime *ert)
 {
   if (ert->size < sizeof *ert)
     {
-      fprintf (stderr, "Runtime size of runtime structure (%td bytes) "
-               "smaller than compile-time size (%zu bytes)",
-               ert->size, sizeof *ert);
+      fprintf (stderr, "Runtime size of runtime structure (%"pT" bytes) "
+               "smaller than compile-time size (%"pZ" bytes)",
+               (T_TYPE) ert->size, (Z_TYPE) sizeof (*ert));
       return 1;
     }
 
@@ -297,9 +322,9 @@ emacs_module_init (struct emacs_runtime *ert)
 
   if (env->size < sizeof *env)
     {
-      fprintf (stderr, "Runtime size of environment structure (%td bytes) "
-               "smaller than compile-time size (%zu bytes)",
-               env->size, sizeof *env);
+      fprintf (stderr, "Runtime size of environment structure (%"pT" bytes) "
+               "smaller than compile-time size (%"pZ" bytes)",
+               (T_TYPE) env->size, (Z_TYPE) sizeof (*env));
       return 2;
     }
 
diff --git a/test/lisp/term-tests.el b/test/lisp/term-tests.el
new file mode 100644
index 0000000..16466ea
--- /dev/null
+++ b/test/lisp/term-tests.el
@@ -0,0 +1,137 @@
+;;; term-tests.el --- tests for term.el  -*- lexical-binding: t -*-
+
+;; Copyright (C) 2017 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 'ert)
+(require 'term)
+(eval-when-compile (require 'cl-lib))
+
+(defvar term-height)                    ; Number of lines in window.
+(defvar term-width)                     ; Number of columns in window.
+
+(defun term-test-screen-from-input (width height input &optional return-var)
+  (with-temp-buffer
+    (term-mode)
+    ;; Keep dimensions independent from window size.
+    (remove-function (local 'window-adjust-process-window-size-function)
+                     'term-maybe-reset-size)
+    (term-exec (current-buffer) "test" "cat" nil nil)
+    (term-char-mode)
+    (setq term-width width)
+    (setq term-height height)
+    ;; Pass input directly to `term-emulate-terminal', it's easier to
+    ;; control chunking, and we don't have to worry about wrestling
+    ;; with stty settings.
+    (let ((proc (get-buffer-process (current-buffer))))
+      (unwind-protect
+          (prog2 (if (consp input)
+                     (mapc (lambda (input) (term-emulate-terminal proc input)) 
input)
+                   (term-emulate-terminal proc input))
+              (if return-var (buffer-local-value return-var (current-buffer))
+                (buffer-substring-no-properties (point-min) (point-max)))
+            ;; End the process to avoid query on buffer kill.
+            (process-send-eof proc)
+            (accept-process-output proc))
+        ;; Make extra sure we don't get stuck in case we hit some
+        ;; error before sending eof.
+        (when (process-live-p proc)
+          (kill-process proc)
+          ;; Let Emacs update process status.
+          (accept-process-output proc))))))
+
+(ert-deftest term-simple-lines ()
+  (let ((str "\
+first line\r
+next line\r\n"))
+    (should (equal (term-test-screen-from-input 40 12 str)
+                   (replace-regexp-in-string "\r" "" str)))))
+
+(ert-deftest term-carriage-return ()
+  (let ((str "\
+first line\r_next line\r\n"))
+    (should (equal (term-test-screen-from-input 40 12 str)
+                   "_next line\n"))))
+
+(ert-deftest term-line-wrap ()
+  (should (string-match-p
+           ;; Don't be strict about trailing whitespace.
+           "\\`a\\{40\\}\na\\{20\\} *\\'"
+           (term-test-screen-from-input 40 12 (make-string 60 ?a))))
+  ;; Again, but split input into chunks.
+  (should (string-match-p
+           "\\`a\\{40\\}\na\\{20\\} *\\'"
+           (term-test-screen-from-input 40 12 (let ((str (make-string 30 ?a)))
+                                                (list str str))))))
+
+(ert-deftest term-cursor-movement ()
+  ;; Absolute positioning.
+  (should (equal "ab\ncd"
+                 (term-test-screen-from-input
+                  40 12 (concat "\e[2;2Hd"
+                                "\e[2;1Hc"
+                                "\e[1;2Hb"
+                                "\e[1;1Ha"))))
+  ;; Send one byte at a time.
+  (should (equal "ab\ncd"
+                 (term-test-screen-from-input
+                  40 12 (split-string (concat "\e[2;2Hd"
+                                              "\e[2;1Hc"
+                                              "\e[1;2Hb"
+                                              "\e[1;1Ha") "" t))))
+  ;; Relative positioning.
+  (should (equal "ab\ncd"
+                 (term-test-screen-from-input
+                  40 12 (concat "\e[B\e[Cd"
+                                "\e[D\e[Dc"
+                                "\e[Ab"
+                                "\e[D\e[Da")))))
+
+(ert-deftest term-scrolling-region ()
+  (should (equal "\
+line3
+line4
+line5
+line6
+"
+                 (term-test-screen-from-input
+                  40 12 "\e[1;5r\
+line1\r
+line2\r
+line3\r
+line4\r
+line5\r
+line6\r
+"))))
+
+(ert-deftest term-set-directory ()
+  (let ((term-ansi-at-user (user-real-login-name)))
+    (should (equal (term-test-screen-from-input
+                    40 12 "\eAnSiTc /foo/\n" 'default-directory)
+                   "/foo/"))
+    ;; Split input (Bug#17231).
+    (should (equal (term-test-screen-from-input
+                    40 12 (list "\eAnSiTc /f" "oo/\n") 'default-directory)
+                   "/foo/"))))
+
+(provide 'term-tests)
+
+;;; term-tests.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]