all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#27341: eww-search-words should prompt if region inactive
@ 2017-06-12 11:21 Alex Branham
  2017-06-13  9:24 ` bug#27341: updated patch to fix docstring Alex Branham
  0 siblings, 1 reply; 15+ messages in thread
From: Alex Branham @ 2017-06-12 11:21 UTC (permalink / raw)
  To: 27341

[-- Attachment #1: Type: text/plain, Size: 205 bytes --]

eww-search-words (M-S M-w) searches for the active region and doesn't do anything useful if the region isn't active. This patch has it prompt the user for a search string if the region isn't active.

Alex

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-eww-earch-prefix-prompt-for-query-if-region-inactive.patch --]
[-- Type: text/x-diff, Size: 876 bytes --]

From bf8cda29c442fa773ce59fe7bf7760887399c8fd Mon Sep 17 00:00:00 2001
From: Alex Branham <branham@utexas.edu>
Date: Mon, 12 Jun 2017 13:10:27 +0200
Subject: [PATCH] eww-earch-prefix: prompt for query if region inactive

---
 lisp/net/eww.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index fe31657914..dd64dc81eb 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -316,7 +316,9 @@ word(s) will be searched for via `eww-search-prefix'."
   "Search the web for the text between BEG and END.
 See the `eww-search-prefix' variable for the search engine used."
   (interactive "r")
-  (eww (buffer-substring beg end)))
+  (if (region-active-p)
+      (eww (buffer-substring beg end))
+    (eww (read-string "Query: "))))
 
 (defun eww-open-in-new-buffer ()
   "Fetch link at point in a new EWW buffer."
-- 
2.13.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-07-02 20:23 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-12 11:21 bug#27341: eww-search-words should prompt if region inactive Alex Branham
2017-06-13  9:24 ` bug#27341: updated patch to fix docstring Alex Branham
2017-06-25 14:29   ` npostavs
2017-06-26 14:00     ` Alex Branham
2017-06-26 23:50       ` npostavs
2017-06-27  5:32         ` Alex Branham
2017-06-27 13:23           ` Alex Branham
2017-06-30  0:54             ` npostavs
2017-06-30  6:25               ` Alex Branham
2017-07-02 18:32             ` npostavs
2017-07-02 18:45               ` Alex Branham
2017-07-02 19:13                 ` npostavs
2017-07-02 19:25                   ` Alex Branham
2017-07-02 20:23                     ` npostavs
2017-06-27 14:40           ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.