emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/modern-mode 66a5fa9 2/3: * Add new global minor mode 'modern-mod


From: Andrea Corallo
Subject: scratch/modern-mode 66a5fa9 2/3: * Add new global minor mode 'modern-mode'
Date: Tue, 15 Sep 2020 10:37:40 -0400 (EDT)

branch: scratch/modern-mode
commit 66a5fa931cd437078d3fdd94fdbd78daf66f485f
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    * Add new global minor mode 'modern-mode'
    
        * lisp/modern-mode.el: New file implementing a new global minor
        mode to enable a small collection of non invasive modern settings.
---
 lisp/modern-mode.el | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/lisp/modern-mode.el b/lisp/modern-mode.el
new file mode 100644
index 0000000..0fea490
--- /dev/null
+++ b/lisp/modern-mode.el
@@ -0,0 +1,54 @@
+;;; modern-mode.el --- collection of non invasive modern settings -*- 
lexical-binding: t -*-
+
+;; Copyright (C) 2020 Free Software Foundation, Inc.
+
+;; Author: Andrea Corallo <akrl@sdf.org>
+;; Version: 0.1
+;; Created: 2020-09-15
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; A minimal collection of non invasive 'modern' settings trying to
+;; make Emacs more appealing/easy to new comers.
+
+;;; Code:
+
+(defgroup modern-mode nil
+  "A conservative collection of modern settings."
+  :group 'convenience)
+
+;;;###autoload
+(define-minor-mode modern-mode
+  "Toggle modern mode in all buffers."
+  :global t :group 'modern-mode
+  (let ((arg (if modern-mode 1 -1)))
+    (column-number-mode arg)
+    (delete-selection-mode arg)
+    (fido-mode arg)
+    (global-auto-revert-mode arg)
+    (show-paren-mode arg)
+    (winner-mode arg))
+  (if modern-mode
+      (progn
+       (windmove-default-keybindings '(shift))
+       (global-set-key (kbd "C-x C-b") 'ibuffer))
+    (windmove-remove-keybindings)
+    (global-set-key (kbd "C-x C-b") 'list-all-buffers)))
+
+(provide 'modern-mode)
+
+;;; modern-mode.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]