From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tak Ota Newsgroups: gmane.emacs.devel Subject: Re: slow bibtex menu access Date: Fri, 18 Mar 2005 14:07:59 -0800 (PST) Organization: Sony Electronics Inc. Message-ID: <20050318.140759.207586777.Takaaki.Ota@am.sony.com> References: <20050314.091505.191467501.Takaaki.Ota@am.sony.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Fri_Mar_18_14_07_59_2005_959)--" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1111183963 1309 80.91.229.2 (18 Mar 2005 22:12:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 18 Mar 2005 22:12:43 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 18 23:12:42 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DCPgO-0002vy-0F for ged-emacs-devel@m.gmane.org; Fri, 18 Mar 2005 23:11:04 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DCPwx-0005PG-73 for ged-emacs-devel@m.gmane.org; Fri, 18 Mar 2005 17:28:11 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DCPwg-0005Nv-4r for emacs-devel@gnu.org; Fri, 18 Mar 2005 17:27:54 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DCPwd-0005MD-FL for emacs-devel@gnu.org; Fri, 18 Mar 2005 17:27:52 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DCPwd-0005MA-8S for emacs-devel@gnu.org; Fri, 18 Mar 2005 17:27:51 -0500 Original-Received: from [160.33.98.75] (helo=mail8.fw-bc.sony.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1DCPdT-0003J9-O3 for emacs-devel@gnu.org; Fri, 18 Mar 2005 17:08:04 -0500 Original-Received: from mail3.sjc.in.sel.sony.com (mail3.sjc.in.sel.sony.com [43.134.1.211]) by mail8.fw-bc.sony.com (8.12.11/8.12.11) with ESMTP id j2IM81ZU022341 for ; Fri, 18 Mar 2005 22:08:01 GMT Original-Received: from localhost (us00e098d0e811.am.sony.com [43.191.36.105]) by mail3.sjc.in.sel.sony.com (8.12.11/8.12.11) with ESMTP id j2IM800x025236 for ; Fri, 18 Mar 2005 22:08:00 GMT Original-To: emacs-devel@gnu.org In-Reply-To: <20050314.091505.191467501.Takaaki.Ota@am.sony.com> X-Telephone: +1-858-942-3239 X-Fax------: +1-858-942-9142 X-SnailMail: 16450 West Bernardo Drive MZ7205, San Diego, CA 92127-1804 X-Mailer: Mew-4.2.50 on Emacs-22.0.50.1 (i386-mingw-nt5.1.2600 built on 2005-03-03) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: news.gmane.org gmane.emacs.devel:34751 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34751 ----Next_Part(Fri_Mar_18_14_07_59_2005_959)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Attached is a bug fix. Could someone please check it in? Thank you. This is the third time I ask. -Tak Mon, 14 Mar 2005 09:15:05 -0800: "Ota, Takaaki" wrote: > If there is no objection to this patch could someone check it in > please. Thank you. > > -Tak > > Tue, 8 Mar 2005 14:56:51 -0800: "Ota, Takaaki" > wrote: > > > Stefan kindly informed me that table.el was slowing down menu > > operation considerably depending on buffer contents. The attached > > patch corrects this problem. Thanks Stefan. > > > > -Tak > > > > 2005-03-08 Takaaki Ota > > > > * textmodes/table.el (table--line-column-position): New idiom. > > (table--row-column-insertion-point-p): New function to test > > validity of row and column insertion operation at a location. > > (table-global-menu, table-cell-menu): Use above functions for > > deterministic test operation. > > (table--editable-cell-p): Behave in deterministic fashion. > > > > > > Sat, 5 Mar 2005 13:27:00 -0800: "Stefan Monnier" > > wrote: > > > > > The following message is a courtesy copy of an article > > > that has been posted to gnu.emacs.help as well. > > > > > > > Thank you, I'd forgotten that (haven't done it in a long time). So > I > > > found > > > > the problem, and it was table.el. I had (require 'table) and > > (require > > > > 'emacs-wiki-table) (the latter requires table.el) in a few places. > I > > > have > > > > no idea where and how table.el is causing the problem, but would > it > > be > > > > possible to turn it off (I guess a hook might do it) while in > > bibtex? > > > > Tables are not needed in bibtex anyway. > > > > > > Setting debug-on-quit and hitting C-g while the menu is being built > > > indicates that the time is actually spent in table--find-row-column. > > > > > > Looking some more at the table.el code, it seems there is a minor > > > logic-thinko bug in it. Can you try the patch below (it's against > the > > > Emacs-CVS version of table.el, so you may have to apply the patch by > > > hand). > > > > > > Tak, is my reasoning correct that `table--probe-cell' should return > > > non-nil > > > iff we're inside a table? > > > > > > > > > Stefan > > > > > > > > > --- orig/lisp/textmodes/table.el > > > +++ mod/lisp/textmodes/table.el > > > @@ -1025,13 +1025,13 @@ > > > :help "Insert a text based table at point"] > > > ["Row" table-insert-row > > > :active (and (not buffer-read-only) > > > - (or (table--probe-cell) > > > + (and (table--probe-cell) > > > (save-excursion > > > (table--find-row-column nil t)))) > > > :help "Insert row(s) of cells in table"] > > > ["Column" table-insert-column > > > :active (and (not buffer-read-only) > > > - (or (table--probe-cell) > > > + (and (table--probe-cell) > > > (save-excursion > > > (table--find-row-column 'column t)))) > > > :help "Insert column(s) of cells in table"]) > > > @@ -1077,13 +1077,13 @@ > > > ("Insert" > > > ["Row" table-insert-row > > > :active (and (not buffer-read-only) > > > - (or (table--probe-cell) > > > + (and (table--probe-cell) > > > (save-excursion > > > (table--find-row-column nil t)))) > > > :help "Insert row(s) of cells in table"] > > > ["Column" table-insert-column > > > :active (and (not buffer-read-only) > > > - (or (table--probe-cell) > > > + (and (table--probe-cell) > > > (save-excursion > > > (table--find-row-column 'column t)))) > > > :help "Insert column(s) of cells in table"]) ----Next_Part(Fri_Mar_18_14_07_59_2005_959)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="table.el.patch" *** table.el Fri Mar 18 13:50:13 2005 --- ../../../../d/pub/emacs/pure/emacs/lisp/textmodes/table.el Wed Feb 9 07:50:36 2005 *************** *** 1,11 **** ;;; table.el --- create and edit WYSIWYG text based embedded tables ! ;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. ;; Keywords: wp, convenience ;; Author: Takaaki Ota ;; Created: Sat Jul 08 2000 13:28:45 (PST) ! ;; Revised: Fri Mar 18 2005 13:50:13 (PST) ;; This file is part of GNU Emacs. --- 1,11 ---- ;;; table.el --- create and edit WYSIWYG text based embedded tables ! ;; Copyright (C) 2000, 01, 02, 03, 04 Free Software Foundation, Inc. ;; Keywords: wp, convenience ;; Author: Takaaki Ota ;; Created: Sat Jul 08 2000 13:28:45 (PST) ! ;; Revised: Tue Jun 01 2004 11:36:39 (PDT) ;; This file is part of GNU Emacs. *************** *** 1024,1033 **** :active (and (not buffer-read-only) (not (table--probe-cell))) :help "Insert a text based table at point"] ["Row" table-insert-row ! :active (table--row-column-insertion-point-p) :help "Insert row(s) of cells in table"] ["Column" table-insert-column ! :active (table--row-column-insertion-point-p 'column) :help "Insert column(s) of cells in table"]) "----" ("Recognize" --- 1024,1039 ---- :active (and (not buffer-read-only) (not (table--probe-cell))) :help "Insert a text based table at point"] ["Row" table-insert-row ! :active (and (not buffer-read-only) ! (or (table--probe-cell) ! (save-excursion ! (table--find-row-column nil t)))) :help "Insert row(s) of cells in table"] ["Column" table-insert-column ! :active (and (not buffer-read-only) ! (or (table--probe-cell) ! (save-excursion ! (table--find-row-column 'column t)))) :help "Insert column(s) of cells in table"]) "----" ("Recognize" *************** *** 1070,1079 **** '("Table" ("Insert" ["Row" table-insert-row ! :active (table--row-column-insertion-point-p) :help "Insert row(s) of cells in table"] ["Column" table-insert-column ! :active (table--row-column-insertion-point-p 'column) :help "Insert column(s) of cells in table"]) ("Delete" ["Row" table-delete-row --- 1076,1091 ---- '("Table" ("Insert" ["Row" table-insert-row ! :active (and (not buffer-read-only) ! (or (table--probe-cell) ! (save-excursion ! (table--find-row-column nil t)))) :help "Insert row(s) of cells in table"] ["Column" table-insert-column ! :active (and (not buffer-read-only) ! (or (table--probe-cell) ! (save-excursion ! (table--find-row-column 'column t)))) :help "Insert column(s) of cells in table"]) ("Delete" ["Row" table-delete-row *************** *** 4686,4715 **** (setq multiplier (1- multiplier))) ret-str)) - (defun table--line-column-position (line column) - "Return the location of LINE forward at COLUMN." - (save-excursion - (forward-line line) - (move-to-column column) - (point))) - - (defun table--row-column-insertion-point-p (&optional columnp) - "Return non nil if it makes sense to insert a row or a column at point." - (and (not buffer-read-only) - (or (get-text-property (point) 'table-cell) - (let ((column (current-column))) - (if columnp - (or (text-property-any (line-beginning-position 0) - (table--line-column-position -1 column) - 'table-cell t) - (text-property-any (line-beginning-position) (point) 'table-cell t) - (text-property-any (line-beginning-position 2) - (table--line-column-position 1 column) - 'table-cell t)) - (text-property-any (table--line-column-position -2 column) - (table--line-column-position -2 (+ 2 column)) - 'table-cell t)))))) - (defun table--find-row-column (&optional columnp no-error) "Search table and return a cell coordinate list of row or column." (let ((current-coordinate (table--get-coordinate))) --- 4698,4703 ---- *************** *** 5148,5154 **** (defun table--editable-cell-p (&optional abort-on-error) (and (not buffer-read-only) ! (get-text-property (point) 'table-cell))) (defun table--probe-cell (&optional abort-on-error) "Probes a table cell around the point. --- 5136,5142 ---- (defun table--editable-cell-p (&optional abort-on-error) (and (not buffer-read-only) ! (table--probe-cell abort-on-error))) (defun table--probe-cell (&optional abort-on-error) "Probes a table cell around the point. ----Next_Part(Fri_Mar_18_14_07_59_2005_959)-- Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel ----Next_Part(Fri_Mar_18_14_07_59_2005_959)----