From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Furna's fisheye minor mode Date: 20 Jan 2004 11:29:35 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <400D4271.6070602@tml.hut.fi> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1074617953 14978 80.91.224.253 (20 Jan 2004 16:59:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 20 Jan 2004 16:59:13 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Jan 20 17:59:06 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AizDW-0000YK-00 for ; Tue, 20 Jan 2004 17:59:06 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AizDV-0006iD-00 for ; Tue, 20 Jan 2004 17:59:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Aiz6M-0001uh-N9 for emacs-devel@quimby.gnus.org; Tue, 20 Jan 2004 11:51:42 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Aiz2d-0000yk-5t for emacs-devel@gnu.org; Tue, 20 Jan 2004 11:47:51 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Aiyl3-0004Bc-Ep for emacs-devel@gnu.org; Tue, 20 Jan 2004 11:30:13 -0500 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Aiyl2-0004B7-TI for emacs-devel@gnu.org; Tue, 20 Jan 2004 11:29:41 -0500 Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id EF40821012; Tue, 20 Jan 2004 11:29:35 -0500 (EST) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 9A8008C6F3; Tue, 20 Jan 2004 11:29:35 -0500 (EST) Original-To: Juha Vierinen In-Reply-To: <400D4271.6070602@tml.hut.fi> Original-Lines: 41 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=0, requis 5) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:19356 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:19356 > I have attached a minor mode for emacs 21 that dynamically filters out stuff > that is indented. It is a bit similar to hideshow, hidelines and outline, > but it works on the indentation level instead of the semantics of some > programming language. Setting outline-regexp to "[ \t]*" does "the same", so I expect there are other differences (just like there are differences between hs-minor-mode, outline-minor-mode, as well as umpteen other variants). Could you describe what your mode does to make it easier to understand your code? Most interesting would be to know "what does the user have to do to hide/unhide parts of the text and to tell which parts to hide/unhide". > The mode is slow with very large files, I suppose it's slow because you use line-counts rather than buffer positions. I recommend you begin by removing fisheye-count-lines and figure out how to get your code working again without using it. That'll speed it up tremendously. > because I couldn't figure out how to check if the point is in the visible > region of the buffer. How about using overlays-at and check whether one of the overlays at point belongs to fisheye ? > Also, the only way I could detect that the point had moved was by saving > the point position and checking if it has changed in the > post-command-hook. Why do you need to detect it ? Do you automatically hide/unhide parts of the buffer based on the user's movement (like reveal-mode does) ? > The question is, what is the right way to check that the point has moved? Using post-command-hook sounds about right. In many cases you can try to answer "why do I need to know whether point has moved" in order to avoid having to answer the first question, tho. Stefan