From 8e76a959c16b6dd1c55ea693a6550538e3578ec1 Mon Sep 17 00:00:00 2001 From: Matthew Zeng Date: Fri, 17 May 2019 14:54:52 -0400 Subject: [PATCH] use built-in desktop-save --- .gitignore | 1 - README.md | 335 +++++++++++++++++------------------- elisp/init-global-config.el | 8 - init.org | 14 +- 4 files changed, 168 insertions(+), 190 deletions(-) diff --git a/.gitignore b/.gitignore index 85276914..4cd8421d 100644 --- a/.gitignore +++ b/.gitignore @@ -27,5 +27,4 @@ workspace/ /request/curl-cookie-jar /.emacs.desktop /.emacs.desktop.lock -/desktop-histories/.emacs.desktop /history diff --git a/README.md b/README.md index e661e398..83742cc1 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ - + # M-EMACS - + # About @@ -19,14 +19,14 @@ This configuration is designed and tested for **GNU Emacs 25.1 and above only**. ``` - + ## About README This README is originated from init.org that is generated using `M-x org-gfm-export-to-markdown`. Every block of code is generated through this function - it exports the section of code from the `elisp/` directory. You will not see their presence in init.org. - + ## Installation @@ -50,7 +50,7 @@ I will be updating M-EMACS from time to time, it is best to `git pull` once a wh Please also execute `git submodule update --recursive --remote` to sync with all the submodules. - + ## Modification @@ -66,14 +66,14 @@ You have the permission to use, modify, distribute in any way you want. However, 6. Call `M-x org-gfm-export-to-markdown` to update this README. - + ## Spotted a Bug? Suggestions? Please fill in Issues. - + ## Special Thanks @@ -86,94 +86,94 @@ Everyone starts somewhere, and I started here. # Table of Contents :TOC_2_ORG: -- [M-EMACS](#org51b029e) -- [About](#orgf3edd3e) - - [About README](#org1103313) - - [Installation](#orgf7c6eb9) - - [Modification](#orgdb0f9bf) - - [Spotted a Bug? Suggestions?](#orga38a426) - - [Special Thanks](#orge7839d3) -- [Startup](#org49d88c1) - - [Lexical-binding](#orgb592605) - - [Disable Unnecessary Interface](#org2d84db8) - - [Optimization](#orgda66897) - - [Load-Path](#org22ee3a3) - - [Define Constants](#org7f12fbb) -- [Package Management](#orge280c63) - - [Melpa Packages](#orgbcf368d) - - [Non-Melpa Packages](#orge5673e6) - - [Configure Package Management](#org7b65535) - - [Use-Package Wrapper](#orga47240d) - - [Auto Package Update](#orgaa42b94) -- [Global Functionalities](#orgb5d5704) - - [User Information](#org0c998f2) - - [Bindings](#orgc7ab5f4) - - [Directory and File Management](#orgdf6dac2) - - [Search](#orge41bfbe) - - [Avy](#org291d52a) - - [Ivy](#org2c4cdd8) - - [Shell](#org16a838e) - - [Winner](#org863aea7) - - [Which Key](#orge4a5de2) - - [Popup Kill Ring](#org579af20) - - [Undo Tree](#org9a9e5de) - - [Discover My Major](#org6b66d2b) - - [Ace Window](#org62becdb) - - [Configs](#org3982ed8) - - [More Functions](#orgf34d271) -- [User Interface Enhancements](#orgf82cb33) - - [Title Bar](#orga0baa1b) - - [All The Icons](#org3e5ffd4) - - [Doom Theme](#org9ac931f) - - [Doom Modeline](#org9464364) - - [Dashboard](#org461c8fb) - - [Fonts](#orge4ba9c7) - - [Diminish](#org7d07622) - - [Smooth Scroll](#orga0c142e) - - [Pretty Symbols](#org61450a4) - - [UI Configs](#org8158a64) -- [General Programming](#orgaa666c6) - - [Magit](#org0260e7a) - - [Projectile](#org6df4af0) - - [Treemacs](#org9ba8336) - - [Company](#orgb3be11e) - - [YASnippet](#orgb67dbde) - - [Flycheck](#org26eb429) - - [Dumb Jump](#org0ef3dc3) - - [Line Numbers](#org8002f9b) - - [Parenthesis](#org6bd3c64) - - [Indentation](#org397ab5e) - - [Format All](#orgd8a09cf) - - [Evil-Nerd-Commenter](#org6b3fe3c) - - [Iedit](#org0d62e1a) - - [Header](#org0aec7c7) - - [Jupyter Notebook](#org21b312e) -- [Programming](#org6c372ac) - - [Language Server Protocol](#org25e458c) - - [Java](#orgb6d3c01) - - [C/C++](#orgaffb346) - - [Python](#org4eff342) - - [Arduino](#org2984a8f) -- [Web Development](#org0ff7a31) - - [Web Mode](#org1dd1d09) - - [Emmet](#orgca53c21) - - [JavaScript/TypeScript](#orgfe5ba9f) -- [Miscellaneous](#orgdb1f89a) - - [Org](#orgc4c29e8) - - [Emacs Web Wowser](#org3de19de) - - [LeetCode](#orge9079a8) - - [Tetris](#org18e598f) - - [Speed Type](#orge85e20a) - - [2048 Game](#org5c66861) - - [Zone](#org4c24aee) - - - +- [M-EMACS](#org4a95f22) +- [About](#orgbf554ff) + - [About README](#org90371e2) + - [Installation](#orgbcab4aa) + - [Modification](#org6203ead) + - [Spotted a Bug? Suggestions?](#org8f355a4) + - [Special Thanks](#org40416a7) +- [Startup](#org03c2829) + - [Lexical-binding](#org2af6735) + - [Disable Unnecessary Interface](#orga711645) + - [Optimization](#org629dedd) + - [Load-Path](#org6d6d2e9) + - [Define Constants](#org761c6a9) +- [Package Management](#org440c321) + - [Melpa Packages](#org1237099) + - [Non-Melpa Packages](#org650b0b7) + - [Configure Package Management](#org34c99b6) + - [Use-Package Wrapper](#orgd5fcb88) + - [Auto Package Update](#orgdb87596) +- [Global Functionalities](#orgdf7f7e0) + - [User Information](#orgcfc2ce0) + - [Bindings](#orge735535) + - [Directory and File Management](#org1a1964d) + - [Search](#orgb3373af) + - [Avy](#org18da75c) + - [Ivy](#org6ef112b) + - [Shell](#org9c1d191) + - [Winner](#orgb367aa2) + - [Which Key](#org82278bb) + - [Popup Kill Ring](#org9ff2060) + - [Undo Tree](#org85fd457) + - [Discover My Major](#org53dcc1e) + - [Ace Window](#org5acc906) + - [Configs](#orgb622a6a) + - [More Functions](#org1c08b5b) +- [User Interface Enhancements](#org1bdec80) + - [Title Bar](#org335ed2f) + - [All The Icons](#orga9c79d2) + - [Doom Theme](#org5ef3259) + - [Doom Modeline](#orgf1cf7dc) + - [Dashboard](#org22d8472) + - [Fonts](#org630b624) + - [Diminish](#orgf02a8aa) + - [Smooth Scroll](#orgbaee401) + - [Pretty Symbols](#orgbebee58) + - [UI Configs](#orgb8cb8e1) +- [General Programming](#org380ee55) + - [Magit](#org669b070) + - [Projectile](#org85c9e0c) + - [Treemacs](#org68475a2) + - [Company](#orgbf69d89) + - [YASnippet](#org2b0bd2c) + - [Flycheck](#org00fa929) + - [Dumb Jump](#org1ac57a2) + - [Line Numbers](#org60ab2a4) + - [Parenthesis](#org64468c1) + - [Indentation](#orga77286e) + - [Format All](#orgc7a3cc6) + - [Evil-Nerd-Commenter](#org21deee8) + - [Iedit](#orgb24f926) + - [Header](#org6692f3a) + - [Jupyter Notebook](#org566bd07) +- [Programming](#org6489d38) + - [Language Server Protocol](#orgd74294c) + - [Java](#orge8d9500) + - [C/C++](#orga4550f1) + - [Python](#orgffc24a2) + - [Arduino](#org558ebf8) +- [Web Development](#orge51bdb4) + - [Web Mode](#org49b72a0) + - [Emmet](#orgf57f020) + - [JavaScript/TypeScript](#orgcc66568) +- [Miscellaneous](#org7b3f2f0) + - [Org](#org4b740e3) + - [Emacs Web Wowser](#org02de462) + - [LeetCode](#orgc6b91e4) + - [Tetris](#org5cf9ace) + - [Speed Type](#orgb5f47d7) + - [2048 Game](#orgc5e0aca) + - [Zone](#org250137c) + + + # Startup - + ## Lexical-binding @@ -186,7 +186,7 @@ Use lexical-binding. [Why?](https://nullprogram.com/blog/2016/12/22/) ``` - + ## Disable Unnecessary Interface @@ -200,7 +200,7 @@ This need to be in the beginning of initialization to smooth the experience. ``` - + ## Optimization @@ -232,7 +232,7 @@ Unset file name handler alist. ``` - + ## Load-Path @@ -254,7 +254,7 @@ Since all the configuration files are stored in `elisp/` folder, they need to be ``` - + ## Define Constants @@ -276,14 +276,14 @@ Since all the configuration files are stored in `elisp/` folder, they need to be ``` - + # Package Management Some packages are turned off because I don't use them very often. Please verify them in `init.el`. - + ## Melpa Packages @@ -302,7 +302,7 @@ Some packages are turned off because I don't use them very often. Please verify Load all Melpa packages in `elisp/` to `load-path` directly to reduce startup time. - + ## Non-Melpa Packages @@ -327,7 +327,7 @@ git submodule update ``` - + ## Configure Package Management @@ -347,7 +347,7 @@ git submodule update ``` - + ## Use-Package Wrapper @@ -401,7 +401,7 @@ The `use-package` wrapper. ``` - + ## Auto Package Update @@ -418,12 +418,12 @@ The `use-package` wrapper. ``` - + # Global Functionalities - + ## User Information @@ -435,7 +435,7 @@ The `use-package` wrapper. ``` - + ## Bindings @@ -460,7 +460,7 @@ The `use-package` wrapper. ``` - + ## Directory and File Management @@ -557,7 +557,7 @@ Create directory where Emacs stores backups files. ``` - + ## Search @@ -591,7 +591,7 @@ Create directory where Emacs stores backups files. ``` - + ## Avy @@ -609,7 +609,7 @@ Create directory where Emacs stores backups files. ``` - + ## Ivy @@ -666,7 +666,7 @@ Create directory where Emacs stores backups files. ``` - + ## Shell @@ -693,7 +693,7 @@ Create directory where Emacs stores backups files. ``` - + ## Winner @@ -715,7 +715,7 @@ Winner mode restores old window layout. ``` - + ## Which Key @@ -732,7 +732,7 @@ Winner mode restores old window layout. ``` - + ## Popup Kill Ring @@ -744,7 +744,7 @@ Winner mode restores old window layout. ``` - + ## Undo Tree @@ -758,7 +758,7 @@ Winner mode restores old window layout. ``` - + ## Discover My Major @@ -770,7 +770,7 @@ Winner mode restores old window layout. ``` - + ## Ace Window @@ -782,7 +782,7 @@ Winner mode restores old window layout. ``` - + ## Configs @@ -893,24 +893,13 @@ Better compilation configurations. ``` - + ## More Functions Other important, but longer functions. -### Save Current Session - -```emacs-lisp -(defun save-current-session () - "Toggle `desktop-save-mode` and `savehist-mode`." - (interactive) - (desktop-save-mode 1) - (savehist-mode 1)) -``` - - ### Resize Window Width / Height Functions ```emacs-lisp @@ -1069,12 +1058,12 @@ BEGIN and END are regexps which define the line range to use." ``` - + # User Interface Enhancements - + ## Title Bar @@ -1083,7 +1072,7 @@ BEGIN and END are regexps which define the line range to use." ``` - + ## All The Icons @@ -1127,7 +1116,7 @@ BEGIN and END are regexps which define the line range to use." ``` - + ## Doom Theme @@ -1145,7 +1134,7 @@ BEGIN and END are regexps which define the line range to use." ``` - + ## Doom Modeline @@ -1166,7 +1155,7 @@ BEGIN and END are regexps which define the line range to use." ``` - + ## Dashboard @@ -1246,7 +1235,7 @@ Open Dashboard Function ``` - + ## Fonts @@ -1286,7 +1275,7 @@ Change Font Function. ``` - + ## Diminish @@ -1297,7 +1286,7 @@ Change Font Function. ``` - + ## Smooth Scroll @@ -1320,7 +1309,7 @@ Smoothens Scrolling. ``` - + ## Pretty Symbols @@ -1344,7 +1333,7 @@ Pretty the Symbols. ``` - + ## UI Configs @@ -1372,12 +1361,12 @@ Pretty the Symbols. ``` - + # General Programming - + ## Magit @@ -1389,7 +1378,7 @@ Pretty the Symbols. ``` - + ## Projectile @@ -1415,7 +1404,7 @@ Pretty the Symbols. ``` - + ## Treemacs @@ -1500,7 +1489,7 @@ Pretty the Symbols. ``` - + ## Company @@ -1527,7 +1516,7 @@ Pretty the Symbols. ``` - + ## YASnippet @@ -1558,7 +1547,7 @@ Pretty the Symbols. ``` - + ## Flycheck @@ -1575,7 +1564,7 @@ Pretty the Symbols. ``` - + ## Dumb Jump @@ -1592,7 +1581,7 @@ Pretty the Symbols. ``` - + ## Line Numbers @@ -1611,7 +1600,7 @@ Display line numbers, and column numbers in modeline. ``` - + ## Parenthesis @@ -1691,7 +1680,7 @@ Match and automatically pair parenthesis. ``` - + ## Indentation @@ -1721,7 +1710,7 @@ Indentation Config ``` - + ## Format All @@ -1735,7 +1724,7 @@ Indentation Config ``` - + ## Evil-Nerd-Commenter @@ -1750,7 +1739,7 @@ Indentation Config ``` - + ## Iedit @@ -1763,7 +1752,7 @@ Indentation Config ``` - + ## Header @@ -1781,7 +1770,7 @@ Indentation Config ``` - + ## Jupyter Notebook @@ -1802,12 +1791,12 @@ Indentation Config ``` - + # Programming - + ## Language Server Protocol @@ -1893,7 +1882,7 @@ Indentation Config ``` - + ## Java @@ -1917,7 +1906,7 @@ Indentation Config ``` - + ## C/C++ @@ -1931,7 +1920,7 @@ Indentation Config Note: If Displaying `No LSP server for c-mode`, execute `M-x ielm` and verify clangd is installed using `(describe-variable *clangd*)` or `(executable-find lsp-clients-clangd-executable)`. - + ## Python @@ -1966,7 +1955,7 @@ Now, put `~/.emacs.d\python-language-server\output\bin\Release\win10-x64\publish ``` - + ## Arduino @@ -2003,7 +1992,7 @@ Now, put `~/.emacs.d\python-language-server\output\bin\Release\win10-x64\publish ``` - + # Web Development @@ -2016,7 +2005,7 @@ npm install -g vscode-html-languageserver-bin ``` - + ## Web Mode @@ -2030,7 +2019,7 @@ npm install -g vscode-html-languageserver-bin ``` - + ## Emmet @@ -2044,7 +2033,7 @@ npm install -g vscode-html-languageserver-bin ``` - + ## JavaScript/TypeScript @@ -2071,12 +2060,12 @@ npm install -g vscode-html-languageserver-bin ``` - + # Miscellaneous - + ## Org @@ -2132,7 +2121,7 @@ npm install -g vscode-html-languageserver-bin ``` - + ## Emacs Web Wowser @@ -2168,7 +2157,7 @@ In Eww, hit & to browse this url system browser ``` - + ## LeetCode @@ -2191,7 +2180,7 @@ In Eww, hit & to browse this url system browser ``` - + ## Tetris @@ -2210,7 +2199,7 @@ Although [Tetris](https://www.emacswiki.org/emacs/TetrisMode) is part of Emacs, ``` - + ## Speed Type @@ -2222,7 +2211,7 @@ Although [Tetris](https://www.emacswiki.org/emacs/TetrisMode) is part of Emacs, ``` - + ## 2048 Game @@ -2234,7 +2223,7 @@ Although [Tetris](https://www.emacswiki.org/emacs/TetrisMode) is part of Emacs, ``` - + ## Zone diff --git a/elisp/init-global-config.el b/elisp/init-global-config.el index 8d92246f..9b35fb3a 100644 --- a/elisp/init-global-config.el +++ b/elisp/init-global-config.el @@ -134,14 +134,6 @@ ;; Functions -;; SaveEmacsSession -(defun save-current-session () - "Toggle `desktop-save-mode` and `savehist-mode`." - (interactive) - (desktop-save-mode 1) - (savehist-mode 1)) -;; -SaveEmacsSession - ;; ResizeWidthHeight ;; Resizes the window width based on the input (defun window-resize-width (w) diff --git a/init.org b/init.org index a946653a..7ea6e2ff 100644 --- a/init.org +++ b/init.org @@ -270,22 +270,20 @@ #+INCLUDE: "~/.emacs.d/elisp/init-global-config.el" src emacs-lisp :range-begin "CustomSetFileLocation" :range-end "-CustomSetFileLocation" :lines "131-133" ** More Functions Other important, but longer functions. -*** Save Current Session - #+INCLUDE: "~/.emacs.d/elisp/init-global-config.el" src emacs-lisp :range-begin "SaveEmacsSession" :range-end "-SaveEmacsSession" :lines "138-143" *** Resize Window Width / Height Functions - #+INCLUDE: "~/.emacs.d/elisp/init-global-config.el" src emacs-lisp :range-begin "ResizeWidthheight" :range-end "-ResizeWidthheight" :lines "146-167" + #+INCLUDE: "~/.emacs.d/elisp/init-global-config.el" src emacs-lisp :range-begin "ResizeWidthheight" :range-end "-ResizeWidthheight" :lines "138-159" *** Edit This Configuration File Shortcut - #+INCLUDE: "~/.emacs.d/elisp/init-global-config.el" src emacs-lisp :range-begin "EditConfig" :range-end "-EditConfig" :lines "170-176" + #+INCLUDE: "~/.emacs.d/elisp/init-global-config.el" src emacs-lisp :range-begin "EditConfig" :range-end "-EditConfig" :lines "162-168" *** Smarter Move Beginning of Line Smarter navigation to the beginning of a line by [[https://emacsredux.com/blog/2013/05/22/smarter-navigation-to-the-beginning-of-a-line/][Bozhidar Batsov]]. - #+INCLUDE: "~/.emacs.d/elisp/init-global-config.el" src emacs-lisp :range-begin "MoveBeginningLine" :range-end "-MoveBeginningLine" :lines "179-204" + #+INCLUDE: "~/.emacs.d/elisp/init-global-config.el" src emacs-lisp :range-begin "MoveBeginningLine" :range-end "-MoveBeginningLine" :lines "171-196" *** Update Org Mode Include Automatically Update Org Mode INCLUDE Statements Automatically from [[http://endlessparentheses.com/updating-org-mode-include-statements-on-the-fly.html][Artur Malabarba]]. - #+INCLUDE: "~/.emacs.d/elisp/init-global-config.el" src emacs-lisp :range-begin "OrgIncludeAuto" :range-end "-OrgIncludeAuto" :lines "207-252" + #+INCLUDE: "~/.emacs.d/elisp/init-global-config.el" src emacs-lisp :range-begin "OrgIncludeAuto" :range-end "-OrgIncludeAuto" :lines "199-244" *** MiniBuffer - #+INCLUDE: "~/.emacs.d/elisp/init-global-config.el" src emacs-lisp :range-begin "BetterMiniBuffer" :range-end "-BetterMiniBuffer" :lines "255-264" + #+INCLUDE: "~/.emacs.d/elisp/init-global-config.el" src emacs-lisp :range-begin "BetterMiniBuffer" :range-end "-BetterMiniBuffer" :lines "247-256" *** Duplicate Line - #+INCLUDE: "~/.emacs.d/elisp/init-global-config.el" src emacs-lisp :range-begin "DuplicateLine" :range-end "-DuplicateLine" :lines "267-279" + #+INCLUDE: "~/.emacs.d/elisp/init-global-config.el" src emacs-lisp :range-begin "DuplicateLine" :range-end "-DuplicateLine" :lines "259-271" * User Interface Enhancements ** Title Bar #+INCLUDE: "~/.emacs.d/elisp/init-ui-config.el" src emacs-lisp :range-begin "TitleBar" :range-end "-TitleBar" :lines "45-46"