Commit 3e29c191 authored by Jonas Bernoulli's avatar Jonas Bernoulli

remove magit-{*}-buffer-name-format options

This temporarily removes the ability to change the buffer names.
parent 824f2249
......@@ -1360,14 +1360,6 @@ The following functions can also be added to the above hook:
Function used by ~magit-status~ to switch to a status buffer.
The function is given one argument, the status buffer.
- User Option: magit-status-buffer-name-format
Name format for buffers used to display a repository's status.
The following ~format~-like specs are supported:
~%a~ the absolute filename of the repository top-level.
~%b~ the basename of the repository top-level.
- User Option: magit-log-section-args
Additional Git arguments used when creating log sections. Only
......
......@@ -1866,15 +1866,6 @@ Function used by @code{magit-status} to switch to a status buffer.
The function is given one argument, the status buffer.
@end defopt
@defopt magit-status-buffer-name-format
Name format for buffers used to display a repository's status.
The following @code{format}-like specs are supported:
@code{%a} the absolute filename of the repository top-level.
@code{%b} the basename of the repository top-level.
@end defopt
@defopt magit-log-section-args
Additional Git arguments used when creating log sections. Only
......
......@@ -73,16 +73,6 @@
:group 'magit-revision
:type 'hook)
(defcustom magit-diff-buffer-name-format "*magit-diff: %a*"
"Name format for buffers used to display a diff.
The following `format'-like specs are supported:
%a the absolute filename of the repository toplevel.
%b the basename of the repository toplevel."
:package-version '(magit . "2.1.0")
:group 'magit-diff
:type 'string)
(defcustom magit-diff-switch-buffer-function 'pop-to-buffer
"Function used to display and possibly select a diff buffer.
......@@ -263,16 +253,6 @@ many spaces. Otherwise, highlight neither."
:group 'magit-revision
:type 'hook)
(defcustom magit-revision-buffer-name-format "*magit-rev: %a*"
"Name format for buffers used to display a commit.
The following `format'-like specs are supported:
%a the absolute filename of the repository toplevel.
%b the basename of the repository toplevel."
:package-version '(magit . "2.1.0")
:group 'magit-revision
:type 'string)
(defcustom magit-revision-headers-format "\
Author: %aN <%aE>
AuthorDate: %ad
......
......@@ -58,16 +58,6 @@
:group 'magit-log
:type 'hook)
(defcustom magit-log-buffer-name-format "*magit-log: %a*"
"Name format for buffers used to display log entries.
The following `format'-like specs are supported:
%a the absolute filename of the repository toplevel.
%b the basename of the repository toplevel."
:package-version '(magit . "2.1.0")
:group 'magit-log
:type 'string)
(defcustom magit-log-arguments '("-n256" "--graph" "--decorate")
"The log arguments used in `magit-log-mode' buffers."
:package-version '(magit . "2.3.0")
......@@ -204,16 +194,6 @@ This is useful if you use really long branch names."
;;;; Select Mode
(defcustom magit-log-select-buffer-name-format "*magit-select: %a*"
"Name format for buffers used to select a commit from a log.
The following `format'-like specs are supported:
%a the absolute filename of the repository toplevel.
%b the basename of the repository toplevel."
:package-version '(magit . "2.2.0")
:group 'magit-log
:type 'string)
(defcustom magit-log-select-arguments '("-n256" "--decorate")
"The log arguments used in `magit-log-select-mode' buffers."
:package-version '(magit . "2.3.0")
......@@ -234,15 +214,6 @@ be nil, in which case no usage information is shown."
;;;; Cherry Mode
(defcustom magit-cherry-buffer-name-format "*magit-cherry: %a*"
"Name format for buffers used to display commits not merged upstream.
The following `format'-like specs are supported:
%a the absolute filename of the repository toplevel.
%b the basename of the repository toplevel."
:group 'magit-log
:type 'string)
(defcustom magit-cherry-sections-hook
'(magit-insert-cherry-headers
magit-insert-cherry-commits)
......@@ -253,16 +224,6 @@ The following `format'-like specs are supported:
;;;; Reflog Mode
(defcustom magit-reflog-buffer-name-format "*magit-reflog: %a*"
"Name format for buffers used to display reflog entries.
The following `format'-like specs are supported:
%a the absolute filename of the repository toplevel.
%b the basename of the repository toplevel."
:package-version '(magit . "2.1.0")
:group 'magit-log
:type 'string)
(defcustom magit-reflog-arguments '("-n256")
"The log arguments used in `magit-reflog-mode' buffers."
:package-version '(magit . "2.3.0")
......
......@@ -38,8 +38,6 @@
;; For `magit-xref-insert-buttons' from `magit'
(defvar magit-diff-show-xref-buttons)
(defvar magit-revision-show-xref-buttons)
;; For `magit-refresh' from `magit'
(defvar magit-status-buffer-name-format)
;; For `magit-revert-buffers'
(declare-function magit-blame-mode 'magit-blame)
(defvar magit-blame-mode)
......@@ -495,32 +493,23 @@ The value is usually set using `magit-mode-setup'.")
(buffer-list))))
(defun magit-mode-get-buffer (mode &optional pwd create frame)
(let ((format (symbol-value
(intern (format "%s-buffer-name-format"
(substring (symbol-name mode) 0 -5))))))
(if (not (string-match-p "%[ab]" format))
(funcall (if create #'get-buffer-create #'get-buffer) format)
(setq pwd (expand-file-name (or pwd default-directory)))
(let* ((topdir (let ((default-directory pwd))
(magit-toplevel)))
(name (format-spec
format (if topdir
`((?a . ,(abbreviate-file-name topdir))
(?b . ,(file-name-nondirectory
(directory-file-name topdir))))
'((?a . "-") (?b . "-"))))))
(or (--first (with-current-buffer it
(and (equal (buffer-name) name)
(or (not topdir)
(equal (expand-file-name default-directory)
topdir))))
(if frame
(-map #'window-buffer
(window-list (unless (eq frame t) frame)))
(buffer-list)))
(and create
(let ((default-directory (or topdir pwd)))
(generate-new-buffer name))))))))
(setq pwd (expand-file-name (or pwd default-directory)))
(let* ((topdir (let ((default-directory pwd))
(magit-toplevel)))
(name (format "*%s: %s*" (substring (symbol-name mode) 0 -5)
(if topdir (abbreviate-file-name topdir) "-"))))
(or (--first (with-current-buffer it
(and (equal (buffer-name) name)
(or (not topdir)
(equal (expand-file-name default-directory)
topdir))))
(if frame
(-map #'window-buffer
(window-list (unless (eq frame t) frame)))
(buffer-list)))
(and create
(let ((default-directory (or topdir pwd)))
(generate-new-buffer name))))))
(defun magit-mode-get-buffer-create (mode &optional directory)
(magit-mode-get-buffer mode directory t))
......
......@@ -40,24 +40,11 @@
(require 'magit-git)
(require 'magit-mode)
(defvar magit-status-buffer-name-format)
(eval-when-compile (require 'dired))
(declare-function dired-uncache 'dired)
;;; Options
(defcustom magit-process-buffer-name-format "*magit-process: %a*"
"Name format for buffers where output of processes is put.
The following `format'-like specs are supported:
%a the absolute filename of the repository toplevel.
%b the basename of the repository toplevel."
:package-version '(magit . "2.1.0")
:group 'magit-process
:type 'string)
(defcustom magit-process-connection-type (not (eq system-type 'cygwin))
"Connection type used for the Git process.
......@@ -189,9 +176,9 @@ Option `magit-git-executable' specifies the Git executable.
The arguments ARGS specify arguments to Git, they are flattened
before use.
Process output goes into a new section in a buffer specified by
variable `magit-process-buffer-name-format'. If Git exits with
a non-zero status, then raise an error."
Process output goes into a new section in the buffer returned by
`magit-process-buffer'. If Git exits with a non-zero status,
then raise an error."
(let ((magit-process-raise-error t))
(magit-call-git args)))
......@@ -208,8 +195,8 @@ as well as the current repository's status buffer are refreshed.
Unmodified buffers visiting files that are tracked in the current
repository are reverted if `magit-revert-buffers' is non-nil.
Process output goes into a new section in a buffer specified by
variable `magit-process-buffer-name-format'."
Process output goes into a new section in the buffer returned by
`magit-process-buffer'."
(magit-call-git args)
(magit-refresh))
......@@ -224,8 +211,8 @@ before use.
After Git returns, the current buffer (if it is a Magit buffer)
as well as the current repository's status buffer are refreshed.
Process output goes into a new section in a buffer specified by
variable `magit-process-buffer-name-format'."
Process output goes into a new section in the buffer returned by
`magit-process-buffer'."
(let ((inhibit-magit-revert t))
(magit-run-git args)))
......@@ -239,16 +226,16 @@ option `magit-git-global-arguments' specifies constant arguments.
The arguments ARGS specify arguments to Git, they are flattened
before use.
Process output goes into a new section in a buffer specified by
variable `magit-process-buffer-name-format'."
Process output goes into a new section in the buffer returned by
`magit-process-buffer'."
(run-hooks 'magit-pre-call-git-hook)
(apply #'magit-call-process magit-git-executable
(magit-process-git-arguments args)))
(defun magit-call-process (program &rest args)
"Call PROGRAM synchronously in a separate process.
Process output goes into a new section in a buffer specified by
variable `magit-process-buffer-name-format'."
Process output goes into a new section in the buffer returned by
`magit-process-buffer'."
(cl-destructuring-bind (process-buf . section)
(magit-process-setup program args)
(magit-process-finish
......
......@@ -303,16 +303,6 @@ instead of \"Stashes:\"."
;;; List Stashes
(defcustom magit-stashes-buffer-name-format "*magit-stashes: %a*"
"Name format for buffers used to list stashes.
The following `format'-like specs are supported:
%a the absolute filename of the repository toplevel.
%b the basename of the repository toplevel."
:package-version '(magit . "2.1.0")
:group 'magit-log
:type 'string)
;;;###autoload
(defun magit-stash-list ()
"List all stashes in a buffer."
......@@ -344,16 +334,6 @@ The following `format'-like specs are supported:
:group 'magit-log
:type 'hook)
(defcustom magit-stash-buffer-name-format "*magit-stash: %a*"
"Name format for buffers used to show stash diffs.
The following `format'-like specs are supported:
%a the absolute filename of the repository toplevel.
%b the basename of the repository toplevel."
:package-version '(magit . "2.1.0")
:group 'magit-modes
:type 'string)
;;;###autoload
(defun magit-stash-show (stash &optional noselect args files)
"Show all diffs of a stash in a buffer."
......
......@@ -133,16 +133,6 @@ The function is given one argument, the status buffer."
(function-item pop-to-buffer)
(function :tag "Other")))
(defcustom magit-status-buffer-name-format "*magit: %a*"
"Name format for buffers used to display a repository's status.
The following `format'-like specs are supported:
%a the absolute filename of the repository toplevel.
%b the basename of the repository toplevel."
:package-version '(magit . "2.1.0")
:group 'magit-status
:type 'string)
(defcustom magit-status-expand-stashes t
"Whether the list of stashes is expanded initially."
:package-version '(magit . "2.3.0")
......@@ -171,16 +161,6 @@ The following `format'-like specs are supported:
:group 'magit-refs
:type 'hook)
(defcustom magit-refs-buffer-name-format "*magit-refs: %a*"
"Name format for buffers used to display and manage refs.
The following `format'-like specs are supported:
%a the absolute filename of the repository toplevel.
%b the basename of the repository toplevel."
:package-version '(magit . "2.1.0")
:group 'magit-refs
:type 'string)
(defcustom magit-refs-show-commit-count nil
"Whether to show commit counts in Magit-Refs mode buffers.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment