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"])