diff --git a/core/core-funcs.el b/core/core-funcs.el index 3ebfb1d9f..442fe50f5 100644 --- a/core/core-funcs.el +++ b/core/core-funcs.el @@ -20,7 +20,7 @@ See `spacemacs/load-or-install-package' for more information." "Load PKG package. PKG will be installed if it is not already installed. Whenever the initial require fails the absolute path to the package directory is returned. -If LOG is non-nil a message is displayed in spacemacs-mode buffer. +If LOG is non-nil a message is displayed in spacemacs-buffer-mode buffer. FILE-TO-LOAD is an explicit file to load after the installation." (let ((warning-minimum-level :error)) (condition-case nil diff --git a/core/core-spacemacs-buffer.el b/core/core-spacemacs-buffer.el index c7641c355..59f105228 100644 --- a/core/core-spacemacs-buffer.el +++ b/core/core-spacemacs-buffer.el @@ -30,6 +30,30 @@ version the release note it displayed") (defvar spacemacs-buffer--previous-insert-type nil "Previous type of note inserted.") +(defvar spacemacs-buffer-mode-map + (let ((map (make-sparse-keymap))) + (define-key map [tab] 'widget-forward) + (define-key map (kbd "C-i") 'widget-forward) + (define-key map [backtab] 'widget-backward) + (define-key map (kbd "RET") 'widget-button-press) + (define-key map [down-mouse-1] 'widget-button-click) + map) + "Keymap for spacemacs buffer mode.") + +(define-derived-mode spacemacs-buffer-mode special-mode "Spacemacs buffer" + "Spacemacs major mode for startup screen. + +\\ +" + :group 'spacemacs + :syntax-table nil + :abbrev-table nil + (setq truncate-lines t) + ;; needed to make tab work correctly in terminal + (evil-define-key 'motion spacemacs-buffer-mode-map (kbd "C-i") 'widget-forward) + ;; motion state since this is a special mode + (add-to-list 'evil-motion-state-modes 'spacemacs-buffer-mode)) + (defun spacemacs-buffer/insert-banner-and-buttons () "Choose a banner according to `dotspacemacs-startup-banner'and insert it in spacemacs buffer along with quick buttons underneath. @@ -398,13 +422,13 @@ HPADDING is the horizontal spacing betwee the content line and the frame border. (spacemacs//redisplay)))) (defmacro spacemacs//insert--shortcut (shortcut-char search-label &optional no-next-line) - `(define-key spacemacs-mode-map ,shortcut-char (lambda () - (interactive) - (unless (search-forward ,search-label (point-max) t) - (search-backward ,search-label (point-min) t)) - ,@(unless no-next-line - '((forward-line 1))) - (back-to-indentation)))) + `(define-key spacemacs-buffer-mode-map ,shortcut-char (lambda () + (interactive) + (unless (search-forward ,search-label (point-max) t) + (search-backward ,search-label (point-min) t)) + ,@(unless no-next-line + '((forward-line 1))) + (back-to-indentation)))) (defun spacemacs-buffer//insert-buttons () (goto-char (point-max)) @@ -550,7 +574,7 @@ HPADDING is the horizontal spacing betwee the content line and the frame border. (widget-forward 1))) (defun spacemacs-buffer/goto-buffer () - "Create the special buffer for `spacemacs-mode' if it doesn't + "Create the special buffer for `spacemacs-buffer-mode' if it doesn't already exist, and switch to it." (interactive) (unless (buffer-live-p (get-buffer spacemacs-buffer-name)) diff --git a/core/core-spacemacs.el b/core/core-spacemacs.el index 00e885b57..e21c25446 100644 --- a/core/core-spacemacs.el +++ b/core/core-spacemacs.el @@ -42,30 +42,9 @@ (/ spacemacs-loading-dots-count spacemacs-loading-dots-chunk-count)) (defvar spacemacs-loading-dots-chunk-threshold 0) -(defvar spacemacs-mode-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "") 'widget-forward) - (define-key map (kbd "") 'widget-button-press) - (define-key map [backtab] 'widget-backward) - (define-key map [down-mouse-1] 'widget-button-click) - map) - "Keymap for spacemacs mode.") - (defvar spacemacs--default-mode-line mode-line-format "Backup of default mode line format.") -(define-derived-mode spacemacs-mode special-mode "Spacemacs" - "Spacemacs major mode for startup screen. - -\\ -" - :group 'spacemacs - :syntax-table nil - :abbrev-table nil - (setq truncate-lines t) - ;; motion state since this is a special mode - (add-to-list 'evil-motion-state-modes 'spacemacs-mode)) - (defun spacemacs/init () "Perform startup initialization." ;; explicitly set the prefered coding systems to avoid annoying prompt diff --git a/doc/DOCUMENTATION.org b/doc/DOCUMENTATION.org index c1c9e0d2b..04330ef87 100644 --- a/doc/DOCUMENTATION.org +++ b/doc/DOCUMENTATION.org @@ -196,8 +196,8 @@ If you are looking for commands to operate on your buffer, they are right under ~SPC b~, if you want to operate on your project, then it is ~SPC p~, etc... ** Discoverable -Spacemacs comes with a dedicated major mode =spacemacs-mode=. Its goal is to -give useful feedbacks and easily perform maintenance tasks. +Spacemacs comes with a dedicated major mode =spacemacs-buffer-mode=. Its goal is +to give useful feedbacks and easily perform maintenance tasks. It also comes with dedicated [[https://github.com/emacs-helm/helm][helm]] sources to quickly find layers, packages and more. diff --git a/layers/+distribution/spacemacs/packages.el b/layers/+distribution/spacemacs/packages.el index 758e15151..bea7f36f7 100644 --- a/layers/+distribution/spacemacs/packages.el +++ b/layers/+distribution/spacemacs/packages.el @@ -104,7 +104,7 @@ :commands spacemacs/ace-buffer-links :init (progn - (define-key spacemacs-mode-map "o" 'spacemacs/ace-buffer-links) + (define-key spacemacs-buffer-mode-map "o" 'spacemacs/ace-buffer-links) (with-eval-after-load 'info (define-key Info-mode-map "o" 'ace-link-info)) (with-eval-after-load 'help-mode