aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2006-01-18 16:39:43 +0000
committerStefan Monnier2006-01-18 16:39:43 +0000
commit1042fc7f9c6526ecd225f9728b3d5ee72d7bedc6 (patch)
tree8e8eda251c9442f697256bfd7fc1c9dcb8ef50f5
parentf462ee2c28b52d1637d3383b9da8983f83ccb88d (diff)
downloademacs-1042fc7f9c6526ecd225f9728b3d5ee72d7bedc6.tar.gz
emacs-1042fc7f9c6526ecd225f9728b3d5ee72d7bedc6.zip
Move defvars out of eval-when-compile.
Remove harmful code meant to avoid byte-compiler warnings. (table-fixed-mode-indicator): Remove. Use a more complex mode-line specification that checks table-fixed-width-mode directly. (table-recognize-region, table-recognize-cell): Use restore-buffer-modified-p. (table-fixed-width-mode): Remove code that refreshes table-fixed-mode-indicator. (*table--cell-describe-bindings, *table--cell-describe-mode): Avoid obsolete name print-help-return-message. (table--test-cell-list): Don't use replace-regexp from elisp. (table--point-entered-cell-function, table--point-left-cell-function): Don't set table-fixed-mode-indicator, use force-mode-line-update.
-rw-r--r--lisp/textmodes/table.el72
1 files changed, 31 insertions, 41 deletions
diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el
index f45bcde6684..80f062ae3fe 100644
--- a/lisp/textmodes/table.el
+++ b/lisp/textmodes/table.el
@@ -1,7 +1,7 @@
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, 2001, 2002, 2003, 2004, 3;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
4;; 2005 Free Software Foundation, Inc. 4;; 2005, 2006 Free Software Foundation, Inc.
5 5
6;; Keywords: wp, convenience 6;; Keywords: wp, convenience
7;; Author: Takaaki Ota <Takaaki.Ota@am.sony.com> 7;; Author: Takaaki Ota <Takaaki.Ota@am.sony.com>
@@ -621,17 +621,18 @@
621;;; 621;;;
622 622
623;; hush up the byte-compiler 623;; hush up the byte-compiler
624(eval-when-compile 624(defvar quail-translating)
625 (defvar quail-translating) 625(defvar quail-converting)
626 (defvar quail-converting) 626(defvar flyspell-mode)
627 (defvar flyspell-mode) 627(defvar real-last-command)
628 (defvar real-last-command) 628(defvar delete-selection-mode)
629 (defvar delete-selection-mode) 629;; This is evil!!
630 (unless (fboundp 'set-face-property) 630;; (eval-when-compile
631 (defun set-face-property (face prop value))) 631;; (unless (fboundp 'set-face-property)
632 (unless (fboundp 'unibyte-char-to-multibyte) 632;; (defun set-face-property (face prop value)))
633 (defun unibyte-char-to-multibyte (char))) 633;; (unless (fboundp 'unibyte-char-to-multibyte)
634 (defun table--point-in-cell-p (&optional location))) 634;; (defun unibyte-char-to-multibyte (char)))
635;; (defun table--point-in-cell-p (&optional location)))
635 636
636;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 637;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
637;;; 638;;;
@@ -910,21 +911,18 @@ It inhibits `table-with-cache-buffer' to update data in both direction, cell to
910This is always set to nil at the entry to `table-with-cache-buffer' before executing body forms.") 911This is always set to nil at the entry to `table-with-cache-buffer' before executing body forms.")
911(defvar table-mode-indicator nil 912(defvar table-mode-indicator nil
912 "For mode line indicator") 913 "For mode line indicator")
913(defvar table-fixed-mode-indicator nil 914;; This is not a real minor-mode but placed in the minor-mode-alist
914 "For mode line indicator") 915;; so that we can show the indicator on the mode line handy.
916(make-variable-buffer-local table-mode-indicator)
917(unless (assq table-mode-indicator minor-mode-alist)
918 (push '(table-mode-indicator (table-fixed-width-mode " Fixed-Table" " Table"))
919 minor-mode-alist))
920
915(defconst table-source-languages '(html latex cals) 921(defconst table-source-languages '(html latex cals)
916 "Supported source languages.") 922 "Supported source languages.")
917(defvar table-source-info-plist nil 923(defvar table-source-info-plist nil
918 "General storage for temporary information used while generating source.") 924 "General storage for temporary information used while generating source.")
919;;; These are not real minor-mode but placed in the minor-mode-alist 925
920;;; so that we can show the indicator on the mode line handy.
921(mapcar (lambda (indicator)
922 (make-variable-buffer-local (car indicator))
923 (unless (assq (car indicator) minor-mode-alist)
924 (setq minor-mode-alist
925 (cons indicator minor-mode-alist))))
926 '((table-mode-indicator " Table")
927 (table-fixed-mode-indicator " Fixed-Table")))
928;;; The following history containers not only keep the history of user 926;;; The following history containers not only keep the history of user
929;;; entries but also serve as the default value providers. When an 927;;; entries but also serve as the default value providers. When an
930;;; interactive command is invoked it offers a user the latest entry 928;;; interactive command is invoked it offers a user the latest entry
@@ -2000,7 +1998,7 @@ specific features."
2000 (table--detect-cell-alignment cell))) 1998 (table--detect-cell-alignment cell)))
2001 (unless (re-search-forward border end t) 1999 (unless (re-search-forward border end t)
2002 (goto-char end)))))))))) 2000 (goto-char end))))))))))
2003 (set-buffer-modified-p modified-flag))) 2001 (restore-buffer-modified-p modified-flag)))
2004 2002
2005;;;###autoload 2003;;;###autoload
2006(defun table-unrecognize-region (beg end) 2004(defun table-unrecognize-region (beg end)
@@ -2090,7 +2088,7 @@ plain text and loses all the table specific features."
2090 (set-buffer cache-buffer) 2088 (set-buffer cache-buffer)
2091 (erase-buffer) 2089 (erase-buffer)
2092 (table--insert-rectangle rectangle))))) 2090 (table--insert-rectangle rectangle)))))
2093 (set-buffer-modified-p modified-flag)) 2091 (restore-buffer-modified-p modified-flag))
2094 (if (featurep 'xemacs) 2092 (if (featurep 'xemacs)
2095 (table--warn-incompatibility)) 2093 (table--warn-incompatibility))
2096 cell))) 2094 cell)))
@@ -2929,12 +2927,6 @@ order to prevent a word being folded into multiple lines."
2929 (if (null arg) 2927 (if (null arg)
2930 (not table-fixed-width-mode) 2928 (not table-fixed-width-mode)
2931 (> (prefix-numeric-value arg) 0))) 2929 (> (prefix-numeric-value arg) 0)))
2932 (save-excursion
2933 (mapcar (lambda (buf)
2934 (set-buffer buf)
2935 (if (table--point-in-cell-p)
2936 (table--point-entered-cell-function)))
2937 (buffer-list)))
2938 (table--update-cell-face)) 2930 (table--update-cell-face))
2939 2931
2940;;;###autoload 2932;;;###autoload
@@ -4084,7 +4076,7 @@ fit in the cell width the word is folded into the next line. The
4084folded location is marked by a continuation character which is 4076folded location is marked by a continuation character which is
4085specified in the variable `table-word-continuation-char'. 4077specified in the variable `table-word-continuation-char'.
4086") 4078")
4087 (print-help-return-message)))) 4079 (help-print-return-message))))
4088 4080
4089(defun *table--cell-describe-bindings () 4081(defun *table--cell-describe-bindings ()
4090 "Table cell version of `describe-bindings'." 4082 "Table cell version of `describe-bindings'."
@@ -4102,7 +4094,7 @@ key binding
4102 (key-description (car binding)) 4094 (key-description (car binding))
4103 (cdr binding)))) 4095 (cdr binding))))
4104 table-cell-bindings) 4096 table-cell-bindings)
4105 (print-help-return-message)))) 4097 (help-print-return-message))))
4106 4098
4107(defun *table--cell-dabbrev-expand (arg) 4099(defun *table--cell-dabbrev-expand (arg)
4108 "Table cell version of `dabbrev-expand'." 4100 "Table cell version of `dabbrev-expand'."
@@ -4897,8 +4889,7 @@ in the list."
4897 4889
4898(defmacro table--log (&rest body) 4890(defmacro table--log (&rest body)
4899 "Debug logging macro." 4891 "Debug logging macro."
4900 `(save-excursion 4892 `(with-current-buffer (get-buffer-create "log")
4901 (set-buffer (get-buffer-create "log"))
4902 (goto-char (point-min)) 4893 (goto-char (point-min))
4903 (let ((standard-output (current-buffer))) 4894 (let ((standard-output (current-buffer)))
4904 ,@body))) 4895 ,@body)))
@@ -4958,7 +4949,8 @@ cell."
4958 (dig1-str (format "%1d" (prog1 (% count 10) (setq count (1+ count)))))) 4949 (dig1-str (format "%1d" (prog1 (% count 10) (setq count (1+ count))))))
4959 (goto-char (car cell)) 4950 (goto-char (car cell))
4960 (table-with-cache-buffer 4951 (table-with-cache-buffer
4961 (replace-regexp "." dig1-str) 4952 (while (re-search-forward "." nil t)
4953 (replace-match dig1-str nil nil))
4962 (setq table-inhibit-auto-fill-paragraph t)) 4954 (setq table-inhibit-auto-fill-paragraph t))
4963 (table--finish-delayed-tasks))) 4955 (table--finish-delayed-tasks)))
4964 (table--goto-coordinate current-coordinate))) 4956 (table--goto-coordinate current-coordinate)))
@@ -5340,9 +5332,8 @@ instead of the current buffer and returns the OBJECT."
5340Refresh the menu bar." 5332Refresh the menu bar."
5341 (unless table-cell-entered-state 5333 (unless table-cell-entered-state
5342 (setq table-cell-entered-state t) 5334 (setq table-cell-entered-state t)
5343 (setq table-mode-indicator (not table-fixed-width-mode)) 5335 (setq table-mode-indicator t)
5344 (setq table-fixed-mode-indicator table-fixed-width-mode) 5336 (force-mode-line-update)
5345 (set-buffer-modified-p (buffer-modified-p))
5346 (table--warn-incompatibility) 5337 (table--warn-incompatibility)
5347 (run-hooks 'table-point-entered-cell-hook))) 5338 (run-hooks 'table-point-entered-cell-hook)))
5348 5339
@@ -5352,8 +5343,7 @@ Refresh the menu bar."
5352 (when table-cell-entered-state 5343 (when table-cell-entered-state
5353 (setq table-cell-entered-state nil) 5344 (setq table-cell-entered-state nil)
5354 (setq table-mode-indicator nil) 5345 (setq table-mode-indicator nil)
5355 (setq table-fixed-mode-indicator nil) 5346 (force-mode-line-update)
5356 (set-buffer-modified-p (buffer-modified-p))
5357 (run-hooks 'table-point-left-cell-hook))) 5347 (run-hooks 'table-point-left-cell-hook)))
5358 5348
5359(defun table--warn-incompatibility () 5349(defun table--warn-incompatibility ()