"Value of `current-time' when Emacs begins loading `user-init-file'.")
(message "Loading Emacs...done (%.3fs)"
"Value of `current-time' when Emacs begins loading `user-init-file'.")
(message "Loading Emacs...done (%.3fs)"
before-init-time)))
;; temporarily increase `gc-cons-threshhold' and `gc-cons-percentage'
;; during startup to reduce garbage collection frequency. clearing
;; `file-name-handler-alist' seems to help reduce startup time too.
before-init-time)))
;; temporarily increase `gc-cons-threshhold' and `gc-cons-percentage'
;; during startup to reduce garbage collection frequency. clearing
;; `file-name-handler-alist' seems to help reduce startup time too.
-(defvar a/gc-cons-threshold gc-cons-threshold)
-(defvar a/gc-cons-percentage gc-cons-percentage)
-(defvar a/file-name-handler-alist file-name-handler-alist)
+(defvar mab/gc-cons-threshold gc-cons-threshold)
+(defvar mab/gc-cons-percentage gc-cons-percentage)
+(defvar mab/file-name-handler-alist file-name-handler-alist)
-(defun a/post-init ()
- (setq gc-cons-threshold a/gc-cons-threshold
- gc-cons-percentage a/gc-cons-percentage
- file-name-handler-alist a/file-name-handler-alist))
-(add-hook 'after-init-hook #'a/post-init)
+(defun mab/post-init ()
+ (setq gc-cons-threshold mab/gc-cons-threshold
+ gc-cons-percentage mab/gc-cons-percentage
+ file-name-handler-alist mab/file-name-handler-alist))
+(add-hook 'after-init-hook #'mab/post-init)
(setq straight-repository-branch "develop"
straight-check-for-modifications '(check-on-save find-when-checking))
(setq straight-repository-branch "develop"
straight-check-for-modifications '(check-on-save find-when-checking))
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
"Conveniently disable `focus-follows-mouse'.
For disabling the behaviour for certain buffers and/or modes."
(make-local-variable 'mouse-autoselect-window)
"Conveniently disable `focus-follows-mouse'.
For disabling the behaviour for certain buffers and/or modes."
(make-local-variable 'mouse-autoselect-window)
"Set all the variables from VARS to value VALUE."
(declare (indent defun) (debug t))
`(progn ,@(mapcar (lambda (x) (list 'setq x value)) vars)))
"Set all the variables from VARS to value VALUE."
(declare (indent defun) (debug t))
`(progn ,@(mapcar (lambda (x) (list 'setq x value)) vars)))
"Same as `start-process', but doesn't bother about name and buffer."
(let ((process-name (concat program "_process"))
(buffer-name (generate-new-buffer-name
"Same as `start-process', but doesn't bother about name and buffer."
(let ((process-name (concat program "_process"))
(buffer-name (generate-new-buffer-name
"Open current file with a PROGRAM."
;; Shell command looks like this: "program [ARGS]... FILE" (ARGS can
;; be nil, so remove it).
"Open current file with a PROGRAM."
;; Shell command looks like this: "program [ARGS]... FILE" (ARGS can
;; be nil, so remove it).
;; https://stackoverflow.com/a/17788551, with changes to use `cl-letf'
;; instead of the now obsolete `flet'.
(with-eval-after-load 'compile
;; https://stackoverflow.com/a/17788551, with changes to use `cl-letf'
;; instead of the now obsolete `flet'.
(with-eval-after-load 'compile
:prefix "C-c p s"
("u" . straight-use-package)
("f" . straight-freeze-versions)
("t" . straight-thaw-versions)
("P" . straight-prune-build)
("g" . straight-get-recipe)
:prefix "C-c p s"
("u" . straight-use-package)
("f" . straight-freeze-versions)
("t" . straight-thaw-versions)
("P" . straight-prune-build)
("g" . straight-get-recipe)
;; org file. closely inspired by
;; https://github.com/dieggsy/dotfiles/tree/cc10edf7701958eff1cd94d4081da544d882a28c/emacs.d#dotfiles
(with-eval-after-load 'org
;; org file. closely inspired by
;; https://github.com/dieggsy/dotfiles/tree/cc10edf7701958eff1cd94d4081da544d882a28c/emacs.d#dotfiles
(with-eval-after-load 'org
(format " (%.3fs)"
(float-time (time-subtract (current-time)
',file-tangle-start-time)))
(format " (%.3fs)"
(float-time (time-subtract (current-time)
',file-tangle-start-time)))
(make-local-variable 'company-idle-delay)
(defvar company-idle-delay)
(setq company-idle-delay nil)
(bind-keys :map eshell-mode-map
(make-local-variable 'company-idle-delay)
(defvar company-idle-delay)
(setq company-idle-delay nil)
(bind-keys :map eshell-mode-map
("<s-tab>" . outline-toggle-children)
("M-p" . outline-previous-visible-heading)
("M-n" . outline-next-visible-heading)
("<s-tab>" . outline-toggle-children)
("M-p" . outline-previous-visible-heading)
("M-n" . outline-next-visible-heading)
web-mode-code-indent-offset
web-mode-css-indent-offset
web-mode-markup-indent-offset))
web-mode-code-indent-offset
web-mode-css-indent-offset
web-mode-markup-indent-offset))
'(("[ \t]*\\(#\\+\\(BEGIN\\|END\\|begin\\|end\\)_\\(\\S-+\\)\\)[ \t]*\\([^\n:]*\\)"
(1 '(:foreground "#5a5b5a" :background "#292b2b") t) ; directive
(3 '(:foreground "#81a2be" :background "#292b2b") t) ; kind
(4 '(:foreground "#c5c8c6") t)))) ; title
'(("[ \t]*\\(#\\+\\(BEGIN\\|END\\|begin\\|end\\)_\\(\\S-+\\)\\)[ \t]*\\([^\n:]*\\)"
(1 '(:foreground "#5a5b5a" :background "#292b2b") t) ; directive
(3 '(:foreground "#81a2be" :background "#292b2b") t) ; kind
(4 '(:foreground "#c5c8c6") t)))) ; title
"Enable my favourite light theme."
(interactive)
(mapc #'disable-theme custom-enabled-themes)
(load-theme 'tangomod t)
(sml/apply-theme 'automatic)
(font-lock-remove-keywords
"Enable my favourite light theme."
(interactive)
(mapc #'disable-theme custom-enabled-themes)
(load-theme 'tangomod t)
(sml/apply-theme 'automatic)
(font-lock-remove-keywords
"Go dark."
(interactive)
(mapc #'disable-theme custom-enabled-themes)
(load-theme 'doom-tomorrow-night t)
(sml/apply-theme 'automatic)
(font-lock-add-keywords
"Go dark."
(interactive)
(mapc #'disable-theme custom-enabled-themes)
(load-theme 'doom-tomorrow-night t)
(sml/apply-theme 'automatic)
(font-lock-add-keywords
"Report project name and type in the modeline."
(let ((project-name (projectile-project-name))
(project-type (projectile-project-type)))
"Report project name and type in the modeline."
(let ((project-name (projectile-project-name))
(project-type (projectile-project-type)))
Termcom, Computer Science Club
University of Waterloo
https://shemshak.org/~amin")
Termcom, Computer Science Club
University of Waterloo
https://shemshak.org/~amin")
("nnimap\\+uw:INBOX"
(gcc "\"nnimap+uw:Sent Items\""))
("nnimap\\+csc:.*"
(address "abandali@csclub.uwaterloo.ca")
(organization "Computer Science Club, University of Waterloo")
("nnimap\\+uw:INBOX"
(gcc "\"nnimap+uw:Sent Items\""))
("nnimap\\+csc:.*"
(address "abandali@csclub.uwaterloo.ca")
(organization "Computer Science Club, University of Waterloo")
(defconst message-cite-style-bandali
'((message-cite-function 'message-cite-original)
(message-citation-line-function 'message-insert-formatted-citation-line)
(defconst message-cite-style-bandali
'((message-cite-function 'message-cite-original)
(message-citation-line-function 'message-insert-formatted-citation-line)
(message-yank-cited-prefix ">")
(message-yank-empty-prefix ">")
(message-citation-line-format
(message-yank-cited-prefix ">")
(message-yank-empty-prefix ">")
(message-citation-line-format
- (if a/message-cite-say-hi
- (concat "Hi %F,\n\n" a/message-cite-style-format)
- a/message-cite-style-format)))
+ (if mab/message-cite-say-hi
+ (concat "Hi %F,\n\n" mab/message-cite-style-format)
+ mab/message-cite-style-format)))
"Citation style based on Mozilla Thunderbird's. Use with message-cite-style.")
(setq ;; message-cite-style 'message-cite-style-bandali
message-kill-buffer-on-exit t
"Citation style based on Mozilla Thunderbird's. Use with message-cite-style.")
(setq ;; message-cite-style 'message-cite-style-bandali
message-kill-buffer-on-exit t