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, FREEMAIL_FROM,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 18176 invoked from network); 17 Nov 2020 03:11:25 -0000 Received: from mx1.math.uh.edu (129.7.128.32) by inbox.vuxu.org with ESMTPUTF8; 17 Nov 2020 03:11:25 -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 1kerNp-005qyu-IF; Mon, 16 Nov 2020 21:10:17 -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 1kerNo-00BYPl-Ik; Mon, 16 Nov 2020 21:10:16 -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 1kerNk-00BYNw-QT for ding@lists.math.uh.edu; Mon, 16 Nov 2020 21:10:12 -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 1kerNj-005qwQ-6e for ding@lists.math.uh.edu; Mon, 16 Nov 2020 21:10:12 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:Mime-Version:References :Message-ID:Date:Subject:From:To:Sender:Reply-To:Cc: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=WAs8WE8uA0+ErvVCbn2UbKg6p6apRbpU2eANWOmjeyw=; b=NXpglBnGn2FuXb6uJ8ub1vSGrM olYAdEiMmhzx4nyBQbpj/0eD+g3UELsnrCxCon9TD3q/LbT4iD4QpSYfZxh64YxyDAwp5TMFT1v14 gSKnL4gnQ3RaZyDGa9YjagX0XlNfqIhV9m0e75qTA8kfIPS9JxlJaU2dT0u7LsJ6EhBc=; 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 1kerNb-0002AH-4T for ding@gnus.org; Tue, 17 Nov 2020 04:10:06 +0100 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1kerNZ-0009xz-TM for ding@gnus.org; Tue, 17 Nov 2020 04:10:01 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: ding@gnus.org From: =?utf-8?B?7Zmp67OR7Z2s?= Subject: Re: i would like to select one mail address at prompt when i hit `m' key in keyboard... Date: Tue, 17 Nov 2020 12:00:52 +0900 Organization: =?utf-8?B?6YeR6Zm1ICjsl7Dsm5DsnZgg66eI7J2MKQ==?= Message-ID: References: <871rgvibgq.fsf@delta.birch.chromebook> <87sg99tika.fsf@eps142.cdf.udc.es> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cancel-Lock: sha1:cr98NT21CFHpVResEIPlKcwhd98= List-ID: Precedence: bulk Alberto Luaces writes: > 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. Thanks Alberto, i will study about local-set-key, thanks again^^^ Sincerely, Byung-Hee -- ^고맙습니다 _地平天成_ 감사합니다_^))//