From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim Johnson Newsgroups: gmane.emacs.help Subject: Re: Trapping Quit from x-popup-menu Date: Sun, 29 Jun 2014 16:07:39 -0800 Organization: AkWebsoft Message-ID: <20140630000739.GI3163@mail.akwebsoft.com> References: <20140627224403.GF3163@mail.akwebsoft.com> <871tu7toy2.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1404086887 2649 80.91.229.3 (30 Jun 2014 00:08:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 30 Jun 2014 00:08:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 30 02:08:03 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 1X1P8c-0004TF-Gf for geh-help-gnu-emacs@m.gmane.org; Mon, 30 Jun 2014 02:08:02 +0200 Original-Received: from localhost ([::1]:59710 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1P8b-00025w-QW for geh-help-gnu-emacs@m.gmane.org; Sun, 29 Jun 2014 20:08:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1P8N-00025r-Qx for help-gnu-emacs@gnu.org; Sun, 29 Jun 2014 20:07:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1P8J-0003Dm-Ir for help-gnu-emacs@gnu.org; Sun, 29 Jun 2014 20:07:47 -0400 Original-Received: from 191-232-4-64.mtaonline.net ([64.4.232.191]:41927 helo=tj49.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1P8J-0003DI-An for help-gnu-emacs@gnu.org; Sun, 29 Jun 2014 20:07:43 -0400 Original-Received: by tj49.com (Postfix, from userid 1000) id A752E124712; Sun, 29 Jun 2014 16:07:39 -0800 (AKDT) Content-Disposition: inline In-Reply-To: <871tu7toy2.fsf@web.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 64.4.232.191 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:98450 Archived-At: * Michael Heerdegen [140629 12:58]: > Tim Johnson writes: > > > ;; --------------------------------------------------------- > > (let ((menu (tj-dir-menu curdir get-hidden)) > > choice nextdir > > (default curdir)) > > (setq choice > > (x-popup-menu (list '(0 0) (selected-window)) menu)) > > (message (concat "choice: " choice)) > > ;; --------------------------------------------------------- > > > > If I quit x-popup-menu without making a selection, than the rest of > > the code in the defun - beginning with > > > > (message (concat "choice: " choice) > > > > is not executed. > > > > What is the proper way to trap the call to x-popup-menu so that I > > can have some sort of a default value for 'choice? > > If you cannot/don't want to use a mouse button event as position > argument of `x-popup-menu` (as it is described in the docstring and > prevents the function from signaling quit), catch the quit signal > with condition-case: > > (condition-case nil > (x-popup-menu ...) > ((quit) a-default-value)) Thanks Michael. That is exactly what I was looking for. On a related note, can you tell me how to use help to get a list of standard errors? I can see documentation at http://www.chemie.fu-berlin.de/chemnet/use/info/elisp/elisp_40.html#SEC592 But don't know how to invoke it from emacs itself. Thanks again -- Tim tim at tee jay forty nine dot com or akwebsoft dot com http://www.akwebsoft.com, http://www.tj49.com