From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.help Subject: Re: Single modeline for all buffers? Date: Wed, 05 Feb 2014 18:46:48 +0100 Message-ID: <52F27908.1030809@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1391622444 15992 80.91.229.3 (5 Feb 2014 17:47:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Feb 2014 17:47:24 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: self@gkayaalp.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 05 18:47:31 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WB6ZP-00057d-7B for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Feb 2014 18:47:31 +0100 Original-Received: from localhost ([::1]:60686 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WB6ZO-0002me-Qo for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Feb 2014 12:47:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WB6Z4-0002mY-Bp for help-gnu-emacs@gnu.org; Wed, 05 Feb 2014 12:47:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WB6Yv-0004ME-AO for help-gnu-emacs@gnu.org; Wed, 05 Feb 2014 12:47:10 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:62757) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WB6Yu-0004M2-W3 for help-gnu-emacs@gnu.org; Wed, 05 Feb 2014 12:47:01 -0500 Original-Received: from [62.47.51.89] ([62.47.51.89]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0Mam2Q-1Vv55728gE-00KQGm for ; Wed, 05 Feb 2014 18:46:59 +0100 Original-References: 87ppn1292g.fsf@gkayaalp.com X-Provags-ID: V03:K0:Z9ZO96KVO5R5BXeb3UMzUiBeOq0TqR+Jn+GoA8hugZBjhQsobmP XfB3ErOgWiPShMseHIkhuYKPLZPEsFsKSnmVU6Qp3QMFhvmtGbfcDhM43JscVPbqO2iFrMJ Xp2VDajuk617xNu9c5m4+KNlUiV3uM3y+yb8rpZ73/NiYAe0pQMMK+waf2p9A2iOKEkrDiD om2JrmsAmWSZMFSB1azKA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.15.18 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:95932 Archived-At: > Can I have sth. like the following? > > | [#]include | (defun add (x y) (+ x y)\| > | int main(int argc, char \| ) | > | ** argv, char ** envp) { | (add 5 6) ;=> 11 | > ------------------------------------------------------- > |-:-- hello.c Top (1, 0) (C/l Arev AC hl-p hl-s Abb| > ------------------------------------------------------- > | | > ------------------------------------------------------- Not really. This would require a major redesign of the involved components. If you have Emacs 24.4 you can try (better with Emacs -Q) the proof of concept below (for fun only). If you are really interested, you'd have to fill in two things: (1) A mechanism that would allow this to work with multiple frames (that is, things like mode-line-buffer and mode-line-window would have to become frame parameters). This is fairly easy. (2) A mechanism to implement keybindings in the mode-line buffer. This should be easy too but is likely tedious. You would mostly have to replace occurrences of (with-selected-window (posn-window (event-start event)) with something like (with-selected-window mode-line-really-selected-window where mode-line-really-selected-window would refer to the window the mode-line is currently talking about. martin (defvar mode-line-buffer (get-buffer-create "mode-line")) (defvar mode-line-window (display-buffer-in-side-window mode-line-buffer nil)) (defvar original-mode-line nil) (make-variable-buffer-local 'original-mode-line) (with-current-buffer mode-line-buffer (font-lock-mode -1) (setq mode-line-format nil)) (defun mode-line-buffer-list () (walk-window-tree (lambda (window) (with-current-buffer (window-buffer window) (when mode-line-format (setq original-mode-line-format mode-line-format) (setq mode-line-format nil)))))) (defun mode-line-post-command () (let ((format original-mode-line-format) (buffer (current-buffer)) (window (selected-window))) (with-selected-window mode-line-window (erase-buffer) (insert (format-mode-line format 'mode-line window buffer)) (let ((window-min-height 1) (window-resize-pixelwise t)) (setq window-size-fixed nil) (fit-window-to-buffer) (set-window-start nil (point-min)) (setq window-size-fixed t))))) (with-selected-window mode-line-window (buffer-face-set 'mode-line) (setq default-frame-alist '((right-divider-width . 4) (bottom-divider-width . 4))) (set-window-margins nil 0 0) (set-window-fringes nil 0 0) (set-window-scroll-bars nil 0) (setq cursor-type nil) (set-window-parameter nil 'no-other-window t) (set-window-dedicated-p nil t)) (add-hook 'post-command-hook 'mode-line-post-command) (add-hook 'buffer-list-update-hook 'mode-line-buffer-list)