From mboxrd@z Thu Jan 1 00:00:00 1970 From: York Zhao Subject: Re: commit 5ea0228 has problem opening big org-mode file Date: Mon, 25 Nov 2013 20:38:12 -0500 Message-ID: References: <871u255cla.fsf@gmail.com> <878uwcbes9.fsf@alphaville.bos.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vl7bT-00072j-LA for emacs-orgmode@gnu.org; Mon, 25 Nov 2013 20:38:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vl7bR-0000r1-K1 for emacs-orgmode@gnu.org; Mon, 25 Nov 2013 20:38:15 -0500 Received: from mail-vc0-x22a.google.com ([2607:f8b0:400c:c03::22a]:50124) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vl7bR-0000qi-C4 for emacs-orgmode@gnu.org; Mon, 25 Nov 2013 20:38:13 -0500 Received: by mail-vc0-f170.google.com with SMTP id ht10so3477584vcb.29 for ; Mon, 25 Nov 2013 17:38:12 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Thomas S. Dye" Cc: Nick Dokos , emacs-orgmode 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 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 wrote: >> Nick Dokos 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 >>