unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* how to highlight the mark
@ 2003-11-11  8:55 Wim Yedema
  0 siblings, 0 replies; 4+ messages in thread
From: Wim Yedema @ 2003-11-11  8:55 UTC (permalink / raw)


Subject says it all really.  I want to highlight the mark kind of like 
the cursor.

Wim Yedema

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: how to highlight the mark
       [not found] <mailman.140.1068544686.2005.help-gnu-emacs@gnu.org>
@ 2003-11-11  9:11 ` roodwriter
  2003-11-11 10:43 ` Oliver Scholz
  2003-11-11 12:30 ` Patrick Gundlach
  2 siblings, 0 replies; 4+ messages in thread
From: roodwriter @ 2003-11-11  9:11 UTC (permalink / raw)


Wim Yedema wrote:

> Subject says it all really.  I want to highlight the mark kind of like
> the cursor.
> 
> Wim Yedema

I don't understand the question.

Are you talking about highlighting the text between point and mark? If so 
you need to be in X and use the transient mark mode under Options. It's on 
your menu bar. It doesn't work in the console mode.

There are also various options under Options for the cursor itself. Plus 
there's a setting to highlight the line your cursor is on.

Hope I've been helpful here. But maybe I'm entirely off base.

--Rod

-- 
Author of "Linux for Non-Geeks--Clear-eyed Answered for Practical Consumers" 
and "Boring Stories from Uncle Rod." Both are available at 
http://www.rodwriterpublishing.com/index.html

To reply by e-mail, take the extra "o" out of the name.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: how to highlight the mark
       [not found] <mailman.140.1068544686.2005.help-gnu-emacs@gnu.org>
  2003-11-11  9:11 ` how to highlight the mark roodwriter
@ 2003-11-11 10:43 ` Oliver Scholz
  2003-11-11 12:30 ` Patrick Gundlach
  2 siblings, 0 replies; 4+ messages in thread
From: Oliver Scholz @ 2003-11-11 10:43 UTC (permalink / raw)


Wim Yedema <yedema@natlab.research.philips.com> writes:

> Subject says it all really.  I want to highlight the mark kind of like 
> the cursor.

Barely tested:

(defvar wy-mark-overlay nil)
(make-variable-buffer-local 'wy-mark-overlay)

(defun wy-move-mark-overlay (pos)
  (move-overlay wy-mark-overlay pos (1+ pos)))

(define-minor-mode wy-highlight-mark-mode
  "Minor mode to highlight the mark."
  nil "wy-mark " nil
  (cond (wy-highlight-mark-mode
	 ;; Turn mode on.
	 (setq wy-mark-overlay (make-overlay (mark) (1+ (mark))))
	 (overlay-put wy-mark-overlay 'face 'highlight))
	(t
	 ;; Turn mode off.
	 (delete-overlay wy-mark-overlay)
	 (setq wy-mark-overlay nil))))

(defadvice set-mark (after wy-highlight-mark activate)
  (when wy-highlight-mark-mode
    (wy-move-mark-overlay (mark))))

It doesn't work well at the end of a line and at `point-max',
though.  I believe that would require hacking the display engine.
You are probably better off using `transient-mark-mode'.

    Oliver
-- 
21 Brumaire an 212 de la Révolution
Liberté, Egalité, Fraternité!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: how to highlight the mark
       [not found] <mailman.140.1068544686.2005.help-gnu-emacs@gnu.org>
  2003-11-11  9:11 ` how to highlight the mark roodwriter
  2003-11-11 10:43 ` Oliver Scholz
@ 2003-11-11 12:30 ` Patrick Gundlach
  2 siblings, 0 replies; 4+ messages in thread
From: Patrick Gundlach @ 2003-11-11 12:30 UTC (permalink / raw)


Wim Yedema <yedema@natlab.research.philips.com> writes:

> Subject says it all really.  I want to highlight the mark kind of like 
> the cursor.

thats what I use:


;; nice mark - shows mark as a highlighted 'cursor' so user 'always' 
;; sees where the mark is. Especially nice for killing a region.

(defvar pg-mark-overlay nil
  "Overlay to show the position where the mark is") 
(make-variable-buffer-local 'pg-mark-overlay)

(put 'pg-mark-mark 'face 'secondary-selection)

(defvar pg-mark-old-position nil
  "The position the mark was at. To be able to compare with the
current position")

(defun pg-show-mark () 
  "Display an overlay where the mark is at. Should be hooked into 
activate-mark-hook" 
  (unless pg-mark-overlay 
    (setq pg-mark-overlay (make-overlay 0 0))
    (overlay-put pg-mark-overlay 'category 'pg-mark-mark))
  (let ((here (mark t)))
    (when here
      (move-overlay pg-mark-overlay here (1+ here)))))

(defadvice  exchange-point-and-mark (after pg-mark-exchange-point-and-mark)
  "Show visual marker"
  (pg-show-mark))

(ad-activate 'exchange-point-and-mark)
(add-hook 'activate-mark-hook 'pg-show-mark)



Patrick
-- 
You are your own rainbow!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-11-11 12:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.140.1068544686.2005.help-gnu-emacs@gnu.org>
2003-11-11  9:11 ` how to highlight the mark roodwriter
2003-11-11 10:43 ` Oliver Scholz
2003-11-11 12:30 ` Patrick Gundlach
2003-11-11  8:55 Wim Yedema

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).