From: Francois Fleuret Date: Sun, 11 Nov 2018 20:44:20 +0000 (+0100) Subject: Update X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=e61bde32719843a643f003ed0e85914495adc3ee;p=elisp.git Update --- diff --git a/emacs.el b/emacs.el index d9d2ec5..6dc9356 100644 --- a/emacs.el +++ b/emacs.el @@ -31,11 +31,11 @@ ;; Xft.antialias: true ;; Xft.rgba: rgb -;; (set-default-font "Inconsolata 15") +(set-default-font "Inconsolata 14") ;; (package-initialize) -(set-default-font "Bitstream vera sans mono-12") +;; (set-default-font "Bitstream vera sans mono 12") ;; (set-default-font "Liberation Mono-13") ;; (set-default-font "DejaVu sans mono 15") ;; (set-default-font "Droid sans mono 13") @@ -231,6 +231,10 @@ load-warning buffer in case of failure." epa-file-cache-passphrase-for-symmetric-encryption t ;; And I like ascii files epa-armor t + ;; This goes with in your ~/.gnupg/gpg-agent.conf: + ;; allow-emacs-pinentry + ;; allow-loopback-pinentry + epa-pinentry-mode 'loopback ;; tramp-default-method "ssh" tramp-default-method "scp" @@ -816,12 +820,15 @@ printer." ;; Dealing with the laptop battery ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defcustom ff/battery-dirs '("/sys/class/power_supply/BAT0" - "/sys/class/power_supply/BAT1") +(defcustom ff/battery-dirs '("/sys/class/power_supply/BAT0") "*Where to gather the battery information") (defcustom ff/temperature-files '("/sys/class/thermal/thermal_zone0/temp" - "/sys/class/thermal/thermal_zone1/temp") + "/sys/class/thermal/thermal_zone1/temp" + "/sys/class/thermal/thermal_zone2/temp" + "/sys/class/thermal/thermal_zone3/temp" + "/sys/class/thermal/thermal_zone4/temp" + "/sys/class/thermal/thermal_zone5/temp") "*Where to gather the thermal information") (defun ff/file-first-line (file) @@ -1215,7 +1222,8 @@ goback argument, go back where we were." (load "vc-git") -(defun ff/git-pull-push () (interactive) +(defun ff/git-pull-push (universal) (interactive "P") + (when universal (async-shell-command "git commit -a -m \"Update\"")) (message "git pull / push ...") (async-shell-command "git pull && git push" nil) ) @@ -1314,12 +1322,14 @@ ff/known-address-face is used." ;; An encrypted file to put secure stuff (passwords, ...) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(when (ff/load-or-alert "mailcrypt") - (mc-setversion "gpg") - ;; Keep the passphrase for 10min - (setq mc-passwd-timeout 600 - ff/secure-note-file "~/private/secure-notes.gpg") - ) +(setq ff/secure-note-file "~/private/secure-notes.gpg") + +;; (when (ff/load-or-alert "mailcrypt") + ;; (mc-setversion "gpg") + ;; ;; Keep the passphrase for 10min + ;; (setq mc-passwd-timeout 600 + ;; ff/secure-note-file "~/private/secure-notes.gpg") + ;; ) (defface ff/secure-date '((t (:background "white" :weight bold))) @@ -1796,19 +1806,14 @@ require 'optim' "Adds all the stuff to start a new python file" (interactive) (goto-char (point-min)) - (insert "#!/usr/bin/env python-for-pytorch + (insert "#!/usr/bin/env python import math import torch, torchvision -from torch import Tensor -from torch import Tensor as T - from torch import nn from torch.nn import functional as F -from torch.nn.parameter import Parameter -from torch.nn import Module ") (python-mode) diff --git a/vm b/vm index a25594b..7326c1b 100644 --- a/vm +++ b/vm @@ -588,14 +588,14 @@ an attachment") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; If we can, encrypt! -(autoload 'mc-install-write-mode "mailcrypt" nil t) -(autoload 'mc-install-read-mode "mailcrypt" nil t) +;; (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) -(add-hook 'vm-mail-mode-hook 'mc-install-write-mode) -(add-hook 'vm-presentation-mode-hook 'mc-install-read-mode) +;; (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) +;; (add-hook 'vm-mail-mode-hook 'mc-install-write-mode) +;; (add-hook 'vm-presentation-mode-hook 'mc-install-read-mode) ;; (defun ff/encrypt-mail-if-possible () (interactive) ;; (condition-case nil (mc-encrypt-message) @@ -663,12 +663,13 @@ an attachment") (ff/first-buffer-in-mode (cdr l) m)))) (defun ff/compose-mail (&optional force-new) - "Cycles through an existing buffers with major mode `mail-mode', + "Cycles through existing buffers with major mode `mail-mode', or invoke `vm-compose-mail' if none can be found or if FORCE-NEW is t." (interactive "P") (when (eq major-mode 'mail-mode) (bury-buffer)) (let ((buf (and (not force-new) + ;; (not (eq major-mode 'mail-mode)) (ff/first-buffer-in-mode (buffer-list) 'mail-mode)))) (if buf (switch-to-buffer buf) (vm-compose-mail)))) @@ -736,7 +737,6 @@ instance, someone in bbdb named \"Paul Smith\" would generate an alias (vm-pipe-message-to-command (concat "munpack -t -C " dir)) (message "Wrote files to %s" dir) ) - ) )