From b26bbd476241ea992022d5f66ed7158c6de84c18 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 6 Jun 2018 02:38:39 +0200 Subject: [PATCH] Fix args-out-of-range in enable-minor-mode-maybe Caused by trying to use out-of-scope match data. --- core/core.el | 2 +- modules/tools/magit/config.el | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/core/core.el b/core/core.el index 4c3174ff5..47fd3e018 100644 --- a/core/core.el +++ b/core/core.el @@ -138,7 +138,7 @@ enable multiple minor modes for the same regexp.") (setq name (file-name-sans-versions name)) ;; Remove remote file name identification. (when (and (stringp remote-id) - (string-match-p (regexp-quote remote-id) name)) + (string-match (regexp-quote remote-id) name)) (setq name (substring name (match-end 0)))) (while (and alist (caar alist) (cdar alist)) (if (string-match-p (caar alist) name) diff --git a/modules/tools/magit/config.el b/modules/tools/magit/config.el index 2315682a3..ecaaa75c8 100644 --- a/modules/tools/magit/config.el +++ b/modules/tools/magit/config.el @@ -24,7 +24,18 @@ load everything.") magit-revision-show-gravatars '("^Author: " . "^Commit: ") magit-diff-refine-hunk t ;; Show word-granularity on the currently selected hunk magit-display-buffer-function - #'magit-display-buffer-fullframe-status-v1) + #'+magit-display-buffer-fullscreen) + + (defun +magit-display-buffer-fullscreen (buffer) + (cond ((eq (with-current-buffer buffer major-mode) + 'magit-status-mode) + (display-buffer buffer '(magit--display-buffer-fullframe))) + ((if-let* ((status (magit-mode-get-buffer 'magit-status-mode t nil nil))) + (when-let* ((window (get-buffer-window status))) + (unless (window-parameter window 'side) + (delete-other-windows window) + (display-buffer-in-side-window status '((side . left))))) + (magit-display-buffer-traditional buffer))))) (set! :popup "^\\(?:\\*magit\\|magit:\\)" :ignore) ;; Consider magit buffers real (so they can switched to)