2

我的 .emacs 文件中的旧的、可靠的(set-cursor-color "#aa88dd")会因 Aquamacs 而失败,除非它在 ​​Aquamacs 启动后运行。这种类型的失败是 Emacs 在启动期间做一些秘密的典型,但我不知道是什么。我修改并保存了光标的 Aquamacs 设置(光标面:背景:),它适用于会话,并保存设置,但没有为下一个会话正确初始化。即便如此,我还是有一个鲜红色的光标。

工作 Emacs:GNU Emacs 23.2.1(i686-apple-darwin,NS apple-appkit-1038.29)

失败的 Aquamacs:GNU Emacs 23.3.50.1(i386-apple-darwin9.8.0,NS apple-appkit-949.54)

1) 解决方法和修复表示赞赏。目前我正在使用 23.2.1。我不觉得有必要升级,但迟早我必须升级。

2)搜索互联网一无所获。我怀疑这个问题是与其他问题相关的问题,即 Aquamacs 无法确定某些设置并选择红色作为光标颜色。是否有让 Emacs 将每个加载的配置文件的名称打印到Messages的技巧?

3)相关的大图问题:一般有没有办法强制新版本的 Emacs 表现得像旧版本?它将解决我当前的问题,以及新版本偶尔发生的剧变。

下面是 Aquamacs customizes.el,它似乎已正确保存了光标背景。我没有编辑这个文件。将 (cursor...) 语句添加到我的 .emacs custom-set-variable 没有任何效果。

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(cua-mode nil nil (cua-base))
 '(cua-normal-cursor-color "#aa88dd")
 '(cursor-type (quote box))
 '(ess-S-assign "_")
 '(ido-everywhere t)
 '(ido-show-dot-for-dired t)
 '(line-move-visual nil)
 '(term-bind-key-alist (quote (("C-c C-x b" . switch-to-buffer) ("C-c M-x" . execute-extended-command) ("C-c C-c" . term-interrupt-subjob) ("M-`" . other-frame) ("C-m" . term-send-raw))))
 '(term-unbind-key-list (quote ("C-c"))))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(default ((t (:inherit nil :stipple nil :background "White" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 210 :width normal :foundry "apple" :family "Inconsolata"))))
 '(cua-normal-cursor-color "#aa88dd")
 '(cursor ((t (:background "#AA88DD" :foreground "black" :box nil)))))
4

3 回答 3

2

我并不完全迷恋 Aquamacs,但 emacsforosx 有一个非常烦人的(对我而言)属性,即窗口位置不会跨会话保存......它总是在我的主显示器的左上角打开,而不是我放置它的位置. 而且没有办法修复它。

我不记得我在哪里找到/了解到这是设置光标颜色的方法,但请参阅此常见问题解答:

http://www.emacswiki.org/emacs/AquamacsFAQ#toc16

打开缓冲区并按照您喜欢的方式设置内容。然后选择

选项->外观->采用面和框架参数作为框架默认值

这将default-frame-alistcustom-set-variables您的customizations.el.

如果您以后想要不同的光标颜色,您可以根据口味进行调味。

于 2013-03-13T21:45:14.073 回答
0

Try putting a message at the bottom of your .emacs file (message "Hello -- this message came from the bottom of your .emacs file.") and a different message at the bottom of your customizations.el file (message "Hello -- this message came from the bottom of your customizations.el file."). The one that loads last will determine your cursor color settings if you have conflicting settings in each configuration file. If there is only one setting for the cursor color in either of those files, then you need to do a word search in the source files of Aquamacs to find out where else that cursor color is being set. For example, the following are the results of a word search for set-cursor-color in the source files for the most recent version of the Aquamacs24 branch on Github: https://github.com/davidswelt/aquamacs-emacs

The source files in the packaged application of Aquamacs are probably going to be compressed in a *.gz format. Depending upon the word search file utility you are using, you may need to perform a search on source files that are not compressed -- it may be easier to just download the source from Github since those source files will all be in an uncompressed format. There is zip download button once you select the branch you want.

Searching 9317 files for "set-cursor-color"

/Users/HOME/Desktop/aquamacs-emacs-aquamacs24/lisp/aquamacs/oneonone/oneonone.el:
 1453    "Set cursor type depending on whether an input method is used or not."
 1454    (when 1on1-change-cursor-on-input-method-flag
 1455:     (set-cursor-color
 1456       (if current-input-method
 1457           1on1-default-frame-cursor-color-input-method

/Users/HOME/Desktop/aquamacs-emacs-aquamacs24/lisp/emulation/cua-base.el:
 1141        (stringp color)
 1142        (not (equal color (frame-parameter nil 'cursor-color))))
 1143:  (set-cursor-color color))
 1144      (if (and type
 1145        (symbolp type)

/Users/HOME/Desktop/aquamacs-emacs-aquamacs24/lisp/emulation/viper-util.el:
  156  ;; This was equally true before the advent of viper-frame-value.
  157  ;; Now it could be changed by passing frame to v-f-v.
  158: (defun viper-set-cursor-color-according-to-state (&optional frame)
  159    (cond ((eq viper-current-state 'replace-state)
  160    (viper-change-cursor-color

/Users/HOME/Desktop/aquamacs-emacs-aquamacs24/lisp/emulation/viper.el:
  946        ))
  947  
  948:   (defadvice set-cursor-color (after viper-set-cursor-color-ad activate)
  949      "Change cursor color in VI state."
  950      (modify-frame-parameters

/Users/HOME/Desktop/aquamacs-emacs-aquamacs24/lisp/frame.el:
 1208        (face-set-after-frame-default (selected-frame))))
 1209  
 1210: (defun set-cursor-color (color-name)
 1211    "Set the text cursor color of the selected frame to COLOR-NAME.
 1212  When called interactively, prompt for the name of the color to use.

/Users/HOME/Desktop/aquamacs-emacs-aquamacs24/lisp/term/pc-win.el:
  349  (fset 'set-default-font 'ignore)
  350  (fset 'set-mouse-color 'ignore)      ; We cannot, I think.
  351: (fset 'set-cursor-color 'ignore) ; Hardware determined by char under.
  352  (fset 'set-border-color 'ignore) ; Not useful.
  353  
于 2014-02-03T22:35:27.437 回答
0

如果您怀疑您的 Emacs 版本在启动期间做了一些我们覆盖您的偏好的事情,您可以尝试在初始化时间之后通过在以下位置添加一个函数来设置您的偏好after-init-hook

(add-hook 'after-init-hook (lambda () (set-cursor-color "#aa88dd")) 'append)

也许这会导致您的自定义被评估得足够晚以覆盖默认值。(编辑:使用“append”参数,这个函数将被添加到钩子列表的末尾,希望覆盖 Aquamacs 放在那里的任何其他东西。)

于 2013-02-19T23:02:07.517 回答