Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[d0e0b7]: emacs.el Maximize Restore History

Download this file

emacs.el    122 lines (107 with data), 3.3 kB

  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
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
(require 'cl)
(defvar ecl-search-string "")
(defun query-replace-ecl-doc (from-string to-string &optional delimited start end)
(interactive (query-replace-read-args "Query replace" nil))
(let ((remaining (member (buffer-file-name (current-buffer)) ecl-doc-files)))
(dolist (i (or remaining ecl-doc-files))
(let ((b (find-buffer-visiting i)))
(unless (equal b (current-buffer))
(switch-to-buffer b)
(beginning-of-buffer)))
(perform-replace from-string to-string t nil delimited nil nil
start end))))
(defun query-replace-regexp-ecl-doc (from-string to-string &optional delimited start end)
(interactive (query-replace-read-args "Query replace" nil))
(let ((remaining (member (buffer-file-name (current-buffer)) ecl-doc-files)))
(dolist (i (or remaining ecl-doc-files))
(let ((b (find-buffer-visiting i)))
(unless (equal b (current-buffer))
(switch-to-buffer b)
(beginning-of-buffer)))
(query-replace-regexp from-string to-string delimited start end))))
(defun search-ecl-doc (string)
(interactive "sString: ")
(setq ecl-search-string string)
(let ((remaining (member (buffer-file-name (current-buffer)) ecl-doc-files)))
(dolist (i (or remaining ecl-doc-files))
(let ((b (find-buffer-visiting i)))
(unless (equal b (current-buffer))
(print b)
(switch-to-buffer b)
(beginning-of-buffer)))
(print '*)
(setq case-fold-search t)
(if (search-forward string nil t)
(return)))))
(defun search-next-ecl-doc ()
(interactive)
(search-ecl-doc ecl-search-string))
(defun back-to-emacs ()
(interactive)
(switch-to-buffer "emacs.el"))
(defun next-ecl-doc ()
(interactive)
(let ((remaining (member (buffer-file-name (current-buffer)) ecl-doc-files)))
(when (cdr remaining)
(switch-to-buffer (find-buffer-visiting (cadr remaining))))))
(global-set-key [?\M-p ?\C-i] 'back-to-emacs)
(global-set-key [?\M-p ?\C-s] 'search-ecl-doc )
(global-set-key [?\M-p ?\C-n] 'search-next-ecl-doc )
(global-set-key [?\M-p ?\C-m] 'next-ecl-doc )
(global-set-key [?\M-p ?\C-p] 'ecl-load-symbols)
(setq auto-mode-alist (acons "\\.d\\'" 'c-mode auto-mode-alist))
(setq ecl-doc-files
(mapcar (lambda (x)
(set-buffer "emacs.el")
(concat (subseq (buffer-file-name (current-buffer)) 0 -8) x))
'(
"ecl.xml"
"asdf.xmlf"
"bibliography.xmlf"
"clos.xmlf"
"compiler.xmlf"
"copyright.xmlf"
"declarations.xmlf"
"discarded.xmlf"
"ecldev.xmlf"
"embed.xmlf"
"ffi.xmlf"
"gc.xmlf"
"internals.xmlf"
"interpreter.xmlf"
"intro.xmlf"
"io.xmlf"
"macros.xmlf"
"memory.xmlf"
"mop.xmlf"
"mp.xmlf"
"os.xmlf"
"pde.xmlf"
"preface.xmlf"
"ref_embed.xmlf"
"ref_memory.xmlf"
"ref_mp.xmlf"
"ref_os.xmlf"
"ref_signals.xmlf"
"signals.xmlf"
"standards.xmlf"
"uffi/ref_aggregate.xml"
"uffi/ref_declare.xml"
"uffi/ref_func_libr.xml"
"uffi/ref_object.xml"
"uffi/ref_primitive.xml"
"uffi/ref_string.xml"
)))
(mapcar 'find-file ecl-doc-files)
(defun ecl-doc-revert ()
(interactive)
(mapcar '(lambda (x) (let ((a (find-buffer-visiting x)))
(and a (switch-to-buffer a)
(revert-buffer t t))))
ecl-doc-files))
(defun ecl-doc-save ()
(interactive)
(mapcar '(lambda (x) (let ((a (find-buffer-visiting x)))
(and a (switch-to-buffer a)
(save-buffer 0))))
ecl-doc-files))