(defun add-load-path (dir)
(interactive "D")
(push dir load-path))
(add-load-path "~/.emacs.d/src")
(cd "~")
(setq max-lisp-eval-depth 3000)
(setq enable-recursive-minibuffers t)
(require 'edit-server)
(setq edit-server-new-frame nil)
(condition-case nil
(edit-server-start)
(error nil))
(let ((delete-by-moving-to-trash nil))
(server-force-delete)
(server-start))
(defvar my-isearch-case-table
(let ((eqv-list '("aAàÀáÁâÂãÃäÄåÅ"
"cCçÇ"
"eEèÈéÉêÊëË"
"iIìÌíÍîÎïÏ"
"nNñÑ"
"oOòÒóÓôÔõÕöÖøØ"
"uUùÙúÚûÛüÜ"
"yYýÝÿ"))
(table (make-char-table 'case-table))
(parent (standard-case-table))
(canon (make-char-table 'case-table)))
(set-char-table-parent table parent)
(set-char-table-parent canon (char-table-extra-slot parent 1))
(mapcar (lambda (s)
(mapcar (lambda (c) (aset canon c (aref s 0))) s))
eqv-list)
(set-char-table-extra-slot table 1 canon)
(set-char-table-extra-slot table 2 nil)
table)
"a case table for ignoring accentuated letter")
(defun my-set-isearch-case-table ()
(interactive)
;; (set-case-table my-isearch-case-table)
)
(add-hook 'text-mode-hook 'my-set-isearch-case-table)
; this does nothing, and this doing nothing make baby cry.
(defun my-isearch-case-table-advice (oldfun &rest args)
(with-case-table my-isearch-case-table
(apply oldfun args)))
(defun my-isearch-forward-regexp ()
(interactive)
(with-case-table my-isearch-case-table
(isearch-forward-regexp)))
(defun my-set-buffer-case-table (&optional buffer)
(interactive)
(when buffer
(with-current-buffer buffer
(set-case-table my-isearch-case-table)))
buffer)
(advice-add 'isearch-mode :around #'my-isearch-case-table-advice)
(advice-add 'isearch-forward-regexp :around #'my-isearch-case-table-advice)
(setq helm-command-prefix-key "C-c h")
(require 'helm-config)
;; The default "C-x c" is quite close to "C-x C-c", which quits Emacs.
;; Changed to "C-c h". Note: We must set "C-c h" globally, because we
;; cannot change `helm-command-prefix-key' once `helm-config' is loaded.
(global-set-key (kbd "C-c h") 'helm-command-prefix)
;(global-unset-key (kbd "C-x c"))
(with-eval-after-load 'helm
(define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action) ; rebind tab to run persistent action
(define-key helm-map (kbd "C-i") 'helm-execute-persistent-action) ; make TAB works in terminal
(define-key helm-map (kbd "<C-dead-circumflex>") 'helm-select-action) ; list actions using C-z
(define-key helm-map (kbd "C-^") 'helm-select-action) ; list actions using C-z
)
(when (executable-find "curl")
(setq helm-google-suggest-use-curl-p t))
(setq helm-split-window-in-side-p t ; open helm buffer inside current window, not occupy whole other window
helm-buffers-fuzzy-matching t ; fuzzy matching buffer names when non--nil
helm-move-to-line-cycle-in-source t ; move to end or beginning of source when reaching top or bottom of source.
helm-ff-search-library-in-sexp t ; search for library in `require' and `declare-function' sexp.
helm-scroll-amount 8 ; scroll 8 lines other window using M-<next>/M-<prior>
helm-ff-file-name-history-use-recentf t)
(helm-mode 1)
(global-set-key (kbd "M-x") 'helm-M-x)
(global-set-key (kbd "<menu>") 'helm-M-x)
(global-set-key (kbd "M-y") 'helm-show-kill-ring)
(global-set-key (kbd "C-x b") 'helm-mini)
(global-set-key (kbd "C-x C-f") 'helm-find-files)
(global-set-key [f4] 'helm-man-woman)
(global-set-key (kbd "C-c h o") 'helm-occur)
(global-set-key (kbd "C-c h g") 'helm-do-grep)
(advice-add #'helm-candidate-buffer :filter-return #'my-set-buffer-case-table)
(defun my-ffap-file-at-point-filter (result)
(cond ((string= result "/")
())
((null result) nil)
((string-match "^file:\\(/.*\\)$" result)
(match-string 1 result))
(t result)))
(advice-add 'ffap-guesser :filter-return #'my-ffap-file-at-point-filter)
(setq helm-man-or-woman-function 'woman)
(setq Info-directory-list (list* "~/info"
Info-default-directory-list))
Penser à reclasser les deux add-hook
;; (when (require 'ethan-wspace () t)
;; (add-hook 'before-save-hook 'clean-whitespace-tentative))
(add-hook 'before-save-hook 'time-stamp)
(setq desktop-save ())
(defvar mydefault-font-height
(cond
((string= system-name "maison.at.home")
200)
((string= system-name "toubib.at.home")
180)
(t 120)))
(set-face-attribute 'default nil :background "black")
(set-face-attribute 'default nil :foreground "gray90")
(set-face-attribute 'default nil :height mydefault-font-height)
(set-face-attribute 'default nil :foundry "bitstream")
(set-face-attribute 'default nil :family "Bitstream Vera Sans Mono")
(set-face-attribute 'cursor nil :background "LightGrey")
(setq visible-bell 't)
(require 'font-lock)
(global-font-lock-mode t)
(setq font-lock-maximum-decoration t)
(show-paren-mode 1)
(setq frame-title-format '(multiple-frames "%b"
("" user-login-name "@" invocation-name "@" system-name)))
(menu-bar-mode -1)
(tool-bar-mode -1)
(electric-pair-mode)
(defvar pair-or-self-insert-alist
'((?\( ?\)) (?\[ ?\]) (?\{ ?\}) (?\< ?\>) (?\" ?\") (?\' ?\') (?\` ?\') (?\« ?\») (?\$ ?\$)))
(defun pair-or-self-insert-command (N)
(interactive "P")
(if (and transient-mark-mode mark-active)
(let ((pair (or (assq last-command-event pair-or-self-insert-alist)
(assq (event-basic-type last-command-event)
pair-or-self-insert-alist)))
open close)
(when pair
(if (nth 2 pair)
(setq open (nth 1 pair) close (nth 2 pair))
(setq open (nth 0 pair) close (nth 1 pair)))
(save-excursion (goto-char (region-end)) (insert close))
(save-excursion (goto-char (region-beginning)) (insert open))))
(call-interactively 'self-insert-command)))
(global-set-key "\"" 'pair-or-self-insert-command)
(global-set-key "«" 'pair-or-self-insert-command)
(global-set-key "<" 'pair-or-self-insert-command)
(global-set-key "(" 'pair-or-self-insert-command)
(global-set-key "[" 'pair-or-self-insert-command)
(global-set-key "{" 'pair-or-self-insert-command)
(define-key input-decode-map (kbd "C-à") [?\C-c])
;; Pave fleches du haut
(global-set-key [S-home] 'beginning-of-buffer)
(global-set-key [S-end] 'end-of-buffer)
(global-set-key [C-home] 'mark-whole-buffer)
;(global-set-key [prior] 'scroll-down)
;(global-set-key [next] 'scroll-up)
(global-set-key [?\C-v] 'yank)
(global-set-key [?\C-c ?b] 'bury-buffer)
(global-set-key [M-dead-circumflex] 'join-line)
;; Diverses F*
(global-set-key [f3] 'speedbar-get-focus)
(global-set-key [S-f4] 'indent-region)
(global-set-key [f5] 'ispell-word)
(global-set-key [S-f5] 'ispell-region)
(global-set-key "\M-c" 'compile) ; ESC-c fait une compilation
(global-set-key "\M-n" 'next-error) ; ESC-n montre les differentes erreurs
(global-set-key [delete] 'delete-char)
;; Souris
(global-set-key [S-mouse-2] 'mouse-set-point-and-find-tag)
(global-set-key "\M-!" 'my-shell-command)
(define-key key-translation-map "\C-x8i" "∞")
(define-key key-translation-map "\C-x8l" "λ")
(define-key key-translation-map "\C-x8s" "√")
(define-key key-translation-map "\C-x8t" "↦")
(define-key key-translation-map "\C-x8^n" "ⁿ")
(define-key key-translation-map "\C-x8I" "∩")
(define-key key-translation-map "\C-x8U" "∪")
(global-set-key [XF86AudioPlay] 'lagn-toggle)
(global-set-key [XF86Back] 'lagn-prev)
(global-set-key [XF86Forward] 'lagn-next)
(global-set-key [XF86AudioPrev] 'lagn-prev)
(global-set-key [XF86AudioNext] 'lagn-next)
(setq home-end-enable t)
(global-set-key [home] 'home-end-home)
(global-set-key [end] 'home-end-end)
(add-to-list 'auto-mode-alist '("\\.ino\\'" . arduino-mode))
(autoload 'arduino-mode "arduino-mode" "\
Major mode for editing Arduino code.
The hook `c-mode-common-hook' is run with no args at mode
initialization, then `arduino-mode-hook'.
Key bindings:
\\{arduino-mode-map}
\(fn)" t nil)
(defun processing-run-programm ()
(interactive)
(save-some-buffers)
(compile (format "processing-java --sketch=\"%s\" --run" default-directory)) t)
(with-eval-after-load 'arduino-mode
(define-key arduino-mode-map (kbd "C-c C-c") #'processing-run-programm))
(add-to-list 'auto-mode-alist '("\\.jvs\\'" . java-mode))
(with-eval-after-load 'dabbrev
(let ((fst (member 'try-expand-dabbrev hippie-expand-try-functions-list)))
(setcar fst 'try-expand-dabbrev-visible)
(setcdr fst (cons 'try-expand-dabbrev-all-buffers (cdr fst)))))
(require 'jka-compr)
(auto-compression-mode 't)
(quietly-read-abbrev-file)
(set-language-environment "utf-8")
(set-selection-coding-system 'utf-8)
(recentf-mode 1)
(push '("vimperator-.*.tmp" . text-mode) auto-mode-alist)
(require 'flycheck () t)
(require 'flycheck-ledger () t)
(add-hook 'after-init-hook #'global-flycheck-mode)
(put 'gnus-group-check-bogus-groups 'disabled t)
(put 'narrow-to-region 'disabled nil)
(put 'narrow-to-page 'disabled nil)
(put 'eval-expression 'disabled nil)
(put 'downcase-region 'disabled nil)
(put 'upcase-region 'disabled nil)
(defun try-complete-abbrev (old)
(if (expand-abbrev)
t nil))
(defun try-complete-tag (old)
(condition-case nil
(if (complete-tag) t nil)
(error nil)))
(defun try-flyspell-auto-correct-word (old)
(if flyspell-mode
(progn
(flyspell-auto-correct-word)
(and
(consp flyspell-auto-correct-region)
(not (string= flyspell-auto-correct-word
(car flyspell-auto-correct-ring)))))
()))
(add-hook 'visual-line-mode-hook
(lambda ()
(adaptive-wrap-prefix-mode +1)))
(defun nop () (interactive))
(defun set-word-wrap () (interactive) (setq word-wrap t))
(defun add-flyspell-to-hippie-expand ()
(make-local-variable 'hippie-expand-try-functions-list)
(setq hippie-expand-try-functions-list
(append hippie-expand-try-functions-list '(try-flyspell-auto-correct-word))))
(add-hook 'text-mode-hook 'turn-on-flyspell)
(add-hook 'text-mode-hook 'text-mode-hook-identify)
(add-hook 'text-mode-hook 'set-word-wrap)
(add-hook 'text-mode-hook 'add-flyspell-to-hippie-expand)
(defun mouse-set-point-and-find-tag (event)
"Set the point to the position of the mouse and invoke find-tag on the word at the
point. This should be bound to a mouse click event type."
(interactive "e")
(mouse-set-point event)
(find-tag (thing-at-point 'word)))
(defun auto-fill-mode-off () (auto-fill-mode -1))
(defun longlines-mode-on () (longlines-mode 1))
(defalias 'report-debian-bug 'debian-bug)
(defun my-shell-command (command)
(interactive (list (read-from-minibuffer "Shell command: "
nil nil nil 'shell-command-history)))
(shell-command command (generate-new-buffer "*Async Shell*")))
(require 'browse-url)
(setq browse-url-browser-function (quote browse-url-generic))
(setq browse-url-generic-program "x-www-browser")
(push '("\\._comment\\(_pending\\)?\\'" . markdown-mode) auto-mode-alist)
(push '("\\.mdwn\\'" . markdown-mode) auto-mode-alist)
(when (file-directory-p "~/.emacs.d/src/magit/lisp/")
(add-to-list 'load-path "~/.emacs.d/src/magit/lisp/"))
(if (file-readable-p "~/.emacs.d/src/magit/lisp/magit-autoloads.el")
(load-file "~/.emacs.d/src/magit/lisp/magit-autoloads.el")
(autoload 'magit-status "magit" "\
Show the status of the current Git repository in a buffer.
With a prefix argument prompt for a repository to be shown.
With two prefix arguments prompt for an arbitrary directory.
If that directory isn't the root of an existing repository
then offer to initialize it as a new repository.
\(fn &optional DIRECTORY)" t nil))
(global-set-key [?\C-x ?g] 'magit-status)
(global-set-key [?\C-x ?L] 'magit-file-log)
(setq git-annex-commit ())
(with-eval-after-load "vc-hooks"
(define-key vc-prefix-map "=" 'ediff-revision))
(require 'pdf-tools)
(when (file-executable-p pdf-info-epdfinfo-program)
(pdf-tools-install () () t))
(setq debian-changelog-mailing-address "vanicat@debian.org")
(setq debian-changelog-full-name "Rémi Vanicat")
(setq user-mail-address "remi.vanicat@gmail.com")
(setq user-full-name "Rémi Vanicat")
(setq debian-bug-use-From-address "vanicat@debian.org")
(setq pgg-gpg-user-id "Rémi Vanicat <vanicat@debian.org>")
(setq pgg-encrypt-for-me "Rémi Vanicat <vanicat@debian.org>")
(setq ispell-program-name "hunspell")
(require 'ispell)
(setq ispell-highlight-face 'underline)
(condition-case err
(ispell-change-dictionary "fr_FR" 't)
(error (message "Warning: no fr_FR dictionary!"))
)
(autoload 'guess-lang-buffer "guess-lang" "" 't)
(autoload 'guess-lang-message "guess-lang" "" 't)
(setq guess-lang-dictionnaries-path "~/.emacs.d/src/guess-lang-dictionaries")
(setq guess-lang-languages-to-guess '("francais" "american"))
(defun ispell-guess-dictionary ()
(interactive)
(let ((dict (guess-lang-buffer)))
(if dict
(ispell-change-dictionary dict))))
(with-eval-after-load 'tramp
(add-to-list 'tramp-default-proxies-alist
'(nil "\\`root\\'" "/ssh:%h:"))
(add-to-list 'tramp-default-proxies-alist
(list (regexp-quote (system-name)) nil nil))
(add-to-list 'tramp-default-proxies-alist
(list "openwrt\\(.lot-of-stuff.info\\)?" "\\`root\\'" nil)))
(modify-coding-system-alist 'file "\\..?rb$" 'utf-8)
(modify-coding-system-alist 'file "\\.rhtml$" 'utf-8)
(autoload 'rhtml-mode "rhtml-mode" "" t)
(with-eval-after-load 'ruby-mode
(require 'ruby-electric nil t)
(autoload 'autotest "autotest" "rez" t)
(defun ruby-electric-return (arg)
(interactive "P")
(self-insert-command (prefix-numeric-value arg))
(if (ruby-electric-space-can-be-expanded-p)
(save-excursion
(ruby-indent-line t)
(newline)
(ruby-insert-end))))
(defvar my-ruby-outline-regexp "####? \\| *def\\>\\| *module\\>\\| *class\\>")
(defun my-ruby-outline-level ()
"compute the level of a outline for ruby"
(save-match-data
(cond
((looking-at "####") 2)
((looking-at "###") 1)
((looking-at "\\( *\\)")
(+ 3 (length (match-string 1)))))))
(defun define-ruby-outline ()
(make-local-variable 'outline-regexp)
(setq outline-regexp my-ruby-outline-regexp)
(make-local-variable 'outline-level)
(setq outline-level #'my-ruby-outline-level)
(outline-minor-mode))
(add-hook 'ruby-mode-hook 'define-ruby-outline))
;; (require 'nxml-mode)
;; (yas/load-directory "~/.myconfig/emacs.d/yasnippets/yasnippets-ruby/")
;; (yas/load-directory "~/.myconfig/emacs.d/yasnippets/yasnippets-rails/")
(push '(".*\\.html.erb\\'" . rhtml-mode) auto-mode-alist)
(with-eval-after-load 'outline
(progn
(define-key outline-minor-mode-map [(control tab)] 'org-cycle)
(define-key outline-minor-mode-map [(backtab)] 'org-global-cycle)))
(with-eval-after-load 'cc-mode
(setq c-brace-offset -2)
(setq c-auto-newline 't)
(add-hook 'c-mode-hook (lambda () (c-toggle-auto-hungry-state 1)))
(add-hook 'c-mode-hook (lambda () (set 'dabbrev-case-fold-search ()))))
(with-eval-after-load 'cc-mode
(defun xmms2-c-mode ()
"C mode with adjusted defaults for use with the xmms2."
(interactive)
(c-mode)
(c-set-style "K&R")
(setq tab-width 4)
(setq indent-tabs-mode t)
(setq c-basic-offset 4)
;; Align closing paren with opening paren
(c-set-offset 'arglist-close 'c-lineup-arglist-intro-after-paren)
(add-hook 'c-special-indent-hook 'smart-tab-indent-hook))
(defun get-nonempty-context ()
(let ((curr-context (car (c-guess-basic-syntax))))
(if (or (eq (car curr-context) 'arglist-intro)
(eq (car curr-context) 'arglist-cont)
(eq (car curr-context) 'arglist-cont-nonempty)
(eq (car curr-context) 'arglist-close))
curr-context
nil))
(defun smart-tab-indent-hook ()
"Fixes indentation to pad with spaces in arglists."
(let ((nonempty-ctx (get-nonempty-context)))
(if nonempty-ctx
(let ((tabbed-columns (+ (point-at-bol)
(/ (c-langelem-col nonempty-ctx t)
tab-width)))
(orig-column (current-column)))
(tabify (point-at-bol) tabbed-columns)
(untabify tabbed-columns (point-at-eol))
; editing tabs screws the pointer position
(move-to-column orig-column)))))))
(autoload 'xmms2-c-mode "cc-mode")
(push '(".*xmms2.*/.*\\.[ch]\\'" . xmms2-c-mode) auto-mode-alist)
(with-eval-after-load 'tuareg
(setq tuareg-with-indent 0)
(setq tuareg-function-indent 0)
(setq tuareg-in-indent 0))
;(autoload 'tuareg-imenu-set-imenu "tuareg-imenu" "Configuration of imenu for tuareg" t)
;(add-hook 'tuareg-mode-hook 'tuareg-imenu-set-imenu)
(setq completion-ignored-extensions
(cons ".cmi" (cons ".cmo" completion-ignored-extensions)))
(with-eval-after-load 'lua-mode
(defvar my-lua-outline-regexp "-- \\*+")
(defun my-lua-outline-level ()
"compute the level of a outline for lua"
(save-match-data
(cond
((looking-at "-- \\(\\*+\\)") (length (match-string 1)))
(t 1))))
(defun define-lua-outline ()
(make-local-variable 'outline-regexp)
(setq outline-regexp my-lua-outline-regexp)
(make-local-variable 'outline-level)
(setq outline-level #'my-lua-outline-level)
(outline-minor-mode))
(add-hook 'lua-mode-hook 'define-lua-outline))
(setq inferior-lisp-program "sbcl --noinform")
;; (setq slime-net-coding-system 'utf-8-unix)
;; ;; load slime:
;; (setq load-path (cons "/home/moi/.clc/packages/clbuild/source/slime" load-path))
;; (setq load-path (cons "/home/moi/.clc/packages/clbuild/source/slime/contrib" load-path))
;; (setq slime-backend "/home/moi/.clc/packages/clbuild/.swank-loader.lisp")
;; ;(setq inhibit-splash-screen t)
;; (load "/home/moi/.clc/packages/clbuild/source/slime/slime")
;; (setq inferior-lisp-program "/home/moi/.clc/packages/clbuild/clbuild preloaded")
;; (setq slime-use-autodoc-mode nil)
;; (slime-setup '(slime-fancy slime-tramp slime-asdf))
;; (setq slime-complete-symbol*-fancy t)
;; (setq slime-complete-symbol-function 'slime-fuzzy-complete-symbol)
;; (put 'with-accessors 'common-lisp-indent-function 2)
(autoload 'lagn-list "lagn" "" t)
(autoload 'lagn-search "lagn" "" t)
(autoload 'lagn-toggle "lagn" "" t)
(autoload 'lagn-prev "lagn" "" t)
(autoload 'lagn-next "lagn" "" t)
(defun erc-freenode ()
(interactive)
(erc :server "irc.freenode.net" :full-name "Rémi Vanicat" :nick "__DL__" :full-name "Rémi Vanicat"))
(defun erc-debian ()
(interactive)
(erc :server "irc.oftc.net" :full-name "Rémi Vanicat" :nick "__DL__" :full-name "Rémi Vanicat"))
(defun erc-debconf ()
(interactive)
(erc :server "irc.oftc.net" :full-name "Rémi Vanicat" :nick "__DL__laptop" :full-name "Rémi Vanicat")
(erc-join-channel "#debconf")
(erc-join-channel "#debconf-heidelberg")
(erc-join-channel "#debconf-berlinlondon")
(erc-join-channel "#debconf-amsterdam"))
(defun erc-otaku ()
(interactive)
(erc :server "irc.otaku-irc.fr" :full-name "darkl" :nick "darkl"))
(autoload 'google-maps "google-maps" "" t)
; (bbdb-initialize)
(with-eval-after-load 'apt-utils
(require 'thingatpt)
(defun apt-utils-choose-package ()
"Choose a Debian package name."
(let ((package
(and (eq major-mode 'apt-utils-mode)
(cadr (member 'apt-package
(text-properties-at (point))))))
(PC-word-delimiters "-"))
(when (not (stringp package))
(setq package (word-at-point)))
(completing-read (if package
(format "Choose Debian package (%s): " package)
"Choose Debian package: ")
'apt-utils-choose-package-completion
nil t package)))
;; (defun apt-utils-add-package-links ()
;; "Add hyperlinks to related Debian packages."
;; (let ((keywords '("Conflicts" "Depends" "Enhances" "Package"
;; "Pre-Depends" "Provides" "Recommends" "Replaces"
;; "Suggests"))
;; match)
;; (if (hash-table-p apt-utils-current-links)
;; (clrhash apt-utils-current-links)
;; (setq apt-utils-current-links (make-hash-table :test 'equal)))
;; (goto-char (point-min))
;; (while (re-search-forward "^\\([^ \n:]+\\):\\( \\|$\\)"
;; (point-max) t)
;; (setq match (match-string 1))
;; (add-text-properties (if (looking-at "$")
;; (point) ;; Conffiles (also see below)
;; (1- (point)))
;; (save-excursion
;; (beginning-of-line)
;; (point))
;; `(,apt-utils-face-property apt-utils-field-keyword-face))
;; (cond
;; ((member match keywords)
;; ;; Remove newline characters in field
;; (let ((end (apt-field-end-position)))
;; (subst-char-in-region (point) end ?\n ?\ )
;; (canonically-space-region (point) end))
;; ;; Find packages
;; (let ((packages (apt-utils-current-field-packages))
;; (inhibit-read-only t)
;; face
;; length length-no-version
;; package)
;; (while packages
;; (setq package (car packages))
;; (setq length (length package))
;; ;; Remove version info (in parenthesis), and whitespace
;; (setq package (apt-utils-replace-regexp-in-string
;; "\\((.*)\\|\\s-+\\)" "" package))
;; (setq length-no-version (length package))
;; ;; Package type
;; (cond
;; ((equal (apt-utils-package-type package t) 'normal)
;; (setq face 'apt-utils-normal-package-face))
;; ((equal (apt-utils-package-type package t) 'virtual)
;; (setq face 'apt-utils-virtual-package-face))
;; (t
;; (setq face 'apt-utils-broken-face)
;; (setq package 'broken)))
;; ;; Store package links
;; (apt-utils-current-links-add-package package)
;; ;; Add text properties
;; (add-text-properties (point) (+ (point) length-no-version)
;; `(,apt-utils-face-property ,face
;; mouse-face highlight
;; apt-package ,package))
;; ;; Version?
;; (when (> length length-no-version)
;; (add-text-properties (+ (point) length-no-version 1)
;; (+ (point) length)
;; `(,apt-utils-face-property apt-utils-version-face)))
;; ;; Fill package names
;; (when (and apt-utils-fill-packages
;; (> (current-column) (+ 2 (length match)))
;; (> (+ (current-column) length) fill-column))
;; (when (equal (char-before) ?\ )
;; (delete-char -1)) ; trailing whitespace
;; (insert "\n" (make-string (+ 2 (length match)) ? )))
;; (forward-char length)
;; (when (and (equal match "Package")
;; apt-utils-display-installed-status)
;; (apt-utils-insert-installed-info package))
;; (skip-chars-forward ", |\n")
;; (setq packages (cdr packages)))))
;; ((string-match-p "Description\\(-..\\)?" match)
;; (add-text-properties (point)
;; (save-excursion
;; (or
;; (re-search-forward "^[^ ]" (point-max) t)
;; (point-max)))
;; `(,apt-utils-face-property apt-utils-description-face)))
;; ;; Conffiles doesn't have trailing space
;; ((looking-at "$")
;; nil)
;; (t
;; (add-text-properties (1- (point))
;; (save-excursion
;; (end-of-line)
;; (point))
;; `(,apt-utils-face-property apt-utils-field-contents-face)))))))
)
(setq yas-trigger-key (kbd "<C-tab>"))
(with-eval-after-load 'yasnippet
(unless (boundp 'yas-minor-mode-map)
(load-library "yasnippet"))
(define-key yas-minor-mode-map (kbd "<tab>") nil)
(define-key yas-minor-mode-map (kbd "<C-tab>") 'yas-expand)
;; (yas-load-directory "~/.emacs.d/snippets/")
)
(autoload 'dino "dino" "" 't)
(setq org-default-notes-file "/home/moi/org/notes.org")
(global-set-key "\C-cr" 'org-capture)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cl" 'org-store-link)
(add-to-list 'load-path "/home/moi/prog/ledger/ledger/lisp/")
(autoload 'ledger-mode "ledger-mode")
(add-to-list 'auto-mode-alist '("\\.ledger$" . ledger-mode))
(add-hook 'emacs-lisp-mode-hook 'paredit-mode)
(add-hook 'emacs-lisp-mode-hook 'eldoc-mode)
(setq gnus-local-domain ())
(defun woman-or-man (&optional re-cache)
(interactive (list current-prefix-arg))
(require 'woman)
(let ((file-name (woman-file-name nil re-cache)))
(condition-case nil
(woman-find-file file-name)
(error (man file-name)))))
(global-set-key [f4] 'woman-or-man)
;(remember-notes)
(defun my-org-add-poids (poids)
(interactive "npoids: ")
(with-current-buffer (find-file-noselect "/home/moi/org/sante.org")
(save-excursion
(goto-char (point-min))
(search-forward "#+name: poids")
(goto-char (org-table-end))
(forward-char -1)
(org-table-goto-column 1)
(org-table-next-row)
(org-table-goto-column 2)
(org-insert-time-stamp (current-time) nil t)
(org-table-goto-column 3)
(insert (format "%.1f" poids))
(org-table-recalculate)
(forward-line -3)
(org-table-recalculate)
(search-forward "#+name: courbe-de-poids")
(let ((org-confirm-babel-evaluate nil))
(org-babel-execute-src-block))
(org-redisplay-inline-images))))
(require 'server)
(unless (server-running-p) (server-start))