From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Branham Newsgroups: gmane.emacs.bugs Subject: bug#27341: updated patch to fix docstring Date: Tue, 27 Jun 2017 15:23:17 +0200 Message-ID: <878tkdy37e.fsf@utexas.edu> References: <8760g1xxhw.fsf@utexas.edu> <8737b4grzq.fsf@utexas.edu> <8737aop2d9.fsf@users.sourceforge.net> <87lgoedf1t.fsf@utexas.edu> <87efu6nwa2.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1498569900 18569 195.159.176.226 (27 Jun 2017 13:25:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 27 Jun 2017 13:25:00 +0000 (UTC) User-Agent: mu4e 0.9.18; emacs 25.2.1 Cc: 27341@debbugs.gnu.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 27 15:24:51 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPqU2-00048j-15 for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Jun 2017 15:24:46 +0200 Original-Received: from localhost ([::1]:52933 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPqU7-0007d5-AJ for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Jun 2017 09:24:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58552) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPqTO-0007Dd-3k for bug-gnu-emacs@gnu.org; Tue, 27 Jun 2017 09:24:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dPqTK-0005S3-3j for bug-gnu-emacs@gnu.org; Tue, 27 Jun 2017 09:24:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37485) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dPqTJ-0005Rs-TR for bug-gnu-emacs@gnu.org; Tue, 27 Jun 2017 09:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dPqTJ-0006Ty-J0 for bug-gnu-emacs@gnu.org; Tue, 27 Jun 2017 09:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Branham Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Jun 2017 13:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27341 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 27341-submit@debbugs.gnu.org id=B27341.149856981024869 (code B ref 27341); Tue, 27 Jun 2017 13:24:01 +0000 Original-Received: (at 27341) by debbugs.gnu.org; 27 Jun 2017 13:23:30 +0000 Original-Received: from localhost ([127.0.0.1]:40160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPqSn-0006T2-Kt for submit@debbugs.gnu.org; Tue, 27 Jun 2017 09:23:29 -0400 Original-Received: from mail-lf0-f53.google.com ([209.85.215.53]:35259) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dPqSl-0006Sp-Ie for 27341@debbugs.gnu.org; Tue, 27 Jun 2017 09:23:28 -0400 Original-Received: by mail-lf0-f53.google.com with SMTP id b207so17084928lfg.2 for <27341@debbugs.gnu.org>; Tue, 27 Jun 2017 06:23:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=utexas-edu.20150623.gappssmtp.com; s=20150623; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=fFBKVARbJLrwPK3Rc7T7SwnR0QfQTVv4k7QilLvLuKg=; b=WN9Bw74GHTjsbAwYOvLiRSMxfvIh68gU44hWfRG2sBjygmgE1jKOkQScitG4RsHu0x BFQcgqV0igFoxaQe1YatSbwaWJm2zMg3auI0M53IfGRLAnktiXVjIpiDempwR0alf/DL OjCWtkKWbkOA+8DB8ShX7KCIyWXUrzGP45OiJj5jOHc2YMRNClf+3xPTLpcrCKzIrv0Q eqLGjxr7BAisiRnHmGSPlO86vH+SY8tkTsp/ChSuGfZqJSBnqvskdxR5RqtnM1LegXXA Wqtfh6DtyS8Um8JGhIYowb29KLqC1Kp87OKbja1AVserTltp4Rfkn1dTtQIn93NbcyRh ZI5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=fFBKVARbJLrwPK3Rc7T7SwnR0QfQTVv4k7QilLvLuKg=; b=czPtn2D+BJ0+J8lLFGcbIa7DzhZoBP9PfWv2SylkynG3z5TrCTrAflLjh5oD4JYnMc g8IadH8/UblptK5zIBrgaTlPYFj0Ya8ooJQNyUHysizx05wzmYLCw86T6iX/APkT+UwK 6IT13LFGl9terGm/QYVLFYLFZODQ1yuY0LYjfsMihy/QdapCvqSLSBIFt0pD0h2DCG60 Wh7wbO54BinQnfg9NP0bt799gTuLteCEKGqdlzlxsv1R/79Nle0JA78yFUIr65mrgLyo 9/Unc4gV2pIQewUVvRRCNtW+V/ode+dBe3vNW1HRs0nMcolx4FKDVicCUYLmgtP8BhVN LloQ== X-Gm-Message-State: AKS2vOwKg+uh1k2625J+2XeISkx5SIyHvyE98VZlQ0jiZ+JEr64ccj/z 0RB+rhyF05qod5QmSBM= X-Received: by 10.46.74.1 with SMTP id x1mr1614248lja.27.1498569801096; Tue, 27 Jun 2017 06:23:21 -0700 (PDT) Original-Received: from mars (edu220107.eduroam.gu.se. [130.241.220.107]) by smtp.gmail.com with ESMTPSA id v28sm650321ljd.17.2017.06.27.06.23.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Jun 2017 06:23:19 -0700 (PDT) In-reply-to: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:133948 Archived-At: --=-=-= Content-Type: text/plain Actually, we need to check (use-region-p) anyway in case the mark hasn't been activated yet in the buffer: >From 685f3d0d2bfea7b3d6aad03d46a247fac25702d0 Mon Sep 17 00:00:00 2001 From: Alex Branham Date: Tue, 27 Jun 2017 15:20:27 +0200 Subject: [PATCH] eww-search-words prompt for query if region inactive or blank --- lisp/net/eww.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index fe31657914..a90caa7fc4 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -314,9 +314,16 @@ word(s) will be searched for via `eww-search-prefix'." ;;;###autoload (defun eww-search-words (&optional beg end) "Search the web for the text between BEG and END. -See the `eww-search-prefix' variable for the search engine used." + If region is active (and not whitespace), search the web for + the text between BEG and END. Else, prompt the user for a search + string. See the `eww-search-prefix' variable for the search + engine used." (interactive "r") - (eww (buffer-substring beg end))) + (if (use-region-p) + (let ((region-string (buffer-substring beg end))) + (if (not (string-match-p "\\`[ \n\t\r\v\f]*\\'" region-string)) + (eww region-string))) + (eww (read-string "Query: ")))) (defun eww-open-in-new-buffer () "Fetch link at point in a new EWW buffer." -- 2.13.2 On Tue 27 Jun 2017 at 05:32, Alex Branham wrote: > No, I haven't. Do I need to for something this small? Happy to do so if > it's necessary. > > Alex > > On Jun 27, 2017 1:49 AM, wrote: > >> Alex Branham writes: >> >> > Here's a new patch that checks the region directly, ignoring >> `use-empty-active-region'. >> >> Looks good, I'll push in a few days. You haven't assigned copyright, >> have you? >> --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0004-eww-search-words-prompt-user-for-query-if-region-inactive.patch >From 685f3d0d2bfea7b3d6aad03d46a247fac25702d0 Mon Sep 17 00:00:00 2001 From: Alex Branham Date: Tue, 27 Jun 2017 15:20:27 +0200 Subject: [PATCH] eww-search-words prompt for query if region inactive or blank --- lisp/net/eww.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index fe31657914..a90caa7fc4 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -314,9 +314,16 @@ word(s) will be searched for via `eww-search-prefix'." ;;;###autoload (defun eww-search-words (&optional beg end) "Search the web for the text between BEG and END. -See the `eww-search-prefix' variable for the search engine used." + If region is active (and not whitespace), search the web for + the text between BEG and END. Else, prompt the user for a search + string. See the `eww-search-prefix' variable for the search + engine used." (interactive "r") - (eww (buffer-substring beg end))) + (if (use-region-p) + (let ((region-string (buffer-substring beg end))) + (if (not (string-match-p "\\`[ \n\t\r\v\f]*\\'" region-string)) + (eww region-string))) + (eww (read-string "Query: ")))) (defun eww-open-in-new-buffer () "Fetch link at point in a new EWW buffer." -- 2.13.2 --=-=-=--