Why do you only discover bugs _after_ you've committed?
[slh] / linux-kernel.el
1 ;; linux-kernel.el --- Linux kernel related bits 'n' pieces   -*- Emacs-Lisp -*-
2
3 ;; Copyright (C) 2003 Steve Youngs
4
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: <2014-03-25 18:04:25 (steve)>
10 ;; Homepage:      None
11 ;; Keywords:      kernel linux
12
13 ;; This file is part of linux-kernel.
14
15 ;; Redistribution and use in source and binary forms, with or without
16 ;; modification, are permitted provided that the following conditions
17 ;; are met:
18 ;;
19 ;; 1. Redistributions of source code must retain the above copyright
20 ;;    notice, this list of conditions and the following disclaimer.
21 ;;
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.
25 ;;
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.
29 ;;
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.
41
42 ;;; Commentary:
43 ;; 
44 ;;   Here is a collection of things I find useful in the land of Linux
45 ;;   kernels.
46 ;;
47 ;;  Currently implemented features:
48 ;;
49 ;;    - Check the latest kernel versions `linux-kernel-check-latest'
50
51 ;;; Todo:
52 ;;
53 ;;     o View kernel ChangeLog-<version> files.
54 ;;
55 ;;     o Download official kernel patches (possibly entire kernels
56 ;;       too).
57 ;;
58 ;;     o Apply/revert patches to local workspace.
59 ;;
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
62 ;;       :-( ).
63 ;;
64 ;;     o Ensure that cc-mode is set up the way Linus likes when hacking
65 ;;       the kernel.
66 ;;
67 ;;     o Configure the kernel from within XEmacs 
68 ;;       (`make ([xg]|menu)?config').
69
70 ;;; ChangeLog:
71 ;;
72 ;; $Log: linux-kernel.el,v $
73 ;; Revision 1.1  2003-12-15 08:39:02+10  steve
74 ;; Initial revision
75 ;;
76
77 ;;; Code:
78 (eval-and-compile
79   (require 'working)
80   (autoload 'with-electric-help "ehelp"))
81
82 ;;;###autoload
83 (defun linux-kernel-commentary ()
84   "*Display the commentary section of linux-kernel.el."
85   (interactive)
86   (with-electric-help
87    '(lambda ()
88       (insert
89        (with-temp-buffer
90          (erase-buffer)
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*"))
97
98 ;;;###autoload
99 (defun linux-kernel-copyright ()
100   "*Display the copyright notice for Linux-Kernel."
101   (interactive)
102   (with-electric-help
103    '(lambda ()
104       (insert
105        (with-temp-buffer
106          (erase-buffer)
107          (insert-file-contents (locate-library "linux-kernel.el"))
108          (goto-char (point-min))
109          (re-search-forward ";;; Commentary" nil t)
110          (beginning-of-line)
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*"))
116
117 ;;;###autoload
118 (defun linux-kernel-check-latest ()
119   "Display a list of the latest kernel versions."
120   (interactive)
121   (let ((finger_banner (expand-file-name "finger_banner" (temp-directory)))
122         (obuf (get-buffer-create "*Linux Kernels*")))
123     (curl:download "https://www.kernel.org/finger_banner"
124                    finger_banner)
125     (with-electric-help
126      #'(lambda ()
127          (insert "The Latest Linux Kernels\n========================\n\n")
128          (goto-char (point-min))
129          (center-line 2)
130          (insert-file-contents finger_banner)
131          (delete-file finger_banner)
132          (buffer-string (current-buffer)))
133      obuf)))
134   
135 (provide 'linux-kernel)
136 ;;; linux-kernel.el ends here
137
138 ;Local Variables:
139 ;time-stamp-start: "Last-Modified:[     ]+\\\\?[\"<]+"
140 ;time-stamp-end: "\\\\?[\">]"
141 ;time-stamp-line-limit: 10
142 ;time-stamp-format: "%4y-%02m-%02d %02H:%02M:%02S (%u)"
143 ;End: