* how to automate a code
@ 2014-09-15 10:50 Renato Pontefice
2014-09-15 14:50 ` Alex Kost
[not found] ` <mailman.8916.1410792630.1147.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 3+ messages in thread
From: Renato Pontefice @ 2014-09-15 10:50 UTC (permalink / raw)
To: help-gnu-emacs
Hi,
it's still me... with same question:
How can I automate this elisp code, that works, if I paste on emacs
___________________________________________________________________
(while (and (not (eobp))
(search-forward "[-" nil 'move))
(skip-chars-forward "A-Z")
(unless (looking-at "-]")
(message "Problem found, please fix and hit C-M-c to continue")
(recursive-edit)))
________________________________________________________________
I'm sorry, but I lost my self on the previous thread :-( (my english is not so good :-( )
All I need, is to run this code when I press a button (or better a key, keybind...)
Can someone tell me how to do that?
TIA
Renato
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: how to automate a code
2014-09-15 10:50 how to automate a code Renato Pontefice
@ 2014-09-15 14:50 ` Alex Kost
[not found] ` <mailman.8916.1410792630.1147.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 3+ messages in thread
From: Alex Kost @ 2014-09-15 14:50 UTC (permalink / raw)
To: Renato Pontefice; +Cc: help-gnu-emacs
Renato Pontefice (2014-09-15 14:50 +0400) wrote:
> Hi,
> it's still me... with same question:
>
> How can I automate this elisp code, that works, if I paste on emacs
> ___________________________________________________________________
> (while (and (not (eobp))
> (search-forward "[-" nil 'move))
> (skip-chars-forward "A-Z")
> (unless (looking-at "-]")
> (message "Problem found, please fix and hit C-M-c to continue")
> (recursive-edit)))
> ________________________________________________________________
>
> I'm sorry, but I lost my self on the previous thread :-( (my english is not so good :-( )
>
> All I need, is to run this code when I press a button (or better a key, keybind...)
>
> Can someone tell me how to do that?
1. You can define an interactive function:
(defun my-working-code ()
"Some really useful thing."
(interactive)
(while (and (not (eobp))
(search-forward "[-" nil 'move))
(skip-chars-forward "A-Z")
(unless (looking-at "-]")
(message "Problem found, please fix and hit C-M-c to continue")
(recursive-edit))))
2. And bind it to any key you want:
(global-set-key (kbd "C-S-z") 'my-working-code)
Hint: string in the (kbd ...) is the same as you see after pressing
"C-h c ..."
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: how to automate a code
[not found] ` <mailman.8916.1410792630.1147.help-gnu-emacs@gnu.org>
@ 2014-09-16 7:55 ` Renato Pontefice
0 siblings, 0 replies; 3+ messages in thread
From: Renato Pontefice @ 2014-09-16 7:55 UTC (permalink / raw)
To: help-gnu-emacs
YEEEESSS!!!!!! IT WORKS!!!!!
sorry for my enthusiasm... :-), but all works at "first time"!!!
first of all, I want to thank, all the people that help me, to do that. I don't know nor elisp neither lisp, but I managed to get the result with you help.
Thans to all.
Renato
ps
now I will continue to improve this script :-) So, you will see me again.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-16 7:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-15 10:50 how to automate a code Renato Pontefice
2014-09-15 14:50 ` Alex Kost
[not found] ` <mailman.8916.1410792630.1147.help-gnu-emacs@gnu.org>
2014-09-16 7:55 ` Renato Pontefice
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).