diff options
| author | Stefan Monnier | 2014-01-08 20:59:19 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2014-01-08 20:59:19 -0500 |
| commit | 684d44ef81d88387fd300588cd01ee5b9efdd617 (patch) | |
| tree | bbc31dc47eb789895a1486377bd37ee32e77e2f9 | |
| parent | ceb885a181e38f2822892db045cce6abe8c3a285 (diff) | |
| download | emacs-684d44ef81d88387fd300588cd01ee5b9efdd617.tar.gz emacs-684d44ef81d88387fd300588cd01ee5b9efdd617.zip | |
* lisp/simple.el (deactivate-mark, activate-mark): Force-mode-line-update.
(activate-mark): Add `no-tmm' argument.
(set-mark, push-mark-command): Use it instead of running
activate-mark-hook by hand.
Fixes: debbugs:16382
| -rw-r--r-- | lisp/ChangeLog | 24 | ||||
| -rw-r--r-- | lisp/simple.el | 24 |
2 files changed, 28 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a1eef95d776..481c3cbc04a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2014-01-09 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * simple.el (deactivate-mark, activate-mark): Force-mode-line-update | ||
| 4 | (bug#16382). | ||
| 5 | (activate-mark): Add `no-tmm' argument. | ||
| 6 | (set-mark, push-mark-command): Use it instead of running | ||
| 7 | activate-mark-hook by hand. | ||
| 8 | |||
| 1 | 2014-01-08 Eric S. Raymond <esr@thyrsus.com> | 9 | 2014-01-08 Eric S. Raymond <esr@thyrsus.com> |
| 2 | 10 | ||
| 3 | In preparation for the move to git, sanitize out some | 11 | In preparation for the move to git, sanitize out some |
| @@ -11,8 +19,8 @@ | |||
| 11 | 19 | ||
| 12 | 2014-01-08 David Engster <deng@randomsample.de> | 20 | 2014-01-08 David Engster <deng@randomsample.de> |
| 13 | 21 | ||
| 14 | * help-fns.el (help-fns-describe-function-functions): New | 22 | * help-fns.el (help-fns-describe-function-functions): |
| 15 | variable to call functions for augmenting help buffers. | 23 | New variable to call functions for augmenting help buffers. |
| 16 | (describe-function-1): Remove explicit calls to | 24 | (describe-function-1): Remove explicit calls to |
| 17 | `help-fns--compiler-macro', `help-fns--parent-mode' and | 25 | `help-fns--compiler-macro', `help-fns--parent-mode' and |
| 18 | `help-fns--obsolete'. Put them in above new variable instead, and | 26 | `help-fns--obsolete'. Put them in above new variable instead, and |
| @@ -20,13 +28,13 @@ | |||
| 20 | * emacs-lisp/eieio-opt.el (eieio-help-class): Rename from | 28 | * emacs-lisp/eieio-opt.el (eieio-help-class): Rename from |
| 21 | `eieio-describe-class'. Not meant for interactive use anymore, | 29 | `eieio-describe-class'. Not meant for interactive use anymore, |
| 22 | but to augment existing help buffers. Remove optional second | 30 | but to augment existing help buffers. Remove optional second |
| 23 | argument. Create proper button for file location. Rewrite | 31 | argument. Create proper button for file location. |
| 24 | function to use `insert' instead of `princ' and `prin1' where | 32 | Rewrite function to use `insert' instead of `princ' and `prin1' where |
| 25 | possible. | 33 | possible. |
| 26 | (eieio-help-class-slots): Rename from `eieio-describe-class-slots'. | 34 | (eieio-help-class-slots): Rename from `eieio-describe-class-slots'. |
| 27 | (eieio-method-def, eieio-class-def): Move further up. | 35 | (eieio-method-def, eieio-class-def): Move further up. |
| 28 | (describe-method, describe-generic, eieio-describe-method): Remove | 36 | (describe-method, describe-generic, eieio-describe-method): |
| 29 | aliases. | 37 | Remove aliases. |
| 30 | (eieio-help-constructor, eieio-help-generic): Rename from | 38 | (eieio-help-constructor, eieio-help-generic): Rename from |
| 31 | `eieio-describe-constructor' and `eieio-describe-generic', resp. | 39 | `eieio-describe-constructor' and `eieio-describe-generic', resp. |
| 32 | Rewrite to use `insert' in the current buffer and use proper help | 40 | Rewrite to use `insert' in the current buffer and use proper help |
| @@ -36,8 +44,8 @@ | |||
| 36 | arguments. | 44 | arguments. |
| 37 | (eieio-help-mode-augmentation-maybee): Remove. | 45 | (eieio-help-mode-augmentation-maybee): Remove. |
| 38 | (eieio-describe-class-sb): Use `describe-function'. | 46 | (eieio-describe-class-sb): Use `describe-function'. |
| 39 | * emacs-lisp/eieio.el (help-fns-describe-function-functions): Add | 47 | * emacs-lisp/eieio.el (help-fns-describe-function-functions): |
| 40 | `eieio-help-generic' and `eieio-help-constructor'. | 48 | Add `eieio-help-generic' and `eieio-help-constructor'. |
| 41 | 49 | ||
| 42 | 2014-01-08 Paul Eggert <eggert@cs.ucla.edu> | 50 | 2014-01-08 Paul Eggert <eggert@cs.ucla.edu> |
| 43 | 51 | ||
diff --git a/lisp/simple.el b/lisp/simple.el index f9ebe129f7e..5c2f3c3db1d 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -4322,6 +4322,7 @@ run `deactivate-mark-hook'." | |||
| 4322 | (null (x-selection-exists-p 'PRIMARY)))) | 4322 | (null (x-selection-exists-p 'PRIMARY)))) |
| 4323 | (x-set-selection 'PRIMARY | 4323 | (x-set-selection 'PRIMARY |
| 4324 | (funcall region-extract-function nil))))) | 4324 | (funcall region-extract-function nil))))) |
| 4325 | (when mark-active (force-mode-line-update)) ;Refresh toolbar (bug#16382). | ||
| 4325 | (if (and (null force) | 4326 | (if (and (null force) |
| 4326 | (or (eq transient-mark-mode 'lambda) | 4327 | (or (eq transient-mark-mode 'lambda) |
| 4327 | (and (eq (car-safe transient-mark-mode) 'only) | 4328 | (and (eq (car-safe transient-mark-mode) 'only) |
| @@ -4334,11 +4335,14 @@ run `deactivate-mark-hook'." | |||
| 4334 | (setq mark-active nil) | 4335 | (setq mark-active nil) |
| 4335 | (run-hooks 'deactivate-mark-hook)))) | 4336 | (run-hooks 'deactivate-mark-hook)))) |
| 4336 | 4337 | ||
| 4337 | (defun activate-mark () | 4338 | (defun activate-mark (&optional no-tmm) |
| 4338 | "Activate the mark." | 4339 | "Activate the mark. |
| 4340 | If NO-TMM is non-nil, leave `transient-mark-mode' alone." | ||
| 4339 | (when (mark t) | 4341 | (when (mark t) |
| 4342 | (unless (and mark-active transient-mark-mode) | ||
| 4343 | (force-mode-line-update)) ;Refresh toolbar (bug#16382). | ||
| 4340 | (setq mark-active t) | 4344 | (setq mark-active t) |
| 4341 | (unless transient-mark-mode | 4345 | (unless (or transient-mark-mode no-tmm) |
| 4342 | (setq transient-mark-mode 'lambda)) | 4346 | (setq transient-mark-mode 'lambda)) |
| 4343 | (run-hooks 'activate-mark-hook))) | 4347 | (run-hooks 'activate-mark-hook))) |
| 4344 | 4348 | ||
| @@ -4359,16 +4363,13 @@ store it in a Lisp variable. Example: | |||
| 4359 | 4363 | ||
| 4360 | (let ((beg (point))) (forward-line 1) (delete-region beg (point)))." | 4364 | (let ((beg (point))) (forward-line 1) (delete-region beg (point)))." |
| 4361 | 4365 | ||
| 4366 | (set-marker (mark-marker) pos (current-buffer)) | ||
| 4362 | (if pos | 4367 | (if pos |
| 4363 | (progn | 4368 | (activate-mark 'no-tmm) |
| 4364 | (setq mark-active t) | ||
| 4365 | (run-hooks 'activate-mark-hook) | ||
| 4366 | (set-marker (mark-marker) pos (current-buffer))) | ||
| 4367 | ;; Normally we never clear mark-active except in Transient Mark mode. | 4369 | ;; Normally we never clear mark-active except in Transient Mark mode. |
| 4368 | ;; But when we actually clear out the mark value too, we must | 4370 | ;; But when we actually clear out the mark value too, we must |
| 4369 | ;; clear mark-active in any mode. | 4371 | ;; clear mark-active in any mode. |
| 4370 | (deactivate-mark t) | 4372 | (deactivate-mark t))) |
| 4371 | (set-marker (mark-marker) nil))) | ||
| 4372 | 4373 | ||
| 4373 | (defcustom use-empty-active-region nil | 4374 | (defcustom use-empty-active-region nil |
| 4374 | "Whether \"region-aware\" commands should act on empty regions. | 4375 | "Whether \"region-aware\" commands should act on empty regions. |
| @@ -4492,11 +4493,10 @@ Start discarding off end if gets this big." | |||
| 4492 | If no prefix ARG and mark is already set there, just activate it. | 4493 | If no prefix ARG and mark is already set there, just activate it. |
| 4493 | Display `Mark set' unless the optional second arg NOMSG is non-nil." | 4494 | Display `Mark set' unless the optional second arg NOMSG is non-nil." |
| 4494 | (interactive "P") | 4495 | (interactive "P") |
| 4495 | (let ((mark (marker-position (mark-marker)))) | 4496 | (let ((mark (mark t))) |
| 4496 | (if (or arg (null mark) (/= mark (point))) | 4497 | (if (or arg (null mark) (/= mark (point))) |
| 4497 | (push-mark nil nomsg t) | 4498 | (push-mark nil nomsg t) |
| 4498 | (setq mark-active t) | 4499 | (activate-mark 'no-tmm) |
| 4499 | (run-hooks 'activate-mark-hook) | ||
| 4500 | (unless nomsg | 4500 | (unless nomsg |
| 4501 | (message "Mark activated"))))) | 4501 | (message "Mark activated"))))) |
| 4502 | 4502 | ||