Code request on #emacs. This doesn’t work with XEmacs, since XEmacs define-minor-mode doesn’t have a BODY argument. Feel free to fix.
YannHodique fixed some nullMarkerException ;), provided a global-mode, and an exception list.
It would be nice if a C-G (keyboard-quit) made the existing visible marks invisible again (kind of a transient-visible-marks-mode). That would let you see them when you want them (e.g. while preparing for a transpose-region) but hide them easily when they annoy. – MarkTKennedy
Tip: I find setting a colored underline face less in-your-face than a colored background for the visible marks - especially if you’re displaying all marks on the mark ring.
If you’re using visible mark and displaying all the marks on the mark ring, you may find yourself wanting to navigate to them in the order they’re displayed relative to the current point rather than the order you pushed them onto the mark ring - following allows you to move to the next/previous mark on the mark ring relative to the point in buffer order with control-super-left/right (super is usually windoze keys on PCs):
(defun buffer-order-next-mark (arg) (interactive "p") (when (mark) (let* ((p (point)) (m (mark)) (n p) (count (if (null arg) 1 arg)) (abscount (abs count)) (rel (funcall (if (< 0 count) 'identity 'reverse) (sort (cons (cons 0 p) (cons (cons (- m p) m) (if mark-ring (mapcar (lambda (mrm) (cons (- mrm p) mrm)) mark-ring) nil))) (lambda (c d) (< (car c) (car d)))))) (cur rel)) (while (and (numberp (caar cur)) (/= (caar cur) 0)) (setq cur (cdr cur))) (while (and (numberp (caadr cur)) (= (caadr cur) 0)) (setq cur (cdr cur))) (while (< 0 abscount) (setq cur (cdr cur)) (when (null cur) (setq cur rel)) (setq abscount (- abscount 1))) (when (number-or-marker-p (cdar cur)) (goto-char (cdar cur))))))
(defun buffer-order-prev-mark (arg) (interactive "p") (buffer-order-next-mark (if (null arg) -1 (- arg))))
(global-set-key [C-s-right] 'buffer-order-next-mark) (global-set-key [C-s-left] 'buffer-order-prev-mark)