(defvar flyspell-mode)
(defvar real-last-command)
(defvar delete-selection-mode)
-;; This is evil!!
-;; (eval-when-compile
-;; (unless (fboundp 'set-face-property)
-;; (defun set-face-property (face prop value)))
-;; (unless (fboundp 'unibyte-char-to-multibyte)
-;; (defun unibyte-char-to-multibyte (char)))
-;; (defun table--point-in-cell-p (&optional location)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
(setplist 'table-disable-incompatibility-warning nil)
-(defvar table-disable-menu (null (and (locate-library "easymenu")
- (require 'easymenu)
- (fboundp 'easy-menu-add-item)))
- "When non-nil, use of menu by table package is disabled.
-It must be set before loading this package `table.el' for the first
-time.")
-
\f
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
))
;; 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)
- (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 (null (fboundp 'font-lock-add-keywords))
- nil
- ;; Color it as a keyword.
- (font-lock-add-keywords
- 'emacs-lisp-mode
- '("\\<table-with-cache-buffer\\>")))
+;; Color it as a keyword.
+(font-lock-add-keywords 'emacs-lisp-mode '("\\<table-with-cache-buffer\\>"))
(defmacro table-put-source-info (prop value)
"Register source generation information."
plain text and loses all the table specific features."
(interactive "i\ni\np")
(table--make-cell-map)
- (if (or force (not (memq (table--get-last-command) table-command-list)))
+ (if (or force (not (memq real-last-command table-command-list)))
(let* ((cell (table--probe-cell (called-interactively-p 'interactive)))
(cache-buffer (get-buffer-create table-cache-buffer-name))
(modified-flag (buffer-modified-p))
(setq table-cell-map map)
(fset 'table-cell-map map)))
;; 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))
+ (easy-menu-define table-cell-menu-map table-cell-map
+ "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
(defun *table--present-cell-popup-menu (event)
"Present and handle cell popup menu."
(interactive "e")
- (unless table-disable-menu
- (select-window (posn-window (event-start event)))
- (goto-char (posn-point (event-start event)))
- (let ((item-list (x-popup-menu event table-cell-menu-map))
- (func table-cell-menu-map))
- (while item-list
- (setq func (nth 3 (assoc (car item-list) func)))
- (setq item-list (cdr item-list)))
- (if (and (symbolp func) (fboundp func))
- (call-interactively func)))))
+ (select-window (posn-window (event-start event)))
+ (goto-char (posn-point (event-start event)))
+ (let ((item-list (x-popup-menu event table-cell-menu-map))
+ (func table-cell-menu-map))
+ (while item-list
+ (setq func (nth 3 (assoc (car item-list) func)))
+ (setq item-list (cdr item-list)))
+ (if (and (symbolp func) (fboundp func))
+ (call-interactively func))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
(and (boundp 'quail-translating)
quail-translating))
(setq table-update-timer
- (table--set-timer table-time-before-update
- (function table--update-cell)
- 'now))
+ (run-with-idle-timer table-time-before-update
+ nil
+ (function table--update-cell)
+ 'now))
(save-current-buffer
(set-buffer table-cell-buffer)
(let ((cache-buffer (get-buffer-create table-cache-buffer-name))
(setq table-widen-timer nil))
(if (not now)
(setq table-widen-timer
- (table--set-timer (+ table-time-before-update table-time-before-reformat)
- (function table--update-cell-widened)
- 'now))
+ (run-with-idle-timer (+ table-time-before-update table-time-before-reformat)
+ nil
+ (function table--update-cell-widened)
+ 'now))
(save-current-buffer
(if table-update-timer
(table--update-cell 'now))
(setq table-heighten-timer nil))
(if (not now)
(setq table-heighten-timer
- (table--set-timer (+ table-time-before-update table-time-before-reformat)
- (function table--update-cell-heightened)
- 'now))
+ (run-with-idle-timer (+ table-time-before-update table-time-before-reformat)
+ nil
+ (function table--update-cell-heightened)
+ 'now))
(save-current-buffer
(if table-update-timer
(table--update-cell 'now))
(defun table--cell-insert-char (char &optional overwrite)
"Insert CHAR inside a table cell."
- (let ((delete-selection-p (and (boundp 'delete-selection-mode)
- delete-selection-mode
+ (let ((delete-selection-p (and delete-selection-mode
transient-mark-mode mark-active
(not buffer-read-only)))
(mark-coordinate (table--transcoord-table-to-cache (table--get-coordinate (mark t)))))
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)))
- (when (and (boundp 'flyspell-mode)
- flyspell-mode
+ (when (and flyspell-mode
(not (get 'table-disable-incompatibility-warning 'flyspell)))
(put 'table-disable-incompatibility-warning 'flyspell t)
(display-warning 'table
idx
nil)))
+\f
+;;;; Obsolete.
+
+(defvar table-disable-menu nil
+ "When non-nil, use of menu by table package is disabled.
+It must be set before loading this package `table.el' for the first
+time.")
+(make-obsolete-variable 'table-disable-menu "no longer used." "28.1")
+
(defun table--set-timer (seconds func args)
"Generic wrapper for setting up a timer."
+ (declare (obsolete run-with-idle-timer "28.1"))
(run-with-idle-timer seconds nil func args))
(defun table--get-last-command ()
"Generic wrapper for getting the real last command."
- (if (boundp 'real-last-command)
- real-last-command
- last-command))
+ (declare (obsolete real-last-command "28.1"))
+ real-last-command)
(run-hooks 'table-load-hook)