>>>> "Uwe" == Uwe Brauer <oub(a)mat.ucm.es>
writes:
Uwe> Now can this be done, if the file in question is not under
Uwe> version control?
Not that I know of. With version control, keyword substitution is
done by the external program, not by Emacs AFAIK. Also, it doesn't
insert the ChangeLog file, it inserts the commit comments from the
repository. (Most projects consider it good practice for those to be
the same, in fact, many don't even maintain ChangeLogs as such. But
they might be different. XEmacs is one example.)
Uwe> So I would like to have something like
Uwe> %% $Log: ChangeLog $
Uwe> and then every entry into the change log file should be
Uwe> inserted in the source file (best with the adequate comment
Uwe> syntax)
It's possible that add-log mode will do log formatting for you
in-file. If so, it surely knows about needing comment syntax,
although you may need to customize it for TeX.
If not, you could use specific comments as boundary markers, then you
can write a couple of simple functions like
(defun ub-changelog-find-end ()
(interactive)
(goto-char (point-min))
(search-forward ub-changelog-begin-marker nil t)
(search-forward ub-changelog-end-marker nil t)
(beginning-of-line))
(defun ub-changelog-insert-skeleton (defun)
"Insert a skeleton at point and leaving point at first comment point."
(interactive)
(open-line 2)
(insert (format-time-string "%Y-%m-%d "))
(insert (format "%s <%s>\n\n\t* %s%s: ")
(ub-changelog-insert-author-name)
(ub-changelog-insert-author-email)
(file-name-nondirectory (buffer-file-name))
(if defun (format " (%s)" defun) "")))
(defun ub-changelog-addlog ()
(interactive)
(let ((defun (ub-changelog-what-defun)))
(ub-changelog-find-end)
(ub-changelog-insert-skeleton defun)))
The insert-author functions are functions so that you can have them
read defaults and query the user; they could just as easilly be simple
customizable variables. The hard part is ub-changelog-what-defun to
figure out what section label to use.
lisp-mnt.el has some similar functionality, but not that close to what
you want IIRC.
--
School of Systems and Information Engineering
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.