projects
/
elisp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b3cb206
)
Update.
author
Francois Fleuret
<francois@fleuret.org>
Sun, 19 Feb 2017 08:06:05 +0000
(09:06 +0100)
committer
Francois Fleuret
<francois@fleuret.org>
Sun, 19 Feb 2017 08:06:05 +0000
(09:06 +0100)
emacs.el
patch
|
blob
|
history
diff --git
a/emacs.el
b/emacs.el
index
e21b34f
..
ebc608e
100644
(file)
--- a/
emacs.el
+++ b/
emacs.el
@@
-1183,6
+1183,15
@@
goback argument, go back where we were."
(define-key global-map [(meta G)] (lambda () (interactive)
(ff/goto-function-definition t)))
(define-key global-map [(meta G)] (lambda () (interactive)
(ff/goto-function-definition t)))
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; (setq python-indent-offset 4)
+
+;; (define-key python-mode-map [(shift right)] 'python-indent-shift-right)
+;; (define-key python-mode-map [(shift left)] 'python-indent-shift-left)
+;; (define-key python-mode-map [(shift right)] 'indent-rigidly-right-to-tab-stop)
+;; (define-key python-mode-map [(shift left)] 'indent-rigidly-left-to-tab-stop)
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The big stuff (bbdb, mailcrypt, etc.)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The big stuff (bbdb, mailcrypt, etc.)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@
-1416,7
+1425,7
@@
universal argument starts xfig even if the .fig does not exist"
;; Automagically add the frame numbers in comments in a beamer file
;; Automagically add the frame numbers in comments in a beamer file
-(defun number-beamer-frames ()
+(defun
ff/
number-beamer-frames ()
"Add the frame numbers as comments after each \begin{frame}"
(interactive)
"Add the frame numbers as comments after each \begin{frame}"
(interactive)
@@
-1740,17
+1749,34
@@
int main(int argc, char **argv) {
require 'torch'
require 'nn'
require 'torch'
require 'nn'
-require 'nnx'
-require 'optim'
require 'image'
require 'image'
-require 'pl'
-require 'paths'
-require 'ffmpeg'
+require 'optim'
")
(lua-mode)
)
")
(lua-mode)
)
+(defun ff/start-python ()
+ "Adds all the stuff to start a new python file"
+ (interactive)
+ (goto-char (point-min))
+ (insert "#!/usr/bin/env python
+
+import torch
+import math
+
+from torch import nn
+from torch.nn import functional as fn
+
+from torch import Tensor
+from torch.autograd import Variable
+from torch.nn.parameter import Parameter
+from torch.nn import Module
+
+")
+ (python-mode)
+ )
+
(defun ff/start-html ()
"Adds all that stuff to start a new HTML file."
(defun ff/start-html ()
"Adds all that stuff to start a new HTML file."
@@
-1964,6
+1990,11
@@
a file in /tmp"
(ff/start-lua)
)
(ff/start-lua)
)
+ (when (string-match "\\.py$" filename)
+ (python-mode)
+ (ff/start-python)
+ )
+
(when (string-match "\\.html$" filename)
(html-mode)
(ff/start-html)
(when (string-match "\\.html$" filename)
(html-mode)
(ff/start-html)
@@
-2645,7
+2676,7
@@
with a time tag, and save this file"
(define-key ff/map [(control m)] 'woman)
(define-key ff/map "b" 'bookmark-jump)
(define-key ff/map [(control =)] 'calc)
(define-key ff/map [(control m)] 'woman)
(define-key ff/map "b" 'bookmark-jump)
(define-key ff/map [(control =)] 'calc)
-(define-key ff/map "=" 'number-beamer-frames)
+(define-key ff/map "=" '
ff/
number-beamer-frames)
(define-key ff/map [(control shift b)]
(lambda () (interactive)
(bookmark-set)
(define-key ff/map [(control shift b)]
(lambda () (interactive)
(bookmark-set)