改变 Emacs 启动窗口(Frame)大小和启动位置

[技巧] 改变 Emacs 启动窗口(Frame)大小和启动位置 

[复制连接]

35 php

主题

0 html

好友

844 算法

积分

你们网大学一年级 windows

Rank: 14Rank: 14Rank: 14Rank: 14

积分844帖子221精华7经验538 点威望0 点金币475
电梯直达 跳转到指定楼层
1
  发表于 2010-8-29 17:07  | 只看该做者  | 倒序浏览
Emacs使用Lisp语言能够对其进行高度制定,也正是有了lisp,才能有这么多的扩展使用得emacs成为最牛的操做平台

改变emacs的frame大小及位置的方法不止一种,这里给一个用lisp包装的函数,方便你们使用
  1. (defun arrange-frame (w h x y)
  2.   "Set the width, height, and x/y position of the current frame"
  3.   (let ((frame (selected-frame)))
  4.     (delete-other-windows)
  5.     (set-frame-position frame x y)
  6.     (set-frame-size frame w h)
  7.   )
  8. )
  9. (arrange-frame 120 30 100 50)
复制代码
arrange-frame (w h x y) 这人函数的w h x y分别是frame的宽、高、左上角x坐标、左上角y坐标
算法+语言=内功+招式
{ Standing on Shoulders of Giants }

35 post

主题

0 ui

好友

844 spa

积分

你们网大学一年级 htm

Rank: 14Rank: 14Rank: 14Rank: 14

积分844帖子221精华7经验538 点威望0 点金币475
2
  发表于 2010-8-29 17:24  | 只看该做者
简单设置 emacs 窗口大小
  1. (add-to-list 'default-frame-alist '(width . 120))
  2. (add-to-list 'default-frame-alist '(height . 35))
复制代码
算法+语言=内功+招式
{ Standing on Shoulders of Giants }

35

主题

0

好友

844

积分

你们网大学一年级

Rank: 14Rank: 14Rank: 14Rank: 14

积分844帖子221精华7经验538 点威望0 点金币475
3
  发表于 2010-8-29 17:27  | 只看该做者
再来一种方法
  1. (if (window-system) (set-frame-width (selected-frame) 120))
  2. (if (window-system) (set-frame-height (selected-frame) 35))
复制代码
算法+语言=内功+招式
{ Standing on Shoulders of Giants }

35

主题

0

好友

844

积分

你们网大学一年级

Rank: 14Rank: 14Rank: 14Rank: 14

积分844帖子221精华7经验538 点威望0 点金币475
4
  发表于 2010-8-29 17:28  | 只看该做者
再来,
  1. (setq default-frame-alist
  2. '((height . 35) (width . 120) (menu-bar-lines . 20) (tool-bar-lines . 0)))
复制代码
算法+语言=内功+招式
{ Standing on Shoulders of Giants }

35

主题

0

好友

844

积分

你们网大学一年级

Rank: 14Rank: 14Rank: 14Rank: 14

积分844帖子221精华7经验538 点威望0 点金币475
5
  发表于 2010-8-29 17:31  | 只看该做者
x window下,用这个也能够达到一样的效果

~/.Xdefaults 中增长下面这行
  1. Emacs.geometry: 120x35
复制代码
算法+语言=内功+招式 { Standing on Shoulders of Giants }
相关文章
相关标签/搜索