unused.el 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. ;; Editing commands in GNU Emacs that turned out not to be used.
  2. ;; They were added with an eye to making possible a more CCA-compatible
  3. ;; command set; but that turned out not to be interesting.
  4. (defun mark-beginning-of-buffer ()
  5. "Set mark at the beginning of the buffer."
  6. (interactive)
  7. (push-mark (point-min)))
  8. (defun mark-end-of-buffer ()
  9. "Set mark at the end of the buffer."
  10. (interactive)
  11. (push-mark (point-max)))
  12. (defun upcase-char (arg)
  13. "Uppercasify ARG chars starting from point. Point doesn't move"
  14. (interactive "p")
  15. (save-excursion
  16. (upcase-region (point) (progn (forward-char arg) (point)))))
  17. (defun forward-to-word (arg)
  18. "Move forward until encountering the beginning of a word.
  19. With argument, do this that many times."
  20. (interactive "p")
  21. (or (re-search-forward (if (> arg 0) "\\W\\b" "\\b\\W") nil t arg)
  22. (goto-char (if (> arg 0) (point-max) (point-min)))))
  23. (defun backward-to-word (arg)
  24. "Move backward until encountering the end of a word.
  25. With argument, do this that many times."
  26. (interactive "p")
  27. (forward-to-word (- arg)))