aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2005-12-27 21:24:53 +0000
committerNick Roberts2005-12-27 21:24:53 +0000
commitbfd9411056a57a2a5843b47abff7775fdba05397 (patch)
tree59db242989882f1df9667ce3f32dc2c72447d1c9
parentee90fe92139cea8ecd5700a0e0099f6e47d38c9f (diff)
downloademacs-bfd9411056a57a2a5843b47abff7775fdba05397.tar.gz
emacs-bfd9411056a57a2a5843b47abff7775fdba05397.zip
(describe-char): Set help-xref-stack-item
explicitly after buffer has been generated. Revert previous changes for optional buffer argument.
-rw-r--r--lisp/descr-text.el15
1 files changed, 5 insertions, 10 deletions
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index e0dcaff4df7..705d582500e 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -404,15 +404,13 @@ character)")
404 404
405 405
406;;;###autoload 406;;;###autoload
407(defun describe-char (pos &optional buf) 407(defun describe-char (pos)
408 "Describe the character after POS (interactively, the character after point). 408 "Describe the character after POS (interactively, the character after point).
409The information includes character code, charset and code points in it, 409The information includes character code, charset and code points in it,
410syntax, category, how the character is encoded in a file, 410syntax, category, how the character is encoded in a file,
411character composition information (if relevant), 411character composition information (if relevant),
412as well as widgets, buttons, overlays, and text properties." 412as well as widgets, buttons, overlays, and text properties."
413 (interactive "d") 413 (interactive "d")
414 (let ((help-buffer (help-buffer)))
415 (with-current-buffer (if buf buf (current-buffer))
416 (if (>= pos (point-max)) 414 (if (>= pos (point-max))
417 (error "No character follows specified position")) 415 (error "No character follows specified position"))
418 (let* ((char (char-after pos)) 416 (let* ((char (char-after pos))
@@ -586,12 +584,8 @@ as well as widgets, buttons, overlays, and text properties."
586 (setq max-width (apply #'max (mapcar #'(lambda (x) 584 (setq max-width (apply #'max (mapcar #'(lambda (x)
587 (if (cadr x) (length (car x)) 0)) 585 (if (cadr x) (length (car x)) 0))
588 item-list))) 586 item-list)))
589 (let ((buffer (current-buffer))) 587 (help-setup-xref nil (interactive-p))
590 (with-current-buffer help-buffer 588 (with-output-to-temp-buffer (help-buffer)
591 (help-setup-xref
592 (list #'describe-char pos (if buf buf buffer))
593 (interactive-p))))
594 (with-output-to-temp-buffer help-buffer
595 (with-current-buffer standard-output 589 (with-current-buffer standard-output
596 (set-buffer-multibyte multibyte-p) 590 (set-buffer-multibyte multibyte-p)
597 (let ((formatter (format "%%%ds:" max-width))) 591 (let ((formatter (format "%%%ds:" max-width)))
@@ -693,8 +687,9 @@ as well as widgets, buttons, overlays, and text properties."
693 "the meaning of the rule.\n")) 687 "the meaning of the rule.\n"))
694 688
695 (if text-props-desc (insert text-props-desc)) 689 (if text-props-desc (insert text-props-desc))
690 (setq help-xref-stack-item (list 'help-insert-string (buffer-string)))
696 (toggle-read-only 1) 691 (toggle-read-only 1)
697 (print-help-return-message))))))) 692 (print-help-return-message)))))
698 693
699(defalias 'describe-char-after 'describe-char) 694(defalias 'describe-char-after 'describe-char)
700(make-obsolete 'describe-char-after 'describe-char "22.1") 695(make-obsolete 'describe-char-after 'describe-char "22.1")