help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

interactive function calls


From: Richard G Riley
Subject: interactive function calls
Date: Mon, 09 Jun 2008 11:43:13 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

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?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]