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
0b0c9565
Commit
0b0c9565
authored
Aug 23, 2015
by
Andreas Schwab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Prefer ‘format’ to ‘substitute-command-keys’"
This reverts commit
6af5aad2
.
parent
70ff6241
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
97 additions
and
71 deletions
+97
-71
lisp/cedet/mode-local.el
lisp/cedet/mode-local.el
+5
-4
lisp/cedet/srecode/srt-mode.el
lisp/cedet/srecode/srt-mode.el
+2
-2
lisp/cus-theme.el
lisp/cus-theme.el
+2
-2
lisp/descr-text.el
lisp/descr-text.el
+8
-3
lisp/emacs-lisp/cl-extra.el
lisp/emacs-lisp/cl-extra.el
+10
-10
lisp/emacs-lisp/cl-generic.el
lisp/emacs-lisp/cl-generic.el
+2
-2
lisp/emacs-lisp/eieio-opt.el
lisp/emacs-lisp/eieio-opt.el
+2
-2
lisp/emacs-lisp/package.el
lisp/emacs-lisp/package.el
+4
-3
lisp/faces.el
lisp/faces.el
+9
-5
lisp/help-fns.el
lisp/help-fns.el
+40
-26
lisp/help.el
lisp/help.el
+5
-3
src/doc.c
src/doc.c
+5
-4
src/syntax.c
src/syntax.c
+3
-5
No files found.
lisp/cedet/mode-local.el
View file @
0b0c9565
...
@@ -629,9 +629,10 @@ SYMBOL is a function that can be overridden."
...
@@ -629,9 +629,10 @@ SYMBOL is a function that can be overridden."
(
defun
mode-local-print-binding
(
symbol
)
(
defun
mode-local-print-binding
(
symbol
)
"Print the SYMBOL binding."
"Print the SYMBOL binding."
(
let
((
value
(
symbol-value
symbol
)))
(
let
((
value
(
symbol-value
symbol
)))
(
princ
(
format
"\n ‘%s’ value is\n "
symbol
))
(
princ
(
format
(
substitute-command-keys
"\n ‘%s’ value is\n "
)
symbol
))
(
if
(
and
value
(
symbolp
value
))
(
if
(
and
value
(
symbolp
value
))
(
princ
(
format
"‘%s’"
value
))
(
princ
(
format
(
substitute-command-keys
"‘%s’"
)
value
))
(
let
((
pt
(
point
)))
(
let
((
pt
(
point
)))
(
pp
value
)
(
pp
value
)
(
save-excursion
(
save-excursion
...
@@ -689,7 +690,7 @@ SYMBOL is a function that can be overridden."
...
@@ -689,7 +690,7 @@ SYMBOL is a function that can be overridden."
)
)
((
symbolp
buffer-or-mode
)
((
symbolp
buffer-or-mode
)
(
setq
mode
buffer-or-mode
)
(
setq
mode
buffer-or-mode
)
(
princ
(
format
"‘%s’\n"
buffer-or-mode
))
(
princ
(
format
(
substitute-command-keys
"‘%s’\n"
)
buffer-or-mode
))
)
)
((
signal
'wrong-type-argument
((
signal
'wrong-type-argument
(
list
'buffer-or-mode
buffer-or-mode
))))
(
list
'buffer-or-mode
buffer-or-mode
))))
...
@@ -699,7 +700,7 @@ SYMBOL is a function that can be overridden."
...
@@ -699,7 +700,7 @@ SYMBOL is a function that can be overridden."
(
while
mode
(
while
mode
(
setq
table
(
get
mode
'mode-local-symbol-table
))
(
setq
table
(
get
mode
'mode-local-symbol-table
))
(
when
table
(
when
table
(
princ
(
format
"\n- From ‘%s’\n"
mode
))
(
princ
(
format
(
substitute-command-keys
"\n- From ‘%s’\n"
)
mode
))
(
mode-local-print-bindings
table
))
(
mode-local-print-bindings
table
))
(
setq
mode
(
get-mode-local-parent
mode
)))))
(
setq
mode
(
get-mode-local-parent
mode
)))))
...
...
lisp/cedet/srecode/srt-mode.el
View file @
0b0c9565
...
@@ -258,9 +258,9 @@ we can tell font lock about them.")
...
@@ -258,9 +258,9 @@ we can tell font lock about them.")
(
when
(
class-abstract-p
C
)
(
when
(
class-abstract-p
C
)
(
throw
'skip
nil
))
(
throw
'skip
nil
))
(
princ
(
format
"‘"
))
(
princ
(
substitute-command-keys
"‘"
))
(
princ
name
)
(
princ
name
)
(
princ
(
format
"’"
))
(
princ
(
substitute-command-keys
"’"
))
(
when
(
slot-exists-p
C
'key
)
(
when
(
slot-exists-p
C
'key
)
(
when
key
(
when
key
(
princ
" - Character Key: "
)
(
princ
" - Character Key: "
)
...
...
lisp/cus-theme.el
View file @
0b0c9565
...
@@ -492,10 +492,10 @@ It includes all faces in list FACES."
...
@@ -492,10 +492,10 @@ It includes all faces in list FACES."
'
(
""
"c"
)))
'
(
""
"c"
)))
doc
)
doc
)
(
when
fn
(
when
fn
(
princ
(
format
" in ‘"
))
(
princ
(
substitute-command-keys
" in ‘"
))
(
help-insert-xref-button
(
file-name-nondirectory
fn
)
(
help-insert-xref-button
(
file-name-nondirectory
fn
)
'help-theme-def
fn
)
'help-theme-def
fn
)
(
princ
(
format
"’"
)))
(
princ
(
substitute-command-keys
"’"
)))
(
princ
".\n"
)
(
princ
".\n"
)
(
if
(
custom-theme-p
theme
)
(
if
(
custom-theme-p
theme
)
(
progn
(
progn
...
...
lisp/descr-text.el
View file @
0b0c9565
...
@@ -161,8 +161,11 @@ otherwise."
...
@@ -161,8 +161,11 @@ otherwise."
;; Buttons
;; Buttons
(
when
(
and
button
(
not
(
widgetp
wid-button
)))
(
when
(
and
button
(
not
(
widgetp
wid-button
)))
(
newline
)
(
newline
)
(
insert
(
format
"Here is a ‘%S’ button labeled ‘%s’.\n\n"
(
insert
(
substitute-command-keys
"Here is a ‘"
)
button-type
button-label
)))
(
format
"%S"
button-type
)
(
substitute-command-keys
"’ button labeled ‘"
)
button-label
(
substitute-command-keys
"’.\n\n"
)))
;; Overlays
;; Overlays
(
when
overlays
(
when
overlays
(
newline
)
(
newline
)
...
@@ -736,7 +739,9 @@ relevant to POS."
...
@@ -736,7 +739,9 @@ relevant to POS."
(
when
face
(
when
face
(
insert
(
propertize
" "
'display
'
(
space
:align-to
5
))
(
insert
(
propertize
" "
'display
'
(
space
:align-to
5
))
"face: "
)
"face: "
)
(
insert
(
format
"‘%s’\n"
face
))))))
(
insert
(
substitute-command-keys
"‘"
)
(
symbol-name
face
)
(
substitute-command-keys
"’\n"
))))))
(
insert
"these terminal codes:\n"
)
(
insert
"these terminal codes:\n"
)
(
dotimes
(
i
(
length
disp-vector
))
(
dotimes
(
i
(
length
disp-vector
))
(
insert
(
car
(
aref
disp-vector
i
))
(
insert
(
car
(
aref
disp-vector
i
))
...
...
lisp/emacs-lisp/cl-extra.el
View file @
0b0c9565
...
@@ -752,16 +752,16 @@ including `cl-block' and `cl-eval-when'."
...
@@ -752,16 +752,16 @@ including `cl-block' and `cl-eval-when'."
;; FIXME: Add a `cl-class-of' or `cl-typeof' or somesuch.
;; FIXME: Add a `cl-class-of' or `cl-typeof' or somesuch.
(
metatype
(
cl--class-name
(
symbol-value
(
aref
class
0
)))))
(
metatype
(
cl--class-name
(
symbol-value
(
aref
class
0
)))))
(
insert
(
symbol-name
type
)
(
insert
(
symbol-name
type
)
(
format
" is a type (of kind ‘"
))
(
substitute-command-keys
" is a type (of kind ‘"
))
(
help-insert-xref-button
(
symbol-name
metatype
)
(
help-insert-xref-button
(
symbol-name
metatype
)
'cl-help-type
metatype
)
'cl-help-type
metatype
)
(
insert
(
format
"’)"
))
(
insert
(
substitute-command-keys
"’)"
))
(
when
location
(
when
location
(
insert
(
format
" in ‘"
))
(
insert
(
substitute-command-keys
" in ‘"
))
(
help-insert-xref-button
(
help-insert-xref-button
(
help-fns-short-filename
location
)
(
help-fns-short-filename
location
)
'cl-type-definition
type
location
'define-type
)
'cl-type-definition
type
location
'define-type
)
(
insert
(
format
"’"
)))
(
insert
(
substitute-command-keys
"’"
)))
(
insert
".\n"
)
(
insert
".\n"
)
;; Parents.
;; Parents.
...
@@ -771,10 +771,10 @@ including `cl-block' and `cl-eval-when'."
...
@@ -771,10 +771,10 @@ including `cl-block' and `cl-eval-when'."
(
insert
" Inherits from "
)
(
insert
" Inherits from "
)
(
while
(
setq
cur
(
pop
pl
))
(
while
(
setq
cur
(
pop
pl
))
(
setq
cur
(
cl--class-name
cur
))
(
setq
cur
(
cl--class-name
cur
))
(
insert
(
format
"‘"
))
(
insert
(
substitute-command-keys
"‘"
))
(
help-insert-xref-button
(
symbol-name
cur
)
(
help-insert-xref-button
(
symbol-name
cur
)
'cl-help-type
cur
)
'cl-help-type
cur
)
(
insert
(
format
(
if
pl
"’, "
"’"
))))
(
insert
(
substitute-command-keys
(
if
pl
"’, "
"’"
))))
(
insert
".\n"
)))
(
insert
".\n"
)))
;; Children, if available. ¡For EIEIO!
;; Children, if available. ¡For EIEIO!
...
@@ -785,10 +785,10 @@ including `cl-block' and `cl-eval-when'."
...
@@ -785,10 +785,10 @@ including `cl-block' and `cl-eval-when'."
(
when
ch
(
when
ch
(
insert
" Children "
)
(
insert
" Children "
)
(
while
(
setq
cur
(
pop
ch
))
(
while
(
setq
cur
(
pop
ch
))
(
insert
(
format
"‘"
))
(
insert
(
substitute-command-keys
"‘"
))
(
help-insert-xref-button
(
symbol-name
cur
)
(
help-insert-xref-button
(
symbol-name
cur
)
'cl-help-type
cur
)
'cl-help-type
cur
)
(
insert
(
format
(
if
ch
"’, "
"’"
))))
(
insert
(
substitute-command-keys
(
if
ch
"’, "
"’"
))))
(
insert
".\n"
)))
(
insert
".\n"
)))
;; Type's documentation.
;; Type's documentation.
...
@@ -804,10 +804,10 @@ including `cl-block' and `cl-eval-when'."
...
@@ -804,10 +804,10 @@ including `cl-block' and `cl-eval-when'."
(
when
generics
(
when
generics
(
insert
(
propertize
"Specialized Methods:\n\n"
'face
'bold
))
(
insert
(
propertize
"Specialized Methods:\n\n"
'face
'bold
))
(
dolist
(
generic
generics
)
(
dolist
(
generic
generics
)
(
insert
(
format
"‘"
))
(
insert
(
substitute-command-keys
"‘"
))
(
help-insert-xref-button
(
symbol-name
generic
)
(
help-insert-xref-button
(
symbol-name
generic
)
'help-function
generic
)
'help-function
generic
)
(
insert
(
format
"’"
))
(
insert
(
substitute-command-keys
"’"
))
(
pcase-dolist
(
`
(
,
qualifiers
,
args
,
doc
)
(
pcase-dolist
(
`
(
,
qualifiers
,
args
,
doc
)
(
cl--generic-method-documentation
generic
type
))
(
cl--generic-method-documentation
generic
type
))
(
insert
(
format
" %s%S\n"
qualifiers
args
)
(
insert
(
format
" %s%S\n"
qualifiers
args
)
...
...
lisp/emacs-lisp/cl-generic.el
View file @
0b0c9565
...
@@ -864,11 +864,11 @@ MET-NAME is a cons (SYMBOL . SPECIALIZERS)."
...
@@ -864,11 +864,11 @@ MET-NAME is a cons (SYMBOL . SPECIALIZERS)."
(
cl--generic-method-specializers
method
)))
(
cl--generic-method-specializers
method
)))
(
file
(
find-lisp-object-file-name
met-name
'cl-defmethod
)))
(
file
(
find-lisp-object-file-name
met-name
'cl-defmethod
)))
(
when
file
(
when
file
(
insert
(
format
" in ‘"
))
(
insert
(
substitute-command-keys
" in ‘"
))
(
help-insert-xref-button
(
help-fns-short-filename
file
)
(
help-insert-xref-button
(
help-fns-short-filename
file
)
'help-function-def
met-name
file
'help-function-def
met-name
file
'cl-defmethod
)
'cl-defmethod
)
(
insert
(
format
"’.\n"
))))
(
insert
(
substitute-command-keys
"’.\n"
))))
(
insert
"\n"
(
or
(
nth
2
info
)
"Undocumented"
)
"\n\n"
)))))))
(
insert
"\n"
(
or
(
nth
2
info
)
"Undocumented"
)
"\n\n"
)))))))
(
defun
cl--generic-specializers-apply-to-type-p
(
specializers
type
)
(
defun
cl--generic-specializers-apply-to-type-p
(
specializers
type
)
...
...
lisp/emacs-lisp/eieio-opt.el
View file @
0b0c9565
...
@@ -141,11 +141,11 @@ are not abstract."
...
@@ -141,11 +141,11 @@ are not abstract."
(
setq
location
(
setq
location
(
find-lisp-object-file-name
ctr
def
)))
(
find-lisp-object-file-name
ctr
def
)))
(
when
location
(
when
location
(
insert
(
format
" in ‘"
))
(
insert
(
substitute-command-keys
" in ‘"
))
(
help-insert-xref-button
(
help-insert-xref-button
(
help-fns-short-filename
location
)
(
help-fns-short-filename
location
)
'cl-type-definition
ctr
location
'define-type
)
'cl-type-definition
ctr
location
'define-type
)
(
insert
(
format
"’"
)))
(
insert
(
substitute-command-keys
"’"
)))
(
insert
".\nCreates an object of class "
(
symbol-name
ctr
)
"."
)
(
insert
".\nCreates an object of class "
(
symbol-name
ctr
)
"."
)
(
goto-char
(
point-max
))
(
goto-char
(
point-max
))
(
if
(
autoloadp
def
)
(
if
(
autoloadp
def
)
...
...
lisp/emacs-lisp/package.el
View file @
0b0c9565
...
@@ -2204,7 +2204,7 @@ Otherwise no newline is inserted."
...
@@ -2204,7 +2204,7 @@ Otherwise no newline is inserted."
"Installed"
"Installed"
(
capitalize
status
))
(
capitalize
status
))
'font-lock-face
'package-status-builtin-face
))
'font-lock-face
'package-status-builtin-face
))
(insert (
format
" in ‘"))
(
insert
(
substitute-command-keys
" in ‘"
))
(
let
((
dir
(
abbreviate-file-name
(
let
((
dir
(
abbreviate-file-name
(
file-name-as-directory
(
file-name-as-directory
(
if
(
file-in-directory-p
pkg-dir
package-user-dir
)
(
if
(
file-in-directory-p
pkg-dir
package-user-dir
)
...
@@ -2213,10 +2213,11 @@ Otherwise no newline is inserted."
...
@@ -2213,10 +2213,11 @@ Otherwise no newline is inserted."
(
help-insert-xref-button
dir
'help-package-def
pkg-dir
))
(
help-insert-xref-button
dir
'help-package-def
pkg-dir
))
(
if
(
and
(
package-built-in-p
name
)
(
if
(
and
(
package-built-in-p
name
)
(
not
(
package-built-in-p
name
version
)))
(
not
(
package-built-in-p
name
version
)))
(insert (format "’,\n shadowing a ")
(
insert
(
substitute-command-keys
"’,\n shadowing a "
)
(
propertize
"built-in package"
(
propertize
"built-in package"
'font-lock-face
'package-status-builtin-face
))
'font-lock-face
'package-status-builtin-face
))
(insert (
format
"’")))
(
insert
(
substitute-command-keys
"’"
)))
(
if
signed
(
if
signed
(
insert
"."
)
(
insert
"."
)
(
insert
" (unsigned)."
))
(
insert
" (unsigned)."
))
...
...
lisp/faces.el
View file @
0b0c9565
...
@@ -1436,10 +1436,12 @@ If FRAME is omitted or nil, use the selected frame."
...
@@ -1436,10 +1436,12 @@ If FRAME is omitted or nil, use the selected frame."
(
when
alias
(
when
alias
(
setq
face
alias
)
(
setq
face
alias
)
(
insert
(
insert
(format "\n %s is an alias for the face ‘%s’.\n%s"
(
format
(
substitute-command-keys
"\n %s is an alias for the face ‘%s’.\n%s"
)
f
alias
f
alias
(
if
(
setq
obsolete
(
get
f
'obsolete-face
))
(
if
(
setq
obsolete
(
get
f
'obsolete-face
))
(format " This face is obsolete%s; use ‘%s’ instead.\n"
(
format
(
substitute-command-keys
" This face is obsolete%s; use ‘%s’ instead.\n"
)
(
if
(
stringp
obsolete
)
(
if
(
stringp
obsolete
)
(
format
" since %s"
obsolete
)
(
format
" since %s"
obsolete
)
""
)
""
)
...
@@ -1457,11 +1459,13 @@ If FRAME is omitted or nil, use the selected frame."
...
@@ -1457,11 +1459,13 @@ If FRAME is omitted or nil, use the selected frame."
(
help-xref-button
1
'help-customize-face
f
)))
(
help-xref-button
1
'help-customize-face
f
)))
(
setq
file-name
(
find-lisp-object-file-name
f
'defface
))
(
setq
file-name
(
find-lisp-object-file-name
f
'defface
))
(
when
file-name
(
when
file-name
(princ (format "Defined in ‘%s’"
(
princ
(
substitute-command-keys
"Defined in ‘"
))
(file-name-nondirectory file-name)))
(
princ
(
file-name-nondirectory
file-name
))
(
princ
(
substitute-command-keys
"’"
))
;; Make a hyperlink to the library.
;; Make a hyperlink to the library.
(
save-excursion
(
save-excursion
(re-search-backward (format "‘\\([^‘’]+\\)’") nil t)
(
re-search-backward
(
substitute-command-keys
"‘\\([^‘’]+\\)’"
)
nil
t
)
(
help-xref-button
1
'help-face-def
f
file-name
))
(
help-xref-button
1
'help-face-def
f
file-name
))
(
princ
"."
)
(
princ
"."
)
(
terpri
)
(
terpri
)
...
...
lisp/help-fns.el
View file @
0b0c9565
...
@@ -319,7 +319,9 @@ suitable file is found, return nil."
...
@@ -319,7 +319,9 @@ suitable file is found, return nil."
(
when
remapped
(
when
remapped
(
princ
"Its keys are remapped to "
)
(
princ
"Its keys are remapped to "
)
(
princ
(
if
(
symbolp
remapped
)
(
princ
(
if
(
symbolp
remapped
)
(
format
"‘%s’"
remapped
)
(
concat
(
substitute-command-keys
"‘"
)
(
symbol-name
remapped
)
(
substitute-command-keys
"’"
))
"an anonymous command"
))
"an anonymous command"
))
(
princ
".\n"
))
(
princ
".\n"
))
...
@@ -353,16 +355,18 @@ suitable file is found, return nil."
...
@@ -353,16 +355,18 @@ suitable file is found, return nil."
(
insert
"\nThis function has a compiler macro"
)
(
insert
"\nThis function has a compiler macro"
)
(
if
(
symbolp
handler
)
(
if
(
symbolp
handler
)
(
progn
(
progn
(
insert
(
format
" ‘%s’"
handler
))
(
insert
(
format
(
substitute-command-keys
" ‘%s’"
)
handler
))
(
save-excursion
(
save-excursion
(
re-search-backward
(
format
"‘\\([^‘’]+\\)’"
)
nil
t
)
(
re-search-backward
(
substitute-command-keys
"‘\\([^‘’]+\\)’"
)
nil
t
)
(
help-xref-button
1
'help-function
handler
)))
(
help-xref-button
1
'help-function
handler
)))
;; FIXME: Obsolete since 24.4.
;; FIXME: Obsolete since 24.4.
(
let
((
lib
(
get
function
'compiler-macro-file
)))
(
let
((
lib
(
get
function
'compiler-macro-file
)))
(
when
(
stringp
lib
)
(
when
(
stringp
lib
)
(
insert
(
format
" in ‘%s’"
lib
))
(
insert
(
format
(
substitute-command-keys
" in ‘%s’"
)
lib
))
(
save-excursion
(
save-excursion
(
re-search-backward
(
format
"‘\\([^‘’]+\\)’"
)
nil
t
)
(
re-search-backward
(
substitute-command-keys
"‘\\([^‘’]+\\)’"
)
nil
t
)
(
help-xref-button
1
'help-function-cmacro
function
lib
)))))
(
help-xref-button
1
'help-function-cmacro
function
lib
)))))
(
insert
".\n"
))))
(
insert
".\n"
))))
...
@@ -417,13 +421,13 @@ suitable file is found, return nil."
...
@@ -417,13 +421,13 @@ suitable file is found, return nil."
(
get
function
(
get
function
'derived-mode-parent
))))
'derived-mode-parent
))))
(
when
parent-mode
(
when
parent-mode
(
insert
(
format
"\nParent mode: ‘"
))
(
insert
(
substitute-command-keys
"\nParent mode: ‘"
))
(
let
((
beg
(
point
)))
(
let
((
beg
(
point
)))
(
insert
(
format
"%s"
parent-mode
))
(
insert
(
format
"%s"
parent-mode
))
(
make-text-button
beg
(
point
)
(
make-text-button
beg
(
point
)
'type
'help-function
'type
'help-function
'help-args
(
list
parent-mode
)))
'help-args
(
list
parent-mode
)))
(
insert
(
format
"’.\n"
)))))
(
insert
(
substitute-command-keys
"’.\n"
)))))
(
defun
help-fns--obsolete
(
function
)
(
defun
help-fns--obsolete
(
function
)
;; Ignore lambda constructs, keyboard macros, etc.
;; Ignore lambda constructs, keyboard macros, etc.
...
@@ -438,9 +442,10 @@ suitable file is found, return nil."
...
@@ -438,9 +442,10 @@ suitable file is found, return nil."
" is obsolete"
)
" is obsolete"
)
(
when
(
nth
2
obsolete
)
(
when
(
nth
2
obsolete
)
(
insert
(
format
" since %s"
(
nth
2
obsolete
))))
(
insert
(
format
" since %s"
(
nth
2
obsolete
))))
(
insert
(
cond
((
stringp
use
)
(
insert
(
cond
((
stringp
use
)
(
concat
";\n"
use
))
(
concat
";\n"
(
substitute-command-keys
use
)))
(
use
(
format
(
substitute-command-keys
(
use
(
format
";\nuse ‘%s’ instead."
use
))
";\nuse ‘%s’ instead."
)
use
))
(
t
"."
))
(
t
"."
))
"\n"
))))
"\n"
))))
...
@@ -476,7 +481,8 @@ FILE is the file where FUNCTION was probably defined."
...
@@ -476,7 +481,8 @@ FILE is the file where FUNCTION was probably defined."
(
format
";\nin Lisp code %s"
interactive-only
))
(
format
";\nin Lisp code %s"
interactive-only
))
((
and
(
symbolp
'interactive-only
)
((
and
(
symbolp
'interactive-only
)
(
not
(
eq
interactive-only
t
)))
(
not
(
eq
interactive-only
t
)))
(
format
";\nin Lisp code use ‘%s’ instead."
(
format
(
substitute-command-keys
";\nin Lisp code use ‘%s’ instead."
)
interactive-only
))
interactive-only
))
(
t
"."
))
(
t
"."
))
"\n"
)))))
"\n"
)))))
...
@@ -545,7 +551,8 @@ FILE is the file where FUNCTION was probably defined."
...
@@ -545,7 +551,8 @@ FILE is the file where FUNCTION was probably defined."
;; Aliases are Lisp functions, so we need to check
;; Aliases are Lisp functions, so we need to check
;; aliases before functions.
;; aliases before functions.
(
aliased
(
aliased
(
format
"an alias for ‘%s’"
real-def
))
(
format
(
substitute-command-keys
"an alias for ‘%s’"
)
real-def
))
((
autoloadp
def
)
((
autoloadp
def
)
(
format
"%s autoloaded %s"
(
format
"%s autoloaded %s"
(
if
(
commandp
def
)
"an interactive"
"an"
)
(
if
(
commandp
def
)
"an interactive"
"an"
)
...
@@ -579,22 +586,24 @@ FILE is the file where FUNCTION was probably defined."
...
@@ -579,22 +586,24 @@ FILE is the file where FUNCTION was probably defined."
(
with-current-buffer
standard-output
(
with-current-buffer
standard-output
(
save-excursion
(
save-excursion
(
save-match-data
(
save-match-data
(
when
(
re-search-backward
(
format
"alias for ‘\\([^‘’]+\\)’"
)
(
when
(
re-search-backward
(
substitute-command-keys
"alias for ‘\\([^‘’]+\\)’"
)
nil
t
)
nil
t
)
(
help-xref-button
1
'help-function
real-def
)))))
(
help-xref-button
1
'help-function
real-def
)))))
(
when
file-name
(
when
file-name
(
princ
(
format
" in ‘"
))
(
princ
(
substitute-command-keys
" in ‘"
))
;; We used to add .el to the file name,
;; We used to add .el to the file name,
;; but that's completely wrong when the user used load-file.
;; but that's completely wrong when the user used load-file.
(
princ
(
if
(
eq
file-name
'C-source
)
(
princ
(
if
(
eq
file-name
'C-source
)
"C source code"
"C source code"
(
help-fns-short-filename
file-name
)))
(
help-fns-short-filename
file-name
)))
(
princ
(
format
"’"
))
(
princ
(
substitute-command-keys
"’"
))
;; Make a hyperlink to the library.
;; Make a hyperlink to the library.
(
with-current-buffer
standard-output
(
with-current-buffer
standard-output
(
save-excursion
(
save-excursion
(
re-search-backward
(
format
"‘\\([^‘’]+\\)’"
)
nil
t
)
(
re-search-backward
(
substitute-command-keys
"‘\\([^‘’]+\\)’"
)
nil
t
)
(
help-xref-button
1
'help-function-def
function
file-name
))))
(
help-xref-button
1
'help-function-def
function
file-name
))))
(
princ
"."
)
(
princ
"."
)
(
with-current-buffer
(
help-buffer
)
(
with-current-buffer
(
help-buffer
)
...
@@ -727,14 +736,17 @@ it is displayed along with the global value."
...
@@ -727,14 +736,17 @@ it is displayed along with the global value."
(
if
file-name
(
if
file-name
(
progn
(
progn
(
princ
(
format
" is a variable defined in ‘"
))
(
princ
(
substitute-command-keys
" is a variable defined in ‘"
))
(
princ
(
if
(
eq
file-name
'C-source
)
(
princ
(
if
(
eq
file-name
'C-source
)
"C source code"
"C source code"
(
file-name-nondirectory
file-name
)))
(
file-name-nondirectory
file-name
)))
(
princ
(
format
"’.\n"
))
(
princ
(
substitute-command-keys
"’.\n"
))
(
with-current-buffer
standard-output
(
with-current-buffer
standard-output
(
save-excursion
(
save-excursion
(
re-search-backward
(
format
"‘\\([^‘’]+\\)’"
)
nil
t
)
(
re-search-backward
(
substitute-command-keys
"‘\\([^‘’]+\\)’"
)
nil
t
)
(
help-xref-button
1
'help-variable-def
(
help-xref-button
1
'help-variable-def
variable
file-name
)))
variable
file-name
)))
(
if
valvoid
(
if
valvoid
...
@@ -864,7 +876,8 @@ if it is given a local binding.\n")))
...
@@ -864,7 +876,8 @@ if it is given a local binding.\n")))
;; Mention if it's an alias.
;; Mention if it's an alias.
(unless (eq alias variable)
(unless (eq alias variable)
(setq extra-line t)
(setq extra-line t)
(princ (format "
This
variable
is
an
alias
for
‘
%s
’
.
\n
"
(princ (format (substitute-command-keys
"
This
variable
is
an
alias
for
‘
%s
’
.
\n
")
alias)))
alias)))
(when obsolete
(when obsolete
...
@@ -872,9 +885,9 @@ if it is given a local binding.\n")))
...
@@ -872,9 +885,9 @@ if it is given a local binding.\n")))
(princ "
This
variable
is
obsolete
")
(princ "
This
variable
is
obsolete
")
(if (nth 2 obsolete)
(if (nth 2 obsolete)
(princ (format "
since
%s
" (nth 2 obsolete))))
(princ (format "
since
%s
" (nth 2 obsolete))))
(princ (cond ((stringp use)
(princ (cond ((stringp use)
(concat "
;\n " use))
(concat "
;\n "
(substitute-command-keys
use)))
(
use
(
format
(
substitute-command-keys
(
use
(
format
";\n use ‘%s’ instead."
";\n use ‘%s’ instead."
)
(
car
obsolete
)))
(
car
obsolete
)))
(
t
"."
)))
(
t
"."
)))
(
terpri
))
(
terpri
))
...
@@ -905,7 +918,7 @@ if it is given a local binding.\n")))
...
@@ -905,7 +918,7 @@ if it is given a local binding.\n")))
;; Otherwise, assume it was set directly.
;; Otherwise, assume it was set directly.
(
setq
file
(
car
file
)
(
setq
file
(
car
file
)
dir-file
nil
)))
dir-file
nil
)))
(
princ
(
format
(
princ
(
substitute-command-keys
(
if
dir-file
(
if
dir-file
"by the file\n ‘"
"by the file\n ‘"
"for the directory\n ‘"
)))
"for the directory\n ‘"
)))
...
@@ -913,7 +926,7 @@ if it is given a local binding.\n")))
...
@@ -913,7 +926,7 @@ if it is given a local binding.\n")))
(
insert-text-button
(
insert-text-button
file
'type
'help-dir-local-var-def
file
'type
'help-dir-local-var-def
'help-args
(
list
variable
file
)))
'help-args
(
list
variable
file
)))
(
princ
(
format
"’.\n"
))))
(
princ
(
substitute-command-keys
"’.\n"
))))
(
princ
" This variable's value is file-local.\n"
)))
(
princ
" This variable's value is file-local.\n"
)))
(
when
(
memq
variable
ignored-local-variables
)
(
when
(
memq
variable
ignored-local-variables
)
...
@@ -937,7 +950,8 @@ file-local variable.\n")
...
@@ -937,7 +950,8 @@ file-local variable.\n")
(princ "
if
its
value\n
satisfies
the
predicate
")
(princ "
if
its
value\n
satisfies
the
predicate
")
(princ (if (byte-code-function-p safe-var)
(princ (if (byte-code-function-p safe-var)
"
which
is
a
byte-compiled
expression.\n
"
"
which
is
a
byte-compiled
expression.\n
"
(format "
‘
%s
’
.
\n
" safe-var))))
(format (substitute-command-keys "
‘
%s
’
.
\n
")
safe-var))))
(if extra-line (terpri))
(if extra-line (terpri))
(princ "
Documentation:\n
")
(princ "
Documentation:\n
")
...
...
lisp/help.el
View file @
0b0c9565
...
@@ -964,12 +964,14 @@ documentation for the major and minor modes of that buffer."
...
@@ -964,12 +964,14 @@ documentation for the major and minor modes of that buffer."
(
let*
((
mode
major-mode
)
(
let*
((
mode
major-mode
)
(
file-name
(
find-lisp-object-file-name
mode
nil
)))
(
file-name
(
find-lisp-object-file-name
mode
nil
)))
(
when
file-name
(
when
file-name
(
princ
(
format
" defined in ‘%s’"
(
princ
(
concat
(
substitute-command-keys
" defined in ‘"
)
(
file-name-nondirectory
file-name
)))
(
file-name-nondirectory
file-name
)
(
substitute-command-keys
"’"
)))
;; Make a hyperlink to the library.
;; Make a hyperlink to the library.
(
with-current-buffer
standard-output
(
with-current-buffer
standard-output
(
save-excursion
(
save-excursion
(
re-search-backward
(
format
"‘\\([^‘’]+\\)’"
)
nil
t
)
(
re-search-backward
(
substitute-command-keys
"‘\\([^‘’]+\\)’"
)
nil
t
)
(
help-xref-button
1
'help-function-def
mode
file-name
)))))
(
help-xref-button
1
'help-function-def
mode
file-name
)))))
(
princ
":\n"
)
(
princ
":\n"
)