unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tim Johnson <tim@akwebsoft.com>
To: Emacs <Help-gnu-emacs@gnu.org>
Subject: Trapping Quit from x-popup-menu
Date: Fri, 27 Jun 2014 14:44:03 -0800	[thread overview]
Message-ID: <20140627224403.GF3163@mail.akwebsoft.com> (raw)

Using 
GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2)
on Ubuntu 12.04

Here is a code snippet :

;; ---------------------------------------------------------
(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?

Thanks
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com, http://www.tj49.com



             reply	other threads:[~2014-06-27 22:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-27 22:44 Tim Johnson [this message]
2014-06-29 20:56 ` Trapping Quit from x-popup-menu Michael Heerdegen
2014-06-30  0:07   ` Tim Johnson
2014-06-30  2:15     ` Drew Adams
2014-06-30 15:33       ` Michael Heerdegen
2014-06-30 15:43         ` Eli Zaretskii
2014-06-30 19:18     ` Tim Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140627224403.GF3163@mail.akwebsoft.com \
    --to=tim@akwebsoft.com \
    --cc=Help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).