-
Notifications
You must be signed in to change notification settings - Fork 2
Rewrite using EIEIO #5
Comments
The following is a usage:
|
Readme in |
Code looks really nice and clean, well-organized! :) |
Your idea was great. I wouldn't be able to come up with it by myself. Thank you. |
Now you can specify function to make a frame in a form of S expression (c7f92d5). This allows you to integrate frame-workflow with frame-purpose concisely, as in the following example: (frame-workflow-define-subject "emacs-lisp"
:make-frame '(frame-purpose-make-mode-frame 'emacs-lisp-mode)) I personally want to strip the quote symbol ( |
Cool! To remove the quote, you'll need to make |
This is an attempt to solve the following problem: #5 (comment)
Thanks. It was a macro, but I mistakenly quoted its entire macro body. Fixed at 3f62c81 Possibly relevant section in the manual: https://www.gnu.org/software/emacs/manual/html_node/elisp/Problems-with-Macros.html#Problems-with-Macros |
That's kind of awkward, because macros are intended to produce code at compile time. This macro isn't producing a Lisp form, so it's acting like a function at runtime. Also, if users call the macro in their config, and if they then byte-compile their config, it will probably produce errors or just not result in the desired behavior, because it will eval at compile time instead of runtime. |
So, it should be converted into a function to require a quote? |
I've added a new commit. How do you think of this solution? adb2399 |
Well, I think that will work correctly, but you should test to make sure. ;) It's really up to you how badly you want to avoid using a quote in the call. If you want to avoid the quote, it should be a macro. If not, it can be a function. Generally, AFAIK, the accepted wisdom is that you shouldn't use a macro when a function will do. But if you want to avoid the quote, it will have to be a macro. On the other hand, making it a macro means that it will be evaluated at compile time, and that actually removes a bit of flexibility from the user. If the user wants to pass a form to the If you were to ask me which is best, I would probably suggest making You might even (frame-workflow-define-subject "emacs-lisp"
:make-frame #'user-make-frame-fn) But only you know which is best, because it's your package. :) Hope this helps, rather than being confusing... |
Thank you for your advice. I will make it a normal |
I've just pushed a new branch named eieio. It is a rewrite from scratch using EIEIO (see #2). Its functionality is minimal for now, but the code seem to be much cleaner than before, so I will continue to work on this branch. I won't continue development on the current mater branch.
The terminology in the README is no longer effective. It has been changed as follows:
frame-workflow-subject
class (and its subclasses) correspond to "prototypes" in the previous version.frame-workflow-observer
class has been added. An object of this class is created for each frame managed by frame-workflow. It can hold frame-local states and handle notifications.I will document these changes soon on the wiki.
The current version lacks some of the features that existed in the previous version. I have to (re-)implement the following features:
frame-workflow-mode
(which is a global minor mode) to add/remove hooks related to frame-workflowThe text was updated successfully, but these errors were encountered: