comparison lisp/add-log.el @ 25273:c8d2d5e80cc0

(add-log-current-defun): Exclude all trailing whitespace. Handle `enum' like `struct'.
author Karl Heuer <kwzh@gnu.org>
date Mon, 16 Aug 1999 03:16:06 +0000
parents ca83292ec6f2
children 7f7e6de546ac
comparison
equal deleted inserted replaced
25272:db26c1e76313 25273:c8d2d5e80cc0
610 (>= location (point))) 610 (>= location (point)))
611 ;; Consistency check: going down and up 611 ;; Consistency check: going down and up
612 ;; shouldn't take us back before BEG. 612 ;; shouldn't take us back before BEG.
613 (> (point) beg)) 613 (> (point) beg))
614 (let (end middle) 614 (let (end middle)
615 ;; Don't include any final newline 615 ;; Don't include any final whitespace
616 ;; in the name we use. 616 ;; in the name we use.
617 (if (= (preceding-char) ?\n) 617 (skip-chars-backward " \t\n")
618 (forward-char -1))
619 (setq end (point)) 618 (setq end (point))
620 (backward-sexp 1) 619 (backward-sexp 1)
621 ;; Now find the right beginning of the name. 620 ;; Now find the right beginning of the name.
622 ;; Include certain keywords if they 621 ;; Include certain keywords if they
623 ;; precede the name. 622 ;; precede the name.
630 (setq end (point)) 629 (setq end (point))
631 (backward-sexp 1) 630 (backward-sexp 1)
632 (setq middle (point)) 631 (setq middle (point))
633 (forward-word -1)) 632 (forward-word -1))
634 (and (bolp) 633 (and (bolp)
635 (looking-at "struct \\|union \\|class ") 634 (looking-at "enum \\|struct \\|union \\|class ")
636 (setq middle (point))) 635 (setq middle (point)))
637 (goto-char end) 636 (goto-char end)
638 (when (eq (preceding-char) ?=) 637 (when (eq (preceding-char) ?=)
639 (forward-char -1) 638 (forward-char -1)
640 (skip-chars-backward " \t") 639 (skip-chars-backward " \t")