Vivek Dasmohapatra
2007-01-27 11:46:47 UTC
CVSROOT: /sources/erbot
Module name: erbot
Changes by: Vivek Dasmohapatra <fledermaus> 07/01/27 11:46:47
Modified files:
. : ChangeLog erbutils.el
Log message:
update erbutils-describe-variable to work with emacs22 help-xref-button
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/erbot/ChangeLog?cvsroot=erbot&r1=1.63&r2=1.64
http://cvs.savannah.gnu.org/viewcvs/erbot/erbutils.el?cvsroot=erbot&r1=1.31&r2=1.32
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/erbot/erbot/ChangeLog,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -b -r1.63 -r1.64
--- ChangeLog 29 Nov 2006 03:25:49 -0000 1.63
+++ ChangeLog 27 Jan 2007 11:46:47 -0000 1.64
@@ -1,3 +1,8 @@
+2007-01-27 Vivek Dasmohapatra <***@etla.org>
+
+ * erbutils.el (erbutils-describe-variable): help-button-xref
+ has changed in emacs22, make this function work with it.
+
2006-11-28 Michael Olson <***@gnu.org>
* erbot.el (erbot-join-servers): Make this work with the ERC
Index: erbutils.el
===================================================================
RCS file: /sources/erbot/erbot/erbutils.el,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- erbutils.el 24 Apr 2006 16:57:18 -0000 1.31
+++ erbutils.el 27 Jan 2007 11:46:47 -0000 1.32
@@ -199,83 +199,19 @@
(defun erbutils-describe-variable (&optional variable buffer)
"Like describe-variable, but doesn't print the actual value.."
- ;; (interactive
- ;; (let ((v (variable-at-point))
- ;; (enable-recursive-minibuffers t)
- ;; val)
- ;; (setq val (completing-read (if (symbolp v)
- ;; (format
- ;; "Describe variable (default %s): " v)
- ;; "Describe variable: ")
- ;; obarray 'boundp t nil nil
- ;; (if (symbolp v) (symbol-name v))))
- ;; (list (if (equal val "")
- ;; v (intern val)))))
(unless (bufferp buffer) (setq buffer (current-buffer)))
(if (not (symbolp variable))
(message "Unknown variable or You did not specify a variable")
(let (valvoid)
(with-current-buffer buffer
(with-output-to-temp-buffer "*Help*"
- ;; (prin1 variable)
- ;; (if (not (boundp variable))
- ;; (progn
- ;; (princ " is void")
- ;; (setq valvoid t))
- ;; (let ((val (symbol-value variable)))
- ;; (with-current-buffer standard-output
- ;; (princ "'s value is ")
- ;; (terpri)
- ;; (let ((from (point)))
- ;; (pp val)
- ;; (help-xref-on-pp from (point))
- ;; (if (< (point) (+ from 20))
- ;; (save-excursion
- ;; (goto-char from)
- ;; (delete-char -1)))))))
(terpri)
(if (erbcompat-local-variable-p variable)
(progn
(princ (format "Local in buffer %s; " (buffer-name)))
- ;; (if (not (default-boundp variable))
- ;; (princ "globally void")
- ;; (let ((val (default-value variable)))
- ;; (with-current-buffer standard-output
- ;; (princ "global value is ")
- ;; (terpri) Fixme: pp can take an age if you happen
- ;; ;; to ask for a very large
- ;; ;; expression. We should
- ;; ;; probably print it raw once
- ;; ;; and check it's a sensible
- ;; ;; size before prettyprinting.
- ;; ;; -- fx
- ;; (let ((from (point)))
- ;; (pp val)
- ;; (help-xref-on-pp from (point))
- ;; (if (< (point) (+ from 20))
- ;; (save-excursion
- ;; (goto-char from)
- ;; (delete-char -1)))))))
+
(terpri)))
(terpri)
- ;; (with-current-buffer standard-output
- ;; (if (> (count-lines (point-min) (point-max)) 10)
- ;; (progn
- ;; ;; Note that setting the syntax table like below
- ;; ;; makes forward-sexp move over a `'s' at the end
- ;; ;; of a symbol.
- ;; (set-syntax-table emacs-lisp-mode-syntax-table)
- ;; (goto-char (point-min))
- ;; (if valvoid
- ;; (forward-line 1)
- ;; (forward-sexp 1)
- ;; (delete-region (point) (progn
- ;; (end-of-line) (point)))
- ;; (insert " value is shown below.\n\n")
- ;; (save-excursion
- ;; (insert "\n\nValue:"))))))
- ;; (princ "Documentation:")
- (terpri)
(let ((doc
(documentation-property variable 'variable-documentation)))
(princ (or doc "not documented as a variable.")))
@@ -297,12 +233,15 @@
(save-excursion
(re-search-backward
(concat "\\(" customize-label "\\)") nil t)
+ (if (< 22 emacs-major-version)
(help-xref-button 1 (lambda (v)
(if help-xref-stack
(pop help-xref-stack))
(customize-variable v))
variable
- "mouse-2, RET: customize variable")))))
+ "mouse-2, RET: customize variable")
+ (help-xref-button 1 'help-customize-variable variable))
+ ))))
;; Make a hyperlink to the library if appropriate. (Don't
;; change the format of the buffer's initial line in case
;; anything expects the current format.)
@@ -314,13 +253,16 @@
(with-current-buffer "*Help*"
(save-excursion
(re-search-backward "`\\([^`']+\\)'" nil t)
+ (if (< 22 emacs-major-version)
(help-xref-button
1 (lambda (arg)
(let ((location
(find-variable-noselect arg)))
(pop-to-buffer (car location))
(goto-char (cdr location))))
- variable "mouse-2, RET: find variable's definition")))))
+ variable "mouse-2, RET: find variable's definition")
+ (help-xref-button 1 'help-variable-def variable file-name))
+ ))))
(print-help-return-message)
(save-excursion
@@ -329,8 +271,6 @@
(buffer-substring-no-properties (point-min) (point-max))))))))
-
-
(defvar erbutils-itemize-style
(list "[%s] %s\n\n" "[%s] %s\n\n" "[%s] %s,\n\n")
Module name: erbot
Changes by: Vivek Dasmohapatra <fledermaus> 07/01/27 11:46:47
Modified files:
. : ChangeLog erbutils.el
Log message:
update erbutils-describe-variable to work with emacs22 help-xref-button
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/erbot/ChangeLog?cvsroot=erbot&r1=1.63&r2=1.64
http://cvs.savannah.gnu.org/viewcvs/erbot/erbutils.el?cvsroot=erbot&r1=1.31&r2=1.32
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/erbot/erbot/ChangeLog,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -b -r1.63 -r1.64
--- ChangeLog 29 Nov 2006 03:25:49 -0000 1.63
+++ ChangeLog 27 Jan 2007 11:46:47 -0000 1.64
@@ -1,3 +1,8 @@
+2007-01-27 Vivek Dasmohapatra <***@etla.org>
+
+ * erbutils.el (erbutils-describe-variable): help-button-xref
+ has changed in emacs22, make this function work with it.
+
2006-11-28 Michael Olson <***@gnu.org>
* erbot.el (erbot-join-servers): Make this work with the ERC
Index: erbutils.el
===================================================================
RCS file: /sources/erbot/erbot/erbutils.el,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- erbutils.el 24 Apr 2006 16:57:18 -0000 1.31
+++ erbutils.el 27 Jan 2007 11:46:47 -0000 1.32
@@ -199,83 +199,19 @@
(defun erbutils-describe-variable (&optional variable buffer)
"Like describe-variable, but doesn't print the actual value.."
- ;; (interactive
- ;; (let ((v (variable-at-point))
- ;; (enable-recursive-minibuffers t)
- ;; val)
- ;; (setq val (completing-read (if (symbolp v)
- ;; (format
- ;; "Describe variable (default %s): " v)
- ;; "Describe variable: ")
- ;; obarray 'boundp t nil nil
- ;; (if (symbolp v) (symbol-name v))))
- ;; (list (if (equal val "")
- ;; v (intern val)))))
(unless (bufferp buffer) (setq buffer (current-buffer)))
(if (not (symbolp variable))
(message "Unknown variable or You did not specify a variable")
(let (valvoid)
(with-current-buffer buffer
(with-output-to-temp-buffer "*Help*"
- ;; (prin1 variable)
- ;; (if (not (boundp variable))
- ;; (progn
- ;; (princ " is void")
- ;; (setq valvoid t))
- ;; (let ((val (symbol-value variable)))
- ;; (with-current-buffer standard-output
- ;; (princ "'s value is ")
- ;; (terpri)
- ;; (let ((from (point)))
- ;; (pp val)
- ;; (help-xref-on-pp from (point))
- ;; (if (< (point) (+ from 20))
- ;; (save-excursion
- ;; (goto-char from)
- ;; (delete-char -1)))))))
(terpri)
(if (erbcompat-local-variable-p variable)
(progn
(princ (format "Local in buffer %s; " (buffer-name)))
- ;; (if (not (default-boundp variable))
- ;; (princ "globally void")
- ;; (let ((val (default-value variable)))
- ;; (with-current-buffer standard-output
- ;; (princ "global value is ")
- ;; (terpri) Fixme: pp can take an age if you happen
- ;; ;; to ask for a very large
- ;; ;; expression. We should
- ;; ;; probably print it raw once
- ;; ;; and check it's a sensible
- ;; ;; size before prettyprinting.
- ;; ;; -- fx
- ;; (let ((from (point)))
- ;; (pp val)
- ;; (help-xref-on-pp from (point))
- ;; (if (< (point) (+ from 20))
- ;; (save-excursion
- ;; (goto-char from)
- ;; (delete-char -1)))))))
+
(terpri)))
(terpri)
- ;; (with-current-buffer standard-output
- ;; (if (> (count-lines (point-min) (point-max)) 10)
- ;; (progn
- ;; ;; Note that setting the syntax table like below
- ;; ;; makes forward-sexp move over a `'s' at the end
- ;; ;; of a symbol.
- ;; (set-syntax-table emacs-lisp-mode-syntax-table)
- ;; (goto-char (point-min))
- ;; (if valvoid
- ;; (forward-line 1)
- ;; (forward-sexp 1)
- ;; (delete-region (point) (progn
- ;; (end-of-line) (point)))
- ;; (insert " value is shown below.\n\n")
- ;; (save-excursion
- ;; (insert "\n\nValue:"))))))
- ;; (princ "Documentation:")
- (terpri)
(let ((doc
(documentation-property variable 'variable-documentation)))
(princ (or doc "not documented as a variable.")))
@@ -297,12 +233,15 @@
(save-excursion
(re-search-backward
(concat "\\(" customize-label "\\)") nil t)
+ (if (< 22 emacs-major-version)
(help-xref-button 1 (lambda (v)
(if help-xref-stack
(pop help-xref-stack))
(customize-variable v))
variable
- "mouse-2, RET: customize variable")))))
+ "mouse-2, RET: customize variable")
+ (help-xref-button 1 'help-customize-variable variable))
+ ))))
;; Make a hyperlink to the library if appropriate. (Don't
;; change the format of the buffer's initial line in case
;; anything expects the current format.)
@@ -314,13 +253,16 @@
(with-current-buffer "*Help*"
(save-excursion
(re-search-backward "`\\([^`']+\\)'" nil t)
+ (if (< 22 emacs-major-version)
(help-xref-button
1 (lambda (arg)
(let ((location
(find-variable-noselect arg)))
(pop-to-buffer (car location))
(goto-char (cdr location))))
- variable "mouse-2, RET: find variable's definition")))))
+ variable "mouse-2, RET: find variable's definition")
+ (help-xref-button 1 'help-variable-def variable file-name))
+ ))))
(print-help-return-message)
(save-excursion
@@ -329,8 +271,6 @@
(buffer-substring-no-properties (point-min) (point-max))))))))
-
-
(defvar erbutils-itemize-style
(list "[%s] %s\n\n" "[%s] %s\n\n" "[%s] %s,\n\n")