简体   繁体   English

检查局部变量在 emacs org-mode 中是否具有特定值

[英]Check local variable has particular value in emacs org-mode

How can I check that the value for org-drill-cram-hours has been set in the buffer (emacs-org-mode)?如何检查org-drill-cram-hours的值是否已在缓冲区(emacs-org-mode)中设置?

# Local Variables:
# org-drill-cram-hours: 0
# org-drill-hide-item-headings-p: t
# End:
  1. I have the above in the TOP OF MY org-mode buffer.我在我的组织模式缓冲区的顶部有上述内容。
  2. I re-opened the file using Cx Cv after adding these values.添加这些值后,我使用Cx Cv重新打开了文件。
  3. I don't think the local variable value is set, cause when I run org-drill-cram , it does not do what is expected (go over all the buffer points ie).我认为没有设置局部变量值,因为当我运行org-drill-cram时,它没有做预期的事情(遍历所有缓冲点,即)。

I want to check the local value set for org-drill-cram-hours , but when I do Ch v org-drill-cram-hours , I don't see the buffer-local value.我想检查为org-drill-cram-hours设置的本地值,但是当我执行Ch v org-drill-cram-hours ,我看不到缓冲区本地值。

org-drill-cram-hours is a variable defined in ‘org-drill.el’.
Its value is 12

What am I missing?我错过了什么? I don't want to use setq or Ch v variable to SET the value.我不想使用setqCh v variable来设置值。

PS附言
(However if I change the variable value through Ch v var , then org-drill-cram works as expected.) (但是,如果我通过Ch v var更改变量值,那么org-drill-cram会按预期工作。)

Just use Ch v org-drill-cram-hours with that buffer current .只需将Ch v org-drill-cram-hours与该缓冲区 current 一起使用

That tells you (1) the buffer-local value, if there is one, and (2) the global value.这告诉您(1)缓冲区本地值(如果有),以及(2)全局值。 If it doesn't specify a buffer-local value then you haven't defined one for that buffer.如果它没有指定缓冲区本地值,那么您还没有为该缓冲区定义一个值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM