# HG changeset patch # User Karoly Lorentey # Date 1114455594 0 # Node ID aa4ff0258607dfc5e6c5b69afbe464753684893d # Parent ad07ff6e45555aed6e91993920367d35254f0263 Fix describe-variable with frame-local variables. * lisp/help-fns.el (describe-variable): Describe frame-local variables correctly. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-333 diff -r ad07ff6e4555 -r aa4ff0258607 lisp/help-fns.el --- a/lisp/help-fns.el Mon Apr 25 11:49:38 2005 +0000 +++ b/lisp/help-fns.el Mon Apr 25 18:59:54 2005 +0000 @@ -498,10 +498,11 @@ 0)) ;;;###autoload -(defun describe-variable (variable &optional buffer) +(defun describe-variable (variable &optional buffer frame) "Display the full documentation of VARIABLE (a symbol). Returns the documentation as a string, also. -If VARIABLE has a buffer-local value in BUFFER (default to the current buffer), +If VARIABLE has a buffer-local value in BUFFER or FRAME +\(default to the current buffer and current frame), it is displayed along with the global value." (interactive (let ((v (variable-at-point)) @@ -516,13 +517,19 @@ (list (if (equal val "") v (intern val))))) (unless (buffer-live-p buffer) (setq buffer (current-buffer))) + (unless (frame-live-p frame) (setq frame (selected-frame))) (if (not (symbolp variable)) (message "You did not specify a variable") (save-excursion - (let* ((valvoid (not (with-current-buffer buffer (boundp variable)))) - ;; Extract the value before setting up the output buffer, - ;; in case `buffer' *is* the output buffer. - (val (unless valvoid (buffer-local-value variable buffer)))) + (let ((valvoid (not (with-current-buffer buffer (boundp variable)))) + val locus) + ;; Extract the value before setting up the output buffer, + ;; in case `buffer' *is* the output buffer. + (unless valvoid + (with-selected-frame frame + (with-current-buffer buffer + (setq val (symbol-value variable) + locus (variable-binding-locus variable))))) (help-setup-xref (list #'describe-variable variable buffer) (interactive-p)) (with-output-to-temp-buffer (help-buffer) @@ -539,11 +546,13 @@ (if (< (point) (+ from 20)) (delete-region (1- from) from))))) (terpri) - (when (local-variable-p variable) - (princ (format "%socal in buffer %s; " - (if (get variable 'permanent-local) - "Permanently l" "L") - (buffer-name))) + (when locus + (if (bufferp locus) + (princ (format "%socal in buffer %s; " + (if (get variable 'permanent-local) + "Permanently l" "L") + (buffer-name))) + (princ (format "It is a frame-local variable; "))) (if (not (default-boundp variable)) (princ "globally void") (let ((val (default-value variable)))