Emacs Orgmode单元格的表格格式
我有一个Emacs组织模式表,如下所示:Emacs Orgmode单元格的表格格式,emacs,org-mode,org-table,Emacs,Org Mode,Org Table,我有一个Emacs组织模式表,如下所示: |--------------------------------+------------------------------------------------------| | <20> | <60> | | How do you alter your password |
|--------------------------------+------------------------------------------------------|
| <20> | <60> |
| How do you alter your password | The command to alter your password in oracle is:: |
| in Oracle? | |
| | ALTER USER {userid} IDENTIFIED BY {password}; |
| | |
|--------------------------------+------------------------------------------------------|
它会自动修剪表中内容的前导空格。有没有办法在组织模式表中防止这种情况?我希望组织模式不更改内容的格式
这是Emacs版本
24.3.50
,但在版本24.2
(我在两个版本中都尝试过)中的行为是相同的。一种真正的黑客方法是重新定义或修改org table align。相关片段大致在这里。通过将*更改为?,将保留开头的空格
--- ./org-table.el
+++ ./org-table.el.orig
@@ -752,7 +752,7 @@
;; Get the data fields by splitting the lines.
(setq fields (mapcar
(lambda (l)
- (org-split-string l " *| *"))
+ (org-split-string l " *| ?"))
(delq nil (copy-sequence lines))))
;; How many fields in the longest line?
(condition-case nil
---/org-table.el
+++/org-table.el.orig
@@ -752,7 +752,7 @@
;; 通过拆分行来获取数据字段。
(setq字段(mapcar)
(λ(l)
-(组织拆分字符串l“*|*”)
+(组织拆分字符串l“*|?”)
(delq nil(复制序列行)))
;; 最长的一行有多少字段?
(情况无)
我不确定你是否真的想这么做。你会考虑改组标记,也许是用标题代替自定义标记函数,以防你真的需要它之后看起来像表?如果这使你变得笨拙,那么另一种实现方法可能是用Ay+NeXEXHTML和Ay+EnEXHTML块。啊……
尝试将数字丰富的列自动对齐到右侧我刚刚尝试了你的建议,它将所有文本对齐。这不是我想做的。我希望有一种方法可以让它不对内容进行任何格式化。使用不可拆分的空格怎么样?组织模式不会触及它们。它可以工作。C-x 8 SPC
用于插入此类空格。对于您正在执行的任务,我使用了一种截然不同的方法:将问题作为链接放在表格中,将答案作为标题。例如:
--- ./org-table.el
+++ ./org-table.el.orig
@@ -752,7 +752,7 @@
;; Get the data fields by splitting the lines.
(setq fields (mapcar
(lambda (l)
- (org-split-string l " *| *"))
+ (org-split-string l " *| ?"))
(delq nil (copy-sequence lines))))
;; How many fields in the longest line?
(condition-case nil