emacs不常用配置

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wangell/article/details/39526799

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))
  )
 )


猜你喜欢

转载自blog.csdn.net/wangell/article/details/39526799