emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r115931: * lisp/simple.el (deactivate-mark, activate


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r115931: * lisp/simple.el (deactivate-mark, activate-mark): Force-mode-line-update.
Date: Thu, 09 Jan 2014 01:59:24 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115931
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16382
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Wed 2014-01-08 20:59:19 -0500
message:
  * 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.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/simple.el                 simple.el-20091113204419-o5vbwnq5f7feedwu-403
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-01-09 01:32:45 +0000
+++ b/lisp/ChangeLog    2014-01-09 01:59:19 +0000
@@ -1,3 +1,11 @@
+2014-01-09  Stefan Monnier  <address@hidden>
+
+       * simple.el (deactivate-mark, activate-mark): Force-mode-line-update
+       (bug#16382).
+       (activate-mark): Add `no-tmm' argument.
+       (set-mark, push-mark-command): Use it instead of running
+       activate-mark-hook by hand.
+
 2014-01-08  Eric S. Raymond  <address@hidden>
 
        In preparation for the move to git, sanitize out some
@@ -11,8 +19,8 @@
 
 2014-01-08  David Engster  <address@hidden>
 
-       * help-fns.el (help-fns-describe-function-functions): New
-       variable to call functions for augmenting help buffers.
+       * help-fns.el (help-fns-describe-function-functions):
+       New variable to call functions for augmenting help buffers.
        (describe-function-1): Remove explicit calls to
        `help-fns--compiler-macro', `help-fns--parent-mode' and
        `help-fns--obsolete'.  Put them in above new variable instead, and
@@ -20,13 +28,13 @@
        * emacs-lisp/eieio-opt.el (eieio-help-class): Rename from
        `eieio-describe-class'.  Not meant for interactive use anymore,
        but to augment existing help buffers.  Remove optional second
-       argument.  Create proper button for file location.  Rewrite
-       function to use `insert' instead of `princ' and `prin1' where
+       argument.  Create proper button for file location.
+       Rewrite function to use `insert' instead of `princ' and `prin1' where
        possible.
        (eieio-help-class-slots): Rename from `eieio-describe-class-slots'.
        (eieio-method-def, eieio-class-def): Move further up.
-       (describe-method, describe-generic, eieio-describe-method): Remove
-       aliases.
+       (describe-method, describe-generic, eieio-describe-method):
+       Remove aliases.
        (eieio-help-constructor, eieio-help-generic): Rename from
        `eieio-describe-constructor' and `eieio-describe-generic', resp.
        Rewrite to use `insert' in the current buffer and use proper help
@@ -36,8 +44,8 @@
        arguments.
        (eieio-help-mode-augmentation-maybee): Remove.
        (eieio-describe-class-sb): Use `describe-function'.
-       * emacs-lisp/eieio.el (help-fns-describe-function-functions): Add
-       `eieio-help-generic' and `eieio-help-constructor'.
+       * emacs-lisp/eieio.el (help-fns-describe-function-functions):
+       Add `eieio-help-generic' and `eieio-help-constructor'.
 
 2014-01-08  Paul Eggert  <address@hidden>
 

=== modified file 'lisp/simple.el'
--- a/lisp/simple.el    2014-01-01 07:43:34 +0000
+++ b/lisp/simple.el    2014-01-09 01:59:19 +0000
@@ -4322,6 +4322,7 @@
                      (null (x-selection-exists-p 'PRIMARY))))
             (x-set-selection 'PRIMARY
                               (funcall region-extract-function nil)))))
+    (when mark-active (force-mode-line-update)) ;Refresh toolbar (bug#16382).
     (if (and (null force)
             (or (eq transient-mark-mode 'lambda)
                 (and (eq (car-safe transient-mark-mode) 'only)
@@ -4334,11 +4335,14 @@
       (setq mark-active nil)
       (run-hooks 'deactivate-mark-hook))))
 
-(defun activate-mark ()
-  "Activate the mark."
+(defun activate-mark (&optional no-tmm)
+  "Activate the mark.
+If NO-TMM is non-nil, leave `transient-mark-mode' alone."
   (when (mark t)
+    (unless (and mark-active transient-mark-mode)
+      (force-mode-line-update)) ;Refresh toolbar (bug#16382).
     (setq mark-active t)
-    (unless transient-mark-mode
+    (unless (or transient-mark-mode no-tmm)
       (setq transient-mark-mode 'lambda))
     (run-hooks 'activate-mark-hook)))
 
@@ -4359,16 +4363,13 @@
 
    (let ((beg (point))) (forward-line 1) (delete-region beg (point)))."
 
+  (set-marker (mark-marker) pos (current-buffer))
   (if pos
-      (progn
-       (setq mark-active t)
-       (run-hooks 'activate-mark-hook)
-       (set-marker (mark-marker) pos (current-buffer)))
+      (activate-mark 'no-tmm)
     ;; Normally we never clear mark-active except in Transient Mark mode.
     ;; But when we actually clear out the mark value too, we must
     ;; clear mark-active in any mode.
-    (deactivate-mark t)
-    (set-marker (mark-marker) nil)))
+    (deactivate-mark t)))
 
 (defcustom use-empty-active-region nil
   "Whether \"region-aware\" commands should act on empty regions.
@@ -4492,11 +4493,10 @@
 If no prefix ARG and mark is already set there, just activate it.
 Display `Mark set' unless the optional second arg NOMSG is non-nil."
   (interactive "P")
-  (let ((mark (marker-position (mark-marker))))
+  (let ((mark (mark t)))
     (if (or arg (null mark) (/= mark (point)))
        (push-mark nil nomsg t)
-      (setq mark-active t)
-      (run-hooks 'activate-mark-hook)
+      (activate-mark 'no-tmm)
       (unless nomsg
        (message "Mark activated")))))
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]