GNU bug report logs - #62278
28.2; Outline in DocTeX mode

Previous Next

Package: emacs;

Reported by: Jan Braun <Jan.Braun <at> klein-gallien.org>

Date: Sun, 19 Mar 2023 18:15:02 UTC

Severity: normal

Tags: notabug

Found in version 28.2

Done: Arash Esbati <arash <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 62278 in the body.
You can then email your comments to 62278 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#62278; Package emacs. (Sun, 19 Mar 2023 18:15:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jan Braun <Jan.Braun <at> klein-gallien.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 19 Mar 2023 18:15:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jan Braun <Jan.Braun <at> klein-gallien.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.2; Outline in DocTeX mode
Date: Sun, 19 Mar 2023 18:36:03 +0100

In GNU Emacs 28.2 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G95))
of 2022-09-12 built on builder10-14.lan
Windowing system distributor 'Apple', version 10.3.2022
System Description:  macOS 11.6.5

Configured using:
'configure --with-ns '--enable-locallisppath=/Library/Application
Support/Emacs/${version}/site-lisp:/Library/Application
Support/Emacs/site-lisp' --with-modules'

Configured features:
ACL GMP GNUTLS JSON LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER THREADS
TOOLKIT_SCROLL_BARS ZLIB

Important settings:
  value of $LANG: de_DE.UTF-8
  locale-coding-system: utf-8-unix

Major mode: DocTeX

Minor modes in effect:
  outline-minor-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail
rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date subr-x
cl-extra shortdoc seq byte-opt gv bytecomp byte-compile cconv help-fns
radix-tree help-mode noutline outline vc-git diff-mode easy-mmode
vc-dispatcher cl-loaddefs cl-lib tex-mode compile text-property-search
shell pcomplete comint ansi-color ring latexenc iso-transl tooltip eldoc
paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode
mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads kqueue
cocoa ns multi-tty make-network-process emacs)

Memory information:
((conses 16 78100 5534)
(symbols 48 8402 1)
(strings 32 25935 1283)
(string-bytes 1 862544)
(vectors 16 16272)
(vector-slots 8 217529 12132)
(floats 8 74 51)
(intervals 56 1280 0)
(buffers 992 13))

When I start it as 'emacs -Q <file>.dtx‘ it opens the requested file in
DocTeX mode. 

Next I load 'outline-minor-mode‘.  If I than run the command
'outline-hide-body‘ I’d expect to be presented with the various
\section, \subsection, … commands.  But this does not happen. 

Instead the first meta comment, the documentclass command and the
document environment are displayed, see the text below.  Any other
sectioning command is hidden.

Thanks in advance.

   Jan
   
% \CheckSum{<CHECKSUM>}
% \iffalse meta-comment
%
% VHW -- Classes to write an article for the VHW Journal or to create the journal itself.
%
% Copyright (c) 2023 by Jan Braun
%
%  This program is free software: you can redistribute it and/or modify
%  it under the terms of the GNU General Public License as published by
%  the Free Software Foundation, either version 3 of the License, or
%  (at your option) any later version.
%
%  This program is distributed in the hope that it will be useful,
%  but WITHOUT ANY WARRANTY; without even the implied warranty of
%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%  GNU General Public License for more details.
%
%  You should have received a copy of the GNU General Public License
%  along with this program.  If not, see <http://www.gnu.org/licenses/>.  
%
% 
% \fi
% 
% \iffalse
%<*driver>
\documentclass[11pt, english, ngerman, draft]{l3doc}…
\begin{document}…
\end{document}…



-- 
Jan Braun (er/ihm)
Jan.Braun <at> klein-gallien.org


=== ypchsh /usr/local/bin/emacs === go FORTH now … ===





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62278; Package emacs. (Tue, 21 Mar 2023 07:45:01 GMT) Full text and rfc822 format available.

