• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/

Lines Matching +defs:beginning +defs:of +defs:buffer

1 ;;; master.el --- make a buffer the master over another buffer
11 ;; This file is part of GNU Emacs.
14 ;; it under the terms of the GNU General Public License as published by
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;; You should have received a copy of the GNU General Public License
31 ;; buffer (the slave) without leaving your current buffer (the master).
33 ;; It can be used by sql.el, for example: The SQL buffer is the master
34 ;; and its SQLi buffer is the slave. This allows you to scroll the SQLi
35 ;; buffer containing the output from the SQL buffer containing the
39 ;; sql-buffer contains the slave buffer. It is a local variable in the
40 ;; SQL buffer.
45 ;; (master-set-slave sql-buffer))))
48 ;; (master-set-slave sql-buffer))))
66 (defvar master-of nil
67 "Slave buffer of the current buffer. See `master-mode'.
82 When Master mode is enabled, you can scroll the slave buffer using the
87 The slave buffer is stored in the buffer-local variable `master-of'.
89 yourself the value of `master-of' by calling `master-show-slave'."
94 ("\C-c<" . master-says-beginning-of-buffer)
95 ("\C-c>" . master-says-end-of-buffer)
98 ;; Initialize Master mode by setting a slave buffer.
100 (defun master-set-slave (buffer)
101 "Makes BUFFER the slave of the current buffer.
102 Use \\[master-mode] to toggle control of the slave buffer."
104 (make-local-variable 'master-of)
105 (setq master-of buffer)
109 "Displays a message with the name of the slave buffer."
111 (message "This buffer is the master of %s. Master-mode is %S."
112 (or master-of "none")
118 ;;; Functions that the master buffer can call for the slave buffer.
121 "Display and scroll the slave buffer up.
127 "Display and scroll the slave buffer down.
132 (defun master-says-beginning-of-buffer (&optional arg)
133 "Display and move to the beginning of the slave buffer.
134 See `beginning-of-buffer'."
136 (master-says 'beginning-of-buffer arg))
138 (defun master-says-end-of-buffer (&optional arg)
139 "Display and move to the end of the slave buffer.
140 See `end-of-buffer'."
142 (master-says 'end-of-buffer arg))
145 "Recenter the slave buffer.
153 "Display slave buffer and execute COMMAND with ARG in its window."
155 (if (null (buffer-live-p (get-buffer master-of)))
156 (error "Slave buffer has disappeared")
158 (if (not (eq (window-buffer window) (get-buffer master-of)))
159 (switch-to-buffer-other-window master-of))