emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/help-fns.el,v


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/help-fns.el,v
Date: Wed, 29 Aug 2007 05:28:41 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Miles Bader <miles>     07/08/29 05:28:10

Index: lisp/help-fns.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/help-fns.el,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -b -r1.98 -r1.99
--- lisp/help-fns.el    26 Jul 2007 05:26:25 -0000      1.98
+++ lisp/help-fns.el    29 Aug 2007 05:28:03 -0000      1.99
@@ -446,10 +446,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))
@@ -468,14 +469,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))))
+      (let ((valvoid (not (with-current-buffer buffer (boundp variable))))
+           val val-start-pos locus)
             ;; Extract the value before setting up the output buffer,
             ;; in case `buffer' *is* the output buffer.
-            (val (unless valvoid (buffer-local-value variable buffer)))
-            val-start-pos)
+       (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)
@@ -537,11 +543,13 @@
                      (delete-region (1- from) from)))))
            (terpri)
 
-           (when (local-variable-p variable)
+           (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)))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]