From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Grant Rettke Newsgroups: gmane.emacs.help Subject: How properly utilize the minibuffer and inactive minibuffer startup hooks? Date: Tue, 8 Jul 2014 15:07:59 -0500 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1404869952 25816 80.91.229.3 (9 Jul 2014 01:39:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Jul 2014 01:39:12 +0000 (UTC) To: Emacs Help Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 09 03:39:07 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X4gqf-0005T5-Nz for geh-help-gnu-emacs@m.gmane.org; Wed, 09 Jul 2014 03:39:05 +0200 Original-Received: from localhost ([::1]:58531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4gqf-0004YU-8M for geh-help-gnu-emacs@m.gmane.org; Tue, 08 Jul 2014 21:39:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4bgI-0002xM-7k for help-gnu-emacs@gnu.org; Tue, 08 Jul 2014 16:08:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X4bgG-0002Zc-Uk for help-gnu-emacs@gnu.org; Tue, 08 Jul 2014 16:08:02 -0400 Original-Received: from mail-oa0-x22e.google.com ([2607:f8b0:4003:c02::22e]:41497) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X4bgG-0002ZW-OI for help-gnu-emacs@gnu.org; Tue, 08 Jul 2014 16:08:00 -0400 Original-Received: by mail-oa0-f46.google.com with SMTP id m1so1089739oag.33 for ; Tue, 08 Jul 2014 13:07:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=klUEHmqHNm5S+oDLyPo8ZlcOmr2hCckBDeWazLjNEnM=; b=EUOrweeuMBmNdHgNIhUecDNN1VzMz89vizAJI0nWzqrUY2dizDSw1J1yGUgv8Foiii n9BnRVNh7HGWeSG/PbA2PQHqvZJd0dHxpQ3ESEanzrkhuhU4IsbYXxVI/ioDNgwoqGgI ShEhhPrPB07BsVzZXjUeQzHMEst8sgZhLt6cr5fFCB0yz6vQ2rJAuRpQH3GlGhQKT2OE Fu00D4vcU3Vi8K9Vd1mWCQVsEWUL4d/+t/oa12GY06WkiLm0HGsDEUwzq5XneMtundZH swtyA2dragEjPj8aNu5Mq5qd6sU92EVIvejcH0AbENOhiQnHBNQW1+7Ony3NoFGU7Vyn a8jQ== X-Received: by 10.60.78.198 with SMTP id d6mr30129371oex.28.1404850079748; Tue, 08 Jul 2014 13:07:59 -0700 (PDT) Original-Received: by 10.182.77.39 with HTTP; Tue, 8 Jul 2014 13:07:59 -0700 (PDT) X-Google-Sender-Auth: EjaIo0vh6A-EDH8wITszzyDUk7U X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c02::22e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:98594 Archived-At: Good morning, 1 My goal =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90 My goal is to enable [smartparens] in the minibuffer but only when calling `eval-expression'. That includes the inactive minibuffer. My attempt to do so looks like this: =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80 =E2=94=82 (defun gcr/smartparens-if-eval-expr () =E2=94=82 "Enable Smartparens in the mini-buffer but only when eval'ing= expressions" =E2=94=82 (if (eq this-command 'eval-expression) =E2=94=82 (turn-on-smartparens-strict-mode))) =E2=94=82 =E2=94=82 (defun gcr/minibuffer-setup-hook () =E2=94=82 "Personal setup." =E2=94=82 (local-set-key "ESC y" 'gcr/paste-from-x-clipboard) =E2=94=82 (gcr/smartparens-if-eval-expr)) =E2=94=82 =E2=94=82 (add-hook 'minibuffer-setup-hook 'gcr/minibuffer-setup-hook) =E2=94=82 =E2=94=82 (add-hook 'minibuffer-inactive-mode-hook 'gcr/minibuffer-setup-= hook) =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80 What I expected is that `smartparens' would be enabled every time I enter the minibuffer. The problem I am facing is that it is not. [smartparens] https://github.com/Fuco1/smartparens 2 Issue and questions =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95= =90=E2=95=90=E2=95=90=E2=95=90=E2=95=90 Instead: =E2=80=A2 It is only turned on inside of the minibuffer on the first call= to `eval-expression' =E2=80=A2 Every call after that to `eval-expression' does not result in `smartparens' being enabled "Being enabled" means that: =E2=80=A2 After starting Emacs =E2=80=A2 After typing `M-:', entering a open round bracket, and I will s= ee the right balanced bracket inserted, too. =E2=80=A2 While in that minibuffer, doing a `C-h m' shows the list of mod= es and Smartparen is in there. It looks like this: =E2=80=A2 `Show-Smartparens-Global Size-Indication Smartparens Smartparens-Strict' Following those steps, within the same Emacs session, the 2nd time that I try to perform those steps it is no longer true in that: 1. Smartparens is not turned on. One thing that I did check for is that I am in the correct mode and command added in the hook this: =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80 =E2=94=82 (print (format "%s %s" mode-name this-command)) =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80 And got what I expected 3 times: =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80 =E2=94=82 InactiveMinibuffer eval-expression =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80 Clearly, *I* am doing something wrong, not the modeline or Smartparens. I am looking for thoughts on what I am doing wrong, and wondering what I may do different to investigate and discover the nature my error since: =E2=80=A2 Smartparens works fine =E2=80=A2 Modeline works fine =E2=80=A2 What am I doing wrong? 3 My environment =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2= =95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90 My environment: =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80 =E2=94=82 (print (format "%s" emacs-version)) =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80 =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80 =E2=94=82 =3D24.3.1 =E2=94=82 =3D" =E2=94=82 \"24.3.1\" =E2=94=82 " =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80 =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80 =E2=94=82 uname -a =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80 =E2=95=AD=E2=94=80=E2=94=80=E2=94=80=E2=94=80 =E2=94=82 Darwin orion 13.2.0 Darwin Kernel Version 13.2.0: Thu Apr 17 23:03:13 PDT 2014; root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64 =E2=95=B0=E2=94=80=E2=94=80=E2=94=80=E2=94=80 Kind regards, gcr