From f56af8ca83c41ae8258461aba41edee392843472 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 21 Jan 2004 03:26:30 +0000 Subject: [PATCH] (outline-insert-heading): Tighten up match. (outline-demote, outline-move-subtree-down): Don't assume anything about outline-regexp. --- lisp/ChangeLog | 43 ++++++++++++++++++++++--------------------- lisp/outline.el | 10 ++++++---- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cbe11dc9560..44862546392 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2004-01-20 Stefan Monnier + + * outline.el (outline-insert-heading): Tighten up match. + (outline-demote, outline-move-subtree-down): Don't assume anything + about outline-regexp. + + * textmodes/texinfo.el (texinfo-mode): Remove ^ from outline-regexp. + (texinfo-show-structure): Explicitly add ^, and simplify. + 2004-01-20 Glenn Morris * calendar/appt.el (appt-check): Restore usage of @@ -15,22 +24,15 @@ * vc.el (vc-default-previous-version): Doc enhancement. (vc-default-next-version): New function. (vc-print-log): New arg FOCUS-REV. - (vc-annotate-mode): Derives from view-mode now. - (vc-annotate): New args REVISION, DISPLAY-MODE. - (vc-annotate-prev-version): New function. - (vc-annotate-prev-version): New function. - (vc-annotate-next-version): New function. - (vc-annotate-workfile-version): New function. - (vc-annotate-extract-revision-at-line): New function. - (vc-annotate-revision-at-line): New function. - (vc-annotate-revision-previous-to-line): New function. - (vc-annotate-show-log-revision-at-line): New function. - (vc-annotate-show-diff-revision-at-line): New function. - (vc-current-line): New function. - (vc-annotate-warp-version): New function. - - * vc-cvs.el (vc-cvs-annotate-extract-revision-at-line): New - function. + (vc-annotate-mode): Derive from view-mode. + (vc-annotate): New args REVISION, DISPLAY-MODE. + (vc-annotate-workfile-version, vc-annotate-extract-revision-at-line) + (vc-annotate-revision-at-line, vc-annotate-revision-previous-to-line) + (vc-annotate-show-log-revision-at-line, vc-annotate-warp-version) + (vc-annotate-show-diff-revision-at-line, vc-current-line) + (vc-annotate-prev-version, vc-annotate-next-version): New functions. + + * vc-cvs.el (vc-cvs-annotate-extract-revision-at-line): New function. 2004-01-19 Karl Berry @@ -43,19 +45,18 @@ 2004-01-19 Karl Berry - * textmodes/texinfo.el (texinfo-mode): define outline-regexp to start + * textmodes/texinfo.el (texinfo-mode): Define outline-regexp to start with ^, since that's what texinfo-show-structure documentation says (plus it works much better in texinfo.txi). 2004-01-18 Jesper Harder - * mail/smtpmail.el (smtpmail-send-data): Don't append spurious - newline. + * mail/smtpmail.el (smtpmail-send-data): Don't append spurious newline. 2004-01-18 David Ponce (tiny change) * progmodes/which-func.el (which-function-mode): Don't cancel - which-func-update-timer if not set. + which-func-update-timer if not set. 2004-01-17 Thien-Thi Nguyen @@ -77,7 +78,7 @@ Save and restore the deletion status of old messages when reading new mail with spam filter, so that expunging spam does not expunge msgs deleted by the user. - (rmail-only-expunge): added an optional argument dont-show to + (rmail-only-expunge): Add an optional argument dont-show to prevent showing message after expunge. 2004-01-15 Luc Teirlinck diff --git a/lisp/outline.el b/lisp/outline.el index fa63fef66a4..59aeb233fdd 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -1,6 +1,6 @@ ;;; outline.el --- outline mode commands for Emacs -;; Copyright (C) 1986, 93, 94, 95, 97, 2000, 2001 +;; Copyright (C) 1986, 93, 94, 95, 97, 2000, 01, 2004 ;; Free Software Foundation, Inc. ;; Maintainer: FSF @@ -410,7 +410,8 @@ If INVISIBLE-OK is non-nil, an invisible heading line is ok too." (or (caar outline-heading-alist) "") (match-string 0))))) (unless (or (string-match "[ \t]\\'" head) - (not (string-match outline-regexp (concat head " ")))) + (not (string-match (concat "\\`\\(?:" outline-regexp "\\)") + (concat head " ")))) (setq head (concat head " "))) (unless (bolp) (end-of-line) (newline)) (insert head) @@ -486,7 +487,8 @@ in the region." ;; Bummer!! There is no lower heading in the buffer. ;; Let's try to invent one by repeating the first char. (let ((new-head (concat (substring head 0 1) head))) - (if (string-match (concat "\\`" outline-regexp) new-head) + (if (string-match (concat "\\`\\(?:" outline-regexp "\\)") + new-head) ;; Why bother checking that it is indeed lower level ? new-head ;; Didn't work: keep it as is so it's still a heading. @@ -557,7 +559,7 @@ the match data is set appropriately." (defun outline-move-subtree-down (&optional arg) "Move the currrent subtree down past ARG headlines of the same level." (interactive "p") - (let ((re (concat "^" outline-regexp)) + (let ((re (concat "^\\(?:" outline-regexp "\\)")) (movfunc (if (> arg 0) 'outline-get-next-sibling 'outline-get-last-sibling)) (ins-point (make-marker)) -- 2.39.2