diff options
| author | Stefan Monnier | 2003-04-12 23:13:03 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2003-04-12 23:13:03 +0000 |
| commit | fc9b05545232b7448e8351d19107768d0c2a2523 (patch) | |
| tree | 3c4d556d24602e2cb4d65cde98f66b5a12ba32a7 | |
| parent | 662871dd952fdc8a84b057f7dd08715d530b2d06 (diff) | |
| download | emacs-fc9b05545232b7448e8351d19107768d0c2a2523.tar.gz emacs-fc9b05545232b7448e8351d19107768d0c2a2523.zip | |
(change-log-version-number-search): Fix old bug.
(add-change-log-entry): Avoid inserting the same funname again.
(add-log-indent-text): New var.
(add-log-indent): New fun.
(change-log-mode): Use it.
| -rw-r--r-- | lisp/ChangeLog | 31 | ||||
| -rw-r--r-- | lisp/add-log.el | 47 |
2 files changed, 67 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4023d57b6ab..8dea5e62fb8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,34 @@ | |||
| 1 | 2003-04-12 Stefan Monnier <monnier@cs.yale.edu> | ||
| 2 | |||
| 3 | * add-log.el (change-log-version-number-search): Fix old bug. | ||
| 4 | (add-change-log-entry): Avoid inserting the same funname again. | ||
| 5 | (add-log-indent-text): New var. | ||
| 6 | (add-log-indent): New fun. | ||
| 7 | (change-log-mode): Use it. | ||
| 8 | |||
| 9 | * net/browse-url.el: Don't autoload all these defcustoms. | ||
| 10 | (browse-url-default-macosx-browser): New fun. | ||
| 11 | (browse-url-browser-function): Use it for system-type = darwin. | ||
| 12 | (browse-url-usr1-signal): Remove. | ||
| 13 | (browse-url-mosaic): Use SIGUSR1 directly instead. | ||
| 14 | (browse-url-gnome-moz-program): New var. | ||
| 15 | (browse-url-gnome-moz, browse-url-default-browser): Use it. | ||
| 16 | |||
| 17 | * emacs-lisp/bytecomp.el: Use push, with-current-buffer, dolist, ... | ||
| 18 | (byte-compile-const-variables): New var. | ||
| 19 | (byte-compile-close-variables): Reset it. | ||
| 20 | (byte-compile-file-form-defvar, byte-compile-defvar): Update it. | ||
| 21 | (byte-compile-const-symbol-p): Now arg `value' to check defconsts. | ||
| 22 | (byte-compile-variable-ref): Use it and improve warning message. | ||
| 23 | (byte-compile-check-lambda-list): Use byte-compile-const-symbol-p. | ||
| 24 | (byte-compile-lapcode): Remove unused vars. | ||
| 25 | (byte-compile-eval): Fix thinko in handling of old-autoloads. | ||
| 26 | (byte-recompile-directory): Use the expanded form for directory. | ||
| 27 | (byte-compile-track-mouse): Use modern backquote syntax. | ||
| 28 | (byte-compile-defvar): Detect and properly handle (defconst a). | ||
| 29 | (byte-compile-defalias-warn): Remove unused arg `alias'. | ||
| 30 | (byte-compile-defalias): Update call. | ||
| 31 | |||
| 1 | 2003-04-13 Masatake YAMATO <jet@gyve.org> | 32 | 2003-04-13 Masatake YAMATO <jet@gyve.org> |
| 2 | 33 | ||
| 3 | * help.el (describe-minor-mode): New function implementation. | 34 | * help.el (describe-minor-mode): New function implementation. |
diff --git a/lisp/add-log.el b/lisp/add-log.el index 86902d88432..a5792601f96 100644 --- a/lisp/add-log.el +++ b/lisp/add-log.el | |||
| @@ -310,27 +310,26 @@ If nil, use local time.") | |||
| 310 | This is the value returned by `vc-workfile-version' or, if that is | 310 | This is the value returned by `vc-workfile-version' or, if that is |
| 311 | nil, by matching `change-log-version-number-regexp-list'." | 311 | nil, by matching `change-log-version-number-regexp-list'." |
| 312 | (let* ((size (buffer-size)) | 312 | (let* ((size (buffer-size)) |
| 313 | (end | 313 | (limit |
| 314 | ;; The version number can be anywhere in the file, but | 314 | ;; The version number can be anywhere in the file, but |
| 315 | ;; restrict search to the file beginning: 10% should be | 315 | ;; restrict search to the file beginning: 10% should be |
| 316 | ;; enough to prevent some mishits. | 316 | ;; enough to prevent some mishits. |
| 317 | ;; | 317 | ;; |
| 318 | ;; Apply percentage only if buffer size is bigger than | 318 | ;; Apply percentage only if buffer size is bigger than |
| 319 | ;; approx 100 lines. | 319 | ;; approx 100 lines. |
| 320 | (if (> size (* 100 80)) | 320 | (if (> size (* 100 80)) (+ (point) (/ size 10))))) |
| 321 | (/ size 10) | ||
| 322 | size)) | ||
| 323 | version) | ||
| 324 | (or (and buffer-file-name (vc-workfile-version buffer-file-name)) | 321 | (or (and buffer-file-name (vc-workfile-version buffer-file-name)) |
| 325 | (save-restriction | 322 | (save-restriction |
| 326 | (widen) | 323 | (widen) |
| 327 | (let ((regexps change-log-version-number-regexp-list)) | 324 | (let ((regexps change-log-version-number-regexp-list) |
| 325 | version) | ||
| 328 | (while regexps | 326 | (while regexps |
| 329 | (save-excursion | 327 | (save-excursion |
| 330 | (goto-char (point-min)) | 328 | (goto-char (point-min)) |
| 331 | (when (re-search-forward (pop regexps) end t) | 329 | (when (re-search-forward (pop regexps) limit t) |
| 332 | (setq version (match-string 1) | 330 | (setq version (match-string 1) |
| 333 | regexps nil))))))))) | 331 | regexps nil)))) |
| 332 | version))))) | ||
| 334 | 333 | ||
| 335 | 334 | ||
| 336 | ;;;###autoload | 335 | ;;;###autoload |
| @@ -564,8 +563,13 @@ non-nil, otherwise in local time." | |||
| 564 | (skip-syntax-backward " ") | 563 | (skip-syntax-backward " ") |
| 565 | (skip-chars-backward "):") | 564 | (skip-chars-backward "):") |
| 566 | (if (and (looking-at "):") | 565 | (if (and (looking-at "):") |
| 567 | (> fill-column (+ (current-column) (length defun) 4))) | 566 | (let ((pos (save-excursion (backward-sexp 1) (point)))) |
| 568 | (progn (delete-region (point) pos) (insert ", ")) | 567 | (when (equal (buffer-substring pos (point)) defun) |
| 568 | (delete-region pos (point))) | ||
| 569 | (> fill-column (+ (current-column) (length defun) 4)))) | ||
| 570 | (progn (skip-chars-backward ", ") | ||
| 571 | (delete-region (point) pos) | ||
| 572 | (unless (memq (char-before) '(?\()) (insert ", "))) | ||
| 569 | (if (looking-at "):") | 573 | (if (looking-at "):") |
| 570 | (delete-region (+ 1 (point)) (line-end-position))) | 574 | (delete-region (+ 1 (point)) (line-end-position))) |
| 571 | (goto-char pos) | 575 | (goto-char pos) |
| @@ -585,6 +589,26 @@ the change log file in another window." | |||
| 585 | (add-change-log-entry whoami file-name t)) | 589 | (add-change-log-entry whoami file-name t)) |
| 586 | ;;;###autoload (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window) | 590 | ;;;###autoload (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window) |
| 587 | 591 | ||
| 592 | (defvar add-log-indent-text 0) | ||
| 593 | |||
| 594 | (defun add-log-indent () | ||
| 595 | (let* ((indent | ||
| 596 | (save-excursion | ||
| 597 | (beginning-of-line) | ||
| 598 | (skip-chars-forward " \t") | ||
| 599 | (cond | ||
| 600 | ((and (looking-at "\\(.*\\) [^ \n].*[^ \n] <.*>$") | ||
| 601 | ;; Matching the output of add-log-time-format is difficult, | ||
| 602 | ;; but I'll get it has at least two adjacent digits. | ||
| 603 | (string-match "[[:digit:]][[:digit:]]" (match-string 1))) | ||
| 604 | 0) | ||
| 605 | ((looking-at "[^*(]") | ||
| 606 | (+ (current-left-margin) add-log-indent-text)) | ||
| 607 | (t (current-left-margin))))) | ||
| 608 | (pos (save-excursion (indent-line-to indent) (point)))) | ||
| 609 | (if (> pos (point)) (goto-char pos)))) | ||
| 610 | |||
| 611 | |||
| 588 | ;;;###autoload | 612 | ;;;###autoload |
| 589 | (define-derived-mode change-log-mode text-mode "Change Log" | 613 | (define-derived-mode change-log-mode text-mode "Change Log" |
| 590 | "Major mode for editing change logs; like Indented Text Mode. | 614 | "Major mode for editing change logs; like Indented Text Mode. |
| @@ -598,7 +622,8 @@ Runs `change-log-mode-hook'." | |||
| 598 | tab-width 8) | 622 | tab-width 8) |
| 599 | (set (make-local-variable 'fill-paragraph-function) | 623 | (set (make-local-variable 'fill-paragraph-function) |
| 600 | 'change-log-fill-paragraph) | 624 | 'change-log-fill-paragraph) |
| 601 | (set (make-local-variable 'indent-line-function) 'indent-to-left-margin) | 625 | (set (make-local-variable 'indent-line-function) 'add-log-indent) |
| 626 | (set (make-local-variable 'tab-always-indent) nil) | ||
| 602 | ;; We really do want "^" in paragraph-start below: it is only the | 627 | ;; We really do want "^" in paragraph-start below: it is only the |
| 603 | ;; lines that begin at column 0 (despite the left-margin of 8) that | 628 | ;; lines that begin at column 0 (despite the left-margin of 8) that |
| 604 | ;; we are looking for. Adding `* ' allows eliding the blank line | 629 | ;; we are looking for. Adding `* ' allows eliding the blank line |