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
e1f29348
Commit
e1f29348
authored
Aug 25, 2012
by
Barry O'Reilly
Committed by
Stefan Monnier
Aug 25, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* src/lisp.h (functionp): New function (extracted from Ffunctionp).
(FUNCTIONP): Use it. * src/eval.c (Ffunctionp): Use it.
parent
4c47bd1e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
33 deletions
+43
-33
src/ChangeLog
src/ChangeLog
+8
-2
src/eval.c
src/eval.c
+2
-26
src/lisp.h
src/lisp.h
+33
-5
No files found.
src/ChangeLog
View file @
e1f29348
2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
* lisp.h (functionp): New function (extracted from Ffunctionp).
(FUNCTIONP): Use it.
* eval.c (Ffunctionp): Use it.
2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
* xgselect.c (xg_select): Use auto storage for the GPollFD buffer
...
...
@@ -160,8 +166,8 @@
* w32uniscribe.c (uniscribe_shape): Fix producing gstring
components for RTL text (Bug#11860). Adjust X-OFFSET of each
non-base glyph for the width of the base character, according to
what x_draw_composite_glyph_string_foreground expects.
Generate
WADJUST value according to composition_gstring_width's
what x_draw_composite_glyph_string_foreground expects.
Generate
WADJUST value according to composition_gstring_width's
expectations, to produce correct width of the composed character.
Reverse the sign of the DU offset produced by ScriptPlace.
...
...
src/eval.c
View file @
e1f29348
...
...
@@ -2722,33 +2722,9 @@ DEFUN ("functionp", Ffunctionp, Sfunctionp, 1, 1, 0,
doc
:
/* Non-nil if OBJECT is a function. */
)
(
Lisp_Object
object
)
{
if
(
SYMBOLP
(
object
)
&&
!
NILP
(
Ffboundp
(
object
)))
{
object
=
Findirect_function
(
object
,
Qt
);
if
(
CONSP
(
object
)
&&
EQ
(
XCAR
(
object
),
Qautoload
))
{
/* Autoloaded symbols are functions, except if they load
macros or keymaps. */
int
i
;
for
(
i
=
0
;
i
<
4
&&
CONSP
(
object
);
i
++
)
object
=
XCDR
(
object
);
return
(
CONSP
(
object
)
&&
!
NILP
(
XCAR
(
object
)))
?
Qnil
:
Qt
;
}
}
if
(
SUBRP
(
object
))
return
(
XSUBR
(
object
)
->
max_args
!=
UNEVALLED
)
?
Qt
:
Qnil
;
else
if
(
COMPILEDP
(
object
))
if
(
FUNCTIONP
(
object
))
return
Qt
;
else
if
(
CONSP
(
object
))
{
Lisp_Object
car
=
XCAR
(
object
);
return
(
EQ
(
car
,
Qlambda
)
||
EQ
(
car
,
Qclosure
))
?
Qt
:
Qnil
;
}
else
return
Qnil
;
return
Qnil
;
}
DEFUN
(
"funcall"
,
Ffuncall
,
Sfuncall
,
1
,
MANY
,
0
,
...
...
src/lisp.h
View file @
e1f29348
...
...
@@ -1906,11 +1906,7 @@ typedef struct {
Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object)
/* Non-zero if OBJ is a Lisp function. */
#define FUNCTIONP(OBJ) \
((CONSP (OBJ) && EQ (XCAR (OBJ), Qlambda)) \
|| (SYMBOLP (OBJ) && !NILP (Ffboundp (OBJ))) \
|| COMPILEDP (OBJ) \
|| SUBRP (OBJ))
#define FUNCTIONP(OBJ) functionp(OBJ)
/* defsubr (Sname);
is how we define the symbol for function `name' at start-up time. */
...
...
@@ -3656,6 +3652,38 @@ maybe_gc (void)
Fgarbage_collect
();
}
LISP_INLINE
int
functionp
(
Lisp_Object
object
)
{
if
(
SYMBOLP
(
object
)
&&
!
NILP
(
Ffboundp
(
object
)))
{
object
=
Findirect_function
(
object
,
Qt
);
if
(
CONSP
(
object
)
&&
EQ
(
XCAR
(
object
),
Qautoload
))
{
/* Autoloaded symbols are functions, except if they load
macros or keymaps. */
int
i
;
for
(
i
=
0
;
i
<
4
&&
CONSP
(
object
);
i
++
)
object
=
XCDR
(
object
);
return
!
(
CONSP
(
object
)
&&
!
NILP
(
XCAR
(
object
)));
}
}
if
(
SUBRP
(
object
))
return
XSUBR
(
object
)
->
max_args
!=
UNEVALLED
;
else
if
(
COMPILEDP
(
object
))
return
1
;
else
if
(
CONSP
(
object
))
{
Lisp_Object
car
=
XCAR
(
object
);
return
EQ
(
car
,
Qlambda
)
||
EQ
(
car
,
Qclosure
);
}
else
return
0
;
}
INLINE_HEADER_END
#endif
/* EMACS_LISP_H */
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