Mercurial > emacs
comparison lisp/simple.el @ 4287:20486b99584f
(kill-ring-save): Delete spurious `message' call.
(set-mark): If POS is nil, call deactivate-mark.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 26 Jul 1993 07:31:11 +0000 |
parents | 997e8a52f9fd |
children | 4d0c57f01eed |
comparison
equal
deleted
inserted
replaced
4286:d719788a0aaa | 4287:20486b99584f |
---|---|
1093 (set-marker (mark-marker) other-end (current-buffer)) | 1093 (set-marker (mark-marker) other-end (current-buffer)) |
1094 (goto-char opoint) | 1094 (goto-char opoint) |
1095 ;; If user quit, deactivate the mark | 1095 ;; If user quit, deactivate the mark |
1096 ;; as C-g would as a command. | 1096 ;; as C-g would as a command. |
1097 (and quit-flag mark-active | 1097 (and quit-flag mark-active |
1098 (progn | 1098 (deactivate-mark))) |
1099 (message "foo") ;XXX what is this here for? --roland | |
1100 (deactivate-mark)))) | |
1101 (let* ((killed-text (current-kill 0)) | 1099 (let* ((killed-text (current-kill 0)) |
1102 (message-len (min (length killed-text) 40))) | 1100 (message-len (min (length killed-text) 40))) |
1103 (if (= (point) beg) | 1101 (if (= (point) beg) |
1104 ;; Don't say "killed"; that is misleading. | 1102 ;; Don't say "killed"; that is misleading. |
1105 (message "Saved text until \"%s\"" | 1103 (message "Saved text until \"%s\"" |
1260 | 1258 |
1261 ;; Many places set mark-active directly, and several of them failed to also | 1259 ;; Many places set mark-active directly, and several of them failed to also |
1262 ;; run deactivate-mark-hook. This shorthand should simplify. | 1260 ;; run deactivate-mark-hook. This shorthand should simplify. |
1263 (defsubst deactivate-mark () | 1261 (defsubst deactivate-mark () |
1264 "Deactivate the mark by setting `mark-active' to nil. | 1262 "Deactivate the mark by setting `mark-active' to nil. |
1263 \(That makes a difference only in Transient Mark mode.) | |
1265 Also runs the hook `deactivate-mark-hook'." | 1264 Also runs the hook `deactivate-mark-hook'." |
1266 (setq mark-active nil) | 1265 (setq mark-active nil) |
1267 (run-hooks 'deactivate-mark-hook)) | 1266 (run-hooks 'deactivate-mark-hook)) |
1268 | 1267 |
1269 (defun set-mark (pos) | 1268 (defun set-mark (pos) |
1281 To remember a location for internal use in the Lisp program, | 1280 To remember a location for internal use in the Lisp program, |
1282 store it in a Lisp variable. Example: | 1281 store it in a Lisp variable. Example: |
1283 | 1282 |
1284 (let ((beg (point))) (forward-line 1) (delete-region beg (point)))." | 1283 (let ((beg (point))) (forward-line 1) (delete-region beg (point)))." |
1285 | 1284 |
1286 (setq mark-active t) | 1285 (if pos |
1287 (run-hooks 'activate-mark-hook) | 1286 (progn |
1288 (set-marker (mark-marker) pos (current-buffer))) | 1287 (setq mark-active t) |
1288 (run-hooks 'activate-mark-hook) | |
1289 (set-marker (mark-marker) pos (current-buffer))) | |
1290 (deactivate-mark) | |
1291 (set-marker (mark-marker) pos (current-buffer)))) | |
1289 | 1292 |
1290 (defvar mark-ring nil | 1293 (defvar mark-ring nil |
1291 "The list of saved former marks of the current buffer, | 1294 "The list of saved former marks of the current buffer, |
1292 most recent first.") | 1295 most recent first.") |
1293 (make-variable-buffer-local 'mark-ring) | 1296 (make-variable-buffer-local 'mark-ring) |