unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* interactive function calls
@ 2008-06-09  9:43 Richard G Riley
  2008-06-09 16:46 ` Nikolaj Schumacher
       [not found] ` <mailman.12949.1213029992.18990.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Richard G Riley @ 2008-06-09  9:43 UTC (permalink / raw)
  To: help-gnu-emacs


I have this in my .emacs

(define-key mode-specific-map [?F] 'fortune-from-region)

The problem is that in the code for fortune-append we see something
like:

,----
|     (unless interactive
|       (save-buffer)
|       (if fortune-always-compile
| 	  (fortune-compile file)))))
| 
`----

Following a chat on #emacs on irc, I tried creating my own rgrfortune
function which was then called from the key binding and then I was told
it would call 'fortune-from-region "non interactively" - but this did not
work e.g

,----
| (defun rgrfortune()
|   (fortune-from-region (region-beginning) (region-end) fortune-file))
| 
| (define-key mode-specific-map [?F] (lambda()(interactive)(rgrfortune)))
`----

The reason I want it called "non interactive" is simply that thats
the way to save and compile the fortune file as the fortune-append
snippet above shows.

How to do it?





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

end of thread, other threads:[~2008-06-09 18:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-09  9:43 interactive function calls Richard G Riley
2008-06-09 16:46 ` Nikolaj Schumacher
     [not found] ` <mailman.12949.1213029992.18990.help-gnu-emacs@gnu.org>
2008-06-09 18:53   ` Richard G Riley

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