Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
循环自定义主题,带emacs 24_Emacs - Fatal编程技术网

循环自定义主题,带emacs 24

循环自定义主题,带emacs 24,emacs,Emacs,我目前正在为Emacs24使用新的customtheme工具,我希望能够通过点击一个键(比如f12)来循环定制主题 下面的代码听起来就像我想要它做的一样,但是它使用了颜色主题,这是我不想做的。我对Lisp还不够熟悉,还不能自己写这篇文章,也不能从旧版本转换到新版本。有没有人可以帮助我使用新的内置加载主题命令将相同的功能添加到emacs 24中 另外,基于,我可能需要在每次调用函数时调用disable theme 非常感谢您的帮助 这是使用颜色主题的旧解决方案 (defun my-theme-se

我目前正在为Emacs24使用新的customtheme工具,我希望能够通过点击一个键(比如f12)来循环定制主题

下面的代码听起来就像我想要它做的一样,但是它使用了颜色主题,这是我不想做的。我对Lisp还不够熟悉,还不能自己写这篇文章,也不能从旧版本转换到新版本。有没有人可以帮助我使用新的内置加载主题命令将相同的功能添加到emacs 24中

另外,基于,我可能需要在每次调用函数时调用disable theme

非常感谢您的帮助

这是使用颜色主题的旧解决方案

(defun my-theme-set-default () ; Set the first row
  (interactive)
  (setq theme-current my-color-themes)
  (funcall (car theme-current)))

(defun my-describe-theme () ; Show the current theme
  (interactive)
  (message "%s" (car theme-current)))

; Set the next theme (fixed by Chris Webber - tanks)
(defun my-theme-cycle ()        
  (interactive)
  (setq theme-current (cdr theme-current))
  (if (null theme-current)
  (setq theme-current my-color-themes))
  (funcall (car theme-current))
  (message "%S" (car theme-current)))

(setq theme-current my-color-themes)
(setq color-theme-is-global nil) ; Initialization
(my-theme-set-default)
(global-set-key [f12] 'my-theme-cycle)

FWIW,这里有两种现成的方法(使用冰柱Do Re Mi)来(您称之为Emacs 24的颜色主题,但它们是自定义主题,而不是颜色主题)。同一页解释了颜色主题和自定义主题之间的差异。

这里有一些代码类似于Jakubozak的代码,但转换速度不如颜色主题快。我完全不明白为什么,但这似乎是由自定义主题和颜色主题之间的差异造成的。虽然如果你把你的自行车限制在emacs附带的主题上,这似乎更容易接受

(setq my-themes (list 'tango 'solarized-dark 'solarized-light 'alect-dark)) ;;the themes I cycle among
(setq curr-theme my-themes)

(defun my-theme-cycle ()
    (interactive)
    (disable-theme (car curr-theme)) ;;Nee flickeringded to stop even worse
    (setq curr-theme (cdr curr-theme))
    (if (null curr-theme) (setq curr-theme my-themes))
    (load-theme (car curr-theme) t)
    (message "%s" (car curr-theme))
)

(global-set-key [f12] 'my-theme-cycle)
(setq curr-theme my-themes)
(load-theme (car curr-theme) t) 

我找到了那个网站,我提供的代码就是从那里提取出来的。这是通过重复Jakubozak的命令代码进行的循环。我遇到的问题可能部分是由于我对名字的误解,他似乎是为颜色主题设置的,我想使用自定义主题。更正了我的帖子:四种循环主题的方法,但其中只有两种用于循环自定义主题:冰柱和Do Re Mi。没有编程,没有麻烦。现在取决于你想做什么。和init.el的好方法和酷方法