unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Lars Magne Ingebrigtsen'" <larsi@gnus.org>
Cc: 8900@debbugs.gnu.org
Subject: bug#8900: 24.0.50; please index mentioned coding systems in Emacs manual
Date: Fri, 1 Jul 2011 08:54:44 -0700	[thread overview]
Message-ID: <A675BFE04CB14D95B80832D1908C5CAA@us.oracle.com> (raw)
In-Reply-To: <m3k4c2ggct.fsf@quimbies.gnus.org>

> > Maybe you were thinking of the `undecided, coding system' 
> > entry in the Concept Index?  That's close, but it is not
> > any of those I mentioned.
> 
> Yes, that's the one I meant.  And instead of adding all the
> `iso-latin-1-*' variations, I just added "`iso-latin-1', 
> coding system".
> 
> I think that should be sufficient for people who want to find these
> things in the index.

I disagree.  These are real, implementation, user-visible, runtime names.  This
is just like indexing command names or variable names or package names.  The
exact name should appear in the index.

Consider, for instance, the use case that brought this to my attention:

I have updated various Emacs `describe-...' commands so that a link to their
coverage in the manuals is added to the *Help* buffer.  This is based on finding
the term in question in the manual's index.  The match naturally should be an
exact match against index entries.

See http://lists.gnu.org/archive/html/emacs-devel/2011-06/msg00368.html.

With a proper fix to this bug as I requested, these particular, literal names
would appear in the index, and I could then add `describe-coding-system' to my
updates.  A user looking at the output of `describe-coding-system' for one of
these coding systems could click the link to get to its doc in the manual.

This is what I have in my TODO list:

;; ADD THIS ONE to help-fns+.el ONLY IF BUG #8900 is fixed.

;; REPLACE ORIGINAL in `mule-diag.el'
;;
;; Call `Info-make-manuals-xref' to create a cross-ref link to manuals.
;;
;;;###autoload
(when (> emacs-major-version 23); Before Emacs 24 no coding systems are indexed.
  (defun describe-coding-system (coding-system)
    "Display information about CODING-SYSTEM."
    (interactive "zDescribe coding system (default current choices): ")
    (require 'mule-diag)
    (if (null coding-system)
        (describe-current-coding-system)
      (help-setup-xref (list #'describe-coding-system coding-system)
                       (called-interactively-p 'interactive))
      (with-output-to-temp-buffer (help-buffer)
        (print-coding-system-briefly coding-system 'doc-string)
        (let ((type (coding-system-type coding-system))
              ;; Fixme: use this
              (extra-spec (coding-system-plist coding-system)))
          (princ "Type: ")
          (princ type)
          (cond ((eq type 'undecided)
                 (princ " (do automatic conversion)"))
                ((eq type 'utf-8)
                 (princ " (UTF-8: Emacs internal multibyte form)"))
                ((eq type 'utf-16)
                 ;; (princ " (UTF-16)")
                 )
                ((eq type 'shift-jis)
                 (princ " (Shift-JIS, MS-KANJI)"))
                ((eq type 'iso-2022)
                 (princ " (variant of ISO-2022)\n")
                 (princ "Initial designations:\n")
                 (print-designation (coding-system-get coding-system
                                                       :designation))

                 (when (coding-system-get coding-system :flags)
                   (princ "Other specifications: \n  ")
                   (apply #'print-list
                          (coding-system-get coding-system :flags))))
                ((eq type 'charset)
                 (princ " (charset)"))
                ((eq type 'ccl)
                 (princ " (do conversion by CCL program)"))
                ((eq type 'raw-text)
                 (princ " (text with random binary characters)"))
                ((eq type 'emacs-mule)
                 (princ " (Emacs 21 internal encoding)"))
                ((eq type 'big5))
                (t (princ ": invalid coding-system.")))
          (princ "\nEOL type: ")
          (let ((eol-type (coding-system-eol-type coding-system)))
            (cond ((vectorp eol-type)
                   (princ "Automatic selection from:\n\t")
                   (princ eol-type)
                   (princ "\n"))
                  ((or (null eol-type) (eq eol-type 0)) (princ "LF\n"))
                  ((eq eol-type 1) (princ "CRLF\n"))
                  ((eq eol-type 2) (princ "CR\n"))
                  (t (princ "invalid\n")))))
        (let ((postread (coding-system-get coding-system
:post-read-conversion)))
          (when postread
            (princ "After decoding text normally,")
            (princ " perform post-conversion using the function: ")
            (princ "\n  ")
            (princ postread)
            (princ "\n")))
        (let ((prewrite (coding-system-get coding-system
:pre-write-conversion)))
          (when prewrite
            (princ "Before encoding text normally,")
            (princ " perform pre-conversion using the function: ")
            (princ "\n  ")
            (princ prewrite)
            (princ "\n")))
        (with-current-buffer standard-output
          (let ((charsets (coding-system-charset-list coding-system)))
            (when (and (not (eq (coding-system-base coding-system) 'raw-text))
                       charsets)
              (cond
                ((eq charsets 'iso-2022)
                 (insert "This coding system can encode all ISO 2022
charsets."))
                ((eq charsets 'emacs-mule)
                 (insert "This coding system can encode all emacs-mule
charsets."""))
                (t
                 (insert "This coding system encodes the following charsets:\n
")
                 (while charsets
                   (insert " " (symbol-name (car charsets)))
                   (search-backward (symbol-name (car charsets)))
                   (help-xref-button 0 'help-character-set (car charsets))
                   (goto-char (point-max))
                   (setq charsets (cdr charsets)))))))
          (when (boundp 'Info-virtual-files) ; Emacs 23.2+
            (Info-make-manuals-xref coding-system)))))))






  reply	other threads:[~2011-07-01 15:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-20 15:24 bug#8900: 24.0.50; please index mentioned coding systems in Emacs manual Drew Adams
2011-07-01 14:28 ` Lars Magne Ingebrigtsen
2011-07-01 15:00   ` Drew Adams
2011-07-01 15:39     ` Lars Magne Ingebrigtsen
2011-07-01 15:54       ` Drew Adams [this message]
2011-07-01 17:52         ` Eli Zaretskii
2011-07-01 18:17           ` Drew Adams
2011-07-01 19:49             ` Eli Zaretskii
2011-07-01 21:00               ` Drew Adams
2011-07-02  6:11                 ` Eli Zaretskii
2011-07-02 14:37                   ` Drew Adams
2011-07-02 15:27                     ` Eli Zaretskii
2011-07-01 17:45   ` Eli Zaretskii
2011-07-01 19:46     ` Eli Zaretskii
2011-07-02 12:38       ` Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A675BFE04CB14D95B80832D1908C5CAA@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=8900@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).