Function: log-edit-changelog-ours-p

log-edit-changelog-ours-p is a byte-compiled function defined in log-edit.el.gz.

Signature

(log-edit-changelog-ours-p)

Documentation

See if ChangeLog entry at point is for the current user, today.

Return non-nil if it is.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/log-edit.el.gz
(defvar log-edit-author)                ;Dynamically scoped.

(defun log-edit-changelog-ours-p ()
  "See if ChangeLog entry at point is for the current user, today.
Return non-nil if it is."
  ;; Code adapted from add-change-log-entry.
  (let ((name (or (and (boundp 'add-log-full-name) add-log-full-name)
		  (and (fboundp 'user-full-name) (user-full-name))
		  (and (boundp 'user-full-name) user-full-name)))
        (mail (or (and (boundp 'add-log-mailing-address) add-log-mailing-address)
		  ;;(and (fboundp 'user-mail-address) (user-mail-address))
		  (and (boundp 'user-mail-address) user-mail-address)))
	(time (or (and (boundp 'add-log-time-format)
		       (functionp add-log-time-format)
		       (funcall add-log-time-format
				nil add-log-time-zone-rule))
		  (format-time-string "%Y-%m-%d"))))
    (if (null log-edit-changelog-use-first)
        (looking-at (regexp-quote (format "%s  %s  <%s>" time name mail)))
      ;; Check the author, to potentially add it as a "Author: " header.
      ;; FIXME This accumulates multiple authors, but only when there
      ;; are multiple ChangeLog files.  It should also check for
      ;; multiple authors in each individual entry.
      (when (looking-at "[^ \t]")
        (when (and (boundp 'log-edit-author)
                   (not (looking-at (format ".+  .+  <%s>"
                                            (regexp-quote mail))))
                   (looking-at ".+  \\(.+  <.+>\\) *\\((tiny change)\\)?"))
          (let ((author (string-replace "  " " "
                                        (match-string 1))))
            (unless (and log-edit-author
                         (string-match (regexp-quote author)
                                       (car log-edit-author)))
              (if (not log-edit-author)
                  (setq log-edit-author
                        (cons author (if (match-string 2) 'tiny)))
                (setcar log-edit-author
                        (concat (car log-edit-author) ", " author))
                (and (match-string 2) (not (cdr log-edit-author))
                     (setcdr log-edit-author 'tiny))))))
        t))))