OK, finally I was able to reproduce the problem with a minimal setup. First goes .emacs file:
--8<---------------cut here---------------start------------->8--- (add-to-list 'load-path "path/to/org-mode") (add-to-list 'load-path "path/to/org-mode/lisp") ; this line is the key (add-to-list 'load-path "path/to/yhj-mode") (require 'yhj-mode) --8<---------------cut here---------------end--------------->8--- Second goes yhj-mode.el: --8<---------------cut here---------------start------------->8--- (require 'org) (define-derived-mode yhj-mode org-mode "yhj") (provide 'yhj-mode) --8<---------------cut here---------------end--------------->8--- Finally, file test.yz: --8<---------------cut here---------------start------------->8--- # -*- mode:yhj -*- --8<---------------cut here---------------end--------------->8--- Open file "test.yz" and note the comment line not fortified, open "*message*" buffer and note the following error: File local-variables error: (error "Lisp nesting exceeds `max-lisp-eval-depth'") There are three keys to reproduce, first, you have to make two files, .emacs and "yhj-mode.el". Second, this line must be present: (add-to-list 'load-path "path/to/org-mode/lisp") ; this line is the key Third, file "yhj-mode.el" has to be byte-compiled. York On Mon, Nov 25, 2013 at 5:39 PM, York Zhao <gtdplatf...@gmail.com> wrote: > Oop, I didn't know that I replied to Nicolas instead of to the list because I > hitted "reply" instead of "reply all". So I'm reposting my previous post to > the > list. Here we go: > > In my previous post I actually meant to say that I set `debug-on-quit', have > no > idea why I did `debug-on-error'. But anyways, I'm now pretty sure it was > commit > "5ea0228" that causes problem because the moment I deleted the last two lines > in > (define-derived-mode org-mode outline-mode "Org") everything worked fine. > Demonstrated below: > > (define-derived-mode org-mode outline-mode "Org" > ... > ;; Delete these two lines and everything worked. > (report-errors "File local-variables error: %s" > (hack-local-variables)) > ) > > Also, I figured out that it was my major mode that derived from `org-mode' > didn't work, and the buffer showed in org-mode, instead of my derived mode. > But > my mode is as simple as: > > (define-derived-mode yhj-mode org-mode "yhj" > ) > > With some special key bindings specific to my file that is opened in > `yhj-mode'. > > By the way, I had toggled `debug-on-quit', but made no difference when I hit > C-g. > > > Thanks, > > York > > On Mon, Nov 25, 2013 at 2:26 PM, Thomas S. Dye <t...@tsdye.com> wrote: >> Nick Dokos <ndo...@gmail.com> writes: >> >>> It may be that hack-local-variables takes a long time to process a large >>> file, although I don't think so: iirc, it limits itself to a tail of the >>> file of a given size, or the last "page" of the file (demarcated by ^L), >>> whichever is smaller. >> >> Hi Nick, >> >> I haven't noticed any slowdown or hangs since hack-local-variables was >> introduced. >> >> I have noticed that I need to answer the query about loading file local >> variables twice: >> >> Please type y, n, or !, or C-v to scroll: y [2 times] >> >> The first y has no apparent effect (except to make the second y >> effective). >> >> hth, >> Tom >> >> -- >> Thomas S. Dye >> http://www.tsdye.com >>