[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 3b36b38 1/3: Merge from origin/emacs-27
From: |
Glenn Morris |
Subject: |
master 3b36b38 1/3: Merge from origin/emacs-27 |
Date: |
Tue, 7 Jul 2020 10:55:41 -0400 (EDT) |
branch: master
commit 3b36b38713aefb3aba40b3c094246782e8893f80
Merge: 6b80ff3 59e768d
Author: Glenn Morris <rgm@gnu.org>
Commit: Glenn Morris <rgm@gnu.org>
Merge from origin/emacs-27
59e768d64a Fix undefined behavior in json.c (Bug#42113)
cce00bef03 Fix ACTION argument of 'display-buffer' call in gud.el
0121db2702 * src/keyboard.c (Fclear_this_command_keys): Doc fix.
b9abf5ceb2 Improve do string of 'man'
b87fc938a0 ; * src/xdisp.c (pos_visible_p): Yet another minor fix for...
---
lisp/man.el | 6 +++++-
lisp/progmodes/gud.el | 6 +++---
src/json.c | 2 ++
src/keyboard.c | 2 +-
src/xdisp.c | 11 +++++++----
test/src/json-tests.el | 12 ++++++++++++
6 files changed, 30 insertions(+), 9 deletions(-)
diff --git a/lisp/man.el b/lisp/man.el
index 5278a1a..8a36f3a 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -996,7 +996,11 @@ An \"apropos\" query with -k gives a buffer of matching
page
names or descriptions. The pattern argument is usually an
\"grep -E\" style regexp.
- -k pattern"
+ -k pattern
+
+Note that in some cases you will need to use \\[quoted-insert] to quote the
+SPC character in the above examples, because this command attempts
+to auto-complete your input based on the installed manual pages."
(interactive
(list (let* ((default-entry (Man-default-man-entry))
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index eb43e8b..092d159 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -2620,9 +2620,9 @@ comint mode, which see."
(select-window
(display-buffer
(get-buffer-create (concat "*gud" filepart "*"))
- '(display-buffer-reuse-window
- display-buffer-in-previous-window
- display-buffer-same-window display-buffer-pop-up-window)))
+ '((display-buffer-reuse-window
+ display-buffer-in-previous-window
+ display-buffer-same-window display-buffer-pop-up-window))))
(when (and existing-buffer (get-buffer-process existing-buffer))
(error "This program is already being debugged"))
;; Set the dir, in case the buffer already existed with a different dir.
diff --git a/src/json.c b/src/json.c
index 3002767..814afc6 100644
--- a/src/json.c
+++ b/src/json.c
@@ -365,6 +365,7 @@ lisp_to_json_toplevel_1 (Lisp_Object lisp,
Lisp_Object key = HASH_KEY (h, i);
if (!EQ (key, Qunbound))
{
+ CHECK_STRING (key);
Lisp_Object ekey = json_encode (key);
/* We can't specify the length, so the string must be
NUL-terminated. */
@@ -975,6 +976,7 @@ usage: (json-parse-string STRING &rest ARGS) */)
#endif
Lisp_Object string = args[0];
+ CHECK_STRING (string);
Lisp_Object encoded = json_encode (string);
check_string_without_embedded_nuls (encoded);
struct json_configuration conf =
diff --git a/src/keyboard.c b/src/keyboard.c
index f9b9399..5fa58ab 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -10531,7 +10531,7 @@ The value is always a vector. */)
DEFUN ("clear-this-command-keys", Fclear_this_command_keys,
Sclear_this_command_keys, 0, 1, 0,
doc: /* Clear out the vector that `this-command-keys' returns.
-Also clear the record of the last 100 events, unless optional arg
+Also clear the record of the last 300 input events, unless optional arg
KEEP-RECORD is non-nil. */)
(Lisp_Object keep_record)
{
diff --git a/src/xdisp.c b/src/xdisp.c
index e454fd7..92afccc 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1872,10 +1872,13 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int
*x, int *y,
/* Account for line-number display, if IT3 still
didn't. This can happen if START - 1 is the
first or the last character on its display line. */
- if (it3.lnum_pixel_width > 0)
- top_x += it3.lnum_pixel_width;
- else if (it.line_number_produced_p)
- top_x += it.lnum_pixel_width;
+ if (!it3.line_number_produced_p)
+ {
+ if (it3.lnum_pixel_width > 0)
+ top_x += it3.lnum_pixel_width;
+ else if (it.line_number_produced_p)
+ top_x += it.lnum_pixel_width;
+ }
/* Normally, we would exit the above loop because we
found the display element whose character
position is CHARPOS. For the contingency that we
diff --git a/test/src/json-tests.el b/test/src/json-tests.el
index 7eeef88..028f92f 100644
--- a/test/src/json-tests.el
+++ b/test/src/json-tests.el
@@ -296,5 +296,17 @@ Test with both unibyte and multibyte strings."
(1+ most-positive-fixnum)
(1- most-negative-fixnum)))))
+(ert-deftest json-parse-string/wrong-type ()
+ "Check that Bug#42113 is fixed."
+ (skip-unless (fboundp 'json-parse-string))
+ (should-error (json-parse-string 1) :type 'wrong-type-argument))
+
+(ert-deftest json-serialize/wrong-hash-key-type ()
+ "Check that Bug#42113 is fixed."
+ (skip-unless (fboundp 'json-serialize))
+ (let ((table (make-hash-table :test #'eq)))
+ (puthash 1 2 table)
+ (should-error (json-serialize table) :type 'wrong-type-argument)))
+
(provide 'json-tests)
;;; json-tests.el ends here