Mercurial > emacs
annotate lisp/case-table.el @ 10952:6069707b1151
Insure that all entry points call `bookmark-maybe-load-default-file'.
Changed format of bookmark-alist and therefore of bookmark files.
Have version stamps in bookmark files.
Automatically upgrade old bookmark files to new format.
Changed name of default bookmark file to ".emacs.bmk".
Replaced "Bookmark-menu" with "bookmark-bmenu". The
capitalization signified nothing; "bmenu" means "buffer-menu"
-- that is, bmenu code is for the dired-like of bookmarks that
appears when `list-bookmarks' is run, and the "bookmark-menu"
prefix is for the menu-bar.
Internally, use an alist instead of hardcoded list-positions
for storing bookmark information.
Applied <johng@media.mit.edu>'s patches for annotation support:
(bookmark-send-annotation, bookmark-read-annotation-mode)
(bookmark-edit-annotation-mode, bookmark-default-annotation-text)
(bookmark-read-annotation-text-func, bookmark-read-annotation)
(bookmark-send-edited-annotation, bookmark-edit-annotation):
New functions.
(bookmark-get-bookmark, bookmark-get-bookmark-record)
(bookmark-name-from-full-record, bookmark-set-name)
(bookmark-get-annotation, bookmark-set-annotation)
(bookmark-get-info-node, bookmark-set-info-node)
(bookmark-get-filename, bookmark-set-filename)
(bookmark-get-position, bookmark-set-position)
(bookmark-get-front-context-string, bookmark-set-front-context-string)
(bookmark-get-rear-context-string, bookmark-set-rear-context-string):
New subroutines.
(bookmark-file-format-version, bookmark-end-of-version-stamp-marker):
New variables.
(bookmark-grok-file-format-version, bookmark-maybe-upgrade-file-format)
(bookmark-upgrade-version-0-alist, bookmark-upgrade-file-format-from-0)
(bookmark-insert-file-format-version-stamp): New functions.
(bookmark-maybe-load-default-file):
Renamed from bookmark-try-default-file'.
(bookmark-old-default-file): New variable.
(bookmark-default-file): Renamed from `bookmark-file'.
New initial value, ".emacs.bmk".
(bookmark-make-cell): Use backquote.
Produce with the new format (Format Version 1).
Use `format' to strip text-properties.
(bookmark-write-file): Use `pp' instead of `princ'.
Call `bookmark-insert-file-format-version-stamp'.
(bookmark-all-names, bookmark-menu-popup-paned-bookmark-menu)
(bookmark-menu-build-paned-menu, bookmark-menu-popup-paned-menu)
(bookmark-insert-location): New functions.
(bookmark-completing-read): New function. Everyone who called
`completing-read' in the interactive spec now calls this.
(bookmark-load-hook): New hook.
(bookmark-make-menu-alist): Function deleted.
(bookmark-popup-menu-and-apply-function): replaces
`bookmark-make-menu-with-function'.
(bookmark-load): Use `bookmark-alist-from-buffer'.
Call `bookmark-maybe-upgrade-file-format'.
(bookmark-set): If Info mode, record Info-current-node.
Use `bookmark-bmenu-surreptitiously-rebuild-list'.
(bookmark-buffer-file-name): Handle Info files.
(bookmark-buffer-name): If Info mode, return Info-current-node.
(bookmark-jump-noselect): For info node, use Info-goto-node.
Use the helper functions, don't mess with the raw
alist (except in completion, which we'll take care of later).
Don't count on `bookmark-search-size' being correct; use the
length of `forward-str' and `behind-str' instead.
(bookmark-relocate): Use the helper functions; don't mess
with the raw alist except in completion.
(bookmark-rename): C-o in minibuffer now inserts old name.
(bookmark-delete): New arg BATCH.
(bookmark-bmenu-execute-deletions): Was `bookmark-bmenu-execute'.
Just call bookmark-delete with the BATCH arg.
Set the modification count and maybe save when done.
Save point intuitively.
(bookmark-insert-current-file-name): Just use `file-name-nondirectory'.
(bookmark-location): Made non-interactive.
(bookmark-bmenu-list): Replaces `list-bookmarks'.
Delete arg ANNOTATION. Use mapcar to simplify.
If not interactive-p, then use `set-buffer' instead of
`switch-to-buffer'.
(bookmark-kill-line): New function, used instead of kill-line.
(bookmark-search-size): Init to 16 instead of 500.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 11 Mar 1995 02:05:20 +0000 |
parents | 0e4831555b2c |
children | 5db7fb75222a |
rev | line source |
---|---|
2229
bd3c525fa6fc
Added standard library headers.
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
860
diff
changeset
|
1 ;;; case-table.el --- code to extend the character set and support case tables. |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
696
diff
changeset
|
2 |
7300 | 3 ;; Copyright (C) 1988, 1994 Free Software Foundation, Inc. |
846
20674ae6bf52
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
807
diff
changeset
|
4 |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
696
diff
changeset
|
5 ;; Author: Howard Gayle |
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
696
diff
changeset
|
6 ;; Maintainer: FSF |
3012
d4b85bbedee8
Change "i14n" keyword to "i18n".
Jim Blandy <jimb@redhat.com>
parents:
2386
diff
changeset
|
7 ;; Keywords: i18n |
36 | 8 |
9 ;; This file is part of GNU Emacs. | |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
696
diff
changeset
|
13 ;; the Free Software Foundation; either version 2, or (at your option) |
36 | 14 ;; any later version. |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
22 ;; along with GNU Emacs; see the file COPYING. If not, write to | |
23 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
24 | |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
696
diff
changeset
|
25 ;;; Commentary: |
36 | 26 |
27 ;; Written by: | |
28 ;; TN/ETX/TX/UMG Howard Gayle UUCP : seismo!enea!erix!howard | |
29 ;; Telefonaktiebolaget L M Ericsson Phone: +46 8 719 55 65 | |
30 ;; Ericsson Telecom Telex: 14910 ERIC S | |
31 ;; S-126 25 Stockholm FAX : +46 8 719 64 82 | |
32 ;; Sweden | |
33 | |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
696
diff
changeset
|
34 ;;; Code: |
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
696
diff
changeset
|
35 |
2385 | 36 ;;;###autoload |
36 | 37 (defun describe-buffer-case-table () |
38 "Describe the case table of the current buffer." | |
39 (interactive) | |
40 (let ((vector (make-vector 256 nil)) | |
3550
0d8c66f2e25e
(describe-buffer-case-table): Merge locals i and ch.
Richard M. Stallman <rms@gnu.org>
parents:
3012
diff
changeset
|
41 (ch 0)) |
0d8c66f2e25e
(describe-buffer-case-table): Merge locals i and ch.
Richard M. Stallman <rms@gnu.org>
parents:
3012
diff
changeset
|
42 (while (< ch 256) |
0d8c66f2e25e
(describe-buffer-case-table): Merge locals i and ch.
Richard M. Stallman <rms@gnu.org>
parents:
3012
diff
changeset
|
43 (aset vector ch |
36 | 44 (cond ((/= ch (downcase ch)) |
45 (concat "uppercase, matches " | |
7156
4d86978056b1
(describe-buffer-case-table): Don't use text-char-description.
Richard M. Stallman <rms@gnu.org>
parents:
3550
diff
changeset
|
46 (char-to-string (downcase ch)))) |
36 | 47 ((/= ch (upcase ch)) |
48 (concat "lowercase, matches " | |
7156
4d86978056b1
(describe-buffer-case-table): Don't use text-char-description.
Richard M. Stallman <rms@gnu.org>
parents:
3550
diff
changeset
|
49 (char-to-string (upcase ch)))) |
36 | 50 (t "case-invariant"))) |
3550
0d8c66f2e25e
(describe-buffer-case-table): Merge locals i and ch.
Richard M. Stallman <rms@gnu.org>
parents:
3012
diff
changeset
|
51 (setq ch (1+ ch))) |
0d8c66f2e25e
(describe-buffer-case-table): Merge locals i and ch.
Richard M. Stallman <rms@gnu.org>
parents:
3012
diff
changeset
|
52 (save-excursion |
0d8c66f2e25e
(describe-buffer-case-table): Merge locals i and ch.
Richard M. Stallman <rms@gnu.org>
parents:
3012
diff
changeset
|
53 (with-output-to-temp-buffer "*Help*" |
0d8c66f2e25e
(describe-buffer-case-table): Merge locals i and ch.
Richard M. Stallman <rms@gnu.org>
parents:
3012
diff
changeset
|
54 (set-buffer standard-output) |
9858
0e4831555b2c
(describe-buffer-case-table): Set help-mode in *Help* buffer.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
55 (describe-vector vector) |
0e4831555b2c
(describe-buffer-case-table): Set help-mode in *Help* buffer.
Karl Heuer <kwzh@gnu.org>
parents:
7300
diff
changeset
|
56 (help-mode))))) |
36 | 57 |
2385 | 58 ;;;###autoload |
2386
ded35864afbe
(set-case-syntax-delims, set-case-syntax-pair, set-case-syntax):
Richard M. Stallman <rms@gnu.org>
parents:
2385
diff
changeset
|
59 (defun set-case-syntax-delims (l r table) |
36 | 60 "Make characters L and R a matching pair of non-case-converting delimiters. |
2386
ded35864afbe
(set-case-syntax-delims, set-case-syntax-pair, set-case-syntax):
Richard M. Stallman <rms@gnu.org>
parents:
2385
diff
changeset
|
61 This sets the entries for L and R in TABLE, which is a string |
ded35864afbe
(set-case-syntax-delims, set-case-syntax-pair, set-case-syntax):
Richard M. Stallman <rms@gnu.org>
parents:
2385
diff
changeset
|
62 that will be used as the downcase part of a case table. |
7156
4d86978056b1
(describe-buffer-case-table): Don't use text-char-description.
Richard M. Stallman <rms@gnu.org>
parents:
3550
diff
changeset
|
63 It also modifies `standard-syntax-table' to |
696
904853a03d9a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
662
diff
changeset
|
64 indicate left and right delimiters." |
2386
ded35864afbe
(set-case-syntax-delims, set-case-syntax-pair, set-case-syntax):
Richard M. Stallman <rms@gnu.org>
parents:
2385
diff
changeset
|
65 (aset table l l) |
ded35864afbe
(set-case-syntax-delims, set-case-syntax-pair, set-case-syntax):
Richard M. Stallman <rms@gnu.org>
parents:
2385
diff
changeset
|
66 (aset table r r) |
36 | 67 (modify-syntax-entry l (concat "(" (char-to-string r) " ") |
68 (standard-syntax-table)) | |
69 (modify-syntax-entry r (concat ")" (char-to-string l) " ") | |
7156
4d86978056b1
(describe-buffer-case-table): Don't use text-char-description.
Richard M. Stallman <rms@gnu.org>
parents:
3550
diff
changeset
|
70 (standard-syntax-table))) |
36 | 71 |
2385 | 72 ;;;###autoload |
2386
ded35864afbe
(set-case-syntax-delims, set-case-syntax-pair, set-case-syntax):
Richard M. Stallman <rms@gnu.org>
parents:
2385
diff
changeset
|
73 (defun set-case-syntax-pair (uc lc table) |
36 | 74 "Make characters UC and LC a pair of inter-case-converting letters. |
2386
ded35864afbe
(set-case-syntax-delims, set-case-syntax-pair, set-case-syntax):
Richard M. Stallman <rms@gnu.org>
parents:
2385
diff
changeset
|
75 This sets the entries for characters UC and LC in TABLE, which is a string |
ded35864afbe
(set-case-syntax-delims, set-case-syntax-pair, set-case-syntax):
Richard M. Stallman <rms@gnu.org>
parents:
2385
diff
changeset
|
76 that will be used as the downcase part of a case table. |
7156
4d86978056b1
(describe-buffer-case-table): Don't use text-char-description.
Richard M. Stallman <rms@gnu.org>
parents:
3550
diff
changeset
|
77 It also modifies `standard-syntax-table' to give them the syntax of |
4d86978056b1
(describe-buffer-case-table): Don't use text-char-description.
Richard M. Stallman <rms@gnu.org>
parents:
3550
diff
changeset
|
78 word constituents." |
2386
ded35864afbe
(set-case-syntax-delims, set-case-syntax-pair, set-case-syntax):
Richard M. Stallman <rms@gnu.org>
parents:
2385
diff
changeset
|
79 (aset table uc lc) |
ded35864afbe
(set-case-syntax-delims, set-case-syntax-pair, set-case-syntax):
Richard M. Stallman <rms@gnu.org>
parents:
2385
diff
changeset
|
80 (aset table lc lc) |
36 | 81 (modify-syntax-entry lc "w " (standard-syntax-table)) |
7156
4d86978056b1
(describe-buffer-case-table): Don't use text-char-description.
Richard M. Stallman <rms@gnu.org>
parents:
3550
diff
changeset
|
82 (modify-syntax-entry uc "w " (standard-syntax-table))) |
36 | 83 |
2385 | 84 ;;;###autoload |
2386
ded35864afbe
(set-case-syntax-delims, set-case-syntax-pair, set-case-syntax):
Richard M. Stallman <rms@gnu.org>
parents:
2385
diff
changeset
|
85 (defun set-case-syntax (c syntax table) |
36 | 86 "Make characters C case-invariant with syntax SYNTAX. |
2386
ded35864afbe
(set-case-syntax-delims, set-case-syntax-pair, set-case-syntax):
Richard M. Stallman <rms@gnu.org>
parents:
2385
diff
changeset
|
87 This sets the entries for character C in TABLE, which is a string |
ded35864afbe
(set-case-syntax-delims, set-case-syntax-pair, set-case-syntax):
Richard M. Stallman <rms@gnu.org>
parents:
2385
diff
changeset
|
88 that will be used as the downcase part of a case table. |
7156
4d86978056b1
(describe-buffer-case-table): Don't use text-char-description.
Richard M. Stallman <rms@gnu.org>
parents:
3550
diff
changeset
|
89 It also modifies `standard-syntax-table'. |
36 | 90 SYNTAX should be \" \", \"w\", \".\" or \"_\"." |
2386
ded35864afbe
(set-case-syntax-delims, set-case-syntax-pair, set-case-syntax):
Richard M. Stallman <rms@gnu.org>
parents:
2385
diff
changeset
|
91 (aset table c c) |
7156
4d86978056b1
(describe-buffer-case-table): Don't use text-char-description.
Richard M. Stallman <rms@gnu.org>
parents:
3550
diff
changeset
|
92 (modify-syntax-entry c syntax (standard-syntax-table))) |
36 | 93 |
94 (provide 'case-table) | |
662
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
584
diff
changeset
|
95 |
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
584
diff
changeset
|
96 ;;; case-table.el ends here |