emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: emacs-orgmode@gnu.org
Subject: org-end-of-line and <TAB> in table interaction
Date: Fri, 28 Sep 2018 11:29:33 +0200	[thread overview]
Message-ID: <87wor6j7gi.fsf@gmail.com> (raw)

Hi,

I have

(add-hook 'org-tab-first-hook 'org-end-of-line)

This causes <TAB> inside a table to always create another row, rather
than moving to the next field. The patch below fixes this for me,
although Iʼm not sure itʼs the right solution.

diff --git a/org.el b/org.el
index 45be987..f22e9a1 100644
--- a/org.el
+++ b/org.el
@@ -23608,6 +23608,7 @@ (defun org-end-of-line (&optional n)
 		   (`(,_ . ,C-e) C-e) (_ org-special-ctrl-a/e)))
 	deactivate-mark)
     ;; First move to a visible line.
+    (when (not (org-at-table-p))
     (if (bound-and-true-p visual-line-mode)
 	(beginning-of-visual-line n)
       (move-beginning-of-line n))
@@ -23651,7 +23652,7 @@ (defun org-end-of-line (&optional n)
 	(when (/= bol (line-beginning-position))
 	  (goto-char bol)
 	  (end-of-line))))
-     (t (end-of-line)))))
+     (t (end-of-line))))))
 
 (define-key org-mode-map "\C-a" 'org-beginning-of-line)
 (define-key org-mode-map "\C-e" 'org-end-of-line)

             reply	other threads:[~2018-09-28  9:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-28  9:29 Robert Pluim [this message]
2018-09-28 10:30 ` org-end-of-line and <TAB> in table interaction Nicolas Goaziou
2018-09-28 12:01   ` Robert Pluim
2018-09-28 12:21     ` Nicolas Goaziou
2018-09-28 12:48       ` Robert Pluim
2018-09-28 15:34         ` Nicolas Goaziou
2018-09-29 12:29           ` Robert Pluim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wor6j7gi.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).