From 7a17c8bf041a7c222b217b53d36647eaff2ba3d7 Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Wed, 26 May 2010 20:09:47 +0200 Subject: [PATCH] *** empty log message *** --- emacs.el | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 60 insertions(+), 7 deletions(-) diff --git a/emacs.el b/emacs.el index b582fa2..eaa1011 100644 --- a/emacs.el +++ b/emacs.el @@ -18,6 +18,15 @@ ;; Contact for comments & bug reports ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Ugly hack because 23.2 is not installed properly in my Debian + +(when (and (>= emacs-major-version 23) + (>= emacs-minor-version 2)) + (add-to-list 'load-path "/usr/share/emacs/site-lisp/vm/") + (add-to-list 'load-path "/usr/share/emacs/site-lisp/bbdb/lisp/") + (add-to-list 'load-path "/usr/share/emacs/site-lisp/mailcrypt/") +) + ;; It's better to set the preferences in the .Xresources so that the ;; window is not first displayed with the wrong options @@ -650,10 +659,10 @@ occurrences " (setq ps-print-color-p nil ;; ps-paper-type 'letter ps-paper-type 'a4 - ps-top-margin (* 1.75 56.692) - ps-left-margin 56.692 - ps-bottom-margin 56.692 - ps-right-margin 56.692 + ;; ps-top-margin (* 1.75 56.692) + ;; ps-left-margin 56.692 + ;; ps-bottom-margin 56.692 + ;; ps-right-margin 56.692 ;; Simple header. Remove that silly frame shadow. ps-print-header nil @@ -1421,15 +1430,26 @@ universal argument starts xfig even if the .fig does not exist" %% \\usepackage{hyperref} %% \\usepackage{harvard} +\\setlength{\\parindent}{0cm} +\\setlength{\\parskip}{12pt} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Sans serif fonts %% \\usepackage[T1]{fontenc} %% \\usepackage[scaled]{helvet} %% \\usepackage[cm]{sfmath} %% \\renewcommand{\\ttdefault}{pcr} %% \\renewcommand*\\familydefault{\\sfdefault} - -\\setlength{\\parindent}{0cm} -\\setlength{\\parskip}{12pt} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Draft layout +%% \\setlength{\\parindent}{1cm} +%% \\renewcommand{\\baselinestretch}{2.0} +%% \\setlength{\\oddsidemargin}{-0.6cm} +%% \\setlength{\\evensidemargin}{0cm} +%% \\setlength{\\textwidth}{17.5cm} +%% \\setlength{\\textheight}{23cm} +%% \\setlength{\\topmargin}{-1.5cm} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% \\renewcommand{\\baselinestretch}{1.3} @@ -1482,6 +1502,14 @@ universal argument starts xfig even if the .fig does not exist" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defun ff/remove-ip-header () (interactive) + (save-excursion + (goto-char (point-min)) + (when (and (re-search-forward "START_IP_HEADER" nil t) + (re-search-forward "END_IP_HEADER" nil t)) + (message "yep")) + )) + (defun ff/add-gpl () "Adds the GPL statements at the beginning of current buffer." (interactive) @@ -1542,6 +1570,24 @@ END_IP_HEADER ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defun ff/start-c () + "Adds the header to start a C program." + (interactive) + ;; (beginning-of-buffer) + (insert + " +#include +#include + +int main(int argc, char **argv) { + exit(EXIT_SUCCESS); +} +") + (previous-line 2) + ) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (defun ff/start-c++ () "Adds the header to start a C++ program." (interactive) @@ -1782,6 +1828,11 @@ a file in /tmp" (previous-line 1) ) + (when (string-match "\\.c$" filename) + (c-mode) + (ff/add-copyrights) + (ff/start-c)) + (when (string-match "\\.cc$" filename) (c++-mode) (ff/add-copyrights) @@ -2360,6 +2411,7 @@ proposes to visit them." (define-key ff/map [(control g)] 'ff/git-status) (define-key ff/map [(control w)] 'server-edit) (define-key ff/map [(control d)] 'ff/elisp-debug-on) +(define-key ff/map "d" 'diary) (define-key ff/map [(control \`)] 'ff/bash-new-buffer) (define-key ff/map [(control n)] 'enotes/show-all-notes) (define-key ff/map [(control s)] 'ff/secure-note-add) @@ -2371,6 +2423,7 @@ proposes to visit them." (define-key ff/map [(control c)] 'calendar) ;; (define-key ff/map [(control c)] (lambda () (interactive) (save-excursion (calendar)))) (define-key ff/map [(control l)] 'goto-line) +(define-key ff/map "l" 'longlines-mode) (define-key ff/map [(control o)] 'selector/quick-pick-recent) (define-key ff/map "s" 'selector/quick-move-in-buffer) (define-key ff/map "S" 'selector/search-sentence) -- 2.20.1