diff options
| -rw-r--r-- | lisp/misc.el | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lisp/misc.el b/lisp/misc.el index fa8471460b7..a477fec5b0e 100644 --- a/lisp/misc.el +++ b/lisp/misc.el | |||
| @@ -58,6 +58,38 @@ The characters copied are inserted in the buffer before point." | |||
| 58 | (+ n (point))))))) | 58 | (+ n (point))))))) |
| 59 | (insert string))) | 59 | (insert string))) |
| 60 | 60 | ||
| 61 | ;; These were added with an eye to making possible a more CCA-compatible | ||
| 62 | ;; command set; but that turned out not to be interesting. | ||
| 63 | |||
| 64 | (defun mark-beginning-of-buffer () | ||
| 65 | "Set mark at the beginning of the buffer." | ||
| 66 | (interactive) | ||
| 67 | (push-mark (point-min))) | ||
| 68 | |||
| 69 | (defun mark-end-of-buffer () | ||
| 70 | "Set mark at the end of the buffer." | ||
| 71 | (interactive) | ||
| 72 | (push-mark (point-max))) | ||
| 73 | |||
| 74 | (defun upcase-char (arg) | ||
| 75 | "Uppercasify ARG chars starting from point. Point doesn't move" | ||
| 76 | (interactive "p") | ||
| 77 | (save-excursion | ||
| 78 | (upcase-region (point) (progn (forward-char arg) (point))))) | ||
| 79 | |||
| 80 | (defun forward-to-word (arg) | ||
| 81 | "Move forward until encountering the beginning of a word. | ||
| 82 | With argument, do this that many times." | ||
| 83 | (interactive "p") | ||
| 84 | (or (re-search-forward (if (> arg 0) "\\W\\b" "\\b\\W") nil t arg) | ||
| 85 | (goto-char (if (> arg 0) (point-max) (point-min))))) | ||
| 86 | |||
| 87 | (defun backward-to-word (arg) | ||
| 88 | "Move backward until encountering the end of a word. | ||
| 89 | With argument, do this that many times." | ||
| 90 | (interactive "p") | ||
| 91 | (forward-to-word (- arg))) | ||
| 92 | |||
| 61 | (provide 'misc) | 93 | (provide 'misc) |
| 62 | 94 | ||
| 63 | ;;; misc.el ends here | 95 | ;;; misc.el ends here |