From unknown Mon Jun 23 04:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16607: hippie-expand, a patch Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Feb 2016 03:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16607 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Emilio C. Lopes Cc: 16607@debbugs.gnu.org Received: via spool by 16607-submit@debbugs.gnu.org id=B16607.145628441323524 (code B ref 16607); Wed, 24 Feb 2016 03:27:01 +0000 Received: (at 16607) by debbugs.gnu.org; 24 Feb 2016 03:26:53 +0000 Received: from localhost ([127.0.0.1]:42012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aYQ6G-00067M-Lo for submit@debbugs.gnu.org; Tue, 23 Feb 2016 22:26:52 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:41980) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aYQ6E-00067E-HY for 16607@debbugs.gnu.org; Tue, 23 Feb 2016 22:26:51 -0500 Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aYQ5q-00075L-NP; Wed, 24 Feb 2016 04:26:27 +0100 From: Lars Ingebrigtsen References: Date: Wed, 24 Feb 2016 14:26:22 +1100 In-Reply-To: (Emilio C. Lopes's message of "Tue, 28 Jan 2014 08:35:37 +0100") Message-ID: <87ziuqlrfl.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-MailScanner-ID: 1aYQ5q-00075L-NP X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1456889187.78522@hYVg3pCW1VOZX981PUy+Pg X-Spam-Status: No X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Emilio C. Lopes writes: > `hippie-expand' use several methods to expand text in the current buffer. > Some of those methods search for possible expansions in multiple Emacs > buffers, controlled by the variables `hippie-expand-ignore-buffers' and > `hippie-expand-only-buffers'. > > It would be useful to be able to set these two variables locally in a > Buffer (using `make-local-variable'). This would allow for example to > set up `hippie-expand' in Lisp buffers to only search for possible > expansions in other Lisp buffers. > > As it is now (Emacs 24.3) the functions in `hippie-expand' using those > variables do so in the context of the buffers where potential completions > are searched for. The patch bellow causes the lookup to occur in the > buffer where `hippie-expand' was invoked. I think the patch below looks reasonable, but I've never used hippie-expand. Are there anybody that can weigh in on this? > > Regards > > Em=EDlio > > 2014-01-27 Emilio C. Lopes > > * hippie-exp.el (try-expand-line-all-buffers) > (try-expand-list-all-buffers, try-expand-dabbrev-all-buffers): > Use the value of `hippie-expand-only-buffers' and > `hippie-expand-ignore-buffers' from the buffer where > `hippie-expand' was invoked allowing these variables to be > buffer-local. > > diff --unified lisp/hippie-exp.el.\~1\~ lisp/hippie-exp.el > --- lisp/hippie-exp.el.~1~ 2013-03-17 20:52:38.000000000 +0100 > +++ lisp/hippie-exp.el 2014-01-27 20:29:12.000000000 +0100 > @@ -642,6 +642,8 @@ > comint-use-prompt-regexp > comint-prompt-regexp)) > (buf (current-buffer)) > + (only-buffers hippie-expand-only-buffers) > + (ignore-buffers hippie-expand-ignore-buffers) > (orig-case-fold-search case-fold-search)) > (if (not old) > (progn > @@ -657,9 +659,9 @@ > (< he-searched-n-bufs hippie-expand-max-buffers))) > (set-buffer (car he-search-bufs)) > (if (and (not (eq (current-buffer) buf)) > - (if hippie-expand-only-buffers > - (he-buffer-member hippie-expand-only-buffers) > - (not (he-buffer-member hippie-expand-ignore-buffers)))) > + (if only-buffers > + (he-buffer-member only-buffers) > + (not (he-buffer-member ignore-buffers)))) > (save-excursion > (save-restriction > (if hippie-expand-no-restriction > @@ -771,6 +773,8 @@ > string). It returns t if a new completion is found, nil otherwise." > (let ((expansion ()) > (buf (current-buffer)) > + (only-buffers hippie-expand-only-buffers) > + (ignore-buffers hippie-expand-ignore-buffers) > (orig-case-fold-search case-fold-search)) > (if (not old) > (progn > @@ -786,9 +790,9 @@ > (< he-searched-n-bufs hippie-expand-max-buffers))) > (set-buffer (car he-search-bufs)) > (if (and (not (eq (current-buffer) buf)) > - (if hippie-expand-only-buffers > - (he-buffer-member hippie-expand-only-buffers) > - (not (he-buffer-member hippie-expand-ignore-buffers)))) > + (if only-buffers > + (he-buffer-member only-buffers) > + (not (he-buffer-member ignore-buffers)))) > (save-excursion > (save-restriction > (if hippie-expand-no-restriction > @@ -926,6 +930,8 @@ > string). It returns t if a new expansion is found, nil otherwise." > (let ((expansion ()) > (buf (current-buffer)) > + (only-buffers hippie-expand-only-buffers) > + (ignore-buffers hippie-expand-ignore-buffers) > (orig-case-fold-search case-fold-search)) > (if (not old) > (progn > @@ -941,9 +947,9 @@ > (< he-searched-n-bufs hippie-expand-max-buffers))) > (set-buffer (car he-search-bufs)) > (if (and (not (eq (current-buffer) buf)) > - (if hippie-expand-only-buffers > - (he-buffer-member hippie-expand-only-buffers) > - (not (he-buffer-member hippie-expand-ignore-buffers)))) > + (if only-buffers > + (he-buffer-member only-buffers) > + (not (he-buffer-member ignore-buffers)))) > (save-excursion > (save-restriction > (if hippie-expand-no-restriction > > Diff finished. Mon Jan 27 22:20:31 2014 --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun May 21 18:31:10 2017 Received: (at control) by debbugs.gnu.org; 21 May 2017 22:31:10 +0000 Received: from localhost ([127.0.0.1]:59707 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dCZNW-0005yv-At for submit@debbugs.gnu.org; Sun, 21 May 2017 18:31:10 -0400 Received: from mail-io0-f170.google.com ([209.85.223.170]:36594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dCZNU-0005yi-3x for control@debbugs.gnu.org; Sun, 21 May 2017 18:31:08 -0400 Received: by mail-io0-f170.google.com with SMTP id o12so71750105iod.3 for ; Sun, 21 May 2017 15:31:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:mime-version; bh=dgkglcIxOKp2AFUiaFHYti7sE1ITJaTh7yg69UDOGRo=; b=MP9FxxgNPDubscH+c95qEIqAYJZbl6371k/UTB6Gu2XQJS/tTgpx5ueF3BEexDEN+c KtXEKD4HcKfBUzrQxIGh/rZpX3JoF+iLOhc7JlzGDrokorD7Pt8lMmnZSPPSZ1lTLZ6C mCGa3M3L73lSWAxbojdskuczh1vzQVKow7UNz7sYE7gBvwtjDVrZMKKH4ekJCuCKCaxr sKnxgz563f8RRSq2sexhLXGcjAGYbPK8Sbjriy5kniuS7zjxq6EIq/evTOL49iLyqRPr 90CgnxH+2hSqBYvM2tulZZpgRpgN8WTZ/rkAixavqSqtmZM21OFEuW1U8noFsooUnHrp 0VFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version; bh=dgkglcIxOKp2AFUiaFHYti7sE1ITJaTh7yg69UDOGRo=; b=QlzETXPUVF/bdSBJVv4QCMPm4z8A0PF6zh114ApF0TpHkYMmVJcJkHlutl4HbQ8+aJ MfDpEH1yGPo6mQV4MyZfPtJBVy41lvElU/2qUOKXkD9iOgA/VyDq8orFtvIpoQobGFWr 4/KHaptO+RFESZCCfuXWV5gj/UYKpA8vPUI5+K7E9fARTLn13TFsdTv/yOO+/+tHFbtn cEP7/7OoV5+XpMCS7rCnx3Lnkx4N0KuZD31qc5r2g7VPAmoSajUrAqDBw7J7s2ct7Vsg KgrTMxJE1Mte1MgQ4ThXEjklPepvr+kKrc8rLiNji5MjWkz+jKXReodGlbHFnsAVqIPK +b8g== X-Gm-Message-State: AODbwcDOAotPFf5fD2f2W24i946wB1rzVIJ1SRaRLHEoM7D2CHiCQYr4 mJsi3UkBN0zXHlwN X-Received: by 10.107.53.170 with SMTP id k42mr20295539ioo.197.1495405862322; Sun, 21 May 2017 15:31:02 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id e126sm6850007ioe.12.2017.05.21.15.31.01 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 21 May 2017 15:31:01 -0700 (PDT) From: npostavs@users.sourceforge.net To: control@debbugs.gnu.org Subject: control message for bug #16607 Date: Sun, 21 May 2017 18:32:38 -0400 Message-ID: <87shjxg7sp.fsf@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) severity 16607 wishlist quit From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 29 21:10:45 2017 Received: (at control) by debbugs.gnu.org; 30 Jun 2017 01:10:45 +0000 Received: from localhost ([127.0.0.1]:45215 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQkSL-00012Q-L7 for submit@debbugs.gnu.org; Thu, 29 Jun 2017 21:10:45 -0400 Received: from mail-it0-f46.google.com ([209.85.214.46]:37789) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQkSJ-00012E-U2 for control@debbugs.gnu.org; Thu, 29 Jun 2017 21:10:44 -0400 Received: by mail-it0-f46.google.com with SMTP id m84so16940521ita.0 for ; Thu, 29 Jun 2017 18:10:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:mime-version; bh=9zEKnDZhAdc+w8POHRA3t8Wc35dViCJiRCAxNxbXuaE=; b=H838gs8W7eOo9fwQzOLH/iNF/cTg08YYuUAT1mTaNjRUVu3JYDK6MSB6lKYzNqQqRD LNuf7wBKdPM54KS6ccCUTO7ebWY1jVmbWTfiDgOAve06ro8WZV4hzXphqDK/pU9msQR9 rnU9rU+DfRULG6sfXU9KKc7Zhq7nJuttevZneZspa2tAOzLI0XIsdnz+0STVvUQpkTBg dbJ30nJHJzDRD35BZ4t8FHU8DWkB2MjX3xgPw36FreRB+M7r4mnLlC2XK8OILk6uHQVf jXVRM5W7DFoH/7b4sP5E4bX/PhTPq42ESCSHGlU9T5ARc2kFyqplmmI0l+SEriFsWJtD F3vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version; bh=9zEKnDZhAdc+w8POHRA3t8Wc35dViCJiRCAxNxbXuaE=; b=Kb2lS/Xgtnygzps31IkeuHmdiJTWNyaOwElqf6OeO3MqnXV024mDsAVqokcP7V9xga 6xaJNdJDLClWXJy8ATCPaz3WiCChFOP1KY+oU39djyXaNGtmKQgkhVMPPWTeg6GlTx6c CugFVdCQkyFVU+G9dOy/fwGCZyGVFB8ULfmommtEE/9Sfb26Jp0Zhav3ScEhkYtBT2VH peT/zdquJFsqHuCWEObmX1NhN72EBWX7zRLT/ygWZr9CWE6ozYbpTFWzwBgjvQSk/suW 8vk6NExnDcYHWDPsvB0Xt7xtq4d7ntcW5KtS4fqBLJRcdc/ZnyqIV9dDVA2LOwqKGNnK aHyA== X-Gm-Message-State: AKS2vOzqui2OoJ4ynR5c+YsS8R8zQbCbHgBvosUTXJkKmYe+oDfj/egy SzM6d4hoToHyoGS5 X-Received: by 10.36.244.3 with SMTP id d3mr5248655iti.62.1498785038122; Thu, 29 Jun 2017 18:10:38 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id b18sm1411740itd.25.2017.06.29.18.10.37 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Jun 2017 18:10:37 -0700 (PDT) From: npostavs@users.sourceforge.net To: control@debbugs.gnu.org Subject: control message for bug #27501 Date: Thu, 29 Jun 2017 21:12:14 -0400 Message-ID: <8737aimg7l.fsf@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) forcemerge 27501 16607 quit From unknown Mon Jun 23 04:12:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#16607: hippie-expand, a patch Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Jul 2017 19:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16607 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Lars Ingebrigtsen Cc: 16607@debbugs.gnu.org, "Emilio C. Lopes" Received: via spool by 16607-submit@debbugs.gnu.org id=B16607.149902406511235 (code B ref 16607); Sun, 02 Jul 2017 19:35:02 +0000 Received: (at 16607) by debbugs.gnu.org; 2 Jul 2017 19:34:25 +0000 Received: from localhost ([127.0.0.1]:49032 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dRkdS-0002v1-2i for submit@debbugs.gnu.org; Sun, 02 Jul 2017 15:34:25 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:35353) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dRkdJ-0002ud-Jb; Sun, 02 Jul 2017 15:34:17 -0400 Received: by mail-io0-f194.google.com with SMTP id 84so7216346iop.2; Sun, 02 Jul 2017 12:34:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Hwn1e+I9sGXBIV5nUsUOG07Bzlv4jauD2RTuy5gjj7o=; b=uHjpd74qDXp5htAT7P7AQiz6wyxoIxS9xsaZyXY56OiJArx5MOeVjWYGOc15kp4v+o 7xjqybeDygurkNw8ues5S53TtNw7LIP5hr0ZTL+ggjt8is/yFLV83xG6INygXhmHH3/B BmVrTsMCztykafBEyXy/GK8MDgrbYT/mmuPJLvSHcswyuy3siC0OUyTNMu8Hzy5UsZxq rrdw5nesz0Cuf58dzC0PoAkqlq2EMtN//GaCmDjFyO6VL1XacYSXCP6ll0ykJ64Up0L6 rBrjgeOtRZECgdVKIlCVOYIPDtb3HELUYT26H/D7eFBBI+QQtrsDMQsfJRJy6s3f08Kz /O+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=Hwn1e+I9sGXBIV5nUsUOG07Bzlv4jauD2RTuy5gjj7o=; b=mAhRl9/ZO011o77xiqDPBU/8YYrV44nkpEQ4GPVQiecolwHX3B2L2oe9LFFrz2XvZX X+27hany4P4ObXu9q+lPy/9JsK7KwPCb0zkPtU6+YRu4vMdit2WcEPf29+xdYGJIimlc guONTDnevv2atOSUAcFH8X/yhBX1yJWD0/MesdtjJsA2yS3o+cK128wjtBs60yq5+hbE +7nMT6u3NEBpDZ3JGVor5kBolvES/KbuO6llfAyrnVKAuPNtuAbm6yDnkYx4c4MNAAdD 0CvjqaCY0yvNK0NLuHYtgEm5jsv+6pxUOIB8A5ZR5TBx1DrW++GuYpRmgSx91DuSljvK Y/VQ== X-Gm-Message-State: AKS2vOy2ZAspwINb1i+KQrqKswJ2rPEyhL2Rx9j7RkFVYLoYbzqR3hhv MQJfwR1wmHUbuLVa X-Received: by 10.107.173.220 with SMTP id m89mr35783568ioo.152.1499024047979; Sun, 02 Jul 2017 12:34:07 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id z62sm6918896ioz.37.2017.07.02.12.34.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 02 Jul 2017 12:34:07 -0700 (PDT) From: npostavs@users.sourceforge.net References: <87ziuqlrfl.fsf@gnus.org> Date: Sun, 02 Jul 2017 15:35:43 -0400 In-Reply-To: <87ziuqlrfl.fsf@gnus.org> (Lars Ingebrigtsen's message of "Wed, 24 Feb 2016 14:26:22 +1100") Message-ID: <87shiek4xc.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.1 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.1 (--) tags 16607 fixed close 16607 25.1 quit Lars Ingebrigtsen writes: > Emilio C. Lopes writes: > >> `hippie-expand' use several methods to expand text in the current buffer. >> Some of those methods search for possible expansions in multiple Emacs >> buffers, controlled by the variables `hippie-expand-ignore-buffers' and >> `hippie-expand-only-buffers'. >> >> It would be useful to be able to set these two variables locally in a >> Buffer (using `make-local-variable'). This would allow for example to >> set up `hippie-expand' in Lisp buffers to only search for possible >> expansions in other Lisp buffers. >> >> As it is now (Emacs 24.3) the functions in `hippie-expand' using those >> variables do so in the context of the buffers where potential completions >> are searched for. The patch bellow causes the lookup to occur in the >> buffer where `hippie-expand' was invoked. > > I think the patch below looks reasonable, but I've never used > hippie-expand. Are there anybody that can weigh in on this? This was already added in Emacs 25.1. [1: 8576251878]: 2014-06-12 09:45:52 -0400 * lisp/hippie-exp.el (try-expand-line-all-buffers) (try-expand-list-all-buffers, try-expand-dabbrev-all-buffers): Read hippie-expand-only-buffers and hippie-expand-ignore-buffers in the original buffer, in case they're buffer-local. http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=8576251878f59f686b3a14c574a402549eabcbc1