protect a window from changing buffers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

protect a window from changing buffers

Jody Klymak-2

Hi All,

I am trying to set up a planner-browser like system. Left window  
should be plan pages and right window is an index page (actually one  
that is manually created).

Is there any way to stop the index window from being treated as the  
"other window" for navigating and for temporary buffers?

i.e. when I click on a link using C-u enter I would like the visited  
buffer to be in another window or frame, but not the index page window.

Thanks for any help,

Cheers,  Jody



--
Jody Klymak
http://web.uvic.ca/~jklymak/






_______________________________________________
Planner-el-discuss mailing list
[hidden email]
https://mail.gna.org/listinfo/planner-el-discuss
Reply | Threaded
Open this post in threaded view
|

Re: protect a window from changing buffers

Suno Ano

 Jody> Is there any way to stop the index window from being treated as
 Jody> the "other window" for navigating and for temporary buffers?

I use dedicated-mode to accomplish this (works for any window with any
major mode at any times). I also use a little code on top of it to
nicely toggle as you can see:


,----[ the keybinding ]
| (global-set-key (kbd "C-c t d")
|                   (fset 'toggle-dedicated-mode
|                     (lambda () "Toggle dedicated-mode"
|                       (interactive)
|                       (toggle-option 'dedicated-mode)
|                     )
|                   )
| )
`----


,----[ the optional toggling code I use ]
| ;;;_ , toggle-option
|
| (require 'toggle-option)
|
| (setq toggle-option-list
|       '(
|          (flyspell-mode function nil nil)
|          (auto-fill-mode function nil nil)
|          (abbrev-mode function nil nil)
|          (dedicated-mode function nil nil)
|        )
| )
`----




_______________________________________________
Planner-el-discuss mailing list
[hidden email]
https://mail.gna.org/listinfo/planner-el-discuss
Reply | Threaded
Open this post in threaded view
|

Re: protect a window from changing buffers

Jody Klymak-2
Hi Ano,

Thanks a lot, that is very useful for a lot of things.   I had a bit  
of trouble finding dedicated mode - its part of emacs goodies and is  
quite small:

;;;dedicated mode 13.04.2000
(defvar dedicated-mode nil
   "Mode variable for dedicated minor mode.")
(make-variable-buffer-local 'dedicated-mode)

(defun dedicated-mode (&optional arg)
   "Dedicated minor mode."
   (interactive "P")
   (setq dedicated-mode (not dedicated-mode))
   (set-window-dedicated-p (selected-window) dedicated-mode)
   (if (not (assq 'dedicated-mode minor-mode-alist))
       (setq minor-mode-alist
             (cons '(dedicated-mode " D")
                   minor-mode-alist))))


"set-window-dedicated-p" was the function call I was looking for.

Unfortunately links in the dedicated window do not work unless I C-u  
enter, but that isn't the end of the world.  I didn't see anyway to  
specify link following behaviour - i.e. always follow link in another  
window.

Thanks,  Jody




On Jul 21, 2008, at 11:10 PM, Suno Ano wrote:

>
> Jody> Is there any way to stop the index window from being treated as
> Jody> the "other window" for navigating and for temporary buffers?
>
> I use dedicated-mode to accomplish this (works for any window with any
> major mode at any times). I also use a little code on top of it to
> nicely toggle as you can see:
>
>
> ,----[ the keybinding ]
> | (global-set-key (kbd "C-c t d")
> |                   (fset 'toggle-dedicated-mode
> |                     (lambda () "Toggle dedicated-mode"
> |                       (interactive)
> |                       (toggle-option 'dedicated-mode)
> |                     )
> |                   )
> | )
> `----
>
>
> ,----[ the optional toggling code I use ]
> | ;;;_ , toggle-option
> |
> | (require 'toggle-option)
> |
> | (setq toggle-option-list
> |       '(
> |          (flyspell-mode function nil nil)
> |          (auto-fill-mode function nil nil)
> |          (abbrev-mode function nil nil)
> |          (dedicated-mode function nil nil)
> |        )
> | )
> `----
>
>
>
>
> _______________________________________________
> Planner-el-discuss mailing list
> [hidden email]
> https://mail.gna.org/listinfo/planner-el-discuss

--
Jody Klymak
http://web.uvic.ca/~jklymak/





_______________________________________________
Planner-el-discuss mailing list
[hidden email]
https://mail.gna.org/listinfo/planner-el-discuss