Ar an t-aonú lá déag de mí Deireadh Fómhair, scríobh Samuel Bronson:
It looks to me as though you need to start learning elisp in earnest
-- that is, you must learn defun, how to figure out what lisp call
corresponds with the way you would do a thing interactively, some
control structures, etc. rather than just these keyboard macros.
(Which I didn't even know you could *do*, actually. Wonder what its
actually good for? Testing that you did't break some keybindings?)
It’s how you can name a keyboard macro; make it the function binding of the
symbol with that string name.
Sirano, it’s great (and very inventive) that you’ve got XEmacs to do what
you want in that way. It’s a whole lot more useful in the medium term,
though, to write Lisp programs in the way everyone else does, since that
makes it much easier to learn from them. Here’s how your 2expressions macro
would usually be written:
(defun 2expressions ()
(interactive)
(goto-char (point-min))
(replace-string "." " ")
(goto-char (point-min))
(flush-lines "^.+ [0-9][0-9][0-9][A-Z][0-9][0-9] e.+$")
(goto-char (point-min))
(replace-regexp "\\(^.+\\) \\(....-....\\)
\\([0-9][0-9][0-9][A-Z][0-9][0-9]\\) .+\\(p.+\\) .+$"
"\3 \\1\.\\2 \\4")
(goto-char (point-min))
(vectors_2bhformat)
....)
It’s incomplete, but I hope it gives a flavour of how to go about it. F1 k
will give information about the function called by a sequence, and you
normally call that function from your Lisp code as above (M-< for
beginning-of-buffer is an exception, but that’s described in its doc string.)
--
“Apart from the nine-banded armadillo, man is the only natural host of
Mycobacterium leprae, although it can be grown in the footpads of mice.”
-- Kumar & Clark, Clinical Medicine, summarising improbable leprosy research
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta