From mboxrd@z Thu Jan 1 00:00:00 1970 From: Torsten Wagner Subject: [PATCH] Change C-' behaviour on #+TBLFM: line Date: Fri, 19 Nov 2010 17:49:56 +0900 Message-ID: <4CE63A34.9060606@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=45204 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJMfE-0003TX-I2 for emacs-orgmode@gnu.org; Fri, 19 Nov 2010 03:49:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJMf9-0000bb-9z for emacs-orgmode@gnu.org; Fri, 19 Nov 2010 03:49:48 -0500 Received: from mail-pw0-f41.google.com ([209.85.160.41]:35242) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJMf9-0000bP-5H for emacs-orgmode@gnu.org; Fri, 19 Nov 2010 03:49:43 -0500 Received: by pwi6 with SMTP id 6so963793pwi.0 for ; Fri, 19 Nov 2010 00:49:41 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi, Short description: I recently started to use tables in org-mode. Having the pointer inside the the table and pressing C-c' I can enter the formula buffer. However, placing the pointer on the #+TBLFM: line C-c' results in "Find file or URL:". If even more people believe this is confusing, I would suggest to switch the behaviour. C-c' on a #+TBLFM: line should open up the formular buffer. Longer Explanation: For small changes of the formula I often edit the #+TBLFM: line directly. If things went more complex or get messed, I press C-c' to enter the formula buffer. However, at this time my pointer is located at the #+TBLFM: line. The associated call function for C-c' is: org-edit-special This function calls org-table-edit-formulas in case the point is located inside the table and ffap aka find-file-at-point in all other cases (omitting the cases for source code and include lines here for simplicity) Thus pressing C-c' at #+TBLFM ends up with the request for a file or a URL. In my opinion org-edit-special needs another case to look out for #+TBLFM or resp. combine this with the case to call `org-table-edit-formulas'. Please find below a patch for that. -------patch--------begin-------- diff --git a/lisp/org.el b/lisp/org.el index 023e019..a7e4d33 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -17259,7 +17259,9 @@ When in an #+include line, visit the include file. Otherwise call ((org-edit-fixed-width-region)) ((org-at-table.el-p) (org-edit-src-code)) - ((org-at-table-p) + ((or (org-at-table-p) (save-excursion + (beginning-of-line 1) + (looking-at "[ \t]*#\\+TBLFM"))) (call-interactively 'org-table-edit-formulas)) (t (call-interactively 'ffap)))) -------patch--------end--------- This is my very first public org-mode patch and my very first hack in vital org-mode elisp code. Thus, don't laugh or blame to much.... :) Best regards Torsten