Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
See what's new at GitLab
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
C
configurations
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Robert Helgesson
configurations
Commits
5f75de4b
Verified
Commit
5f75de4b
authored
Nov 11, 2020
by
Robert Helgesson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add basic Emacs email setup
Using msmtp and notmuch.
parent
3c5602b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
12 deletions
+76
-12
user/emacs.nix
user/emacs.nix
+76
-12
No files found.
user/emacs.nix
View file @
5f75de4b
...
...
@@ -10,6 +10,7 @@ in
{
imports
=
[
nurNoPkgs
.
repos
.
rycee
.
hmModules
.
emacs-init
nurNoPkgs
.
repos
.
rycee
.
hmModules
.
emacs-notmuch
];
nixpkgs
.
overlays
=
[
(
import
sources
.
emacs-overlay
)
];
...
...
@@ -387,6 +388,48 @@ in
command
=
[
"notifications-notify"
];
};
notmuch
=
{
command
=
[
"notmuch"
"notmuch-show-tag"
"notmuch-search-tag"
];
hook
=
[
''(notmuch-show . rah-disable-trailing-whitespace-mode)''
];
bindLocal
=
{
notmuch-show-mode-map
=
{
"S"
=
"rah-notmuch-show-tag-spam"
;
"d"
=
"rah-notmuch-show-tag-deleted"
;
};
notmuch-search-mode-map
=
{
"S"
=
"rah-notmuch-search-tag-spam"
;
"d"
=
"rah-notmuch-search-tag-deleted"
;
};
};
config
=
let
listTags
=
ts
:
"(list
${
toString
(
map
(
t
:
''"
${
t
}
"''
)
ts
)
}
)"
;
spamTags
=
listTags
[
"+spam"
"-inbox"
];
deletedTags
=
listTags
[
"+deleted"
"-inbox"
];
in
''
(defun rah-notmuch-show-tag-spam ()
(interactive)
(notmuch-show-tag
${
spamTags
}
))
(defun rah-notmuch-show-tag-deleted ()
(interactive)
(notmuch-show-tag
${
deletedTags
}
))
(defun rah-notmuch-search-tag-spam (&optional beg end)
(interactive)
(notmuch-search-tag
${
spamTags
}
beg end))
(defun rah-notmuch-search-tag-deleted (&optional beg end)
(interactive)
(notmuch-search-tag
${
deletedTags
}
beg end))
(setq notmuch-show-logo nil)
''
;
};
flyspell
=
{
enable
=
true
;
diminish
=
[
"flyspell-mode"
];
...
...
@@ -1404,20 +1447,41 @@ in
rust-mode
.
enable
=
true
;
sendmail
=
{
enable
=
false
;
command
=
[
"mail-mode"
"mail-text"
]
;
mode
=
[
''("mutt-" . mail-mode)''
''("\\.article" . mail-mode))''
];
hook
=
[
''
(lambda ()
(auto-fill-mode) ; Avoid having to M-q all the time.
(rah-mail-flyspell) ; I spel funily soemtijms.
(rah-mail-reftex) ; Make it easy to include references.
(mail-text)) ; Jump to the actual text.
''
''("^mutt-" . mail-mode)''
''("\\.article" . mail-mode)''
];
bindLocal
=
{
mail-mode-map
=
{
# Make it easy to include references.
"C-c ["
=
"rah-mail-reftex-citation"
;
};
};
hook
=
[
"rah-mail-mode-hook"
];
config
=
''
(defun rah-mail-reftex-citation ()
(let ((reftex-cite-format 'locally))
(reftex-citation)))
(defun rah-mail-flyspell ()
"Enable flyspell and set dictionary based on To: field."
(save-excursion
(goto-char (point-min))
(when (re-search-forward "^To: .*\\.se\\($\\|,\\|>\\)" nil t)
(ispell-change-dictionary "swedish"))))
(defun rah-mail-mode-hook ()
(auto-fill-mode) ; Avoid having to M-q all the time.
(rah-mail-flyspell) ; I spel funily soemtijms.
(mail-text)) ; Jump to the actual text.
(setq sendmail-program "
${
pkgs
.
msmtp
}
/bin/msmtp"
send-mail-function 'sendmail-send-it
mail-specify-envelope-from t
message-sendmail-envelope-from 'header
mail-envelope-from 'header)
''
;
};
sv-kalender
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment