[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


From: Sebastian Rose
Subject: add-log.el
Date: Sat, 16 Dec 2006 18:15:20 +0100

Hi there,

pardon me for posting to this group, but after searching for a way to
contact someone who probably feels responsable for add-log.el, I think
this is the place to start.

The problem:

I wrote a small peace of code, that shall hold for add-log.el's
add-log-file-name-function and customized change-log according to this.
Everythting works fine so far.

Unfortunately the code relies on a local variable in add-log.el:

logfile, one of the parameters to add-log-file-name(), that is
originally a local variable in add-change-log-entry().

The Question:

Is there an other way to find out the path and filename of the logfile
the user has choosen?

My add-log.el has no version... but it came with emacs-21.4.1 on my

If not - how about using a more global, documented and reliable technic
to achieve this? How about sending patches?

The Code:

mtn-get-parent-directory is a helperfunction, that returns the real name
(no linknames) of the arguments parent directory. The whole of it can be
reviewed at http://venge.net/monotone/wiki/ChangeLog.


(defun mtn-add-log-file-name(original-name)
  "Return the filename printed in _MTN/log (or ChangeLog) relative to
the projects root. That is the driectory the file ChangeLog lives in,
if not a monotone project, _MTN/../ otherwise."

  (let ((directory (mtn-get-parent-directory log-file))
        (file (file-truename original-name)))

    (if (string= change-log-default-name "log")
        ;; monotone
        (let ((directory  (mtn-get-parent-directory directory)))
          (file-relative-name file directory))
      ;; else no monotone:
      (file-relative-name file directory))))


Sebastian Rose <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]