emacs - 如何获取组织表中某个点的列名和字段名

标签 emacs org-mode spacemacs

这样的表格:

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

当我在“i am here”行输入时,是否有任何内置函数可以执行此操作?

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!")
    )
  )

关于emacs - 如何获取组织表中某个点的列名和字段名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47988029/

相关文章:

emacs - 如何安装 org-drill?

org-mode - 如何在组织模式下将 [t] 选项添加到列导出到投影仪?

ide - Spacemacs:如何在文件夹之间导航?

emacs - 提取二级标题

emacs - 在 Spacemacs 中,如何在不进入插入模式的情况下插入换行符?

c++ - Emacs、cedet 和 c++/c++11 支持

emacs - Elisp 本身有 flymake 模式吗?

emacs - 使组织议程全屏

Emacs大写锁定小模式?

vim - 如何从 shell 脚本启动编辑器?