From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11545 invoked from network); 16 Nov 2020 16:01:36 -0000 Received: from mx1.math.uh.edu (129.7.128.32) by inbox.vuxu.org with ESMTPUTF8; 16 Nov 2020 16:01:36 -0000 Received: from lists1.math.uh.edu ([129.7.128.208]) by mx1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kegwe-005XrE-PP for ml@inbox.vuxu.org; Mon, 16 Nov 2020 10:01:32 -0600 Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.94) (envelope-from ) id 1kegwe-00BSSW-7d for ml@inbox.vuxu.org; Mon, 16 Nov 2020 10:01:32 -0600 Received: from mx1.math.uh.edu ([129.7.128.32]) by lists1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kegdy-00BSHt-Bx for ding@lists.math.uh.edu; Mon, 16 Nov 2020 09:42:14 -0600 Received: from quimby.gnus.org ([95.216.78.240]) by mx1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1kegdv-005Ut9-G4 for ding@lists.math.uh.edu; Mon, 16 Nov 2020 09:42:13 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:Mime-Version:References:Message-ID:Date:Subject: From:To:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=w+4jf0Wf9y0GeShhMcvsaUvVH4uPXbyCHl3/rxn7JCU=; b=d4pJSmcWNKDNV/Vcq1S/tlJ9VN Oq8eC4XXM0hYCM4zTRD+ZoEYNJW5LSc7QL0XomiHl3ipjSqa4Y4flUeLqhwb7kjCIWRe6oQ3vJSNT eN5C1pooSDB7bzTmFwfIyJh94oLZ7AiT5XZS3NzO6q8obAItwFfLbqIUi6PMX3X+8qTI=; Received: from static.214.254.202.116.clients.your-server.de ([116.202.254.214] helo=ciao.gmane.io) by quimby.gnus.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kegdn-0001jv-AI for ding@gnus.org; Mon, 16 Nov 2020 16:42:07 +0100 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1kegdm-00052l-1s for ding@gnus.org; Mon, 16 Nov 2020 16:42:02 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: ding@gnus.org From: Alberto Luaces Subject: Re: i would like to select one mail address at prompt when i hit `m' key in keyboard... Date: Mon, 16 Nov 2020 16:41:57 +0100 Message-ID: <87sg99tika.fsf@eps142.cdf.udc.es> References: <871rgvibgq.fsf@delta.birch.chromebook> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cancel-Lock: sha1:eIcJFmErjxJ7RQ+syJj7TIHQLuE= List-ID: Precedence: bulk Byung-Hee HWANG writes: [...] > > (add-hook 'message-mode-hook > '(lambda () > (if (y-or-n-p "at home?") > (progn (setHome)) > (progn (setWork))))) > #+end_src > > at then, question... > > how can i enable the above rule only when i hit `m' key? > > i try to google and emacs manual etc... but failed.. Hi, I guess you don't want a hook here, but to bind a keypress to your function inside the hook. Something along the lines of: (add-hook 'message-mode-hook '(local-set-key (kbd "M-m") '(lambda () (if (y-or-n-p "at home?") (progn (setHome)) (progn (setWork)))))) I have binded to M-m instead of just "m", otherwise you couldn't type the letter "m" in a message. -- Alberto