emacs-devel
[Top][All Lists]
Advanced

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

table.el 1.6.3


From: Tak Ota
Subject: table.el 1.6.3
Date: Thu, 21 Mar 2002 22:01:35 -0800 (PST)

Tue, 19 Mar 2002 21:22:49 -0800: Tak Ota <address@hidden> wrote:

> Attached is the latest table.el that does not use function advice
> anymore.  It depends on the new command remap feature therefore won't
> run correctly in the previous versions of emacs.
> 
> So far I find one problem.  Somehow when point goes inside a table
> cell the table menu does not appear in the menu bar.  For this part
> the same code works fine under emacs-21.1.90 although command remap is
> missing.  Has the menu mechanism in keymap changed under 21.3?

Following is a patch from table.el 1.6.1 to 1.6.3.  The version 1.6.3
fixes the table cell filling problem introduced by the new definition
of `paragraph-start'.  The table menu problem is now fixed in the
latest keyboard.c from the CVS by Kim F. Storm.

-Tak


*** table-1.6.1.el      Thu Mar 21 21:48:01 2002
--- table.el    Thu Mar 21 21:49:23 2002
***************
*** 4,20 ****
  
  ;; Emacs Lisp Archive Entry
  ;; Filename:      table.el
! ;; Version:       1.6.1
  ;; Keywords:      wp, convenience
  ;; Author:        Takaaki Ota <address@hidden>
  ;; Maintainer:    Takaaki Ota <address@hidden>
  ;; Created:       Sat Jul 08 2000 13:28:45 (PST)
! ;; Revised:       Wed Mar 13 2002 21:20:00 (PST)
  ;; Description:   create and edit WYSIWYG text based embedded tables
  ;; Compatibility: Require Emacs 21.3 or lator
  ;; URL:           http://table.sourceforge.net/
  
! (defconst table-version "1.6.1"
    "Table version number.
  The latest version is available from http://table.sourceforge.net/";)
  
--- 4,20 ----
  
  ;; Emacs Lisp Archive Entry
  ;; Filename:      table.el
! ;; Version:       1.6.3
  ;; Keywords:      wp, convenience
  ;; Author:        Takaaki Ota <address@hidden>
  ;; Maintainer:    Takaaki Ota <address@hidden>
  ;; Created:       Sat Jul 08 2000 13:28:45 (PST)
! ;; Revised:       Thu Mar 21 2002 17:52:43 (PST)
  ;; Description:   create and edit WYSIWYG text based embedded tables
  ;; Compatibility: Require Emacs 21.3 or lator
  ;; URL:           http://table.sourceforge.net/
  
! (defconst table-version "1.6.3"
    "Table version number.
  The latest version is available from http://table.sourceforge.net/";)
  
***************
*** 868,873 ****
--- 868,875 ----
  ;;; Internal variables and constants
  ;;; No need of user configuration
  
+ (defconst table-paragraph-start "[ \t\n\f]"
+   "*Regexp for beginning of a line that starts OR separates paragraphs.")
  (defconst table-cache-buffer-name " *table cell cache*"
    "Cell cache buffer name.")
  (defvar table-cell-info-lu-coordinate nil
***************
*** 4317,4322 ****
--- 4319,4357 ----
      (car (table--get-coordinate (cdr (table--horizontal-cell-list nil t))))
      (1+ (cdr (table--get-coordinate (cdr (table--vertical-cell-list nil 
t))))))))
  
+ (defun table-call-interactively (function &optional recoard-flag keys)
+   "Call FUNCTION, or a table version of it if applicable.
+ See `call-interactively' for full description of the arguments."
+   (let ((table-func (intern-soft (format "*table--cell-%s" function))))
+     (call-interactively
+      (if (and table-func
+             (table--point-in-cell-p))
+        table-func
+        function) recoard-flag keys)))
+ 
+ (defun table-funcall (function &rest arguments)
+   "Call FUNCTION, or a table version of it if applicable.
+ See `funcall' for full description of the arguments."
+   (let ((table-func (intern-soft (format "*table--cell-%s" function))))
+     (apply
+      (if (and table-func
+             (table--point-in-cell-p))
+        table-func
+        function)
+      arguments)))
+ 
+ (defmacro table-apply (function &rest arguments)
+   "Call FUNCTION, or a table version of it if applicable.
+ See `apply' for full description of the arguments."
+   (let ((table-func (make-symbol "table-func")))
+     `(let ((,table-func (intern-soft (format "*table--cell-%s" ,function))))
+        (apply
+       (if (and ,table-func
+                (table--point-in-cell-p))
+           ,table-func
+         ,function)
+       ,@arguments))))
+ 
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;
  ;; Utility functions
***************
*** 4558,4564 ****
        (if (memq justify valign-symbols)
            (table--valign)
          (table--remove-eol-spaces beg end 'bol)
!         (fill-region beg end table-cell-info-justify)))
        (setq table-inhibit-auto-fill-paragraph t)
        (set-marker end nil)))
    (table--update-cell 'now))
--- 4593,4600 ----
        (if (memq justify valign-symbols)
            (table--valign)
          (table--remove-eol-spaces beg end 'bol)
!         (let ((paragraph-start table-paragraph-start))
!           (fill-region beg end table-cell-info-justify))))
        (setq table-inhibit-auto-fill-paragraph t)
        (set-marker end nil)))
    (table--update-cell 'now))
***************
*** 5399,5405 ****
      (table--remove-eol-spaces (point-min) (point-max))
      (if table-fixed-width-mode
        (table--fill-region-strictly marker-beg marker-end)
!       (fill-region marker-beg marker-end justify nil t))
      (goto-char marker-point)
      (set-marker marker-beg nil)
      (set-marker marker-end nil)
--- 5435,5442 ----
      (table--remove-eol-spaces (point-min) (point-max))
      (if table-fixed-width-mode
        (table--fill-region-strictly marker-beg marker-end)
!       (let ((paragraph-start table-paragraph-start))
!       (fill-region marker-beg marker-end justify nil t)))
      (goto-char marker-point)
      (set-marker marker-beg nil)
      (set-marker marker-end nil)
***************
*** 5422,5428 ****
                            end t)
      (delete-region (match-beginning 1) (match-end 1)))
    ;; then fill as normal
!   (fill-region beg end nil nil t)
    ;; now fix up
    (goto-char beg)
    (while (let ((col (move-to-column fill-column t)))
--- 5459,5466 ----
                            end t)
      (delete-region (match-beginning 1) (match-end 1)))
    ;; then fill as normal
!   (let ((paragraph-start table-paragraph-start))
!     (fill-region beg end nil nil t))
    ;; now fix up
    (goto-char beg)
    (while (let ((col (move-to-column fill-column t)))



reply via email to

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