From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.devel Subject: problem with fullscreen(now with actual attachment) Date: Mon, 08 Jun 2009 22:32:45 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1244539731 10183 80.91.229.12 (9 Jun 2009 09:28:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Jun 2009 09:28:51 +0000 (UTC) To: Emacs Development Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 09 11:28:49 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MDxdP-0007EF-4v for ged-emacs-devel@m.gmane.org; Tue, 09 Jun 2009 11:28:47 +0200 Original-Received: from localhost ([127.0.0.1]:51890 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MDxdO-0000RS-A2 for ged-emacs-devel@m.gmane.org; Tue, 09 Jun 2009 05:28:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MDxcH-0008MT-Jf for emacs-devel@gnu.org; Tue, 09 Jun 2009 05:27:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MDxcF-0008Kl-L3 for emacs-devel@gnu.org; Tue, 09 Jun 2009 05:27:36 -0400 Original-Received: from [199.232.76.173] (port=33161 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MDxcF-0008KG-Al for emacs-devel@gnu.org; Tue, 09 Jun 2009 05:27:35 -0400 Original-Received: from h-131-104.a184.priv.bahnhof.se ([85.24.131.104]:41517 helo=localhost.localdomain) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MDxcE-0000Mf-PQ for emacs-devel@gnu.org; Tue, 09 Jun 2009 05:27:35 -0400 Original-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.14.3/8.14.3) with ESMTP id n58KWjae005745 for ; Mon, 8 Jun 2009 22:32:46 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-Greylist: delayed 3593 seconds by postgrey-1.27 at monty-python; Tue, 09 Jun 2009 05:27:34 EDT X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:111391 Archived-At: --=-=-= I have a mode which toggles full-screen and other things. (find it attached) It has worked well, but suddenly it has stopped working when I did an emacs update. The problem is that the following code doesnt enter fullscreen: (set-frame-parameter nil 'fullscreen 'fullboth) However, the fragment does work in an emacs -Q session. So, it would appear some of my other emacs init code disables fullscreen somehow. Any hints on where I should look? -- Joakim Verona --=-=-= Content-Disposition: inline; filename=zen-mode.el ;;; zen-mode.el --- remove/restore Emacs frame distractions quickly ;;; Copyright (C) 2008 Joakim Verona ;;Author: Joakim Verona, joakim@verona.se ;;License: GPL V3 or later ;;; Commentary: ;; ;;zen-mode is Emacs in fullscreen without toolbar and menubar ;;the function toggles between previous state of features and zen ;; ;; ;;I bind zen-mode to f11 like this: ;;;(global-set-key [f11] 'zen-mode) ;; ;;TODO: ;; ;;- Zen-master mode, like writeroom mode. (c-u m-x zen-mode), which ;; isn't customizable, it just turns all distractions off ;; ;;- There shouldnt just be a toogle, but a way to enter a specific ;; state, like scroll-bar-mode, probably with a numeric argument ;; ;;- Optionaly advice some modes like ERC so as not to interrupt while ;; in Zen, also dont Gnus while in Zen. You are supposed to concentrate :) ;; ;;- Currently zen isnt entered properly the 1st time, you have to try twice. ;;Note: ;; There are some problems in the Compiz WM, (and maybe other WM:s) regarding fullscreen: ;; When selecting another workspace temporarily and going back, Emacs ;; does not cover the wm panels as it should. This can be resolved with alt-tab a bit, ;; but its annoying. In Metacity it works well. ;; ;; ;;; History: ;; ;; 2008.08.17 -- v0.1 ;;; Code: (provide 'zen-mode) (defvar zen-mode-is-active-p nil "If zen mode is currently active or not.") (defvar zen-mode-previous-state nil "The state of features to be disabled in zen-mode, before entering zen-mode.") (defgroup zen-mode nil "zen-mode"); :group 'some-apropriate-root-group) (defcustom zen-mode-what-is-not-zen '() "These Emacs features are not considered Zen. They will be disabled when entering Zen. They will be restored to their previous settings when leaving Zen." :group 'zen-mode :type '(set :tag "zen" (const scroll-bar-mode) (const menu-bar-mode) (const tool-bar-mode) (const windowed-mode) ;windowed is the inverse of fullscreen, for didactic reasons ) ) (defun zen-mode-get-feature-state (feature) "An uniform get/set facility for each feature zen handles. FEATURE is a symbol from 'zen-mode-what-is-not-zen'." (cond ((eq feature 'scroll-bar-mode) scroll-bar-mode) ((eq feature 'menu-bar-mode) menu-bar-mode) ((eq feature 'tool-bar-mode) tool-bar-mode) ((eq feature 'windowed-mode) (if (frame-parameter nil 'fullscreen) nil t)) ) ) (defun zen-mode-set-feature-state (feature state) "Set zen FEATURE to STATE." (let* ((modeflag (if state t -1))) (cond ((eq feature 'scroll-bar-mode) (scroll-bar-mode modeflag)) ((eq feature 'menu-bar-mode) (menu-bar-mode modeflag)) ((eq feature 'tool-bar-mode) (tool-bar-mode modeflag)) ((eq feature 'windowed-mode) (set-frame-parameter nil 'fullscreen (if state nil 'fullboth))) )) ) (defun zen-mode-store-state () "Store the state of all features zen is interested in." (setq zen-mode-previous-state nil) (let ((f zen-mode-what-is-not-zen)) (while f (setq zen-mode-previous-state (append zen-mode-previous-state (list (list (car f) (zen-mode-get-feature-state (car f))) ))) (setq f (cdr f)))) zen-mode-previous-state) (defun zen-mode-disable-nonzen-features () "Disable all non-zen features." (let ((f zen-mode-what-is-not-zen)) (while f (zen-mode-set-feature-state (car f) nil) (setq f (cdr f))))) (defun zen-mode-restore-state () "Restore the feature state as before entering zen." (let ((f zen-mode-previous-state)) (while f (zen-mode-set-feature-state (caar f) (cadar f)) (setq f (cdr f)))) ) (defun zen-mode () "Toggle Zen mode." (interactive) (if zen-mode-is-active-p (progn;deactivate zen (setq zen-mode-is-active-p nil) (zen-mode-store-state) (zen-mode-disable-nonzen-features) ) (progn;activate zen (setq zen-mode-is-active-p t) (zen-mode-restore-state)))) (provide 'zen-mode) ;;; zen-mode.el ends here --=-=-=--