Subject: bug#12774: RE: bug#12774: 24.2.50; EMACS 24.2.50.1 crashing

From: Vincent Belaïche <[email-masked]>
Date: Sun, 04 Nov 2012 09:52:02 +0100

> Date: Sun, 4 Nov 2012 05:46:16 +0200
> From: [email-masked]
> Subject: Re: RE: bug#12774: RE: bug#12774: 24.2.50; EMACS 24.2.50.1 crashing‏
> To: [email-masked]
> CC: [email-masked]
> 
> > From: Vincent Belaïche <[email-masked]>
> > Date: Sat, 3 Nov 2012 23:24:15 +0100
> > 
> > The crash can happen without my doing anything special previously except opening that attached file USING_CEDET_FROM_BZR which causes loading orgmode. Also it seems that it has to do with the size of my init.el file --- and not only to its content.
> > 
> > 
> > 
> > For instance there was in my init file some doit-1 function definition (which is some trash code which I wrote for some purpose and I don't need any longer), here is the definition:
> > 
> > 
> > (defun doit-1 ()
> > (interactive)
> > (save-excursion
> > ; (goto-char (point-min))
> > (while (re-search-forward "--\\|\\." nil t)
> > (when (save-match-data (texmathp))
> > (cond
> > ((string= (match-string 0) "--")
> > (replace-match "-"))
> > ((string= (match-string 0) ".")
> > (unless (looking-back "\\\\right")
> > (replace-match "\\cdot " t t))))))))
> > 
> > 
> > 
> > If I comment out this definition from the init file, then I cannot re-produce the crash (or at least I could not succeed in doing it, but it may still be possible), but if I let it, then I can rather easily make the crash occur. I cannot believe that this function per se is the root cause of the problem. However the simple fact that its definition takes some memory space suffices to increase the likelihood the crash when I open that file.
> 
> Is this doit-1 function actually used somewhere in your init.el or in
> your .emacs? If it is, can you show the code that uses it?
> 

No it is not used anywhere else, this is some leftover trash code...

> > BTW, here is the end of my *Message* buffer when the opening of USING_CEDET_FROM_BZR does cause any crash, this reflects what should happen when this file is visited --- the `Loading dired-x...done' is because I open USING_CEDET_FROM_BZR from a Dired buffer, so what happens is from line `flet' is an obsolete macro (as of 24.3); use either `cl-flet' or `cl-letf'. [2 times]. 
> > 
> > 
> > Loading dired-x...done
> > `flet' is an obsolete macro (as of 24.3); use either `cl-flet' or `cl-letf'. [2 times]
> > File mode specification error: (void-function org-mode-p)
> > Loading vc-bzr...done
> 
> Can you turn on debug-on-error and show the Lisp backtrace for these
> messages? Each time a backtrace appears, type "C-]" to get out of the
> debugger and continue to the next error.

For your information, to get the backtrace I had to open directly
USING_CEDET_FROM_BZR without going through Dired, because going through
Dired beforehand increases considerably the risk of trash.

When I did `C-]' I got again and again the same backtrace.

For your information also, I did not get any bracktrace for

 `flet' is an obsolete macro (as of 24.3); use either `cl-flet' or
 `cl-letf'

   Vincent.

Debugger entered--Lisp error: (void-function org-mode-p)
  (org-mode-p)
  (if (org-mode-p) (setq bl nil))
  (while bl (set-buffer (car (prog1 bl (setq bl (cdr bl))))) (if (org-mode-p) (setq bl nil)))
  (save-excursion (while bl (set-buffer (car (prog1 bl (setq bl (cdr bl))))) (if (org-mode-p) (setq bl nil))) (if (org-mode-p) (progn (easy-menu-change (quote ("Org")) "File List for Agenda" (append (list ["Edit File List" (org-edit-agenda-file-list) t] ["Add/Move Current File to Front of List" org-agenda-file-to-front t] ["Remove Current File from List" org-remove-file t] ["Cycle through agenda files" org-cycle-agenda-files t] ["Occur in all agenda files" org-occur-in-agenda-files t] "--") (mapcar (quote org-file-menu-entry) (org-agenda-files t)))))))
  (let ((bl (buffer-list))) (save-excursion (while bl (set-buffer (car (prog1 bl (setq bl (cdr bl))))) (if (org-mode-p) (setq bl nil))) (if (org-mode-p) (progn (easy-menu-change (quote ("Org")) "File List for Agenda" (append (list ["Edit File List" ... t] ["Add/Move Current File to Front of List" org-agenda-file-to-front t] ["Remove Current File from List" org-remove-file t] ["Cycle through agenda files" org-cycle-agenda-files t] ["Occur in all agenda files" org-occur-in-agenda-files t] "--") (mapcar (quote org-file-menu-entry) (org-agenda-files t))))))))
  org-install-agenda-files-menu()
  org-mode()
  set-auto-mode-0(org-mode nil)
  byte-code("\237\305\211\203/