Subject: bug#14238: [PATCH] Help page for character description forgets the character

From: Kelly Dean <[email-masked]>
Date: Sun, 21 Apr 2013 04:38:21 -0700 (PDT)

On 24.3, emacs -Q
Type the letters AB, then put point on A. Do describe-char, then put point on B, and do describe-char again.
Change the A to C, the press [back] in *Help*.
The help page is now for C, not for A. It should be for A; you never did describe-char on C.
The attached descharbug.patch fixes it.
--- emacs-24.3/lisp/descr-text.el
+++ emacs-24.3/lisp/descr-text.el
@@ -670,8 +670,11 @@
                                             (if (cadr x) (length (car x)) 0))
                                           item-list)))
       (set-buffer src-buf)
-      (help-setup-xref (list 'describe-char pos buffer)
-                       (called-interactively-p 'interactive))
+      (describe-char-make-help multibyte-p max-width item-list overlays char-description disp-vector composition component-chars eight-bit-p char text-props-desc (called-interactively-p 'interactive)))))
+
+(defun describe-char-make-help (multibyte-p max-width item-list overlays char-description disp-vector composition component-chars eight-bit-p char text-props-desc interactive-p)
+      (help-setup-xref (list 'describe-char-make-help multibyte-p max-width item-list overlays char-description disp-vector composition component-chars eight-bit-p char text-props-desc nil)
+                       interactive-p)
       (with-help-window (help-buffer)
         (with-current-buffer standard-output
           (set-buffer-multibyte multibyte-p)
@@ -804,7 +807,7 @@
                             (format "  %s: %s\n" elt val)))))))
 
           (if text-props-desc (insert text-props-desc))
-          (setq buffer-read-only t))))))
+          (setq buffer-read-only t))))
 
 (define-obsolete-function-alias 'describe-char-after 'describe-char "22.1")