修订版 | fdac27abf6d8d51eacdb5c998942cf1a67d01f89 (tree) |
---|---|
时间 | 2017-12-28 08:07:12 |
作者 | echo68 <echo68@loca...> |
Commiter | echo68 |
customize a theme
@@ -0,0 +1,19 @@ | ||
1 | +syntax: glob | |
2 | +auto-save-list | |
3 | +backups | |
4 | +bookmarks | |
5 | +ede-projects.el | |
6 | +elpa | |
7 | +eshell | |
8 | +filesets-cache.el | |
9 | +ido.last | |
10 | +newsticker | |
11 | +places | |
12 | +savehist | |
13 | +semanticdb | |
14 | +server | |
15 | +url | |
16 | +viper | |
17 | +recentf | |
18 | +*.elc | |
19 | +*#*# |
@@ -0,0 +1,342 @@ | ||
1 | +# R E A D M E ! | |
2 | + | |
3 | +This repository gathers all my Emacs resources files. I have tried to drop some | |
4 | +useful comments on each function. The lisp code runs with Emacs release 25.2. | |
5 | +Some tools to make an even better Emacs experience: | |
6 | +- Ripgrep https://github.com/BurntSushi/ripgrep | |
7 | +- Universal Ctags http://ctags.io/ | |
8 | +Enjoy! | |
9 | + | |
10 | +## Intro to Emacs Lisp | |
11 | + | |
12 | +A nice and clear summary of Emacs Lisp can be found here: | |
13 | +http://www.fincher.org/tips/Languages/Emacs.shtml. Go here if you are keen to | |
14 | +learn more about lists: https://www.emacswiki.org/emacs/ListModification A | |
15 | +detailed Elisp documentation is embedded in Emacs. Run ``M-x info-emacs-manual`` | |
16 | +and navigate to the section ``Emacs Lisp``. | |
17 | + | |
18 | +A quick look up into Emacs own documentation, especially into the index, can give | |
19 | +you this command `M-x elisp-index-search <return> KEYWORD <return>`. | |
20 | + | |
21 | +## Tips, Tips, Tips | |
22 | + | |
23 | +Editing source code without code navigation is a real pain. For the most time I | |
24 | +use the _classic_ etags, that is shipped with the regular Emacs release. On | |
25 | +Windows machines it is as natural as on Unix machines to get the TAGS file. The | |
26 | +reason for this is to pipe all relevant source code files to etags. If the | |
27 | +`findutils` are installed (is a part of Git on Windows) use this command in Eshell: | |
28 | + | |
29 | + find . -type f -not -iregex ".*\(Debug\|Release\).*" -and -regex ".*\.[ch]$" -exec etags --append {} ; | |
30 | + | |
31 | +### Expand supported tags for etags | |
32 | + | |
33 | +Call etags with this parameters to support function tags in the form `FUNC(void, | |
34 | +SEGMENT)` func_Tag:: | |
35 | + | |
36 | + `cat files | etags --regex='{c}/FUNC(.*)[ \t]+\([A-Za-z_]+\).*/\1/' -` | |
37 | + | |
38 | +### Expand the search path for executables | |
39 | + | |
40 | +Add this code to init.el to add ~/App/GnuPorts/bin to environment variable PATH and Emacs search path: | |
41 | + | |
42 | + (when (equal (getenv "COMPUTERNAME") "VMWIN7X64") | |
43 | + (message "Local customization on %s" (getenv "COMPUTERNAME")) | |
44 | + (add-to-list 'exec-path (concat (replace-regexp-in-string "\\\\" "/" (getenv "USERPROFILE")) "/App/GNUports/bin")) | |
45 | + (setenv "PATH" (concat (concat (getenv "USERPROFILE") "\\App\\GNUports\\bin;") (getenv "PATH")))) | |
46 | + | |
47 | +### Lookup text in open buffers | |
48 | + | |
49 | +Start a occur session with from isearch mode directly by pressing M-s o. This | |
50 | +feature is very useful when re-factoring / analyzing code. To have something, | |
51 | +that is as powerful as Vims famous star command use this Elisp snippet: | |
52 | + | |
53 | + (global-set-key (kbd "C-?") | |
54 | + (lambda () | |
55 | + (interactive) | |
56 | + (occur (thing-at-point 'symbol)) | |
57 | + (pop-to-buffer "*Occur*" nil t) | |
58 | + (next-error-follow-minor-mode))) | |
59 | + | |
60 | +Calling occur with a prefix argument will open the *Occur* buffer with the | |
61 | +context around a match. Here is an example: C-6 M-x occur | |
62 | + | |
63 | +Occur Edit mode applies edits made in *Occur* buffers to the original buffers. | |
64 | +It is bound to key `e` in Occur mode. | |
65 | + | |
66 | +### Using directory local variables | |
67 | + | |
68 | +Here is my `.dir-locals.el` file, located a project's root | |
69 | +directory, as an example: | |
70 | + | |
71 | + ;;; Directory Local Variables | |
72 | + ;;; For more information see (info "(emacs) Directory Variables") | |
73 | + | |
74 | + ((nil . ((grep-find-ignored-directories . (".git" "Debug" "Release" "AUTOSAR_tresos" "Doc" "Documentation" "TLProj" "TLSim")) | |
75 | + (grep-command . "grep -nH -R --exclude-dir=C_AUTOSAR --exclude-dir=Debug --exclude-dir=Release --exclude-dir=Documenatation --include='*.[ch]'") | |
76 | + (compile-command . (format "cd %sC_Application/Build/ ; ebuild Debug.gpj" (file-name-as-directory desktop-dirname)))))) | |
77 | + | |
78 | + | |
79 | +### Using autoload | |
80 | + | |
81 | +Write your elisp code and add this line in front of functions which shall | |
82 | +support autoload feature: | |
83 | + | |
84 | + ;;;###autoload | |
85 | + | |
86 | +Next, run ``M-x update-file-autoloads``. The first input parameter is the file | |
87 | +to be parsed for the autoload keyword. The second input parameter is the file | |
88 | +which will hold the elisp code to active the functions, marked by the above | |
89 | +comment line. Now, just add this line to your init.el: | |
90 | + | |
91 | + (load "loaddefs.el") | |
92 | + | |
93 | +Or run `update-directory-autoloads` to update the load definitions for an | |
94 | +entire directory. | |
95 | + | |
96 | +Need more info? Check out the [GNU Emacs Manual](http://www.gnu.org/software/emacs/manual/html_node/elisp/Autoload.html) | |
97 | + | |
98 | +### Elisp: Read subdirectories | |
99 | + | |
100 | +Like to find out which subdirectories exists in a specific directory path? Try | |
101 | +this Emacs lisp snippet as a starting point to write your final code: | |
102 | + | |
103 | + (defun deep(path) | |
104 | + (message "enter -- %s" path) | |
105 | + (dolist (candidate (directory-files path)) | |
106 | + (when (file-directory-p (concat (file-name-as-directory path) candidate)) | |
107 | + (when (and (not (equal candidate ".")) (not (equal candidate ".."))) | |
108 | + (deep (concat (file-name-as-directory path) candidate)))))) | |
109 | + (deep "~/.vim") ;; Sorry! | |
110 | + | |
111 | +### Elisp: call functions by reference | |
112 | + | |
113 | +A small code snippte to show how to select a function from a list, using IDO, | |
114 | +and call the selected function, referenced by init-func. | |
115 | + | |
116 | + (let ((init-func (ido-completing-read | |
117 | + "Run function: " | |
118 | + (quote ("func-a" "func-b" "func-c"))))) | |
119 | + (when (fboundp (intern init-func)) | |
120 | + (funcall (intern init-func) desktop-dirname))) | |
121 | + | |
122 | +### Find project's root directory | |
123 | + | |
124 | +My favorite method is save my desktop file in project's root path. A `compile` | |
125 | +shall run in directory `desktop-dirname`. | |
126 | + | |
127 | +Here is a differnt approach to get projects root: `(locate-dominating-file FILE NAME)` | |
128 | + | |
129 | +``` | |
130 | +Look up the directory hierarchy from FILE for a directory containing NAME. Stop | |
131 | +at the first parent directory containing a file NAME, and return the directory. | |
132 | +Return nil if not found. Instead of a string, NAME can also be a predicate | |
133 | +taking one argument (a directory) and returning a non-nil value if that | |
134 | +directory is the one for which we’re looking. | |
135 | +``` | |
136 | + | |
137 | +### Numbered column | |
138 | + | |
139 | +Function `rectangle-number-lines` does this job. It is bound to `C-x r N` and | |
140 | +operates on the active region. Use with prefix `C-u C-x r N` and you will be | |
141 | +requested for the starting number and the format. | |
142 | +Select 4 lines and press `C-u C-x r N 15 <CR> #define something 0x%x <CR>` | |
143 | +to get this result: | |
144 | + | |
145 | + #define something 0xf | |
146 | + #define something 0x10 | |
147 | + #define something 0x11 | |
148 | + #define something 0x12 | |
149 | + | |
150 | +### Converting Decimal and Hexadecimal Numbers | |
151 | + | |
152 | +Hexadecimal a to decimal: `(format "%d" #xa)` | |
153 | + | |
154 | +Decimal to hexadezimal: `(format "%x" 10)` | |
155 | + | |
156 | +Some further example to show simple math: | |
157 | + | |
158 | + (- (string-to-number (format "%d" #x170)) 200) | |
159 | + ==> 168 | |
160 | + | |
161 | +### Search and replace powered with Elisp | |
162 | + | |
163 | +Search for a regular expression and process the found regex groups with a piece | |
164 | +of Elisp. It goes like this: | |
165 | + | |
166 | +> `M-x query-replace-regexp<CR>`, enter the regex to look for with `Query | |
167 | +> replace regex: \(T\w*\)<CR>` and enter the elisp code to run the replacement | |
168 | +> like this `with: \,(concat "Head" \1 "Tail")<CR>`. | |
169 | + | |
170 | +### Call interactive commands from Elisp | |
171 | + | |
172 | +Here is an example how to call the interactive M-x compile: | |
173 | + | |
174 | + (call-interactively #'compile))) | |
175 | + | |
176 | +### Benchmark your Elisp code | |
177 | + | |
178 | +Sometimes it is useful to check the performance of a piece of Elisp code. In | |
179 | +this case you can use the `benchmark` function. Check out the documentation to | |
180 | +read more about it. | |
181 | + | |
182 | +### Better interactive commands | |
183 | + | |
184 | +Some commands provide input history, so that user can use up-key to enter | |
185 | +previous input. (e.g. shell-command [Alt+!]) Also, some commands provide | |
186 | +completition (e.g. "dired"" [Ctrl+x]) | |
187 | + | |
188 | +The most useful are: read-string, read-file-name, read-regexp. Examples: | |
189 | + | |
190 | + (defun test-fun (arg) | |
191 | + "Prompt user to enter a string, with input history support." | |
192 | + (interactive (list (read-string "Your name is:")) ) | |
193 | + (message "String is [%s] ." arg) ) | |
194 | + | |
195 | + (defun test-fun (arg) | |
196 | + "Prompt user to enter a file path, with file name completion and input history support." | |
197 | + (interactive (list (read-file-name "Open directory:")) ) | |
198 | + (message "Path is [%s]." arg) ) | |
199 | + | |
200 | + (defun test-fun (arg) | |
201 | + "Prompt user to enter a elisp regex and input history support." | |
202 | + (interactive (list (read-regexp "Type a regex:")) ) | |
203 | + (message "Regex is [%s]." arg) ) | |
204 | + | |
205 | + | |
206 | +### Splitting Windows | |
207 | + | |
208 | +If this is an integer, `split-window-sensibly` may split a window horizontally | |
209 | +only if it has at least this many columns. If this is nil, | |
210 | +`split-window-sensibly` is not allowed to split a window horizontally. | |
211 | + | |
212 | +### Move, Change, Kill | |
213 | + | |
214 | +* Some brief tips to edit text: | |
215 | + - `C-a` and `C-e` moves to start and end of line. | |
216 | + - `M-a` and `M-e` moves to start and end of sentence. | |
217 | + - `C-M-n` and `C-M-p` moves between braces. | |
218 | + - `C-M-f` and `C-M-b` moves statement wise. | |
219 | + - `back-to-indentation`, bound to `M-m`, moves point to the first | |
220 | + non-whitespace character on this line. | |
221 | + | |
222 | +### Hot Tips for org-mode | |
223 | + | |
224 | +- Adds a tag: `C-c C-q` | |
225 | + | |
226 | +- Toggle DONE|TODO status: `C-c C-t` | |
227 | + | |
228 | +- Adds the scheduling date: `C-c C-s` | |
229 | + | |
230 | +- Adds a date: `C-c !` | |
231 | + | |
232 | +- Move subtree to the Archives `C-c C-w` | |
233 | + | |
234 | +- How to handle files to be used for agenda display? Entries may be added to | |
235 | + this list with `M-x org-agenda-file-to-front` and removed with `M-x | |
236 | + org-remove-file`. You can also use customize to edit the list with `M-x | |
237 | + customize-variable<CR>org-agenda-files<CR>` | |
238 | + | |
239 | +### The Eshell | |
240 | + | |
241 | +Emacs has it own shell integrated: Eshell. Start this major mode by typing `M-x | |
242 | +eshell-mode`. Eshell has a lot of functions integrated that everybody would | |
243 | +expect from a regular shell plus easy execution of Elisp code. | |
244 | + | |
245 | +A great introdunction to Eshell and lot of its features is here: | |
246 | +https://www.masteringemacs.org/article/complete-guide-mastering-eshell | |
247 | + | |
248 | +Here are some aliases to get started. Once the alias is entered, it is stored permanently: | |
249 | + | |
250 | + alias ll 'ls -l $*' | |
251 | + alias d 'dired $1' | |
252 | + | |
253 | +### Lots of cool stuff | |
254 | + | |
255 | +* Like to add keywords in a specific mode? Use this: | |
256 | + | |
257 | + (font-lock-add-keywords 'c-mode ; Highlight function calls | |
258 | + '(("\\<\\(\\sw+\\) ?(" 1 'font-lock-function-name-face)))) | |
259 | + | |
260 | +* In `dired-mode` it is possible to set bookmarks by pressing `C-x r m`. The | |
261 | + actual directory is now bookmarked and the location gets strored in a | |
262 | + persisitent bookmarks file. Like to customize the feature set of bookmarks? | |
263 | + Here you go `M-x customize-group<CR> bookmark<CR>`. | |
264 | + | |
265 | +* Ever asked yourself how to move cursor to the first non-whitespace character | |
266 | + in a line? The command is `back-to-indentation`, bound by default to M-m. | |
267 | + | |
268 | +* Check for unbalanced parentheses in the current buffer with `M-x | |
269 | + check-parens`. | |
270 | + | |
271 | +* Always good to highlight the most interesting symbols. Press `M-s h r` to | |
272 | + highlight a regexp and `M-s h u` to remove it again. To highlight the current | |
273 | + regexp at point, press `M-s h .`. | |
274 | + | |
275 | +* `delete-blank-lines`, bound to `C-x C-o, will` delete all the empty lines | |
276 | + around your current cursor, except one line. Press it again and also the last | |
277 | + empty line will be deleted. What `just-one-space` does for a sequence of | |
278 | + spaces on a single line, does `delete-blank-lines` for a sequence of empty | |
279 | + lines. | |
280 | + | |
281 | +* `M-z` runs (zap-to-char arg char) Kill up to and including argth occurrence of | |
282 | + char. | |
283 | + | |
284 | +* `C-x C-q` runs the command `toggle-read-only`. This especially useful in | |
285 | + dired-mode, because it makes the file names editable! Changed files names are | |
286 | + writen to your drive after pressing `C-x C-q` again. | |
287 | + | |
288 | +* To find out more the char/text properties at point, type `C-x =` to get basic | |
289 | + information or `C-u C-x =` for detailed information. | |
290 | + | |
291 | +* `M-x count-lines-region` displays the number of lines in the current region. | |
292 | + Function is bound to `M-=`, except in a few specialist modes. | |
293 | + | |
294 | +* `M-x re-builder`: Use this one to test regular expressions. | |
295 | + | |
296 | +* In cc-mode press `C-c C-o` and function `c-set-offset` will ask you how to | |
297 | + indent the statement at point. | |
298 | + | |
299 | +* To customize Emacs dependent on the directory your are working on, take a look | |
300 | + at chapter 'Directory Variables' in the Emacs manual. | |
301 | + | |
302 | +* `add-change-log-entry-other-window`, mapped to `C-x 4 a`, find change log file | |
303 | + in other window and add entry and item. | |
304 | + | |
305 | +* To get organized again after resizing some windows, a call of balance-windows | |
306 | + might help It is bound to `C-x +` and balances all windows in the actual | |
307 | + frame. | |
308 | + | |
309 | +* Configure Commands that act on sentences by customizing | |
310 | + `sentence-end-double-space`. I.e. command `kill-sentence` mapped on `M-k`. | |
311 | + | |
312 | +* If you struggle to leave the minibuffer, do a `M-x top-level` to recover from | |
313 | + this situation. | |
314 | + | |
315 | +* Like to see the unsaved changes in current buffer? Simply type `M-x | |
316 | + diff-buffer-with-file<Ret> buffer<Ret>`. Like to have a similar function with | |
317 | + ediff? Use `ediff-current-file`. | |
318 | + | |
319 | +* Use `visual-line-mode` to turn word wrap in plain text files on. Simple | |
320 | + editing commands act on visual lines only. | |
321 | + | |
322 | +* Like to scale the font size for a specific window? `C-x C-+` or `C-x C--` does | |
323 | + the job by calling text-scale-adjust. | |
324 | + | |
325 | +* The `*grep*` window is to big? Press C-x - or M-x | |
326 | + shrink-window-if-larger-than-buffer and the `*grep*` windows fits better in | |
327 | + the frame. | |
328 | + | |
329 | +* Use `M-x toggle-case-fold-search` to make the search cas sensitive or | |
330 | + insensitive. | |
331 | + | |
332 | +* Like to open a URL at point? Just type `M-x browse-url-at-point <CR>`. | |
333 | + | |
334 | +* Customize variable `ido-use-virtual-buffers` enables ido to list recently | |
335 | + closed buffers. | |
336 | + | |
337 | +* Like to search the eshell history with ido?: | |
338 | + | |
339 | + (ido-completing-read "History: " (ring-elements eshell-history-ring)) | |
340 | + | |
341 | +* Completion of symbols in most programming language modes, mapped on C-M-i. | |
342 | + Read the Emacs manual (26.8 Completion for Symbol Names). |
@@ -0,0 +1,269 @@ | ||
1 | +;;-*-coding: utf-8;-*- | |
2 | +(define-abbrev-table 'Buffer-menu-mode-abbrev-table '()) | |
3 | + | |
4 | +(define-abbrev-table 'Custom-mode-abbrev-table '()) | |
5 | + | |
6 | +(define-abbrev-table 'Info-edit-mode-abbrev-table '()) | |
7 | + | |
8 | +(define-abbrev-table 'adoc-mode-abbrev-table '()) | |
9 | + | |
10 | +(define-abbrev-table 'apropos-mode-abbrev-table '()) | |
11 | + | |
12 | +(define-abbrev-table 'asciidoc-mode-abbrev-table '()) | |
13 | + | |
14 | +(define-abbrev-table 'awk-mode-abbrev-table | |
15 | + '( | |
16 | + )) | |
17 | + | |
18 | +(define-abbrev-table 'bat-mode-abbrev-table '()) | |
19 | + | |
20 | +(define-abbrev-table 'bibtex-mode-abbrev-table '()) | |
21 | + | |
22 | +(define-abbrev-table 'bookmark-bmenu-mode-abbrev-table '()) | |
23 | + | |
24 | +(define-abbrev-table 'bookmark-edit-annotation-mode-abbrev-table '()) | |
25 | + | |
26 | +(define-abbrev-table 'bs-mode-abbrev-table '()) | |
27 | + | |
28 | +(define-abbrev-table 'c++-mode-abbrev-table | |
29 | + '( | |
30 | + ("x3" "uint32" nil 0) | |
31 | + ("x6" "uint16" nil 1) | |
32 | + ("x8" "uint8" nil 5) | |
33 | + ("xbrf" "" c-skeleton-plain-doxy-comment-before 0) | |
34 | + ("xcase" "" c-skeleton-new-case 0) | |
35 | + ("xdbg" "#warning ADDED DEBUG CODE --" nil 2) | |
36 | + ("xdef" "#define" nil 0) | |
37 | + ("xdel" "" c-skeleton-delimiter 0) | |
38 | + ("xel" "" c-skeleton-else 6) | |
39 | + ("xfile" "" c-skeleton-file-header 0) | |
40 | + ("xfun" "" c-skeleton-function-header 0) | |
41 | + ("xif" "" c-skeleton-if 0) | |
42 | + ("xifd" "" c-skeleton-preproc-ifdef 0) | |
43 | + ("xinc" "" c-skeleton-preproc-include 0) | |
44 | + ("xop" "" c-skeleton-open-curly-braces 3) | |
45 | + ("xswitch" "" c-skeleton-switch-case 0) | |
46 | + )) | |
47 | + | |
48 | +(define-abbrev-table 'c-mode-abbrev-table | |
49 | + '( | |
50 | + ("x3" "uint32" nil 0) | |
51 | + ("x6" "uint16" nil 1) | |
52 | + ("x8" "uint8" nil 5) | |
53 | + ("xbrf" "" c-skeleton-plain-doxy-comment-before 6) | |
54 | + ("xcase" "" c-skeleton-new-case 9) | |
55 | + ("xdbg" "#warning ADDED DEBUG CODE --" nil 2) | |
56 | + ("xdef" "#define" nil 0) | |
57 | + ("xdel" "" c-skeleton-delimiter 3) | |
58 | + ("xel" "" c-skeleton-else 7) | |
59 | + ("xfile" "" c-skeleton-file-header 1) | |
60 | + ("xfun" "" c-skeleton-function-header 5) | |
61 | + ("xif" "" c-skeleton-if 8) | |
62 | + ("xifd" "" c-skeleton-preproc-ifdef 0) | |
63 | + ("xinc" "" c-skeleton-preproc-include 2) | |
64 | + ("xop" "" c-skeleton-open-curly-braces 2) | |
65 | + ("xswitch" "" c-skeleton-switch-case 2) | |
66 | + )) | |
67 | + | |
68 | +(define-abbrev-table 'calc-trail-mode-abbrev-table '()) | |
69 | + | |
70 | +(define-abbrev-table 'calendar-mode-abbrev-table '()) | |
71 | + | |
72 | +(define-abbrev-table 'change-log-mode-abbrev-table '()) | |
73 | + | |
74 | +(define-abbrev-table 'comint-mode-abbrev-table '()) | |
75 | + | |
76 | +(define-abbrev-table 'completion-list-mode-abbrev-table '()) | |
77 | + | |
78 | +(define-abbrev-table 'conf-colon-mode-abbrev-table '()) | |
79 | + | |
80 | +(define-abbrev-table 'conf-javaprop-mode-abbrev-table '()) | |
81 | + | |
82 | +(define-abbrev-table 'conf-ppd-mode-abbrev-table '()) | |
83 | + | |
84 | +(define-abbrev-table 'conf-space-mode-abbrev-table '()) | |
85 | + | |
86 | +(define-abbrev-table 'conf-unix-mode-abbrev-table '()) | |
87 | + | |
88 | +(define-abbrev-table 'conf-windows-mode-abbrev-table '()) | |
89 | + | |
90 | +(define-abbrev-table 'conf-xdefaults-mode-abbrev-table '()) | |
91 | + | |
92 | +(define-abbrev-table 'data-debug-mode-abbrev-table '()) | |
93 | + | |
94 | +(define-abbrev-table 'debugger-mode-abbrev-table '()) | |
95 | + | |
96 | +(define-abbrev-table 'diary-fancy-display-mode-abbrev-table '()) | |
97 | + | |
98 | +(define-abbrev-table 'diary-mode-abbrev-table '()) | |
99 | + | |
100 | +(define-abbrev-table 'diff-mode-abbrev-table '()) | |
101 | + | |
102 | +(define-abbrev-table 'dig-mode-abbrev-table '()) | |
103 | + | |
104 | +(define-abbrev-table 'edebug-eval-mode-abbrev-table '()) | |
105 | + | |
106 | +(define-abbrev-table 'edit-abbrevs-mode-abbrev-table '()) | |
107 | + | |
108 | +(define-abbrev-table 'eieio-custom-mode-abbrev-table '()) | |
109 | + | |
110 | +(define-abbrev-table 'elisp-byte-code-mode-abbrev-table '()) | |
111 | + | |
112 | +(define-abbrev-table 'emacs-lisp-byte-code-mode-abbrev-table '()) | |
113 | + | |
114 | +(define-abbrev-table 'emacs-lisp-mode-abbrev-table '()) | |
115 | + | |
116 | +(define-abbrev-table 'eshell-mode-abbrev-table '()) | |
117 | + | |
118 | +(define-abbrev-table 'finder-mode-abbrev-table '()) | |
119 | + | |
120 | +(define-abbrev-table 'fundamental-mode-abbrev-table '()) | |
121 | + | |
122 | +(define-abbrev-table 'gfm-mode-abbrev-table '()) | |
123 | + | |
124 | +(define-abbrev-table 'global-abbrev-table '()) | |
125 | + | |
126 | +(define-abbrev-table 'grep-mode-abbrev-table '()) | |
127 | + | |
128 | +(define-abbrev-table 'help-mode-abbrev-table '()) | |
129 | + | |
130 | +(define-abbrev-table 'html-mode-abbrev-table '()) | |
131 | + | |
132 | +(define-abbrev-table 'idl-mode-abbrev-table '()) | |
133 | + | |
134 | +(define-abbrev-table 'inferior-python-mode-abbrev-table '()) | |
135 | + | |
136 | +(define-abbrev-table 'java-mode-abbrev-table | |
137 | + '( | |
138 | + )) | |
139 | + | |
140 | +(define-abbrev-table 'jython-mode-abbrev-table '()) | |
141 | + | |
142 | +(define-abbrev-table 'ld-script-mode-abbrev-table '()) | |
143 | + | |
144 | +(define-abbrev-table 'lisp-interaction-mode-abbrev-table '()) | |
145 | + | |
146 | +(define-abbrev-table 'lisp-mode-abbrev-table | |
147 | + '( | |
148 | + ("aluminium1" "#eeeeec" nil 0) | |
149 | + ("aluminium2" "#d3d7cf" nil 0) | |
150 | + ("aluminium3" "#babdb6" nil 0) | |
151 | + ("aluminium4" "#888a85" nil 0) | |
152 | + ("aluminium5" "#555753" nil 0) | |
153 | + ("aluminium6" "#2e3436" nil 0) | |
154 | + ("butter1" "#fce94f" nil 0) | |
155 | + ("butter2" "#edd400" nil 0) | |
156 | + ("butter3" "#c4a000" nil 0) | |
157 | + ("chameleon1" "#8ae234" nil 0) | |
158 | + ("chameleon2" "#73d216" nil 0) | |
159 | + ("chameleon3" "#4e9a06" nil 0) | |
160 | + ("chocolate1" "#e9b96e" nil 0) | |
161 | + ("chocolate2" "#c17d11" nil 0) | |
162 | + ("chocolate3" "#8f5902" nil 0) | |
163 | + ("orange1" "#fcaf3e" nil 0) | |
164 | + ("orange2" "#f57900" nil 0) | |
165 | + ("orange3" "#ce5c00" nil 0) | |
166 | + ("plum1" "#ad7fa8" nil 0) | |
167 | + ("plum2" "#75507b" nil 0) | |
168 | + ("plum3" "#5c3566" nil 0) | |
169 | + ("scarletred1" "#ef2929" nil 0) | |
170 | + ("scarletred2" "#cc0000" nil 0) | |
171 | + ("scarletred3" "#a40000" nil 0) | |
172 | + ("skyblue1" "#729fcf" nil 0) | |
173 | + ("skyblue2" "#3465a4" nil 0) | |
174 | + ("skyblue3" "#204a87" nil 0) | |
175 | + )) | |
176 | + | |
177 | +(define-abbrev-table 'log-edit-mode-abbrev-table '()) | |
178 | + | |
179 | +(define-abbrev-table 'makefile-automake-mode-abbrev-table '()) | |
180 | + | |
181 | +(define-abbrev-table 'makefile-bsdmake-mode-abbrev-table '()) | |
182 | + | |
183 | +(define-abbrev-table 'makefile-gmake-mode-abbrev-table '()) | |
184 | + | |
185 | +(define-abbrev-table 'makefile-imake-mode-abbrev-table '()) | |
186 | + | |
187 | +(define-abbrev-table 'makefile-makepp-mode-abbrev-table '()) | |
188 | + | |
189 | +(define-abbrev-table 'makefile-mode-abbrev-table '()) | |
190 | + | |
191 | +(define-abbrev-table 'markdown-mode-abbrev-table '()) | |
192 | + | |
193 | +(define-abbrev-table 'message-mode-abbrev-table '()) | |
194 | + | |
195 | +(define-abbrev-table 'messages-buffer-mode-abbrev-table '()) | |
196 | + | |
197 | +(define-abbrev-table 'nxml-mode-abbrev-table '()) | |
198 | + | |
199 | +(define-abbrev-table 'objc-mode-abbrev-table | |
200 | + '( | |
201 | + )) | |
202 | + | |
203 | +(define-abbrev-table 'occur-edit-mode-abbrev-table '()) | |
204 | + | |
205 | +(define-abbrev-table 'occur-mode-abbrev-table '()) | |
206 | + | |
207 | +(define-abbrev-table 'org-export-stack-mode-abbrev-table '()) | |
208 | + | |
209 | +(define-abbrev-table 'org-mode-abbrev-table | |
210 | + '( | |
211 | + ("xcheck" "- [ ] " nil 0) | |
212 | + )) | |
213 | + | |
214 | +(define-abbrev-table 'outline-mode-abbrev-table '()) | |
215 | + | |
216 | +(define-abbrev-table 'package-menu-mode-abbrev-table '()) | |
217 | + | |
218 | +(define-abbrev-table 'perl-mode-abbrev-table '()) | |
219 | + | |
220 | +(define-abbrev-table 'pike-mode-abbrev-table | |
221 | + '( | |
222 | + )) | |
223 | + | |
224 | +(define-abbrev-table 'process-menu-mode-abbrev-table '()) | |
225 | + | |
226 | +(define-abbrev-table 'prog-mode-abbrev-table '()) | |
227 | + | |
228 | +(define-abbrev-table 'python-mode-abbrev-table '()) | |
229 | + | |
230 | +(define-abbrev-table 'python-mode-skeleton-abbrev-table '()) | |
231 | + | |
232 | +(define-abbrev-table 'rst-mode-abbrev-table '()) | |
233 | + | |
234 | +(define-abbrev-table 'rst-toc-mode-abbrev-table '()) | |
235 | + | |
236 | +(define-abbrev-table 'select-tags-table-mode-abbrev-table '()) | |
237 | + | |
238 | +(define-abbrev-table 'semantic-symref-results-mode-abbrev-table '()) | |
239 | + | |
240 | +(define-abbrev-table 'sgml-mode-abbrev-table '()) | |
241 | + | |
242 | +(define-abbrev-table 'sh-mode-abbrev-table '()) | |
243 | + | |
244 | +(define-abbrev-table 'shell-mode-abbrev-table '()) | |
245 | + | |
246 | +(define-abbrev-table 'special-mode-abbrev-table '()) | |
247 | + | |
248 | +(define-abbrev-table 'speedbar-mode-abbrev-table '()) | |
249 | + | |
250 | +(define-abbrev-table 'tabulated-list-mode-abbrev-table '()) | |
251 | + | |
252 | +(define-abbrev-table 'term-mode-abbrev-table '()) | |
253 | + | |
254 | +(define-abbrev-table 'text-mode-abbrev-table '()) | |
255 | + | |
256 | +(define-abbrev-table 'vc-bzr-log-view-mode-abbrev-table '()) | |
257 | + | |
258 | +(define-abbrev-table 'vc-dir-mode-abbrev-table '()) | |
259 | + | |
260 | +(define-abbrev-table 'vc-git-log-edit-mode-abbrev-table '()) | |
261 | + | |
262 | +(define-abbrev-table 'vc-git-log-view-mode-abbrev-table '()) | |
263 | + | |
264 | +(define-abbrev-table 'vc-hg-log-view-mode-abbrev-table '()) | |
265 | + | |
266 | +(define-abbrev-table 'vc-svn-log-view-mode-abbrev-table '()) | |
267 | + | |
268 | +(define-abbrev-table 'xref--xref-buffer-mode-abbrev-table '()) | |
269 | + |
@@ -0,0 +1,235 @@ | ||
1 | +;;; custom.el --- | |
2 | +(provide 'custom) | |
3 | + | |
4 | +;; ===================================================================== | |
5 | +(custom-set-variables | |
6 | + ;; custom-set-variables was added by Custom. | |
7 | + ;; If you edit it by hand, you could mess it up, so be careful. | |
8 | + ;; Your init file should contain only one such instance. | |
9 | + ;; If there is more than one, they won't work right. | |
10 | + '(abbrev-file-name "~/.emacs.d/abbrev-defs.el") | |
11 | + '(auto-coding-alist | |
12 | + (quote | |
13 | + (("\\.\\(arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|7z\\|ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\)\\'" . no-conversion-multibyte) | |
14 | + ("\\.\\(exe\\|EXE\\)\\'" . no-conversion) | |
15 | + ("\\.\\(sx[dmicw]\\|odt\\|tar\\|t[bg]z\\)\\'" . no-conversion) | |
16 | + ("\\.\\(gz\\|Z\\|bz\\|bz2\\|xz\\|gpg\\)\\'" . no-conversion) | |
17 | + ("/#[^/]+#\\'" . utf-8-emacs-unix) | |
18 | + ("\\.\\(TXT\\|txt\\|[cC]\\|[hH]\\)\\'" . windows-1252)))) | |
19 | + '(auto-insert t) | |
20 | + '(auto-insert-mode t) | |
21 | + '(auto-revert-mode-text "") | |
22 | + '(c-doc-comment-style (quote ((java-mode . javadoc) (pike-mode . autodoc)))) | |
23 | + '(c-font-lock-extra-types | |
24 | + (quote | |
25 | + ("\\sw+Type" "\\sw+_t" "bool" "complex" "imaginary" "FILE" "lconv" "tm" "va_list" "jmp_buf" "Lisp_Object" "BYTE" "PBYTE" "SHORT" "USHORT" "ULONG" "BOOL" "sint[0-9]+" "uint[0-9]+"))) | |
26 | + '(calendar-mark-diary-entries-flag t) | |
27 | + '(calendar-today-marker (quote calendar-today)) | |
28 | + '(calendar-view-diary-initially-flag t) | |
29 | + '(comment-multi-line t) | |
30 | + '(company-backends (quote (company-etags company-semantic))) | |
31 | + '(compilation-ask-about-save nil) | |
32 | + '(compilation-auto-jump-to-first-error nil) | |
33 | + '(compilation-message-face (quote default)) | |
34 | + '(compilation-scroll-output t) | |
35 | + '(compilation-window-height 15) | |
36 | + '(confirm-kill-emacs (quote yes-or-no-p)) | |
37 | + '(cua-enable-cua-keys nil) | |
38 | + '(current-language-environment "English") | |
39 | + '(custom-enabled-themes (quote (glimmer))) | |
40 | + '(custom-safe-themes t) | |
41 | + '(custom-theme-directory "~/.emacs.d/themes") | |
42 | + '(cwarn-configuration (quote ((c-mode t) (c++-mode t)))) | |
43 | + '(delete-by-moving-to-trash t) | |
44 | + '(delete-selection-mode t) | |
45 | + '(desktop-locals-to-save | |
46 | + (quote | |
47 | + (desktop-locals-to-save truncate-lines case-fold-search case-replace fill-column overwrite-mode change-log-default-name line-number-mode column-number-mode size-indication-mode buffer-file-coding-system indent-tabs-mode tab-width indicate-buffer-boundaries indicate-empty-lines show-trailing-whitespace compilation-command))) | |
48 | + '(desktop-path (quote ("."))) | |
49 | + '(desktop-restore-eager 30) | |
50 | + '(desktop-restore-frames nil) | |
51 | + '(desktop-save (quote if-exists)) | |
52 | + '(desktop-save-mode t) | |
53 | + '(diary-entry-marker "!") | |
54 | + '(diary-file "~/Documents/diary.txt") | |
55 | + '(diff-switches (quote ("--unified=3" "--ignore-all-space"))) | |
56 | + '(dired-auto-revert-buffer t) | |
57 | + '(echo-keystrokes 0.1 nil nil "Show unfinished keystrokes early.") | |
58 | + '(ediff-custom-diff-options "-B") | |
59 | + '(ediff-diff-options "-B") | |
60 | + '(ediff-keep-variants t) | |
61 | + '(ediff-use-last-dir t) | |
62 | + '(enable-local-variables :all) | |
63 | + '(eshell-history-size 64) | |
64 | + '(european-calendar-style t) | |
65 | + '(ff-other-file-alist (quote (("\\.c$" (".h")) ("\\.h$" (".c"))))) | |
66 | + '(ff-search-directories (quote ("." "../*"))) | |
67 | + '(fill-column 80) | |
68 | + '(fringe-mode (quote (nil . 0)) nil (fringe)) | |
69 | + '(global-auto-revert-mode t) | |
70 | + '(global-auto-revert-non-file-buffers nil) | |
71 | + '(global-company-mode t) | |
72 | + '(global-font-lock-mode t nil (font-lock)) | |
73 | + '(global-hl-line-sticky-flag nil) | |
74 | + '(global-reveal-mode t) | |
75 | + '(global-semantic-decoration-mode t) | |
76 | + '(global-semantic-idle-local-symbol-highlight-mode t nil (semantic/idle)) | |
77 | + '(global-semantic-idle-scheduler-mode t) | |
78 | + '(global-semanticdb-minor-mode t) | |
79 | + '(grep-command | |
80 | + "grep -nH -R --exclude-dir=C_AUTOSAR --exclude-dir=Debug --exclude-dir=Release --exclude-dir=Documenatation --include='*.[ch]'") | |
81 | + '(grep-find-ignored-directories (quote (".vscode" ".git" ".hg" ".jazz5"))) | |
82 | + '(grep-find-ignored-files (quote (".#*" "*~" "*.elc" "*.pyc" "*.pyo"))) | |
83 | + '(grep-find-template "find <D> <X> -type f <F> -exec grep <C> -Hn <R> {} \";\"") | |
84 | + '(grep-highlight-matches nil) | |
85 | + '(grep-use-null-device nil) | |
86 | + '(grep-window-height 15) | |
87 | + '(hippie-expand-try-functions-list | |
88 | + (quote | |
89 | + (try-complete-file-name-partially try-complete-file-name try-expand-all-abbrevs try-expand-dabbrev try-expand-dabbrev-all-buffers try-expand-dabbrev-from-kill try-complete-lisp-symbol-partially try-complete-lisp-symbol))) | |
90 | + '(history-delete-duplicates t) | |
91 | + '(ibuffer-formats | |
92 | + (quote | |
93 | + ((mark modified read-only " " | |
94 | + (name 32 32 :left :elide) | |
95 | + " " | |
96 | + (size 9 -1 :right) | |
97 | + " " | |
98 | + (mode 16 16 :left :elide) | |
99 | + " " filename-and-process) | |
100 | + (mark " " | |
101 | + (name 16 -1) | |
102 | + " " filename)))) | |
103 | + '(icomplete-mode nil) | |
104 | + '(ido-case-fold t) | |
105 | + '(ido-default-buffer-method (quote selected-window)) | |
106 | + '(ido-mode (quote both) nil (ido)) | |
107 | + '(ido-use-filename-at-point (quote guess)) | |
108 | + '(ido-use-virtual-buffers (quote auto)) | |
109 | + '(ido-uses-completions-vertically t) | |
110 | + '(indent-tabs-mode nil) | |
111 | + '(init-ido-uses-completions-vertically t) | |
112 | + '(isearch-allow-scroll t) | |
113 | + '(ispell-extra-args (quote ("-d"))) | |
114 | + '(ispell-local-dictionary "en_US") | |
115 | + '(kill-do-not-save-duplicates t) | |
116 | + '(kill-ring-max 8) | |
117 | + '(linum-format "%4d ") | |
118 | + '(make-backup-files nil) | |
119 | + '(mark-ring-max 8) | |
120 | + '(midnight-mode t nil (midnight)) | |
121 | + '(mouse-avoidance-mode (quote jump) nil (avoid)) | |
122 | + '(mouse-wheel-progressive-speed nil) | |
123 | + '(mouse-wheel-scroll-amount (quote (2 ((shift) . 0.2) ((control) . 0.5)))) | |
124 | + '(next-line-add-newlines nil nil nil "t: don't add lines at the end of buffer when trying to scroll past end") | |
125 | + '(org-agenda-files (quote ("~/.emacs.d/todo.org"))) | |
126 | + '(org-archive-location "c:/Users/webasto/Documents/org/done.org::* From %s") | |
127 | + '(org-archive-save-context-info (quote (time todo itags))) | |
128 | + '(org-export-with-sub-superscripts (quote {})) | |
129 | + '(org-log-done (quote time)) | |
130 | + '(org-replace-disputed-keys t) | |
131 | + '(org-startup-folded nil) | |
132 | + '(org-use-speed-commands nil) | |
133 | + '(package-archives | |
134 | + (quote | |
135 | + (("gnu" . "http://elpa.gnu.org/packages/") | |
136 | + ("melpa" . "http://stable.melpa.org/packages/")))) | |
137 | + '(package-selected-packages | |
138 | + (quote | |
139 | + (hydra ggtags artbollocks-mode markdown-mode ripgrep anything swiper yasnippet powershell sr-speedbar ivy ioccur helm))) | |
140 | + '(paragraph-start "^[ \\t]*$") | |
141 | + '(partial-completion-mode t nil nil "t: Allow completions like em-s-region to complete to emacspeak-speak-region") | |
142 | + '(python-shell-completion-native-enable nil) | |
143 | + '(python-shell-interpreter-interactive-arg "") | |
144 | + '(python-shell-prompt-detect-enabled nil) | |
145 | + '(read-mail-command (quote gnus)) | |
146 | + '(recentf-auto-cleanup (quote mode)) | |
147 | + '(recentf-max-menu-items 10) | |
148 | + '(recentf-max-saved-items 10) | |
149 | + '(recentf-mode 1) | |
150 | + '(safe-local-variable-values nil) | |
151 | + '(save-abbrevs (quote silently)) | |
152 | + '(save-place-mode t) | |
153 | + '(savehist-autosave-interval nil) | |
154 | + '(scroll-bar-mode nil) | |
155 | + '(scroll-conservatively 101) | |
156 | + '(scroll-margin 4) | |
157 | + '(semantic-complete-inline-analyzer-displayor-class (quote semantic-displayor-ghost)) | |
158 | + '(semantic-default-submodes | |
159 | + (quote | |
160 | + (global-semantic-highlight-func-mode global-semantic-stickyfunc-mode global-semanticdb-minor-mode global-semantic-idle-local-symbol-highlight-mode))) | |
161 | + '(sentence-end-double-space nil) | |
162 | + '(shift-select-mode nil) | |
163 | + '(show-paren-mode t nil (paren)) | |
164 | + '(speedbar-frame-parameters | |
165 | + (quote | |
166 | + ((minibuffer) | |
167 | + (width . 80) | |
168 | + (border-width . 0) | |
169 | + (menu-bar-lines . 0) | |
170 | + (tool-bar-lines . 0) | |
171 | + (unsplittable . t) | |
172 | + (left-fringe . 0)))) | |
173 | + '(speedbar-sort-tags t) | |
174 | + '(speedbar-tag-hierarchy-method nil) | |
175 | + '(speedbar-use-images nil) | |
176 | + '(speedbar-use-tool-tips-flag nil) | |
177 | + '(split-width-threshold 120) | |
178 | + '(tab-always-indent (quote complete)) | |
179 | + '(tab-width 4) | |
180 | + '(tags-add-tables (quote ask-user)) | |
181 | + '(tags-case-fold-search nil) | |
182 | + '(tags-loop-revert-buffers t) | |
183 | + '(tags-revert-without-query t) | |
184 | + '(tags-tag-face (quote match)) | |
185 | + '(text-scale-mode-step 1.1) | |
186 | + '(todo-directory "~\\Documents\\todo\\") | |
187 | + '(tool-bar-mode nil) | |
188 | + '(tooltip-mode nil) | |
189 | + '(truncate-lines t) | |
190 | + '(uniquify-buffer-name-style (quote forward) nil (uniquify)) | |
191 | + '(uniquify-strip-common-suffix t) | |
192 | + '(user-mail-address "markus.prepens@gmail.com") | |
193 | + '(visible-bell t) | |
194 | + '(whitespace-style | |
195 | + (quote | |
196 | + (tabs trailing space-before-tab empty space-after-tab tab-mark))) | |
197 | + '(window-divider-default-bottom-width 2) | |
198 | + '(window-divider-default-right-width 2) | |
199 | + '(window-divider-mode t)) | |
200 | + | |
201 | +(custom-set-faces | |
202 | + ;; custom-set-faces was added by Custom. | |
203 | + ;; If you edit it by hand, you could mess it up, so be careful. | |
204 | + ;; Your init file should contain only one such instance. | |
205 | + ;; If there is more than one, they won't work right. | |
206 | + '(default ((t (:inherit nil :stipple nil :background "grey13" :foreground "azure3" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :foundry "outline")))) | |
207 | + '(artbollocks-face ((t (:underline (:color "magenta3" :style wave))))) | |
208 | + '(artbollocks-lexical-illusions-face ((t (:underline (:color "magenta" :style wave))))) | |
209 | + '(artbollocks-passive-voice-face ((t (:underline (:color "hotpink" :style wave))))) | |
210 | + '(artbollocks-weasel-words-face ((t (:underline (:color "maroon2" :style wave))))) | |
211 | + '(calendar-today ((t (:box (:line-width 1 :color "grey75"))))) | |
212 | + '(compilation-mode-line-exit ((t (:inherit compilation-info)))) | |
213 | + '(completions-common-part ((t (:inherit default :underline t)))) | |
214 | + '(completions-first-difference ((t (:inherit default :underline t)))) | |
215 | + '(cua-rectangle ((t (:inherit region)))) | |
216 | + '(diary ((t (:foreground "hotpink3")))) | |
217 | + '(eshell-ls-readonly ((t (:slant italic)))) | |
218 | + '(font-lock-warning-face ((t (:inherit default :box (:line-width -1 :color "red"))))) | |
219 | + '(markup-emphasis-face ((t (:inherit markup-reference-face :slant italic)))) | |
220 | + '(markup-list-face ((t (:inherit font-lock-comment-delimiter-face)))) | |
221 | + '(markup-title-0-face ((t (:inherit markup-gen-face :weight bold :height 1.4)))) | |
222 | + '(markup-title-1-face ((t (:inherit markup-gen-face :height 1.4)))) | |
223 | + '(markup-title-2-face ((t (:inherit markup-gen-face :slant italic :height 1.0)))) | |
224 | + '(mode-line-highlight ((t (:inherit highlight)))) | |
225 | + '(org-block ((t (:inherit font-lock-doc-face)))) | |
226 | + '(semantic-highlight-edits-face ((t (:overline "grey50")))) | |
227 | + '(semantic-highlight-func-current-tag-face ((t (:inherit hl-line :overline "grey50")))) | |
228 | + '(semantic-idle-symbol-highlight ((t (:inherit hl-line)))) | |
229 | + '(speedbar-file-face ((t (:inherit default)))) | |
230 | + '(speedbar-highlight-face ((t (:inherit highlight)))) | |
231 | + '(speedbar-selected-face ((t (:inherit highlight)))) | |
232 | + '(speedbar-tag-face ((t (:inherit font-lock-function-name-face)))) | |
233 | + '(which-func ((t (:foreground "white")))) | |
234 | + '(window-divider ((t (:foreground "gray50"))))) | |
235 | +;;; custom.el ends here |
@@ -0,0 +1,166 @@ | ||
1 | +;;; autoloads-elisp.el --- automatically extracted autoloads | |
2 | +;; | |
3 | +;;; Code: | |
4 | + | |
5 | + | |
6 | +;;;### (autoloads nil "buffers" "buffers.el" (22774 31653 0 0)) | |
7 | +;;; Generated autoloads from buffers.el | |
8 | + | |
9 | +(autoload 'quick-multi-occur "buffers" "\ | |
10 | +Occur on multiple visited files (buffers). Press key 'e' in | |
11 | +*Occur* buffer to do code refactoring by editing matching lines. | |
12 | +This function operates on C files only. | |
13 | + | |
14 | +\(fn)" t nil) | |
15 | + | |
16 | +(autoload 'revert-all-buffers "buffers" "\ | |
17 | +Reverts all opened buffers from their respective files. In | |
18 | +case the buffer is modofied, the buffer will not be reverted. | |
19 | + | |
20 | +\(fn)" t nil) | |
21 | + | |
22 | +(autoload 'store-last-insertation-point "buffers" "\ | |
23 | +Store in `go-back-marker' last point where | |
24 | +`self-insert-command' was called. Function shall be called by | |
25 | +`after-change-functions'. | |
26 | + | |
27 | +\(fn BEG END LEN)" nil nil) | |
28 | + | |
29 | +(autoload 'go-back-to-last-insertion-point "buffers" "\ | |
30 | +Go back to point of last text insertion. | |
31 | + | |
32 | +\(fn)" t nil) | |
33 | + | |
34 | +;;;*** | |
35 | + | |
36 | +;;;### (autoloads nil "enhance-edit" "enhance-edit.el" (22783 42855 | |
37 | +;;;;;; 0 0)) | |
38 | +;;; Generated autoloads from enhance-edit.el | |
39 | + | |
40 | +(autoload 'select-region-symbol-line "enhance-edit" "\ | |
41 | +This function selects symbol at point, or, if a region is | |
42 | +active, the actual line. | |
43 | + | |
44 | +\(fn)" t nil) | |
45 | + | |
46 | +(autoload 'prettify-c-code "enhance-edit" "\ | |
47 | +A simple reformat of current buffer in `c-mode'. | |
48 | + | |
49 | +\(fn)" t nil) | |
50 | + | |
51 | +(autoload 'quick-search-forward "enhance-edit" "\ | |
52 | +A quick search forward for the symbol at point. Using regex search | |
53 | +with use of symbol boundaries. | |
54 | + | |
55 | +\(fn)" t nil) | |
56 | + | |
57 | +(autoload 'quick-search-backward "enhance-edit" "\ | |
58 | +A quick search backward for the symbol at point. Using regex search | |
59 | +with use of symbol boundaries. | |
60 | + | |
61 | +\(fn)" t nil) | |
62 | + | |
63 | +(autoload 'toggle-selective-display "enhance-edit" "\ | |
64 | +Fold the text. It works in any mode. | |
65 | + | |
66 | +\(fn)" t nil) | |
67 | + | |
68 | +(autoload 'insert-date "enhance-edit" "\ | |
69 | +When called without prefix arg, it inserts the current date in | |
70 | +`diary-mode' format at point. When called with prefix arg,inserts | |
71 | +the current date plus `user-mail-address' at point. | |
72 | + | |
73 | +\(fn PREFIX)" t nil) | |
74 | + | |
75 | +(autoload 'print-radix-16-value "enhance-edit" "\ | |
76 | +Convert the current decimal number (radix 10) at point as | |
77 | +hexadecimal number and print the radix 16 converted number. | |
78 | + | |
79 | +\(fn)" t nil) | |
80 | + | |
81 | +(autoload 'print-radix-10-value "enhance-edit" "\ | |
82 | +Convert the current hexadecimal number (radix 16) at point as | |
83 | +decimal number and print the radix 10 converted number. | |
84 | + | |
85 | +\(fn)" t nil) | |
86 | + | |
87 | +(autoload 'show-dir-info "enhance-edit" "\ | |
88 | + | |
89 | + | |
90 | +\(fn)" t nil) | |
91 | + | |
92 | +(autoload 'cycle-bti-bol "enhance-edit" "\ | |
93 | +Cycle between `back-to-indentation' and `beginning-of-line'. | |
94 | + | |
95 | +\(fn)" t nil) | |
96 | + | |
97 | +;;;*** | |
98 | + | |
99 | +;;;### (autoloads nil "enhance-etags" "enhance-etags.el" (22774 31653 | |
100 | +;;;;;; 0 0)) | |
101 | +;;; Generated autoloads from enhance-etags.el | |
102 | + | |
103 | +(autoload 'rebuild-etags "enhance-etags" "\ | |
104 | +A universal approch to gnerate the TAGS file by Emacs own | |
105 | +etags or Universal Ctags. It requires a loaded desktop, so that | |
106 | +`desktop-dirname' is set. | |
107 | + | |
108 | +In case file .ctags is available in `desktop-dirname', Universal | |
109 | +Ctags is executed. | |
110 | + | |
111 | +In case file .ctags is not available, the classic find/etags | |
112 | +command gets computed by `compute-rebuild-find-etags-command'. | |
113 | +Before starting the process, the old TAGS file gets deleted, | |
114 | +because etags is called with option --append. | |
115 | + | |
116 | +\(fn)" t nil) | |
117 | + | |
118 | +(autoload 'ido-find-file-in-tag-files "enhance-etags" "\ | |
119 | +An ido-method to open a file, that is listed in the visited | |
120 | +tags file. Customize `ido-case-fold' to select the right input | |
121 | +method that works for you. | |
122 | + | |
123 | +\(fn)" t nil) | |
124 | + | |
125 | +(autoload 'ido-find-tag "enhance-etags" "\ | |
126 | +Go to the IDO selected tag. | |
127 | + | |
128 | +\(fn PREFIX)" t nil) | |
129 | + | |
130 | +;;;*** | |
131 | + | |
132 | +;;;### (autoloads nil "enhance-semantic" "enhance-semantic.el" (22774 | |
133 | +;;;;;; 31653 0 0)) | |
134 | +;;; Generated autoloads from enhance-semantic.el | |
135 | + | |
136 | +(autoload 'semantic-start-simple-ede-project "enhance-semantic" "\ | |
137 | +Enable`semantic-mode' and create a 'simple' ede project of | |
138 | +type CPP. | |
139 | + | |
140 | +\(fn ROOT-DIR)" t nil) | |
141 | + | |
142 | +;;;*** | |
143 | + | |
144 | +;;;### (autoloads nil "style-doxygen" "style-doxygen.el" (22774 31653 | |
145 | +;;;;;; 0 0)) | |
146 | +;;; Generated autoloads from style-doxygen.el | |
147 | + | |
148 | +(autoload 'doxygen-font-lock-mode "style-doxygen" "\ | |
149 | +Use font lock for Doxygen keywords for the current buffer. | |
150 | + | |
151 | +\(fn)" t nil) | |
152 | + | |
153 | +;;;*** | |
154 | + | |
155 | +;;;### (autoloads nil nil ("skeletons.el") (22774 31653 0 0)) | |
156 | + | |
157 | +;;;*** | |
158 | + | |
159 | +(provide 'autoloads-elisp) | |
160 | +;; Local Variables: | |
161 | +;; version-control: never | |
162 | +;; no-byte-compile: t | |
163 | +;; no-update-autoloads: t | |
164 | +;; coding: utf-8 | |
165 | +;; End: | |
166 | +;;; autoloads-elisp.el ends here |
@@ -0,0 +1,80 @@ | ||
1 | +;;; buffers.el --- revert, jump between buffers | |
2 | + | |
3 | +;; Copyright (C) 2017 Markus | |
4 | + | |
5 | +;; Author: Markus <markus.prepens@gmail.com> | |
6 | +;; Keywords: elisp support | |
7 | + | |
8 | +;; This program is free software; you can redistribute it and/or modify | |
9 | +;; it under the terms of the GNU General Public License as published by | |
10 | +;; the Free Software Foundation, either version 3 of the License, or | |
11 | +;; (at your option) any later version. | |
12 | + | |
13 | +;; This program is distributed in the hope that it will be useful, | |
14 | +;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | +;; GNU General Public License for more details. | |
17 | + | |
18 | +;; You should have received a copy of the GNU General Public License | |
19 | +;; along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 | + | |
21 | +;;; Commentary: | |
22 | + | |
23 | +;; Some work to be done .... | |
24 | + | |
25 | +;;; Code: | |
26 | + | |
27 | + | |
28 | +;;;###autoload | |
29 | +(defun quick-multi-occur () | |
30 | + "Occur on multiple visited files (buffers). Press key 'e' in | |
31 | +*Occur* buffer to do code refactoring by editing matching lines. | |
32 | +This function operates on C files only." | |
33 | + (interactive) | |
34 | + (let* ((text (read-from-minibuffer "locking for: " (thing-at-point 'symbol)))) | |
35 | + (when (eq major-mode 'c-mode) | |
36 | + (multi-occur-in-matching-buffers "\\.[ch]$" text)) | |
37 | + (when (eq major-mode 'python-mode) | |
38 | + (multi-occur-in-matching-buffers "\\.py$" text)) | |
39 | + (when (eq major-mode 'emacs-lisp-mode) | |
40 | + (multi-occur-in-matching-buffers "\\.el$" text)))) | |
41 | + | |
42 | +;;;###autoload | |
43 | +(defun revert-all-buffers () | |
44 | + "Reverts all opened buffers from their respective files. In | |
45 | +case the buffer is modofied, the buffer will not be reverted." | |
46 | + (interactive) | |
47 | + (let* ((mod-counter 0) | |
48 | + (no-mod-counter 0)) | |
49 | + (dolist (buf (buffer-list)) | |
50 | + (when (buffer-file-name buf) | |
51 | + (if (buffer-modified-p buf) | |
52 | + (setq mod-counter (1+ mod-counter)) | |
53 | + (progn | |
54 | + (set-buffer buf) | |
55 | + (revert-buffer t t t) | |
56 | + (setq no-mod-counter (1+ no-mod-counter)))))) | |
57 | + (if (> mod-counter 0) | |
58 | + (message "%d buffer(s) reverted. %d modified buffer(s) not reverted." | |
59 | + no-mod-counter mod-counter) | |
60 | + (message "%d buffer(s) reverted." | |
61 | + no-mod-counter)))) | |
62 | + | |
63 | +;;;###autoload | |
64 | +(defun store-last-insertation-point (beg end len) | |
65 | + "Store in `go-back-marker' last point where | |
66 | +`self-insert-command' was called. Function shall be called by | |
67 | +`after-change-functions'." | |
68 | + (when buffer-file-name | |
69 | + (when (not (equal "TAGS" (upcase (file-name-nondirectory buffer-file-name)))) | |
70 | + (setq go-back-marker (point-marker))))) | |
71 | + | |
72 | +;;;###autoload | |
73 | +(defun go-back-to-last-insertion-point () | |
74 | + "Go back to point of last text insertion." | |
75 | + (interactive) | |
76 | + (when (boundp 'go-back-marker) | |
77 | + (switch-to-buffer (marker-buffer go-back-marker)) | |
78 | + (goto-char (marker-position go-back-marker)))) | |
79 | + | |
80 | +(provide 'buffers) |
@@ -0,0 +1,167 @@ | ||
1 | +;;; enhance-edit.el --- functions to give abetter edit experience | |
2 | + | |
3 | +;; Copyright (C) 2017 Markus | |
4 | + | |
5 | +;; Author: Markus <markus.prepens@gmail.com> | |
6 | +;; Keywords: elisp support | |
7 | + | |
8 | +;; This program is free software; you can redistribute it and/or modify | |
9 | +;; it under the terms of the GNU General Public License as published by | |
10 | +;; the Free Software Foundation, either version 3 of the License, or | |
11 | +;; (at your option) any later version. | |
12 | + | |
13 | +;; This program is distributed in the hope that it will be useful, | |
14 | +;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | +;; GNU General Public License for more details. | |
17 | + | |
18 | +;; You should have received a copy of the GNU General Public License | |
19 | +;; along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 | + | |
21 | +;;; Commentary: | |
22 | + | |
23 | +;; Some work to be done .... | |
24 | + | |
25 | +;;; Code: | |
26 | + | |
27 | + | |
28 | +;;;###autoload | |
29 | +(defun select-region-symbol-line () | |
30 | + "This function selects symbol at point, or, if a region is | |
31 | +active, the actual line." | |
32 | + (interactive) | |
33 | + (if (and transient-mark-mode mark-active) | |
34 | + (progn (set-mark-command (beginning-of-line)) | |
35 | + (goto-char (line-end-position))) | |
36 | + (let* ((bounds-of-sym (bounds-of-thing-at-point 'symbol))) | |
37 | + (if bounds-of-sym | |
38 | + (let* ((pos1 (car bounds-of-sym)) | |
39 | + (pos2 (cdr bounds-of-sym))) | |
40 | + (goto-char pos1) | |
41 | + (set-mark-command nil) | |
42 | + (goto-char pos2)) | |
43 | + (progn (set-mark-command (beginning-of-line)) | |
44 | + (goto-char (line-end-position))))))) | |
45 | + | |
46 | +;;;###autoload | |
47 | +(defun prettify-c-code () | |
48 | + "A simple reformat of current buffer in `c-mode'." | |
49 | + (interactive) | |
50 | + (when (eq major-mode 'c-mode) | |
51 | + (save-excursion | |
52 | + ;; Look for this: if(...) and change to if (...) | |
53 | + (goto-char (point-min)) | |
54 | + (while (re-search-forward "\\(if\\|for\\|while\\|switch\\)(" nil t) | |
55 | + (if (prettify-test-face-at-point 'font-lock-keyword-face -2) | |
56 | + (replace-match "\\1 ("))) | |
57 | + ;; Look for this: ( abc and change to (abc) | |
58 | + (goto-char (point-min)) | |
59 | + (while (re-search-forward "([ ]+\\(\\w\\)" nil t) | |
60 | + (if (not (prettify-test-face-at-point 'font-lock-comment-face)) | |
61 | + (replace-match "(\\1"))) | |
62 | + ;; Look for this: abc ) and change to abc) | |
63 | + (goto-char (point-min)) | |
64 | + (while (re-search-forward "\\(\\w\\)[ ]+)" nil t) | |
65 | + (if (not (prettify-test-face-at-point 'font-lock-comment-face)) | |
66 | + (replace-match "\\1)"))) | |
67 | + (goto-char (point-min)) | |
68 | + (while (re-search-forward "([ ]\\{1,\\}(" nil t) | |
69 | + (if (not (prettify-test-face-at-point 'font-lock-comment-face)) | |
70 | + (replace-match "(("))) | |
71 | + (goto-char (point-min)) | |
72 | + (while (re-search-forward ")[ ]\\{1,\\})" nil t) | |
73 | + (if (not (prettify-test-face-at-point 'font-lock-comment-face)) | |
74 | + (replace-match "))")))))) | |
75 | + | |
76 | +(defun prettify-test-face-at-point (test-face &optional point-offset) | |
77 | + "A support function for `prettify-c-code'. " | |
78 | + (let ((face-at-point (plist-get | |
79 | + (text-properties-at | |
80 | + (+ (point) (if point-offset point-offset 0))) | |
81 | + 'face))) | |
82 | + (equal face-at-point test-face))) | |
83 | + | |
84 | +;;;###autoload | |
85 | +(defun quick-search-forward () | |
86 | + "A quick search forward for the symbol at point. Using regex search | |
87 | +with use of symbol boundaries." | |
88 | + (interactive) | |
89 | + ;; move point to tail of symbol | |
90 | + (left-char 1) | |
91 | + (search-forward-regexp "\\_>" nil t) | |
92 | + ;; read symbol and run search forward | |
93 | + (let ((regexp (concat "\\_<" (thing-at-point 'symbol) "\\_>"))) | |
94 | + (search-forward-regexp regexp nil t))) | |
95 | + | |
96 | +;;;###autoload | |
97 | +(defun quick-search-backward () | |
98 | + "A quick search backward for the symbol at point. Using regex search | |
99 | +with use of symbol boundaries. " | |
100 | + (interactive) | |
101 | + ;; move point to head of symbol | |
102 | + (right-char 1) | |
103 | + (search-backward-regexp "\\_<" nil t) | |
104 | + ;; read symbol and run search backward | |
105 | + (let ((regexp (concat "\\_<" (thing-at-point 'symbol) "\\_>"))) | |
106 | + (search-backward-regexp regexp nil t))) | |
107 | + | |
108 | +;;;###autoload | |
109 | +(defun toggle-selective-display () | |
110 | + "Fold the text. It works in any mode." | |
111 | + (interactive) | |
112 | + (set-selective-display | |
113 | + (if selective-display nil tab-width))) | |
114 | + | |
115 | +;;;###autoload | |
116 | +(defun insert-date (prefix) | |
117 | + "When called without prefix arg, it inserts the current date in | |
118 | +`diary-mode' format at point. When called with prefix arg,inserts | |
119 | +the current date plus `user-mail-address' at point." | |
120 | + (interactive "P") | |
121 | + (let* ((MOYlist '(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)) | |
122 | + (now (decode-time)) | |
123 | + (date-string (format "%d %s %04d" | |
124 | + (nth 3 now) ; day | |
125 | + (nth (- (nth 4 now) 1) MOYlist) ; month | |
126 | + (nth 5 now)))) ; year | |
127 | + (if prefix | |
128 | + (insert (concat date-string "<" user-mail-address ">")) | |
129 | + (insert date-string)))) | |
130 | + | |
131 | +;;;###autoload | |
132 | +(defun print-radix-16-value () | |
133 | + "Convert the current decimal number (radix 10) at point as | |
134 | +hexadecimal number and print the radix 16 converted number." | |
135 | + (interactive) | |
136 | + (message "\"%s\" is %X as radix 16" | |
137 | + (thing-at-point 'word) | |
138 | + (string-to-number (thing-at-point 'word) 10))) | |
139 | + | |
140 | +;;;###autoload | |
141 | +(defun print-radix-10-value () | |
142 | + "Convert the current hexadecimal number (radix 16) at point as | |
143 | +decimal number and print the radix 10 converted number." | |
144 | + (interactive) | |
145 | + (message "\"%s\" is %X as radix 10" | |
146 | + (thing-at-point 'word) | |
147 | + (string-to-number (thing-at-point 'word) 16))) | |
148 | + | |
149 | +;;;###autoload | |
150 | +(defun show-dir-info () | |
151 | + (interactive) | |
152 | + (message "buffer file name: %s\ndefault directory: %s\ndesktop directory: %s" | |
153 | + (or (buffer-file-name) | |
154 | + "buffer has no file") | |
155 | + (file-name-as-directory default-directory) | |
156 | + (file-name-as-directory desktop-dirname))) | |
157 | + | |
158 | +;;;###autoload | |
159 | +(defun cycle-bti-bol () | |
160 | + "Cycle between `back-to-indentation' and `beginning-of-line'." | |
161 | + (interactive) | |
162 | + (let ((orig (point))) | |
163 | + (back-to-indentation) | |
164 | + (when (= orig (point)) | |
165 | + (beginning-of-line)))) | |
166 | + | |
167 | +(provide 'enhance-edit) |
@@ -0,0 +1,111 @@ | ||
1 | +;;; enhance-etags.el --- Elisp code snippets to make live easier | |
2 | + | |
3 | +;; Copyright (C) 2017 Markus | |
4 | + | |
5 | +;; Author: Markus <markus.prepens@gmail.com> | |
6 | +;; Keywords: elisp support | |
7 | + | |
8 | +;; This program is free software; you can redistribute it and/or modify | |
9 | +;; it under the terms of the GNU General Public License as published by | |
10 | +;; the Free Software Foundation, either version 3 of the License, or | |
11 | +;; (at your option) any later version. | |
12 | + | |
13 | +;; This program is distributed in the hope that it will be useful, | |
14 | +;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | +;; GNU General Public License for more details. | |
17 | + | |
18 | +;; You should have received a copy of the GNU General Public License | |
19 | +;; along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 | + | |
21 | +;;; Commentary: | |
22 | + | |
23 | +;; Support functions to update etags files. | |
24 | + | |
25 | +;;; Code: | |
26 | + | |
27 | +(defvar-mode-local c-mode init-ido-tags-symbol-list nil | |
28 | + "List of known tags for this major mode.") | |
29 | + | |
30 | + | |
31 | +(defun compute-rebuild-find-etags-command () | |
32 | + "The classic find/etags command gets computed which takes | |
33 | +`grep-find-ignored-directories' into account." | |
34 | + (format "%s" | |
35 | + (concat "find . -type f -not -iregex \".*\\(" | |
36 | + ;; `identity' returns the argument unchanged | |
37 | + (mapconcat 'identity grep-find-ignored-directories "\\|") | |
38 | + "\\).*\" -and -regex \".*\\.[ch]$\" -exec etags --append {} +"))) | |
39 | + | |
40 | +;;;###autoload | |
41 | +(defun rebuild-etags () | |
42 | + "A universal approch to gnerate the TAGS file by Emacs own | |
43 | +etags or Universal Ctags. It requires a loaded desktop, so that | |
44 | +`desktop-dirname' is set. | |
45 | + | |
46 | +In case file .ctags is available in `desktop-dirname', Universal | |
47 | +Ctags is executed. | |
48 | + | |
49 | +In case file .ctags is not available, the classic find/etags | |
50 | +command gets computed by `compute-rebuild-find-etags-command'. | |
51 | +Before starting the process, the old TAGS file gets deleted, | |
52 | +because etags is called with option --append." | |
53 | + (interactive) | |
54 | + (when (and (boundp 'desktop-dirname) (boundp 'grep-find-ignored-directories)) | |
55 | + (let* ((default-directory desktop-dirname)) | |
56 | + (if (file-exists-p ".ctags") | |
57 | + ;; Oh! We can run Ctags. Assuming it's the Universal|Exuberant Ctags. | |
58 | + (progn | |
59 | + (start-process-shell-command "CTAGS" "*ctags*" "ctags -Re .") | |
60 | + (set-process-sentinel (get-process "CTAGS") 'rebuild-tags-sentinel)) | |
61 | + ;; Ohhhh! Use old school approach with find/etags | |
62 | + (progn | |
63 | + (when (file-exists-p "tags") | |
64 | + (delete-file "TAGS" nil)) | |
65 | + (start-process-shell-command "ETAGS" "*etags*" (compute-rebuild-find-etags-command)) | |
66 | + (set-process-sentinel (get-process "ETAGS") 'rebuild-tags-sentinel)))))) | |
67 | + | |
68 | +(defun rebuild-tags-sentinel (process event) | |
69 | + "Throw a message in case process status is not 'exit'." | |
70 | + (when (not (equal (format "%s" (process-status process)) "exit")) | |
71 | + (message (format "Process %s had status <%s>" | |
72 | + process | |
73 | + (process-status process))))) | |
74 | + | |
75 | + | |
76 | +;;;###autoload | |
77 | +(defun ido-find-file-in-tag-files () | |
78 | + "An ido-method to open a file, that is listed in the visited | |
79 | +tags file. Customize `ido-case-fold' to select the right input | |
80 | +method that works for you." | |
81 | + (interactive) | |
82 | + (save-excursion | |
83 | + (let ((enable-recursive-minibuffers t)) | |
84 | + (visit-tags-table-buffer)) | |
85 | + (find-file | |
86 | + (expand-file-name | |
87 | + (ido-completing-read | |
88 | + "Open file: " (tags-table-files) nil t))))) | |
89 | + | |
90 | +(defun init-ido-read-tag (prompt &optional require-match initial-input) | |
91 | + "Return the name of a tag in the current tags table." | |
92 | + (let ((enable-recursive-minibuffers t)) | |
93 | + (visit-tags-table-buffer 'same) | |
94 | + (tags-completion-table) | |
95 | + (setq init-ido-tags-symbol-list '()) | |
96 | + ;;(mapatoms (lambda (e) (push (symbol-name e) init-ido-tags-symbol-list)) tags-completion-table) | |
97 | + (mapcar (lambda (e) (push e init-ido-tags-symbol-list)) tags-completion-table) | |
98 | + (ido-completing-read prompt | |
99 | + init-ido-tags-symbol-list | |
100 | + nil | |
101 | + require-match | |
102 | + initial-input))) | |
103 | + | |
104 | +;;;###autoload | |
105 | +(defun ido-find-tag (prefix) | |
106 | + "Go to the IDO selected tag." | |
107 | + (interactive "P") | |
108 | + (let ((tag (init-ido-read-tag "Find tag: " nil nil))) ;; choose the tag | |
109 | + (xref-find-definitions tag))) | |
110 | + | |
111 | +(provide 'enhance-etags) |
@@ -0,0 +1,47 @@ | ||
1 | +;;; desktops.el --- Customize Emacs for special projects | |
2 | + | |
3 | +;; Copyright (C) 2017 Markus | |
4 | + | |
5 | +;; Author: Markus <markus.prepens@gmail.com> | |
6 | +;; Keywords: tools, c | |
7 | + | |
8 | +;; This program is free software; you can redistribute it and/or modify | |
9 | +;; it under the terms of the GNU General Public License as published by | |
10 | +;; the Free Software Foundation, either version 3 of the License, or | |
11 | +;; (at your option) any later version. | |
12 | + | |
13 | +;; This program is distributed in the hope that it will be useful, | |
14 | +;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | +;; GNU General Public License for more details. | |
17 | + | |
18 | +;; You should have received a copy of the GNU General Public License | |
19 | +;; along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 | + | |
21 | +;;; Commentary: | |
22 | + | |
23 | +;; Some work to be done .... | |
24 | + | |
25 | +;;; Code: | |
26 | + | |
27 | +;;;###autoload | |
28 | +(defun semantic-start-simple-ede-project () | |
29 | + "Enable`semantic-mode' and create a simple ede project of | |
30 | +type CPP. Root directory is `dektop-dirname'." | |
31 | + (interactive) | |
32 | + (global-ede-mode 1) | |
33 | + (ede-cpp-root-project "generation4" | |
34 | + :file (concat desktop-dirname desktop-base-file-name) | |
35 | + :include-path '("/C_Application" "/C_HeaterCore" "/C_CDD" "/C_CmdHandler" "/C_WBusCoreServices")) | |
36 | + (semantic-mode t)) | |
37 | + | |
38 | +(defun additional-semantic-c-setup () | |
39 | + "A function to be called for each buffer using c-mode. Set | |
40 | +proper key bindings. The intention of this function is to be | |
41 | +added to hook `c-mode-common-hook'." | |
42 | + (local-set-key (kbd "C-c , <return>") 'semantic-complete-inline-done) | |
43 | + (local-set-key (kbd "C-c , <tab>") 'semantic-analyze-proto-impl-toggle)) | |
44 | + | |
45 | +(add-hook 'c-mode-common-hook 'additional-semantic-c-setup t) | |
46 | + | |
47 | +(provide 'enhance-semantic) |
@@ -0,0 +1,222 @@ | ||
1 | +;;; skeletons.el --- skeletons used by abbrevs | |
2 | + | |
3 | +;; Copyright (C) 2017 Markus | |
4 | + | |
5 | +;; Author: Markus <markus.prepens@gmail.com> | |
6 | +;; Keywords: elisp support | |
7 | + | |
8 | +;; This program is free software; you can redistribute it and/or modify | |
9 | +;; it under the terms of the GNU General Public License as published by | |
10 | +;; the Free Software Foundation, either version 3 of the License, or | |
11 | +;; (at your option) any later version. | |
12 | + | |
13 | +;; This program is distributed in the hope that it will be useful, | |
14 | +;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | +;; GNU General Public License for more details. | |
17 | + | |
18 | +;; You should have received a copy of the GNU General Public License | |
19 | +;; along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 | + | |
21 | +;;; Commentary: | |
22 | + | |
23 | +;; .... | |
24 | + | |
25 | +;;; Code: | |
26 | + | |
27 | +;;;;;;; | |
28 | +;; Auto-pairing is done by skeleton-mode | |
29 | +(setq skeleton-pair t) | |
30 | +(setq skeleton-pair-on-word nil) | |
31 | + | |
32 | +(add-hook 'markdown-mode-hook | |
33 | + (lambda () | |
34 | + (local-set-key (kbd "'") 'skeleton-pair-insert-maybe) | |
35 | + (local-set-key (kbd "`") 'skeleton-pair-insert-maybe) | |
36 | + (local-set-key (kbd "\"") 'skeleton-pair-insert-maybe))) | |
37 | + | |
38 | +(add-hook 'emacs-lisp-mode-hook | |
39 | + (lambda () | |
40 | + (local-set-key (kbd "(") 'skeleton-pair-insert-maybe) | |
41 | + (local-set-key (kbd "\"") 'skeleton-pair-insert-maybe))) | |
42 | + | |
43 | +(add-hook 'c-mode-common-hook | |
44 | + (lambda () | |
45 | + (local-set-key (kbd "{") 'skeleton-pair-insert-maybe) | |
46 | + (local-set-key (kbd "(") 'skeleton-pair-insert-maybe) | |
47 | + (local-set-key (kbd "\"") 'skeleton-pair-insert-maybe))) | |
48 | + | |
49 | +(define-skeleton c-skeleton-file-header | |
50 | + "A comment header of a C files." nil | |
51 | + "/*\n" | |
52 | + " *\n" | |
53 | + " * WEBASTO SE, MCC, COPYRIGHT (c) " (format "%04d" (nth 5 (decode-time))) "\n" | |
54 | + " * ALL RIGHTS RESERVED\n" | |
55 | + " *\n" | |
56 | + " */\n" | |
57 | + "\n" | |
58 | + "/**\n" | |
59 | + " * \\file <FILE>\n" | |
60 | + " *\n" | |
61 | + " * \\ingroup <GROUP_NAME>\n" | |
62 | + " *\n" | |
63 | + " * \\brief <ADD DESC>\n" | |
64 | + " *\n" | |
65 | + " * \\author $Author$\n" | |
66 | + " * \\version $Revision$\n" | |
67 | + " * \\date $Date$\n" | |
68 | + " *\n" | |
69 | + " */\n") | |
70 | + | |
71 | +(define-skeleton c-skeleton-delimiter | |
72 | + "A delimiter line to bring more structure in file headers." nil | |
73 | + "/* " _ "========================================================================== */" | |
74 | + ) | |
75 | + | |
76 | + | |
77 | +(define-skeleton c-skeleton-function-header | |
78 | + "A comment header of a C function" nil | |
79 | + "/**\n" | |
80 | + " * \\brief " (read-string "Brief description:") | |
81 | + "\n *" | |
82 | + "\n * <Add detailed documentation here>" | |
83 | + "\n *" | |
84 | + "\n * \\par Used global variables:" | |
85 | + "\n * - None" | |
86 | + "\n *" | |
87 | + "\n * \\param[in] " | |
88 | + "\n * \\param[out] " | |
89 | + "\n * \\return " | |
90 | + "\n *" | |
91 | + "\n * */\n") | |
92 | + | |
93 | +(define-skeleton c-skeleton-preproc-if | |
94 | + "A simple preprocessor ifdef directive." nil | |
95 | + "#if (" (setq str (read-string "Directive condition: ")) ")\n" | |
96 | + _ "\n#endif /* " str " */") | |
97 | + | |
98 | +(define-skeleton c-skeleton-preproc-ifdef | |
99 | + "A simple preprocessor ifdef directive." nil | |
100 | + "#ifdef " (setq str (read-string "Directive condition: ")) "\n" | |
101 | + _ "\n#endif /* " str " */") | |
102 | + | |
103 | +(define-skeleton c-skeleton-plain-doxy-comment-before | |
104 | + "A simple doxygen comment before definition." nil | |
105 | + "/** \\brief " _ " */") | |
106 | + | |
107 | +(define-skeleton c-skeleton-plain-doxy-comment-after | |
108 | + "A simple doxygen comment after definition." nil | |
109 | + "/**< " _ " */") | |
110 | + | |
111 | +(define-skeleton c-skeleton-preproc-include | |
112 | + "A simple preprocessor include." nil | |
113 | + "#include \"" _ "\"") | |
114 | + | |
115 | +(define-skeleton c-skeleton-open-curly-braces | |
116 | + "Put a pair of curly braces with proper indention." nil | |
117 | + "{" > "\n" > _ "\n}" > ) | |
118 | + | |
119 | +(define-skeleton c-skeleton-if | |
120 | + "insert a final else to th if statement." nil | |
121 | + "if (" _ ")" > "\n{" > "\n}" >) | |
122 | + | |
123 | +(define-skeleton c-skeleton-else | |
124 | + "insert a final else to th if statement." nil | |
125 | + "else" > "\n{" > "\n" > _ "\n}" > ) | |
126 | + | |
127 | +(define-skeleton c-skeleton-new-case | |
128 | + "a case construction, used by switch statement." nil | |
129 | + "case " (read-string "Identifier: ") ":" > "\n" | |
130 | + > _ > "\nbreak;" >) | |
131 | + | |
132 | +(define-skeleton c-skeleton-switch-case | |
133 | + "a default switch-case construction" nil | |
134 | + "switch (" (read-string "Identifier: ") > ")\n" | |
135 | + "{" > "\n" > _ | |
136 | + "\ndefault:" > "\nbreak;" > "\n}") | |
137 | + | |
138 | + | |
139 | +(setq auto-insert-alist | |
140 | + '((("\\.\\([Hh]\\|hh\\|hpp\\)\\'" . "C / C++ header") | |
141 | + (upcase | |
142 | + (concat | |
143 | + (file-name-nondirectory | |
144 | + (file-name-sans-extension buffer-file-name)) | |
145 | + "_" | |
146 | + (file-name-extension buffer-file-name))) | |
147 | + | |
148 | + " /*\n" | |
149 | + " * WEBASTO GROUP, MCC, COPYRIGHT (c) " (format "%4d" (nth 5 (decode-time))) "\n" | |
150 | + " * ALL RIGHTS RESERVED\n" | |
151 | + " *\n" | |
152 | + " */\n" | |
153 | + "\n" | |
154 | + "/**\n" | |
155 | + " * \\file " (file-name-nondirectory buffer-file-name) "\n" | |
156 | + " * \\ingroup <module name>\n" | |
157 | + " * \\brief <short description>\n" | |
158 | + " * \n" | |
159 | + " * <Description about the purpose of this file>\n" | |
160 | + " *\n" | |
161 | + " */\n" | |
162 | + "\n" | |
163 | + "#ifndef " str n "#define " str "\n\n" | |
164 | + "/* ============================= INCLUDES ================================== */\n" | |
165 | + "\n" | |
166 | + "/* ============================= TYPEDEFS ================================== */\n" | |
167 | + "\n" | |
168 | + "/* ========================= SYMBOLIC CONSTANTS ============================ */\n" | |
169 | + "\n" | |
170 | + "/* ========================= EXPORTED MACROS =============================== */\n" | |
171 | + "\n" | |
172 | + "/* ========================= EXPORTED VARIABLES ============================ */\n" | |
173 | + "\n" | |
174 | + "/* ======================== EXPORTED FUNCTIONS ============================= */\n" | |
175 | + "\n" | |
176 | + "\n" | |
177 | + "#endif /* " str " */\n") | |
178 | + (("\\.\\([Cc]\\|cc\\|cpp\\)\\'" . "C / C++ program") | |
179 | + nil | |
180 | + | |
181 | + "/*\n" | |
182 | + " * WEBASTO GROUP, MCC, COPYRIGHT (c) " (format "%4d" (nth 5 (decode-time))) "\n" | |
183 | + " * ALL RIGHTS RESERVED\n" | |
184 | + " *\n" | |
185 | + " */\n" | |
186 | + "\n" | |
187 | + "/**\n" | |
188 | + " * \\file " (file-name-nondirectory buffer-file-name) "\n" | |
189 | + " * \\ingroup <module name>\n" | |
190 | + " * \\brief <short description>\n" | |
191 | + " *\n" | |
192 | + " * <Description about the purpose of this file>\n" | |
193 | + " *\n" | |
194 | + " */\n" | |
195 | + "\n" | |
196 | + "/* ============================= INCLUDES ================================== */\n" | |
197 | + "\n" | |
198 | + "#include \"Basic/HcStd.h\"\n" | |
199 | + "#include \"" (file-name-nondirectory | |
200 | + (file-name-sans-extension buffer-file-name)) ".h\"\n\n" | |
201 | + "\n" | |
202 | + "/* ============================= TYPEDEFS ================================== */\n" | |
203 | + "\n" | |
204 | + "/* ======================= FORWARD DECLARATIONS ============================ */\n" | |
205 | + "\n" | |
206 | + "/* ========================= SYMBOLIC CONSTANTS ============================ */\n" | |
207 | + "\n" | |
208 | + "/* ============================== MACROS =================================== */\n" | |
209 | + "\n" | |
210 | + "/* ========================= EXPORTED VARIABLES ============================ */\n" | |
211 | + "\n" | |
212 | + "/* ========================== LOCAL VARIABLES ============================== */\n" | |
213 | + "\n" | |
214 | + "/* ======================== EXPORTED FUNCTIONS ============================= */\n" | |
215 | + "\n" | |
216 | + "/* ========================== LOCAL FUNCTIONS ============================== */\n" | |
217 | + "\n" | |
218 | + "/* =============================== TASKS =================================== */\n"))) | |
219 | + | |
220 | + | |
221 | + | |
222 | +(provide 'skeletons) |
@@ -0,0 +1,169 @@ | ||
1 | +;;; style-doxygen.el --- Doxygen support | |
2 | + | |
3 | +;; Copyright (C) 2017 Markus | |
4 | + | |
5 | +;; Author: Markus <markus.prepens@gmail.com> | |
6 | +;; Keywords: elisp support | |
7 | + | |
8 | +;; This program is free software; you can redistribute it and/or modify | |
9 | +;; it under the terms of the GNU General Public License as published by | |
10 | +;; the Free Software Foundation, either version 3 of the License, or | |
11 | +;; (at your option) any later version. | |
12 | + | |
13 | +;; This program is distributed in the hope that it will be useful, | |
14 | +;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | +;; GNU General Public License for more details. | |
17 | + | |
18 | +;; You should have received a copy of the GNU General Public License | |
19 | +;; along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 | + | |
21 | +;;; Commentary: | |
22 | +;; | |
23 | +;; Highlight Doxygen keywords in c-mode. | |
24 | +;; | |
25 | +;; The code uses the standard Emacs interface for that purpose, called | |
26 | +;; `font-lock-add-keywords'. | |
27 | +;; | |
28 | +;; Parts taken from Sourceforge project Doxymacs. | |
29 | +;; Find the original sources here - http://sourceforge.net/projects/doxymacs | |
30 | +;; | |
31 | +;; To get it working in c-mode, disable highlighting for comment style gtkdoc. It is | |
32 | +;; controlled by variable `c-doc-comment-style'. Customize this variable. | |
33 | +;; | |
34 | +;; Add this to your init.el: | |
35 | +;; | |
36 | +;; (eval-after-load "c-mode" (load "style-doxygen.el")) | |
37 | +;; | |
38 | +;; Code: | |
39 | + | |
40 | + | |
41 | +;; (defgroup doxygen-faces nil | |
42 | +;; "Doxygen highlighting" | |
43 | +;; :group 'docs) | |
44 | +;; | |
45 | +;; (defface font-lock-doxygen-keyword | |
46 | +;; `((t (:inherit font-lock-comment-delimiter-face))) | |
47 | +;; "Doxygen keywords" | |
48 | +;; :group 'doxygen-faces) | |
49 | +;; | |
50 | +;; (defface font-lock-doxygen-parameter | |
51 | +;; `((t (:inherit font-lock-function-name-face))) | |
52 | +;; "Doxygen keywords" | |
53 | +;; :group 'doxygen-faces) | |
54 | + | |
55 | +(defconst doxygen-keywords | |
56 | + (list | |
57 | + (list | |
58 | + ;; One shot keywords that take no arguments | |
59 | + (concat "\\([@\\\\]\\(brief\\|li\\|\\(end\\)?code\\|sa" | |
60 | + "\\|note\\|\\(end\\)?verbatim\\|return\\|arg\\|fn" | |
61 | + "\\|hideinitializer\\|showinitializer" | |
62 | + ;; FIXME | |
63 | + ;; How do I get & # < > % to work? | |
64 | + ;;"\\|\\\\&\\|\\$\\|\\#\\|<\\|>\\|\\%" | |
65 | + "\\|\\$" | |
66 | + "\\|internal\\|nosubgrouping\\|author\\|date\\|endif" | |
67 | + "\\|invariant\\|post\\|pre\\|remarks\\|since\\|test\\|version" | |
68 | + "\\|\\(end\\)?htmlonly\\|\\(end\\)?latexonly\\|f\\$\\|file" | |
69 | + "\\|\\(end\\)?xmlonly\\|\\(end\\)?manonly\\|property" | |
70 | + "\\|mainpage\\|name\\|overload\\|typedef\\|deprecated\\|par" | |
71 | + "\\|addindex\\|line\\|skip\\|skipline\\|until\\|see" | |
72 | + "\\|endlink\\|callgraph\\|endcond\\|else\\)\\)\\>") | |
73 | + '(0 font-lock-comment-delimiter-face prepend)) | |
74 | + ;; attention, warning, etc. given a different font | |
75 | + (list | |
76 | + "\\([@\\\\]\\(attention\\|warning\\|todo\\|bug\\)\\)\\>" | |
77 | + '(0 font-lock-warning-face prepend)) | |
78 | + ;; keywords that take a variable name as an argument | |
79 | + (list | |
80 | + (concat "\\([@\\\\]\\(param\\(?:\\s-*\\[\\(?:in\\|out\\|in,out\\)\\]\\)?" | |
81 | + "\\|a\\|namespace\\|relates\\(also\\)?" | |
82 | + "\\|var\\|def\\)\\)\\s-+\\(\\sw+\\)") | |
83 | + '(1 font-lock-comment-delimiter-face prepend) | |
84 | + '(4 font-lock-doc-face prepend)) | |
85 | + ;; keywords that take a type name as an argument | |
86 | + (list | |
87 | + (concat "\\([@\\\\]\\(class\\|struct\\|union\\|exception\\|enum" | |
88 | + "\\|throw\\|interface\\|protocol\\)\\)\\s-+\\(\\(\\sw\\|:\\)+\\)") | |
89 | + '(1 font-lock-comment-delimiter-face prepend) | |
90 | + '(3 font-lock-doc-face prepend)) | |
91 | + ;; keywords that take a function name as an argument | |
92 | + (list | |
93 | + "\\([@\\\\]retval\\)\\s-+\\([^ \t\n]+\\)" | |
94 | + '(1 font-lock-comment-delimiter-face prepend) | |
95 | + '(2 font-lock-doc-face prepend)) | |
96 | + ;; bold | |
97 | + (list | |
98 | + "\\([@\\\\]b\\)\\s-+\\([^ \t\n]+\\)" | |
99 | + '(1 font-lock-comment-delimiter-face prepend) | |
100 | + '(2 (quote bold) prepend)) | |
101 | + ;; code | |
102 | + (list | |
103 | + "\\([@\\\\][cp]\\)\\s-+\\([^ \t\n]+\\)" | |
104 | + '(1 font-lock-comment-delimiter-face prepend) | |
105 | + '(2 (quote font-lock-doc-face) prepend)) | |
106 | + ;; italics/emphasised | |
107 | + (list | |
108 | + "\\([@\\\\]e\\(m\\)?\\)\\s-+\\([^ \t\n]+\\)" | |
109 | + '(1 font-lock-comment-delimiter-face prepend) | |
110 | + '(3 (quote italic) prepend)) | |
111 | + ;; keywords that take a list | |
112 | + (list | |
113 | + "\\([@\\\\]ingroup\\)\\s-+\\(\\(\\sw+\\s-*\\)+\\)\\s-*$" | |
114 | + '(1 font-lock-comment-delimiter-face prepend) | |
115 | + '(2 font-lock-doc-face prepend)) | |
116 | + ;; one argument that can contain arbitrary non-whitespace stuff | |
117 | + (list | |
118 | + (concat "\\([@\\\\]\\(link\\|copydoc\\|xrefitem" | |
119 | + "\\|if\\(not\\)?\\|elseif\\)\\)" | |
120 | + "\\s-+\\([^ \t\n]+\\)") | |
121 | + '(1 font-lock-comment-delimiter-face prepend) | |
122 | + '(4 font-lock-doc-face prepend)) | |
123 | + ;; one optional argument that can contain arbitrary non-whitespace stuff | |
124 | + (list | |
125 | + "\\([@\\\\]\\(cond\\|dir\\)\\(\\s-+[^ \t\n]+\\)?\\)" | |
126 | + '(1 font-lock-comment-delimiter-face prepend) | |
127 | + '(3 font-lock-doc-face prepend t)) | |
128 | + ;; one optional argument with no space between | |
129 | + (list | |
130 | + "\\([@\\\\]\\(~\\)\\([^ \t\n]+\\)?\\)" | |
131 | + '(1 font-lock-comment-delimiter-face prepend) | |
132 | + '(3 font-lock-doc-face prepend t)) | |
133 | + ;; one argument that has to be a filename | |
134 | + (list | |
135 | + (concat "\\([@\\\\]\\(example\\|\\(dont\\)?include\\|includelineno" | |
136 | + "\\|htmlinclude\\|verbinclude\\)\\)\\s-+" | |
137 | + "\\(\"?[~:\\/a-zA-Z0-9_. ]+\"?\\)") | |
138 | + '(1 font-lock-comment-delimiter-face prepend) | |
139 | + '(4 font-lock-doc-face prepend)) | |
140 | + ;; dotfile <file> ["caption"] | |
141 | + (list | |
142 | + (concat "\\([@\\\\]dotfile\\)\\s-+" | |
143 | + "\\(\"?[~:\\/a-zA-Z0-9_. ]+\"?\\)\\(\\s-+\"[^\"]+\"\\)?") | |
144 | + '(1 font-lock-comment-delimiter-face prepend) | |
145 | + '(2 font-lock-doc-face prepend) | |
146 | + '(3 font-lock-doc-face prepend t)) | |
147 | + ;; image <format> <file> ["caption"] [<sizeindication>=<size>] | |
148 | + (list | |
149 | + "\\([@\\\\]image\\)\\s-+\\(html\\|latex\\)\\s-+\\(\"?[~:\\/a-zA-Z0-9_. ]+\"?\\)\\(\\s-+\"[^\"]+\"\\)?\\(\\s-+\\sw+=[0-9]+\\sw+\\)?" | |
150 | + '(1 font-lock-comment-delimiter-face prepend) | |
151 | + '(2 font-lock-doc-face prepend) | |
152 | + '(3 font-lock-doc-face prepend) | |
153 | + '(4 font-lock-doc-face prepend t) | |
154 | + '(5 font-lock-doc-face prepend t)) | |
155 | + ;; one argument that has to be a word | |
156 | + (list | |
157 | + (concat "\\([@\\\\]\\(addtogroup\\|defgroup\\|weakgroup" | |
158 | + "\\|page\\|anchor\\|ref\\|section\\|subsection" | |
159 | + "\\)\\)\\s-+\\(\\sw+\\)") | |
160 | + '(1 font-lock-comment-delimiter-face prepend) | |
161 | + '(3 font-lock-doc-face prepend)))) | |
162 | + | |
163 | +;;;###autoload | |
164 | +(defun doxygen-font-lock-mode () | |
165 | + "Use font lock for Doxygen keywords for the current buffer." | |
166 | + (interactive) | |
167 | + (font-lock-add-keywords 'c-mode doxygen-keywords)) | |
168 | + | |
169 | +(provide 'style-doxygen) |
@@ -0,0 +1,476 @@ | ||
1 | +;;; init.el | |
2 | + | |
3 | +;; Copyright (C) 2017 Markus | |
4 | + | |
5 | +;; Author: Markus <markus.prepens@gmail.com> | |
6 | +;; Keywords: tools, c | |
7 | + | |
8 | +;; This program is free software; you can redistribute it and/or modify | |
9 | +;; it under the terms of the GNU General Public License as published by | |
10 | +;; the Free Software Foundation, either version 3 of the License, or | |
11 | +;; (at your option) any later version. | |
12 | + | |
13 | +;; This program is distributed in the hope that it will be useful, | |
14 | +;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | +;; GNU General Public License for more details. | |
17 | + | |
18 | +;; You should have received a copy of the GNU General Public License | |
19 | +;; along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 | + | |
21 | +;;; Commentary: Well, none! | |
22 | + | |
23 | +;;; Code: | |
24 | + | |
25 | +;;;;;;;;;; | |
26 | +;; Add additional directories in front of `load-path'. | |
27 | +(add-to-list 'load-path "~/.emacs.d/modes") | |
28 | +(add-to-list 'load-path "~/.emacs.d/elisp") | |
29 | + | |
30 | +;; Added by Package.el. This must come before configurations of | |
31 | +;; installed packages. Don't delete this line. If you don't want it, | |
32 | +;; just comment it out by adding a semicolon to the start of the line. | |
33 | +;; You may delete these explanatory comments. | |
34 | +(package-initialize) | |
35 | + | |
36 | +(defgroup my-customs nil | |
37 | + "Customizing group of init.el. It offers an easy way to keep | |
38 | +the init file as it is and to adapt certain variables depedent on | |
39 | +the actual work station or project your are working on. | |
40 | + | |
41 | +Here is a additional tip to customize Emacs for your project | |
42 | +needs, this variables might be useful: | |
43 | + | |
44 | + * `ff-search-directories' | |
45 | + * `compilation-search-path' | |
46 | + * `grep-find-template' | |
47 | + * `grep-find-ignored-directories' | |
48 | + * `grep-find-ignored-files' | |
49 | + | |
50 | +They are part of Emacs standard packages." | |
51 | + :group 'tools) | |
52 | + | |
53 | +(defcustom init-ido-uses-completions-vertically nil | |
54 | + "Display IDO completions vertically, when t." | |
55 | + :type '(boolean) | |
56 | + :group 'my-customs) | |
57 | + | |
58 | +(setq custom-file "~/.emacs.d/custom.el") | |
59 | +(load custom-file) | |
60 | + | |
61 | +;; Load autoload commands. Gerated by `update-file-autoloads' or | |
62 | +;; `update-directory-autoloads'. Check out | |
63 | +;; http://www.gnu.org/software/emacs/manual/html_node/elisp/Autoload.html | |
64 | +(require 'autoloads-modes) | |
65 | +(require 'autoloads-elisp) | |
66 | + | |
67 | +;;;;;;; | |
68 | +;; Load my skeleton templates before abbrev mode loads. | |
69 | +(require 'skeletons) | |
70 | + | |
71 | +;; Set the frame's title. %b is the name of the buffer. %+ indicates | |
72 | +;; the state of the buffer: * if modified, % if read only, or - | |
73 | +;; otherwise. Two of them to emulate the mode line. %f for the file | |
74 | +;; name. Incredibly useful! | |
75 | +(setq-default frame-title-format | |
76 | + '(:eval | |
77 | + (format "%s (%s) on Emacs" | |
78 | + (buffer-name) | |
79 | + (file-name-directory (or (buffer-file-name) | |
80 | + default-directory))))) | |
81 | + | |
82 | +;;;;;;;;;; | |
83 | +;; The history mode | |
84 | +(setq savehist-additional-variables ;; also save ... | |
85 | + '(search-ring regexp-search-ring) ;; ... my search entries | |
86 | + savehist-file "~/.emacs.d/savehist") ;; keep my home clean | |
87 | +(savehist-mode t) ;; do customization before activate | |
88 | + | |
89 | +(when (eq system-type 'windows-nt) | |
90 | + (prefer-coding-system 'windows-1256-dos)) | |
91 | + | |
92 | +;;;;;;;;;; | |
93 | +;; Mode VC needs filesets to work properly. Needed for operations on marked | |
94 | +;; files in a vc-dir buffer. Chapter "28.1.3 Basic Editing under Version | |
95 | +;; Control" | |
96 | +(filesets-init) | |
97 | + | |
98 | +;;;;;;;;;; | |
99 | +;; My Ediff configuration | |
100 | +;; Find out more on http://www.emacswiki.org/emacs/EdiffMode | |
101 | +(eval-after-load "ediff" | |
102 | + (progn (setq ediff-window-setup-function 'ediff-setup-windows-plain) | |
103 | + (setq ediff-split-window-function 'split-window-horizontally) | |
104 | + (setq-default ediff-ignore-similar-regions t))) | |
105 | + | |
106 | +;; Display IDO completions vertically | |
107 | +;; Code taken from this Emacs wiki page: | |
108 | +;; http://www.emacswiki.org/emacs/InteractivelyDoThings#toc23 | |
109 | +(add-hook 'ido-minibuffer-setup-hook | |
110 | + (lambda () | |
111 | + (set (make-local-variable 'truncate-lines) nil) | |
112 | + (setcar (nthcdr 2 ido-decorations) | |
113 | + (if init-ido-uses-completions-vertically "\n | " " | ")))) | |
114 | + | |
115 | +(add-hook 'ido-setup-hook | |
116 | + (lambda () | |
117 | + ;; C-f/p is more intuitive in vertical layout | |
118 | + (define-key ido-completion-map (kbd "<down>") 'ido-next-match) | |
119 | + (define-key ido-completion-map (kbd "<up>") 'ido-prev-match))) | |
120 | + | |
121 | +(add-hook 'compilation-mode-hook | |
122 | + (lambda () | |
123 | + ;; line break for comilation buffer | |
124 | + (setq truncate-lines t) | |
125 | + (text-scale-adjust -1))) | |
126 | + | |
127 | +(add-hook 'before-save-hook | |
128 | + (lambda() | |
129 | + ;; Emacs writes the backup before save-buffer and sets local | |
130 | + ;; variable `buffer-backed-up' to t. To enable further backups in | |
131 | + ;; this session, set buffer-backed-up to nil with this hook. | |
132 | + ;; `backup-directory-alist' controls which and where files are | |
133 | + ;; stored. | |
134 | + (setq buffer-backed-up nil))) | |
135 | + | |
136 | +(add-hook 'before-save-hook | |
137 | + ;; Take care to customize `whitespace-style' in order to keep | |
138 | + ;; indentation of source code | |
139 | + 'whitespace-cleanup) | |
140 | + | |
141 | +;; Get easy access to eshells history list | |
142 | +(add-hook 'eshell-mode-hook | |
143 | + (lambda () | |
144 | + (local-set-key (kbd "C-c h") | |
145 | + (lambda () | |
146 | + (interactive) | |
147 | + (insert | |
148 | + (ido-completing-read "Eshell history: " | |
149 | + (delete-dups | |
150 | + (ring-elements eshell-history-ring)))))) | |
151 | + (local-set-key (kbd "C-c C-h") 'eshell-list-history) | |
152 | + (local-set-key (kbd "C-c o") 'eshell-show-output))) | |
153 | + | |
154 | +;; Support for Octave/Matlab files | |
155 | +(autoload 'octave-mode "octave") | |
156 | +(add-to-list 'auto-mode-alist '("\\.m$" . octave-mode)) | |
157 | + | |
158 | +;; Makefiles | |
159 | +(add-to-list 'auto-mode-alist '("\\.mak$" . makefile-mode)) | |
160 | + | |
161 | +;; RH850 assembler code | |
162 | +(add-to-list 'auto-mode-alist '("\\.850$" . asm-mode)) | |
163 | + | |
164 | +;;;;;;;;; | |
165 | +;; Add hooks | |
166 | + | |
167 | +(add-hook 'org-mode-hook | |
168 | + (lambda () | |
169 | + (local-set-key (kbd "C-c a") 'org-agenda-file-to-front) | |
170 | + (artbollocks-mode 1) | |
171 | + (abbrev-mode 1))) | |
172 | + | |
173 | +(add-hook 'makefile-mode | |
174 | + (lambda () | |
175 | + (setq indent-tabs-mode t))) ; Use real tabs | |
176 | + | |
177 | +;; Use this hooks to change file mode | |
178 | +(add-hook 'after-save-hook | |
179 | + 'executable-make-buffer-file-executable-if-script-p) | |
180 | + | |
181 | +(add-hook 'python-mode-hook | |
182 | + (lambda () | |
183 | + (local-set-key (kbd "C-c , <return>") 'semantic-complete-inline-done) | |
184 | + (setq python-indent 4) | |
185 | + (whitespace-mode 1) | |
186 | + (setq whitespace-style '(empty | |
187 | + tabs | |
188 | + trailing | |
189 | + indentation::space | |
190 | + space-before-tab::space | |
191 | + space-after-tab::space)))) | |
192 | + | |
193 | +(add-hook 'emacs-lisp-mode-hook | |
194 | + (lambda () | |
195 | + (eldoc-mode 1))) | |
196 | + | |
197 | +(add-hook 'text-mode-hook | |
198 | + (lambda () | |
199 | + (artbollocks-mode 1) | |
200 | + (setq comment-start nil) | |
201 | + (turn-on-auto-fill) | |
202 | + (text-mode-hook-identify))) | |
203 | + | |
204 | + | |
205 | +;; Stop ^M's from displaying in system shell window | |
206 | +(add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m) | |
207 | + | |
208 | +(add-hook 'comint-mode-hook | |
209 | + (lambda() | |
210 | + (setq comint-process-echoes t))) ; This prevents shell commands from being echoed | |
211 | + | |
212 | +(add-hook 'shell-mode-hook | |
213 | + (lambda () | |
214 | + (setq comint-scroll-to-bottom-on-input t) | |
215 | + (setq comint-scroll-to-bottom-on-output t) | |
216 | + (setq comint-scroll-show-maximum-output t) | |
217 | + ;; parse shell output as compilation output please | |
218 | + (compilation-shell-minor-mode))) | |
219 | + | |
220 | +(add-hook 'c-mode-common-hook | |
221 | + (lambda () | |
222 | + (linum-mode 1) | |
223 | + (doxygen-font-lock-mode) | |
224 | + (cwarn-mode 0) | |
225 | + (electric-indent-mode 1) | |
226 | + (c-toggle-auto-newline -1) | |
227 | + (c-toggle-hungry-state -1) | |
228 | + (c-set-offset 'substatement-open '0) | |
229 | + (c-set-offset 'inline-open '+) | |
230 | + (c-set-offset 'block-open '+) | |
231 | + (c-set-offset 'case-label '+) | |
232 | + (c-set-offset 'statement-case-open '+) | |
233 | + (c-set-offset 'brace-list-open '0) | |
234 | + (c-set-offset 'brace-list-entry '0))) | |
235 | + | |
236 | +(add-hook 'align-load-hook | |
237 | + (lambda () | |
238 | + (add-to-list 'align-rules-list | |
239 | + '(c-assignment-1 | |
240 | + (regexp . "[=;]\\(\\s-*\\)") | |
241 | + (modes . '(c-mode)) | |
242 | + (repeat . t))))) | |
243 | + | |
244 | +;; Set indentation style | |
245 | +(setq c-default-style '((c-mode . "k&r") | |
246 | + (other . "k&r"))) | |
247 | + | |
248 | +;; Indenting in C and tab behaviour. Optimized for a tab width of four. | |
249 | +(setq c-basic-offset 4 | |
250 | + tab-width 4 | |
251 | + indent-tabs-mode nil | |
252 | + tab-stop-list '(4 8 12 16 20 24 28 32 36 40)) | |
253 | + | |
254 | +;; remember last point of changed text | |
255 | +(add-to-list 'after-change-functions 'store-last-insertation-point) | |
256 | + | |
257 | +;;;;;;;;;; | |
258 | +;; window move with shift plus cursor arrows | |
259 | +(windmove-default-keybindings) | |
260 | + | |
261 | +;; winner-mode help to undo(C-c <left>) or redo (C-c <right> changes in the | |
262 | +;; window configuration | |
263 | +(winner-mode 1) | |
264 | + | |
265 | +;;;;;;;;;; | |
266 | +;; Aliases | |
267 | +(defalias 'cv 'customize-variable) | |
268 | +(defalias 'cf 'customize-face) | |
269 | +(defalias 'cg 'customize-group) | |
270 | +(defalias 'dcd 'desktop-change-dir) | |
271 | + | |
272 | +;;;;;;;;;; | |
273 | +;; key mappings. First, unbind leader key | |
274 | +(global-unset-key (kbd "<apps>")) | |
275 | + | |
276 | +;; recursive `rgrep' with `default-directory' as root directory | |
277 | +(global-set-key (kbd "<apps> r") 'rgrep) | |
278 | + | |
279 | +;; recursive `rgrep' with `desktop-dirname' as root directory | |
280 | +(global-set-key (kbd "<apps> R") (lambda () | |
281 | + (interactive) | |
282 | + (let ((default-directory desktop-dirname)) | |
283 | + (call-interactively #'rgrep)))) | |
284 | + | |
285 | +;; To maximize speed of a `rgrep' command, don't forget to customize | |
286 | +;; grep-find-ignored-directories and grep-find-ignored-files. | |
287 | +(global-set-key (kbd "<apps> <apps> r") (lambda () | |
288 | + (interactive) | |
289 | + (customize-variable 'grep-find-ignored-directories))) | |
290 | + | |
291 | +;;;;;;; | |
292 | +;; Support functions and key mappings to make life in Emacs easier. | |
293 | +(global-set-key (kbd "<apps> <tab>") 'ff-find-other-file) | |
294 | + | |
295 | +(global-set-key (kbd "<apps> d") (lambda () | |
296 | + (interactive) | |
297 | + (message "desktop location is %s" (file-name-as-directory desktop-dirname)))) | |
298 | + | |
299 | +(global-set-key (kbd "M-#") 'select-region-symbol-line) | |
300 | +(global-set-key (kbd "<apps> e") 'rebuild-etags) | |
301 | +(global-set-key (kbd "<apps> .") 'insert-date) | |
302 | +(global-set-key (kbd "<apps> m") 'quick-multi-occur) | |
303 | +;; align active region. Change `align-rules-list' for your needs- | |
304 | +(global-set-key (kbd "<apps> a") (lambda () | |
305 | + (interactive) | |
306 | + (when (region-active-p) | |
307 | + (align (region-beginning) (region-end))))) | |
308 | + | |
309 | +;;; Look up symbol at point in current buffer. Function uses package hi-lock. To | |
310 | +;;; remove highlighting, press M-s h u or M-x unhighlight-regexp<CR>. | |
311 | +(global-set-key (kbd "<apps> o") (lambda () | |
312 | + (interactive) | |
313 | + (highlight-regexp | |
314 | + (thing-at-point 'symbol) 'match) | |
315 | + (occur (thing-at-point 'symbol)) | |
316 | + (message "Remove highlighting by pressing M-s h u"))) | |
317 | + | |
318 | +(global-set-key (kbd "<apps> p") (lambda () | |
319 | + (interactive) | |
320 | + (if (equal (current-buffer) (get-buffer " SPEEDBAR")) | |
321 | + (other-frame -1) | |
322 | + (if (not (get-buffer " SPEEDBAR")) | |
323 | + (progn | |
324 | + (speedbar 1) | |
325 | + (speedbar-expand-line)) | |
326 | + (switch-to-buffer-other-frame " SPEEDBAR"))))) | |
327 | + | |
328 | + | |
329 | +(global-set-key (kbd "<M-right>") 'quick-search-forward) | |
330 | +(global-set-key (kbd "<M-left>") 'quick-search-backward) | |
331 | + | |
332 | +(global-set-key (kbd "<apps> <DEL>") 'go-back-to-last-insertion-point) | |
333 | + | |
334 | +;; folding aka `selective-display' | |
335 | +(global-set-key (kbd "<apps> z") 'toggle-selective-display) | |
336 | +(global-set-key (kbd "<apps> C-z") 'toggle-selective-display) | |
337 | + | |
338 | +;; show converted numbers | |
339 | +(global-set-key (kbd "M-0") 'print-radix-10-value) | |
340 | +(global-set-key (kbd "M-6") 'print-radix-16-value) | |
341 | + | |
342 | +;; Better support of tags based search with `tags-search' and | |
343 | +;; `tags-loop-continue'. By the way: Do not forget the useful | |
344 | +;; `tags-query-replace' as a LO-Fi-version of code-refactoring. | |
345 | +(global-set-key (kbd "<apps> t") (lambda() | |
346 | + (interactive) | |
347 | + (bookmark-set "point before tags-search" nil) | |
348 | + (tags-search (thing-at-point 'symbol)))) | |
349 | +(global-set-key (kbd "<apps> c") 'tags-loop-continue) | |
350 | + | |
351 | +;;;;;;;;;; | |
352 | +;; Functions keys for quick, 'one-key' access. | |
353 | +;; Browse files and symbols with ido-mode | |
354 | +(global-set-key (kbd "<f1>") 'ido-find-file-in-tag-files) | |
355 | +(global-set-key (kbd "<f2>") 'ido-find-tag) | |
356 | + | |
357 | +;; Key <f3> is reserved to access `kmacro-start-macro-or-insert-counterhk'. | |
358 | +;; Key <f4> is reserved to access `kmacro-end-or-call-macro'. | |
359 | + | |
360 | +(global-set-key (kbd "<f5>") 'ibuffer) | |
361 | +(global-set-key (kbd "<f6>") 'org-todo-list) | |
362 | + | |
363 | +(global-set-key (kbd "<f7>") 'recompile) | |
364 | +(global-set-key (kbd "<C-f7>") 'compile) | |
365 | + | |
366 | +;; customize `grep-command' for your favorite grep tool (GNU global, Cscope, | |
367 | +;; Ripgrep or classic grep with switch -r) | |
368 | +(global-set-key (kbd "<f8>") (lambda () | |
369 | + (interactive) | |
370 | + (let ((default-directory desktop-dirname)) | |
371 | + (grep (concat grep-command " " (thing-at-point 'symbol)))))) | |
372 | + | |
373 | +;; <f10> is used to focus on the menu | |
374 | +(global-set-key (kbd "<f11>") 'toggle-frame-fullscreen) | |
375 | +(global-set-key (kbd "<f12>") 'next-error) | |
376 | +(global-set-key (kbd "<S-f12>") 'previous-error) | |
377 | + | |
378 | +;; A quick access key for my-customs | |
379 | +(global-set-key (kbd "<C-f12>") (lambda () | |
380 | + (interactive) | |
381 | + (customize-group 'my-customs))) | |
382 | + | |
383 | +;; key binding to toggle movement in CamelCase words | |
384 | +(global-set-key (kbd "<apps> s") 'global-subword-mode) | |
385 | + | |
386 | +(global-set-key (kbd "C-S-j") 'join-line) | |
387 | +(global-set-key (kbd "C-S-<left>") 'beginning-of-line-text) | |
388 | + | |
389 | +;; Scroll the view port | |
390 | +(global-set-key (kbd "<C-up>") (lambda() | |
391 | + (interactive) | |
392 | + (scroll-down 1))) | |
393 | +(global-set-key (kbd "<C-down>") (lambda() | |
394 | + (interactive) | |
395 | + (scroll-up 1))) | |
396 | + | |
397 | +(global-set-key (kbd "M-<up>") 'backward-paragraph) | |
398 | +(global-set-key (kbd "M-<down>") 'forward-paragraph) | |
399 | + | |
400 | +;; text completion | |
401 | +(global-set-key (kbd "<C-tab>") 'hippie-expand) | |
402 | + | |
403 | +(global-set-key (kbd "<apps> i") 'show-dir-info) | |
404 | + | |
405 | +(global-set-key (kbd "<home>") 'cycle-bti-bol) | |
406 | + | |
407 | +;; Indent and outdent active region | |
408 | +(global-set-key (kbd "<apps> <left>") (lambda (p1 p2) | |
409 | + (interactive "r") | |
410 | + (indent-rigidly-left-to-tab-stop p1 p2))) | |
411 | +(global-set-key (kbd "<apps> <right>") (lambda (p1 p2) | |
412 | + (interactive "r") | |
413 | + (indent-rigidly-right-to-tab-stop p1 p2))) | |
414 | + | |
415 | +;; Resize current window in vertical and horizontal dimension | |
416 | +(global-set-key (kbd "C-M--") (lambda () | |
417 | + (interactive) | |
418 | + (when (> (window-width) 40) | |
419 | + (shrink-window-horizontally 3) | |
420 | + (when (> (window-height) 20) | |
421 | + (shrink-window 5))))) | |
422 | +(global-set-key (kbd "C-M-+") (lambda () | |
423 | + (interactive) | |
424 | + (enlarge-window-horizontally 3) | |
425 | + (enlarge-window 5))) | |
426 | + | |
427 | +;; Bring back some important buffers | |
428 | +(global-set-key (kbd "<apps> b c") (lambda () | |
429 | + (interactive) | |
430 | + (pop-to-buffer "*compilation*"))) | |
431 | +(global-set-key (kbd "<apps> b g") (lambda () | |
432 | + (interactive) | |
433 | + (pop-to-buffer "*grep*"))) | |
434 | +(global-set-key (kbd "<apps> b o") (lambda () | |
435 | + (interactive) | |
436 | + (pop-to-buffer "*Occur*"))) | |
437 | + | |
438 | +;;;;;;;;;; | |
439 | +;; Some fancy stuff | |
440 | +(if window-system | |
441 | + (progn | |
442 | + ;; Start the server. If a server is already running, restart it. | |
443 | + (server-start) | |
444 | + ;; Menu bar, please. | |
445 | + (menu-bar-mode 1)) | |
446 | + ;; No GUI, no menus! | |
447 | + (menu-bar-mode -1)) | |
448 | + | |
449 | +;;;;;;;;;; | |
450 | +;; Test available ELPA packages | |
451 | +(add-hook 'after-init-hook | |
452 | + (lambda () | |
453 | + (when (fboundp 'defhydra) | |
454 | + ;; taken from https://killring.org/2016/09/16/emacs-hydra-for-fun-and-profit/ | |
455 | + (defhydra hydra-window (:color red :hint nil) | |
456 | + "One key surfing:" | |
457 | + ("o" other-window "other window") | |
458 | + ("n" next-error "next error") | |
459 | + ("p" previous-error "previous error") | |
460 | + ("q" nil "cancel")) | |
461 | + (defun one-key-surfer () | |
462 | + (interactive) | |
463 | + (hydra-window/body)) | |
464 | + (global-set-key (kbd "C-#") 'one-key-surfer)) | |
465 | + (when (fboundp 'swiper) | |
466 | + (global-set-key (kbd "<C-apps>") 'swiper)))) | |
467 | + | |
468 | +;;;;;;;;;; | |
469 | +;; Set property values. | |
470 | +;; Enable upper-case (C-x C-u) or lower-case (C-x C-l) conversions | |
471 | +(put 'downcase-region 'disabled nil) | |
472 | +(put 'upcase-region 'disabled nil) | |
473 | +;; Enable goal-column. Can be used by C-x C-n and left by C-u C-x C-n | |
474 | +(put 'set-goal-column 'disabled nil) | |
475 | +(put 'narrow-to-region 'disabled nil) | |
476 | +(put 'scroll-left 'disabled nil) |
@@ -0,0 +1,38 @@ | ||
1 | +;;; autoloads-modes.el --- automatically extracted autoloads | |
2 | +;; | |
3 | +;;; Code: | |
4 | + | |
5 | + | |
6 | +;;;### (autoloads nil "ripgrep" "ripgrep.el" (22734 57018 0 0)) | |
7 | +;;; Generated autoloads from ripgrep.el | |
8 | + | |
9 | +(autoload 'ripgrep-regexp "ripgrep" "\ | |
10 | +Run a ripgrep search with `REGEXP' rooted at `DIRECTORY'. | |
11 | +`ARGS' provides Ripgrep command line arguments. | |
12 | + | |
13 | +\(fn REGEXP DIRECTORY &optional ARGS)" t nil) | |
14 | + | |
15 | +;;;*** | |
16 | + | |
17 | +;;;### (autoloads nil "srec-mode" "srec-mode.el" (22728 15612 0 0)) | |
18 | +;;; Generated autoloads from srec-mode.el | |
19 | + | |
20 | +(autoload 'srec-mode "srec-mode" "\ | |
21 | +A major mode for editing Motorola S-format Record files. Runs `srec-mode-hook'. | |
22 | + | |
23 | +\(fn)" t nil) | |
24 | + | |
25 | +;;;*** | |
26 | + | |
27 | +;;;### (autoloads nil nil ("loaddefs-modes.el") (22767 55776 0 0)) | |
28 | + | |
29 | +;;;*** | |
30 | + | |
31 | +(provide 'autoloads-modes) | |
32 | +;; Local Variables: | |
33 | +;; version-control: never | |
34 | +;; no-byte-compile: t | |
35 | +;; no-update-autoloads: t | |
36 | +;; coding: utf-8 | |
37 | +;; End: | |
38 | +;;; autoloads-modes.el ends here |
@@ -0,0 +1,204 @@ | ||
1 | +;;; ripgrep.el --- Front-end for ripgrep, a command line search tool | |
2 | + | |
3 | +;; Copyright (C) 2016 Nicolas Lamirault <nicolas.lamirault@gmail.com> | |
4 | +;; | |
5 | +;; Author: Nicolas Lamirault <nicolas.lamirault@gmail.com> | |
6 | +;; Version: 0.4.0 | |
7 | +;; Package-Version: 0.4.0 | |
8 | +;; Keywords : ripgrep ack pt ag sift grep search | |
9 | +;; Homepage: https://github.com/nlamirault/ripgrep.el | |
10 | + | |
11 | +;; Modifications in base version 0.4.0: | |
12 | +;; Author: Markus Prepens <markus.prepens@gmail.com> | |
13 | + | |
14 | +;; Description: ripgrep-regexp makes no use of prefix arguments: Any prefix | |
15 | +;; argument runs Ripgrep interactive, presets current buffers default-directory | |
16 | +;; and symbol at point. No prefix argument uses desktop-dirname and current | |
17 | +;; symbol at point without further interaction. If desktop-dirname is nil, run | |
18 | +;; Ripgrep from default-directory. | |
19 | + | |
20 | +;;; Commentary: | |
21 | + | |
22 | +;; Emacs front-end for ripgrep, a command line search tool | |
23 | + | |
24 | +;; Installation: | |
25 | + | |
26 | +;; ripgrep.el is available on the two major community maintained repositories | |
27 | +;; Melpa stable (https://stable.melpa.org), and Melpa (https://melpa.org) | |
28 | +;; | |
29 | +;; (add-to-list 'package-archives | |
30 | +;; '("melpa" . "https://melpa.org/packages/") t) | |
31 | +;; | |
32 | +;; M-x package-install ripgrep | |
33 | + | |
34 | +;;; License: | |
35 | + | |
36 | +;; This program is free software; you can redistribute it and/or | |
37 | +;; modify it under the terms of the GNU General Public License | |
38 | +;; as published by the Free Software Foundation; either version 2 | |
39 | +;; of the License, or (at your option) any later version. | |
40 | + | |
41 | +;; This program is distributed in the hope that it will be useful, | |
42 | +;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
43 | +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
44 | +;; GNU General Public License for more details. | |
45 | + | |
46 | +;; You should have received a copy of the GNU General Public License | |
47 | +;; along with this program; if not, write to the Free Software | |
48 | +;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | |
49 | +;; 02110-1301, USA. | |
50 | + | |
51 | +;;; Commentary: | |
52 | + | |
53 | +;; Usage : | |
54 | + | |
55 | +;; M-x ripgrep-regexp | |
56 | + | |
57 | +;;; Code: | |
58 | + | |
59 | +(require 'compile) | |
60 | +(require 'grep) | |
61 | +(require 'thingatpt) | |
62 | + | |
63 | + | |
64 | +;; Customization | |
65 | +;; -------------------------- | |
66 | + | |
67 | +(defgroup ripgrep nil | |
68 | + "Ripgrep" | |
69 | + :group 'tools | |
70 | + :group 'matching) | |
71 | + | |
72 | + | |
73 | +(defcustom ripgrep-executable | |
74 | + "rg" | |
75 | + "Name of the ripgrep executable to use." | |
76 | + :type 'string | |
77 | + :group 'ripgrep) | |
78 | + | |
79 | + | |
80 | +(defcustom ripgrep-arguments | |
81 | + (list "") | |
82 | + "Default arguments passed to ripgrep." | |
83 | + :type '(repeat (string)) | |
84 | + :group 'ripgrep) | |
85 | + | |
86 | + | |
87 | +(defcustom ripgrep-highlight-search t | |
88 | + "Non-nil means we highlight the current search term in results. | |
89 | +This requires the ripgrep command to support --color-match, which is only in v0.14+" | |
90 | + :type 'boolean | |
91 | + :group 'ripgrep) | |
92 | + | |
93 | + | |
94 | +;; Faces | |
95 | +;; -------------------------- | |
96 | + | |
97 | + | |
98 | +(defface ripgrep-hit-face '((t :inherit compilation-info)) | |
99 | + "Face name to use for ripgrep matches." | |
100 | + :group 'ripgrep) | |
101 | + | |
102 | + | |
103 | +(defface ripgrep-match-face '((t :inherit match)) | |
104 | + "Face name to use for ripgrep matches." | |
105 | + :group 'ripgrep) | |
106 | + | |
107 | + | |
108 | + | |
109 | +;; Mode | |
110 | +;; -------------------------- | |
111 | + | |
112 | + | |
113 | +(defvar ripgrep-search-finished-hook nil | |
114 | + "Hook run when ripgrep completes a search in a buffer.") | |
115 | + | |
116 | +(defun ripgrep/run-finished-hook (buffer how-finished) | |
117 | + "Run the ripgrep hook to signal that the search has completed." | |
118 | + (with-current-buffer buffer | |
119 | + (run-hooks 'ripgrep-search-finished-hook))) | |
120 | + | |
121 | +(defvar ripgrep-search-mode-map | |
122 | + (let ((map (make-sparse-keymap))) | |
123 | + (set-keymap-parent map compilation-minor-mode-map) | |
124 | + (define-key map "p" 'compilation-previous-error) | |
125 | + (define-key map "n" 'compilation-next-error) | |
126 | + (define-key map "{" 'compilation-previous-file) | |
127 | + (define-key map "}" 'compilation-next-file) | |
128 | + (define-key map "k" '(lambda () | |
129 | + (interactive) | |
130 | + (let ((kill-buffer-query-functions)) | |
131 | + (kill-buffer)))) | |
132 | + map) | |
133 | + "Keymap for ripgrep-search buffers. | |
134 | +`compilation-minor-mode-map' is a cdr of this.") | |
135 | + | |
136 | + | |
137 | +(define-compilation-mode ripgrep-search-mode "Ripgrep" | |
138 | + "Ripgrep results compilation mode" | |
139 | + (set (make-local-variable 'truncate-lines) t) | |
140 | + (set (make-local-variable 'compilation-disable-input) t) | |
141 | + (set (make-local-variable 'compilation-scroll-output) nil) | |
142 | + (set (make-local-variable 'tool-bar-map) grep-mode-tool-bar-map) | |
143 | + (let ((symbol 'compilation-ripgrep) | |
144 | + (pattern '("^\\([^:\n]+?\\):\\([0-9]+\\):\\([0-9]+\\):" 1 2 3))) | |
145 | + (set (make-local-variable 'compilation-error-regexp-alist) (list symbol)) | |
146 | + (set (make-local-variable 'compilation-error-regexp-alist-alist) (list (cons symbol pattern)))) | |
147 | + (set (make-local-variable 'compilation-error-face) 'ripgrep-hit-face) | |
148 | + (add-hook 'compilation-filter-hook 'ripgrep-filter nil t)) | |
149 | + | |
150 | + | |
151 | +;; Taken from grep-filter, just changed the color regex. | |
152 | +(defun ripgrep-filter () | |
153 | + "Handle match highlighting escape sequences inserted by the rg process. | |
154 | +This function is called from `compilation-filter-hook'." | |
155 | + (when ripgrep-highlight-search | |
156 | + (save-excursion | |
157 | + (forward-line 0) | |
158 | + (let ((end (point)) beg) | |
159 | + (goto-char compilation-filter-start) | |
160 | + (forward-line 0) | |
161 | + (setq beg (point)) | |
162 | + ;; Only operate on whole lines so we don't get caught with part of an | |
163 | + ;; escape sequence in one chunk and the rest in another. | |
164 | + (when (< (point) end) | |
165 | + (setq end (copy-marker end)) | |
166 | + ;; Highlight rg matches and delete marking sequences. | |
167 | + (while (re-search-forward "\033\\[30;43m\\(.*?\\)\033\\[[0-9]*m" end 1) | |
168 | + (replace-match (propertize (match-string 1) | |
169 | + 'face nil 'font-lock-face 'ripgrep-match-face) | |
170 | + t t)) | |
171 | + ;; Delete all remaining escape sequences | |
172 | + (goto-char beg) | |
173 | + (while (re-search-forward "\033\\[[0-9;]*[mK]" end 1) | |
174 | + (replace-match "" t t))))))) | |
175 | + | |
176 | + | |
177 | + | |
178 | +;; API | |
179 | +;; -------------------------- | |
180 | + | |
181 | + | |
182 | +;;;###autoload | |
183 | +(defun ripgrep-regexp (regexp directory &optional args) | |
184 | + "Run a ripgrep search with `REGEXP' rooted at `DIRECTORY'. | |
185 | +`ARGS' provides Ripgrep command line arguments." | |
186 | + (interactive | |
187 | + (if (and current-prefix-arg (boundp 'desktop-dirname)) | |
188 | + (list (read-from-minibuffer "Ripgrep search for: " (thing-at-point 'symbol)) | |
189 | + (read-directory-name "Directory: " default-directory)) | |
190 | + (list (thing-at-point 'symbol) | |
191 | + desktop-dirname))) | |
192 | + (let ((default-directory directory)) | |
193 | + (compilation-start | |
194 | + (mapconcat 'identity | |
195 | + (append (list ripgrep-executable) | |
196 | + ripgrep-arguments | |
197 | + args | |
198 | + '("--no-heading --vimgrep") | |
199 | + (list (shell-quote-argument regexp) ".")) " ") | |
200 | + 'ripgrep-search-mode))) | |
201 | + | |
202 | + | |
203 | +(provide 'ripgrep) | |
204 | +;;; ripgrep.el ends here |
@@ -0,0 +1,263 @@ | ||
1 | +;;; srec-mode.el --- Major Mode for Motorola S-format record files | |
2 | + | |
3 | +;; Copyright (C) 2003 Dast <dast@freeshell.org> | |
4 | + | |
5 | +;; Author: Dast <dast@freeshell.org> | |
6 | +;; Keywords: files, data, hardware, tools | |
7 | +;; URL: http://dast.freeshell.org/section/emacs/elisp | |
8 | +;; Version: 1.0 | |
9 | + | |
10 | +;; This file is free software; you can redistribute it and/or modify | |
11 | +;; it under the terms of the GNU General Public License as published by | |
12 | +;; the Free Software Foundation; either version 2, or (at your option) | |
13 | +;; any later version. | |
14 | + | |
15 | +;; This file is distributed in the hope that it will be useful, | |
16 | +;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | +;; GNU General Public License for more details. | |
19 | + | |
20 | +;; You should have received a copy of the GNU General Public License | |
21 | +;; along with GNU Emacs; see the file COPYING. If not, write to | |
22 | +;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
23 | +;; Boston, MA 02111-1307, USA. | |
24 | + | |
25 | +;;; Commentary: | |
26 | + | |
27 | +;; This file provides a mode for viewing Motorola S-Record formatted | |
28 | +;; files. The format is designed to allow printable ASCII | |
29 | +;; representations of program or data files to be loaded on various | |
30 | +;; hardware platforms. Each line is a record with a specific format. | |
31 | +;; Details on the S-Record format can be found at the following | |
32 | +;; locations. It has been modified to allow records to start with | |
33 | +;; either the letter S or T, upper or lower case. | |
34 | + | |
35 | +;; http://www.cs.net/lucid/moto.htm | |
36 | +;; http://www.compusmart.ab.ca/rc/TechTips/srecords.html | |
37 | +;; http://www.amelek.gda.pl/avr/uisp/srecord.htm | |
38 | + | |
39 | +;; To use this file, make sure you put it in your load-path. Then you | |
40 | +;; can put the following line in your .emacs file. | |
41 | + | |
42 | +;; (require 'srec-mode) | |
43 | + | |
44 | +;; This file does not modify auto-mode-alist to load the mode | |
45 | +;; automatically. You may wish to set it to load for appropriate file | |
46 | +;; extensions. | |
47 | + | |
48 | +;; Tested with GNU Emacs 21.2.1 on Win32. | |
49 | + | |
50 | +;; You can find this file at | |
51 | +;; http://dast.freeshell.org/section/emacs/elisp | |
52 | + | |
53 | +;;; Code: | |
54 | + | |
55 | +(defgroup srec () | |
56 | + "Mororola S Record file group" | |
57 | + :group 'languages) | |
58 | + | |
59 | +(defface srec-mode-type-face | |
60 | + '((t (:inherit font-lock-type-face))) | |
61 | + "Bold cyan" | |
62 | + :group 'srec) | |
63 | + | |
64 | +(defface srec-mode-length-face | |
65 | + '((t (:inherit font-lock-variable-name-face))) | |
66 | + "Aquamarine" | |
67 | + :group 'srec) | |
68 | + | |
69 | +(defface srec-mode-addr-face | |
70 | + '((t (:inherit font-lock-keyword-face))) | |
71 | + "Light Salmon" | |
72 | + :group 'srec) | |
73 | + | |
74 | +(defface srec-mode-misc-face | |
75 | + '((t (:inherit font-lock-doc-face))) | |
76 | + "Orchid1" | |
77 | + :group 'srec) | |
78 | + | |
79 | +(defface srec-mode-checksum-face | |
80 | + '((t (:inherit font-lock-comment-face))) | |
81 | + "yellow" | |
82 | + :group 'srec) | |
83 | + | |
84 | +(defface srec-mode-error-face | |
85 | + '((t (:inherit show-paren-mismatch))) | |
86 | + "red") | |
87 | + | |
88 | +(defcustom srec-mode-hook nil | |
89 | + "Normal hook run by `srec-mode'." | |
90 | + :type 'hook | |
91 | + :group 'srec) | |
92 | + | |
93 | +(defcustom srec-mode-check-s0-len nil | |
94 | + "If nil, do not check the length of S0 records, otherwise check them." | |
95 | + :type 'boolean | |
96 | + :group 'srec) | |
97 | + | |
98 | +(defvar srec-font-lock-keywords | |
99 | + '( | |
100 | + ;; bad records | |
101 | + ("^[^SsT].*$" | |
102 | + . 'srec-mode-error-face) ;anything that doesn't begin with an S or a T | |
103 | + ("^[SsT].*[^[:xdigit:]\n].*$" | |
104 | + . 'srec-mode-error-face) ;anything that begins with an S or a T but has non hex digits | |
105 | + | |
106 | + ;; S0 records | |
107 | + ("^\\([SsT]0\\)\\([[:xdigit:]]\\{2\\}\\)\\(.*\\)\\([[:xdigit:]]\\{2\\}\\)$" | |
108 | + . ((1 'srec-mode-type-face) (2 'srec-mode-length-face) (3 'srec-mode-misc-face) (4 'srec-mode-checksum-face))) | |
109 | + | |
110 | + ;; data records | |
111 | + ("^\\([SsT]1\\)\\([[:xdigit:]]\\{2\\}\\)\\([[:xdigit:]]\\{4\\}\\)[[:xdigit:]]\\{0,504\\}\\([[:xdigit:]]\\{2\\}\\)$" | |
112 | + . ((1 'srec-mode-type-face) (2 'srec-mode-length-face) (3 'srec-mode-addr-face) (4 'srec-mode-checksum-face))) | |
113 | + ("^\\([SsT]2\\)\\([[:xdigit:]]\\{2\\}\\)\\([[:xdigit:]]\\{6\\}\\)[[:xdigit:]]\\{0,502\\}\\([[:xdigit:]]\\{2\\}\\)$" | |
114 | + . ((1 'srec-mode-type-face) (2 'srec-mode-length-face) (3 'srec-mode-addr-face) (4 'srec-mode-checksum-face))) | |
115 | + ("^\\([SsT]3\\)\\([[:xdigit:]]\\{2\\}\\)\\([[:xdigit:]]\\{8\\}\\)[[:xdigit:]]\\{0,500\\}\\([[:xdigit:]]\\{2\\}\\)$" | |
116 | + . ((1 'srec-mode-type-face) (2 'srec-mode-length-face) (3 'srec-mode-addr-face) (4 'srec-mode-checksum-face))) | |
117 | + | |
118 | + ;; terminator record with optional starting execution address, must be the last in the file? | |
119 | + ;; ("^\\([SsT]7\\)\\([[:xdigit:]]\\{2\\}\\)\\([[:xdigit:]]\\{8\\}\\)\\([[:xdigit:]]\\{2\\}\\)$" . ((1 'srec-mode-type-face) (2 'srec-mode-length-face) (3 'srec-mode-addr-face) (4 'srec-mode-checksum-face))) | |
120 | + ;; ("^\\([SsT]8\\)\\([[:xdigit:]]\\{2\\}\\)\\([[:xdigit:]]\\{6\\}\\)\\([[:xdigit:]]\\{2\\}\\)$" . ((1 'srec-mode-type-face) (2 'srec-mode-length-face) (3 'srec-mode-addr-face) (4 'srec-mode-checksum-face))) | |
121 | + ;; ("^\\([SsT]9\\)\\([[:xdigit:]]\\{2\\}\\)\\([[:xdigit:]]\\{4\\}\\)\\([[:xdigit:]]\\{2\\}\\)$" . ((1 'srec-mode-type-face) (2 'srec-mode-length-face) (3 'srec-mode-addr-face) (4 'srec-mode-checksum-face))) | |
122 | + | |
123 | + ;; hardcoded lengths | |
124 | + ("^\\([SsT]7\\)\\(05\\)\\([[:xdigit:]]\\{8\\}\\)\\([[:xdigit:]]\\{2\\}\\)$" | |
125 | + . ((1 'srec-mode-type-face) (2 'srec-mode-length-face) (3 'srec-mode-addr-face) (4 'srec-mode-checksum-face))) | |
126 | + ("^\\([SsT]8\\)\\(04\\)\\([[:xdigit:]]\\{6\\}\\)\\([[:xdigit:]]\\{2\\}\\)$" | |
127 | + . ((1 'srec-mode-type-face) (2 'srec-mode-length-face) (3 'srec-mode-addr-face) (4 'srec-mode-checksum-face))) | |
128 | + ("^\\([SsT]9\\)\\(03\\)\\([[:xdigit:]]\\{4\\}\\)\\([[:xdigit:]]\\{2\\}\\)$" | |
129 | + . ((1 'srec-mode-type-face) (2 'srec-mode-length-face) (3 'srec-mode-addr-face) (4 'srec-mode-checksum-face)))) | |
130 | + "Keyword highlighting specification for `srec-mode'.") | |
131 | + | |
132 | +;;;###autoload | |
133 | +(define-derived-mode srec-mode fundamental-mode "SREC" | |
134 | + "A major mode for editing Motorola S-format Record files. Runs `srec-mode-hook'." | |
135 | + (set (make-local-variable 'font-lock-defaults) | |
136 | + '(srec-font-lock-keywords)) | |
137 | + (toggle-truncate-lines) | |
138 | + (local-set-key [menu-bar srec] (cons "SREC" (make-sparse-keymap "SREC"))) | |
139 | + (local-set-key [menu-bar srec check] '("Check Buffer Format" . srec-check-buffer)) | |
140 | + (local-set-key [menu-bar srec process] '("Process S2 Records" . srec-process-buffer)) | |
141 | + (local-set-key [menu-bar srec consec] '("Consecutive S2 Ranges" . srec-consecutive-ranges)) | |
142 | + ;;(define-key srec-mode-map [menu-bar srec check] '("Check Buffer Format" . srec-check-buffer)) | |
143 | + (run-hooks 'srec-mode-hook)) | |
144 | + | |
145 | + | |
146 | +(defun srec-check-region (beg end) | |
147 | + "Check all of the S records in the given region." | |
148 | + (interactive "r") | |
149 | + (goto-char beg) | |
150 | + (while (and | |
151 | + (<= (point) end) | |
152 | + (re-search-forward "^\\([SsT]\\([0-9]\\)\\(\\([[:xdigit:]]\\{2\\}\\)[[:xdigit:]]*\\)\\([[:xdigit:]]\\{2\\}\\)\\)$" nil t)) | |
153 | + (let ( (line (match-string-no-properties 1)) | |
154 | + (type (match-string-no-properties 2)) | |
155 | + (cblk (match-string-no-properties 3)) | |
156 | + (leng (match-string-no-properties 4)) | |
157 | + (csum (match-string-no-properties 5))) | |
158 | + ;; highlight bad lengths in yellow, bad checksums in blue | |
159 | + (if (and | |
160 | + (or (not (string= type "0")) srec-mode-check-s0-len) | |
161 | + (not (srec-good-len-p cblk leng))) | |
162 | + (highlight-phrase line "hi-yellow") ; highlight entire line | |
163 | + (if (not (srec-good-sum-p cblk csum)) | |
164 | + (highlight-phrase line "hi-blue")))) ; highlight entire line | |
165 | + (forward-line))) | |
166 | + | |
167 | +(defun srec-check-buffer () | |
168 | + "Check all of the S records in the given buffer." | |
169 | + (interactive) | |
170 | + (save-excursion | |
171 | + (srec-check-region (point-min) (point-max)) | |
172 | + (princ "All done!\n"))) | |
173 | + | |
174 | +(defun srec-good-sum-p (cblk csum) | |
175 | + "Check the checksum in an S record." | |
176 | + (let ((index 0) | |
177 | + (num 0) | |
178 | + (asum 0)) | |
179 | + ;; calculate the checksum | |
180 | + (while (setq index (string-match "\\([[:xdigit:]]\\{2\\}\\)" cblk index)) | |
181 | + (setq index (+ index 2)) ; 2 is the length of the match data | |
182 | + (setq asum (+ asum (number-to-decimal (match-string 1 cblk) 16)))) | |
183 | + ;; compare the calculated checksum against the checksum field | |
184 | + ;; logxor to do ones compliment, logand to get least significant bits | |
185 | + (= (logand 255 (logxor asum 255)) (number-to-decimal csum 16)))) | |
186 | + | |
187 | + | |
188 | +(defun srec-good-len-p (cblk leng) | |
189 | + "Check the length of an S record." | |
190 | + ;; (length of cblk) == (leng field in decimal * 2) | |
191 | + (= (length cblk) (* 2 (string-to-number leng 16)))) | |
192 | + | |
193 | + | |
194 | +(defun srec-process-region (beg end) | |
195 | + "Process all of the S2 records in the given region." | |
196 | + (interactive "r") | |
197 | + (goto-char beg) | |
198 | + (with-output-to-temp-buffer "*Processed S2 Records*" | |
199 | + (while (and | |
200 | + (<= (point) end) | |
201 | + (re-search-forward "^[SsT]2[[:xdigit:]]\\{2\\}\\([[:xdigit:]]\\{6\\}\\)\\([[:xdigit:]]*\\)[[:xdigit:]]\\{2\\}$" nil t)) | |
202 | + (let ( (addr (match-string-no-properties 1)) | |
203 | + (blk (match-string-no-properties 2)) | |
204 | + (index 0) | |
205 | + (byte) | |
206 | + (line "")) | |
207 | + (princ (format "0x%s : " addr)) | |
208 | + | |
209 | + (while (setq index (string-match "\\([[:xdigit:]]\\{2\\}\\)" blk index)) | |
210 | + (setq index (+ index 2)) ; 2 is the length of the match data | |
211 | + (setq byte (format "%c" (string-to-number (match-string 1 blk) 16))) | |
212 | + (if (string-match "\\([^[:print:]]\\)" byte 0) | |
213 | + (setq byte ".")) | |
214 | + (setq line (concat line byte))) | |
215 | + (princ (format "%s\n" line))))) | |
216 | + (save-current-buffer | |
217 | + (set-buffer "*Processed S2 Records*") | |
218 | + (toggle-truncate-lines))) | |
219 | + | |
220 | +(defun srec-process-buffer () | |
221 | + "Process all of the S2 records in the given buffer." | |
222 | + (interactive) | |
223 | + (save-excursion | |
224 | + (srec-process-region (point-min) (point-max)))) | |
225 | + | |
226 | +(defun srec-consecutive-ranges () | |
227 | + "Find all consecutive ranges of S2 records in the given buffer" | |
228 | + (interactive) | |
229 | + | |
230 | + (save-excursion | |
231 | + (goto-char (point-min)) | |
232 | + (with-output-to-temp-buffer "*Consecutive S2 Record Ranges*" | |
233 | + (re-search-forward "^[SsT]2\\([[:xdigit:]]\\{2\\}\\)\\([[:xdigit:]]\\{6\\}\\)[[:xdigit:]]*[[:xdigit:]]\\{2\\}$" nil t) | |
234 | + ;; subtract 4 from the length to get rid of 3 character pairs for the address and 1 character pair for the checksum | |
235 | + (let ( (prev-leng (- (string-to-number (match-string-no-properties 1) 16) 4)) | |
236 | + (prev-addr (match-string-no-properties 2)) ) | |
237 | + | |
238 | + (setq prev-addr-num (string-to-number prev-addr 16)) | |
239 | + (setq prev-end-addr (+ prev-addr-num prev-leng)) | |
240 | + | |
241 | + ;; we begin at the first address we find | |
242 | + (princ (format "%s - " prev-addr)) | |
243 | + | |
244 | + (while (re-search-forward "^[SsT]2\\([[:xdigit:]]\\{2\\}\\)\\([[:xdigit:]]\\{6\\}\\)[[:xdigit:]]*[[:xdigit:]]\\{2\\}$" nil t) | |
245 | + ;; subtract 4 from the length to get rid of 3 character pairs for the address and 1 character pair for the checksum | |
246 | + (let ( (leng (- (string-to-number (match-string-no-properties 1) 16) 4)) | |
247 | + (addr (match-string-no-properties 2)) ) | |
248 | + | |
249 | + (setq addr-num (string-to-number addr 16)) | |
250 | + (setq end-addr (+ addr-num leng)) | |
251 | + | |
252 | + ;; if we don't begin at the end of the previous record | |
253 | + ;; (princ (format "Addr: %d\tPrev Addr: %d\n" addr-num prev-end-addr)) | |
254 | + (if (/= addr-num prev-end-addr) | |
255 | + ;; then we have a new range | |
256 | + ;; (princ (format "0%s\n%s - " (upcase (decimal-to-number prev-end-addr 16)) addr)) | |
257 | + (princ (format "0%X\n%s - " prev-end-addr addr))) | |
258 | + (setq prev-end-addr end-addr))) ; end while | |
259 | + ;; (princ (format "0%s\n" (upcase (decimal-to-number prev-end-addr 16)))) | |
260 | + (princ (format "0%X\n" prev-end-addr)))))) | |
261 | + | |
262 | +(provide 'srec-mode) | |
263 | +;;; srec-mode.el ends here |
@@ -0,0 +1,114 @@ | ||
1 | +(deftheme angry-bee | |
2 | + "My color theme with dark background.") | |
3 | + | |
4 | +(custom-theme-set-variables | |
5 | + 'angry-bee) | |
6 | + | |
7 | +(custom-theme-set-faces | |
8 | + 'angry-bee | |
9 | + | |
10 | + ;; basics | |
11 | + '(default ((t (:inherit nil :stipple nil :background "grey12" :foreground "azure3" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :foundry "outline")))) | |
12 | + '(region ((t (:foreground "white" :background "deepskyblue3")))) | |
13 | + '(mode-line ((t (:box (:line-width 1 :color "lightblue2" :style none) :foreground "black" :background "lightblue2")))) | |
14 | + '(mode-line-inactive ((t (:box (:line-width 1 :color "grey45" :style none) :foreground "grey60" :background "grey15")))) | |
15 | + | |
16 | + ;; decoration | |
17 | + '(fringe ((t (:inherit default)))) | |
18 | + '(underline ((((supports :underline t)) (:underline "grey35")))) | |
19 | + '(cursor ((t (:background "yellow" :foreground "white")))) | |
20 | + '(hl-line ((t (:inherit t :background "grey22")))) | |
21 | + '(linum ((t (:weight bold :slant normal :foreground "coral4" :background "grey17")))) | |
22 | + '(border ((t (:inherit default)))) | |
23 | + '(highlight ((t (:foreground "white" :background "grey40")))) | |
24 | + | |
25 | + ;; prompt | |
26 | + '(minibuffer-prompt ((t (:weight bold :foreground "yellow2")))) | |
27 | + '(eshell-prompt ((t (:inherit default :foreground "yellow3")))) | |
28 | + '(comint-highlight-prompt ((t (:inherit default :foreground "yellow3")))) | |
29 | + | |
30 | + ;; search | |
31 | + '(isearch ((t (:foreground "yellow" :background "gold3" :weight bold)))) | |
32 | + '(lazy-highlight ((t (:underline "gold3")))) | |
33 | + '(isearch-fail ((t (:foreground "coral1" :underline "coral3")))) | |
34 | + '(match ((t (:underline "white")))) | |
35 | + '(show-paren-match ((t (:underline "gold2")))) | |
36 | + '(show-paren-mismatch ((t (:underline "coral1")))) | |
37 | + '(hi-blue ((t (:inherit default :underline "cornflowerblue")))) | |
38 | + '(hi-green ((t (:inherit default :underline "limegreen")))) | |
39 | + '(hi-pink ((t (:inherit default :underline "hotpink")))) | |
40 | + '(hi-red ((t (:inherit default :underline "coral")))) | |
41 | + '(hi-yellow ((t (:inherit default :underline "yellow3")))) | |
42 | + | |
43 | + ;; compilation | |
44 | + '(compilation-error ((t (:foreground "skyblue3")))) | |
45 | + '(compilation-line-number ((t (:foreground "skyblue1" :weight bold :underline "skyblue4")))) | |
46 | + '(compilation-column-number ((t (:foreground "skyblue1" :weight bold :underline "skyblue4")))) | |
47 | + '(compilation-info ((t (:foreground "deepskyblue1" :underline "skyblue4")))) | |
48 | + | |
49 | + ;; Faces | |
50 | + '(font-lock-warning-face ((t (:foreground "yellow1" :underline "yellow3")))) | |
51 | + '(font-lock-builtin-face ((t (:foreground "cyan3")))) | |
52 | + '(font-lock-doc-face ((t (:foreground "limegreen" :slant italic)))) | |
53 | + '(font-lock-comment-face ((t (:foreground "grey60" :slant normal)))) | |
54 | + '(font-lock-comment-delimiter-face ((t (:foreground "grey40" :weight bold)))) | |
55 | + '(font-lock-preprocessor-face ((t (:foreground "white" :bold t)))) | |
56 | + '(font-lock-constant-face ((t (:foreground "yellow2")))) | |
57 | + '(font-lock-string-face ((t (:foreground "yellow2")))) | |
58 | + '(font-lock-keyword-face ((t (:foreground "deepskyblue3" :weight bold)))) | |
59 | + '(font-lock-type-face ((t (:foreground "cornflowerblue" :slant italic)))) | |
60 | + '(font-lock-variable-name-face ((t (:foreground "yellow1")))) | |
61 | + '(font-lock-function-name-face ((t (:foreground "yellow1" :weight bold)))) | |
62 | + '(sh-quoted-exec ((t (:foreground "gray" :slant italic)))) | |
63 | + | |
64 | + ;; org/calendar/diary | |
65 | + '(org-done ((t (:foreground "green2")))) | |
66 | + '(org-todo ((t (:foreground "yellow2")))) | |
67 | + '(org-level-1 ((t (:inherit default :foreground "cyan1" :height 1.2 :weight bold)))) | |
68 | + '(org-level-2 ((t (:inherit default :foreground "cyan2" :height 1.1 :weight bold)))) | |
69 | + '(org-level-3 ((t (:inherit default :foreground "cyan2" :height 1.0)))) | |
70 | + '(diary ((t (:foreground "lightblue" :slant italic)))) | |
71 | + | |
72 | + ;; dired | |
73 | + '(dired-directory ((t (:foreground "deepskyblue2" :underline "deepskyblue1")))) | |
74 | + '(dired-marked ((t (:foreground "white" :background "grey40")))) | |
75 | + '(dired-flagged ((t (:foreground "white" :background "yellow3")))) | |
76 | + | |
77 | + ;; ido | |
78 | + '(ido-first-match ((t (:foreground "yellow1" :underline "orange1")))) | |
79 | + '(ido-only-match ((t (:foreground "yellow1" :underline "orange1")))) | |
80 | + '(ido-subdir ((t (:foreground "deepskyblue3" :underline "deepskyblue1")))) | |
81 | + '(ido-virtual ((t (:foreground "grey50" :slant italic)))) | |
82 | + | |
83 | + ;; diff | |
84 | + '(diff-header ((t (:foreground "yellow1" :weight bold)))) | |
85 | + '(diff-file-header ((t (:foreground "yellow1" :weight bold)))) | |
86 | + '(diff-context ((t (:inherit default)))) | |
87 | + '(diff-hunk-header ((t (:foreground "yellow3")))) | |
88 | + '(diff-added ((t (:foreground "turquoise3" :background)))) | |
89 | + '(diff-refine-added ((t (:inherit diff-added)))) | |
90 | + '(diff-changed ((t (:inherit hl-line :slant italic)))) | |
91 | + '(diff-refine-changed ((t (:inherit diff-changed)))) | |
92 | + '(diff-removed ((t (:foreground "hotpink3")))) | |
93 | + '(diff-refine-removed ((t (:inherit diff-removed)))) | |
94 | + | |
95 | + ;; ediff | |
96 | + '(ediff-even-diff-a ((t (:background "grey20")))) | |
97 | + '(ediff-even-diff-b ((t (:background "grey20")))) | |
98 | + '(ediff-even-diff-c ((t (:background "grey20")))) | |
99 | + '(ediff-odd-diff-a ((t (:background "grey20")))) | |
100 | + '(ediff-odd-diff-b ((t (:background "grey20")))) | |
101 | + '(ediff-odd-diff-c ((t (:background "grey20")))) | |
102 | + '(ediff-current-diff-a ((t (:foreground "white" :background "forestgreen")))) | |
103 | + '(ediff-current-diff-B ((t (:foreground "white" :background "forestgreen")))) | |
104 | + '(ediff-current-diff-C ((t (:foreground "white" :background "forestgreen")))) | |
105 | + '(ediff-fine-diff-A ((t (:foreground "white" :background "dodgerblue3" :weight bold)))) | |
106 | + '(ediff-fine-diff-B ((t (:foreground "white" :background "dodgerblue3" :weight bold)))) | |
107 | + '(ediff-fine-diff-C ((t (:foreground "white" :background "dodgerblue3" :weight bold)))) | |
108 | + | |
109 | + ;; customize | |
110 | + '(custom-button ((t (:background "grey20" :foreground "steelblue3" :box (:line-width 1 :color "steelblue3"))))) | |
111 | + '(custom-button-mouse ((t (:inherit custom-button :background "coral1" :foreground "white" :box (:line-width 1 :color "coral3"))))) | |
112 | + '(custom-button-mouse ((t (:inherit custom-button :background "coral1" :foreground "white" :box (:line-width 1 :color "white")))))) | |
113 | + | |
114 | +(provide-theme 'angry-bee) |
@@ -0,0 +1,107 @@ | ||
1 | +(deftheme bleached-paper | |
2 | + "Created 2014-Jan-03.") | |
3 | + | |
4 | +(custom-theme-set-variables | |
5 | + 'bleached-paper) | |
6 | + | |
7 | +(custom-theme-set-faces | |
8 | + 'bleached-paper | |
9 | + '(default ((t (:inherit nil :stipple nil :background "white" :foreground "grey33" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :foundry "outline")))) | |
10 | + '(hl-line ((t (:inherit nil :background "lightcyan1")))) | |
11 | + '(highlight-changes ((t (:background "lightyellow")))) | |
12 | + '(mode-line ((t (:background "paleturquoise4" :foreground "paleturquoise1" :box (:line-width 1 :color "paleturquoise4" :style nil))))) | |
13 | + '(mode-line-inactive ((t (:background "paleturquoise3" :foreground "white" :box (:line-width 1 :color "grey85"))))) | |
14 | + | |
15 | + ;; decorations | |
16 | + '(border ((t (:foreground "grey20")))) | |
17 | + '(fringe ((t (:background "white" :foreground "grey22")))) | |
18 | + '(linum ((t (:weight normal :slant italic :foreground "grey55" :background "#f8f9fe")))) | |
19 | + '(region ((t (:background "lightcyan2")))) | |
20 | + '(cursor ((t (:background "grey40" :foreground "white")))) | |
21 | + '(underline (( ((supports :underline t)) (:underline "skyblue1")))) | |
22 | + '(highlight ((t (:foreground "white" :background "steelblue1")))) | |
23 | + | |
24 | + ;; ido and prompts | |
25 | + '(ido-first-match ((t (:foreground "plum4" :weight bold)))) | |
26 | + '(ido-only-match ((t (:foreground "plum4" :weight bold)))) | |
27 | + '(ido-subdir ((t (:foreground "blue3" :underline "steelblue1")))) | |
28 | + '(ido-virtual ((t (:foreground "grey50" :slant italic)))) | |
29 | + '(minibuffer-prompt ((t (:foreground "hotpink3" :weight bold)))) | |
30 | + '(eshell-prompt ((t (:weight normal :foreground "royalblue")))) | |
31 | + '(comint-highlight-prompt ((t (:inherit eshell-prompt)))) | |
32 | + | |
33 | + ;; compilation | |
34 | + '(compilation-info ((t (:foreground "violetred3" :weight normal)))) | |
35 | + '(compilation-line-number ((t (:foreground "violetred1")))) | |
36 | + '(compilation-column-number ((t (:foreground "steelblue3")))) | |
37 | + '(compilation-warning ((t (:foreground "violetred3")))) | |
38 | + '(compilation-error ((t (:foreground "violetred3")))) | |
39 | + | |
40 | + ;; font lock | |
41 | + '(font-lock-doc-face ((t (:foreground "aquamarine4")))) | |
42 | + '(font-lock-comment-face ((t (:foreground "aquamarine4")))) | |
43 | + '(font-lock-comment-delimiter-face ((t (:foreground "aquamarine3")))) | |
44 | + '(font-lock-preprocessor-face ((t (:foreground "sienna" :weight normal)))) | |
45 | + '(font-lock-constant-face ((t (:foreground "coral3")))) | |
46 | + '(font-lock-string-face ((t (:foreground "coral3")))) | |
47 | + '(font-lock-function-name-face ((t (:foreground "plum4" :weight bold)))) | |
48 | + '(font-lock-keyword-face ((t (:foreground "sienna" :weight normal)))) | |
49 | + '(font-lock-type-face ((t (:foreground "goldenrod4" :weight normal)))) | |
50 | + '(font-lock-builtin-face ((t (:foreground "maroon")))) | |
51 | + '(font-lock-variable-name-face ((t (:foreground "darkcyan")))) | |
52 | + | |
53 | + ;; search | |
54 | + '(isearch ((t (:foreground "hotpink4" :background "pink1")))) | |
55 | + '(lazy-highlight ((t (:foreground "cyan4" :background "lightcyan2")))) | |
56 | + '(isearch-fail ((t (:foreground "red3" :background "mistyrose" :underline t)))) | |
57 | + '(show-paren-match ((t (:underline "cornflowerblue")))) | |
58 | + '(show-paren-mismatch ((t (:foreground "white" :background "palevioletred2")))) | |
59 | + '(match ((t (:background "grey88")))) | |
60 | + '(hi-yellow ((t (:background "lightyellow2")))) | |
61 | + '(hi-blue ((t (:background "lightblue")))) | |
62 | + '(hi-green ((t (:background "palegreen")))) | |
63 | + '(hi-pink ((t (:background "pink1")))) | |
64 | + '(outline-1 ((t (:foreground "blue3" :weight normal)))) | |
65 | + '(outline-2 ((t (:foreground "blue3")))) | |
66 | + '(outline-3 ((t (:slant italic)))) | |
67 | + | |
68 | + ;; org | |
69 | + '(org-done ((t (:foreground "lightblue" :slant italic :weight normal)))) | |
70 | + '(org-todo ((t (:foreground "tomato3" :slant italic :weight normal )))) | |
71 | + '(org-level-1 ((t (:family "Sans Serif" :foreground "dodgerblue" :weight bold :height 1.6)))) | |
72 | + '(org-level-2 ((t (:foreground "grey30")))) | |
73 | + | |
74 | + ;; dired | |
75 | + '(dired-directory ((t (:foreground "slateblue2" :underline "slateblue1")))) | |
76 | + '(dired-header ((t (:foreground "blue3" :underline "steelblue1")))) | |
77 | + '(dired-marked ((t (:weight bold :slant normal :underline "dodgerblue")))) | |
78 | + '(dired-flagged ((t (:weight bold :slant italic :underline "tomato")))) | |
79 | + | |
80 | + ;; diff | |
81 | + '(highlight-changes ((t (:background "lavenderblush2")))) | |
82 | + '(diff-added ((t (:inherit diff-changed :foreground "palegreen4")))) | |
83 | + '(diff-context ((t (:inherit default)))) | |
84 | + '(diff-header ((t (:foreground "dodgerblue2")))) | |
85 | + '(diff-file-header ((t (:foreground "dodgerblue3" :weight bold)))) | |
86 | + '(diff-hunk-header ((t (:box (:line-width 1 :color "dodgerblue3" :style nil) :foreground "dodgerblue3")))) | |
87 | + '(diff-refine-change ((t (:foreground "black" :background "gold1")))) | |
88 | + '(diff-removed ((t (:inherit diff-changed :foreground "coral3")))) | |
89 | + '(ediff-even-diff-A ((t (:foreground "grey50" :background "grey93")))) | |
90 | + '(ediff-even-diff-B ((t (:foreground "grey50" :background "grey93")))) | |
91 | + '(ediff-even-diff-C ((t (:foreground "grey50" :background "grey93")))) | |
92 | + '(ediff-odd-diff-A ((t (:foreground "grey50" :background "grey93")))) | |
93 | + '(ediff-odd-diff-B ((t (:foreground "grey50" :background "grey93")))) | |
94 | + '(ediff-odd-diff-C ((t (:foreground "grey50" :background "grey93")))) | |
95 | + '(ediff-current-diff-A ((t (:foreground "dodgerblue3" :background "paleturquoise1")))) | |
96 | + '(ediff-current-diff-B ((t (:foreground "dodgerblue3" :background "paleturquoise1")))) | |
97 | + '(ediff-current-diff-C ((t (:foreground "dodgerblue3" :background "paleturquoise1")))) | |
98 | + '(ediff-fine-diff-A ((t (:foreground "red3" :background "pink1")))) | |
99 | + '(ediff-fine-diff-B ((t (:foreground "red3" :background "pink1")))) | |
100 | + '(ediff-fine-diff-C ((t (:foreground "red3" :background "pink1")))) | |
101 | + | |
102 | + ;; customize | |
103 | + '(custom-button ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :color "cornflowerblue"))))) | |
104 | + '(custom-button-mouse ((t (:inherit custom-button :background "grey95")))) | |
105 | + '(custom-button-pressed ((t (:inherit custom-button :background "grey80"))))) | |
106 | + | |
107 | +(provide-theme 'bleached-paper) |
@@ -0,0 +1,124 @@ | ||
1 | +(deftheme glimmer | |
2 | + "Created 2013-03-19. My color theme with dark background.") | |
3 | + | |
4 | +(custom-theme-set-variables | |
5 | + 'glimmer | |
6 | + '(line-spacing 4)) | |
7 | + | |
8 | +(custom-theme-set-faces | |
9 | + 'glimmer | |
10 | + | |
11 | + ;; basics | |
12 | + '(default ((t (:inherit nil :stipple nil :background "grey13" :foreground "azure3" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :foundry "outline")))) | |
13 | + '(cursor ((t (:background "magenta" :foreground "white")))) | |
14 | + '(minibuffer-prompt ((t (:foreground "yellowgreen" :weight bold)))) | |
15 | + '(border ((t (:inherit default)))) | |
16 | + '(region ((t (:foreground "lightcyan" :background "royalblue")))) | |
17 | + | |
18 | + ;; decorations | |
19 | + '(window-divider ((t (:foreground "gray33")))) | |
20 | + '(window-divider-first-pixel ((t (:foreground "gray33")))) | |
21 | + '(window-divider-last-pixel ((t (:foreground "gray33")))) | |
22 | + '(fringe ((t (:inherit default)))) | |
23 | + | |
24 | + ;; mode line | |
25 | + '(mode-line ((t (:box (:line-width 1 :color "grey17" :style nil) :foreground "maroon1" :background "grey8" :weight bold)))) | |
26 | + '(mode-line-inactive ((t (:box (:line-width 1 :color "grey17" :style nil) :foreground "grey50" :background "grey10" :bold nil)))) | |
27 | + '(mode-line-buffer-id ((t (:foreground "limegreen" :bold t)))) | |
28 | + | |
29 | + ;; shell and stuff | |
30 | + '(sh-quoted-exec ((t (:foreground "gray" :slant italic)))) | |
31 | + '(eshell-prompt ((t (:inherit dired-directory :underline nil)))) | |
32 | + '(comint-highlight-prompt ((t (:inherit default :foreground "gray")))) | |
33 | + | |
34 | + ;; search | |
35 | + '(isearch ((t (:foreground "black" :background "yellow3" :underline nil :weight bold)))) | |
36 | + '(lazy-highlight ((t (:background "grey5" :underline "yellow3")))) | |
37 | + '(isearch-fail ((t (:foreground "firebrick1" :underline "firebrick3")))) | |
38 | + '(show-paren-match ((t (:underline "yellow")))) | |
39 | + '(show-paren-mismatch ((t (:underline "firebrick1")))) | |
40 | + '(highlight ((t (:foreground "white" :background "dodgerblue3")))) | |
41 | + '(match ((t (:underline "green3")))) | |
42 | + '(hi-blue ((t (:inherit default :underline "cornflowerblue")))) | |
43 | + '(hi-green ((t (:inherit default :underline "limegreen")))) | |
44 | + '(hi-pink ((t (:inherit default :underline "hotpink")))) | |
45 | + '(hi-red ((t (:inherit default :underline "rosybrown4")))) | |
46 | + '(hi-yellow ((t (:inherit default :underline "yellow3")))) | |
47 | + | |
48 | + ;; compilation | |
49 | + '(underline ((t (:underline "grey50")))) | |
50 | + '(compilation-error ((t (:foreground "limegreen")))) | |
51 | + '(compilation-line-number ((t (:foreground "yellowgreen" :weight bold)))) | |
52 | + '(compilation-column-number ((t (:foreground "skyblue1" :slant italic)))) | |
53 | + '(compilation-info ((t (:foreground "steelblue2")))) | |
54 | + | |
55 | + ;; font lock | |
56 | + '(font-lock-warning-face ((t (:foreground "firebrick1" :underline "tomato3")))) | |
57 | + '(font-lock-builtin-face ((t (:foreground "skyblue3")))) | |
58 | + '(font-lock-comment-face ((t (:foreground "cyan4" :slant normal)))) | |
59 | + '(font-lock-comment-delimiter-face ((t (:foreground "aquamarine3" :weight bold :slant normal)))) | |
60 | + '(font-lock-preprocessor-face ((t (:foreground "dodgerblue3" :bold nil)))) | |
61 | + '(font-lock-constant-face ((t (:foreground "skyblue2")))) | |
62 | + '(font-lock-string-face ((t (:foreground "skyblue2")))) | |
63 | + '(font-lock-doc-face ((t (:foreground "cyan2" :slant italic)))) | |
64 | + '(font-lock-keyword-face ((t (:foreground "royalblue1" :weight bold)))) | |
65 | + '(font-lock-type-face ((t (:foreground "cyan3")))) | |
66 | + '(font-lock-variable-name-face ((t (:foreground "magenta1")))) | |
67 | + '(font-lock-function-name-face ((t (:foreground "yellow3" :weight bold)))) | |
68 | + | |
69 | + ;; minor modes | |
70 | + '(highlight-changes ((t (:background "#103015")))) ; Sorry, no X11 color | |
71 | + '(highlight-changes-delete ((t (:background "#300515")))) ; Sorry, no X11 color | |
72 | + '(hl-line ((t (:background "grey18")))) | |
73 | + '(linum ((t (:weight bold :slant normal :foreground "grey26")))) | |
74 | + | |
75 | + ;; org/calendar/diary | |
76 | + '(org-done ((t (:foreground "grey50" :background "grey5")))) | |
77 | + '(org-todo ((t (:foreground "royalblue1" :background "grey20")))) | |
78 | + '(org-level-1 ((t (:inherit default :foreground "aquamarine3" :height 1.2 :weight bold)))) | |
79 | + '(org-level-2 ((t (:inherit default :foreground "magenta2" :height 1.1 :weight bold)))) | |
80 | + '(org-level-3 ((t (:inherit default :foreground "white" :height 1.0)))) | |
81 | + '(diary ((t (:foreground "lightblue" :slant italic)))) | |
82 | + | |
83 | + ;; dired | |
84 | + '(dired-directory ((t (:foreground "limegreen" :underline "limegreen")))) | |
85 | + '(dired-marked ((t (:foreground "white" :background "grey40")))) | |
86 | + '(dired-ignored ((t (:foreground "grey40" :slant italic)))) | |
87 | + '(dired-flagged ((t (:foreground "white" :background "firebrick3")))) | |
88 | + | |
89 | + ; IDO | |
90 | + '(ido-first-match ((t (:foreground "yellowgreen")))) | |
91 | + '(ido-only-match ((t (:foreground "yellowgreen")))) | |
92 | + '(ido-subdir ((t (:foreground "deepskyblue3" :underline "deepskyblue1")))) | |
93 | + '(ido-virtual ((t (:foreground "grey50" :slant italic)))) | |
94 | + | |
95 | + ;; diff mode | |
96 | + '(diff-context ((t (:inherit default)))) | |
97 | + '(diff-hunk-header ((t (:background "darkslategray" :foreground "white")))) | |
98 | + '(diff-added ((t (:foreground "deepskyblue3")))) | |
99 | + '(diff-refine-added ((t (:inherit diff-added)))) | |
100 | + '(diff-changed ((t (:inherit hl-line :slant italic)))) | |
101 | + '(diff-refine-changed ((t (:inherit diff-changed)))) | |
102 | + '(diff-removed ((t (:foreground "orangered")))) | |
103 | + '(diff-refine-removed ((t (:inherit diff-removed)))) | |
104 | + | |
105 | + ;; ediff | |
106 | + '(ediff-even-diff-A ((t (:background "grey20")))) | |
107 | + '(ediff-even-diff-B ((t (:background "grey20")))) | |
108 | + '(ediff-even-diff-C ((t (:background "grey20")))) | |
109 | + '(ediff-odd-diff-A ((t (:background "grey20")))) | |
110 | + '(ediff-odd-diff-B ((t (:background "grey20")))) | |
111 | + '(ediff-odd-diff-C ((t (:background "grey20")))) | |
112 | + '(ediff-current-diff-A ((t (:foreground "white" :background "cyan4")))) | |
113 | + '(ediff-current-diff-B ((t (:foreground "white" :background "cyan4")))) | |
114 | + '(ediff-current-diff-C ((t (:foreground "white" :background "cyan4")))) | |
115 | + '(ediff-fine-diff-A ((t (:foreground "white" :background "cyan3")))) | |
116 | + '(ediff-fine-diff-B ((t (:foreground "white" :background "cyan3")))) | |
117 | + '(ediff-fine-diff-C ((t (:foreground "white" :background "cyan3")))) | |
118 | + | |
119 | + ;; customize | |
120 | + '(custom-button ((t (:background "grey20" :foreground "grey87" :box (:line-width 1 :color "cyan4"))))) | |
121 | + '(custom-button-mouse ((t (:inherit custom-button :background "grey20")))) | |
122 | + '(custom-button-pressed ((t (:inherit custom-button :background "grey20"))))) | |
123 | + | |
124 | +(provide-theme 'glimmer) |
@@ -0,0 +1,112 @@ | ||
1 | +(deftheme grayskies | |
2 | + "Created 2014-Jan-03.") | |
3 | + | |
4 | +(custom-theme-set-variables | |
5 | + 'grayskies) | |
6 | + | |
7 | +(custom-theme-set-faces | |
8 | + 'grayskies | |
9 | + | |
10 | + ;; basics | |
11 | + '(default ((t (:inherit nil :stipple nil :background "grey95" :foreground "grey20" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :foundry "outline")))) | |
12 | + '(fringe ((t (:background "grey95" :foreground "skyblue2")))) | |
13 | + '(hl-line ((t (:background "grey95")))) | |
14 | + '(border ((t (:foreground "grey60")))) | |
15 | + '(linum ((t (:weight bold :slant italic :foreground "hotpink3")))) | |
16 | + '(region ((t (:background "grey80")))) | |
17 | + '(cursor ((t (:background "dodgerblue3" :foreground "white")))) | |
18 | + '(underline (( ((supports :underline t)) (:underline "skyblue1")))) | |
19 | + '(cua-rectangle ((t (:inherit region)))) | |
20 | + | |
21 | + ;; mode line | |
22 | + '(mode-line ((t (:family "Segoe UI" :background "grey70" :foreground "grey25" :box (:line-width 1 :color "grey65" :style nil))))) | |
23 | + '(mode-line-inactive ((t (:family "Segoe UI" :background "grey85" :foreground "grey40" :box (:line-width 1 :color "grey70"))))) | |
24 | + | |
25 | + ;; shell | |
26 | + '(minibuffer-prompt ((t (:foreground "red3")))) | |
27 | + '(eshell-prompt ((t (:weight bold :foreground "dodgerblue3" :slant italic)))) | |
28 | + '(comint-highlight-prompt ((t (:inherit eshell-prompt)))) | |
29 | + | |
30 | + ;; search | |
31 | + '(match ((t (:foreground "black" :background "lightcyan2" :bold nil)))) | |
32 | + '(highlight ((t :foreground "grey25" :background "grey70" ))) | |
33 | + '(isearch ((t :foreground "white" :background "grey40" :underline nil))) | |
34 | + '(lazy-highlight ((t (:underline "red")))) | |
35 | + '(isearch-fail ((t (:foreground "red3" :background "mistyrose" :underline t)))) | |
36 | + '(show-paren-match ((t (:underline "grey30")))) | |
37 | + '(show-paren-mismatch ((t (:foreground "white" :underline "white" :background "hotpink")))) | |
38 | + '(hi-yellow ((t (:background "palegoldenrod")))) | |
39 | + '(hi-blue ((t (:background "lightblue")))) | |
40 | + '(hi-green ((t (:background "darkseagreen1")))) | |
41 | + '(hi-pink ((t (:background "hotpink")))) | |
42 | + | |
43 | + ;; compilation | |
44 | + '(compilation-info ((t (:foreground "dodgerblue3" :weight normal)))) | |
45 | + '(compilation-line-number ((t (:foreground "hotpink2")))) | |
46 | + '(compilation-column-number ((t (:foreground "steelblue3")))) | |
47 | + '(compilation-warning ((t (:foreground "coral3")))) | |
48 | + '(compilation-error ((t (:foreground "coral3")))) | |
49 | + | |
50 | + ;; font lock | |
51 | + '(font-lock-doc-face ((t (:foreground "cadetblue4")))) | |
52 | + '(font-lock-comment-face ((t (:foreground "aquamarine4")))) | |
53 | + '(font-lock-comment-delimiter-face ((t (:foreground "aquamarine3")))) | |
54 | + '(font-lock-preprocessor-face ((t (:foreground "black" :weight bold)))) | |
55 | + '(font-lock-constant-face ((t (:foreground "deeppink3")))) | |
56 | + '(font-lock-string-face ((t (:foreground "deepskyblue4")))) | |
57 | + '(font-lock-function-name-face ((t (:foreground "dodgerblue4" :bold t)))) | |
58 | + '(font-lock-keyword-face ((t (:foreground "tomato3" :bold t)))) | |
59 | + '(font-lock-type-face ((t (:foreground "dodgerblue4" :bold nil)))) | |
60 | + '(font-lock-builtin-face ((t (:foreground "maroon")))) | |
61 | + '(font-lock-variable-name-face ((t (:foreground "darkcyan")))) | |
62 | + '(outline-1 ((t (:foreground "blue3" :bold t)))) | |
63 | + '(outline-2 ((t (:foreground "blue3")))) | |
64 | + '(outline-3 ((t (:slant italic)))) | |
65 | + | |
66 | + ;; org | |
67 | + '(org-done ((t (:foreground "lightblue" :slant italic :weight bold)))) | |
68 | + '(org-todo ((t (:foreground "tomato3" :slant italic :weight bold )))) | |
69 | + '(org-table ((t (:foreground "dodgerblue3" :weight bold )))) | |
70 | + '(org-level-1 ((t (:family "Times New Roman" :foreground "dodgerblue" :weight bold :height 1.6)))) | |
71 | + '(org-level-2 ((t (:foreground "grey30")))) | |
72 | + | |
73 | + ;; dired | |
74 | + '(dired-directory ((t (:foreground "royalblue" :underline "steelblue1")))) | |
75 | + '(dired-header ((t (:foreground "blue3" :underline "steelblue1")))) | |
76 | + '(dired-marked ((t (:foreground "black" :background "skyblue")))) | |
77 | + '(dired-flagged ((t (:foreground "white" :background "tomato3")))) | |
78 | + | |
79 | + ;; ido | |
80 | + '(ido-first-match ((t (:foreground "black" :background "grey65" :weight bold)))) | |
81 | + '(ido-only-match ((t (:foreground "black" :background "grey65" :weight bold)))) | |
82 | + '(ido-subdir ((t (:foreground "blue3" :underline "steelblue1")))) | |
83 | + '(ido-virtual ((t (:foreground "grey60" :slant italic)))) | |
84 | + | |
85 | + ;; diff | |
86 | + '(highlight-changes ((t (:background "lavenderblush2")))) | |
87 | + '(diff-added ((t (:inherit default :background "palegreen" :foreground "black")))) | |
88 | + '(diff-removed ((t (:inherit default :background "pink1" :foreground "black")))) | |
89 | + '(diff-changed ((t (:inherit default :background "powderblue" :foreground "black")))) | |
90 | + '(diff-context ((t (:inherit default)))) | |
91 | + '(diff-hunk-header ((t (:background "lightgray" :foreground "dimgray")))) | |
92 | + '(diff-refine-change ((t (:foreground "black" :background "gold1")))) | |
93 | + '(diff-removed ((t (:inherit diff-changed :foreground "coral3")))) | |
94 | + '(ediff-even-diff-A ((t (:foreground "grey40" :background "grey90")))) | |
95 | + '(ediff-even-diff-B ((t (:foreground "grey40" :background "grey90")))) | |
96 | + '(ediff-even-diff-C ((t (:foreground "grey40" :background "grey90")))) | |
97 | + '(ediff-odd-diff-A ((t (:foreground "grey40" :background "grey90")))) | |
98 | + '(ediff-odd-diff-B ((t (:foreground "grey40" :background "grey90")))) | |
99 | + '(ediff-odd-diff-C ((t (:foreground "grey40" :background "grey90")))) | |
100 | + '(ediff-current-diff-A ((t (:foreground "white" :background "steelblue1")))) | |
101 | + '(ediff-current-diff-B ((t (:foreground "white" :background "steelblue1")))) | |
102 | + '(ediff-current-diff-C ((t (:foreground "white" :background "steelblue1")))) | |
103 | + '(ediff-fine-diff-A ((t (:foreground "white" :background "dodgerblue1")))) | |
104 | + '(ediff-fine-diff-B ((t (:foreground "white" :background "dodgerblue1")))) | |
105 | + '(ediff-fine-diff-C ((t (:foreground "white" :background "dodgerblue1")))) | |
106 | + | |
107 | + ;; customize | |
108 | + '(custom-button ((t (:background "lightgrey" :foreground "black" :box (:line-width 2 :color "cornflowerblue"))))) | |
109 | + '(custom-button-mouse ((t (:inherit custom-button :background "grey95")))) | |
110 | + '(custom-button-pressed ((t (:inherit custom-button :background "grey80"))))) | |
111 | + | |
112 | +(provide-theme 'grayskies) |
@@ -0,0 +1,117 @@ | ||
1 | +(deftheme summertime | |
2 | + "Created 2011-10-19.") | |
3 | + | |
4 | +(custom-theme-set-variables | |
5 | + 'summertime | |
6 | + '(line-spacing 3)) | |
7 | + | |
8 | +(custom-theme-set-faces | |
9 | + 'summertime | |
10 | + | |
11 | + ;; basics | |
12 | + '(default ((t (:inherit nil :stipple nil :background "smokewhite" :foreground "dodgerblue4" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width normal :foundry "outline")))) | |
13 | + '(region ((t (:background "lightblue2")))) | |
14 | + '(cursor ((t (:background "black")))) | |
15 | + '(underline (( ((supports :underline t)) (:underline "cornflowerblue")))) | |
16 | + '(minibuffer-prompt ((t (:foreground "firebrick2" :weight normal)))) | |
17 | + '(highlight ((t (:background "lightcyan2")))) | |
18 | + '(border ((t (:foreground "grey20")))) | |
19 | + | |
20 | + ;; mode line | |
21 | + '(mode-line ((t (:foreground "black" :background "azure3" :box (:line-width 1 :color "azure4" :style nil))))) | |
22 | + '(mode-line-inactive ((t (:foreground "black" :background "azure2" :box (:line-width 1 :color "azure3" :style none))))) | |
23 | + | |
24 | + ;; decorations | |
25 | + '(fringe ((t (:foreground "grey60" :background "smokewhite")))) | |
26 | + '(window-divider ((t (:foreground "gray33")))) | |
27 | + '(window-divider-first-pixel ((t (:foreground "gray33")))) | |
28 | + '(window-divider-last-pixel ((t (:foreground "gray33")))) | |
29 | + | |
30 | + ;; shell and stuff | |
31 | + '(eshell-prompt ((t (:foreground "dodgerblue1" :background "white" :weight normal)))) | |
32 | + '(comint-highlight-prompt ((t (:inherit eshell-prompt)))) | |
33 | + | |
34 | + ;; search | |
35 | + '(isearch ((t (:foreground "black" :background "moccasin")))) | |
36 | + '(lazy-highlight ((t (:background "lightcyan1")))) | |
37 | + '(isearch-fail ((t (:foreground "white" :background "indianred1" :underline t)))) | |
38 | + '(match ((t (:underline "black")))) | |
39 | + '(show-paren-match ((t (:inherit match)))) | |
40 | + '(show-paren-mismatch ((t (:foreground "red3" :background "mistyrose")))) | |
41 | + | |
42 | + ;; compilation | |
43 | + '(compilation-line-number ((t (:foreground "cornflowerblue" :weight bold)))) | |
44 | + '(compilation-column-number ((t (:foreground "dodgerblue3" :weight bold)))) | |
45 | + '(compilation-info ((t (:foreground "dodgerblue3")))) | |
46 | + '(compilation-warning ((t (:foreground "red")))) | |
47 | + '(compilation-error ((t (:foreground "indianred3")))) | |
48 | + | |
49 | + ;; font lock | |
50 | + '(font-lock-doc-face ((t (:foreground "forestgreen")))) | |
51 | + '(font-lock-comment-face ((t (:foreground "darkseagreen4")))) | |
52 | + '(font-lock-comment-delimiter-face ((t (:foreground "darkseagreen3")))) | |
53 | + '(font-lock-preprocessor-face ((t (:foreground "grey30" :slant normal :weight bold)))) | |
54 | + '(font-lock-constant-face ((t (:foreground "palevioletred3")))) | |
55 | + '(font-lock-string-face ((t (:foreground "palevioletred3" :slant italic)))) | |
56 | + '(font-lock-function-name-face ((t (:foreground "dodgerblue3" :bold t)))) | |
57 | + '(font-lock-keyword-face ((t (:foreground "firebrick3" :weight bold)))) | |
58 | + '(font-lock-type-face ((t (:foreground "maroon3" :bold nil)))) | |
59 | + '(font-lock-builtin-face ((t (:foreground "deepskyblue4")))) | |
60 | + '(font-lock-variable-name-face ((t (:foreground "firebrick4")))) | |
61 | + | |
62 | + ;; minor modes | |
63 | + '(hi-yellow ((t (:background "yellow")))) | |
64 | + '(hi-blue ((t (:background "lightblue")))) | |
65 | + '(hi-green ((t (:background "palegreen")))) | |
66 | + '(hi-pink ((t (:background "pink1")))) | |
67 | + '(linum ((t (:foreground "cornflowerblue" :slant normal :weight bold)))) | |
68 | + '(hl-line ((t (:inherit nil :background "azure2")))) | |
69 | + '(ido-first-match ((t (:foreground "black" :background "lightcyan2" :weight normal)))) | |
70 | + '(ido-only-match ((t (:foreground "black" :background "lightcyan2" :weight normal)))) | |
71 | + '(ido-subdir ((t (:foreground "dodgerblue3" :underline "dodgerblue1")))) | |
72 | + '(ido-virtual ((t (:foreground "grey50" :slant italic)))) | |
73 | + '(cua-rectangle ((t (:inherit region)))) | |
74 | + '(highlight-changes ((t (:background "aquamarine1")))) | |
75 | + '(highlight-changes-delete ((t (:foreground "red1" :background "rosybrown1")))) | |
76 | + | |
77 | + ;; org/calendar/diary | |
78 | + '(org-done ((t (:foreground "grey70" :background "grey93")))) | |
79 | + '(org-todo ((t (:foreground "darkgoldenrod" :background "lemonchiffon")))) | |
80 | + '(org-level-1 ((t (:inherit default :foreground "dodgerblue1" :height 1.3 :weight bold)))) | |
81 | + '(org-level-2 ((t (:inherit default :foreground "dodgerblue1" :height 1.2 :weight bold)))) | |
82 | + '(org-level-3 ((t (:inherit default :foreground "dodgerblue4" :height 1.0)))) | |
83 | + '(diary ((t (:foreground "lightblue" :slant italic)))) | |
84 | + | |
85 | + ;; dired | |
86 | + '(dired-directory ((t (:foreground "royalblue" :underline "blue1")))) | |
87 | + '(dired-header ((t (:foreground "blue3" :underline "blue1")))) | |
88 | + '(dired-marked ((t (:weight bold :slant normal :foreground "dodgerblue1" :underline "dodgerblue")))) | |
89 | + '(dired-flagged ((t (:weight bold :slant italic :foreground "lightcoral" :underline "tomato")))) | |
90 | + | |
91 | + ;; diff mode | |
92 | + '(diff-added ((t (:inherit diff-changed :foreground "green4")))) | |
93 | + '(diff-context ((t (:inherit default)))) | |
94 | + '(diff-hunk-header ((t (:background "lightgray" :foreground "dimgray")))) | |
95 | + '(diff-refine-change ((t (:foreground "black" :background "gold1")))) | |
96 | + '(diff-removed ((t (:inherit diff-changed :foreground "coral3")))) | |
97 | + | |
98 | + ;; ediff | |
99 | + '(ediff-even-diff-A ((t (:foreground "cyan3" :background "lightcyan1")))) | |
100 | + '(ediff-even-diff-B ((t (:foreground "cyan3" :background "lightcyan1")))) | |
101 | + '(ediff-even-diff-C ((t (:foreground "cyan3" :background "lightcyan1")))) | |
102 | + '(ediff-odd-diff-A ((t (:foreground "cyan3" :background "lightcyan1")))) | |
103 | + '(ediff-odd-diff-B ((t (:foreground "cyan3" :background "lightcyan1")))) | |
104 | + '(ediff-odd-diff-C ((t (:foreground "cyan3" :background "lightcyan1")))) | |
105 | + '(ediff-current-diff-A ((t (:foreground "black" :background "lightcyan2")))) | |
106 | + '(ediff-current-diff-B ((t (:foreground "black" :background "lightcyan2")))) | |
107 | + '(ediff-current-diff-C ((t (:foreground "black" :background "lightcyan2")))) | |
108 | + '(ediff-fine-diff-A ((t (:foreground "black" :background "pink1")))) | |
109 | + '(ediff-fine-diff-B ((t (:foreground "black" :background "pink1")))) | |
110 | + '(ediff-fine-diff-C ((t (:foreground "black" :background "pink1")))) | |
111 | + | |
112 | + ;; customize | |
113 | + '(custom-button ((t (:background "lightblue3" :foreground "white" :box (:line-width 2 :color "lightblue2"))))) | |
114 | + '(custom-button-mouse ((t (:inherit custom-button :background "grey95")))) | |
115 | + '(custom-button-pressed ((t (:inherit custom-button :background "grey80"))))) | |
116 | + | |
117 | +(provide-theme 'summertime) |
@@ -0,0 +1,35 @@ | ||
1 | +-*- mode: org -*- | |
2 | +#+SEQ_TODO: TODO TEST DONE | |
3 | + | |
4 | +* The Emacs Config Wishlist | |
5 | + | |
6 | +** TODO Take a look at Hydra mode | |
7 | + | |
8 | +** TODO Enhance org-mode | |
9 | + | |
10 | + TODO and DONE are the standard work-flow states in Org-mode, but it's possible | |
11 | + to configure your own work flow, either globally for all Org-mode files or a | |
12 | + custom one for each file. For example, if you wanted to set up a custom work | |
13 | + flow, such as TODO --> TEST --> DONE, add the following to the top of your Org | |
14 | + file: | |
15 | + | |
16 | +#+BEGIN_SRC emacs-lisp | |
17 | +#+SEQ_TODO: TODO TEST DONE | |
18 | +#+END_SRC | |
19 | + | |
20 | +** DONE start using directory local variable files | |
21 | + CLOSED: [2017-06-11 Sun 00:37] | |
22 | +Check if this code snippet, put in file .dir-locals.el, work for my projects. | |
23 | + | |
24 | +#+BEGIN_SRC emacs-lisp | |
25 | +((nil | |
26 | + . ((grep-find-ignored-directories | |
27 | + . (quote (".git" ".vscode" "Build" "Debug" "Release" | |
28 | + "AUTOSAR_tresos" "Doc" "Documentation" "TLProj" "TLSim"))) | |
29 | + (compile-command | |
30 | + . (lambda () | |
31 | + (concat | |
32 | + "cd " | |
33 | + (file-name-as-directory desktop-dirname) | |
34 | + "C_Application/Build/ && gbuild Debug.gpj")))))) | |
35 | +#+END_SRC |