unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Creating a menu/pop-up?
@ 2003-06-29  0:38 Mike Ballard
  2003-06-29 22:24 ` Sandip Chitale
  2003-06-30 16:48 ` Kevin Rodgers
  0 siblings, 2 replies; 4+ messages in thread
From: Mike Ballard @ 2003-06-29  0:38 UTC (permalink / raw)



Hi -

I use a pkg called steno (sort of an expandable to-do list, each list
being a seperate text file).  There doesn't appear to be any support for a
menu/pop-up.  I'd like to see if I can either add "steno" to the menubar
or somehow create a pop-up actived by a mouse/ctl key combo with either
method showing the list of steno files I've created (they're all in one
dir).  I'd prefer a pop-up using mouse/ctl (listing my steno files).  I
contacted the author and got no reply.

I found something called user-menu.el (something like that) but am having
trouble (I only know the simplest of elisp) and don't really know if it
will work for what I want anyway.

A long time ago I figured out how to assign "edit/bookmarks:jump to
bookmarks" to a mouse/ctl combo but have no idea how now.  But I did look
in bookmark*el to see if I could figure out what to use there to create
the steno menu/pop-up I want (the same kind of pop-up I get with
"jump*book*).  I looked but there's way too much I don't understand.

Anyone have an idea or two for an elisp neophyte so that I can create a
pop-up showing my list of text files such that clicking on one of the
files runs it under steno?

Mike
-- 

mike.ballard--at--earthlink.net

  "Play an accordion, go to jail.  It's the law!"

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Creating a menu/pop-up?
  2003-06-29  0:38 Creating a menu/pop-up? Mike Ballard
@ 2003-06-29 22:24 ` Sandip Chitale
  2003-06-30 16:48 ` Kevin Rodgers
  1 sibling, 0 replies; 4+ messages in thread
From: Sandip Chitale @ 2003-06-29 22:24 UTC (permalink / raw)


Mike Ballard <dont_w@nt_spam.org> wrote in message news:<m2vfupd8d7.fsf@west_f1.net>...
> Hi -
> 
> I use a pkg called steno (sort of an expandable to-do list, each list
> being a seperate text file).  There doesn't appear to be any support for a
> menu/pop-up.  I'd like to see if I can either add "steno" to the menubar
> or somehow create a pop-up actived by a mouse/ctl key combo with either
> method showing the list of steno files I've created (they're all in one
> dir).  I'd prefer a pop-up using mouse/ctl (listing my steno files).  I
> contacted the author and got no reply.
> 
> I found something called user-menu.el (something like that) but am having
> trouble (I only know the simplest of elisp) and don't really know if it
> will work for what I want anyway.
> 
> A long time ago I figured out how to assign "edit/bookmarks:jump to
> bookmarks" to a mouse/ctl combo but have no idea how now.  But I did look
> in bookmark*el to see if I could figure out what to use there to create
> the steno menu/pop-up I want (the same kind of pop-up I get with
> "jump*book*).  I looked but there's way too much I don't understand.

(global-set-key [C-down-mouse-3]            'bookmark-menu-jump)

> 
> Anyone have an idea or two for an elisp neophyte so that I can create a
> pop-up showing my list of text files such that clicking on one of the
> files runs it under steno?
> 
> Mike

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Creating a menu/pop-up?
  2003-06-29  0:38 Creating a menu/pop-up? Mike Ballard
  2003-06-29 22:24 ` Sandip Chitale
@ 2003-06-30 16:48 ` Kevin Rodgers
  2003-07-02  2:33   ` Mike Ballard
  1 sibling, 1 reply; 4+ messages in thread
From: Kevin Rodgers @ 2003-06-30 16:48 UTC (permalink / raw)


Mike Ballard wrote:

> Anyone have an idea or two for an elisp neophyte so that I can create a
> pop-up showing my list of text files such that clicking on one of the
> files runs it under steno?

How's this for a start:

(defun mouse-steno-popup (e)
   "Pop up a menu of *.txt files in the ~ directory.  E is a mouse event."
   (interactive "e")
   (let ((steno-menu (steno-popup-menu))) ; keymap
     (call-interactively (lookup-key steno-menu
				    (vector (x-popup-menu e steno-menu))))))

(global-set-key [S-down-mouse-3] 'mouse-steno-popup)

(defun steno-popup-menu ()
   "Return a menu keymap mapping each ~/*.txt file to \\[steno-command]."
   (let ((menu (make-sparse-keymap "Steno Files"))
	(files (nreverse (directory-files "~" nil "\\.txt\\'"))))
     (while files
       (define-key menu (vector (intern (car files)))
	(cons (car files)
	      `(lambda ()
		 ,(format "Run \\[steno-command] on \"%s\"." (car files))
		 (interactive)
		 (steno-command ,(car files)))))
       (setq files (cdr files)))
     menu))

-- 
<a href="mailto:&lt;kevin.rodgers&#64;ihs.com&gt;">Kevin Rodgers</a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Creating a menu/pop-up?
  2003-06-30 16:48 ` Kevin Rodgers
@ 2003-07-02  2:33   ` Mike Ballard
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Ballard @ 2003-07-02  2:33 UTC (permalink / raw)



On Mon Jun 30, Kevin Rodgers disturbed my nap when he said:

> Mike Ballard wrote:
> 
> > Anyone have an idea or two for an elisp neophyte so that I can create a
> > pop-up showing my list of text files such that clicking on one of the
> > files runs it under steno?
> 
> How's this for a start:
> 
> (defun mouse-steno-popup (e)
>    "Pop up a menu of *.txt files in the ~ directory.  E is a mouse event."
>    (interactive "e")
>    (let ((steno-menu (steno-popup-menu))) ; keymap
>      (call-interactively (lookup-key steno-menu
> 				    (vector (x-popup-menu e steno-menu))))))
> 
> (global-set-key [S-down-mouse-3] 'mouse-steno-popup)
> 
> (defun steno-popup-menu ()
>    "Return a menu keymap mapping each ~/*.txt file to \\[steno-command]."
>    (let ((menu (make-sparse-keymap "Steno Files"))
> 	(files (nreverse (directory-files "~" nil "\\.txt\\'"))))
>      (while files
>        (define-key menu (vector (intern (car files)))
> 	(cons (car files)
> 	      `(lambda ()
> 		 ,(format "Run \\[steno-command] on \"%s\"." (car files))
> 		 (interactive)
> 		 (steno-command ,(car files)))))
>        (setq files (cdr files)))
>      menu))
> 

Outstanding!  Thanks so much - it gives me exactly what I was looking for.

I got the steno cmd in, and my text files have no ext and using nil
w/dir-files includes . and .. in pop-up, but I'll get it.

What's the escaped ' for in dir-files regexp - I don't see it (Info)?

Thanks again - much appreciated!

Mike
-- 

mike.ballard--at--earthlink.net

  "Play an accordion, go to jail.  It's the law!"

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-07-02  2:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-29  0:38 Creating a menu/pop-up? Mike Ballard
2003-06-29 22:24 ` Sandip Chitale
2003-06-30 16:48 ` Kevin Rodgers
2003-07-02  2:33   ` Mike Ballard

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).