emacs不常用配置

1. 修改emacs的界面大小/颜色

;; frame configuration  
(setq default-frame-alist  
             '(  
               (top . 16)  
               (left . 64)  
               (width . 144)  
               (height . 40)     
               ;(mouse-color . "gold1")  
               (cursor-color . "gold1")  
               (background-color . "black")  
               (foreground-color . "grey")  
               ;;(right-fringe)  
               ;;(left-fringe)  
              )  
) 

2. emacs最大化/最小化

;; linux
(defun my-maximized ()
  (interactive)
  (x-send-client-message
    nil 0 nil "_NET_WM_STATE" 32
    '(2 "_NET_WM_STATE_MAXIMIZED_HORZ" 0)
  )
  (x-send-client-message
    nil 0 nil "_NET_WM_STATE" 32
    '(2 "_NET_WM_STATE_MAXIMIZED_VERT" 0)
  )
)
;;(my-maximized)  ;;启动时最大化
;; windows
;; window maximize/minimize/normal
(defun emacs-maximize ()
  "Maximize emacs window in windows os"
  (interactive)
  (w32-send-sys-command 61488))
(defun emacs-minimize ()
  "Minimize emacs window in windows os"
  (interactive)
  (w32-send-sys-command #xf020))
(defun emacs-normal ()
  "Normal emacs window in windows os"
  (interactive)
  (w32-send-sys-command #xf120))
;;(emacs-maximize) ;;启动时最大化

;; 自动控制
(cond
 ((string-equal system-type "windows-nt")
  (progn
    (message "Windows-nt")
    (emacs-maximize))
  )
 ((string-equal system-type "gnu/linux")
  (progn
    (message "GNU/Linux")
    (my-maximized))
  )
 )


你可能感兴趣的:(配置,emacs)