diff options
| author | Gerd Moellmann | 2000-01-11 15:08:47 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-01-11 15:08:47 +0000 |
| commit | c1356086c3fc3f24c4d277c5532dac9dbfb7c8f4 (patch) | |
| tree | 2f42fe4923ea1827b225ad7f243e6c412011f91e | |
| parent | 7a85e4dfa3ffc1247a394330d5e95b818e4c5985 (diff) | |
| download | emacs-c1356086c3fc3f24c4d277c5532dac9dbfb7c8f4.tar.gz emacs-c1356086c3fc3f24c4d277c5532dac9dbfb7c8f4.zip | |
(add-log-current-defun): Call
`add-log-current-defun-function'. Try matches at level 0 and
level 1. Strip whitespace from defun found.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/add-log.el | 30 |
2 files changed, 27 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 59d96bb9cea..2c9180c3e9a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2000-01-09 Sun Jari Aalto <jari.aalto@poboxes.com> | ||
| 2 | |||
| 3 | * add-log.el (add-log-current-defun): Call | ||
| 4 | `add-log-current-defun-function'. Try matches at level 0 and | ||
| 5 | level 1. Strip whitespace from defun found. | ||
| 6 | |||
| 1 | 2000-01-10 John Wiegley <johnw@gnu.org> | 7 | 2000-01-10 John Wiegley <johnw@gnu.org> |
| 2 | 8 | ||
| 3 | * allout.el (isearch-done/outline-provisions): Added `edit' | 9 | * allout.el (isearch-done/outline-provisions): Added `edit' |
diff --git a/lisp/add-log.el b/lisp/add-log.el index 333089d5cff..30802c4155d 100644 --- a/lisp/add-log.el +++ b/lisp/add-log.el | |||
| @@ -581,14 +581,17 @@ Texinfo (@node titles), Perl, and Fortran. | |||
| 581 | 581 | ||
| 582 | Other modes are handled by a heuristic that looks in the 10K before | 582 | Other modes are handled by a heuristic that looks in the 10K before |
| 583 | point for uppercase headings starting in the first column or | 583 | point for uppercase headings starting in the first column or |
| 584 | identifiers followed by `:' or `=', see variable | 584 | identifiers followed by `:' or `=', see variables |
| 585 | `add-log-current-defun-header-regexp'. | 585 | `add-log-current-defun-header-regexp' and |
| 586 | `add-log-current-defun-function' | ||
| 586 | 587 | ||
| 587 | Has a preference of looking backwards." | 588 | Has a preference of looking backwards." |
| 588 | (condition-case nil | 589 | (condition-case nil |
| 589 | (save-excursion | 590 | (save-excursion |
| 590 | (let ((location (point))) | 591 | (let ((location (point))) |
| 591 | (cond ((memq major-mode add-log-lisp-like-modes) | 592 | (cond ((functionp add-log-current-defun-function) |
| 593 | (funcall add-log-current-defun-function)) | ||
| 594 | ((memq major-mode add-log-lisp-like-modes) | ||
| 592 | ;; If we are now precisely at the beginning of a defun, | 595 | ;; If we are now precisely at the beginning of a defun, |
| 593 | ;; make sure beginning-of-defun finds that one | 596 | ;; make sure beginning-of-defun finds that one |
| 594 | ;; rather than the previous one. | 597 | ;; rather than the previous one. |
| @@ -771,13 +774,22 @@ Has a preference of looking backwards." | |||
| 771 | "main"))) | 774 | "main"))) |
| 772 | (t | 775 | (t |
| 773 | ;; If all else fails, try heuristics | 776 | ;; If all else fails, try heuristics |
| 774 | (let (case-fold-search) | 777 | (let (case-fold-search |
| 778 | result) | ||
| 775 | (end-of-line) | 779 | (end-of-line) |
| 776 | (if (re-search-backward add-log-current-defun-header-regexp | 780 | (when (re-search-backward |
| 777 | (- (point) 10000) | 781 | add-log-current-defun-header-regexp |
| 778 | t) | 782 | (- (point) 10000) |
| 779 | (buffer-substring (match-beginning 1) | 783 | t) |
| 780 | (match-end 1)))))))) | 784 | (setq result (or (buffer-substring (match-beginning 1) |
| 785 | (match-end 1)) | ||
| 786 | (buffer-substring (match-beginning 0) | ||
| 787 | (match-end 0)))) | ||
| 788 | ;; Strip whitespace away | ||
| 789 | (when (string-match "\\([^ \t\n\r\f].*[^ \t\n\r\f]\\)" | ||
| 790 | result) | ||
| 791 | (setq result (match-string 1 result))) | ||
| 792 | result)))))) | ||
| 781 | (error nil))) | 793 | (error nil))) |
| 782 | 794 | ||
| 783 | (defvar change-log-get-method-definition-md) | 795 | (defvar change-log-get-method-definition-md) |