Commit 14931973 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(finder-known-keywords): Use i18n, not i14n.

(finder-compile-keywords): Substitute i18n for i14n.
Turn off undo in *finder-scratch*.  Ignore file names starting with =.
(finder-mode, finder-current-item): Rename headmark to finder-headmark.
(finder-list-matches, finder-list-keywords): Likewise.
parent f62d1f9f
...@@ -41,6 +41,9 @@ ...@@ -41,6 +41,9 @@
(require 'finder-inf) (require 'finder-inf)
(require 'picture) (require 'picture)
;; Local variable in finder buffer.
(defvar finder-headmark)
(defvar finder-known-keywords (defvar finder-known-keywords
'( '(
(abbrev . "abbreviation handling, typing shortcuts, macros") (abbrev . "abbreviation handling, typing shortcuts, macros")
...@@ -54,7 +57,7 @@ ...@@ -54,7 +57,7 @@
(games . "games, jokes and amusements") (games . "games, jokes and amusements")
(hardware . "support for interfacing with exotic hardware") (hardware . "support for interfacing with exotic hardware")
(help . "support for on-line help systems") (help . "support for on-line help systems")
(i14n . "internationalization and alternate character-set support") (i18n . "internationalization and alternate character-set support")
(internal . "code for Emacs internals, build process, defaults") (internal . "code for Emacs internals, build process, defaults")
(languages . "specialized modes for editing programming languages") (languages . "specialized modes for editing programming languages")
(lisp . "Lisp support, including Emacs Lisp") (lisp . "Lisp support, including Emacs Lisp")
...@@ -87,7 +90,7 @@ ...@@ -87,7 +90,7 @@
"Assoc list mapping file names to description & keyword lists.") "Assoc list mapping file names to description & keyword lists.")
(defun finder-compile-keywords (&rest dirs) (defun finder-compile-keywords (&rest dirs)
"Regenerate the keywords association list into the file finder-inf.el. "Regenerate the keywords association list into the file `finder-inf.el'.
Optional arguments are a list of Emacs Lisp directories to compile from; no Optional arguments are a list of Emacs Lisp directories to compile from; no
arguments compiles from `load-path'." arguments compiles from `load-path'."
(save-excursion (save-excursion
...@@ -106,11 +109,13 @@ arguments compiles from `load-path'." ...@@ -106,11 +109,13 @@ arguments compiles from `load-path'."
(mapcar (mapcar
(function (function
(lambda (f) (lambda (f)
(if (and (string-match "\\.el$" f) (not (member f processed))) (if (and (string-match "^[^=].*\\.el$" f)
(let (summary keystart) (not (member f processed)))
(let (summary keystart keywords)
(setq processed (cons f processed)) (setq processed (cons f processed))
(save-excursion (save-excursion
(set-buffer (get-buffer-create "*finder-scratch*")) (set-buffer (get-buffer-create "*finder-scratch*"))
(buffer-disable-undo (current-buffer))
(erase-buffer) (erase-buffer)
(insert-file-contents (insert-file-contents
(concat (file-name-as-directory (or d ".")) f)) (concat (file-name-as-directory (or d ".")) f))
...@@ -126,7 +131,11 @@ arguments compiles from `load-path'." ...@@ -126,7 +131,11 @@ arguments compiles from `load-path'."
(if keywords (format "(%s)" keywords) "nil") (if keywords (format "(%s)" keywords) "nil")
")\n") ")\n")
(subst-char-in-region keystart (point) ?, ? ) (subst-char-in-region keystart (point) ?, ? )
) (let ((end (point)))
(goto-char keystart)
(while (search-forward "i14n" end t)
(replace-match "i18n"))
(goto-char end)))
))) )))
(directory-files (or d "."))) (directory-files (or d ".")))
)) ))
...@@ -152,7 +161,7 @@ arguments compiles from `load-path'." ...@@ -152,7 +161,7 @@ arguments compiles from `load-path'."
(cons (symbol-name keyword) keyword)))) (cons (symbol-name keyword) keyword))))
finder-known-keywords) finder-known-keywords)
(goto-char (point-min)) (goto-char (point-min))
(setq headmark (point)) (setq finder-headmark (point))
(setq buffer-read-only t) (setq buffer-read-only t)
(set-buffer-modified-p nil) (set-buffer-modified-p nil)
(balance-windows) (balance-windows)
...@@ -164,7 +173,7 @@ arguments compiles from `load-path'." ...@@ -164,7 +173,7 @@ arguments compiles from `load-path'."
(let ((id (intern key))) (let ((id (intern key)))
(insert (insert
"The following packages match the keyword `" key "':\n\n") "The following packages match the keyword `" key "':\n\n")
(setq headmark (point)) (setq finder-headmark (point))
(mapcar (mapcar
(function (lambda (x) (function (lambda (x)
(if (memq id (car (cdr (cdr x)))) (if (memq id (car (cdr (cdr x))))
...@@ -206,7 +215,7 @@ arguments compiles from `load-path'." ...@@ -206,7 +215,7 @@ arguments compiles from `load-path'."
)) ))
(defun finder-current-item () (defun finder-current-item ()
(if (and headmark (< (point) headmark)) (if (and finder-headmark (< (point) finder-headmark))
(error "No keyword or filename on this line") (error "No keyword or filename on this line")
(save-excursion (save-excursion
(beginning-of-line) (beginning-of-line)
...@@ -239,8 +248,8 @@ arguments compiles from `load-path'." ...@@ -239,8 +248,8 @@ arguments compiles from `load-path'."
(set-syntax-table emacs-lisp-mode-syntax-table) (set-syntax-table emacs-lisp-mode-syntax-table)
(setq mode-name "Finder") (setq mode-name "Finder")
(setq major-mode 'finder-mode) (setq major-mode 'finder-mode)
(make-local-variable 'headmark) (make-local-variable 'finder-headmark)
(setq headmark nil) (setq finder-headmark nil)
) )
(defun finder-summary () (defun finder-summary ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment