aboutsummaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/init/ycp-editing.el2
-rw-r--r--emacs/.emacs.d/init/ycp-project.el2
-rw-r--r--emacs/.emacs.d/lisp/my/my-editing.el7
-rw-r--r--emacs/README.org42
4 files changed, 29 insertions, 24 deletions
diff --git a/emacs/.emacs.d/init/ycp-editing.el b/emacs/.emacs.d/init/ycp-editing.el
index 7af3587..4bdeb32 100644
--- a/emacs/.emacs.d/init/ycp-editing.el
+++ b/emacs/.emacs.d/init/ycp-editing.el
@@ -132,7 +132,7 @@
(add-hook 'text-mode-hook #'turn-on-auto-fill)
-(my-add-hooks #'my-non-special-modes-setup '(text-mode prog-mode))
+(my-add-hooks #'my-non-special-modes-setup '(text-mode-hook prog-mode-hook))
(add-to-list
'auto-mode-alist
diff --git a/emacs/.emacs.d/init/ycp-project.el b/emacs/.emacs.d/init/ycp-project.el
index 15c7fcc..d4c7dd9 100644
--- a/emacs/.emacs.d/init/ycp-project.el
+++ b/emacs/.emacs.d/init/ycp-project.el
@@ -29,7 +29,7 @@
(my-package my-project
(:delay 30)
- (my-setq-from-local my-projects-root-dirs)
+ (my-setq-from-local my-projects-root-dirs my-licenses)
(my-keybind global-map
"\C-xpl" #'my-project-copy-license-file-to-project
"\C-xpS" #'my-project-shell-at
diff --git a/emacs/.emacs.d/lisp/my/my-editing.el b/emacs/.emacs.d/lisp/my/my-editing.el
index 940a338..b420d89 100644
--- a/emacs/.emacs.d/lisp/my/my-editing.el
+++ b/emacs/.emacs.d/lisp/my/my-editing.el
@@ -251,9 +251,10 @@ Call the commands `my-escape-url-line' and
(defun my--character-prompt (chars)
"Helper of `my-insert-pair-completion' to read CHARS."
(let ((def (car my--character-hist)))
- (completing-read
- (format "Select character [%s]: " def)
- chars nil t nil 'my--character-hist def)))
+ (let ((electric-pair-mode nil))
+ (completing-read
+ (format "Select character [%s]: " def)
+ chars nil t nil 'my--character-hist def))))
;;;###autoload
(defun my-insert-pair (pair &optional count)
diff --git a/emacs/README.org b/emacs/README.org
index 7dc1366..5f2a094 100644
--- a/emacs/README.org
+++ b/emacs/README.org
@@ -1,11 +1,12 @@
-:PROPERTIES:
-:UPDATED: [2023-06-12 Mon 15:28]
-:END:
#+title: Yuchen Pei's GNU Emacs Configuration
#+author: Yuchen Pei
#+language: en
#+email: id@ypei.org
+* Intro
+ :PROPERTIES:
+ :UPDATED: [2023-06-26 Mon 16:02]
+ :END:
I started using Emacs and ditched Vim in 2020, and the content of this
repo is the result of the config over the years. This config has
several characteristics.
@@ -15,32 +16,32 @@ quest to realise it always favours the Emacs core, followed by the GNU
ELPA, then the NonGNU ELPA. In the same spirit, the keybindings follow
the convention of Emacs core.
-Acknowledgement: this config is influenced by many people's configs,
-most notably Protesilaos Stavrou's, both in organisation and the
-actual configuration.
-
+* Organisation
+ :PROPERTIES:
+ :UPDATED: [2023-06-26 Mon 15:49]
+ :END:
Here's how the files are organised:
- The =early-init.el= file :: The first file loaded by emacs, it
does the following
- - Set the =my-profile= variable from the =EMACS_PROFILE= environment
+ - Set the ~my-profile~ variable from the ~EMACS_PROFILE~ environment
variable. This variable controls which packages to allow or
- ignore. Examples include =emms= and =erc= which causes a dedicated
- emacs instance to run =emms= or =erc=, in which case most packages
+ ignore. Examples include ~emms~ and ~erc~ which causes a dedicated
+ emacs instance to run ~emms~ or ~erc~, in which case most packages
are disabled. The default profile, by contrast, disables these two
packages.
- Add a hook to report the time taken at the end of initialisation
- Some optimizations
-- The =init.el= file :: The init file, it adds the =load-path=, and
- =requires='s ='my-package=, ='ycp-package= and the remaining
- configurations. Apart from =my-package= and =ycp-package=, the
- remaining =require='s may be needed to be in a loose order.
+- The =init.el= file :: The init file, it adds the ~load-path~, and
+ ~requires~'s ~'my-package~, ~'ycp-package~ and the remaining
+ configurations. Apart from ~my-package~ and ~ycp-package~, the
+ remaining ~require~'s may be needed to be in a loose order.
- The =lisp/my/my-package.el= file :: This file defines macros needed
by the rest of the initialisation. After comparing [[https://protesilaos.com/emacs/dotemacs][Protesilaos
Stavrou's]] and [[https://github.com/jwiegley/dot-emacs][John Wiegley's]] approaches, I decided to adopt the
- former, with the simple =my-package= macro, given that the delay and
+ former, with the simple ~my-package~ macro, given that the delay and
installation directives are sufficient for the use of this config,
and it is closer to the emacs core. Another design decision is to
not use org literate configuration.
@@ -49,16 +50,19 @@ Here's how the files are organised:
config. The local config is a mechanism for separating out variables
concerning machine-specific and/or personal information from the
emacs config files in this repository. Values of these variables are
- set with the macro =my-setq-from-local= after running
- =my-read-from-local-config= to read the local config in
- =my-local-config=.
+ set with the macro ~my-setq-from-local~ after running
+ ~my-read-from-local-config~ to read the local config in
+ ~my-local-config~. To generate a local config file from all the
+ variables used in ~my-setq-from-local~ with their current values,
+ invoke the function ~my-collect-my-setqd-vars~ which will print out
+ an alist that you can put in a local config file.
Finally, this file defines some other convenience macros for
overriding functions and setting timers.
- The =init/ycp-package.el= file :: This file determines what packages
to allow or omit depending on the profile, calls
- =my-read-from-local-config= as mentioned above, starts the server,
+ ~my-read-from-local-config~ as mentioned above, starts the server,
and sets the package archives to use. It also configure package
related options, like the rest of the files in the =init= directory.