diff options
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/term/ns-win.el | 24 |
2 files changed, 5 insertions, 22 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b8fc9b32f98..7dea339d669 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2013-09-12 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2013-09-12 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * term/ns-win.el (parameters): Don't declare as dynamic. | ||
| 4 | (before-make-frame-hook): Don't add ineffective function. | ||
| 5 | |||
| 3 | * eshell/*.el: Use lexical-binding (bug#15231). | 6 | * eshell/*.el: Use lexical-binding (bug#15231). |
| 4 | 7 | ||
| 5 | 2013-09-12 Kenichi Handa <handa@gnu.org> | 8 | 2013-09-12 Kenichi Handa <handa@gnu.org> |
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el index b4693a5451a..225f809d70b 100644 --- a/lisp/term/ns-win.el +++ b/lisp/term/ns-win.el | |||
| @@ -556,29 +556,9 @@ unless the current buffer is a scratch buffer." | |||
| 556 | (interactive) | 556 | (interactive) |
| 557 | (other-frame -1)) | 557 | (other-frame -1)) |
| 558 | 558 | ||
| 559 | ;; If no position specified, make new frame offset by 25 from current. | 559 | ;; Frame will be focused anyway, so select it |
| 560 | ;; You'd think this was a window manager's job, but apparently without | ||
| 561 | ;; this, new frames open exactly on top of old ones (?). | ||
| 562 | ;; http://lists.gnu.org/archive/html/emacs-devel/2010-10/msg00988.html | ||
| 563 | ;; Note that AFAICS it is not documented that functions on | ||
| 564 | ;; before-make-frame-hook can access PARAMETERS. | ||
| 565 | (defvar parameters) ; dynamically bound in make-frame | ||
| 566 | (add-hook 'before-make-frame-hook | ||
| 567 | (lambda () | ||
| 568 | (let ((left (cdr (assq 'left (frame-parameters)))) | ||
| 569 | (top (cdr (assq 'top (frame-parameters))))) | ||
| 570 | (if (consp left) (setq left (cadr left))) | ||
| 571 | (if (consp top) (setq top (cadr top))) | ||
| 572 | (cond | ||
| 573 | ((or (assq 'top parameters) (assq 'left parameters))) | ||
| 574 | ((or (not left) (not top))) | ||
| 575 | (t | ||
| 576 | (setq parameters (cons (cons 'left (+ left 25)) | ||
| 577 | (cons (cons 'top (+ top 25)) | ||
| 578 | parameters)))))))) | ||
| 579 | |||
| 580 | ;; frame will be focused anyway, so select it | ||
| 581 | ;; (if this is not done, mode line is dimmed until first interaction) | 560 | ;; (if this is not done, mode line is dimmed until first interaction) |
| 561 | ;; FIXME: Sounds like we're working around a bug in the underlying code. | ||
| 582 | (add-hook 'after-make-frame-functions 'select-frame) | 562 | (add-hook 'after-make-frame-functions 'select-frame) |
| 583 | 563 | ||
| 584 | (defvar tool-bar-mode) | 564 | (defvar tool-bar-mode) |