浏览代码

Re-bind `org-show-children' to C-c TAB

* lisp/org.el (org-ctrl-c-tab): New function.
Nicolas Goaziou 7 年之前
父节点
当前提交
44c46176ec
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      lisp/org.el

+ 10 - 0
lisp/org.el

@@ -19614,6 +19614,7 @@ COMMANDS is a list of alternating OLDDEF NEWDEF command names."
 (org-defkey org-mode-map "\C-c\C-x>" 'org-agenda-remove-restriction-lock)
 (org-defkey org-mode-map "\C-c-"    'org-ctrl-c-minus)
 (org-defkey org-mode-map "\C-c*"    'org-ctrl-c-star)
+(org-defkey org-mode-map (kbd "C-c TAB") #'org-ctrl-c-tab)
 (org-defkey org-mode-map "\C-c^"    'org-sort)
 (org-defkey org-mode-map "\C-c\C-c" 'org-ctrl-c-ctrl-c)
 (org-defkey org-mode-map "\C-c\C-k" 'org-kill-note-or-show-branches)
@@ -21077,6 +21078,15 @@ context.  See the individual commands for more information."
   (interactive)
   (org-return t))
 
+(defun org-ctrl-c-tab (&optional arg)
+  "Toggle columns width in a table, or show children.
+Call `org-table-toggle-column-width' if point is in a table.
+Otherwise, call `org-show-children'."
+  (interactive "p")
+  (call-interactively
+   (if (org-at-table-p) #'org-table-toggle-column-width
+     #'org-show-children)))
+
 (defun org-ctrl-c-star ()
   "Compute table, or change heading status of lines.
 Calls `org-table-recalculate' or `org-toggle-heading',