Created
September 8, 2011 01:55
-
-
Save legumbre/1202418 to your computer and use it in GitHub Desktop.
flet and byte-compiled primitives
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; discussed this with jlf and turbofail in #emacs | |
| ;; say we want a function face-at-pos, and we attempt to do | |
| ;; it by fletting `point' and using `face-at-point' | |
| (defun face-at-pos (pos) | |
| "return the face at position p using face-at-point" | |
| (flet ((point () pos)) | |
| (face-at-point))) ;; face-at-point uses `point' internally | |
| ;; that won't work if face-at-point is byte-compiled since `point' is | |
| ;; a bytecode primitive and the interpreter will bypass the symbol | |
| ;; lookup (so no flet!) | |
| ;; One can see the byte-opcode flag set in (symbol-plist 'point) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment