From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tak Kunihiro Newsgroups: gmane.emacs.devel Subject: Re: poplife-mode Date: Wed, 15 Nov 2017 08:26:12 +0900 Message-ID: <86y3n81lyj.fsf@misasa.okayama-u.ac.jp> References: <86shditx7b.fsf@misasa.okayama-u.ac.jp> <79a5c7f3-ca81-4476-bd91-e5436cc0a33f@default> <86vaid93ye.fsf@misasa.okayama-u.ac.jp> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1510702045 7600 195.159.176.226 (14 Nov 2017 23:27:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 14 Nov 2017 23:27:25 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (windows-nt) Cc: Tak Kunihiro , charles@aurox.ch, emacs-devel@gnu.org To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 15 00:27:21 2017 Return-path: Envelope-to: ged-emacs-devel@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 1eEkbx-0001i6-3e for ged-emacs-devel@m.gmane.org; Wed, 15 Nov 2017 00:27:21 +0100 Original-Received: from localhost ([::1]:33989 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEkc4-0000v1-0p for ged-emacs-devel@m.gmane.org; Tue, 14 Nov 2017 18:27:28 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eEkb2-0000u4-Hl for emacs-devel@gnu.org; Tue, 14 Nov 2017 18:26:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eEkay-0008Ev-II for emacs-devel@gnu.org; Tue, 14 Nov 2017 18:26:24 -0500 Original-Received: from mail-pf0-x234.google.com ([2607:f8b0:400e:c00::234]:50284) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eEkay-0008E4-CG for emacs-devel@gnu.org; Tue, 14 Nov 2017 18:26:20 -0500 Original-Received: by mail-pf0-x234.google.com with SMTP id u70so10780613pfa.7 for ; Tue, 14 Nov 2017 15:26:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=XaiHBEjbTRn2msbfeT1ZtjJpNyVkima1cdBnKfDxvPY=; b=aeekNQLc3mYHGcO+6FU1ULQzhe7rZWNfC8CptIepydwRMQNAnKBM8OHVDrjN9yqOkl Uumu9oTabx7ocY5rrEUnrHCQR9HLRoJ7LEkRd2+m7xYKSLN4EPZh4lMb5ZAxzADdjgFo bGl+ugOqQGOmIzoYZh0mi3YQWTaExyXmZwuOsA8Mrwn3hN//mnpVhFI0gvx4+Yth8EFn FguyoTq9g/89mxL/8yzEzmZMGQwjLs3PAFttZ61xdtJx0821pS0N4622LXqg0onl7SBr fNLr//pEDFiXHSBnuVXNiuUy0H8EFaIF5XQRT3O5goEpWsRAGCfeW2GgEI5z987DUG8d Ho4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=XaiHBEjbTRn2msbfeT1ZtjJpNyVkima1cdBnKfDxvPY=; b=PAlaT2IhCaWM5z5w6AG+8KvCPj7ufN0a4iTHU7XnPk4HN3+AkUfbPKfJ3OjjpXYUAu Zgfz6DKQdknS+X2CYTCGsBMYO1kmrs8Z81rucMLzxFr180yBNzdLUVEISUSkvRr2KmzW RZWxhH0BL9180zBq1CZj0lWefOh6LaTs4clUEQMAy3TTn0v0bbyQUVuw4Dk5hQ0lTBMi sTc8sugbpzxAXKYlUr6qgeC8SWMv8+f+7K5ye5UecxHTWofjukDGFnVGOxwUuF7vqm6e qBFUgUgXaxXMgCVmur3LliquzaZnbgpJp2rIvxrKywbuLQBAbbtZNbe49aAViO+/VsuS CDfQ== X-Gm-Message-State: AJaThX7YQQ2StPvmuw5jOCsnuRRhy6x9605NyiTqA7G1BH+fvwdHQdSQ BttUkkz1l1IvC7Q8ktrFepFRUQ== X-Google-Smtp-Source: AGs4zMYEXEdpnJifSSfyjKklZwbhTVfQ4R0CIOPUuk4JrUz6+CvzkwYJjcFVZgncEQtWoa3nFwRUBw== X-Received: by 10.84.202.12 with SMTP id w12mr13966967pld.358.1510701979311; Tue, 14 Nov 2017 15:26:19 -0800 (PST) Original-Received: from thinkless2016 (vesta.misasa.okayama-u.ac.jp. [150.46.48.154]) by smtp.gmail.com with ESMTPSA id k8sm32168963pgt.22.2017.11.14.15.26.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Nov 2017 15:26:18 -0800 (PST) X-Google-Original-From: Tak Kunihiro In-Reply-To: (Drew Adams's message of "Mon, 13 Nov 2017 16:48:23 -0800 (PST)") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::234 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:220201 Archived-At: > You can incorporate any existing menus you want, with `mouse3.el'. > > See how the current major-mode menu is incorporated, for example. > Or the menu-bar menus (all of them, under a menu `Menu Bar', when > the menu-bar itself is not visible). > > To incorporate an existing menu, all you need is its keymap. I want to pop a keymap that is created dynamically such for directory listing. To do so, functions that return keymap should be evaluated sequentially. I think IO of a function for context menu should accept event and return a keymap or nil. As a result, a function that returns context-menu would be written like below. (global-set-key [mouse-3] 'context-menu) (defun context-menu (event) (interactive "e") (or (poplife-mouse-file-menu event) ; FILE menu (poplife-mouse-dir-menu event) ; DIR menu (poplife-mouse-ispell-menu event) ; iSpell menu (poplife-mouse-url-menu event) ; URL menu (mouse3-region-menu event) ; region menu (mouse3-noregion-menu event))) ; default menu