tag:blogger.com,1999:blog-3992530807750384868.post6631519299738080226..comments2022-03-28T08:42:20.497+03:00Comments on emacs-fu: rememberUnknownnoreply@blogger.comBlogger8125tag:blogger.com,1999:blog-3992530807750384868.post-6064094555887441002014-03-02T16:31:02.140+02:002014-03-02T16:31:02.140+02:00you should use capture which is delivered with org...you should use capture which is delivered with org mode, and not remember any more!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-52341509775974934152010-03-21T03:42:39.747+02:002010-03-21T03:42:39.747+02:00Ha! I think I solved the problem where you either ...Ha! I think I solved the problem where you either get an extra frame, or your remember frame disappears right after appearing. The problem is that emacs acts a little oddly if the one and only frame currently in existence was created by emacsclient itself. This is the case if you do emacsclient -e '(remember-other-frame)'. You can work around this by using the -c option to create a new frame, but then you have an extra frame lying around. <br /><br />So, to fix this, my basic idea was to create a "sacrificial" frame, then do what I wanted to do, then delete the sacrificial frame. This seems to work. To do this, put the following in your .emacs somewhere:<br /><br />(defmacro with-invisible-background-frame (&rest body)<br /> "Like `progn', but evaluates the body after creating a new<br /> frame and making it invisible. After the body is evaluated,this<br /> background frame is deleted. Also, any errors are ignored in<br /> the body, because I can't fathom emacs' error-handling<br /> functions. This function exists to work around one of the<br /> quirks of emacsclient."<br /><br /> `(let ((sacrificial-frame (make-frame)))<br /> (make-frame-invisible sacrificial-frame)<br /> (ignore-errors ,@body)<br /> (delete-frame sacrificial-frame)))<br /><br />That function (actually a macro, but whatever) will create a sacrificial frame, make it invisible, do your stuff, then delete that frame. Since all your commands get executed while a frame already exists, your commands shouldn't trigger the weird behavior described above, and so they should not be deleted.<br /><br />Here's an example. Suppose you have an emacs dameon with no open frames, and you run the following at the command-line:<br /><br />emacsclient -e '(remember-other-frame)'<br /><br />What probably happens is that the remember frame appears and then disappears before you can do anything with it. Now, try this instead:<br /><br />emacsclient -d "$DISPLAY" -e '(with-invisible-background-frame (remember-other-frame))'<br /><br />You should get what you want, a remember frame that doesn't disappear. The sacrificial frame may be visible for a split second.<br /><br />Oh, and you'll probably have to use something like emacsclient -d "$DISPLAY" to tell emacsclient which display to use.Ryannoreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-50163225048481947682010-02-11T16:39:48.784+02:002010-02-11T16:39:48.784+02:00It's really nice hack, but emacsclient process...It's really nice hack, but emacsclient process keeps running after closing frame.Vladimirhttps://www.blogger.com/profile/13085113161610838297noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-535293620711300772010-01-28T10:14:05.071+02:002010-01-28T10:14:05.071+02:00The remember-frame keeps popping up very briefly a...The remember-frame keeps popping up very briefly and dissapears again with the original setting. However, if I use rodprice's settings I get two emacs frames, both ignoring the width and height settings... <br /><br />I don't know where to look for a solution. I'am using emacs snapshot and would love to have this working.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-38553375627319128332009-09-27T08:40:24.359+03:002009-09-27T08:40:24.359+03:00Ryan's solution using emacs advice above works...Ryan's solution using emacs advice above works for me, but I had to alter the command given to xbindkeys to "emacsclient -e '(remember-other-frame)'" to get it to stop opening two frames.Unknownhttps://www.blogger.com/profile/11650537922139306024noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-74726957700455220972009-07-07T21:41:24.592+03:002009-07-07T21:41:24.592+03:00@Folcon: I've updated the code; hope this fixe...@Folcon: I've updated the code; hope this fixes your problem.<br /><br />@Ryan: I've incorporated some of your ideas.djcbhttps://www.blogger.com/profile/15938154009846040711noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-29711104284746113112009-06-30T17:00:58.685+03:002009-06-30T17:00:58.685+03:00Thanks I appreciate the help, though its not compl...Thanks I appreciate the help, though its not completely solved my problem I have a mostly working solution... Hmm I'll have to do a bit more debugging till I get it fixed :D.Unknownhttps://www.blogger.com/profile/16903627228001309504noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-60636198012382806392009-06-11T14:46:51.729+03:002009-06-11T14:46:51.729+03:00You can do all of that much more easily like this:...You can do all of that much more easily like this:<br /><br />(defcustom remember-frame-alist nil<br /> "Additional frame parameters for dedicated rememebr frame."<br /> :type 'alist<br /> :group 'remember)<br /><br />(defadvice remember (around remember-frame-parameters activate)<br /> "Set some frame parameters for the remember frame."<br /> (let ((default-frame-alist (append remember-frame-alist default-frame-alist)))<br /> ad-do-it))<br /><br />Then M-x customize-variable remember-frame-alist and add width 80 and height 10.<br /><br />In your xbindkeys config, use remember-other-frame instead of make-remember-frame.<br /><br />This has the added bonus of making C-g do the right thing (i.e. close the remember frame) while selecting a template.Unknownhttps://www.blogger.com/profile/02143067975903176677noreply@blogger.com