tag:blogger.com,1999:blog-3992530807750384868.post8184896567058918882..comments2022-03-28T08:42:20.497+03:00Comments on emacs-fu: showing pop-upsUnknownnoreply@blogger.comBlogger19125tag:blogger.com,1999:blog-3992530807750384868.post-1510753788618160432012-03-26T22:21:04.291+03:002012-03-26T22:21:04.291+03:00It'd be better to replace the "(shell-com...It'd be better to replace the "(shell-command (concat..." with "(start-process ...)".<br /><br />As it is it's wide open to command injection if the incoming messages can come from uncontrolled sources.spingnoreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-20160883733794605492011-02-18T16:42:02.776+02:002011-02-18T16:42:02.776+02:00I've been trying this and it works, but it blo...I've been trying this and it works, but it blocks the emacs process for some seconds which is annoying. Has anybody managed to get it work in an async manner?Simonnoreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-55814907794152951992011-02-01T18:55:25.781+02:002011-02-01T18:55:25.781+02:00Hi djbc.
just a little modification when calling...Hi djbc.<br /><br />just a little modification when calling mplayer. If you are using pulseaudio add the <i>'-ao pulse'</i> parameters.<br /><br />It ends <b><i>"mplayer -ao pulse -really-quiet " sound " 2> /dev/null"</i></b><br /><br />When mplayer was being used(just with alsa) and a notification happens at the same time the notification sound was lostkipuamutayhttp://www.kipuamutay.comnoreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-9085058717801050132010-07-27T17:37:34.671+03:002010-07-27T17:37:34.671+03:00awesome, tnx!awesome, tnx!wikhttps://www.blogger.com/profile/13068439846644672558noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-34238680428006662222010-05-20T17:59:21.973+03:002010-05-20T17:59:21.973+03:00Thanks for the fix, @Kiwon Um.
It seems to be wor...Thanks for the fix, @Kiwon Um.<br /><br />It seems to be working with a few tests I did. <br /><br />One question, the trailing slash at the end of each task is intentional, right?<br /><br />My "combined" tasks look like this in the popup:<br /><br />task1 :tag: \<br />task2 :tag:<br /><br />with a trailing slash after the firstHelloWorldhttps://www.blogger.com/profile/07439131988528827008noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-54545887751795992262010-05-14T05:42:37.324+03:002010-05-14T05:42:37.324+03:00As @HelloWorld said, some emacs users have reporte...As @HelloWorld said, some emacs users have reported that appt only works for one element when there are many schedules at the same time. So I post my org-appt hack which merges the schedules at same time together: <br /><br />(defun kiwon/merge-appt-time-msg-list (time-msg-list)<br /> "Merge time-msg-list's elements if they have the same time."<br /> (let* ((merged-time-msg-list (list)))<br /> (while time-msg-list<br /> (if (eq (car (caar time-msg-list)) (car (caar (cdr time-msg-list))))<br /> (setq time-msg-list<br /> (cons<br /> (append<br /> (list (car (car time-msg-list)) ; time<br /> (concat (car (cdr (car time-msg-list))) " / "(car (cdr (car (cdr time-msg-list)))))) ; combined msg<br /> (cdr (cdr (car time-msg-list)))) ; rest information<br /> (nthcdr 2 time-msg-list)))<br /> (progn (add-to-list 'merged-time-msg-list (car time-msg-list) t)<br /> (setq time-msg-list (cdr time-msg-list)))))<br /> merged-time-msg-list))<br /><br />And you can use this function in org-configuration as follows:<br /><br />(defun kiwon/org-agenda-to-appt ()<br /> (prog2<br /> (setq appt-time-msg-list nil)<br /> (org-agenda-to-appt)<br /> (setq appt-time-msg-list (kiwon/merge-appt-time-msg-list appt-time-msg-list))))<br /><br />(add-hook 'org-finalize-agenda-hook (function kiwon/org-agenda-to-appt))<br /><br />Be careful! If you manage some appt elements not only from org but also others, please keep in mind this hack firstly delete all pre-existing appt-time-msg-list elements!<br /><br />Good luck!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-23795365193682947252010-04-19T17:10:29.621+03:002010-04-19T17:10:29.621+03:00Unfortunately, after playing around with this all ...Unfortunately, after playing around with this all day, it seems that emacs' appt system is limited. If you have two appointments at the same time, you get a notification only for one of them. Also, suppose you have two appointments, say at 12pm and 12:10pm. If the appt warning time is 15 minutes, you get warnings only for the 12pm appointment.<br /><br />The bottom line is that appt is still useful but you'll still need to check your agenda. Don't rely on the appt warnings.HelloWorldhttps://www.blogger.com/profile/07439131988528827008noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-54817902235680306712010-04-16T20:34:23.211+03:002010-04-16T20:34:23.211+03:00I think I may have answered my own question. While...I think I may have answered my own question. While there doesn't seem to be another good hook to run org-agenda-to-appt, I did find "run-at-time". The following runs org-agenda-to-appt every hour:<br /><br />(run-at-time "08:01" 3600 'org-agenda-to-appt)<br /><br />As for the other question, I think "appt-display-interval" controls the number of popups before the deadline.<br /><br />I'm not always at my computer, so if I'm not physically present at the computer before the deadline, I'll miss the popups altogether. Is there a way for emacs to keep sending you popups until you mark the task as done? Notifications stop coming up <i>after</i> the deadline time even if you still haven't marked them done.HelloWorldhttps://www.blogger.com/profile/07439131988528827008noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-65261073397314434122010-04-16T17:59:28.412+03:002010-04-16T17:59:28.412+03:00Hey this is really awesome.
So if I'm gettin...Hey this is really awesome. <br /><br />So if I'm getting this right, in order to work, you have to run the agenda command? Is there a way to add the hook so that it runs after you insert the date (either after C-c . or inserting a deadline)? I don't always run the agenda command. <br /><br />The other thing is that when I tried this it kept bugging me with popups until I marked the task complete. Is there a way to make it popup once?HelloWorldhttps://www.blogger.com/profile/07439131988528827008noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-85689316157208316382010-02-19T06:22:20.213+02:002010-02-19T06:22:20.213+02:00@Folgert Karsdorps: hmmm, do you have things set u...@Folgert Karsdorps: hmmm, do you have things set up on your e-mail program's<br />side? I.e., if you use Wanderlust, you should have something like:<br /><br />(setq <br /> wl-biff-check-interval 30 ;; check every 30 seconds <br /> wl-biff-use-idle-timer t) ;; in the background<br /><br /><br />And may have a look at the other 'wl-biff-' variables. If you're using another<br />e-mail program... you need to do something else.djcbhttps://www.blogger.com/profile/15938154009846040711noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-48737302353313110412010-02-19T01:45:22.274+02:002010-02-19T01:45:22.274+02:00This sounds really cool. However, it doesn't s...This sounds really cool. However, it doesn't seem to work for me. I have libnotify installed (ubuntu 9.10) and the latest emacs-snap-shot version. I do manage to see te notification via the elisp interpreter, but not when new email arrives... Do you perhaps have an idea what may be wrong?<br /><br />Many thanks!Folgert Karsdorphttps://www.blogger.com/profile/02480219006832231175noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-52506562707458505552009-11-22T23:32:36.147+02:002009-11-22T23:32:36.147+02:00@John M: of course my icon/sound paths are very sp...@John M: of course my icon/sound paths are very specific to my machine... but anyway thanks for the great tip about icon-search path in notify-send, did not know that one...djcbhttps://www.blogger.com/profile/15938154009846040711noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-68278530188563891972009-11-22T19:10:02.746+02:002009-11-22T19:10:02.746+02:00just for testing, this bit of code works on Ubuntu...just for testing, this bit of code works on Ubuntu:<br /><br />(djcb-popup "Warning" "The end is near" <br /> "/usr/share/icons/Human/scalable/status/user-busy.svg"<br /> "/usr/share/sounds/gnome/default/alerts/glass.ogg")<br /><br />I'd imagine notify-send has a icon searchpath based on your Gnome theme. For me, finding icons works like this: "find /usr/share/icons/gnome/scalable/"<br /><br />Examples:<br /><br />notify-send -i face-cool "free beer"<br />notify-send -i stock_dialog-warning "it's warm!"John Tells Allhttps://www.blogger.com/profile/10134085861618082210noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-18449481952741432462009-11-21T13:44:07.238+02:002009-11-21T13:44:07.238+02:00Mac users can also use growlnotify. growl.el comes...Mac users can also use <a href="http://growl.info/extras.php#growlnotify" rel="nofollow">growlnotify</a>. <a href="http://www.emacswiki.org/cgi-bin/wiki/growl.el" rel="nofollow">growl.el</a> comes in handy.wilanehttps://www.blogger.com/profile/07135801823590058194noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-13797148867457032912009-11-20T19:40:58.297+02:002009-11-20T19:40:58.297+02:00@kiwonum,@Chris: ah, I see now... I fixed the it (...@kiwonum,@Chris: ah, I see now... I fixed the it (s/%s/%d/). I shouldn't do last minute changes...<br /><br />@Chris: it's a nice way to experiment with Elisp, You could use 'cond' instead of the 'if's. Any maybe increasingly scary sounds as the deadline draws near... good luck!djcbhttps://www.blogger.com/profile/15938154009846040711noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-69207909594909347012009-11-20T18:22:16.366+02:002009-11-20T18:22:16.366+02:00I noticed the problem with the string vs integer a...I noticed the problem with the string vs integer argument as well, and simply replaced the %d in the title to %s.<br /><br />I also checked the value of min-to-appt to change the text to fit a bit better. <br /><br />Here's my version of the wrapper function (helpful comments are welcome, because I'm not too proficient in lisp yet)<br /><br />(defun djcb-appt-display (min-to-app curr-time msg)<br /> (setq title (format "Appt in %s mins" min-to-app))<br /> (if (= 1 (string-to-int min-to-app))<br /> (setq title "Appt in 1 min"))<br /> (if (= 0 (string-to-int min-to-app))<br /> (setq title "Appt NOW"))<br /> (djcb-popup title msg <br /> "/usr/share/icons/gnome/scalable/status/appointment-soon.svg"))Chrishttps://www.blogger.com/profile/02511013971319524554noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-79309308102626401002009-11-20T08:03:58.748+02:002009-11-20T08:03:58.748+02:00@kiwonum: hmmm... my djcb-apt-display function tak...@kiwonum: hmmm... my djcb-apt-display function takes 3 args already; it seems the difference in your proposal is that you replaced 'format' with 'concat'.djcbhttps://www.blogger.com/profile/15938154009846040711noreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-4722471842156242662009-11-20T05:50:36.574+02:002009-11-20T05:50:36.574+02:00A comment for org appt:
In the latest (CVS) org mo...A comment for org appt:<br />In the latest (CVS) org mode, the appt-disp-window-function takes 3 string arguments, so:<br />(defun djcb-appt-display (min-to-app new-time msg)<br /> (djcb-popup (concat "Appointment in " min-to-app " minute(s)") msg <br /> "/usr/share/icons/gnome/32x32/status/appointment-soon.png"<br /> "/usr/share/sounds/ubuntu/stereo/phone-incoming-call.ogg"))<br /> (setq appt-disp-window-function (function djcb-appt-display))<br />will work well.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3992530807750384868.post-88765838302540461572009-11-19T23:37:13.980+02:002009-11-19T23:37:13.980+02:00this is cool. I created a tool for doing OSD (wit...this is cool. I created a tool for doing OSD (with the purpose of showing keystrokes such as emacs during presentations or screencasts) [0]. Now I'm wondering if it would be worthwhile/possible to use notify to do this within emacs itself.<br /><br />0 - http://github.com/mattharrison/pykeyviewmatt harrisonhttp://panela.blog-city.com/noreply@blogger.com