emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: table-recognize and default-major-mode


From: Roland Winkler
Subject: Re: table-recognize and default-major-mode
Date: Sun, 31 Jul 2005 19:20:09 +0200

On Fri Jul 29 2005 Richard M. Stallman wrote:
> This is a patch I am thinking of installing.  Does it fix this
> problem?

No, unfortunately it does not fix the problem.

Up to now I had overlooked that table-recognize actually issues a
message in the message area "Recognizing tables...done". This
message is always issued when I load a file, suggesting that this
function is always evaluated. But somehow, table-recognize has no
effect. All this does not depend on whether your patch is installed
or not.

To give a more specific example, I have attached below a table taken
from table.el. Put this table into two files, one named `table' (no
extension), the other one named `table.txt'.

My problem occurs when `emacs --no-init-file' is
initialized with

(setq default-major-mode 'text-mode)
(require 'table)
(add-hook 'text-mode-hook 'table-recognize)

When I visit the file `table', I get one message

  Recognizing tables...done

However, the table is not recognized.
When I visit the file `table.txt', I get two messages

  Recognizing tables...(4%)
  Recognizing tables...done

In this case, the table is correctly recognized. Apparently,
table-recognize sees the buffer content differently depending on how
text-mode is invoked.

Roland


cat > table <<EOF
;; Following is a table of entry points and brief description of each
;; of them.  The tables below are of course generated and edited by
;; using this package.  Not all the commands are bound to keys.  Many
;; of them must be invoked by "M-x" (`execute-extended-command')
;; command.  Refer to the section "Keymap" below for the commands
;; available from keys.
;;
;; +------------------------------------------------------------------+
;; |                    User Visible Entry Points                     |
;; +-------------------------------+----------------------------------+
;; |           Function            |           Description            |
;; +-------------------------------+----------------------------------+
;; |`table-insert'                 |Insert a table consisting of grid |
;; |                               |of cells by specifying the number |
;; |                               |of COLUMNS, number of ROWS, cell  |
;; |                               |WIDTH and cell HEIGHT.            |
;; +-------------------------------+----------------------------------+
;; |`table-insert-row'             |Insert row(s) of cells before the |
;; |                               |current row that matches the      |
;; |                               |current row structure.            |
;; +-------------------------------+----------------------------------+
;; |`table-insert-column'          |Insert column(s) of cells before  |
;; |                               |the current column that matches   |
;; |                               |the current column structure.     |
;; +-------------------------------+----------------------------------+
;; |`table-delete-row'             |Delete row(s) of cells.  The row  |
;; |                               |must consist from cells of the    |
;; |                               |same height.                      |
;; +-------------------------------+----------------------------------+
;; |`table-delete-column'          |Delete column(s) of cells.  The   |
;; |                               |column must consist from cells of |
;; |                               |the same width.                   |
;; +-------------------------------+----------------------------------+
;; |`table-recognize'              |Recognize all tables in the       |
;; |`table-unrecognize'            |current buffer and                |
;; |                               |activate/inactivate them.         |
;; +-------------------------------+----------------------------------+
;; |`table-recognize-region'       |Recognize all the cells in a      |
;; |`table-unrecognize-region'     |region and activate/inactivate    |
;; |                               |them.                             |
;; +-------------------------------+----------------------------------+
;; |`table-recognize-table'        |Recognize all the cells in a      |
;; |`table-unrecognize-table'      |single table and                  |
;; |                               |activate/inactivate them.         |
;; +-------------------------------+----------------------------------+
;; |`table-recognize-cell'         |Recognize a cell.  Find a cell    |
;; |`table-unrecognize-cell'       |which contains the current point  |
;; |                               |and activate/inactivate that cell.|
;; +-------------------------------+----------------------------------+
;; |`table-forward-cell'           |Move point to the next Nth cell in|
;; |                               |a table.                          |
;; +-------------------------------+----------------------------------+
;; |`table-backward-cell'          |Move point to the previous Nth    |
;; |                               |cell in a table.                  |
;; +-------------------------------+----------------------------------+
;; |`table-span-cell'              |Span the current cell toward the  |
;; |                               |specified direction and merge it  |
;; |                               |with the adjacent cell.  The      |
;; |                               |direction is right, left, above or|
;; |                               |below.                            |
;; +-------------------------------+----------------------------------+
;; |`table-split-cell-vertically'  |Split the current cell vertically |
;; |                               |and create a cell above and a cell|
;; |                               |below the point location.         |
;; +-------------------------------+----------------------------------+
;; |`table-split-cell-horizontally'|Split the current cell            |
;; |                               |horizontally and create a cell on |
;; |                               |the left and a cell on the right  |
;; |                               |of the point location.            |
;; +-------------------------------+----------------------------------+
;; |`table-split-cell'             |Split the current cell vertically |
;; |                               |or horizontally.  This is a       |
;; |                               |wrapper command to the other two  |
;; |                               |orientation specific commands.    |
;; +-------------------------------+----------------------------------+
;; |`table-heighten-cell'          |Heighten the current cell.        |
;; +-------------------------------+----------------------------------+
;; |`table-shorten-cell'           |Shorten the current cell.         |
;; +-------------------------------+----------------------------------+
;; |`table-widen-cell'             |Widen the current cell.           |
;; +-------------------------------+----------------------------------+
;; |`table-narrow-cell'            |Narrow the current cell.          |
;; +-------------------------------+----------------------------------+
;; |`table-fixed-width-mode'       |Toggle fixed width mode.  In the  |
;; |                               |fixed width mode, typing inside a |
;; |                               |cell never changes the cell width,|
;; |                               |while in the normal mode the cell |
;; |                               |width expands automatically in    |
;; |                               |order to prevent a word being     |
;; |                               |folded into multiple lines.  Fixed|
;; |                               |width mode reverses video or      |
;; |                               |underline the cell contents for   |
;; |                               |its indication.                   |
;; +-------------------------------+----------------------------------+
;; |`table-query-dimension'        |Compute and report the current    |
;; |                               |cell dimension, current table     |
;; |                               |dimension and the number of       |
;; |                               |columns and rows in the table.    |
;; +-------------------------------+----------------------------------+
;; |`table-generate-source'        |Generate the source of the current|
;; |                               |table in the specified language   |
;; |                               |and insert it into a specified    |
;; |                               |buffer.                           |
;; +-------------------------------+----------------------------------+
;; |`table-insert-sequence'        |Travel cells forward while        |
;; |                               |inserting a specified sequence    |
;; |                               |string into each cell.            |
;; +-------------------------------+----------------------------------+
;; |`table-capture'                |Convert plain text into a table by|
;; |                               |capturing the text in the region. |
;; +-------------------------------+----------------------------------+
;; |`table-release'                |Convert a table into plain text by|
;; |                               |removing the frame from a table.  |
;; +-------------------------------+----------------------------------+
;; |`table-justify'                |Justify the contents of cell(s).  |
;; +-------------------------------+----------------------------------+
EOF




reply via email to

[Prev in Thread] Current Thread [Next in Thread]