Changeset 4073 for trunk/lisp/add-log.el
- Timestamp:
- 05/03/06 18:37:43 (3 years ago)
- Files:
-
- trunk (modified) (1 prop)
- trunk/lisp/add-log.el (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk
- Property svn:ignore changed from
bin
to
bin
site-lisp
- Property svn:ignore changed from
trunk/lisp/add-log.el
r4058 r4073 73 73 ;;;###autoload 74 74 (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. 76 76 This defaults to the value of `user-mail-address'. In addition to 77 77 being a simple string, this value can also be a list. All elements … … 84 84 85 85 (defcustom add-log-time-format 'add-log-iso8601-time-string 86 " *Function that defines the time format.86 "Function that defines the time format. 87 87 For example, `add-log-iso8601-time-string', which gives the 88 88 date in international ISO 8601 format, … … 96 96 97 97 (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. 99 99 100 100 Log entries for a given file made with \\[add-change-log-entry] or … … 128 128 129 129 (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." 131 131 :version "22.1" 132 132 :type 'boolean … … 134 134 135 135 (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. 137 137 This function is called with no argument. If this is nil, the default is to 138 138 use `buffer-file-name'." … … 141 141 142 142 (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. 144 144 This function is called with one argument, the value of variable 145 145 `buffer-file-name' in that buffer. If this is nil, the default is to … … 287 287 "Keymap for Change Log major mode.") 288 288 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 290 293 "Time zone used for calculating change log time stamps. 291 294 It 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) 295 If nil, use local time. 296 If t, use universal time.") 297 298 (defun add-log-iso8601-time-zone (&optional time) 295 299 (let* ((utc-offset (or (car (current-time-zone time)) 0)) 296 300 (sign (if (< utc-offset 0) ?- ?+)) … … 305 309 sign hh mm ss))) 306 310 311 (defvar add-log-iso8601-with-time-zone nil) 312 307 313 (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))) 319 319 320 320 (defun change-log-name () … … 495 495 notices. 496 496 497 Today's date is calculated according to ` change-log-time-zone-rule' if497 Today's date is calculated according to `add-log-time-zone-rule' if 498 498 non-nil, otherwise in local time." 499 499 (interactive (list current-prefix-arg … … 539 539 540 540 ;; 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))))) 548 557 (if (and (not add-log-always-start-new-record) 549 558 (let ((hit nil)) … … 653 662 ;;;###autoload (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window) 654 663 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 () 658 667 (let* ((indent 659 668 (save-excursion … … 661 670 (skip-chars-forward " \t") 662 671 (cond 663 ((and (looking-at "\\(.*\\) [^ \n].*[^ \n] <.*> $")672 ((and (looking-at "\\(.*\\) [^ \n].*[^ \n] <.*>\\(?: +(.*)\\)? *$") 664 673 ;; Matching the output of add-log-time-format is difficult, 665 674 ;; but I'll get it has at least two adjacent digits. … … 667 676 0) 668 677 ((looking-at "[^*(]") 669 (+ (current-left-margin) add-log-indent-text))678 (+ (current-left-margin) change-log-indent-text)) 670 679 (t (current-left-margin))))) 671 680 (pos (save-excursion (indent-line-to indent) (point)))) … … 689 698 (set (make-local-variable 'fill-paragraph-function) 690 699 '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) 692 701 (set (make-local-variable 'tab-always-indent) nil) 693 702 ;; We really do want "^" in paragraph-start below: it is only the … … 723 732 (defcustom add-log-current-defun-header-regexp 724 733 "^\\([[: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." 726 735 :type 'regexp 727 736 :group 'change-log) … … 729 738 ;;;###autoload 730 739 (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) 732 741 "*Modes that look like Lisp to `add-log-current-defun'.") 733 742 734 743 ;;;###autoload 735 744 (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) 737 746 "*Modes that look like C to `add-log-current-defun'.") 738 747 739 748 ;;;###autoload 740 749 (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) 742 751 "*Modes that look like TeX to `add-log-current-defun'.") 743 752 … … 1104 1113 (provide 'add-log) 1105 1114 1106 ;; ;arch-tag: 81eee6fc-088f-4372-a37f-80ad9620e7621115 ;; arch-tag: 81eee6fc-088f-4372-a37f-80ad9620e762 1107 1116 ;;; add-log.el ends here
