summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/lisp.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2004-12-14 07:34:55 +0000
committerMiles Bader <miles@gnu.org>2004-12-14 07:34:55 +0000
commitdce59e79ab8a6ecc869ceda44d579b8b1e8e10d5 (patch)
treec3da6c32ac0401833eb29b6a4be9cf93febf248e /lisp/emacs-lisp/lisp.el
parent56cc8ca9b68886dc4aae4c8ef44ad5e62b59db49 (diff)
parent734c576596678065b39591128d88609bc6fc5aad (diff)
downloademacs-dce59e79ab8a6ecc869ceda44d579b8b1e8e10d5.tar.gz
emacs-dce59e79ab8a6ecc869ceda44d579b8b1e8e10d5.tar.bz2
emacs-dce59e79ab8a6ecc869ceda44d579b8b1e8e10d5.zip
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-78
Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-719 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-732 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-733 Update from CVS: man/calc.texi: Fix some TeX definitions. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-734 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-75 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-76 - miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-77 Update from CVS
Diffstat (limited to 'lisp/emacs-lisp/lisp.el')
-rw-r--r--lisp/emacs-lisp/lisp.el38
1 files changed, 22 insertions, 16 deletions
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index 87b3fcff96c..090f793c700 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -73,17 +73,18 @@ move forward across N balanced expressions."
"Set mark ARG sexps from point.
The place mark goes is the same place \\[forward-sexp] would
move to with the same argument.
-If this command is repeated, it marks the next ARG sexps after the ones
-already marked."
+If this command is repeated or mark is active in Transient Mark mode,
+it marks the next ARG sexps after the ones already marked."
(interactive "P")
- (cond ((and (eq last-command this-command) (mark t))
+ (cond ((or (and (eq last-command this-command) (mark t))
+ (and transient-mark-mode mark-active))
(setq arg (if arg (prefix-numeric-value arg)
- (if (> (mark) (point)) 1 -1)))
+ (if (< (mark) (point)) -1 1)))
(set-mark
(save-excursion
- (goto-char (mark))
- (forward-sexp arg)
- (point))))
+ (goto-char (mark))
+ (forward-sexp arg)
+ (point))))
(t
(push-mark
(save-excursion
@@ -191,9 +192,11 @@ open-parenthesis, and point ends up at the beginning of the line.
If variable `beginning-of-defun-function' is non-nil, its value
is called as a function to find the defun's beginning."
(interactive "p")
- (and (eq this-command 'beginning-of-defun)
- (or inhibit-mark-movement (eq last-command 'beginning-of-defun)
- (push-mark)))
+ (or inhibit-mark-movement
+ (not (eq this-command 'beginning-of-defun))
+ (eq last-command 'beginning-of-defun)
+ (and transient-mark-mode mark-active)
+ (push-mark))
(and (beginning-of-defun-raw arg)
(progn (beginning-of-line) t)))
@@ -242,9 +245,11 @@ matches the open-parenthesis that starts a defun; see function
If variable `end-of-defun-function' is non-nil, its value
is called as a function to find the defun's end."
(interactive "p")
- (and (eq this-command 'end-of-defun)
- (or inhibit-mark-movement (eq last-command 'end-of-defun)
- (push-mark)))
+ (or inhibit-mark-movement
+ (not (eq this-command 'end-of-defun))
+ (eq last-command 'end-of-defun)
+ (and transient-mark-mode mark-active)
+ (push-mark))
(if (or (null arg) (= arg 0)) (setq arg 1))
(if end-of-defun-function
(if (> arg 0)
@@ -289,10 +294,11 @@ is called as a function to find the defun's end."
(defun mark-defun ()
"Put mark at end of this defun, point at beginning.
The defun marked is the one that contains point or follows point.
-If this command is repeated, marks more defuns after the ones
-already marked."
+If this command is repeated or mark is active in Transient Mark mode,
+it marks more defuns after the ones already marked."
(interactive)
- (cond ((and (eq last-command this-command) (mark t))
+ (cond ((or (and (eq last-command this-command) (mark t))
+ (and transient-mark-mode mark-active))
(set-mark
(save-excursion
(goto-char (mark))