diff options
| author | Stefan Monnier | 2005-03-18 23:17:34 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2005-03-18 23:17:34 +0000 |
| commit | 951f97e67d904729032b476caf5f7c2e7e303d73 (patch) | |
| tree | 331bc0a56362f7e34790bdf72ccb3a45154fe58f | |
| parent | 9188be47894513f5bb58b58ed619d9f5de14ec38 (diff) | |
| download | emacs-951f97e67d904729032b476caf5f7c2e7e303d73.tar.gz emacs-951f97e67d904729032b476caf5f7c2e7e303d73.zip | |
(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.
| -rw-r--r-- | lisp/ChangeLog | 25 | ||||
| -rw-r--r-- | lisp/textmodes/table.el | 53 |
2 files changed, 49 insertions, 29 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6a005871549..43dc9d7bfbc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2005-03-18 Tak Ota <Takaaki.Ota@am.sony.com> | ||
| 2 | |||
| 3 | * textmodes/table.el (table--line-column-position): New idiom. | ||
| 4 | (table--row-column-insertion-point-p): New function to test | ||
| 5 | validity of row and column insertion operation at a location. | ||
| 6 | (table-global-menu, table-cell-menu): Use above functions for | ||
| 7 | deterministic test operation. | ||
| 8 | (table--editable-cell-p): Behave in deterministic fashion. | ||
| 9 | |||
| 1 | 2005-03-18 Juri Linkov <juri@jurta.org> | 10 | 2005-03-18 Juri Linkov <juri@jurta.org> |
| 2 | 11 | ||
| 3 | * isearch.el (isearch-lazy-highlight-new-loop): | 12 | * isearch.el (isearch-lazy-highlight-new-loop): |
| @@ -7,8 +16,8 @@ | |||
| 7 | (isearch-lazy-highlight-search): Let-bind case-fold-search to | 16 | (isearch-lazy-highlight-search): Let-bind case-fold-search to |
| 8 | isearch-lazy-highlight-case-fold-search instead of | 17 | isearch-lazy-highlight-case-fold-search instead of |
| 9 | isearch-case-fold-search, and let-bind isearch-regexp to | 18 | isearch-case-fold-search, and let-bind isearch-regexp to |
| 10 | isearch-lazy-highlight-regexp. Use | 19 | isearch-lazy-highlight-regexp. |
| 11 | isearch-lazy-highlight-last-string instead of isearch-string. | 20 | Use isearch-lazy-highlight-last-string instead of isearch-string. |
| 12 | 21 | ||
| 13 | * replace.el (perform-replace): Remove bindings of global | 22 | * replace.el (perform-replace): Remove bindings of global |
| 14 | variables isearch-string, isearch-regexp, isearch-case-fold-search. | 23 | variables isearch-string, isearch-regexp, isearch-case-fold-search. |
| @@ -16,7 +25,7 @@ | |||
| 16 | (replace-highlight): Add arguments string, regexp, case-fold. | 25 | (replace-highlight): Add arguments string, regexp, case-fold. |
| 17 | Let-bind isearch-string, isearch-regexp, isearch-case-fold-search | 26 | Let-bind isearch-string, isearch-regexp, isearch-case-fold-search |
| 18 | to allow isearch-lazy-highlight-new-loop to use these values | 27 | to allow isearch-lazy-highlight-new-loop to use these values |
| 19 | to set corresponding isearch-lazy-highlight-... internal | 28 | to set corresponding isearch-lazy-highlight-* internal |
| 20 | variables whose values lazy highlighting will use regardless of | 29 | variables whose values lazy highlighting will use regardless of |
| 21 | changes to global variables isearch-string, isearch-regexp, | 30 | changes to global variables isearch-string, isearch-regexp, |
| 22 | isearch-case-fold-search during lazy highlighting loop. | 31 | isearch-case-fold-search during lazy highlighting loop. |
| @@ -41,13 +50,13 @@ | |||
| 41 | * isearch.el (lazy-highlight-cleanup) <command>: Rename from | 50 | * isearch.el (lazy-highlight-cleanup) <command>: Rename from |
| 42 | `isearch-lazy-highlight-cleanup', add alias to old name and | 51 | `isearch-lazy-highlight-cleanup', add alias to old name and |
| 43 | declare obsolete. Add release numbers to other obsolete vars. | 52 | declare obsolete. Add release numbers to other obsolete vars. |
| 44 | (isearch-done, isearch-lazy-highlight-new-loop): Rename | 53 | (isearch-done, isearch-lazy-highlight-new-loop): |
| 45 | `isearch-lazy-highlight-cleanup' to `lazy-highlight-cleanup'. | 54 | Rename `isearch-lazy-highlight-cleanup' to `lazy-highlight-cleanup'. |
| 46 | (lazy-highlight-cleanup) <variable>: Doc fix. | 55 | (lazy-highlight-cleanup) <variable>: Doc fix. |
| 47 | (isearch-lazy-highlight-update): Rename obsolete | 56 | (isearch-lazy-highlight-update): Rename obsolete |
| 48 | `isearch-lazy-highlight-face' to `lazy-highlight-face'. | 57 | `isearch-lazy-highlight-face' to `lazy-highlight-face'. |
| 49 | 58 | ||
| 50 | 2005-03-18 handa <handa@m17n.org> | 59 | 2005-03-18 Kenichi Handa <handa@m17n.org> |
| 51 | 60 | ||
| 52 | * language/thai-util.el: Fix categorization of Thai characters in | 61 | * language/thai-util.el: Fix categorization of Thai characters in |
| 53 | thai-category-table. | 62 | thai-category-table. |
| @@ -74,7 +83,7 @@ | |||
| 74 | (rmail-pop-password-required, rmail-remote-password): Doc fixes. | 83 | (rmail-pop-password-required, rmail-remote-password): Doc fixes. |
| 75 | (rmail-preserve-inbox, rmail-probe, rmail-autodetect): Doc fix. | 84 | (rmail-preserve-inbox, rmail-probe, rmail-autodetect): Doc fix. |
| 76 | 85 | ||
| 77 | * mail/sendmail.el (sendmail-send-it): Reenaable the code | 86 | * mail/sendmail.el (sendmail-send-it): Reenable the code |
| 78 | to compute resend-to-address and use it. | 87 | to compute resend-to-address and use it. |
| 79 | 88 | ||
| 80 | * tar-mode.el (tar-mode): Turn off undo unconditionally. | 89 | * tar-mode.el (tar-mode): Turn off undo unconditionally. |
| @@ -89,8 +98,6 @@ | |||
| 89 | * bindings.el (esc-map): Make M-g a prefix. | 98 | * bindings.el (esc-map): Make M-g a prefix. |
| 90 | Bind M-g g and M-g M-g to goto-line. | 99 | Bind M-g g and M-g M-g to goto-line. |
| 91 | 100 | ||
| 92 | * progmodes/perl-mode.el (perl-mode): Use run-mode-hooks. | ||
| 93 | |||
| 94 | * faces.el (face-id): Doc fix. | 101 | * faces.el (face-id): Doc fix. |
| 95 | 102 | ||
| 96 | 2005-03-17 Frederik Fouvry <fouvry@CoLi.Uni-SB.DE> | 103 | 2005-03-17 Frederik Fouvry <fouvry@CoLi.Uni-SB.DE> |
diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el index 2c685753f1f..52a0c8a1deb 100644 --- a/lisp/textmodes/table.el +++ b/lisp/textmodes/table.el | |||
| @@ -1,11 +1,12 @@ | |||
| 1 | ;;; table.el --- create and edit WYSIWYG text based embedded tables | 1 | ;;; table.el --- create and edit WYSIWYG text based embedded tables |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2000, 01, 02, 03, 04 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 |
| 4 | ;; Free Software Foundation, Inc. | ||
| 4 | 5 | ||
| 5 | ;; Keywords: wp, convenience | 6 | ;; Keywords: wp, convenience |
| 6 | ;; Author: Takaaki Ota <Takaaki.Ota@am.sony.com> | 7 | ;; Author: Takaaki Ota <Takaaki.Ota@am.sony.com> |
| 7 | ;; Created: Sat Jul 08 2000 13:28:45 (PST) | 8 | ;; Created: Sat Jul 08 2000 13:28:45 (PST) |
| 8 | ;; Revised: Tue Jun 01 2004 11:36:39 (PDT) | 9 | ;; Revised: Fri Mar 18 2005 13:50:13 (PST) |
| 9 | 10 | ||
| 10 | ;; This file is part of GNU Emacs. | 11 | ;; This file is part of GNU Emacs. |
| 11 | 12 | ||
| @@ -1024,16 +1025,10 @@ This is always set to nil at the entry to `table-with-cache-buffer' before execu | |||
| 1024 | :active (and (not buffer-read-only) (not (table--probe-cell))) | 1025 | :active (and (not buffer-read-only) (not (table--probe-cell))) |
| 1025 | :help "Insert a text based table at point"] | 1026 | :help "Insert a text based table at point"] |
| 1026 | ["Row" table-insert-row | 1027 | ["Row" table-insert-row |
| 1027 | :active (and (not buffer-read-only) | 1028 | :active (table--row-column-insertion-point-p) |
| 1028 | (or (table--probe-cell) | ||
| 1029 | (save-excursion | ||
| 1030 | (table--find-row-column nil t)))) | ||
| 1031 | :help "Insert row(s) of cells in table"] | 1029 | :help "Insert row(s) of cells in table"] |
| 1032 | ["Column" table-insert-column | 1030 | ["Column" table-insert-column |
| 1033 | :active (and (not buffer-read-only) | 1031 | :active (table--row-column-insertion-point-p 'column) |
| 1034 | (or (table--probe-cell) | ||
| 1035 | (save-excursion | ||
| 1036 | (table--find-row-column 'column t)))) | ||
| 1037 | :help "Insert column(s) of cells in table"]) | 1032 | :help "Insert column(s) of cells in table"]) |
| 1038 | "----" | 1033 | "----" |
| 1039 | ("Recognize" | 1034 | ("Recognize" |
| @@ -1076,16 +1071,10 @@ This is always set to nil at the entry to `table-with-cache-buffer' before execu | |||
| 1076 | '("Table" | 1071 | '("Table" |
| 1077 | ("Insert" | 1072 | ("Insert" |
| 1078 | ["Row" table-insert-row | 1073 | ["Row" table-insert-row |
| 1079 | :active (and (not buffer-read-only) | 1074 | :active (table--row-column-insertion-point-p) |
| 1080 | (or (table--probe-cell) | ||
| 1081 | (save-excursion | ||
| 1082 | (table--find-row-column nil t)))) | ||
| 1083 | :help "Insert row(s) of cells in table"] | 1075 | :help "Insert row(s) of cells in table"] |
| 1084 | ["Column" table-insert-column | 1076 | ["Column" table-insert-column |
| 1085 | :active (and (not buffer-read-only) | 1077 | :active (table--row-column-insertion-point-p 'column) |
| 1086 | (or (table--probe-cell) | ||
| 1087 | (save-excursion | ||
| 1088 | (table--find-row-column 'column t)))) | ||
| 1089 | :help "Insert column(s) of cells in table"]) | 1078 | :help "Insert column(s) of cells in table"]) |
| 1090 | ("Delete" | 1079 | ("Delete" |
| 1091 | ["Row" table-delete-row | 1080 | ["Row" table-delete-row |
| @@ -4698,6 +4687,30 @@ of line." | |||
| 4698 | (setq multiplier (1- multiplier))) | 4687 | (setq multiplier (1- multiplier))) |
| 4699 | ret-str)) | 4688 | ret-str)) |
| 4700 | 4689 | ||
| 4690 | (defun table--line-column-position (line column) | ||
| 4691 | "Return the location of LINE forward at COLUMN." | ||
| 4692 | (save-excursion | ||
| 4693 | (forward-line line) | ||
| 4694 | (move-to-column column) | ||
| 4695 | (point))) | ||
| 4696 | |||
| 4697 | (defun table--row-column-insertion-point-p (&optional columnp) | ||
| 4698 | "Return non nil if it makes sense to insert a row or a column at point." | ||
| 4699 | (and (not buffer-read-only) | ||
| 4700 | (or (get-text-property (point) 'table-cell) | ||
| 4701 | (let ((column (current-column))) | ||
| 4702 | (if columnp | ||
| 4703 | (or (text-property-any (line-beginning-position 0) | ||
| 4704 | (table--line-column-position -1 column) | ||
| 4705 | 'table-cell t) | ||
| 4706 | (text-property-any (line-beginning-position) (point) 'table-cell t) | ||
| 4707 | (text-property-any (line-beginning-position 2) | ||
| 4708 | (table--line-column-position 1 column) | ||
| 4709 | 'table-cell t)) | ||
| 4710 | (text-property-any (table--line-column-position -2 column) | ||
| 4711 | (table--line-column-position -2 (+ 2 column)) | ||
| 4712 | 'table-cell t)))))) | ||
| 4713 | |||
| 4701 | (defun table--find-row-column (&optional columnp no-error) | 4714 | (defun table--find-row-column (&optional columnp no-error) |
| 4702 | "Search table and return a cell coordinate list of row or column." | 4715 | "Search table and return a cell coordinate list of row or column." |
| 4703 | (let ((current-coordinate (table--get-coordinate))) | 4716 | (let ((current-coordinate (table--get-coordinate))) |
| @@ -5136,7 +5149,7 @@ Focus only on the corner pattern. Further cell validity check is required." | |||
| 5136 | 5149 | ||
| 5137 | (defun table--editable-cell-p (&optional abort-on-error) | 5150 | (defun table--editable-cell-p (&optional abort-on-error) |
| 5138 | (and (not buffer-read-only) | 5151 | (and (not buffer-read-only) |
| 5139 | (table--probe-cell abort-on-error))) | 5152 | (get-text-property (point) 'table-cell))) |
| 5140 | 5153 | ||
| 5141 | (defun table--probe-cell (&optional abort-on-error) | 5154 | (defun table--probe-cell (&optional abort-on-error) |
| 5142 | "Probes a table cell around the point. | 5155 | "Probes a table cell around the point. |
| @@ -5603,5 +5616,5 @@ It returns COLUMN unless STR contains some wide characters." | |||
| 5603 | ;; End: *** | 5616 | ;; End: *** |
| 5604 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 5617 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 5605 | 5618 | ||
| 5606 | ;;; arch-tag: 0d69b03e-aa5f-4e72-8806-5727217617e0 | 5619 | ;; arch-tag: 0d69b03e-aa5f-4e72-8806-5727217617e0 |
| 5607 | ;;; table.el ends here | 5620 | ;;; table.el ends here |