:help "Move point backward by cell(s)"])
))
-;; XEmacs causes an error when encountering unknown keywords in the
-;; menu definition. Specifically the :help keyword is new in Emacs 21
-;; and causes error for the XEmacs function `check-menu-syntax'. IMHO
-;; it is unwise to generate an error for unknown keywords because it
-;; kills the nice backward compatible extensibility of keyword use.
-;; Unknown keywords should be quietly ignore so that future extension
-;; does not cause a problem in the old implementation. Sigh...
-(when (featurep 'xemacs)
- (defun table--tweak-menu-for-xemacs (menu)
- (cond
- ((listp menu)
- (mapcar #'table--tweak-menu-for-xemacs menu))
- ((vectorp menu)
- (let ((len (length menu)))
- (dotimes (i len)
- ;; replace :help with something harmless.
- (if (eq (aref menu i) :help) (aset menu i :included)))))))
- (mapcar #'table--tweak-menu-for-xemacs
- (list table-global-menu table-cell-menu))
- (defvar mark-active t))
-
;; register table menu under global tools menu
(unless table-disable-menu
- (easy-menu-define table-global-menu-map nil "Table global menu" table-global-menu)
- (if (featurep 'xemacs)
- (progn
- (easy-menu-add-item nil '("Tools") table-global-menu-map))
- (easy-menu-add-item (current-global-map) '("menu-bar" "tools") "--")
- (easy-menu-add-item (current-global-map) '("menu-bar" "tools") table-global-menu-map)))
+ (easy-menu-define table-global-menu-map nil
+ "Table global menu" table-global-menu)
+ (easy-menu-add-item (current-global-map) '("menu-bar" "tools") "--")
+ (easy-menu-add-item (current-global-map)
+ '("menu-bar" "tools") table-global-menu-map))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; set up the update timer unless it is explicitly inhibited.
(unless table-inhibit-update
(table--update-cell)))))
-(if (or (featurep 'xemacs)
- (null (fboundp 'font-lock-add-keywords))) nil
+(if (null (fboundp 'font-lock-add-keywords))
+ nil
;; Color it as a keyword.
(font-lock-add-keywords
'emacs-lisp-mode
(erase-buffer)
(table--insert-rectangle rectangle)))))
(restore-buffer-modified-p modified-flag))
- (if (featurep 'xemacs)
- (table--warn-incompatibility))
cell)))
;;;###autoload
;; Add menu for table cells.
(unless table-disable-menu
(easy-menu-define table-cell-menu-map table-cell-map
- "Table cell menu" table-cell-menu)
- (if (featurep 'xemacs)
- (easy-menu-add table-cell-menu)))
+ "Table cell menu" table-cell-menu))
(run-hooks 'table-cell-map-hook))
;; Create the keymap after running the user init file so that the user
timer. If it is non-nil the function copies the contents of the cell
cache buffer into the designated cell in the table buffer."
(if (null table-update-timer) nil
- (table--cancel-timer table-update-timer)
+ (cancel-timer table-update-timer)
(setq table-update-timer nil))
(if (or (not now)
(and (boundp 'quail-converting)
(defun table--update-cell-widened (&optional now)
"Update the contents of the cells that are affected by widening operation."
(if (null table-widen-timer) nil
- (table--cancel-timer table-widen-timer)
+ (cancel-timer table-widen-timer)
(setq table-widen-timer nil))
(if (not now)
(setq table-widen-timer
(defun table--update-cell-heightened (&optional now)
"Update the contents of the cells that are affected by heightening operation."
(if (null table-heighten-timer) nil
- (table--cancel-timer table-heighten-timer)
+ (cancel-timer table-heighten-timer)
(setq table-heighten-timer nil))
(if (not now)
(setq table-heighten-timer
(read-from-minibuffer
(format "%s (default %s): " (car prompt-history) default)
"" nil nil (cdr prompt-history) default))
- (and (featurep 'xemacs)
- (equal (car (symbol-value (cdr prompt-history))) "")
- (set (cdr prompt-history)
- (cdr (symbol-value (cdr prompt-history)))))
(car (symbol-value (cdr prompt-history))))
(defun table--buffer-substring-and-trim (beg end)
(defun table--untabify (beg end)
"Wrapper to raw untabify."
- (untabify beg end)
- (if (featurep 'xemacs)
- ;; Cancel strange behavior of xemacs
- (message "")))
+ (untabify beg end))
(defun table--multiply-string (string multiplier)
"Multiply string and return it."
(defun table--update-cell-face ()
"Update cell face according to the current mode."
- (if (featurep 'xemacs)
- (set-face-property 'table-cell 'underline table-fixed-width-mode)
- (set-face-inverse-video 'table-cell table-fixed-width-mode)))
+ (set-face-inverse-video 'table-cell table-fixed-width-mode))
(table--update-cell-face)
is non-nil. The warning is done only once per session for each item."
(unless (and table-disable-incompatibility-warning
(not (called-interactively-p 'interactive)))
- (cond ((and (featurep 'xemacs)
- (not (get 'table-disable-incompatibility-warning 'xemacs)))
- (put 'table-disable-incompatibility-warning 'xemacs t)
- (display-warning 'table
- "
-*** Warning ***
-
-Table package mostly works fine under XEmacs, however, due to the
-peculiar implementation of text property under XEmacs, cell splitting
-and any undo operation of table exhibit some known strange problems,
-such that a border characters dissolve into adjacent cells. Please be
-aware of this.
-
-"
- :warning))
- ((and (boundp 'flyspell-mode)
- flyspell-mode
- (not (get 'table-disable-incompatibility-warning 'flyspell)))
- (put 'table-disable-incompatibility-warning 'flyspell t)
- (display-warning 'table
- "
+ (when (and (boundp 'flyspell-mode)
+ flyspell-mode
+ (not (get 'table-disable-incompatibility-warning 'flyspell)))
+ (put 'table-disable-incompatibility-warning 'flyspell t)
+ (display-warning 'table
+ "
*** Warning ***
Flyspell minor mode is known to be incompatible with this table
works better than the previous versions however not fully compatible.
"
- :warning))
- )))
+ :warning))))
(defun table--cell-blank-str (&optional n)
"Return blank table cell string of length N."
(setq justify (or justify table-cell-info-justify))
(and justify
(not (eq justify 'left))
- (not (featurep 'xemacs))
(set-marker-insertion-type marker-point t))
(table--remove-eol-spaces (point-min) (point-max))
(if table-fixed-width-mode
(defun table--set-timer (seconds func args)
"Generic wrapper for setting up a timer."
- (if (featurep 'xemacs)
- ;; the picky xemacs refuses to accept zero
- (add-timeout (if (zerop seconds) 0.01 seconds) func args nil)
- ;;(run-at-time seconds nil func args)))
- ;; somehow run-at-time causes strange problem under Emacs 20.7
- ;; this problem does not show up under Emacs 21.0.90
- (run-with-idle-timer seconds nil func args)))
-
-(defun table--cancel-timer (timer)
- "Generic wrapper for canceling a timer."
- (if (featurep 'xemacs)
- (disable-timeout timer)
- (cancel-timer timer)))
+ (run-with-idle-timer seconds nil func args))
(defun table--get-last-command ()
"Generic wrapper for getting the real last command."