Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emacs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emacs
emacs
Commits
0a6313f7
Commit
0a6313f7
authored
May 04, 2013
by
Stefan Monnier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* doc/misc/cl.texi (Obsolete Macros): Describe replacements for `flet'.
Fixes: debbugs:14293
parent
998768af
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
3 deletions
+25
-3
doc/misc/ChangeLog
doc/misc/ChangeLog
+5
-0
doc/misc/cl.texi
doc/misc/cl.texi
+20
-3
No files found.
doc/misc/ChangeLog
View file @
0a6313f7
2013-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
* cl.texi (Obsolete Macros): Describe replacements for `flet'
(bug#14293).
2013-04-16 Michael Albinus <michael.albinus@gmx.de>
* tramp.texi (Frequently Asked Questions): Precise, how to define
...
...
doc/misc/cl.texi
View file @
0a6313f7
...
...
@@ -4850,10 +4850,27 @@ generated directly inside Emacs will not be caught since they make
direct C-language calls to the message routines rather than going
through the Lisp @code{message} function.
For those cases where the dynamic scoping of @code{flet} is desired,
@code{cl-flet} is clearly not a substitute. The most direct replacement would
be instead to use @code{cl-letf} to temporarily rebind @code{(symbol-function
'@var{fun})}. But in most cases, a better substitute is to use an advice, such
as:
@example
(defvar my-fun-advice-enable nil)
(add-advice '@var{fun} :around
(lambda (orig &rest args)
(if my-fun-advice-enable (do-something)
(apply orig args))))
@end example
so that you can then replace the @code{flet} with a simple dynamically scoped
binding of @code{my-fun-advice-enable}.
@c Bug#411.
Note that many primitives (e.g., @code{+}) have special byte-compile
handling. Attempts to redefine such functions using @code{flet} will
fail if
byte-compiled.
Note that many primitives (e.g., @code{+}) have special byte-compile
handling.
Attempts to redefine such functions using @code{flet}, @code{cl-letf}, or an
advice will fail when
byte-compiled.
@c Or cl-flet.
@c In such cases, use @code{labels} instead.
@end defmac
...
...
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