|
| From: | Kim F. Storm |
| Subject: | Re: address@hidden: [patch] factor out comment-or-uncomment feature from comment-dwim] |
| Date: | 10 Apr 2002 23:39:51 +0200 |
| User-agent: | Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50 |
address@hidden (Kim F. Storm) writes:
> What about this modification to set-mark-command which simply turns on
> transient-mark-command (temporarily) if you repeat C-SPC immediately.
> If you move the mark with another C-SPC, transient-mark-mode is
> turned off again (enter another C-SPC to reenable it):
>
> (defun set-mark-command (arg)
> (interactive "P")
> (if (null arg)
> (if (eq this-command last-command)
> (setq transient-mark-mode 'lambda)
> (setq transient-mark-mode nil)
> (push-mark nil nil t))
> (if (null (mark t))
> (error "No mark set in this buffer")
> (goto-char (mark t))
> (pop-mark))))
>
This will disturb users who does use transient-mark-mode.
A proper definition would be:
(defun set-mark-command (arg)
(interactive "P")
(if (null arg)
(if (eq this-command last-command)
(if (not transient-mark-mode)
(setq transient-mark-mode 'lambda))
(if (eq transient-mark-mode 'lambda)
(setq transient-mark-mode nil))
(push-mark nil nil t))
(if (null (mark t))
(error "No mark set in this buffer")
(goto-char (mark t))
(pop-mark))))
--
Kim F. Storm <address@hidden> http://www.cua.dk
| [Prev in Thread] | Current Thread | [Next in Thread] |