mark-word (forward and backward) many words????

Stephen J. Turnbull stephen at xemacs.org
Fri Oct 22 07:51:00 EDT 2010


Andreas Röhler writes:
 > Am 22.10.2010 12:17, schrieb Uwe Brauer:

 > > However when I mark a word with mark-word and then again
 > > execute the function its continues to mark the next word etc
 > > till I am pleased with the result.

OK, what happens is that mark-something assumes that if (> (point)
(mark)), forward motion was used to mark, and otherwise backward
motion.  It then negates the argument in the latter case to preserve
the backward motion.  To work around this, you need to manipulate the
argument passed to backward-word:

(defun mark-word-backward (&optional count)
  (interactive "p")
  (mark-something 'mark-word-backward
                  (lambda (x)
                    (and (mark)
                         ;; this is tricky: if we get here, then
                         ;; mark-something has already done (goto-char (mark))
                         (= (mark) (point))
                         (setq x (- x)))
                    (backward-word x))
                  count))

Does GNU have a mark-word-backward that works?

 > Ok, but than push-mark -- CRTL-SPACE -- followed by a 
 > forward-/backward-word should do all you need (?)

*snort*



More information about the XEmacs-Beta mailing list