aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-05-15 20:55:02 +0000
committerRichard M. Stallman1993-05-15 20:55:02 +0000
commit9a1277dd3bb18883a023db7af279abcd89f7eef9 (patch)
tree1107185a377c0c64e2db027eefafa37da4d21293
parent9397d456509afed46ac517a58027c71dcf92ddc0 (diff)
downloademacs-9a1277dd3bb18883a023db7af279abcd89f7eef9.tar.gz
emacs-9a1277dd3bb18883a023db7af279abcd89f7eef9.zip
(push-mark): Don't activate the mark.
(set-mark-command): Explicitly do so here. When popping, don't mind if mark is inactive. (pop-mark): Deactivate mark. Don't mind if it's inactive. (yank-pop): Don't mind if mark is inactive. (keyboard-quit): Deactivate the mark. (kill-ring-save): When bouncing cursor, bounce the mark too, so highlighted area does not change.
-rw-r--r--lisp/simple.el34
1 files changed, 22 insertions, 12 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index b3a0870ea4c..9481c3da14f 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1062,9 +1062,10 @@ system cut and paste."
1062 (save-excursion 1062 (save-excursion
1063 (let ((other-end (if (= (point) beg) end beg))) 1063 (let ((other-end (if (= (point) beg) end beg)))
1064 (if (pos-visible-in-window-p other-end (selected-window)) 1064 (if (pos-visible-in-window-p other-end (selected-window))
1065 (progn 1065 (let ((omark (mark t)))
1066 (set-marker (mark-marker) (point) (current-buffer))
1066 (goto-char other-end) 1067 (goto-char other-end)
1067 (sit-for 1)) 1068 (sit-for 1))
1068 (let* ((killed-text (current-kill 0)) 1069 (let* ((killed-text (current-kill 0))
1069 (message-len (min (length killed-text) 40))) 1070 (message-len (min (length killed-text) 40)))
1070 (if (= (point) beg) 1071 (if (= (point) beg)
@@ -1100,8 +1101,8 @@ comes the newest one."
1100 (if (not (eq last-command 'yank)) 1101 (if (not (eq last-command 'yank))
1101 (error "Previous command was not a yank")) 1102 (error "Previous command was not a yank"))
1102 (setq this-command 'yank) 1103 (setq this-command 'yank)
1103 (let ((before (< (point) (mark)))) 1104 (let ((before (< (point) (mark t))))
1104 (delete-region (point) (mark)) 1105 (delete-region (point) (mark t))
1105 (set-mark (point)) 1106 (set-mark (point))
1106 (insert (current-kill arg)) 1107 (insert (current-kill arg))
1107 (if before (exchange-point-and-mark))) 1108 (if before (exchange-point-and-mark)))
@@ -1242,10 +1243,12 @@ Novice Emacs Lisp programmers often try to use the mark for the wrong
1242purposes. See the documentation of `set-mark' for more information." 1243purposes. See the documentation of `set-mark' for more information."
1243 (interactive "P") 1244 (interactive "P")
1244 (if (null arg) 1245 (if (null arg)
1245 (push-mark) 1246 (progn
1247 (push-mark)
1248 (set-mark (mark t)))
1246 (if (null (mark t)) 1249 (if (null (mark t))
1247 (error "No mark set in this buffer") 1250 (error "No mark set in this buffer")
1248 (goto-char (mark)) 1251 (goto-char (mark t))
1249 (pop-mark)))) 1252 (pop-mark))))
1250 1253
1251(defun push-mark (&optional location nomsg) 1254(defun push-mark (&optional location nomsg)
@@ -1253,7 +1256,9 @@ purposes. See the documentation of `set-mark' for more information."
1253Displays \"Mark set\" unless the optional second arg NOMSG is non-nil. 1256Displays \"Mark set\" unless the optional second arg NOMSG is non-nil.
1254 1257
1255Novice Emacs Lisp programmers often try to use the mark for the wrong 1258Novice Emacs Lisp programmers often try to use the mark for the wrong
1256purposes. See the documentation of `set-mark' for more information." 1259purposes. See the documentation of `set-mark' for more information.
1260
1261In Transient Mark mode, this does not activate the mark."
1257 (if (null (mark t)) 1262 (if (null (mark t))
1258 nil 1263 nil
1259 (setq mark-ring (cons (copy-marker (mark-marker)) mark-ring)) 1264 (setq mark-ring (cons (copy-marker (mark-marker)) mark-ring))
@@ -1261,7 +1266,7 @@ purposes. See the documentation of `set-mark' for more information."
1261 (progn 1266 (progn
1262 (move-marker (car (nthcdr mark-ring-max mark-ring)) nil) 1267 (move-marker (car (nthcdr mark-ring-max mark-ring)) nil)
1263 (setcdr (nthcdr (1- mark-ring-max) mark-ring) nil)))) 1268 (setcdr (nthcdr (1- mark-ring-max) mark-ring) nil))))
1264 (set-mark (or location (point))) 1269 (set-marker (mark-marker) (or location (point)) (current-buffer))
1265 (or nomsg executing-macro (> (minibuffer-depth) 0) 1270 (or nomsg executing-macro (> (minibuffer-depth) 0)
1266 (message "Mark set")) 1271 (message "Mark set"))
1267 nil) 1272 nil)
@@ -1272,9 +1277,11 @@ Does not set point. Does nothing if mark ring is empty."
1272 (if mark-ring 1277 (if mark-ring
1273 (progn 1278 (progn
1274 (setq mark-ring (nconc mark-ring (list (copy-marker (mark-marker))))) 1279 (setq mark-ring (nconc mark-ring (list (copy-marker (mark-marker)))))
1275 (set-mark (+ 0 (car mark-ring))) 1280 (set-marker (mark-marker) (+ 0 (car mark-ring)) (current-buffer))
1281 (if transient-mark-mode
1282 (setq mark-active nil))
1276 (move-marker (car mark-ring) nil) 1283 (move-marker (car mark-ring) nil)
1277 (if (null (mark)) (ding)) 1284 (if (null (mark t)) (ding))
1278 (setq mark-ring (cdr mark-ring))))) 1285 (setq mark-ring (cdr mark-ring)))))
1279 1286
1280(define-function 'exchange-dot-and-mark 'exchange-point-and-mark) 1287(define-function 'exchange-dot-and-mark 'exchange-point-and-mark)
@@ -2065,13 +2072,16 @@ in the mode line."
2065;Turned off because it makes dbx bomb out. 2072;Turned off because it makes dbx bomb out.
2066(setq blink-paren-function 'blink-matching-open) 2073(setq blink-paren-function 'blink-matching-open)
2067 2074
2068; this is just something for the luser to see in a keymap -- this is not 2075;; This executes C-g typed while Emacs is waiting for a command.
2069; how quitting works normally! 2076;; Quitting out of a program does not go through here;
2077;; that happens in the QUIT macro at the C code level.
2070(defun keyboard-quit () 2078(defun keyboard-quit ()
2071 "Signal a quit condition. 2079 "Signal a quit condition.
2072During execution of Lisp code, this character causes a quit directly. 2080During execution of Lisp code, this character causes a quit directly.
2073At top-level, as an editor command, this simply beeps." 2081At top-level, as an editor command, this simply beeps."
2074 (interactive) 2082 (interactive)
2083 (if transient-mark-mode
2084 (setq mark-active nil))
2075 (signal 'quit nil)) 2085 (signal 'quit nil))
2076 2086
2077(define-key global-map "\C-g" 'keyboard-quit) 2087(define-key global-map "\C-g" 'keyboard-quit)