emacs-orgmode
[Top][All Lists]
Advanced

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

[Orgmode] Re: [REQUEST] orgtbl-ctrl-c-ctrl-c-hook


From: Seweryn Kokot
Subject: [Orgmode] Re: [REQUEST] orgtbl-ctrl-c-ctrl-c-hook
Date: Wed, 17 Nov 2010 09:58:19 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Carsten Dominik <carsten.dominik <at> gmail.com> writes:

> I am a bit confused by this patch.  You do call the hook after C-c C-c  
> has done its thing.  Which is OK, but this is not what the  
> documentation in your hook variable says.  That documentation seems to  
> have been copied from the normal ctrl-c-ctrl-c hook, and these hooks  
> are used in a different way:  They establish *alternative*  
> functionality to the normal C-c C-c actions.  So if any of the hook  
> functions returns a non-nil value, the normal C-c C-c functionality  
> will *not* be executed.
> 
> So what are your true intentions, and can you make code and  
> documentation macht up?

Thank for you help. Indeed, the previous patch was confusing. I've done a new 
patch below. Is it correct now?

regards,
Seweryn

--- h:/org-mode/lisp/org-table.el       2010-11-16 11:17:36.000000000 +0100
+++ h:/org-mode/lisp/org-table-new.el   2010-11-17 10:54:22.000000000 +0100
@@ -48,6 +48,11 @@
 (defvar org-export-html-table-tag) ; defined in org-exp.el
 (defvar constants-unit-system)
 
+(defvar orgtbl-ctrl-c-ctrl-c-hook nil
+  "Hook for functions attaching themselves to `C-c C-c'.
+This can be used to add additional functionality after the table is sent
+to the receiver position.")
+
 (defcustom orgtbl-optimized (eq org-enable-table-editor 'optimized)
   "Non-nil means use the optimized table editor version for `orgtbl-mode'.
 In the optimized version, the table editor takes over all simple keys that
@@ -3729,7 +3734,8 @@
          (call-interactively 'org-table-recalculate)
        (org-table-maybe-recalculate-line))
       (call-interactively 'org-table-align)
-      (orgtbl-send-table 'maybe))
+      (orgtbl-send-table 'maybe)
+      (run-hooks 'orgtbl-ctrl-c-ctrl-c-hook))
      ((eq action 'recalc)
       (save-excursion
        (beginning-of-line 1)

Diff finished.  Wed Nov 17 10:54:46 2010




reply via email to

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