Function: gnus-summary-update-mark

gnus-summary-update-mark is a byte-compiled function defined in gnus-sum.el.gz.

Signature

(gnus-summary-update-mark MARK TYPE)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-sum.el.gz
(defun gnus-summary-update-mark (mark type)
  (let ((forward (cdr (assq type gnus-summary-mark-positions)))
	(inhibit-read-only t))
    (re-search-backward "[\n\r]" (line-beginning-position) 'move-to-limit)
    (when forward
      (when (looking-at "\r")
        (incf forward))
      (when (<= (+ forward (point)) (point-max))
	;; Go to the right position on the line.
	(goto-char (+ forward (point)))
	;; Replace the old mark with the new mark.
        (let ((to-insert
               (subst-char-in-string
		(char-after) mark
		(buffer-substring (point) (1+ (point))))))
          (delete-region (point) (1+ (point)))
          (insert to-insert))
	;; Optionally update the marks by some user rule.
	(when (eq type 'unread)
	  (setf (gnus-data-mark
                 (gnus-data-find (gnus-summary-article-number)))
                mark)
	  (gnus-summary-update-line (eq mark gnus-unread-mark)))))))