emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Several outline-promote bugs


From: Matthieu Moy
Subject: Several outline-promote bugs
Date: Tue, 23 Aug 2005 00:43:19 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

I'm trying to use outline-{promote|demote} with auctex. It works very
badly:

Here's a test file:

,----
| \section{sec}
| text
| \subsection{subsec}
| other text
`----

Putting my cursor on the first line, and running M-x outline-promote
RET, I get this

,----
| \section{sec}
| text
| \section{subsec}
| other text
`----

While I expected this:

,----
| \part{sec}
| text
| \section{subsec}
| other text
`----

Now, I add an empty line at the beginning of the file:

,----
| 
| \section{sec}
| text
| \subsection{subsec}
| other text
`----

and, with the cursor on the second line, M-x outline-promote RET. I
get an error "Unrecognized header". After debugging a bit, this
appears to be because `outline-level' is called with the cursor on the
first, empty line.

The problematic call is in `outline-up-heading' (comments added by
me):

(defun outline-up-heading (arg &optional invisible-ok)
  "Move to the visible heading line of which the present line is a subheading.
With argument, move up ARG levels.
If INVISIBLE-OK is non-nil, also consider invisible lines."
  (interactive "p")
  (and (eq this-command 'outline-up-heading)
       (or (eq last-command 'outline-up-heading) (push-mark)))
  (outline-back-to-heading invisible-ok)
  (let ((start-level (funcall outline-level)))
    (if (eq start-level 1)
        (error "Already at top level of the outline"))
    (while (and (> start-level 1) (> arg 0) (not (bobp)))
      (let ((level start-level))
        (while (not (or (< level start-level) (bobp)))
          (if invisible-ok
              (outline-previous-heading) ;;;;; <--------- this causes
                                         ;;;;; the cursor to go to the
                                         ;;;;; first, empty line
            (outline-previous-visible-heading 1))
          (setq level (funcall outline-level))) ;;;;;;;;;; <------ This one.
        (setq start-level level))
      (setq arg (- arg 1))))
  (looking-at outline-regexp))

I didn't find obvious bug in auctex. The function LaTeX-outline-level
does what it's supposed to do, so I think the bugs are in outline.el.


In GNU Emacs 22.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.6.4)
 of 2005-08-15 on ecrins
configured using `configure '--with-gtk' '--with-png' '--with-gif' 
'--with-tiff' '--with-jpeg' '--with-xpm' '--prefix=/home/moy/local/usr''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: fr_FR
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  locale-coding-system: iso-latin-1
  default-enable-multibyte-characters: t

Major mode: LaTeX

Minor modes in effect:
  flyspell-mode: t
  reftex-mode: t
  outline-minor-mode: t
  recentf-mode: t
  which-function-mode: t
  show-paren-mode: t
  icomplete-mode: t
  auto-image-file-mode: t
  encoded-kbd-mode: t
  auto-compression-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  unify-8859-on-decoding-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  column-number-mode: t
  line-number-mode: t
  next-error-follow-minor-mode:  Fol

Recent input:
ESC [ A RET C-_ ESC x ESC [ A ESC [ C ESC [ C ESC [ 
C ESC [ C ESC [ C ESC [ C ESC [ C ESC [ C ESC [ C ESC 
[ C ESC [ C ESC [ D ESC [ D ESC [ D d e n DEL m C-d 
C-d C-d C-d RET ESC x ESC [ A RET ESC x ESC [ A RET 
ESC x ESC [ A RET ESC x r e p o r TAB C-g ESC x r e 
p o TAB r t TAB RET

Recent messages:
end while Tex-look-at nil
Tex-look-at (("part" 0) ("chapter" 1) ("section" 2) ("subsection" 3) 
("subsubsection" 4) ("paragraph" 5) ("subparagraph" 6))
xtla: Current-line(18)=\[_]section{sec3}
end while Tex-look-at (("section" 2) ("subsection" 3) ("subsubsection" 4) 
("paragraph" 5) ("subparagraph" 6))
Tex-look-at (("part" 0) ("chapter" 1) ("section" 2) ("subsection" 3) 
("subsubsection" 4) ("paragraph" 5) ("subparagraph" 6))
xtla: Current-line(18)=\[_]section{sec3}
end while Tex-look-at (("section" 2) ("subsection" 3) ("subsubsection" 4) 
("paragraph" 5) ("subparagraph" 6))
Quit
Making completion list...
Loading emacsbug...done

-- 
Matthieu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]