From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Virtual Info Help manual Date: Sat, 17 Apr 2010 02:45:45 +0300 Organization: JURTA Message-ID: <87aat3klle.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1271462243 32543 80.91.229.12 (16 Apr 2010 23:57:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 16 Apr 2010 23:57:23 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 17 01:57:22 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O2vPT-0007i1-Dq for ged-emacs-devel@m.gmane.org; Sat, 17 Apr 2010 01:57:20 +0200 Original-Received: from localhost ([127.0.0.1]:36160 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2vPS-00027b-F2 for ged-emacs-devel@m.gmane.org; Fri, 16 Apr 2010 19:57:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O2vPM-00026Q-VJ for emacs-devel@gnu.org; Fri, 16 Apr 2010 19:57:13 -0400 Original-Received: from [140.186.70.92] (port=38354 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2vPK-00024f-GT for emacs-devel@gnu.org; Fri, 16 Apr 2010 19:57:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O2vPI-0006vK-Dv for emacs-devel@gnu.org; Fri, 16 Apr 2010 19:57:10 -0400 Original-Received: from smtp-out2.starman.ee ([85.253.0.4]:55916 helo=mx2.starman.ee) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2vPH-0006um-M7 for emacs-devel@gnu.org; Fri, 16 Apr 2010 19:57:08 -0400 X-Virus-Scanned: by Amavisd-New at mx2.starman.ee Original-Received: from mail.starman.ee (82.131.70.170.cable.starman.ee [82.131.70.170]) by mx2.starman.ee (Postfix) with ESMTP id 818B53F40C2 for ; Sat, 17 Apr 2010 02:57:02 +0300 (EEST) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:123788 Archived-At: --=-=-= There are two different sources of information about Emacs now: 1. Info manuals 2. Help documentation They have different UI for the same purpose. If the online Help documentation were in an Info manual, that would have several advantages: 1. the same UI for browsing online documentation - Info manuals or Help documentation alike. 2. consistent cross references between Info manuals. For instance, a cross reference (info "(*Help*) Function car") will go to a virtual Info node equivalent to `C-h f car RET'. Previously visited cross references will be highlighted in a different face. 3. common history The `l' command will go back in the history to the last Info node with a function's docstring, etc. 4. other rich Info functionality will be available for the online Help documentation. All this is easy to do using virtual Info manuals. The patch below implements a virtual Info manual *Help* with the following virtual nodes: * Top - a menu of top nodes. * About Emacs - like the About screen (`C-h C-a') displays the current version string and some useful links to other Emacs manuals. * Statistics - the memory usage (garbage collection stats, etc.) * Functions Index - a list of all defined functions * Functions by Prefix * Functions by Suffix - a list of functions grouped by common prefix/suffux * Function - like the output of `C-h f' with cross references to other Info nodes. * Variables Index - a list of all defined variables * Variables by Prefix * Variables by Suffix - a list of variables grouped by common prefix/suffux * Variable - like the output of `C-h v' with cross references to other Info nodes. * Buffers - a list of buffers * Buffer - complete information about buffer: name, major mode, cross references to nodes of its minor modes and buffer-local variables. * Mule Diagnosis - a menu for all chapters of `describe-*' functions ** Input Methods ** Coding Systems ** Character Sets ... --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline; filename=info-help.el Content-Transfer-Encoding: quoted-printable ;; info-help.el --- Emacs on-line help system as a virtual Info manual ;; Copyright (C) 2010 Free Software Foundation, Inc. ;; Author: Juri Linkov ;; Maintainer: FSF ;; Keywords: help ;; This file is part of GNU Emacs. ;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . ;;; Commentary: ;; This is the Emacs on-line help system implemented as a virtual Info manu= al. ;;; Code: (require 'info) (add-to-list 'Info-virtual-files '("\\`\\*Help\\*\\'" (toc-nodes . info-help-toc-nodes) (find-file . info-help-find-file) (find-node . info-help-find-node) )) (defvar info-help-dispatch '(("\\`Top\\'" . info-help-node-top) ("\\`About\\'" . info-help-node-about) ("\\`Functions\\(.*\\)\\'" . info-help-node-functions) ("\\`Function \\(.+\\)\\'" . info-help-node-function) ("\\`Variables\\(.*\\)\\'" . info-help-node-variables) ("\\`Variable \\(.+\\)\\'" . info-help-node-variable) ("\\`Buffers\\(.*\\)\\'" . info-help-node-buffers) ("\\`Buffer \\(.+\\)\\'" . info-help-node-buffer) ("\\`Mule\\(.*\\)\\'" . info-help-node-mule) ("\\`Input Methods\\'" . info-help-node-input-methods) ("\\`Input Method \\(.+\\)\\'" . info-help-node-input-method) ("\\`Coding Systems\\'" . info-help-node-coding-systems) ("\\`Coding System \\(.+\\)\\'" . info-help-node-coding-system) ("\\`Character Sets\\'" . info-help-node-character-sets) ("\\`Character Set \\(.+\\)\\'" . info-help-node-character-set) ("\\`Statistics\\'" . info-help-node-statistics) ) "Map a node name that matches a regexp to its rendering function.") (defvar info-help-node-menu-tree '(("Top" "About" "Functions" "Variables" "Buffers" "Mule Diagnosis" "Statistics") ("Functions" "Functions by Package" "Functions by Prefix" "Functions by Suffix" "Functions Index") ("Variables" "Variables by Package" "Variables by Prefix" "Variables by Suffix" "Variables Index") ("Mule Diagnosis" "Mule General Information" "Mule Display" "Input Methods" "Coding Systems" "Character Sets") )) (defvar info-help-cache-nodes "\\`Functions\\'") (defvar info-help-cached-nodes nil) (defun info-help-print-title-1 (text) (princ (format "%s\n%s\n\n" text (make-string (length text) ?*)))) (defun info-help-print-title-2 (text) (princ (format "%s\n%s\n\n" text (make-string (length text) ?=3D)))) (defun info-help-print-title-3 (text) (princ (format "%s\n%s\n\n" text (make-string (length text) ?-)))) (defun info-help-print-menu () (princ "* Menu:\n\n")) (defun info-help-link (link text) (format "*Note %s: %s." link text)) (defun info-help-toc-nodes (filename) "Help-specific implementation of info-help-toc-nodes." `(,filename ("Top" nil nil nil))) (defun info-help-find-file (filename &optional noerror) "Help-specific implementation of Info-find-file." filename) (defun info-help-find-node (filename nodename &optional no-going-back) "Help-specific implementation of Info-find-node-2." (if (assoc nodename info-help-cached-nodes) (insert (cdr (assoc nodename info-help-cached-nodes))) (insert (format "\n\^_\nFile: %s, Node: %s, Up: Top\n\n" (or filename Info-current-file) nodename)) (let ((fun (assoc-default nodename info-help-dispatch 'string-match))) (cond (fun (funcall fun nodename)) ((assoc nodename info-help-node-menu-tree) (let ((standard-output (current-buffer))) (princ (format "%s\n%s\n\n" nodename (make-string (length nodename) ?*))) (info-help-print-menu) (dolist (node (cdr (assoc nodename info-help-node-menu-tree))) (princ (format "* %s::%s.\n" node node))))) (t (info-help-node-404 nodename))) ;; Cache the current node. (if (and (stringp info-help-cache-nodes) (string-match-p info-help-cache-nodes nodename) (not (assoc nodename info-help-cached-nodes))) (push (cons nodename (buffer-string)) info-help-cached-nodes))))) ;;; Top (defun info-help-node-top (nodename) (let ((standard-output (current-buffer))) (info-help-print-title-1 "Info help") (info-help-print-menu) (dolist (node (cdr (assoc "Top" info-help-node-menu-tree))) (princ (format "* %s::%s.\n" node node))))) ;;; About (defun info-help-node-about (nodename) (let ((standard-output (current-buffer))) (info-help-print-title-1 "About Emacs") (insert "\ Emacs is the extensible, customizable, self-documenting real-time display editor. This on-line Emacs Info help system dynamically describes internals of Emacs; it corresponds to GNU Emacs version\n\n") (insert (emacs-version) "\n\n") (insert emacs-copyright "\n\n") (insert "\ To learn more about the Info documentation system, type `h', to visit a programmed instruction sequence for the Info commands.\n\n") (insert "\ For information on extending Emacs, see *note Emacs Lisp: (elisp)Top.\n\= n"))) ;;; Statistics (defun info-help-node-statistics (nodename) (let* ((standard-output (current-buffer)) (garbage-collection-messages nil) (g-c (garbage-collect)) (conses (nth 0 g-c)) (syms (nth 1 g-c)) (miscs (nth 2 g-c)) (string-chars (nth 3 g-c)) (vector-slots (nth 4 g-c)) (floats (nth 5 g-c)) (intervals (nth 6 g-c)) (strings (nth 7 g-c))) (info-help-print-title-1 "Statistics") (princ (format " Uptime: %s\n\n" (emacs-uptime))) (info-help-print-title-2 "Memory") (dolist (row `(("Cons cells" . ,(+ (car conses) (cdr conses))) ("Symbols" . ,(+ (car syms) (cdr syms))) ("Misc objects" . ,(+ (car miscs) (cdr miscs))) ("String chars" . ,string-chars) ("Vector slots" . ,vector-slots) ("Floats" . ,(+ (car floats) (cdr floats))) ("Intervals" . ,(+ (car intervals) (cdr intervals))) ("Strings" . ,(+ (car strings) (cdr strings))))) (princ (format " %-14s %9s\n" (concat (car row) ":") (cdr row)))))) ;;; Functions (defun info-help-node-functions (nodename) (let ((standard-output (current-buffer)) (nodetype (match-string 1 nodename))) (cond ;; Main menu of Functions. ((equal nodetype "") (info-help-print-title-1 "Functions") (info-help-print-menu) (dolist (node (cdr (assoc "Functions" info-help-node-menu-tree))) (princ (format "* %s::%s.\n" node node)))) ;; Functions by Prefix/Suffix (and the value prefix/suffix if specifie= d). ((string-match " by \\(Prefix\\|Suffix\\)\\(?: \\(.+\\)\\)?" nodetype) (princ (format "%s\n%s\n\n" nodename (make-string (length nodename) ?= *))) (info-help-print-menu) (cond ;; Display functions that match the specified prefix/suffix. ((match-string 2 nodetype) (let ((by-prefix (equal (match-string 1 nodetype) "Prefix")) (prefix-suffix (match-string 2 nodetype))) (let (functions) (mapatoms (lambda (symbol) (if (and (fboundp symbol) (equal prefix-suffix (if by-prefix (car (split-string (format "%S" symbol) "-" t)) (car (last (split-string (format "%S" symbol) "-" t)))))) (push symbol functions)))) (mapcar (lambda (function) (princ (format "* Function %S::.\n" function))) (sort functions 'string<))))) ;; Display a menu of all prefixes/suffixes. (t (let ((by-prefix (equal (match-string 1 nodetype) "Prefix")) (prefix-hash (make-hash-table :test 'equal))) (mapatoms (lambda (symbol) (when (fboundp symbol) (let ((prefix (if by-prefix (car (split-string (format "%S" symbol) "-" t)) (car (last (split-string (format "%S" symbol) "-" t)))))) (puthash prefix (1+ (gethash prefix prefix-hash 0)) prefix-hash))))) (mapcar (lambda (prefix) (princ (format "* Functions by %s %s:: %s.\n" (if by-prefix "Prefix" "Suffix") (car prefix) (cdr prefix)))) (sort (let (prefix-list) (maphash (lambda (key value) (push (cons key value) prefix-list)) prefix-hash) prefix-list) (lambda (a b) (if (=3D (cdr b) (cdr a)) (string< (car a) (car b)) (< (cdr b) (cdr a)))))))))) ;; Index of Functions. ((equal nodetype " Index") (info-help-print-title-1 "Functions") (info-help-print-menu) (let (functions) (mapatoms (lambda (symbol) (if (fboundp symbol) (push symbol functions)))) (mapcar (lambda (function) (princ (format "* Function %S::.\n" function))) (sort functions 'string<)))) (t (info-help-node-404 nodename))))) (defun info-help-node-function (nodename) (let* ((standard-output (current-buffer)) (function-name (match-string 1 nodename)) (function (intern function-name)) see-also) (info-help-print-title-1 (format "Function %s" function-name)) (info-help-print-title-2 "SYNOPSIS") ; remove this clutter line (princ (format "%S\n\n" (help-make-usage function (help-function-arglis= t function)))) (info-help-print-title-2 "DESCRIPTION") ; remove this clutter line (princ (format "%s\n\n" (documentation function))) (info-help-print-title-2 "FILES") (princ (format "%s\n\n" (find-lisp-object-file-name function function))) (save-excursion (while (re-search-backward "`\\([a-z-]+\\)'" nil t) (cond ((and (fboundp (intern (match-string 1))) (not (equal (match-string 1) function-name))) (replace-match (let ((link (info-help-link (match-string 1) (concat "Function " (match-string 1))))) (push link see-also) link) nil t)) ((boundp (intern (match-string 1))) (replace-match (let ((link (info-help-link (match-string 1) (concat "Variable " (match-string 1))))) (push link see-also) link) nil t))))) (when see-also (info-help-print-title-2 "SEE ALSO") (dolist (item (sort see-also 'string<)) (princ (format "%s\n" item)))))) ;;; Variables (defun info-help-node-variables (nodename) (let ((standard-output (current-buffer)) (nodetype (match-string 1 nodename))) (cond ;; Main menu of Variables. ((equal nodetype "") (info-help-print-title-1 "Variables") (info-help-print-menu) (dolist (node (cdr (assoc "Variables" info-help-node-menu-tree))) (princ (format "* %s::%s.\n" node node)))) ;; Variables by Prefix/Suffix (and the value prefix/suffix if specifie= d). ((string-match " by \\(Prefix\\|Suffix\\)\\(?: \\(.+\\)\\)?" nodetype) (princ (format "%s\n%s\n\n" nodename (make-string (length nodename) ?= *))) (info-help-print-menu) (cond ;; Display variables that match the specified prefix/suffix. ((match-string 2 nodetype) (let ((by-prefix (equal (match-string 1 nodetype) "Prefix")) (prefix-suffix (match-string 2 nodetype))) (let (variables) (mapatoms (lambda (symbol) (if (and (boundp symbol) (equal prefix-suffix (if by-prefix (car (split-string (format "%S" symbol) "-" t)) (car (last (split-string (format "%S" symbol) "-" t)))))) (push symbol variables)))) (mapcar (lambda (variable) (princ (format "* Variable %S::.\n" variable))) (sort variables 'string<))))) ;; Display a menu of all prefixes/suffixes. (t (let ((by-prefix (equal (match-string 1 nodetype) "Prefix")) (prefix-hash (make-hash-table :test 'equal))) (mapatoms (lambda (symbol) (when (boundp symbol) (let ((prefix (if by-prefix (car (split-string (format "%S" symbol) "-" t)) (car (last (split-string (format "%S" symbol) "-" t)))))) (puthash prefix (1+ (gethash prefix prefix-hash 0)) prefix-hash))))) (mapcar (lambda (prefix) (princ (format "* Variables by %s %s:: %s.\n" (if by-prefix "Prefix" "Suffix") (car prefix) (cdr prefix)))) (sort (let (prefix-list) (maphash (lambda (key value) (push (cons key value) prefix-list)) prefix-hash) prefix-list) (lambda (a b) (if (=3D (cdr b) (cdr a)) (string< (car a) (car b)) (< (cdr b) (cdr a)))))))))) ;; Index of Variables. ((equal nodetype " Index") (info-help-print-title-1 "Variables") (info-help-print-menu) (let (variables) (mapatoms (lambda (symbol) (if (boundp symbol) (push symbol variables)))) (mapcar (lambda (variable) (princ (format "* Variable %S::.\n" variable))) (sort variables 'string<)))) (t (info-help-node-404 nodename))))) (defun info-help-node-variable (nodename) (let* ((standard-output (current-buffer)) (variable-name (match-string 1 nodename)) (variable (intern variable-name))) (info-help-print-title-1 (format "Variable %s" variable-name)) (info-help-print-title-2 "DESCRIPTION") (princ (format "%s\n\n" (documentation-property variable 'variable-docu= mentation))) (info-help-print-title-2 "VALUE") (princ (format "%s\n\n" (pp-to-string (symbol-value variable)))) (info-help-print-title-2 "FILES") (princ (format "%s\n\n" (find-lisp-object-file-name variable 'defvar))) (while (re-search-backward "`\\([^`']+\\)'" nil t) (if (and (boundp (intern (match-string 1))) (not (equal (match-string 1) variable-name))) (replace-match (info-help-link (match-string 1) (concat "Variable " (match-string 1))) nil t))))) ;;; Buffers (defun info-help-node-buffers (nodename) (let ((standard-output (current-buffer))) (info-help-print-title-1 "Buffers") (info-help-print-menu) (mapcar (lambda (buffer) (princ (format "* Buffer %s::.\n" (buffer-name buffer)))) (buffer-list)))) (defun info-help-node-buffer (nodename) (let* ((standard-output (current-buffer)) (buffer-name (match-string 1 nodename)) (buffer (get-buffer buffer-name))) (info-help-print-title-1 (format "Buffer %s" buffer-name)) (dolist (row (with-current-buffer buffer `(("Buffer name" . ,buffer-name) ("Major mode" . ,(info-help-link (format "%S" major-mode) (format "Function %S" major-mode))) ("Mode name" . ,(format-mode-line mode-name nil nil buffer)) ("Read only" . ,buffer-read-only) ("Modified" . ,(buffer-modified-p buffer)) ("Modtime" . ,(and (not (eq (visited-file-modtime) 0)) (format-time-string "%Y-%m-%d %T %z" (visited-file-modtime)))) ("Size" . ,(buffer-size)) ("Saved size" . ,buffer-saved-size) ("Backed up" . ,buffer-backed-up) ("Directory" . ,default-directory) ("File name" . ,(buffer-file-name buffer)) ("File truename" . ,buffer-file-truename) ("File format" . ,buffer-file-format) ("File coding system" . ,(info-help-link (format "%S" buffer-file-coding-system) (format "Coding system %S" buffer-file-coding-system))) ("Display time" . ,(and (boundp 'buffer-display-time) (format-time-string "%Y-%m-%d %T %z" buffer-display-time))) ("Display count" . ,(and (boundp 'buffer-display-count) buffer-display-count))))) (princ (format " %-20s %s\n" (concat (car row) ":") (cdr row)))) (princ "\n") (info-help-print-title-2 "Minor modes") (dolist (minor-mode (sort (with-current-buffer buffer (copy-sequence minor-mode-alist)) (lambda (a b) (string< (car a) (car b))))) (princ (format " %s\n" (info-help-link (format "%S" (car minor-mode)) (format "Function %S" (car minor-mode)))))) (princ "\n") (info-help-print-title-2 "Buffer local variables") (dolist (buffer-local (sort (buffer-local-variables buffer) (lambda (a b) (string< (car a) (car b))))) (princ (format " %s\n" (info-help-link (format "%S" (car buffer-local)) (format "Variable %S" (car buffer-local)))))) )) ;;; Mule (defun info-help-node-mule (nodename) (let ((standard-output (current-buffer)) (nodetype (match-string 1 nodename))) (cond ;; Main menu of Mule Diagnosis. ((equal nodetype " Diagnosis") (info-help-print-title-1 "Mule Diagnosis") (info-help-print-menu) (dolist (node (cdr (assoc "Mule Diagnosis" info-help-node-menu-tree))) (princ (format "* %s::%s.\n" node node)))) ;; General Information. ((equal nodetype " General Information") (info-help-print-title-1 "General Information") ;; Copied from `mule-diag'. (insert "Version of this emacs:\n " (emacs-version) "\n\n") (insert "Configuration options:\n " system-configuration-options "\n= \n") (insert "Multibyte characters awareness:\n" (format " default: %S\n" (default-value 'enable-multibyte-characters)) (format " current-buffer: %S\n\n" enable-multibyte-characters)) (insert "Current language environment: " current-language-environment "\n\n") ) ;; Display. ((equal nodetype " Display") (info-help-print-title-1 "Display") ;; Copied from `mule-diag'. (if window-system (insert (format "Window-system: %s, version %s" window-system window-system-version)) (insert "Terminal: " (getenv "TERM"))) (insert "\n\n") (if window-system (let ((font (cdr (assq 'font (frame-parameters))))) (insert "The font and fontset of the selected frame are:\n" " font: " font "\n" " fontset: " (face-attribute 'default :fontset) "\n")) (insert "Coding system of the terminal: " (symbol-name (terminal-coding-system))))) (t (info-help-node-404 nodename))))) ;;; Input Methods (defun info-help-node-input-methods (nodename) (let ((standard-output (current-buffer))) (info-help-print-title-1 "Input Methods") (info-help-print-menu) (mapcar (lambda (input-method) (princ (format "* Input Method %s::.\n" (car input-method)))) (sort (copy-sequence input-method-alist) (lambda (x y) (string< (car x) (car y))))))) (defun info-help-node-input-method (nodename) (let* ((standard-output (current-buffer)) (input-method-name (match-string 1 nodename)) (input-method (intern input-method-name))) (info-help-print-title-1 (format "Input Method %s" input-method-name)) ;; Copied from `describe-input-method'. (if (and input-method (symbolp input-method)) (setq input-method (symbol-name input-method))) (princ (let ((current current-input-method) (temp-buffer-show-function (lambda (b))) (inhibit-read-only t)) (condition-case nil (progn (save-excursion (activate-input-method input-method) (describe-current-input-method)) (activate-input-method current)) (error (activate-input-method current))) (with-current-buffer (help-buffer) (untabify (point-min) (point-max)) (buffer-string)))))) ;;; Coding Systems (defun info-help-node-coding-systems (nodename) (let ((standard-output (current-buffer))) (info-help-print-title-1 "Coding Systems") (info-help-print-menu) (mapcar (lambda (coding-system) (princ (format "* Coding System %S::.\n" coding-system))) (sort-coding-systems (coding-system-list 'base-only))))) (defun info-help-node-coding-system (nodename) (let* ((standard-output (current-buffer)) (coding-system-name (match-string 1 nodename)) (coding-system (intern coding-system-name))) (info-help-print-title-1 (format "Coding System %s" coding-system-name)) ;; (print-coding-system coding-system) ;; (print-coding-system-briefly coding-system 'tightly) (print-coding-system-briefly coding-system 'doc-string) )) ;;; Character Sets (defun info-help-node-character-sets (nodename) (let ((standard-output (current-buffer))) (info-help-print-title-1 "Character Sets") (info-help-print-menu) (mapcar (lambda (charset) (princ (format "* Character Set %S::.\n" charset))) (sort (copy-sequence charset-list) 'string<)))) (defun info-help-node-character-set (nodename) (let* ((standard-output (current-buffer)) (charset-name (match-string 1 nodename)) (charset (intern charset-name))) (info-help-print-title-1 (format "Character Set %s" charset-name)) (dolist (row `(("Name" . ,charset-name) ("Dimension" . ,(charset-dimension charset)) ("Chars" . ,(charset-chars charset)) ("Final char" . ,(charset-iso-final-char charset)) ("Description" . ,(charset-description charset)) )) (princ (format " %-20s %s\n" (concat (car row) ":") (cdr row)))) (princ "\n") (princ (let ((temp-buffer-show-function (lambda (b))) (inhibit-read-only t)) (list-charset-chars charset) (with-current-buffer "*Character List*" (untabify (point-min) (point-max)) (buffer-string)))))) ;;; Other (defun info-help-node-404 (nodename) (let* ((standard-output (current-buffer))) (info-help-print-title-1 "Info node not found") (princ (format "The node `%s' was not found.\n\n" nodename)) (princ "Please make a bug report using `M-x report-emacs-bug'.\n") (princ "For more information, *note (emacs)Bugs::.\n"))) ;;;###autoload (defun info-help () "Go to a node with a menu of visited nodes." (interactive) (Info-find-node "*Help*" "Top")) (provide 'info-help) ;;; info-help.el ends here --=-=-= -- Juri Linkov http://www.jurta.org/emacs/ --=-=-=--