69 |
(or arg (setq arg 1)) |
(or arg (setq arg 1)) |
70 |
(forward-sexp (- arg))) |
(forward-sexp (- arg))) |
71 |
|
|
72 |
(defun mark-sexp (&optional arg) |
(defun mark-sexp (&optional arg allow-extend) |
73 |
"Set mark ARG sexps from point. |
"Set mark ARG sexps from point. |
74 |
The place mark goes is the same place \\[forward-sexp] would |
The place mark goes is the same place \\[forward-sexp] would |
75 |
move to with the same argument. |
move to with the same argument. |
76 |
If this command is repeated or mark is active in Transient Mark mode, |
Interactively, if this command is repeated |
77 |
|
or (in Transient Mark mode) if the mark is active, |
78 |
it marks the next ARG sexps after the ones already marked." |
it marks the next ARG sexps after the ones already marked." |
79 |
(interactive "P") |
(interactive "P\np") |
80 |
(cond ((or (and (eq last-command this-command) (mark t)) |
(cond ((and allow-extend |
81 |
(and transient-mark-mode mark-active)) |
(or (and (eq last-command this-command) (mark t)) |
82 |
|
(and transient-mark-mode mark-active))) |
83 |
(setq arg (if arg (prefix-numeric-value arg) |
(setq arg (if arg (prefix-numeric-value arg) |
84 |
(if (< (mark) (point)) -1 1))) |
(if (< (mark) (point)) -1 1))) |
85 |
(set-mark |
(set-mark |
291 |
(goto-char (point-min))))) |
(goto-char (point-min))))) |
292 |
(setq arg (1+ arg)))))) |
(setq arg (1+ arg)))))) |
293 |
|
|
294 |
(defun mark-defun () |
(defun mark-defun (&optional allow-extend) |
295 |
"Put mark at end of this defun, point at beginning. |
"Put mark at end of this defun, point at beginning. |
296 |
The defun marked is the one that contains point or follows point. |
The defun marked is the one that contains point or follows point. |
297 |
If this command is repeated or mark is active in Transient Mark mode, |
|
298 |
it marks more defuns after the ones already marked." |
Interactively, if this command is repeated |
299 |
(interactive) |
or (in Transient Mark mode) if the mark is active, |
300 |
(cond ((or (and (eq last-command this-command) (mark t)) |
it marks the next defun after the ones already marked." |
301 |
(and transient-mark-mode mark-active)) |
(interactive "p") |
302 |
|
(cond ((and allow-extend |
303 |
|
(or (and (eq last-command this-command) (mark t)) |
304 |
|
(and transient-mark-mode mark-active))) |
305 |
(set-mark |
(set-mark |
306 |
(save-excursion |
(save-excursion |
307 |
(goto-char (mark)) |
(goto-char (mark)) |