如何在org-table中的点获取列名和字段名称



这样的表:

|  Time | ---AAA ---  | ---BBB ---  |
|-------+-------------+-------------+
|  9:45 |             |             |
| 10:00 |             |             |
| 10:15 |  i am here  |             |
| 10:30 |             |             |
| 10:45 |             |             |
|-------+-------------+-------------+

当我在"我在这里"中输入时,是否有任何建筑功能可以执行此操作?

get-current-column-name(),return "AAA"
get-current-line-name(),return "10:15"

我找不到任何构建功能,所以我写了它们,希望它有帮助

(defun dindom/org-table-get-current-colname()
  "get current column name if in org table"
  (if (org-table-p)
      (org-table-get 1 nil)
    (message "not in table!")
    )
  )
(defun dindom/org-table-get-current-linename()
  "get current line name if in org table"
  (if (org-table-p)
      (org-table-get nil 1)
    (message "not in table!")
    )
  )

或使用org-table-get-field:

(defun dindom/org-table-get-current-linename()
  "get current line name if in org table"
  (if (org-table-p)
      (save-excursion
        (org-table-get-field 1)
        )
    (message "not in table!")
    )
  )

最新更新