Compare commits
106 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
87e49a2d4a | ||
|
d4d7b1b846 | ||
|
758de45705 | ||
|
5e60ef9b9f | ||
|
c319a91b81 | ||
|
e483802576 | ||
|
fad5f6b429 | ||
|
2188f7570e | ||
|
a71676b18f | ||
|
7004ec1392 | ||
|
9c34028514 | ||
|
975b8c5103 | ||
|
b35f9aeb18 | ||
|
807a13fb5d | ||
|
94a5305f80 | ||
|
00a2bac09d | ||
|
59ddf58c41 | ||
|
eb0e381e9c | ||
|
e4dbc3784c | ||
|
c2d156d336 | ||
|
e460cd5407 | ||
|
7c0320af53 | ||
|
c8aae53adb | ||
|
76fe04e735 | ||
|
1c4cbd27db | ||
|
793c99ea88 | ||
|
9915abb255 | ||
|
e79bd97150 | ||
|
7371b8295d | ||
|
756a65e2ac | ||
|
abf4f953de | ||
|
9b41cae5d6 | ||
|
4d00c8b56d | ||
|
1d841ca894 | ||
|
0ad3b93ecf | ||
|
6162d5653d | ||
|
fbc0328bd7 | ||
|
1d5d7a4575 | ||
|
e251807ddf | ||
|
3bc64682b3 | ||
|
4d89c3431c | ||
|
6249b6e3d4 | ||
|
e3c96a376e | ||
|
30f054973a | ||
|
e380fcdbd1 | ||
|
aca8d86ff4 | ||
|
645b93c707 | ||
|
3dd3f9b564 | ||
|
1f60836382 | ||
|
f8bea702fd | ||
|
ec853266c7 | ||
|
b4d3efe729 | ||
|
936644ba42 | ||
|
44bc50f825 | ||
|
28a1eb11df | ||
|
1eb48ca728 | ||
|
d43272e130 | ||
|
e37d7a15a5 | ||
|
123f5d1c93 | ||
|
9fa5a7c682 | ||
|
48385e7890 | ||
|
e1d391b427 | ||
|
c78f7c1113 | ||
|
c0b6cc97a5 | ||
|
475652cd32 | ||
|
f731541162 | ||
|
61f4bac6d7 | ||
|
f2895e0d47 | ||
|
ce72b2acdc | ||
|
5af9bb32d1 | ||
|
536a584023 | ||
|
0903318305 | ||
|
42b37dec2c | ||
|
8786448b59 | ||
|
1f1fbdda08 | ||
|
de02d0df08 | ||
|
3608cbbc38 | ||
|
7020381da5 | ||
|
9c876c0319 | ||
|
e4b45a26af | ||
|
34a88e927f | ||
|
711c894ac5 | ||
|
4d1a72a532 | ||
|
d1b4b17d10 | ||
|
a4050581f6 | ||
|
06ea613a9a | ||
|
f1e443eac0 | ||
|
5c9984c1e8 | ||
|
0fa6331639 | ||
|
b489fb6822 | ||
|
af57368ed1 | ||
|
445eba96ac | ||
|
0f5a618fbe | ||
|
3339b7006c | ||
|
c845a1d7b9 | ||
|
1c59dc3673 | ||
|
6839eabe82 | ||
|
8184b4690d | ||
|
621bbc595a | ||
|
ef46af6703 | ||
|
4b8931ea93 | ||
|
bd2ea9113b | ||
|
259a2e2222 | ||
|
b134d8ca63 | ||
|
2d973287f9 | ||
|
119a7eceb6 |
@ -1,5 +0,0 @@
|
|||||||
elisp-manual-21-2.6.tar.bz2
|
|
||||||
emacs-20.7.tar.bz2
|
|
||||||
emacs-asian.tar.bz2
|
|
||||||
gnus-5.8.8-compiled.tar.bz2
|
|
||||||
leim-20.7.tar.bz2
|
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
emacs-22.1.tar.gz
|
1
Emacs
Normal file
1
Emacs
Normal file
@ -0,0 +1 @@
|
|||||||
|
Emacs*font: -adobe-courier-medium-r-*-*-12-120-75-75-*-*-*-*
|
6
Makefile
6
Makefile
@ -1,6 +0,0 @@
|
|||||||
# Makefile for source rpm: emacs
|
|
||||||
# $Id$
|
|
||||||
NAME := emacs
|
|
||||||
SPECFILE = $(firstword $(wildcard *.spec))
|
|
||||||
|
|
||||||
include ../common/Makefile.common
|
|
5
default.el
Normal file
5
default.el
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
;;; default.el - loaded after ".emacs" on startup
|
||||||
|
;;;
|
||||||
|
;;; Setting `inhibit-default-init' non-nil in "~/.emacs"
|
||||||
|
;;; prevents loading of this file. Also the "-q" option to emacs
|
||||||
|
;;; prevents both "~/.emacs" and this file from being loaded at startup.
|
20
dotemacs.el
Normal file
20
dotemacs.el
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
;; .emacs
|
||||||
|
|
||||||
|
;;; uncomment this line to disable loading of "default.el" at startup
|
||||||
|
;; (setq inhibit-default-init t)
|
||||||
|
|
||||||
|
;; enable visual feedback on selections
|
||||||
|
;(setq transient-mark-mode t)
|
||||||
|
|
||||||
|
;; default to better frame titles
|
||||||
|
(setq frame-title-format
|
||||||
|
(concat "%b - emacs@" (system-name)))
|
||||||
|
|
||||||
|
;; default to unified diffs
|
||||||
|
(setq diff-switches "-u")
|
||||||
|
|
||||||
|
;; always end a file with a newline
|
||||||
|
;(setq require-final-newline 'query)
|
||||||
|
|
||||||
|
;;; uncomment for CJK utf-8 support for non-Asian users
|
||||||
|
;; (require 'un-define)
|
@ -1,31 +1,34 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Name=Emacs
|
Name=Emacs Text Editor
|
||||||
Name[eo]=Emakso
|
Name[bg]=редактор Emacs
|
||||||
Name[et]=Emacs tekstiredaktor
|
Name[ca]=Editor Emacs
|
||||||
Comment=Emacs
|
Name[cs]=Editor Emacs
|
||||||
Comment[ca]=Editor Emacs
|
Name[da]=Emacs tekstredigerer
|
||||||
Comment[cs]=Editor Emacs
|
Name[de]=Emacs Texteditor
|
||||||
Comment[eo]=La redaktilo Emakso
|
Name[eo]=La redaktilo Emakso
|
||||||
Comment[et]=Võimas tekstiredaktor Emacs
|
Name[et]=Võimas tekstiredaktor Emacs
|
||||||
Comment[fi]=Emacs editori
|
Name[fi]=Emacs editori
|
||||||
Comment[fr]=Éditeur Emacs
|
Name[fr]=Éditeur Emacs
|
||||||
Comment[hu]=Emacs szövegszerkesztő
|
Name[hu]=Emacs szövegszerkesztő
|
||||||
Comment[is]=Emacs-ritill
|
Name[is]=Emacs-ritill
|
||||||
Comment[mk]=Софистицираниот Emacs уредувач
|
Name[ja]=Emacs テキスト・エディター
|
||||||
Comment[no]=Emacs-tekstredigerer
|
Name[mk]=Софистицираниот Emacs уредувач
|
||||||
Comment[pt]=Editor Emacs
|
Name[no]=Emacs-tekstredigerer
|
||||||
Comment[ro]=Editorul Emacs
|
Name[pt]=Editor Emacs
|
||||||
Comment[ru]=Редактор Emacs
|
Name[ro]=Editorul Emacs
|
||||||
Comment[sk]=Editor Emacs
|
Name[ru]=Редактор Emacs
|
||||||
Comment[sl]=Urejevalnik Emacs
|
Name[sk]=Editor Emacs
|
||||||
Comment[uk]=Редактор Emacs
|
Name[sl]=Urejevalnik Emacs
|
||||||
BinaryPattern=
|
Name[uk]=Редактор Emacs
|
||||||
Protocols=
|
Name[zh_TW]=Emacs 文字編輯器
|
||||||
|
GenericName=Text Editor
|
||||||
|
Comment=Edit text
|
||||||
|
Comment[zh_TW]=編輯文字
|
||||||
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
|
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
|
||||||
Exec=emacs %f
|
Exec=emacs %f
|
||||||
Icon=emacs.png
|
Icon=emacs.png
|
||||||
TerminalOptions=
|
|
||||||
Path=
|
|
||||||
Type=Application
|
Type=Application
|
||||||
Terminal=0
|
Terminal=false
|
||||||
MapNotify=false
|
Categories=Application;Utility;TextEditor;X-Red-Hat-Base;
|
||||||
|
Encoding=UTF-8
|
||||||
|
StartupWMClass=Emacs
|
||||||
|
1315
emacs.spec
1315
emacs.spec
File diff suppressed because it is too large
Load Diff
3
focus-init.el
Normal file
3
focus-init.el
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
(when window-system
|
||||||
|
;; make switching frames works properly under the default click-to-focus
|
||||||
|
(setq focus-follows-mouse nil))
|
11
glibc-open-macro.patch
Normal file
11
glibc-open-macro.patch
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--- emacs-22.1/src/sound.c~ 2007-03-06 07:14:14.000000000 -0500
|
||||||
|
+++ emacs-22.1/src/sound.c 2007-08-09 15:54:52.117018000 -0400
|
||||||
|
@@ -1469,7 +1469,7 @@ Internal use only, use `play-sound' inst
|
||||||
|
error ("No usable sound device driver found");
|
||||||
|
|
||||||
|
/* Open the device. */
|
||||||
|
- current_sound_device->open (current_sound_device);
|
||||||
|
+ (current_sound_device->open) (current_sound_device);
|
||||||
|
|
||||||
|
/* Play the sound. */
|
||||||
|
current_sound->play (current_sound, current_sound_device);
|
16
igrep-init.el
Normal file
16
igrep-init.el
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
;; igrep-init.el
|
||||||
|
|
||||||
|
(autoload 'igrep "igrep"
|
||||||
|
"*Run `grep` PROGRAM to match REGEX in FILES..." t)
|
||||||
|
(autoload 'igrep-find "igrep"
|
||||||
|
"*Run `grep` via `find`..." t)
|
||||||
|
(autoload 'igrep-visited-files "igrep"
|
||||||
|
"*Run `grep` ... on all visited files." t)
|
||||||
|
(autoload 'dired-do-igrep "igrep"
|
||||||
|
"*Run `grep` on the marked (or next prefix ARG) files." t)
|
||||||
|
(autoload 'dired-do-igrep-find "igrep"
|
||||||
|
"*Run `grep` via `find` on the marked (or next prefix ARG) directories." t)
|
||||||
|
(autoload 'Buffer-menu-igrep "igrep"
|
||||||
|
"*Run `grep` on the files visited in buffers marked with '>'." t)
|
||||||
|
(autoload 'igrep-insinuate "igrep"
|
||||||
|
"Define `grep' aliases for the corresponding `igrep' commands." t)
|
7
php-mode-init.el
Normal file
7
php-mode-init.el
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
;; Use php-mode for .php,.php3,.php4 and .phtml files
|
||||||
|
|
||||||
|
(autoload 'php-mode "php-mode" "Major mode for editing PHP code." t)
|
||||||
|
|
||||||
|
(add-to-list 'auto-mode-alist
|
||||||
|
'("\\.php[34]\\'\\|\\.php\\'\\|\\.phtml\\'" . php-mode))
|
||||||
|
|
1121
php-mode.el
Normal file
1121
php-mode.el
Normal file
File diff suppressed because it is too large
Load Diff
13
po-mode-auto-replace-date-71264.patch
Normal file
13
po-mode-auto-replace-date-71264.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
diff -u po-mode.el~ po-mode.el
|
||||||
|
--- po-mode.el~ 2003-01-16 01:44:50.000000000 +0900
|
||||||
|
+++ po-mode.el 2003-01-16 01:44:50.000000000 +0900
|
||||||
|
@@ -1267,8 +1267,7 @@
|
||||||
|
(concat "\"PO-Revision-Date: "
|
||||||
|
(format-time-string "%Y-%m-%d %H:%M" time)
|
||||||
|
zone "\\n\"")
|
||||||
|
- t t))))
|
||||||
|
- (message ""))
|
||||||
|
+ t t)))))
|
||||||
|
(message (_"PO-Revision-Date should be adjusted..."))))
|
||||||
|
|
||||||
|
;;; Handling span of entry, entry type and entry attributes.
|
5
po-mode-init.el
Normal file
5
po-mode-init.el
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
;; Use po-mode for translation files
|
||||||
|
|
||||||
|
(autoload 'po-mode "po-mode"
|
||||||
|
"Major mode for translators to edit PO files" t)
|
||||||
|
(add-to-list 'auto-mode-alist '("\\.po\\'\\|\\.po\\." . po-mode))
|
3314
po-mode.el
Normal file
3314
po-mode.el
Normal file
File diff suppressed because it is too large
Load Diff
3104
python-mode.el
3104
python-mode.el
File diff suppressed because it is too large
Load Diff
BIN
rfc1345.el
Normal file
BIN
rfc1345.el
Normal file
Binary file not shown.
4
rpm-spec-mode-init.el
Normal file
4
rpm-spec-mode-init.el
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
;; rpm-spec-mode for spec files
|
||||||
|
|
||||||
|
(autoload 'rpm-spec-mode "rpm-spec-mode" "RPM spec mode." t)
|
||||||
|
(add-to-list 'auto-mode-alist '("\\.spec$" . rpm-spec-mode))
|
743
rpm-spec-mode.el
743
rpm-spec-mode.el
File diff suppressed because it is too large
Load Diff
91
rpm-spec-mode.patch
Normal file
91
rpm-spec-mode.patch
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
--- rpm-spec-mode.el~ 2008-04-22 15:14:40.000000000 -0400
|
||||||
|
+++ rpm-spec-mode.el 2008-04-22 16:19:09.000000000 -0400
|
||||||
|
@@ -63,7 +63,9 @@
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
-(defconst rpm-spec-mode-version "0.12.1x" "Version of `rpm-spec-mode'.")
|
||||||
|
+(require 'compile)
|
||||||
|
+
|
||||||
|
+(defconst rpm-spec-mode-version "0.12.1x.rh1" "Version of `rpm-spec-mode'.")
|
||||||
|
|
||||||
|
(defgroup rpm-spec nil
|
||||||
|
"RPM spec mode with Emacs/XEmacs enhancements."
|
||||||
|
@@ -189,11 +191,6 @@
|
||||||
|
:type 'boolean
|
||||||
|
:group 'rpm-spec)
|
||||||
|
|
||||||
|
-(defcustom rpm-spec-use-compilation-mode t
|
||||||
|
- "*If non-nil, build in `compilation-mode' if it's available."
|
||||||
|
- :type 'boolean
|
||||||
|
- :group 'rpm-spec)
|
||||||
|
-
|
||||||
|
(defcustom rpm-spec-default-release "1"
|
||||||
|
"*Default value for the Release tag in new spec files."
|
||||||
|
:type 'string
|
||||||
|
@@ -225,6 +222,11 @@
|
||||||
|
:type 'string
|
||||||
|
:group 'rpm-spec)
|
||||||
|
|
||||||
|
+(defcustom rpm-spec-auto-topdir nil
|
||||||
|
+ "*Automatically detect an rpm build directory tree and define _topdir."
|
||||||
|
+ :type 'boolean
|
||||||
|
+ :group 'rpm-spec)
|
||||||
|
+
|
||||||
|
(defgroup rpm-spec-faces nil
|
||||||
|
"Font lock faces for `rpm-spec-mode'."
|
||||||
|
:prefix "rpm-spec-"
|
||||||
|
@@ -1025,20 +1027,30 @@
|
||||||
|
(setq buildoptions (cons "--nodeps" buildoptions)))
|
||||||
|
(if (and rpm-spec-sign-gpg (not rpm-no-gpg))
|
||||||
|
(setq buildoptions (cons "--sign" buildoptions)))
|
||||||
|
- (save-excursion
|
||||||
|
- (set-buffer (get-buffer rpm-buffer-name))
|
||||||
|
- (and rpm-spec-use-compilation-mode
|
||||||
|
- (fboundp 'compilation-mode)
|
||||||
|
- (compilation-mode))
|
||||||
|
- (goto-char (point-max)))
|
||||||
|
- (let* ((process-environment (cons "EMACS=t" process-environment))
|
||||||
|
- (process
|
||||||
|
- (apply 'start-process rpm-spec-build-command rpm-buffer-name
|
||||||
|
- rpm-spec-build-command buildoptions)))
|
||||||
|
- (if (and rpm-spec-sign-gpg (not rpm-no-gpg))
|
||||||
|
- (let ((rpm-passwd-cache (read-passwd "GPG passphrase: ")))
|
||||||
|
- (process-send-string process (concat rpm-passwd-cache "\n"))))
|
||||||
|
- (set-process-filter process 'rpm-command-filter)))
|
||||||
|
+
|
||||||
|
+ (if rpm-spec-auto-topdir
|
||||||
|
+ (if (string-match ".*/SPECS/$" default-directory)
|
||||||
|
+ (let ((topdir (expand-file-name default-directory)))
|
||||||
|
+ (setq buildoptions
|
||||||
|
+ (cons
|
||||||
|
+ (concat "--define \"_topdir "
|
||||||
|
+ (replace-regexp-in-string "/SPECS/$" "" topdir)
|
||||||
|
+ "\"")
|
||||||
|
+ buildoptions)))))
|
||||||
|
+
|
||||||
|
+ (progn
|
||||||
|
+ (defun list->string (lst)
|
||||||
|
+ (if (cdr lst)
|
||||||
|
+ (concat (car lst) " " (list->string (cdr lst)))
|
||||||
|
+ (car lst)))
|
||||||
|
+ (compilation-start (list->string (cons rpm-spec-build-command buildoptions)) 'rpmbuild-mode))
|
||||||
|
+
|
||||||
|
+ (if (and rpm-spec-sign-gpg (not rpm-no-gpg))
|
||||||
|
+ (let ((build-proc (get-buffer-process
|
||||||
|
+ (get-buffer
|
||||||
|
+ (compilation-buffer-name "rpmbuild" nil nil))))
|
||||||
|
+ (rpm-passwd-cache (read-passwd "GPG passphrase: ")))
|
||||||
|
+ (process-send-string build-proc (concat rpm-passwd-cache "\n")))))
|
||||||
|
|
||||||
|
(defun rpm-build-prepare (&optional arg)
|
||||||
|
"Run a `rpmbuild -bp'."
|
||||||
|
@@ -1409,5 +1421,8 @@
|
||||||
|
;;;###autoload(add-to-list 'auto-mode-alist '("\\.spec\\(\\.in\\)?$" . rpm-spec-mode))
|
||||||
|
|
||||||
|
(provide 'rpm-spec-mode)
|
||||||
|
+;;;###autoload
|
||||||
|
+(define-compilation-mode rpmbuild-mode "RPM build" ""
|
||||||
|
+ (set (make-local-variable 'compilation-disable-input) t))
|
||||||
|
|
||||||
|
;;; rpm-spec-mode.el ends here
|
@ -1,20 +1,5 @@
|
|||||||
;; Aspell is a replacement for ispell
|
;;; loaded before user's ".emacs" file and default.el
|
||||||
(setq-default ispell-program-name "aspell")
|
|
||||||
|
|
||||||
;; Add python support
|
;; load ".el" files in "/usr/share/emacs/site-lisp/site-start.d/" on startup
|
||||||
(require 'python-mode)
|
(mapc 'load
|
||||||
(setq auto-mode-alist
|
(directory-files "/usr/share/emacs/site-lisp/site-start.d" t "\\.el\\'"))
|
||||||
(cons '("\\.py$" . python-mode) auto-mode-alist))
|
|
||||||
(setq interpreter-mode-alist
|
|
||||||
(cons '("python" . python-mode) interpreter-mode-alist))
|
|
||||||
|
|
||||||
;; run functions from the /usr/share/emacs/site-lisp/site-start.d directory
|
|
||||||
;; Files in this directory ending with ".el" are run on startup
|
|
||||||
|
|
||||||
(require 'cl) ; mapc isn't built into emacs 20
|
|
||||||
(mapc 'load (directory-files "/usr/share/emacs/site-lisp/site-start.d" t "\\.el\\'"))
|
|
||||||
|
|
||||||
;; Use the rpm-spec-mode for spec files
|
|
||||||
(require 'rpm-spec-mode)
|
|
||||||
(setq auto-mode-alist
|
|
||||||
(cons '("\\.spec$" . rpm-spec-mode) auto-mode-alist))
|
|
||||||
|
6
sources
6
sources
@ -1,5 +1 @@
|
|||||||
367bc83b70bd10b8908549087b73530d elisp-manual-21-2.6.tar.bz2
|
6949df37caec2d7a2e0eee3f1b422726 emacs-22.1.tar.gz
|
||||||
7c55c72e7cc8f1cb49b57b670b82dba2 emacs-20.7.tar.bz2
|
|
||||||
606b7415499a88b839a7cf414e3caaa8 emacs-asian.tar.bz2
|
|
||||||
9395bc6d85f12471ee8f1f9bd6988d9e gnus-5.8.8-compiled.tar.bz2
|
|
||||||
112c8f7493ef295fc9022feb4653eab0 leim-20.7.tar.bz2
|
|
||||||
|
201
ssl.el
Normal file
201
ssl.el
Normal file
@ -0,0 +1,201 @@
|
|||||||
|
;;; ssl.el,v --- ssl functions for emacsen without them builtin
|
||||||
|
;; Author: wmperry
|
||||||
|
;; Created: 1999/10/14 12:44:18
|
||||||
|
;; Version: 1.2
|
||||||
|
;; Keywords: comm
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;;; Copyright (c) 1995, 1996 by William M. Perry <wmperry@cs.indiana.edu>
|
||||||
|
;;; Copyright (c) 1996 - 1999 Free Software Foundation, Inc.
|
||||||
|
;;;
|
||||||
|
;;; This file is part of GNU Emacs.
|
||||||
|
;;;
|
||||||
|
;;; GNU Emacs 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 2, or (at your option)
|
||||||
|
;;; any later version.
|
||||||
|
;;;
|
||||||
|
;;; GNU Emacs 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 GNU Emacs; see the file COPYING. If not, write to the
|
||||||
|
;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
;;; Boston, MA 02111-1307, USA.
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
(require 'cl)
|
||||||
|
(require 'base64)
|
||||||
|
|
||||||
|
(eval-and-compile
|
||||||
|
(condition-case ()
|
||||||
|
(require 'custom)
|
||||||
|
(error nil))
|
||||||
|
(if (and (featurep 'custom) (fboundp 'custom-declare-variable))
|
||||||
|
nil ;; We've got what we needed
|
||||||
|
;; We have the old custom-library, hack around it!
|
||||||
|
(defmacro defgroup (&rest args)
|
||||||
|
nil)
|
||||||
|
(defmacro defcustom (var value doc &rest args)
|
||||||
|
(` (defvar (, var) (, value) (, doc))))))
|
||||||
|
|
||||||
|
(defgroup ssl nil
|
||||||
|
"Support for `Secure Sockets Layer' encryption."
|
||||||
|
:group 'comm)
|
||||||
|
|
||||||
|
(defcustom ssl-certificate-directory "~/.w3/certs/"
|
||||||
|
"*Directory to store CA certificates in"
|
||||||
|
:group 'ssl
|
||||||
|
:type 'directory)
|
||||||
|
|
||||||
|
(defcustom ssl-rehash-program-name "c_rehash"
|
||||||
|
"*Program to run after adding a cert to a directory .
|
||||||
|
Run with one argument, the directory name."
|
||||||
|
:group 'ssl
|
||||||
|
:type 'string)
|
||||||
|
|
||||||
|
(defcustom ssl-view-certificate-program-name "x509"
|
||||||
|
"*The program to run to provide a human-readable view of a certificate."
|
||||||
|
:group 'ssl
|
||||||
|
:type 'string)
|
||||||
|
|
||||||
|
(defcustom ssl-view-certificate-program-arguments '("-text" "-inform" "DER")
|
||||||
|
"*Arguments that should be passed to the certificate viewing program.
|
||||||
|
The certificate is piped to it.
|
||||||
|
Maybe a way of passing a file should be implemented"
|
||||||
|
:group 'ssl
|
||||||
|
:type 'list)
|
||||||
|
|
||||||
|
(defcustom ssl-certificate-directory-style 'ssleay
|
||||||
|
"*Style of cert database to use, the only valid value right now is `ssleay'.
|
||||||
|
This means a directory of pem encoded certificates with hash symlinks."
|
||||||
|
:group 'ssl
|
||||||
|
:type '(choice (const :tag "SSLeay" :value ssleay)
|
||||||
|
(const :tag "OpenSSL" :value openssl)))
|
||||||
|
|
||||||
|
(defcustom ssl-certificate-verification-policy 0
|
||||||
|
"*How far up the certificate chain we should verify."
|
||||||
|
:group 'ssl
|
||||||
|
:type '(choice (const :tag "No verification" :value 0)
|
||||||
|
(const :tag "Verification required" :value 1)
|
||||||
|
(const :tag "Reject connection if verification fails" :value 3)
|
||||||
|
(const :tag "SSL_VERIFY_CLIENT_ONCE" :value 5)))
|
||||||
|
|
||||||
|
(defcustom ssl-program-name "openssl"
|
||||||
|
"*The program to run in a subprocess to open an SSL connection."
|
||||||
|
:group 'ssl
|
||||||
|
:type 'string)
|
||||||
|
|
||||||
|
(defcustom ssl-program-arguments
|
||||||
|
'("s_client"
|
||||||
|
"-quiet"
|
||||||
|
"-host" host
|
||||||
|
"-port" service
|
||||||
|
"-verify" (int-to-string ssl-certificate-verification-policy)
|
||||||
|
"-CApath" ssl-certificate-directory
|
||||||
|
)
|
||||||
|
"*Arguments that should be passed to the program `ssl-program-name'.
|
||||||
|
This should be used if your SSL program needs command line switches to
|
||||||
|
specify any behaviour (certificate file locations, etc).
|
||||||
|
The special symbols 'host and 'port may be used in the list of arguments
|
||||||
|
and will be replaced with the hostname and service/port that will be connected
|
||||||
|
to."
|
||||||
|
:group 'ssl
|
||||||
|
:type 'list)
|
||||||
|
|
||||||
|
(defun ssl-certificate-information (der)
|
||||||
|
"Return an assoc list of information about a certificate in DER format."
|
||||||
|
(let ((certificate (concat "-----BEGIN CERTIFICATE-----\n"
|
||||||
|
(base64-encode-string der)
|
||||||
|
"\n-----END CERTIFICATE-----\n"))
|
||||||
|
(exit-code 0))
|
||||||
|
(save-excursion
|
||||||
|
(set-buffer (get-buffer-create " *openssl*"))
|
||||||
|
(erase-buffer)
|
||||||
|
(insert certificate)
|
||||||
|
(setq exit-code (condition-case ()
|
||||||
|
(call-process-region (point-min) (point-max)
|
||||||
|
ssl-program-name
|
||||||
|
t (list (current-buffer) nil) t
|
||||||
|
"x509"
|
||||||
|
"-subject" ; Print the subject DN
|
||||||
|
"-issuer" ; Print the issuer DN
|
||||||
|
"-dates" ; Both before and after dates
|
||||||
|
"-serial" ; print out serial number
|
||||||
|
"-noout" ; Don't spit out the certificate
|
||||||
|
)
|
||||||
|
(error -1)))
|
||||||
|
(if (/= exit-code 0)
|
||||||
|
nil
|
||||||
|
(let ((vals nil))
|
||||||
|
(goto-char (point-min))
|
||||||
|
(while (re-search-forward "^\\([^=\n\r]+\\)\\s *=\\s *\\(.*\\)" nil t)
|
||||||
|
(push (cons (match-string 1) (match-string 2)) vals))
|
||||||
|
vals)))))
|
||||||
|
|
||||||
|
(defun ssl-accept-ca-certificate ()
|
||||||
|
"Ask if the user is willing to accept a new CA certificate. The buffer-name
|
||||||
|
should be the intended name of the certificate, and the buffer should probably
|
||||||
|
be in DER encoding"
|
||||||
|
;; TODO, check if it is really new or if we already know it
|
||||||
|
(let* ((process-connection-type nil)
|
||||||
|
(tmpbuf (generate-new-buffer "X509 CA Certificate Information"))
|
||||||
|
(response (save-excursion
|
||||||
|
(and (eq 0
|
||||||
|
(apply 'call-process-region
|
||||||
|
(point-min) (point-max)
|
||||||
|
ssl-view-certificate-program-name
|
||||||
|
nil tmpbuf t
|
||||||
|
ssl-view-certificate-program-arguments))
|
||||||
|
(switch-to-buffer tmpbuf)
|
||||||
|
(goto-char (point-min))
|
||||||
|
(or (recenter) t)
|
||||||
|
(yes-or-no-p
|
||||||
|
"Accept this CA to vouch for secure server identities? ")
|
||||||
|
(kill-buffer tmpbuf)))))
|
||||||
|
(if (not response)
|
||||||
|
nil
|
||||||
|
(if (not (file-directory-p ssl-certificate-directory))
|
||||||
|
(make-directory ssl-certificate-directory))
|
||||||
|
(case ssl-certificate-directory-style
|
||||||
|
(ssleay
|
||||||
|
(base64-encode-region (point-min) (point-max))
|
||||||
|
(goto-char (point-min))
|
||||||
|
(insert "-----BEGIN CERTIFICATE-----\n")
|
||||||
|
(goto-char (point-max))
|
||||||
|
(insert "-----END CERTIFICATE-----\n")
|
||||||
|
(let ((f (expand-file-name
|
||||||
|
(concat (file-name-sans-extension (buffer-name)) ".pem")
|
||||||
|
ssl-certificate-directory)))
|
||||||
|
(write-file f)
|
||||||
|
(call-process ssl-rehash-program-name
|
||||||
|
nil nil nil
|
||||||
|
(expand-file-name ssl-certificate-directory))))))))
|
||||||
|
|
||||||
|
(defun open-ssl-stream (name buffer host service)
|
||||||
|
"Open a SSL connection for a service to a host.
|
||||||
|
Returns a subprocess-object to represent the connection.
|
||||||
|
Input and output work as for subprocesses; `delete-process' closes it.
|
||||||
|
Args are NAME BUFFER HOST SERVICE.
|
||||||
|
NAME is name for process. It is modified if necessary to make it unique.
|
||||||
|
BUFFER is the buffer (or buffer-name) to associate with the process.
|
||||||
|
Process output goes at end of that buffer, unless you specify
|
||||||
|
an output stream or filter function to handle the output.
|
||||||
|
BUFFER may be also nil, meaning that this process is not associated
|
||||||
|
with any buffer
|
||||||
|
Third arg is name of the host to connect to, or its IP address.
|
||||||
|
Fourth arg SERVICE is name of the service desired, or an integer
|
||||||
|
specifying a port number to connect to."
|
||||||
|
(if (integerp service) (setq service (int-to-string service)))
|
||||||
|
(let* ((process-connection-type nil)
|
||||||
|
(port service)
|
||||||
|
(proc (eval
|
||||||
|
(`
|
||||||
|
(start-process name buffer ssl-program-name
|
||||||
|
(,@ ssl-program-arguments))))))
|
||||||
|
(process-kill-without-query proc)
|
||||||
|
proc))
|
||||||
|
|
||||||
|
(provide 'ssl)
|
3
tramp-init.el
Normal file
3
tramp-init.el
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
;; setup tramp
|
||||||
|
|
||||||
|
(add-to-list 'load-path "/usr/share/emacs/site-lisp/tramp")
|
Loading…
Reference in New Issue
Block a user