Mercurial > hg > xemacs-beta
annotate lisp/special-mode.el @ 5664:00fd55d635fb
Sync #'truncate-string-to-width with GNU, add tests for it.
lisp/ChangeLog addition:
2012-05-12 Aidan Kehoe <kehoea@parhasard.net>
* subr.el:
* subr.el (truncate-string-to-width):
Sync with GNU's version, use its test suite in mule-tests.el.
tests/ChangeLog addition:
2012-05-12 Aidan Kehoe <kehoea@parhasard.net>
* automated/mule-tests.el:
Test #'truncate-string-to-width, thank you Colin Walters.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sat, 12 May 2012 17:51:05 +0100 |
parents | dc37764a105b |
children |
rev | line source |
---|---|
5487
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
1 ;;; special-mode.el --- Special major mode to view specially formatted data |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
2 |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
3 ;; Copyright (C) 2011 Didier Verna <didier@xemacs.org> |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
4 |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
5 ;; Maintainer: Didier Verna <didier@xemacs.org> |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
6 ;; Keywords: dumped |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
7 |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
8 ;; This file is part of XEmacs. |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
9 |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
10 ;; XEmacs is free software; you can redistribute it and/or modify it |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
11 ;; under the terms of the GNU General Public License as published by the |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
12 ;; Free Software Foundation, either version 3 of the License, or (at your |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
13 ;; option) any later version. |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
14 |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
15 ;; XEmacs is distributed in the hope that it will be useful, but WITHOUT |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
16 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
17 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
18 ;; for more details. |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
19 |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
20 ;; You should have received a copy of the GNU General Public License |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
21 ;; along with XEmacs. If not, see <http://www.gnu.org/licenses/>. |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
22 |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
23 ;;; Commentary: |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
24 |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
25 ;; This file is dumped with XEmacs. |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
26 |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
27 |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
28 ;;; Code: |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
29 |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
30 ;; This code is imported from GNU Emacs 23.3.1 -- dvl |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
31 |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
32 (defvar special-mode-map |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
33 (let ((map (make-sparse-keymap))) |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
34 (suppress-keymap map) |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
35 (define-key map "q" 'quit-window) |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
36 (define-key map " " 'scroll-up) |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
37 (define-key map "\C-?" 'scroll-down) |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
38 (define-key map "?" 'describe-mode) |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
39 (define-key map ">" 'end-of-buffer) |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
40 (define-key map "<" 'beginning-of-buffer) |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
41 (define-key map "g" 'revert-buffer) |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
42 map)) |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
43 |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
44 (put 'special-mode 'mode-class 'special) |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
45 (define-derived-mode special-mode nil "Special" |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
46 "Parent major mode from which special major modes should inherit." |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
47 (setq buffer-read-only t)) |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
48 |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
49 |
dc37764a105b
Import special-mode from GNU Emacs.
Didier Verna <didier@lrde.epita.fr>
parents:
diff
changeset
|
50 ;;; special-mode.el ends here |