-
Notifications
You must be signed in to change notification settings - Fork 6
/
gimp-init.el
82 lines (65 loc) · 2.51 KB
/
gimp-init.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
;;; gimp-init.el --- Loading file for Gimp Mode
;; Copyright (C) 2008-2012 Niels Giesen
;; Author: Niels Giesen <niels.giesen@gmail.com>
;; Keywords: processes, languages, multimedia, tools
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, write to the Free Software
;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
;; 02110-1301, USA.
;; Check whether first time
;; Put this in your .emacs (load-file "~/.emacs.d/gimp/gimp-init.el")
(defvar gimp-mode-dir
(file-name-directory
(or load-file-name buffer-file-name)))
(condition-case err
(load (concat gimp-mode-dir "gimp-vars.el"))
(error (load-file (concat gimp-mode-dir "gimp-install.el"))))
(let* ((related-dir (file-name-as-directory
(expand-file-name "related"
gimp-mode-dir))))
(add-to-list 'load-path gimp-mode-dir)
(add-to-list 'load-path related-dir))
(mapc (lambda (command)
(autoload command "gimp-mode" "" t))
'(run-gimp
gimp-mode
gimp-help
gimp-selector
gimp-open-image
gimp-cl-connect))
(autoload 'gimp-install "gimp-install.el")
;; Uncomment the following line to have a nice selector:
;(global-set-key "\C-cg" 'gimp-selector)
(mapc (lambda (hook)
(add-hook hook
(lambda ()
(require 'snippet)
(require 'scheme-complete)
(autoload 'eldoc-current-symbol "eldoc"))))
'(gimp-mode-hook gimp-help-mode-hook inferior-gimp-mode-hook))
(add-to-list 'auto-mode-alist
'("\\(s-f-\\|script-fu\\).*\\.scm\\'" . gimp-mode))
(defun gimp-script-p ()
"Return t when current buffer holds a GIMP script."
(when (and (buffer-file-name) (string-match "gimp.*\.scm\\'" (buffer-file-name)))
t))
(add-to-list 'magic-mode-alist
'(gimp-script-p . gimp-mode))
;; auto-insert-alist is *not* automatically loaded in a vanilla
;; session... force by toggling:
(auto-insert-mode)
(auto-insert-mode)
(add-to-list
'auto-insert-alist
'(gimp-mode
lambda nil
(insert ";; -*- mode: Gimp; -*-\n")
(snippet-insert (eval gimp-registration-snippet))))