[EMAIL PROTECTED] (Daniel Jensen) writes: > Here is a feature that I forgot we talked about; the > universal argument M-&. I wrote a straightforward > implementation based on how Gnus does it.
Cool! > (defun bongo-universal-argument () I wonder why it's called `universal argument', though... What about `bongo-universal-prefix/region/marking-command'? ...or something. :-) > "Perform the following command at every marked track line. > Reads a key sequence and executes the command it is bound to, > once at every marked track line in the buffer." I think it should do it - on the next N track lines (given a prefix argument N), or - on every track line in the region (if active), or - on every marked line (if any), or, otherwise, - just on the line at point. Let's call this the `prefix/region/marking convention'. (I realize you wrote a simple implementation on purpose.) > (interactive) > (let* ((key (read-key-sequence > (substitute-command-keys > "\\<bongo-mode-map>\\[bongo-universal-argument]-"))) > (command (key-binding key))) > (if (null command) > (error "%s is undefined" (key-description key)) > (save-excursion > (goto-char (point-min)) > (while (and (not (eobp)) You don't need the EOB check here. > (bongo-snap-to-object-line 'no-error)) > (when (bongo-marked-track-line-p) > (command-execute command)) > (goto-char (bongo-point-after-line))) > (bongo-kill-marking))))) In order to get the right behavior, we'd have to kill the marking before executing the command --- otherwise the command itself might use the marking. The same goes for the region (which we'll have to deactivate) and the prefix argument (which we'll have to clear). Well, I _think_ that's how we should do it. Do you agree? -- Daniel Brockman <[EMAIL PROTECTED]> _______________________________________________ bongo-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/bongo-devel
