1 ;; linux-kernel.el --- Linux kernel related bits 'n' pieces -*- Emacs-Lisp -*-
3 ;; Copyright (C) 2003 Steve Youngs
5 ;; RCS: $Id: linux-kernel.el,v 1.1 2003-12-15 08:39:02+10 steve Exp $
6 ;; Author: Steve Youngs <sryoungs@bigpond.net.au>
7 ;; Maintainer: Steve Youngs <sryoungs@bigpond.net.au>
8 ;; Created: <2003-12-15>
9 ;; Last-Modified: <2003-12-15 08:38:58 (steve)>
11 ;; Keywords: kernel linux
13 ;; This file is part of linux-kernel.
15 ;; Redistribution and use in source and binary forms, with or without
16 ;; modification, are permitted provided that the following conditions
19 ;; 1. Redistributions of source code must retain the above copyright
20 ;; notice, this list of conditions and the following disclaimer.
22 ;; 2. Redistributions in binary form must reproduce the above copyright
23 ;; notice, this list of conditions and the following disclaimer in the
24 ;; documentation and/or other materials provided with the distribution.
26 ;; 3. Neither the name of the author nor the names of any contributors
27 ;; may be used to endorse or promote products derived from this
28 ;; software without specific prior written permission.
30 ;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
31 ;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
32 ;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
33 ;; DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
34 ;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
35 ;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
36 ;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
37 ;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
38 ;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
39 ;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
40 ;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44 ;; Here is a collection of things I find useful in the land of Linux
47 ;; Currently implemented features:
49 ;; - Check the latest kernel versions `linux-kernel-check-latest'
53 ;; o View kernel ChangeLog-<version> files.
55 ;; o Download official kernel patches (possibly entire kernels
58 ;; o Apply/revert patches to local workspace.
60 ;; o Create a TAGS table file that will actually work in XEmacs
61 ;; (the kernel's `make tags' doesn't work for me and my XEmacs
64 ;; o Ensure that cc-mode is set up the way Linus likes when hacking
67 ;; o Configure the kernel from within XEmacs
68 ;; (`make ([xg]|menu)?config').
72 ;; $Log: linux-kernel.el,v $
73 ;; Revision 1.1 2003-12-15 08:39:02+10 steve
80 (autoload 'with-electric-help "ehelp"))
83 (defun linux-kernel-commentary ()
84 "*Display the commentary section of linux-kernel.el."
91 (insert (lm-commentary (locate-library "linux-kernel.el")))
92 (goto-char (point-min))
93 (while (re-search-forward "^;+ ?" nil t)
94 (replace-match "" nil nil))
95 (buffer-string (current-buffer)))))
96 "*Linux-Kernel Commentary*"))
99 (defun linux-kernel-copyright ()
100 "*Display the copyright notice for Linux-Kernel."
107 (insert-file-contents (locate-library "linux-kernel.el"))
108 (goto-char (point-min))
109 (re-search-forward ";;; Commentary" nil t)
111 (narrow-to-region (point-min) (point))
112 (while (re-search-backward "^;+ ?" nil t)
113 (replace-match "" nil nil))
114 (buffer-string (current-buffer)))))
115 "*Linux-Kernel Copyright Notice*"))
118 (defun linux-kernel-check-latest ()
119 "Display a list of the latest kernel versions."
121 (let* ((host "www.kernel.org")
123 (file "finger_banner")
124 (path (concat dir file))
125 (coding-system-for-read 'binary)
126 (coding-system-for-write 'binary)
127 (user-agent (concat "XEmacs " emacs-program-version))
134 (pbuf (process-buffer http))
135 (obuf (get-buffer-create "*Latest Kernels*")))
138 (concat "GET " path " HTTP/1.1\r\n"
139 "MIME-Version: 1.0\r\n"
140 "Connection: close\r\n"
141 "Extension: Security/Digest Security/SSL\r\n"
144 "User-Agent: " user-agent "\r\n\r\n"))
145 (working-status-forms "Checking Kernel Version: " "Done!"
146 (while (eq (process-status http) 'open)
147 (working-dynamic-status nil)
149 (working-dynamic-status t))
153 (with-current-buffer pbuf
154 (goto-char (point-min))
155 (while (re-search-forward "\r" nil t) nil)
156 (kill-region (point-min) (point))
157 (insert "The Latest Linux Kernels\n========================\n\n")
158 (goto-char (point-min))
160 (re-search-forward "^Process.*$" nil t)
162 (buffer-string (current-buffer)))))
166 (provide 'linux-kernel)
167 ;;; linux-kernel.el ends here
170 ;time-stamp-start: "Last-Modified:[ ]+\\\\?[\"<]+"
171 ;time-stamp-end: "\\\\?[\">]"
172 ;time-stamp-line-limit: 10
173 ;time-stamp-format: "%4y-%02m-%02d %02H:%02M:%02S (%u)"