Changeset - 6e8a9fec23d0
[Not reviewed]
0 1 0
Sergey Pashinin - 11 years ago 2014-08-01 11:32:39
sergey@pashinin.com
defalias wg-switch-to-buffer
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/workgroups-variables.el
Show inline comments
 
@@ -231,197 +231,197 @@ When nil - save/restore frame parameters to/from the first workgroup."
 

	
 

	
 
;; buffer-list filtration customization
 

	
 
(defcustom wg-buffer-list-filtration-on t
 
  "Non-nil means Workgroups' buffer-list filtration feature is on.
 
Nil means ido and iswitchb behave normally.  See
 
`wg-buffer-list-filter-definitions' for more info."
 
  :type 'boolean
 
  :group 'workgroups)
 

	
 
(defcustom wg-buffer-list-filter-definitions
 
  '((all "all" wg-buffer-list-filter-all)
 
    (fallback "fallback" nil))
 
  "List of buffer list filter definitions.
 
Each entry should be a list containing an identifier symbol, a
 
prompt string, and a function form that's funcall'd to produce
 
the filtered buffer-list.
 

	
 
The prompt string is displayed as part of the minibuffer prompt
 
when its filter is active.
 

	
 
The function form should be either a function-symbol or a lambda, and
 
should take two arguments: a workgroup and a list of live Emacs
 
buffers.  The function should return a new list of live buffers,
 
typically by filtering its second argument in some way.
 

	
 
Default buffer-list-filters include:
 

	
 
`all'           All buffer names
 

	
 
`fallback'      A special case used to fallback to the
 
                original (non-ido/iswitchb) Emacs command.
 
                `fallback' isn't actually a buffer-list-filter
 
                itself, but can be used in
 
                `wg-buffer-list-filter-order-alist' just the
 
                same.
 

	
 
Becomes workgroup-local when set with `wg-set-workgroup-parameter'.
 
Becomes session-local when set with `wg-set-session-parameter'."
 
  :type 'list
 
  :group 'workgroups)
 

	
 
(defcustom wg-buffer-list-filter-order-alist
 
  '((default all fallback))
 
  "Alist defining the order in which filtered buffer-lists are presented.
 

	
 
The car of each entry should be the symbol of the original Emacs
 
command (not the ido or iswitchb remappings) -- i.e. one of
 
`switch-to-buffer', `switch-to-buffer-other-window',
 
`switch-to-buffer-other-frame', `kill-buffer', `next-buffer',
 
`previous-buffer', `display-buffer', `insert-buffer',
 
`read-buffer', or the special symbol `default', which defines the
 
buffer-list-filter order for all commands not present in this
 
alist.
 

	
 
The cdr of each entry should be a list of buffer-list-filter
 
identifiers defining the order in which filtered buffer-lists are
 
presented for the command.  See
 
`wg-buffer-list-filter-definitions'.
 

	
 
Becomes workgroup-local when set with `wg-set-workgroup-parameter'.
 
Becomes session-local when set with `wg-set-session-parameter'."
 
  :type 'alist
 
  :group 'workgroups)
 

	
 
(defcustom wg-center-rotate-buffer-list-display nil
 
  "Non-nil means rotate the buffer list display so that the
 
current buffer is in the center of the list.  This can make it
 
easier to see the where `wg-previous-buffer' will take you, but
 
it doesn't look right if the buffer list display is long enough
 
to wrap in the miniwindow."
 
  :type 'boolean
 
  :group 'workgroups)
 

	
 
(defcustom wg-remap-bury-buffer nil
 
  "Non-nil means remap `bury-buffer'.
 
`banish' means remap `bury-buffer' to `wg-banish-buffer'.
 
`bury' or other non-nil means remap `bury-buffer' to
 
`wg-bury-buffer'.  Otherwise, don't remap."
 
  :type 'boolean
 
  :group 'workgroups)
 

	
 

	
 
;;; vars
 

	
 
(defvar wg-workgroups-mode-minor-mode-map-entry nil
 
  "Workgroups' minor-mode-map entry.")
 

	
 
(defvar wg-wconfig-kill-ring nil
 
  "Ring of killed or kill-ring-saved wconfigs.")
 

	
 
(defvar wg-last-message nil
 
  "Holds the last message Workgroups sent to the echo area.")
 

	
 
(defvar wg-buffer-uid nil
 
  "Symbol for the current buffer's wg-buf's uid.
 
Every Workgroups buffer object (wg-buf) has a uid.  When
 
Workgroups creates or encounters an Emacs buffer object
 
corresponding to a wg-buf, it tags it with the wg-buf's uid to
 
unambiguously pair the two.")
 
(make-variable-buffer-local 'wg-buffer-uid)
 

	
 

	
 
;; file and modified flag vars
 

	
 
(defvar wg-flag-modified t
 
  "Dynamically bound to nil around destructive operations to
 
temporarily disable flagging `modified'.")
 

	
 

	
 
;; undo vars
 

	
 
(defvar wg-window-configuration-changed nil
 
  "Flag set by `window-configuration-change-hook'.")
 

	
 
(defvar wg-already-updated-working-wconfig nil
 
  "Flag set by `wg-update-working-wconfig-hook'.")
 

	
 
(defvar wg-undoify-window-configuration-change t
 
  "Flag unset when changes to the window config shouldn't cause
 
workgroups' undo info to be updated.")
 

	
 

	
 

	
 

	
 
;; buffer-list-filter vars
 

	
 
(defvar wg-current-workgroup nil
 
  "Bound to the current workgroup in `wg-with-buffer-list-filters'.")
 

	
 
;; (defvar wg-current-buffer-command nil
 
;;   "Bound to the current buffer command in `wg-with-buffer-list-filters'.")
 

	
 
(defvar wg-current-buffer-list-filter-id nil
 
  "Bound to the current buffer-list-filter symbol in `wg-with-buffer-list-filters'.")
 

	
 
(defvar wg-previous-minibuffer-contents nil
 
  "Holds the previous minibuffer contents for re-insertion when
 
the buffer-list-filter is cycled.")
 

	
 
(defvar wg-ido-method-translations
 
  `((switch-to-buffer              . selected-window)
 
    (switch-to-buffer-other-window . other-window)
 
    (switch-to-buffer-other-frame  . other-frame)
 
    (kill-buffer                   . kill)
 
    (insert-buffer                 . insert)
 
    (display-buffer                . display))
 
  "Alist mapping buffer commands to ido buffer methods.")
 

	
 
(defvar wg-buffer-internal-default-buffer nil
 
  "Bound to `wg-buffer-internal's optional DEFAULT argument for
 
use by buffer list filtration hooks.")
 

	
 
(defvar wg-temp-buffer-list nil
 
  "Dynamically bound to the filtered buffer list in
 
`wg-finalize-buffer-list'.  Functions in
 
`wg-buffer-list-finalization-hook' should modify this variable.")
 

	
 

	
 
;; wconfig restoration
 

	
 
(defvar wg-window-min-width 2
 
  "Bound to `window-min-width' when restoring wtrees. ")
 

	
 
(defvar wg-window-min-height 1
 
  "Bound to `window-min-height' when restoring wtrees.")
 

	
 
(defvar wg-window-min-pad 2
 
  "Added to `wg-window-min-foo' to produce the actual minimum window size.")
 

	
 
(defvar wg-actual-min-width (+ wg-window-min-width wg-window-min-pad)
 
  "Actual minimum window width when creating windows.")
 

	
 
(defvar wg-actual-min-height (+ wg-window-min-height wg-window-min-pad)
 
  "Actual minimum window height when creating windows.")
 

	
 
(defvar wg-min-edges `(0 0 ,wg-actual-min-width ,wg-actual-min-height)
 
  "Smallest allowable edge list of windows created by Workgroups.")
 

	
 
(defvar wg-null-edges '(0 0 0 0)
 
  "Null edge list.")
 

	
 
(defvar wg-window-tree-selected-window nil
 
  "Used during wconfig restoration to hold the selected window.")
 

	
 
(defvar wg-update-current-workgroup-working-wconfig-on-select-frame t
 
  "Non-nil means update `selected-frame's current workgroup's
 
working wconfig before `select-frame' selects a new frame.
 
let-bind this to nil around forms in which you don't want this to
 
happen.")
 

	
 

	
 

	
 
;; Remove after some time
 
(defalias 'wg-switch-to-buffer 'switch-to-buffer)
 

	
 
(provide 'workgroups-variables)
 
;;; workgroups-variables.el ends here
0 comments (0 inline, 0 general)