|
View:
New views
10 Messages
—
Rating Filter:
Alert me
|
|
|
My sawfishrcHi all,
dunno wether someone's interrested, but my .sawfishrc can be found here: http://www.nanolx.org/free/sawfishrc Regards, Chris |
|
|
Re: My sawfishrcOn 29/09/09 05:53, Christopher Roy Bratusek wrote:
> Hi all, > > dunno wether someone's interrested, but my .sawfishrc can be found here: > > http://www.nanolx.org/free/sawfishrc > > Regards, > Chris My sawfishrc is much shorter, but I notice a usage difference: CB: ( define-special-variable viewport-dimensions '(1 . 1) ) AD: (setq viewport-dimensions '(3 . 2)) Any reason to go one way or the other here, as both appear to work? |
|
|
Re: My sawfishrcAm Dienstag, den 29.09.2009, 23:30 +1000 schrieb Allan Duncan:
> On 29/09/09 05:53, Christopher Roy Bratusek wrote: > > Hi all, > > > > dunno wether someone's interrested, but my .sawfishrc can be found here: > > > > http://www.nanolx.org/free/sawfishrc > > > > Regards, > > Chris > > My sawfishrc is much shorter, but I notice a usage difference: > > CB: ( define-special-variable viewport-dimensions '(1 . 1) ) > > AD: (setq viewport-dimensions '(3 . 2)) > > > Any reason to go one way or the other here, as both appear to work? > shorter lifetime than dsv, but for an rc this doesn't make a difference. I've uploaded rev9 of my sawfishrc: http://www.nanolx.org/free/sawfishrc overview of changes: - I've found a much shorter way using jump-or-exec than in it's example - Now using undo/rich-title/uptimes/jump-or-exec overall - Removed deprecated stuff from Window Snooper - Added jump-or-exec-class to jump-or-exec.jl ° jump-or-exec matches against WM_NAME but sometimes ° WM_CLASS is better, as some apps only have the name ° of the open file as WM_NAME (glade-3), others have ° a different WM_NAME on different locales or versions, ° a third group has a frequently changing WM_NAME ^ somehow jump-or-exec-class doesn't work correctly ^ it both focusses the open instance and creates ^ a new one ... my someone get a look? Perhaps you'll get some inspiration, Chris ;;; jump-or-exec.jl --- flexible application shortcut keys (v0.1) ;; -*- lisp-mode -*- ;; Copyright (C) 2002 Free Software Foundation, Inc. ;; Author: Damien Elmes <resolve@...> ;; This file is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; This file is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Commentary: ;; To use this file, put (require 'jump-or-exec) somewhere in your local config ;; files (like ~/.sawfishrc), and then define shortcuts using it like this one, ;; for example: ;; ;; load a multi gnome terminal, ;; ;; or switch to it if it's already running, ;; ;; and load a new tab if it's currently focused ;; (bind-keys global-keymap ;; "W-o" `(jump-or-exec "MGT" ; window title to jump to ;; ,(lambda () ; if the window doesn't exist ;; (select-workspace 0) ;; (system ;; "multi-gnome-terminal --start-factory-server --use-factory &")) ;; ,(lambda (wind) ; if the window is focused already ;; (display-window wind) ;; (synthesize-event "C-F1" wind) ;; (synthesize-event "n" wind)))) ;;; Code: ;; this function is used a bit further in, in my local config. i use it to blur ;; the line between what's running and what needs to be started, so i can hit a ;; key to load something, or jump to it if it was already running. i love ;; sawfish. (defun jump-or-exec (re prog #!optional onfocused) "jump to a window matched by re, or start program otherwise." (catch 'return (let ((wind (get-window-by-name-re re))) (if (functionp onfocused) ; check if already focused (let ((curwin (input-focus))) (if curwin (if (string-match re (window-name curwin)) (progn (funcall onfocused wind) (throw 'return)))))) (if (windowp wind) (display-window wind) (if (functionp prog) (funcall prog) (system (concat prog "&"))))))) (defun jump-or-exec-class (re prog #!optional onfocused) "jump to a window matched by re, or start program otherwise." (catch 'return (let ((wind (get-window-by-class-re re))) (if (functionp onfocused) ; check if already focused (let ((curwin (input-focus))) (if curwin (if (string-match re (window-class curwin)) (progn (funcall onfocused wind) (throw 'return)))))) (if (windowp wind) (display-window wind) (if (functionp prog) (funcall prog) (system (concat prog "&"))))))) (provide 'jump-or-exec) ;;; jump-or-exec.jl ends here |
|
|
Re: My sawfishrcChristopher Roy Bratusek <zanghar@...> writes:
> Am Dienstag, den 29.09.2009, 23:30 +1000 schrieb Allan Duncan: >> On 29/09/09 05:53, Christopher Roy Bratusek wrote: >> > Hi all, >> > >> > dunno wether someone's interrested, but my .sawfishrc can be found here: >> > >> > http://www.nanolx.org/free/sawfishrc >> > >> > Regards, >> > Chris >> >> My sawfishrc is much shorter, but I notice a usage difference: >> >> CB: ( define-special-variable viewport-dimensions '(1 . 1) ) >> >> AD: (setq viewport-dimensions '(3 . 2)) >> >> >> Any reason to go one way or the other here, as both appear to work? >> > > Dunno the exact difference but if I remember correctly setq has a > shorter lifetime than dsv, but for an rc this doesn't make a difference. > > I've uploaded rev9 of my sawfishrc: > > http://www.nanolx.org/free/sawfishrc > > overview of changes: > > - I've found a much shorter way using jump-or-exec than in it's example > - Now using undo/rich-title/uptimes/jump-or-exec overall > - Removed deprecated stuff from Window Snooper > - Added jump-or-exec-class to jump-or-exec.jl > ° jump-or-exec matches against WM_NAME but sometimes > ° WM_CLASS is better, as some apps only have the name Thanks! I downloaded your jump-or-exec-class. With it, i won't have to give emacs a strange name what i did before. Because when i were browsing a page with name "emacs" in iceweasel, it confused jump-or-exec which to switch to. > ° of the open file as WM_NAME (glade-3), others have > ° a different WM_NAME on different locales or versions, > ° a third group has a frequently changing WM_NAME > ^ somehow jump-or-exec-class doesn't work correctly > ^ it both focusses the open instance and creates > ^ a new one ... my someone get a look? > > Perhaps you'll get some inspiration, > Chris > And, from your rc file, i learned how to use keymap-trans in window-matcher, never noticed before. Using it in urxvt, i can scroll page with C-v and M-v now ;) Thank! -- Regards, Lei |
|
|
Re: My sawfishrcAm Sonntag, den 04.10.2009, 12:27 +0800 schrieb Wang Lei:
> Christopher Roy Bratusek <zanghar@...> writes: > > > Am Dienstag, den 29.09.2009, 23:30 +1000 schrieb Allan Duncan: > >> On 29/09/09 05:53, Christopher Roy Bratusek wrote: > >> > Hi all, > >> > > >> > dunno wether someone's interrested, but my .sawfishrc can be found here: > >> > > >> > http://www.nanolx.org/free/sawfishrc > >> > > >> > Regards, > >> > Chris > >> > >> My sawfishrc is much shorter, but I notice a usage difference: > >> > >> CB: ( define-special-variable viewport-dimensions '(1 . 1) ) > >> > >> AD: (setq viewport-dimensions '(3 . 2)) > >> > >> > >> Any reason to go one way or the other here, as both appear to work? > >> > > > > Dunno the exact difference but if I remember correctly setq has a > > shorter lifetime than dsv, but for an rc this doesn't make a difference. > > > > I've uploaded rev9 of my sawfishrc: > > > > http://www.nanolx.org/free/sawfishrc > > > > overview of changes: > > > > - I've found a much shorter way using jump-or-exec than in it's example > > - Now using undo/rich-title/uptimes/jump-or-exec overall > > - Removed deprecated stuff from Window Snooper > > - Added jump-or-exec-class to jump-or-exec.jl > > ° jump-or-exec matches against WM_NAME but sometimes > > ° WM_CLASS is better, as some apps only have the name > > Thanks! I downloaded your jump-or-exec-class. With it, i won't have to give emacs a strange name what i did before. Because when i were browsing a page with name "emacs" in iceweasel, it confused jump-or-exec which to switch to. > > ° of the open file as WM_NAME (glade-3), others have > > ° a different WM_NAME on different locales or versions, > > ° a third group has a frequently changing WM_NAME > > ^ somehow jump-or-exec-class doesn't work correctly > > ^ it both focusses the open instance and creates > > ^ a new one ... my someone get a look? O.K. There's no bug in jump-or-exec-class, but in my sawfishrc rev10 - fixed jump-or-exec calls (less code btw) http://www.nanolx.org/free/sawfishrc > > > > Perhaps you'll get some inspiration, > > Chris > > > > And, from your rc file, i learned how to use keymap-trans in window-matcher, never noticed before. Using it in urxvt, i can scroll page with C-v and M-v now ;) Well, the reason why you never noticed it before, is pretty simple: it's in for just about 2 months, and it's (currently) not exposable in SawfishConfig > Thank! Regards, Chris |
|
|
Re: My sawfishrcOn Saturday 03 October 2009 23:13:55 Christopher Roy Bratusek wrote:
> Dunno the exact difference but if I remember correctly setq has a > shorter lifetime than dsv, but for an rc this doesn't make a > difference. (define-special-variable foo bar) is equivalent to (defvar foo nil) (setq foo bar). Unless evaluated in some inner scope where foo is locally defined, (setq foo bar) (defvar foo nil) also achieves the same result. -- Timo Korvola <URL:http://www.iki.fi/tkorvola> |
|
|
Re: My sawfishrcOn 04/10/09 18:26, Timo Korvola wrote:
> On Saturday 03 October 2009 23:13:55 Christopher Roy Bratusek wrote: >> Dunno the exact difference but if I remember correctly setq has a >> shorter lifetime than dsv, but for an rc this doesn't make a >> difference. > > (define-special-variable foo bar) is equivalent to > (defvar foo nil) (setq foo bar). Unless evaluated in some inner scope > where foo is locally defined, (setq foo bar) (defvar foo nil) also > achieves the same result. > The complete context is: (require 'sawfish.wm.gnome.integration) (setq customize-command-classes '(default viewport)) (setq viewport-dimensions '(3 . 2)) Would the equivalent of (defvar viewport-dimensions nil) therefore occur in sawfish.wm.gnome.integration or customize-command-classes then? That however implies that (define-special-variable viewport-dimensions.. would create a new local scope that is unconnected to the code to actually do what is intended, or am I misinterpreting defvar as a variable definition and storage allocation? And could you combine (defvar foo nil) (setq foo bar) as (defvar foo bar)? |
|
|
Re: My sawfishrc
rev11 "C.R.B now using Sawfish Standalone Edition"
- added pager ( matcher / config ) - more matchers on Nautilus - more matchers on GNOME-Terminal - added mather on Synaptic - changed window-history-states to save more attrs - added a simple-session-manager ° ( since my CJK is horrible I can't say who wrot the code, but ° you can get it here: http://docs.huihoo.com/homepage/shredderyin/wiki/SawfishWindowManager.html ) ° starting the following apps: ^ nautilus (automount storages) ^ gnome-settings-daemon (un-uglify gtk+) ^ seahorse-daemon (keyring daemon) ^ mail-notification (get a pop-up on new mails) ^ hsetroot (background setter) http://www.nanolx.org/free/sawfishrc Regards, Chris |
|
|
Re: My sawfishrcOn Sunday 04 October 2009 14:31:59 Allan Duncan wrote:
> Would the equivalent of (defvar viewport-dimensions nil) therefore > occur in sawfish.wm.gnome.integration or customize-command-classes > then? viewport-dimensions is defined in sawfish.wm.viewport with defcustom, which also creates dynamically scoped variables. > That however implies that (define-special-variable > viewport-dimensions.. would create a new local scope Local scopes are always limited by parentheses. E.g., (let ((foo bar)) body...) creates a local scope for body. So define-special-variable does not create any scope. > am I misinterpreting defvar as a variable definition and > storage allocation? defvar declares the variable to be dynamically scoped. > And could you combine (defvar foo nil) (setq foo bar) as (defvar foo > bar)? Only if foo is not previously defined. If it is, defvar keeps the previous value. -- Timo Korvola <URL:http://www.iki.fi/tkorvola> |
|
|
Re: My sawfishrcrev14 (several changes)
ahhh, I've almost reached the perfect "desktop" :D http://www.nanolx.org/free/sawfishrc |
| Free embeddable forum powered by Nabble | Forum Help |