【问题标题】:aquamacs red cursoraquamacs 红色光标
【发布时间】:2014-02-04 06:43:55
【问题描述】:

我的 .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 定制化.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)))))

【问题讨论】:

  • 帮自己一个忙,避开 Aquamacs。它已经过时,几乎没有维护。相反,使用来自emacsformacosx.com 的普通 GNU Emacs 24.3 预测试。
  • 那行得通。我认为我的“工作”版本 emacsformacosx。它具有相同的图标,相同的安装路径,并且光标设置有效。我很久以前就安装了它,没有做笔记。一个更完整的答案可能会很有趣,但我还有工作要做。潜伏者注意:emacsformacosx 是真正的 Emacs,它是一个普通的 MacOS 应用程序,不需要 X-Windows。

标签: macos emacs dot-emacs aquamacs


【解决方案1】:

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

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

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

打开一个缓冲区并按照您喜欢的方式进行设置。然后选择

Options->Appearance->采用 Face 和 Frame 参数作为 Frame Default

这会将default-frame-alist 定义放在customizations.elcustom-set-variables 部分。

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

【讨论】:

  • 我看不到使用 Aquamacs,因为它严重违反了正常的 Emacs 约定。一旦你开始走这条路,你的配置就不是可移植的。此外,我习惯于移动和调整 Mac 放置在反直觉位置的新窗口。
【解决方案2】:

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

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

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

【讨论】:

  • 它不起作用。 Aquamacs 将自定义设置添加到 after-init-hook,本质上也破坏了此功能。你最终会得到这个:(lambda nil (set-cursor-color "#aa88dd")) aquamacs-turn-on-buffer-offer-save-in-scratch aquamacs-notice-user-settings aquamacs-update-new-file-menu aquamacs-create-customization-fontsets (lambda nil (if tabbar-mode (add-to-list ... ...)) (quote append)) aquamacs-setup-echo-areas smart-fp--load-frame-positions-from-file check-for-aquamacs-crashes aquamacs-check-for-updates-if-necessary display-startup-echo-area-message-2)
【解决方案3】:

尝试在.emacs 文件(message "Hello -- this message came from the bottom of your .emacs file.") 的底部添加一条消息,并在customizations.el 文件(message "Hello -- this message came from the bottom of your customizations.el file.") 的底部添加一条不同的消息。如果您在每个配置文件中有冲突的设置,最后加载的将决定您的光标颜色设置。如果这些文件中的任何一个只有一个光标颜色设置,那么您需要在 Aquamacs 的源文件中进行字词搜索,以找出设置光标颜色的其他位置。例如,以下是在 Github 上最新版本的 Aquamacs24 分支的源文件中搜索 set-cursor-color 的结果:https://github.com/davidswelt/aquamacs-emacs

Aquamacs 打包应用程序中的源文件可能会以 *.gz 格式压缩。根据您使用的单词搜索文件实用程序,您可能需要对未压缩的源文件执行搜索——从 Github 下载源文件可能更容易,因为这些源文件都是未压缩的格式。一旦你选择了你想要的分支,就会有 zip 下载按钮。

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  

【讨论】:

    猜你喜欢
    • 2012-07-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-01
    • 2019-06-09
    • 2012-07-16
    • 2016-10-01
    • 1970-01-01
    相关资源
    最近更新 更多