Show
Ignore:
Timestamp:
05/03/06 18:37:43 (3 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk

    • Property svn:ignore changed from
      bin
      to
      bin
      site-lisp
  • trunk/lisp/add-log.el

    r4058 r4073  
    7373;;;###autoload 
    7474(defcustom add-log-mailing-address nil 
    75   "*Email addresses of user, for inclusion in ChangeLog headers. 
     75  "Email addresses of user, for inclusion in ChangeLog headers. 
    7676This defaults to the value of `user-mail-address'.  In addition to 
    7777being a simple string, this value can also be a list.  All elements 
     
    8484 
    8585(defcustom add-log-time-format 'add-log-iso8601-time-string 
    86   "*Function that defines the time format. 
     86  "Function that defines the time format. 
    8787For example, `add-log-iso8601-time-string', which gives the 
    8888date in international ISO 8601 format, 
     
    9696 
    9797(defcustom add-log-keep-changes-together nil 
    98   "*If non-nil, normally keep day's log entries for one file together. 
     98  "If non-nil, normally keep day's log entries for one file together. 
    9999 
    100100Log entries for a given file made with \\[add-change-log-entry] or 
     
    128128 
    129129(defcustom add-log-always-start-new-record nil 
    130   "*If non-nil, `add-change-log-entry' will always start a new record." 
     130  "If non-nil, `add-change-log-entry' will always start a new record." 
    131131  :version "22.1" 
    132132  :type 'boolean 
     
    134134 
    135135(defcustom add-log-buffer-file-name-function nil 
    136   "*If non-nil, function to call to identify the full filename of a buffer. 
     136  "If non-nil, function to call to identify the full filename of a buffer. 
    137137This function is called with no argument.  If this is nil, the default is to 
    138138use `buffer-file-name'." 
     
    141141 
    142142(defcustom add-log-file-name-function nil 
    143   "*If non-nil, function to call to identify the filename for a ChangeLog entry. 
     143  "If non-nil, function to call to identify the filename for a ChangeLog entry. 
    144144This function is called with one argument, the value of variable 
    145145`buffer-file-name' in that buffer.  If this is nil, the default is to 
     
    287287  "Keymap for Change Log major mode.") 
    288288 
    289 (defvar change-log-time-zone-rule nil 
     289;; It used to be called change-log-time-zone-rule but really should be 
     290;; called add-log-time-zone-rule since it's only used from add-log-* code. 
     291(defvaralias 'change-log-time-zone-rule 'add-log-time-zone-rule) 
     292(defvar add-log-time-zone-rule nil 
    290293  "Time zone used for calculating change log time stamps. 
    291294It takes the same format as the TZ argument of `set-time-zone-rule'. 
    292 If nil, use local time.") 
    293  
    294 (defun add-log-iso8601-time-zone (time) 
     295If nil, use local time. 
     296If t, use universal time.") 
     297 
     298(defun add-log-iso8601-time-zone (&optional time) 
    295299  (let* ((utc-offset (or (car (current-time-zone time)) 0)) 
    296300         (sign (if (< utc-offset 0) ?- ?+)) 
     
    305309            sign hh mm ss))) 
    306310 
     311(defvar add-log-iso8601-with-time-zone nil) 
     312 
    307313(defun add-log-iso8601-time-string () 
    308   (if change-log-time-zone-rule 
    309       (let ((tz (getenv "TZ")) 
    310             (now (current-time))) 
    311         (unwind-protect 
    312             (progn 
    313               (set-time-zone-rule change-log-time-zone-rule) 
    314               (concat 
    315                (format-time-string "%Y-%m-%d " now) 
    316                (add-log-iso8601-time-zone now))) 
    317           (set-time-zone-rule tz))) 
    318     (format-time-string "%Y-%m-%d"))) 
     314  (let ((time (format-time-string "%Y-%m-%d" 
     315                                  nil (eq t add-log-time-zone-rule)))) 
     316    (if add-log-iso8601-with-time-zone 
     317        (concat time " " (add-log-iso8601-time-zone)) 
     318      time))) 
    319319 
    320320(defun change-log-name () 
     
    495495notices. 
    496496 
    497 Today's date is calculated according to `change-log-time-zone-rule' if 
     497Today's date is calculated according to `add-log-time-zone-rule' if 
    498498non-nil, otherwise in local time." 
    499499  (interactive (list current-prefix-arg 
     
    539539 
    540540    ;; Advance into first entry if it is usable; else make new one. 
    541     (let ((new-entries (mapcar (lambda (addr) 
    542                                  (concat (funcall add-log-time-format) 
    543                                          "  " full-name 
    544                                          "  <" addr ">")) 
    545                                (if (consp mailing-address) 
    546                                    mailing-address 
    547                                  (list mailing-address))))) 
     541    (let ((new-entries 
     542           (mapcar (lambda (addr) 
     543                     (concat 
     544                      (if (stringp add-log-time-zone-rule) 
     545                          (let ((tz (getenv "TZ"))) 
     546                            (unwind-protect 
     547                                (progn 
     548                                  (set-time-zone-rule add-log-time-zone-rule) 
     549                                  (funcall add-log-time-format)) 
     550                              (set-time-zone-rule tz))) 
     551                        (funcall add-log-time-format)) 
     552                      "  " full-name 
     553                      "  <" addr ">")) 
     554                   (if (consp mailing-address) 
     555                       mailing-address 
     556                     (list mailing-address))))) 
    548557      (if (and (not add-log-always-start-new-record) 
    549558               (let ((hit nil)) 
     
    653662;;;###autoload (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window) 
    654663 
    655 (defvar add-log-indent-text 0) 
    656  
    657 (defun add-log-indent () 
     664(defvar change-log-indent-text 0) 
     665 
     666(defun change-log-indent () 
    658667  (let* ((indent 
    659668          (save-excursion 
     
    661670            (skip-chars-forward " \t") 
    662671            (cond 
    663              ((and (looking-at "\\(.*\\)  [^ \n].*[^ \n]  <.*>$") 
     672             ((and (looking-at "\\(.*\\)  [^ \n].*[^ \n]  <.*>\\(?: +(.*)\\)? *$") 
    664673                   ;; Matching the output of add-log-time-format is difficult, 
    665674                   ;; but I'll get it has at least two adjacent digits. 
     
    667676              0) 
    668677             ((looking-at "[^*(]") 
    669               (+ (current-left-margin) add-log-indent-text)) 
     678              (+ (current-left-margin) change-log-indent-text)) 
    670679             (t (current-left-margin))))) 
    671680         (pos (save-excursion (indent-line-to indent) (point)))) 
     
    689698  (set (make-local-variable 'fill-paragraph-function) 
    690699       'change-log-fill-paragraph) 
    691   (set (make-local-variable 'indent-line-function) 'add-log-indent) 
     700  (set (make-local-variable 'indent-line-function) 'change-log-indent) 
    692701  (set (make-local-variable 'tab-always-indent) nil) 
    693702  ;; We really do want "^" in paragraph-start below: it is only the 
     
    723732(defcustom add-log-current-defun-header-regexp 
    724733  "^\\([[:upper:]][[:upper:]_ ]*[[:upper:]_]\\|[-_[:alpha:]]+\\)[ \t]*[:=]" 
    725   "*Heuristic regexp used by `add-log-current-defun' for unknown major modes." 
     734  "Heuristic regexp used by `add-log-current-defun' for unknown major modes." 
    726735  :type 'regexp 
    727736  :group 'change-log) 
     
    729738;;;###autoload 
    730739(defvar add-log-lisp-like-modes 
    731     '(emacs-lisp-mode lisp-mode scheme-mode dsssl-mode lisp-interaction-mode) 
     740  '(emacs-lisp-mode lisp-mode scheme-mode dsssl-mode lisp-interaction-mode) 
    732741  "*Modes that look like Lisp to `add-log-current-defun'.") 
    733742 
    734743;;;###autoload 
    735744(defvar add-log-c-like-modes 
    736     '(c-mode c++-mode c++-c-mode objc-mode) 
     745  '(c-mode c++-mode c++-c-mode objc-mode) 
    737746  "*Modes that look like C to `add-log-current-defun'.") 
    738747 
    739748;;;###autoload 
    740749(defvar add-log-tex-like-modes 
    741     '(TeX-mode plain-TeX-mode LaTeX-mode plain-tex-mode latex-mode) 
     750  '(TeX-mode plain-TeX-mode LaTeX-mode plain-tex-mode latex-mode) 
    742751  "*Modes that look like TeX to `add-log-current-defun'.") 
    743752 
     
    11041113(provide 'add-log) 
    11051114 
    1106 ;;; arch-tag: 81eee6fc-088f-4372-a37f-80ad9620e762 
     1115;; arch-tag: 81eee6fc-088f-4372-a37f-80ad9620e762 
    11071116;;; add-log.el ends here