Difference between revisions of "Keyboard macros"

From WikEmacs
Jump to navigation Jump to search
(How to download cheap XRumer + SocPlugin???)
(608 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
:{{Manual|keyboard macros|(emacs) Basic Keyboard Macro}}
+
How I can get for free XRumer + BlogsPlugin??
 
+
'''Keyboard macros''' can be used to automate or repeat tedious editing tasks in Emacs.
+
It's really new powerful tool for promo, I'm need it, so help me please if it possible... Thnkz
 
+
Mostly I need SocPlugin - it unique tool for Facebook promotion, break all captchas and protections....  
==Example usage==
+
(it's included in XRumer 12 official package, so please help me to find it! Thank you again!)
Consider the standard <code>*scratch*</code> buffer:
 
 
 
<pre>
 
;; This buffer is for notes you don't want to save, and for Lisp evaluation.
 
;; If you want to create a file, visit that file with C-x C-f,
 
;; then enter the text in that file's own buffer.
 
</pre>
 
 
 
Suppose you want to remove the first occurrence of the letter "a" in that piece of text. You could write a [[regular expression]] to do the job, but let's assume you want to use a keyboard macro this time.
 
 
 
# Make sure [[point]] is at the start of the buffer.
 
# Hit <code>C-x (</code> to start recording your macro. '''Note:''' If you hit <code>C-g</code> or if an error occurs, your keyboard macro recording will stop.
 
# Hit <code>C-s</code> followed by <code>a</code> to find the first "a". Now, point is right after the first "a" in the text.
 
# Hit backspace to delete that "a".
 
 
 
The first occurrence of "a" of the first line has been deleted. Let's move point to the beginning of the next line and then stop recording.
 
 
 
<ol start="5">
 
<li>Hit <code>C-e C-f</code> to move point to the beginning of the next line.</li>
 
<li>Hit <code>C-x )</code> to finish the recording of our macro.</li>
 
</ol>
 
 
 
The macro you have just recorded performs the operation of removing the first occurrence of "a" it can find and then moving point to the next line.
 
 
 
<ol start="7">
 
<li>Hit <code>C-x e</code> once to call that macro.</li>
 
<li>Continue hitting <code>e</code> to call it several times. Hit any other key to get out of the macro repetition.</li>
 
</ol>
 
 
 
==Repeating a macro==
 
To repeat a macro e.g. five times, you could hit <code>C-x e e e e e</code>. This could become tedious if you want to repeat it a greater amount of times, so an alternative is to provide a numeric argument to <code>C-x e</code>, e.g. <code>C-u 25 C-x e</code>.
 
 
 
===Repeating until there's an error===
 
Provide a <code>0</code> prefix argument to <code>C-x e</code> to execute a macro from point until there is an error, e.g. <code>C-u 0 C-x e</code> or <code>M-0 C-x e</code>. See [[prefix arguments]].
 
 
 
===Repeating a macro on every line in a region===
 
If you've recorded a macro which you want to call on every line in a buffer, you can use <code>C-x C-k r</code>, which applies the macro to every line in the region.
 
 
 
==Saving macros==
 
{{Manual|saving keyboard macros|(emacs) Save Keyboard Macro}}
 
 
 
===By name===
 
To give a macro a name which you can later call using <code>M-x</code>, hit <code>C-x C-k n</code>.  Try to avoid strange characters in the name.  Once you've given it a name, you can execute it using <code>M-x the-name-of-the-macro</code>.
 
 
 
===Binding to a key===
 
To bind a keyboard macro to a key using <code>C-x C-k b</code>. To avoid problems caused by overriding existing bindings, the key sequences <code>C-x C-k 0</code> through <code>C-x C-k 9</code> and <code>C-x C-k A</code> through <code>C-x C-k Z</code> are reserved for your own keyboard macro bindings. You can, however, bind a keyboard macro to whatever you like.
 
 
 
===Saving it permanently===
 
To save a keyboard macro for future Emacs sessions, go to your init file (or wherever you want to store it) and hit <code>M-x insert-kbd-macro</code>.  Then enter the name of the macro you would like to save.  This will insert Emacs Lisp code which defines the macro you chose, so you can use it in future sessions.
 
 
 
Using the example in the beginning of this article, let's say you named that macro <code>remove-first-a</code>.  If you use <code>insert-kbd-macro</code> to insert the Lisp for that macro, this is what would come up:
 
 
 
<pre>
 
(fset 'remove-first-a
 
  (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([19 97 13 backspace 5 6] 0 "%d")) arg)))
 
</pre>
 
 
 
If you have bound the macro to a key as described in the previous section, you can generate the code for that as well by prefixing the insert-kbd-macro call with [[prefix argument|<code>C-u</code>]].
 

Revision as of 13:39, 7 June 2015

How I can get for free XRumer + BlogsPlugin??

It's really new powerful tool for promo, I'm need it, so help me please if it possible... Thnkz Mostly I need SocPlugin - it unique tool for Facebook promotion, break all captchas and protections.... (it's included in XRumer 12 official package, so please help me to find it! Thank you again!)