unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Refactoring?
@ 2006-10-06 15:12 Andreas Roehler
  0 siblings, 0 replies; only message in thread
From: Andreas Roehler @ 2006-10-06 15:12 UTC (permalink / raw)



Hi,

after finishing the following function I remarked, I
could reuse the inner parts easier, while addressing
them separate. (Just an example anyway...)

(defun alpha-numb-count (start end)
  "Counts alphabetical signs and numbers"
  (interactive "r*")
  (count-matches "[a-z-A-ZäöüÄÖÜß]" start end)
  (count-matches "[0-9]" start end))

Looking for a procedure, which would result in the following
(Numbers just for decoration here):

(1)
(defun alpha-numb-count_1 (start end)
  "Counts alphabetical signs and numbers"
  (interactive "r*")
  (count-matches "[a-z-A-ZäöüÄÖÜß]" start end))

(2)
(defun alpha-numb-count_2 (start end)
  "Counts alphabetical signs and numbers"
  (interactive "r*")
  (count-matches "[0-9]" start end))

Which later would be written:

(defun alpha-count (start end)
  "Counts alphabetical signs and numbers"
  (interactive "r*")
  (count-matches "[a-z-A-ZäöüÄÖÜß]" start end))

(defun numb-count (start end)
  "Counts alphabetical signs and numbers"
  (interactive "r*")
  (count-matches "[0-9]" start end))

Am I right, it's called refactoring otherwise?

Is there such a thing for Emacs-Lisp?


Thanks

__
Andreas Roehler

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-10-06 15:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-06 15:12 Refactoring? Andreas Roehler

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