Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
2e48ba18
Commit
2e48ba18
authored
Apr 26, 2000
by
Gerd Moellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(help-xref-on-pp): New function.
(describe-variable): Use it to display xrefs in a symbol's value.
parent
23c0fb21
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
8 deletions
+38
-8
lisp/help.el
lisp/help.el
+38
-8
No files found.
lisp/help.el
View file @
2e48ba18
...
...
@@ -751,6 +751,29 @@ Return 0 if there is no such symbol."
(
set-syntax-table
stab
)))
(
error
0
)))
(
defun
help-xref-on-pp
(
from
to
)
"Add xrefs for symbols in `pp's output between FROM and TO."
(
let
((
ost
(
syntax-table
)))
(
unwind-protect
(
save-excursion
(
save-restriction
(
set-syntax-table
emacs-lisp-mode-syntax-table
)
(
narrow-to-region
from
to
)
(
goto-char
(
point-min
))
(
while
(
not
(
eobp
))
(
cond
((
looking-at
"\""
)
(
forward-sexp
1
))
((
looking-at
"#<"
)
(
search-forward
">"
nil
'move
))
((
looking-at
"\\(\\(\\sw\\|\\s_\\)+\\)"
)
(
let*
((
sym
(
intern-soft
(
buffer-substring
(
match-beginning
1
)
(
match-end
1
))))
(
fn
(
cond
((
fboundp
sym
)
#'
describe-function
)
((
and
sym
(
boundp
sym
))
#'
describe-variable
))))
(
when
fn
(
help-xref-button
1
fn
sym
)))
(
goto-char
(
match-end
1
)))
(
t
(
forward-char
1
))))))
(
set-syntax-table
ost
))))
(
defun
describe-variable
(
variable
)
"Display the full documentation of VARIABLE (a symbol).
Returns the documentation as a string, also."
...
...
@@ -772,20 +795,27 @@ Returns the documentation as a string, also."
(
if
(
not
(
boundp
variable
))
(
progn
(
princ
" is void"
)
(
terpri
)
(
setq
valvoid
t
))
(
princ
"'s value is "
)
(
terpri
)
(
pp
(
symbol-value
variable
))
(
terpri
))
(
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
))))))
(
terpri
)
(
if
(
local-variable-p
variable
)
(
progn
(
princ
(
format
"Local in buffer %s; "
(
buffer-name
)))
(
if
(
not
(
default-boundp
variable
))
(
princ
"globally void"
)
(
princ
"global value is "
)
(
terpri
)
(
pp
(
default-value
variable
)))
(
let
((
val
(
default-value
variable
)))
(
with-current-buffer
standard-output
(
princ
"global value is "
)
(
terpri
)
(
let
((
from
(
point
)))
(
pp
val
)
(
help-xref-on-pp
from
(
point
))))))
(
terpri
)))
(
terpri
)
(
save-current-buffer
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment