From e6834952edbd8b4e00c2e7b06535778fb6a1865b Mon Sep 17 00:00:00 2001 From: Devon Sean McCullough Date: Fri, 25 Dec 2015 22:21:22 +0100 Subject: [PATCH 1/4] Doc fix for url-http * lisp/url/url-http.el (url-http): Document better return values (bug#13187) (tiny change) (cherry picked from commit 344303c8d9cb03d4778a73940e80e966280aa694) --- lisp/url/url-http.el | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index 8f36ddeafbf..e0e080e76af 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el @@ -1195,17 +1195,20 @@ the end of the document." "Retrieve URL via HTTP asynchronously. URL must be a parsed URL. See `url-generic-parse-url' for details. -When retrieval is completed, execute the function CALLBACK, passing it -an updated value of CBARGS as arguments. The first element in CBARGS -should be a plist describing what has happened so far during the -request, as described in the docstring of `url-retrieve' (if in -doubt, specify nil). +When retrieval is completed, execute the function CALLBACK, +passing it an updated value of CBARGS as arguments. The first +element in CBARGS should be a plist describing what has happened +so far during the request, as described in the docstring of +`url-retrieve' (if in doubt, specify nil). The current buffer +then CALLBACK is executed is the retrieval buffer. Optional arg RETRY-BUFFER, if non-nil, specifies the buffer of a previous `url-http' call, which is being re-attempted. Optional arg GATEWAY-METHOD specifies the gateway to be used, -overriding the value of `url-gateway-method'." +overriding the value of `url-gateway-method'. + +The return value of this function is the retrieval buffer." (cl-check-type url vector "Need a pre-parsed URL.") (let* ((host (url-host (or url-using-proxy url))) (port (url-port (or url-using-proxy url))) From ace9d227dd5fd0c81c456e75a40ea36d169a0d58 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 28 Apr 2016 15:53:15 +0200 Subject: [PATCH 2/4] Make a menu less ambiguous * doc/emacs/custom.texi (Key Bindings): The Modifier Keys node is about using modifier keys, not binding them (bug#10942). (cherry picked from commit 214f85a0a68b96a552ca605d601b33f6eef5c4ca) --- doc/emacs/custom.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index c1093353757..771633623f5 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -1396,7 +1396,7 @@ init file (@pxref{Init Rebinding}). * Minibuffer Maps:: The minibuffer uses its own local keymaps. * Rebinding:: How to redefine one key's meaning conveniently. * Init Rebinding:: Rebinding keys with your initialization file. -* Modifier Keys:: Using modifier keys in key bindings. +* Modifier Keys:: Using modifier keys. * Function Keys:: Rebinding terminal function keys. * Named ASCII Chars:: Distinguishing @key{TAB} from @kbd{C-i}, and so on. * Mouse Buttons:: Rebinding mouse buttons in Emacs. From 5e50114d2495dab67793e76411d10c93bf411e03 Mon Sep 17 00:00:00 2001 From: "Peder O. Klingenberg" Date: Tue, 30 Aug 2016 14:44:16 +0200 Subject: [PATCH 3/4] Avoid error in icalendar--read-element * lisp/calendar/icalendar.el (icalendar--read-element): Avoid a regex stack overflow by not using regex to extract values from calendar events. (Bug#24315) (cherry picked from commit 55dde6c1a21a792d3d75c19e612c74dd054aaf1e) --- lisp/calendar/icalendar.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el index 386c554c068..c88f4abcb6e 100644 --- a/lisp/calendar/icalendar.el +++ b/lisp/calendar/icalendar.el @@ -361,7 +361,8 @@ Pass arguments REGEXP REP STRING FIXEDCASE LITERAL to INVALUE gives the current iCalendar element we are reading. INPARAMS gives the current parameters..... This function calls itself recursively for each nested calendar element -it finds." +it finds. The current buffer should be an unfolded buffer as returned +from `icalendar--get-unfolded-buffer'." (let (element children line name params param param-name param-value value (continue t)) @@ -391,8 +392,9 @@ it finds." (unless (looking-at ":") (error "Oops")) (forward-char 1) - (re-search-forward "\\(.*\\)\\(\r?\n[ \t].*\\)*" nil t) - (setq value (icalendar--rris "\r?\n[ \t]" "" (match-string 0))) + (let ((start (point))) + (end-of-line) + (setq value (buffer-substring start (point)))) (setq line (list name params value)) (cond ((eq name 'BEGIN) (setq children From 623401267a66929a1c13c264e0dc40ba2599500f Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 3 Sep 2016 23:38:35 -0400 Subject: [PATCH 4/4] Don't require isearch-update before isearch-done It is useful to be able to call `isearch-done' unconditionally to ensure a non-isearching state. * lisp/isearch.el (isearch-done): Check that `isearch--current-buffer' is a live buffer before using it (Bug #21091). * test/lisp/isearch-tests.el (isearch--test-done): Test it. (cherry picked from commit 68f4b5292781bc331b040105c4079902b993835c) --- lisp/isearch.el | 7 ++++--- test/automated/isearch-tests.el | 8 ++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index a97247671cc..9df7627fa7c 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1049,9 +1049,10 @@ NOPUSH is t and EDIT is t." (remove-hook 'mouse-leave-buffer-hook 'isearch-done) (remove-hook 'kbd-macro-termination-hook 'isearch-done) (setq isearch-lazy-highlight-start nil) - (with-current-buffer isearch--current-buffer - (setq isearch--current-buffer nil) - (setq cursor-sensor-inhibit (delq 'isearch cursor-sensor-inhibit))) + (when (buffer-live-p isearch--current-buffer) + (with-current-buffer isearch--current-buffer + (setq isearch--current-buffer nil) + (setq cursor-sensor-inhibit (delq 'isearch cursor-sensor-inhibit)))) ;; Called by all commands that terminate isearch-mode. ;; If NOPUSH is non-nil, we don't push the string on the search ring. diff --git a/test/automated/isearch-tests.el b/test/automated/isearch-tests.el index 48c342403c9..52f312d0b97 100644 --- a/test/automated/isearch-tests.el +++ b/test/automated/isearch-tests.el @@ -28,5 +28,13 @@ (isearch-update) (should (equal isearch--current-buffer (current-buffer))))) +(ert-deftest isearch--test-done () + ;; Normal operation. + (isearch-update) + (isearch-done) + (should-not isearch--current-buffer) + ;; Bug #21091: let `isearch-done' work without `isearch-update'. + (isearch-done)) + (provide 'isearch-tests) ;;; isearch-tests.el ends here