summaryrefslogtreecommitdiff
path: root/README.creole
diff options
context:
space:
mode:
authorNic Ferier <nic@ferrier.me.uk>2013-05-18 15:52:48 +0100
committerNic Ferier <nic@ferrier.me.uk>2013-05-18 15:52:48 +0100
commit64e103c93d1954b5be91eadec291ac78031740bc (patch)
tree68bd5d184c9a44c352d51dfc1f97efa05a87ec12 /README.creole
parent1826c6ea5a216431c2ab351ff56b59dbe4913e50 (diff)
document the decorating functionality
Diffstat (limited to 'README.creole')
-rw-r--r--README.creole17
1 files changed, 17 insertions, 0 deletions
diff --git a/README.creole b/README.creole
index 94e95fc..14553c2 100644
--- a/README.creole
+++ b/README.creole
@@ -30,3 +30,20 @@ This specifies that two functions should be overridden:
In both cases {{{this-fn}}} is used to access the original function
definition of these common Emacs functions.
+
+=== Decorating results ===
+
+noflet can also be used to decorate results of course:
+
+{{{
+(noflet ((find-file (file-name &optional wildcards)
+ (let ((result (funcall this-fn file-name wildcards)))
+ (with-current-buffer result
+ (setq some-buffer-local "special"))
+ result)))
+ (with-current-buffer (find-file "~/some-file")
+ (message "buffer local var is: %s" some-buffer-local)))
+}}}
+
+This overrides {{{find-file}}} to set a local variable. There are
+surely better ways to do it than this but it illustrates the point.