From ced29038dfbab47428b974dff1408f331f36c8f1 Mon Sep 17 00:00:00 2001 From: Carl Lei Date: Sun, 24 May 2020 11:52:24 +0000 Subject: [PATCH 1/6] Add three C++20 coroutine keywords, co_await, co_yield, and co_return * lisp/progmodes/cc-langs.el (c-operators): Add co_await and co_yield to the C++ value of "Exception" keywords. (c-return-kwds): Create a C++ value containing co_return. (c-simple-stmt-kwds): Add co_return to the C++ value. Copyright-paperwork-exempt: yes. --- lisp/progmodes/cc-langs.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 17ffea59ff0..2369cb03428 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -1174,7 +1174,7 @@ since CC Mode treats every identifier as an expression." ;; Exception. ,@(when (c-major-mode-is 'c++-mode) - '((prefix "throw"))) + '((prefix "throw" "co_await" "co_yield"))) ;; Sequence. (left-assoc ",")) @@ -2040,6 +2040,7 @@ the appropriate place for that." (c-lang-defconst c-return-kwds "Keywords which return a value to the calling function." t '("return") + c++ '("return" "co_return") idl nil) (c-lang-defconst c-return-key @@ -2822,6 +2823,7 @@ Keywords here should also be in `c-block-stmt-1-kwds'." (c-lang-defconst c-simple-stmt-kwds "Statement keywords followed by an expression or nothing." t '("break" "continue" "goto" "return") + c++ '("break" "continue" "goto" "return" "co_return") objc '("break" "continue" "goto" "return" "@throw") ;; Note: `goto' is not valid in Java, but the keyword is still reserved. java '("break" "continue" "goto" "return" "throw") From 104b68b670eb6de6614c562ae6b18c009b20584f Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 24 May 2020 18:48:16 +0200 Subject: [PATCH 2/6] Mark browse-url-conkeror as obsolete * lisp/net/browse-url.el: (browse-url--browser-defcustom-type) (browse-url-conkeror-new-window-is-buffer) (browse-url-conkeror-program, browse-url-conkeror-arguments) (browse-url-default-browser, browse-url-conkeror): Mark the conkeror browser as obsolete. * etc/NEWS: Mention this. --- etc/NEWS | 2 ++ lisp/net/browse-url.el | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index efad273da6c..4bc00cc3375 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -362,6 +362,8 @@ symbol property to the browsing functions. With a new command 'browse-url-with-browser-kind', an URL can explicitly be browsed with either an internal or external browser. +*** Support for the conkeror browser is now obsolete. + ** SHR --- diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 8132f8d9933..8892e800cd6 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -39,7 +39,6 @@ ;; browse-url-chrome Chrome 47.0.2526.111 ;; browse-url-chromium Chromium 3.0 ;; browse-url-epiphany Epiphany Don't know -;; browse-url-conkeror Conkeror Don't know ;; browse-url-w3 w3 0 ;; browse-url-text-* Any text browser 0 ;; browse-url-generic arbitrary @@ -154,7 +153,6 @@ (function-item :tag "Google Chrome" :value browse-url-chrome) (function-item :tag "Chromium" :value browse-url-chromium) (function-item :tag "Epiphany" :value browse-url-epiphany) - (function-item :tag "Conkeror" :value browse-url-conkeror) (function-item :tag "Text browser in an xterm window" :value browse-url-text-xterm) (function-item :tag "Text browser in an Emacs window" @@ -396,6 +394,8 @@ If non-nil, then open the URL in a new buffer rather than a new window if :version "25.1" :type 'boolean) +(make-obsolete-variable 'browse-url-conkeror-new-window-is-buffer nil "28.1") + (defcustom browse-url-galeon-new-window-is-tab nil "Whether to open up new windows in a tab or a new window. If non-nil, then open the URL in a new tab rather than a new window if @@ -449,11 +449,15 @@ commands reverses the effect of this variable." :type 'string :version "25.1") +(make-obsolete-variable 'browse-url-conkeror-program nil "28.1") + (defcustom browse-url-conkeror-arguments nil "A list of strings to pass to Conkeror as arguments." :version "25.1" :type '(repeat (string :tag "Argument"))) +(make-obsolete-variable 'browse-url-conkeror-arguments nil "28.1") + (defcustom browse-url-filename-alist `(("^/\\(ftp@\\|anonymous@\\)?\\([^:/]+\\):/*" . "ftp://\\2/") ;; The above loses the username to avoid the browser prompting for @@ -1072,7 +1076,7 @@ instead of `browse-url-new-window-flag'." ((executable-find browse-url-kde-program) 'browse-url-kde) ;;; ((executable-find browse-url-netscape-program) 'browse-url-netscape) ;;; ((executable-find browse-url-mosaic-program) 'browse-url-mosaic) - ((executable-find browse-url-conkeror-program) 'browse-url-conkeror) +;;; ((executable-find browse-url-conkeror-program) 'browse-url-conkeror) ((executable-find browse-url-chrome-program) 'browse-url-chrome) ((executable-find browse-url-xterm-program) 'browse-url-text-xterm) ((locate-library "w3") 'browse-url-w3) @@ -1546,6 +1550,7 @@ new window, load it in a new buffer in an existing window instead. When called non-interactively, use optional second argument NEW-WINDOW instead of `browse-url-new-window-flag'." + (declare (obsolete nil "28.1")) (interactive (browse-url-interactive-arg "URL: ")) (setq url (browse-url-encode-url url)) (let* ((process-environment (browse-url-process-environment))) From 3b65fb7658c2717457c033c6704cf3b007804226 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 24 May 2020 20:14:48 -0400 Subject: [PATCH 3/6] Fix segfault on closing frame with tooltip (Bug#41239) * src/gtkutil.c (xg_free_frame_widgets): Empty and unreference the tooltip widget before destroying its label. --- src/gtkutil.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gtkutil.c b/src/gtkutil.c index 681f86f51ba..5d1ce6de97c 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -1404,10 +1404,15 @@ xg_free_frame_widgets (struct frame *f) FRAME_X_WINDOW (f) = 0; /* Set to avoid XDestroyWindow in xterm.c */ FRAME_X_RAW_DRAWABLE (f) = 0; FRAME_GTK_OUTER_WIDGET (f) = 0; + if (x->ttip_widget) + { + /* Remove ttip_lbl from ttip_widget's custom slot before + destroying it, to avoid double-free (Bug#41239). */ + gtk_tooltip_set_custom (x->ttip_widget, NULL); + g_object_unref (G_OBJECT (x->ttip_widget)); + } if (x->ttip_lbl) gtk_widget_destroy (x->ttip_lbl); - if (x->ttip_widget) - g_object_unref (G_OBJECT (x->ttip_widget)); } } From b9b8c5e3fa71aea719934ce422fb22734590a8b3 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 24 May 2020 20:17:40 -0400 Subject: [PATCH 4/6] Make dedicated keymap and mode for eshell-command (Bug#41370) Otherwise, we end up permanently modifying eshell-mode-map when running eshell-command. * lisp/eshell/eshell.el (eshell-command-mode): New mode, with map to contain the bindings previously set by eshell-return-exits-minibuffer. (eshell-return-exits-minibuffer): Make into obsolete alias for eshell-command-mode. (eshell-command): Use eshell-command-mode instead of eshell-return-exits-minibuffer. --- lisp/eshell/eshell.el | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el index 2a63882ff09..5ffb159b575 100644 --- a/lisp/eshell/eshell.el +++ b/lisp/eshell/eshell.el @@ -265,14 +265,18 @@ information on Eshell, see Info node `(eshell)Top'." (eshell-mode)) buf)) -(defun eshell-return-exits-minibuffer () - ;; This is supposedly run after enabling esh-mode, when eshell-mode-map - ;; already exists. - (defvar eshell-mode-map) - (define-key eshell-mode-map [(control ?g)] 'abort-recursive-edit) - (define-key eshell-mode-map [(control ?m)] 'exit-minibuffer) - (define-key eshell-mode-map [(control ?j)] 'exit-minibuffer) - (define-key eshell-mode-map [(meta control ?m)] 'exit-minibuffer)) +(define-minor-mode eshell-command-mode + "Minor mode for `eshell-command' input. +\\{eshell-command-mode-map}" + :keymap (let ((map (make-sparse-keymap))) + (define-key map [(control ?g)] 'abort-recursive-edit) + (define-key map [(control ?m)] 'exit-minibuffer) + (define-key map [(control ?j)] 'exit-minibuffer) + (define-key map [(meta control ?m)] 'exit-minibuffer) + map)) + +(define-obsolete-function-alias 'eshell-return-exits-minibuffer + #'eshell-command-mode "28.1") (defvar eshell-non-interactive-p nil "A variable which is non-nil when Eshell is not running interactively. @@ -292,7 +296,7 @@ With prefix ARG, insert output into the current buffer at point." ;; Enable `eshell-mode' only in this minibuffer. (minibuffer-with-setup-hook #'(lambda () (eshell-mode) - (eshell-return-exits-minibuffer)) + (eshell-command-mode +1)) (unless command (setq command (read-from-minibuffer "Emacs shell command: ")) (if (eshell-using-module 'eshell-hist) From 0cdedf612b9da14fccc39c4a4e81cbf400e4552f Mon Sep 17 00:00:00 2001 From: "ej32u@protonmail.com" Date: Tue, 19 May 2020 21:43:13 +0000 Subject: [PATCH 5/6] Add command ffap-other-tab (Bug#41410) * lisp/ffap.el (ffap-other-tab): New command, opens files at point in another tab. (ffap-bindings): Bind it to find-file-other-tab's binding. --- lisp/ffap.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lisp/ffap.el b/lisp/ffap.el index d656b373729..ceba9d26223 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -54,6 +54,8 @@ ;; C-x 5 r ffap-read-only-other-frame ;; C-x 5 d ffap-dired-other-frame ;; +;; C-x t f ffap-other-tab +;; ;; S-mouse-3 ffap-at-mouse ;; C-S-mouse-3 ffap-menu ;; @@ -1758,6 +1760,14 @@ Only intended for interactive use." (set-window-dedicated-p win wdp)) value)) +(defun ffap-other-tab (filename) + "Like `ffap', but put buffer in another tab. +Only intended for interactive use." + (interactive (list (ffap-prompter nil " other tab"))) + (pcase (save-window-excursion (find-file-at-point filename)) + ((or (and (pred bufferp) b) `(,(and (pred bufferp) b) . ,_)) + (switch-to-buffer-other-tab b)))) + (defun ffap--toggle-read-only (buffer-or-list) (dolist (buffer (if (listp buffer-or-list) buffer-or-list @@ -2013,6 +2023,7 @@ This hook is intended to be put in `file-name-at-point-functions'." (global-set-key [remap find-file-other-window] 'ffap-other-window) (global-set-key [remap find-file-other-frame] 'ffap-other-frame) + (global-set-key [remap find-file-other-tab] 'ffap-other-tab) (global-set-key [remap find-file-read-only-other-window] 'ffap-read-only-other-window) (global-set-key [remap find-file-read-only-other-frame] 'ffap-read-only-other-frame) From c812223c9fc2684d0edc9cb848cfa6d83c6fdb9a Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 25 May 2020 15:03:37 +0200 Subject: [PATCH 6/6] Don't bug out in xml-escape-string if invalid characters aren't present * lisp/xml.el (xml-escape-string): Don't bug out if invalid characters aren't present. --- lisp/xml.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/xml.el b/lisp/xml.el index 767cf042846..10ef8e2087a 100644 --- a/lisp/xml.el +++ b/lisp/xml.el @@ -1032,7 +1032,8 @@ by https://www.w3.org/TR/xml/#charsets), signal an error of type (insert string) (goto-char (point-min)) (when (re-search-forward - "[^\u0009\u000A\u000D\u0020-\uD7FF\uE000-\uFFFD\U00010000-\U0010FFFF]") + "[^\u0009\u000A\u000D\u0020-\uD7FF\uE000-\uFFFD\U00010000-\U0010FFFF]" + nil t) (signal 'xml-invalid-character (list (char-before) (match-beginning 0)))) (dolist (substitution '(("&" . "&") ("<" . "<")