From: Francois Fleuret Date: Fri, 2 Dec 2016 15:37:25 +0000 (+0100) Subject: Update. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=2439cdd60f235b3ccde4ddc47c740e3c9ee43b99;p=elisp.git Update. --- diff --git a/emacs.el b/emacs.el index ac9782c..99c5e54 100644 --- a/emacs.el +++ b/emacs.el @@ -33,6 +33,8 @@ ;; (set-default-font "Inconsolata 15") +;; (package-initialize) + (set-default-font "Bitstream vera sans mono-12") ;; (set-default-font "Liberation Mono-13") ;; (set-default-font "DejaVu sans mono 15") @@ -340,7 +342,7 @@ load-warning buffer in case of failure." (flyspell-mode)))) (add-hook 'c++-mode-hook 'flyspell-prog-mode) -(add-hook 'lua-mode-hook 'flyspell-prog-mode) +;; (add-hook 'lua-mode-hook 'flyspell-prog-mode) (add-hook 'log-edit-mode-hook 'flyspell-mode) ;; I am a power-user @@ -1690,6 +1692,26 @@ int main(int argc, char **argv) { ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defun ff/start-lua () + "Adds all the stuff to start a new lua file" + (interactive) + (goto-char (point-min)) + (insert "#!/usr/bin/env luajit + +require 'torch' +require 'nn' +require 'nnx' +require 'optim' +require 'image' +require 'pl' +require 'paths' +require 'ffmpeg' + +") + (lua-mode) + ) + + (defun ff/start-html () "Adds all that stuff to start a new HTML file." (interactive) @@ -1883,6 +1905,11 @@ a file in /tmp" (ff/add-copyrights)) ) + (when (string-match "\\.lua$" filename) + (lua-mode) + (ff/start-lua) + ) + (when (string-match "\\.html$" filename) (html-mode) (ff/start-html) @@ -1996,7 +2023,7 @@ a file in /tmp" compile-history '("make clean" "make DEBUG=yes -j -k" "make -j -k") ) -(defun ff/universal-compile () (interactive) +(defun ff/universal-compile (universal) (interactive "P") (funcall (or (cdr (assoc major-mode '( (latex-mode . tex-file) @@ -2099,7 +2126,7 @@ This may be a useful alternative binding for \\[delete-other-windows] (while (re-search-forward "[0-9\.]+" nil t) (let ((value (string-to-number (buffer-substring (match-beginning 0) (match-end 0))))) (delete-region (match-beginning 0) (match-end 0)) - (insert (format "%0.3f" value))))))) + (insert (format "%0.1e" value))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Keymaping @@ -2298,7 +2325,7 @@ next one. With universal argument, kill all killable buffers." "svn-commit.tmp$" ".git/COMMIT_EDITMSG$" "\.bbl$" "\.aux$" "\.toc$" )) - recentf-max-saved-items 1000 + recentf-max-saved-items 10000 recentf-save-file (concat ff/emacs-dir "/recentf") ) @@ -2336,6 +2363,7 @@ next one. With universal argument, kill all killable buffers." media/duration-to-history 30 media/history-size 1000 media/playlist-file (concat ff/emacs-dir "/media-playlists") + media/continue-mode-hint (if window-system "⤸" "*") media/mplayer/args '( "-framedrop" "-zoom" @@ -2346,6 +2374,7 @@ next one. With universal argument, kill all killable buffers." ) media/mplayer/timing-request-period 1.0 ) + ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -2512,6 +2541,12 @@ with a time tag, and save this file" (define-key esc-map "`" ff/map) +(defun ff/kill-downto-signature () (interactive) + (let ((s (point))) + (when (re-search-forward "^-- $") + (kill-region s (match-beginning 0)) + (goto-char s)))) + (defun ff/git-status (&optional dir) (interactive) (if (buffer-file-name) (git-status (file-name-directory (buffer-file-name))) @@ -2562,6 +2597,7 @@ with a time tag, and save this file" (bookmark-save))) (define-key ff/map "f" 'ff/move-region-to-fridge) (define-key ff/map [(control f)] 'ff/flyspell-mode) +(define-key ff/map [(control k)] 'ff/kill-downto-signature) (define-key ff/map [?\C-0] 'ff/delete-annoying-windows) (define-key ff/map "1" 'delete-other-windows) diff --git a/vm b/vm index 6393b45..85a9bdc 100644 --- a/vm +++ b/vm @@ -351,7 +351,8 @@ attachement from mail." (ff/configure-faces ;; '((ff/mail-header-face :background "#c8c8ff")) - '((ff/mail-header-face :background "#f0f0f0")) + '((ff/mail-header-face :background "#eaf0ff")) + ;; '((ff/mail-header-face :background "#fff0a0")) ;; '((ff/mail-header-face :foreground "blue4")) ) @@ -588,6 +589,9 @@ an attachment") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; If we can, encrypt! +(autoload 'mc-install-write-mode "mailcrypt" nil t) +(autoload 'mc-install-read-mode "mailcrypt" nil t) + (add-hook 'vm-mode-hook 'mc-install-read-mode) (add-hook 'vm-summary-mode-hook 'mc-install-read-mode) (add-hook 'vm-virtual-mode-hook 'mc-install-read-mode) @@ -713,9 +717,23 @@ instance, someone in bbdb named \"Paul Smith\" would generate an alias (let ((link "/tmp/at") (dir (format-time-string "/tmp/at-%Y%m%d-%H%M%S" (current-time)))) (mkdir dir) - (when (file-symlink-p link) (delete-file link)) - (unless (file-exists-p link) (make-symbolic-link dir link 1)) + + (when (file-symlink-p (concat link "~~")) + (delete-file (concat link "~~"))) + + (when (and (file-symlink-p (concat link "~")) + (not (file-exists-p (concat link "~~")))) + (rename-file (concat link "~") (concat link "~~"))) + + (when (and (file-symlink-p link) + (not (file-exists-p (concat link "~")))) + (file-symlink-p link) (rename-file link (concat link "~"))) + + (unless (file-exists-p link) + (make-symbolic-link dir link 1)) + ;; (vm-pipe-message-to-command (concat "munpack -C " dir)) + (vm-pipe-message-to-command (concat "munpack -t -C " dir)) (message "Wrote files to %s" dir) )