...
 
Commits (9)
......@@ -43,6 +43,7 @@ push @emacs_dirs, $ENV{HOME} . '/.emacs.d';
# then fall in place.
my %ft_regular_globs = (
'bin/*' => '/bin',
'dict/*-mode' => '/.emacs.d/dict',
'themes/*.el' => '/.emacs.d/themes',
'vendor/*.el' => '/.emacs.d/vendor' );
......@@ -109,6 +110,8 @@ sub ft_emacs_register {
my ($glob, $dest) = @_;
register { glob => $glob,
post_glob => sub {
return remove_hashes( remove_tilde(@_) ) },
method => $method,
destination => $dest };
}
......
#!/bin/sh
exec emacsclient -a vim -t "$@"
#!/bin/sh
exec new-emacs-frame "$@"
#!/bin/sh
exec start-emacs -nw "$@"
#!/bin/sh
exec emacsclient -a gvim -n -c "$@"
#!/bin/sh
exec emacs --no-site-file "$@"
......@@ -5,8 +5,4 @@
(expand-file-name (format "elpa-%s" emacs-major-version)
user-emacs-directory))))
(when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(when (fboundp 'menu-bar-mode) (menu-bar-mode -1))
(when (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(defvar ft/with-early-init-el t)
......@@ -24,7 +24,7 @@
(setq ft/gnus-adaptive-score-dir "~/etc/mailnews/gnus-adaptive/")
;; Force tmux title to "mail/news".
(cond ((and (string-equal ft/host-system "console")
(cond ((and (string-equal (ft/host-system) "console")
(string-match "^screen" ft/term))
(send-string-to-terminal "\ekmail/news\e\\")))
......
......@@ -145,17 +145,58 @@
(cond ((> width 1400) 11)
(t 11)))
((eq system 'x-win)
(cond ((> width 1400) 11)
(t 10))))))
(cond ((> width 2500) 13)
((> width 1400) 11)
(t 10)))
(t 12))))
(concat (format fmt size)
(if embolden-p ":embolden=true" ""))))
(when (memq ft/host-system '(x-win ms-win))
(setq default-frame-alist
(let* ((width (ft/gui-display-width))
(height (ft/gui-display-height))
(gui-font (ft/generate-font-string ft/host-system width height)))
(list (cons 'font gui-font)))))
(defun ft/set-gui-parameters ()
(let ((system (ft/host-system)))
;; Configure GUI font based on system and screen size.
(when (memq system '(x-win ms-win))
(setq default-frame-alist
(let* ((width (ft/gui-display-width))
(height (ft/gui-display-height))
(gui-font (ft/generate-font-string system width height)))
(list (cons 'horizontal-scroll-bars nil)
(cons 'vertical-scroll-bars nil)
(cons 'font gui-font)))))
;; Put yanked stuff into primary buffer, if we're on X11 since this will
;; not work on M$-Windoze type systems — and terminal emacs doesn't give
;; a crap anyway.
(when (eq system 'x-win)
(setq select-enable-primary t)
(setq select-enable-clipboard nil)
(setq x-select-enable-clipboard-manager nil)))
;; Mouse behaviour adjustments.
(when (display-mouse-p)
;; Mouse avoidance mode is interesting, but I only liked the ‘banish’ mode it
;; offers. Now after a while, I sometimes misclicked in another application
;; after switching to another workspace in my window manager.
(mouse-avoidance-mode 'none)
;; This is the default, but I wanted to remind myself that it exists.
;; Unfortuntely, it only makes the pointer invisible after *changing* a
;; buffer, and *not* if you merely move the cursor or scroll a buffer's
;; display. This is rather annoying for reading documentation within emacs.
;; Not great, but oh well.
(setq make-pointer-invisible t)))
(defvar ft/gui-initialised-p nil
"Session variable reflecting if emacs' GUI parameters were initialised yet.")
(when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
(when (fboundp 'menu-bar-mode) (menu-bar-mode -1))
(when (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(add-hook 'server-after-make-frame-hook
(lambda ()
(unless ft/gui-initialised-p
(ft/set-gui-parameters)
(modify-frame-parameters nil default-frame-alist)
(setq ft/gui-initialised-p t))
(winring-set-name "default")))
(setq-default line-spacing 0.1)
(setq diff-switches '("-u"))
......@@ -171,13 +212,6 @@
(setq mouse-yank-at-point t)
(setq custom-file (concat ft/emacs-directory "/customize.el"))
;; Put yanked stuff into primary buffer, if we're on X11 since this won't work
;; on M$-Windoze type systems — and terminal emacs doesn't give a crap anyway.
(when (eq ft/host-system 'x-win)
(setq select-enable-primary t)
(setq select-enable-clipboard nil)
(setq x-select-enable-clipboard-manager nil))
(setq-default inhibit-startup-message t)
(setq-default inhibit-startup-echo-area-message t)
(setq-default require-final-newline t)
......@@ -186,17 +220,6 @@
(setq-default sentence-end-double-space nil)
(setq-default cursor-in-non-selected-windows nil)
(setq-default fill-column 79)
(when (display-mouse-p)
;; Mouse avoidance mode is interesting, but I only liked the ‘banish’ mode it
;; offers. Now after a while, I sometimes misclicked in another application
;; after switching to another workspace in my window manager.
(mouse-avoidance-mode 'none)
;; This is the default, but I wanted to remind myself that it exists.
;; Unfortuntely, it only makes the pointer invisible after *changing* a
;; buffer, and *not* if you merely move the cursor or scroll a buffer's
;; display. This is rather annoying for reading documentation within emacs.
;; Not great, but oh well.
(setq make-pointer-invisible t))
(fset 'yes-or-no-p 'y-or-n-p)
......@@ -1756,7 +1779,7 @@ beginning of the next S-expression."
(defun ft/want-tmux-title ()
"Determine if the running emacs instance should try to update
tmux's status line."
(and (eq ft/host-system 'console)
(and (eq (ft/host-system) 'console)
(string-match "^screen" ft/term)))
(defun ft/tmux-set-title ()
(send-string-to-terminal (format "\ekemacs(%s)\e\\" (buffer-name))))
......@@ -1777,19 +1800,14 @@ tmux's status line."
(add-hook 'select-window-hook #'ft/tmux-set-title)))
(use-package server
:if (and (not noninteractive)
(or (eq ft/host-system 'x-win)
(eq ft/host-system 'ms-win)
(eq ft/host-system 'mac)))
:if (and (not noninteractive) (memq (ft/host-system) '(x-win 'ms-win 'mac)))
:preface (defun ft/maybe-start-server ()
(if (server-running-p server-name)
(message "Another server running on %s; leaving it alone."
server-name)
(message "Starting emacs server: %s" server-name)
(server-start)))
:init (progn (setq server-socket-dir (expand-file-name "~/.emacs.d/server"))
(setq server-name "socket")
(add-hook 'after-init-hook #'ft/maybe-start-server)))
:init (add-hook 'after-init-hook #'ft/maybe-start-server))
(use-package shr
:config (setq shr-use-fonts nil))
......
......@@ -14,16 +14,16 @@
(expand-file-name "~/.emacs.d")
"The $HOME/.emacs.d directory of the current system.")
(defvar ft/host-system
(defun ft/host-system ()
"Return the display-system the current emacs instance is running in. Can
be one of `console', `ms-win', `x-win', `mac', `dos' or `unknown'."
(cond
((eq window-system 'x) 'x-win)
((eq window-system nil) 'console)
((memq window-system '(win32 w32)) 'ms-win)
((eq window-system 'x) 'x-win)
((eq window-system 'ns) 'mac)
((eq window-system 'pc) 'dos)
(t 'unknown))
"Set to the display-system the current emacs instance is running in. Can
be one of `console', `ms-win', `x-win', `mac', `dos' or `unknown'.")
(t 'unknown)))
(defvar ft/host-name
(let ((name (system-name)))
......@@ -32,7 +32,7 @@ be one of `console', `ms-win', `x-win', `mac', `dos' or `unknown'.")
only the host-name if the `system-name' function returns a fqdn.")
(defvar ft/term
(getenv "TERM")
(or (getenv "TERM") "dumb")
"The $TERM environment variable the current emacs instance was started in.")
(defvar ft/gui-browser-function
......