Message #8 received at 62278 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Jan Braun <Jan.Braun <at> klein-gallien.org>
Cc: 62278 <at> debbugs.gnu.org
Subject: Re: bug#62278: 28.2; Outline in DocTeX mode
Date: Tue, 21 Mar 2023 08:43:57 +0100
Jan Braun <Jan.Braun <at> klein-gallien.org> writes:

> When I start it as 'emacs -Q <file>.dtx‘ it opens the requested file in
> DocTeX mode. 
>
> Next I load 'outline-minor-mode‘.  If I than run the command
> 'outline-hide-body‘ I’d expect to be presented with the various
> \section, \subsection, … commands.  But this does not happen. 
>
> Instead the first meta comment, the documentclass command and the
> document environment are displayed, see the text below.  Any other
> sectioning command is hidden.

I'd say this is by design: `latex-outline-regexp' defined in tex-mode.el
doesn't cater for headings which start with '%', but in doctex mode,
almost all of them do so.  So you have to tell doctex about it with this
piece of code (which I haven't tested) in your init file:

(add-hook 'doctex-mode-hook
          (lambda ()
            (setq-local latex-outline-regexp
                        (concat "[% \t]*" "\\\\"
                                (regexp-opt
                                 (append latex-metasection-list
		                         (mapcar #'car latex-section-alist))
                                 t))))
          (setq-local outline-regexp latex-outline-regexp))

Best, Arash




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62278; Package emacs. (Tue, 21 Mar 2023 11:10:01 GMT) Full text and rfc822 format available.

Message #11 received at 62278 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Jan Braun <Jan.Braun <at> klein-gallien.org>
Cc: 62278 <at> debbugs.gnu.org
Subject: Re: bug#62278: 28.2; Outline in DocTeX mode
Date: Tue, 21 Mar 2023 12:09:08 +0100
Jan Braun <Jan.Braun <at> klein-gallien.org> writes:

>> Am 21.03.2023 um 08:43 schrieb Arash Esbati <arash <at> gnu.org>:
>> 
> Same applies to the \label comamnds, which won’t be found, when 
> inserting \ref commands.

How do you insert \ref's?  I'm not sure if the stock doctex-mode
provides completion support for \ref-\label insertion.

> It looks promising, but did not fully do the trick. :-(
>
> Emacs complains
> [...]

Do you byte compile your init file?  Maybe wrapping the whole thing
inside

(with-eval-after-load "tex-mode"
  (...))

helps.

Best, Arash




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62278; Package emacs. (Tue, 21 Mar 2023 11:43:02 GMT) Full text and rfc822 format available.

Message #14 received at 62278 <at> debbugs.gnu.org (full text, mbox):

From: Jan Braun <Jan.Braun <at> klein-gallien.org>
To: Arash Esbati <arash <at> gnu.org>
Cc: 62278 <at> debbugs.gnu.org
Subject: Re: bug#62278: 28.2; Outline in DocTeX mode
Date: Tue, 21 Mar 2023 09:45:07 +0100
Dear Arash,

thank you for your help.


> Am 21.03.2023 um 08:43 schrieb Arash Esbati <arash <at> gnu.org>:
> 
> I'd say this is by design: `latex-outline-regexp' defined in tex-mode.el
> doesn't cater for headings which start with '%', but in doctex mode,
> almost all of them do so.

I agree.

Same applies to the \label comamnds, which won’t be found, when 
inserting \ref commands.

> So you have to tell doctex about it with this
> piece of code (which I haven't tested) in your init file:

It looks promising, but did not fully do the trick. :-(

Emacs complains

Debugger entered--Lisp error: (void-variable latex-outline-regexp)
(set (make-local-variable 'outline-regexp) latex-outline-regexp)
(add-hook 'doctex-mode-hook #'(lambda nil (set (make-local-variable 'latex-outline-regexp) (concat "[% \11]*" "\\\\" (regexp-opt (append latex-metasection-list (mapcar ... latex-section-alist)) t)))) (set (make-local-variable 'outline-regexp) latex-outline-regexp))
eval-buffer(#<buffer  *load*> nil "/Users/tmjb/.emacs" nil t)  ; Reading at buffer position 30847
load-with-code-conversion("/Users/tmjb/.emacs" "/Users/tmjb/.emacs" t t)
load("~/.emacs" noerror nomessage)
startup--load-user-init-file(#f(compiled-function () #<bytecode -0x148e3df754d535f>) #f(compiled-function () #<bytecode -0x1f3c686ddc0d6275>) t)
command-line()
normal-top-level()

Do you have any further advice for me?

Sincerely

 Jan

-- 
Jan Braun (er/ihm)
Jan.Braun <at> klein-gallien.org


=== ypchsh /usr/local/bin/emacs === go FORTH now … ===





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62278; Package emacs. (Sat, 25 Mar 2023 12:29:02 GMT) Full text and rfc822 format available.

Message #17 received at 62278 <at> debbugs.gnu.org (full text, mbox):

From: Jan Braun <Jan.Braun <at> klein-gallien.org>
To: Arash Esbati <arash <at> gnu.org>
Cc: 62278 <at> debbugs.gnu.org
Subject: Re: bug#62278: 28.2; Outline in DocTeX mode
Date: Sat, 25 Mar 2023 08:08:20 +0100
Hello again,

Regarding my previous assumption:

> But even with this code added: we may have to dig deeper 
> into the problem?  Look, my actual (fith) DTX files looks
> somewhat similiar to this:
> 
> % \iffalse meta-comment
> % Real comment about the file and its purpose
> % ...
> % \fi
> %\iffalse
> %<driver>
> \documentclass[…]{…}
> \usepackage{…} % and other usual LaTeX preamble stuff
> \EnableCrossrefs
> \CodelineIndex
> \RecordChanges
> \setcounter{IndexColumns}{2}
> 
> \begin{document}
>  \DocInput{key-label.dtx}
> \end{document}
> %<driver>
> %/fi
> %
> % \changes{…} % lots of "TeXDoc preamble“ stuff
> % …
> %
> % \title{…}
> % \author{…}
> % \date{…}
> % \maketitle
> % … Rest of the LaTeX/DocTeX document body
> 
> Although I haven’t dived into the Outline code, maybe 
> Emacs sees \end{document} and stops folding there?  

I addd some DocTeX code into the document environment, like this:

% \iffalse meta-comment
% Real comment about the file and its purpose
% ...
% \fi
%\iffalse
%<driver>
\documentclass[…]{…}
\usepackage{…} % and other usual LaTeX preamble stuff
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\setcounter{IndexColumns}{2}

\begin{document}
 \DocInput{key-label.dtx}
% \sectio{…}
% \subsection{…}
\end{document}
%<driver>
%/fi

and it didn’t fold :-(

Sorry.

   Jan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62278; Package emacs. (Sat, 25 Mar 2023 15:53:01 GMT) Full text and rfc822 format available.

Message #20 received at 62278 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Jan Braun <Jan.Braun <at> klein-gallien.org>
Cc: 62278 <at> debbugs.gnu.org
Subject: Re: bug#62278: 28.2; Outline in DocTeX mode
Date: Sat, 25 Mar 2023 16:51:25 +0100
[Message part 1 (text/plain, inline)]
Jan Braun <Jan.Braun <at> klein-gallien.org> writes:

>> But even with this code added: we may have to dig deeper 
>> into the problem?

I think I had a typo in the code I suggested, it should read:

(with-eval-after-load "tex-mode"
  (add-hook 'doctex-mode-hook
            (lambda ()
              (setq-local latex-outline-regexp
                          (concat "[% \t]*" "\\\\"
                                  (regexp-opt
                                   (append latex-metasection-list
                                           (mapcar #'car latex-section-alist))
                                   t)))
	      (setq-local outline-regexp latex-outline-regexp))))

Now take a small example like this:

%\iffalse
%<*driver>
\documentclass{ltxdox}
\usepackage{microtype} % and other usual LaTeX preamble stuff
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\setcounter{IndexColumns}{2}
\begin{document}
\DocInput{jb-test.dtx}
\end{document}
%</driver>
%\fi
%
% \section{Introduction}
% This is some introduction.
%
% \section{User macros}
% This is some text.
% And this is some text
%
% \section{Implementation}
%
%    \begin{macrocode}
%<*package>
%    \end{macrocode}
%
%    \begin{macrocode}
\def\foo#1{%
  $#1$%
}
%    \end{macrocode}
%
%    \begin{macrocode}
%</package>
%    \end{macrocode}
%
%\endinput
% Local Variables:
% mode: doctex
% End:

When I start Emacs with 'emacs -Q', open the file above, do
'M-x outline-minor-mode RET' followed by 'C-c @ C-t', this is what I
see:
[outline.png (image/png, inline)]
[Message part 3 (text/plain, inline)]
Or do you expect something else?

Best, Arash

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62278; Package emacs. (Sat, 25 Mar 2023 21:37:02 GMT) Full text and rfc822 format available.

Message #23 received at 62278 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Jan Braun <Jan.Braun <at> klein-gallien.org>
Cc: 62278 <at> debbugs.gnu.org
Subject: Re: bug#62278: 28.2; Outline in DocTeX mode
Date: Sat, 25 Mar 2023 22:35:44 +0100
Jan Braun <Jan.Braun <at> klein-gallien.org> writes:

>  When I start Emacs with 'emacs -Q', open the file above, do
>  'M-x outline-minor-mode RET' followed by 'C-c @ C-t', this is what I
>  see:
>  <outline.png>
>  Or do you expect something else?
>
> No, no, this is exactly, what I would like to see and work on.  
>
> Unfortunately, I get this result:

I see that I missed to say that the exact steps were:

  • Start Emacs with 'emacs -Q'
  • Paste this code into scratch buffer and eval it (it is the same code
    as in my last message)

     (with-eval-after-load "tex-mode"
       (add-hook 'doctex-mode-hook
                 (lambda ()
                   (setq-local latex-outline-regexp
                               (concat "[% \t]*" "\\\\"
                                       (regexp-opt
                                        (append latex-metasection-list
                                                (mapcar #'car latex-section-alist))
                                        t)))
                   (setq-local outline-regexp latex-outline-regexp))))

  • Open the .dtx file in my other message
  • Do 'M-x outline-minor-mode RET'
  • Do 'C-c @ C-t'

This is with Emacs30 (997a8dbc48).  If this doesn't work for you, I'm
out of ideas.

Best, Arash




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62278; Package emacs. (Sat, 25 Mar 2023 22:17:02 GMT) Full text and rfc822 format available.

Message #26 received at 62278 <at> debbugs.gnu.org (full text, mbox):

From: Jan Braun <Jan.Braun <at> klein-gallien.org>
To: Arash Esbati <arash <at> gnu.org>
Cc: 62278 <at> debbugs.gnu.org
Subject: Re: bug#62278: 28.2; Outline in DocTeX mode
Date: Sat, 25 Mar 2023 19:00:52 +0100
[Message part 1 (text/plain, inline)]
Dear Arash,

thank you for ongoing, constant support! 

> Am 25.03.2023 um 16:51 schrieb Arash Esbati <arash <at> gnu.org>:
> 
> Jan Braun <Jan.Braun <at> klein-gallien.org> writes:
> 
>>> But even with this code added: we may have to dig deeper 
>>> into the problem?
> 
> I think I had a typo in the code I suggested, it should read:

Thanks, I corrected it, …

> Now take a small example like this:

OK.

> When I start Emacs with 'emacs -Q', open the file above, do
> 'M-x outline-minor-mode RET' followed by 'C-c @ C-t', this is what I
> see:
> <outline.png>
> Or do you expect something else?

No, no, this is exactly, what I would like to see and work on.  

Unfortunately, I get this result:


What a pitty! :-(

Bye

   Jan
[Message part 2 (text/html, inline)]
[doctex-outline.png (image/png, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62278; Package emacs. (Sun, 26 Mar 2023 08:11:02 GMT) Full text and rfc822 format available.

Message #29 received at 62278 <at> debbugs.gnu.org (full text, mbox):

From: Jan Braun <Jan.Braun <at> klein-gallien.org>
To: Arash Esbati <arash <at> gnu.org>
Cc: 62278 <at> debbugs.gnu.org
Subject: Re: bug#62278: 28.2; Outline in DocTeX mode
Date: Sun, 26 Mar 2023 09:55:20 +0200
Good morning Arash,


> Am 25.03.2023 um 22:35 schrieb Arash Esbati <arash <at> gnu.org>:

> I see that I missed to say that the exact steps were:

Done that and: eh voila: It worked on your example DTX file, as 
well as on my DTX files, I am actually working on.

Do you have any suggestions, how to make that code work 
automagically on Emacsens startup?

Bye

   Jan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62278; Package emacs. (Mon, 27 Mar 2023 07:51:02 GMT) Full text and rfc822 format available.

Message #32 received at 62278 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Jan Braun <Jan.Braun <at> klein-gallien.org>
Cc: 62278 <at> debbugs.gnu.org
Subject: Re: bug#62278: 28.2; Outline in DocTeX mode
Date: Mon, 27 Mar 2023 09:50:20 +0200
Jan Braun <Jan.Braun <at> klein-gallien.org> writes:

> Done that and: eh voila: It worked on your example DTX file, as 
> well as on my DTX files, I am actually working on.

Thanks for the confirmation.

> Do you have any suggestions, how to make that code work 
> automagically on Emacsens startup?

Add that lisp snippet to your init file and you should be fine.

Best, Arash




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62278; Package emacs. (Mon, 27 Mar 2023 10:15:02 GMT) Full text and rfc822 format available.

Message #35 received at 62278 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Jan Braun <Jan.Braun <at> klein-gallien.org>
Cc: 62278 <at> debbugs.gnu.org
Subject: Re: bug#62278: 28.2; Outline in DocTeX mode
Date: Mon, 27 Mar 2023 12:14:09 +0200
Jan Braun <Jan.Braun <at> klein-gallien.org> writes:

> Your fix only works in a plain Emacsen, being started without 
> any kind of init file. :-(
>
> So, in principle, your fix works, but not, if I place it in my 
> init file.

You mean putting this in your init file still throws an error?

  (with-eval-after-load "tex-mode"
    (add-hook 'doctex-mode-hook
              (lambda ()
                (setq-local latex-outline-regexp
                            (concat "[% \t]*" "\\\\"
                                    (regexp-opt
                                     (append latex-metasection-list
                                             (mapcar #'car latex-section-alist))
                                     t)))
                (setq-local outline-regexp latex-outline-regexp))))

Best, Arash




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62278; Package emacs. (Mon, 27 Mar 2023 13:15:06 GMT) Full text and rfc822 format available.

Message #38 received at 62278 <at> debbugs.gnu.org (full text, mbox):

From: Jan Braun <Jan.Braun <at> klein-gallien.org>
To: Arash Esbati <arash <at> gnu.org>
Cc: 62278 <at> debbugs.gnu.org
Subject: Re: bug#62278: 28.2; Outline in DocTeX mode
Date: Mon, 27 Mar 2023 11:58:50 +0200
Hi Arash,

> Am 27.03.2023 um 09:50 schrieb Arash Esbati <arash <at> gnu.org>:
> 
> Jan Braun <Jan.Braun <at> klein-gallien.org> writes:
> 
>> Done that and: eh voila: It worked on your example DTX file, as 
>> well as on my DTX files, I am actually working on.
> 
> Thanks for the confirmation.

You are more than welcome.

>> Do you have any suggestions, how to make that code work 
>> automagically on Emacsens startup?
> 
> Add that lisp snippet to your init file and you should be fine.

As you might remember: that was the starting point.  As I wrote 
in my message from 2023-03-12, 09:45

>> Emacs complains
>> 
>> Debugger entered--Lisp error: (void-variable latex-outline-regexp)
>> (set (make-local-variable 'outline-regexp) latex-outline-regexp)
>> (add-hook 'doctex-mode-hook #'(lambda nil (set (make-local-variable 'latex-outline-regexp) (concat "[% \11]*" "\\\\" (regexp-opt (append latex-metasection-list (mapcar ... latex-section-alist)) t)))) (set (make-local-variable 'outline-regexp) latex-outline-regexp))
>> eval-buffer(#<buffer  *load*> nil "/Users/tmjb/.emacs" nil t)  ; Reading at buffer position 30847
>> load-with-code-conversion("/Users/tmjb/.emacs" "/Users/tmjb/.emacs" t t)
>> load("~/.emacs" noerror nomessage)
>> startup--load-user-init-file(#f(compiled-function () #<bytecode -0x148e3df754d535f>) #f(compiled-function () #<bytecode -0x1f3c686ddc0d6275>) t)
>> command-line()
>> normal-top-level()

Your fix only works in a plain Emacsen, being started without 
any kind of init file. :-(

So, in principle, your fix works, but not, if I place it in my 
init file.

Bye

 Jan

-- 
Jan Braun (er/ihm)
Jan.Braun <at> klein-gallien.org


=== ypchsh /usr/local/bin/emacs === go FORTH now … ===





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62278; Package emacs. (Mon, 27 Mar 2023 15:45:03 GMT) Full text and rfc822 format available.

Message #41 received at 62278 <at> debbugs.gnu.org (full text, mbox):

From: Jan Braun <Jan.Braun <at> klein-gallien.org>
To: Arash Esbati <arash <at> gnu.org>
Cc: 62278 <at> debbugs.gnu.org
Subject: Re: bug#62278: 28.2; Outline in DocTeX mode
Date: Mon, 27 Mar 2023 15:34:48 +0200
Dear Arash,

thank you very much for your ongoing support. :+1:

> Am 27.03.2023 um 12:14 schrieb Arash Esbati <arash <at> gnu.org>:
> 
> Jan Braun <Jan.Braun <at> klein-gallien.org> writes:
> 
>> Your fix only works in a plain Emacsen, being started without 
>> any kind of init file. :-(
>> 
>> So, in principle, your fix works, but not, if I place it in my 
>> init file.
> 
> You mean putting this in your init file still throws an error?

No, it does not throw an error, but it is not folding properly.

 1) Starting emacs -Q, 
 2) inserting the fix into *scratch* buffer,
 3) M-X eval-last-sexp ==> gives no error.
 4) Loading an DocTeX file, 
 5) M-x outline-minor-mode  ==> gives no error
 6) C-c @ C-t ==> presents all sectioning commands in the buffer

Very well.

But including it into my ~/.emacs file and 
  1) Starting emacs 
  2) Loading DocTeX file
  3) Choosing Hide-Body from the Oultine Menu or
     Typing C-c @ C-t on the keyboard

will only show \documentclass, \begin and \end{document} and 
nothing in between :-(

I am still running GNU Emacs 28.2 (build 1, 
x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 
(Build 18G95)) of 2022-09-12

Any hints?

Sincerely

   Jan

-- 
Jan Braun (er/ihm)
Jan.Braun <at> klein-gallien.org


=== ypchsh /usr/local/bin/emacs === go FORTH now … ===





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62278; Package emacs. (Mon, 27 Mar 2023 17:50:02 GMT) Full text and rfc822 format available.

Message #44 received at 62278 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Jan Braun <Jan.Braun <at> klein-gallien.org>
Cc: 62278 <at> debbugs.gnu.org
Subject: Re: bug#62278: 28.2; Outline in DocTeX mode
Date: Mon, 27 Mar 2023 19:48:51 +0200
Jan Braun <Jan.Braun <at> klein-gallien.org> writes:

> But including it into my ~/.emacs file and 
>   1) Starting emacs 
>   2) Loading DocTeX file
>   3) Choosing Hide-Body from the Oultine Menu or
>      Typing C-c @ C-t on the keyboard
>
> will only show \documentclass, \begin and \end{document} and 
> nothing in between :-(

If the code works with 'emacs -Q' and not when in your init file, then
you have to bisect your init file.  My only guess is to check if you're
using AUCTeX instead of the built-in mode when you load your init file.

Best, Arash




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62278; Package emacs. (Tue, 28 Mar 2023 07:18:02 GMT) Full text and rfc822 format available.

Message #47 received at 62278 <at> debbugs.gnu.org (full text, mbox):

From: Jan Braun <Jan.Braun <at> klein-gallien.org>
To: Arash Esbati <arash <at> gnu.org>
Cc: 62278 <at> debbugs.gnu.org
Subject: Re: bug#62278: 28.2; Outline in DocTeX mode
Date: Tue, 28 Mar 2023 08:01:32 +0200
Good Morning Arash,


> Am 27.03.2023 um 19:48 schrieb Arash Esbati <arash <at> gnu.org>:

> If the code works with 'emacs -Q' and not when in your init file, then
> you have to bisect your init file.

I am sorry, but I only have a vague idea of what you mean with 
bisecting my input file.

I have tried to move your code up, so that it is the first 
code in my ~/.emacs file.  This didn’t change a thing.  Same
results as before.

(Same, if I make it the last code of my init file.)

> My only guess is to check if you’re using AUCTeX instead of the
> built-in mode when you load your init file.

What do you mean with „using AUCTeX instead of the built-in 
mode“?

What kind of check should I perform?

This are the essential lines of ~/.emacs:

;;; 
;;; AUCTeX (sometimes also called AUC-TeX) was developed at the
;;; Aalborg university in denmark.  It is a mighty mode to work with
;;; nearly any kind of TeX and LaTeX files.
(load "auctex.el" nil t t)
(require 'auctex-latexmk)
(auctex-latexmk-setup)

Therefore I guess, I am using AUCTeX?

Bye

  Jan

-- 
Jan Braun (er/ihm)
Jan.Braun <at> klein-gallien.org


=== ypchsh /usr/local/bin/emacs === go FORTH now … ===





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62278; Package emacs. (Tue, 28 Mar 2023 07:43:02 GMT) Full text and rfc822 format available.

Message #50 received at 62278 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Jan Braun <Jan.Braun <at> klein-gallien.org>
Cc: 62278 <at> debbugs.gnu.org
Subject: Re: bug#62278: 28.2; Outline in DocTeX mode
Date: Tue, 28 Mar 2023 09:42:33 +0200
Jan Braun <Jan.Braun <at> klein-gallien.org> writes:

> What do you mean with „using AUCTeX instead of the built-in 
> mode“?

I mean that there are at least 2 major modes for editing LaTeX/docTeX
files.  One of them is the one built in Emacs provided by this file:

  http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/textmodes/tex-mode.el

Another one is AUCTeX which you have to install yourself (since you're
on a mac, I assume you've installed yourself and pre-installed by a
distro).

> What kind of check should I perform?

I think the easiest way is to check the mode you're using with 'C-h m'.
If I open a .dtx file and hit 'C-h m', I see this because I'm using
AUCTeX:

  The major mode is docTeX/P mode defined in tex-mode.el:

  This function has :override advice: ‘TeX-doctex-mode’.

  This is an :override advice, which means that ‘doctex-mode’ isn’t
  run at all, and the documentation below may be irrelevant.
  [...]

When I start Emacs with the '-Q' switch, the same file reports:

  The major mode is DocTeX mode defined in tex-mode.el:

  Major mode to edit DocTeX files.

Because AUCTeX is not initialized and hence the built-in mode kicks in.

> This are the essential lines of ~/.emacs:
>
> ;;; 
> ;;; AUCTeX (sometimes also called AUC-TeX) was developed at the
> ;;; Aalborg university in denmark.  It is a mighty mode to work with
> ;;; nearly any kind of TeX and LaTeX files.
> (load "auctex.el" nil t t)
> (require 'auctex-latexmk)
> (auctex-latexmk-setup)
>
> Therefore I guess, I am using AUCTeX?

Yes, you are.  And if you have installed AUCTeX from ELPA (i.e. with M-x
list-packages), then you better drop the (load "auctex.el" nil t t)
line.

AUCTeX is a complete different beast w.r.t to outline-mode, so the code
I suggested cannot work when you use AUCTeX to edit a .dtx file.  I
suggest you close this report and open an AUCTeX feature request by
sending a message to bug-auctex <at> gnu.org.

Best, Arash




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62278; Package emacs. (Tue, 28 Mar 2023 08:35:02 GMT) Full text and rfc822 format available.

Message #53 received at 62278 <at> debbugs.gnu.org (full text, mbox):

From: Arash Esbati <arash <at> gnu.org>
To: Jan Braun <Jan.Braun <at> klein-gallien.org>
Cc: 62278 <at> debbugs.gnu.org
Subject: Re: bug#62278: 28.2; Outline in DocTeX mode
Date: Tue, 28 Mar 2023 10:33:56 +0200
tags 62278 notabug
close 62278
quit

Jan Braun <Jan.Braun <at> klein-gallien.org> writes:

> I’ll send a bug report to AUCTeX and this bug could be closed.

Done.

> I still learned some lessons here. :-)

👍

Best, Arash




Added tag(s) notabug. Request was from Arash Esbati <arash <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 28 Mar 2023 08:35:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 62278 <at> debbugs.gnu.org and Jan Braun <Jan.Braun <at> klein-gallien.org> Request was from Arash Esbati <arash <at> gnu.org> to control <at> debbugs.gnu.org. (Tue, 28 Mar 2023 08:35:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62278; Package emacs. (Tue, 28 Mar 2023 10:02:01 GMT) Full text and rfc822 format available.

Message #60 received at 62278 <at> debbugs.gnu.org (full text, mbox):

From: Jan Braun <Jan.Braun <at> klein-gallien.org>
To: Arash Esbati <arash <at> gnu.org>
Cc: 62278 <at> debbugs.gnu.org
Subject: Re: bug#62278: 28.2; Outline in DocTeX mode
Date: Tue, 28 Mar 2023 10:21:17 +0200
Hi Arash,


> Am 28.03.2023 um 09:42 schrieb Arash Esbati <arash <at> gnu.org>:
> 
> Jan Braun <Jan.Braun <at> klein-gallien.org> writes:

[…]

>> What kind of check should I perform?
> 
> I think the easiest way is to check the mode you're using with 'C-h m'.

I see nearly the same as you do:

docTeX/FP mode defined in ‘tex-mode.el’:
Major mode to edit DocTeX files.

This function has :override advice: ‘TeX-doctex-mode’.

> When I start Emacs with the '-Q' switch, the same file reports:
> […]
> Because AUCTeX is not initialized and hence the built-in mode kicks in.

Same here.

> […] I suggest you close this report

OK.  Thank you very much for your support.

I’ll send a bug report to AUCTeX and this bug could be closed.

I still learned some lessons here. :-)

Bye

  Jan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 25 Apr 2023 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 1 day ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.