2013-02-19 42 views
2

我的.emacs文件中舊的可靠(set-cursor-color「#aa88dd」)失敗,Aquamacs失敗,除非它在Aquamacs啓動後運行。這種類型的失敗是Emacs在啓動時做了一些祕密的典型事情,但我無法弄清楚。我修改並保存了Aquamacs設置光標(光標face:background :),它適用於會話,並保存設置,但不會爲下一個會話正確初始化。即便如此,我還是有一個明亮的紅色光標。aquamacs紅色光標

工作的Emacs:GNU Emacs的23.2.1(i686的,蘋果達爾文,NS蘋果了AppKit-1038.29)

失敗Aquamacs:GNU Emacs的23.3.50.1(I386-蘋果darwin9.8.0,Apple蘋果NS appkit-949.54)

1)讚賞解決方法和修復。目前我正在使用23.2.1。我不覺得有必要升級,但遲早我不得不這樣做。

2)搜索interwebs什麼都沒有。我懷疑這個問題是一個與其他問題有關的紅鯡魚,其中Aquamacs無法確定某些設置並選擇Red作爲光標顏色。是否有一招讓Emacs將每個加載的配置文件的名稱打印到消息

3)相關的大圖問題:通常有一種方法來強制Emacs的新版本像舊版本一樣行事嗎?它將解決我目前的問題,以及偶爾在新版本中發生的劇變。

下面是Aquamacs customizations.el,它似乎已經正確保存了光標背景。我沒有編輯這個文件。將(遊標...)語句添加到我的.emacs自定義設置變量沒有效果。

(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))))) 
+0

幫你一個忙,順水Aquamacs。它已經過時並且幾乎沒有維護。相反,請使用http://emacsformacosx.com/中的普通GNU Emacs 24.3預測試。 – lunaryorn 2013-02-19 15:16:35

+0

這很有效。我認爲,我的「工作」版**是** emacsformacosx。它具有相同的圖標,相同的安裝路徑以及光標設置。我很久以前安裝了它,並沒有記錄筆記。更完整的答案可能很有趣,但我有工作要做。注意潛伏者:emacsformacosx是真正的Emacs,它是一個普通的MacOS應用程序,不需要X-Windows。 – infogizmo 2013-02-19 22:32:21

回答

0

如果您懷疑您的Emacs的版本做啓動過程中的東西,我們重寫你的喜好,你可以嘗試把一個函數after-init-hook設置初始化時間後,你的喜好:

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

也許這會導致您的自定義評估時間足夠晚,以覆蓋默認設置。 (編輯:使用「append」參數,該函數將被添加到鉤子列表的末尾,希望覆蓋Aquamacs放在那裏的任何其他東西。)

+0

它不起作用。 Aquamacs將自定義設置添加到after-init-hook中,實質上也破壞了該功能。你最終得到這個: '(lambda nil(set-cursor-color「#aa88dd」))aquamacs-turn-on-buffer-offer-save-in-scratch aquamacs-notice-user-settings aquamacs-update-新的文件菜單aquamacs-create-customization-fontsets(lambda nil(如果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)' – infogizmo 2013-03-15 02:27:29

+0

我忘了提及這個工程很棒與真正的Emacs。 – infogizmo 2013-03-15 02:57:33

2

我並不完全迷戀Aquamacs,但emacsforosx已經非常討厭(對我)屬性,窗口位置沒有跨會話保存....它總是打開在我的主顯示器的左上角,而不是我放置它的位置。而且沒有辦法解決它。

我不記得在那裏我發現/瞭解到,這是設置光標顏色,但看到這個常見問題的方式:

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

打開一個緩衝區,並設置東西你喜歡的方式。然後,選擇

選項 - > Appearance->採用的表面和框架參數爲框架默認

這將會把一個default-frame-alist定義你的customizations.elcustom-set-variables部分。

然後你可以季節品嚐,如果你以後想要一個不同的光標顏色。

+0

我無法看到使用Aquamacs,因爲它嚴重破壞了正常的Emacs慣例。一旦你開始了這條道路,你的配置是不可移植的。此外,我習慣於移動和調整Mac放置在反直覺位置的新窗口的大小。 – infogizmo 2013-03-15 02:25:55

0

嘗試把一個消息你.emacs文件(message "Hello -- this message came from the bottom of your .emacs file.")的底部,不同的消息在您的customizations.el文件​​的底部。如果每個配置文件中存在衝突的設置,最後加載的將決定您的光標顏色設置。如果在這兩個文件中只有一個設置了光標顏色的一個,那麼您需要在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