4 (message "checking for local setup and loading..")
5 (if (file-exists-p "/local/skel/all.emacs")
6 (load "/local/skel/all.emacs" nil t t))
8 (message "loading .emacs-standard")
9 (load "~/.emacs-standard")
11 (setq vc-follow-symlinks t
12 custom-file (expand-file-name "~/.emacs-custom"))
14 (cw/requiring-forms nil
15 (message "checking for local setup and loading..")
16 (if (file-exists-p "/local/skel/all.emacs")
17 (load "/local/skel/all.emacs" nil t t))
18 (if (file-exists-p custom-file)
19 (load custom-file nil t t)))
21 (setq tfheen-color-preference 'dark) ; light or dark
23 (auto-compression-mode t)
26 (if (string-match "[Uu][Tt][Ff]-?8" (or (getenv "LC_ALL")
30 (set-language-environment "UTF-8") ; UTF-8 mode
31 (if (not window-system)
33 (set-keyboard-coding-system 'utf-8)
34 (set-terminal-coding-system 'utf-8))))
35 (set-language-environment "Latin-1")))
37 ;(prefer-coding-system "utf-8")
39 (add-to-list 'Info-default-directory-list (expand-file-name "~/usr/info"))
41 (add-to-list 'load-path (expand-file-name "~/data/emacs/lisp"))
42 (add-to-list 'load-path (expand-file-name "~/svn/elisp"))
44 (cw/requiring-package (eweouz)
45 (add-hook 'gnus-startup-hook 'eweouz-insinuate-gnus)
46 (add-hook 'mail-setup-hook 'eweouz-insinuate-sendmail)
47 (add-hook 'message-setup-hook 'eweouz-insinuate-message))
49 ;;;(cw/requiring-package (bbdb)
50 ;;; (cw/not-for-host ".*ntnu.no"
51 ;;; (bbdb-initialize 'gnus 'message 'w3))
52 ;;; (setq bbdb-use-pop-up nil
53 ;;; bbdb-quiet-about-name-mismatches t
54 ;;; bbdb-default-area-code nil
55 ;;; bbdb-north-american-phone-numbers-p nil
56 ;;; bbdb-user-mail-names "\(tollef|tfheen\)"
58 ;;; bbdb-use-pop-up nil
59 ;;; mail-setup-hook 'bbdb-insinuate-sendmail
60 ;;; bbdb-dwim-net-address-allow-redundancy t
61 ;;; bbdb-complete-name-allow-cycling t)
62 ;;; (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus)
63 ;;; (add-hook mail-setup-hook 'bbdb-define-all-aliases))
65 (setq default-major-mode 'text-mode
66 mail-user-agent 'gnus-user-agent
67 read-mail-command 'gnus)
69 (add-hook 'text-mode-hook 'turn-on-auto-fill)
70 (add-hook 'debian-changelog-mode-hook 'turn-on-auto-fill)
72 (fset 'yes-or-no-p 'y-or-n-p)
74 (cw/requiring-package (mailcrypt)
75 (cw/not-for-host ".*ntnu.no"
76 (mc-setversion "gpg") )
77 (autoload 'mc-install-write-mode "mailcrypt" nil t)
78 (autoload 'mc-install-read-mode "mailcrypt" nil t)
79 (add-hook 'mail-mode-hook 'mc-install-write-mode)
80 (add-hook 'mail-setup-hook 'mc-install-write-mode)
81 (add-hook 'gnus-summary-mode-hook 'mc-install-read-mode)
82 (add-hook 'news-reply-mode-hook 'mc-install-write-mode)
83 (setq mc-temp-directory (expand-file-name "~/tmp")
85 mc-gpg-user-id "tfheen@opera.no"
86 mc-passwd-timeout 600))
88 (global-set-key "\M-n" 'browse-url-at-point)
89 ;(global-set-key (kbd "C-x C-c")
90 ;#'(lambda () (interactive)
91 ; (if (and window-system (string-match "yiwaz\\|thosu" system-name))
92 ; (message "you must be kidding")
93 ; (save-buffers-kill-emacs))))
95 (global-set-key [(control backspace)] 'undo)
96 (global-set-key [(control return)] 'find-tag)
98 (cw/requiring-package (w3-auto))
100 (setq browse-url-browser-function 'browse-url-generic
101 browse-url-new-window-p t
102 browse-url-mozilla-program (or (executable-find "firefox-3.0") "firefox")
103 browse-url-generic-program "chromium")
107 (autoload 'php-mode "php-mode" "PHP editing mode" t)
108 (autoload 'css-mode "css-mode")
109 (autoload 'pov-mode "pov-mode" "PoVray scene file mode" t)
110 (autoload 'jde-mode "jde" "Java Development Environment" t)
111 (autoload 'dtml-mode "dtml-mode" "Document Template Markup Language" t)
112 (autoload 'vcl-mode "vcl-mode")
114 (add-to-list 'auto-mode-alist '("\\.php3$" . php-mode))
115 (add-to-list 'auto-mode-alist '("\\.css$" . css-mode))
116 (add-to-list 'auto-mode-alist '("\\.pov$" . pov-mode))
117 (add-to-list 'auto-mode-alist '("\\.jl$" . lisp-mode))
118 (add-to-list 'auto-mode-alist '("\\.java$" . jde-mode))
119 (add-to-list 'auto-mode-alist '("\\.vcl$" . vcl-mode))
121 ;; Set up autoloading and auto-mode
122 (autoload 'ps-mode "ps-mode"
123 "Major mode for editing PostScript" t)
124 (setq auto-mode-alist
126 '(("\\.[eE]?[pP][sS]$" . ps-mode))
129 ;; Various programming settings and languages
131 (setq perl-indent-level 8
132 perl-continued-statement-offset 8
133 perl-continued-brace-offset 0
135 perl-brace-imaginary-offset 0
136 perl-label-offset -8)
138 (setq next-line-add-newlines nil
139 compilation-window-height 10
140 european-calendar-style t
143 (defun reverse-list-in-list (reverse-list)
145 (let '(bar (copy-list reverse-list))
148 (let '(elem (car bar))
149 (add-to-list 'liste (reverse elem)))
150 (setq bar (cdr bar)))
153 (setq py-honor-comment-indentation nil)
155 (add-hook 'sgml-mode-hook '(lambda()(local-set-key "\C-c>" 'sgml-insert-end-tag)))
156 ;(add-hook 'emacs-lisp-mode-hook '(lambda()(local-set-key "\C-j" 'find-function)))
158 ;(add-hook 'c-mode-common-hook 'tmpl-init)
159 ;(add-hook 'c-mode-common-hook 'auto-insert-file-header)
160 (add-hook 'c-mode-common-hook (lambda() (local-set-key "\M-\C-x" 'compile)))
161 (add-hook 'c-mode-common-hook (lambda() (local-set-key "\M-\C-z" 'next-error)))
163 (cw/requiring-package (auto-header))
165 (setq header-full-name "Tollef Fog Heen"
166 header-email-address "tollef@err.no"
167 add-log-mailing-address "tfheen@err.no"
168 debian-changelog-mailing-address "tfheen@debian.org"
169 tags-table-list '("~/varnish" "~/usr/include/"))
171 (setq sgml-local-catalogs (list "~/usr/lib/sgml/sgml.catalog"))
174 ; Stolen from Jan Ingvoldstad
175 (add-hook 'find-file-hooks
177 ;; Invoke proper modes when we don't know file extensions
178 (cond ((looking-at "#!.*/perl") (perl-mode))
179 ((looking-at "#!.*/tclsh") (tcl-mode))
180 ((looking-at "#!.*/wish") (tcl-mode))
181 ((looking-at "#!.*/make") (makefile-mode)))))
186 (if (functionp 'toggle-scroll-bar)
188 (toggle-scroll-bar -1)
189 (setq scrollbars-visible-p nil))))
191 (setq scroll-bar-mode nil)
192 ; (set-default-font "fixed")
194 ; show-paren-style 'expression)
196 ; Highlight matching/nonmatching parens
198 ; (show-paren-mode t)) ; show-paren-mode takes too much cpu
200 (global-font-lock-mode t)
205 (cw/requiring-package
207 (setq mmm-global-mode 'maybe)
208 (set-face-background 'mmm-default-submode-face "White"))
210 (cw/requiring-package
212 (cw/requiring-package
214 (set-face-foreground (find-face font-lock-string-face) "Blue")))
216 (cw/requiring-package (tramp)
217 (setq tramp-auto-save-directory "/home/tfheen/tmp"
218 tramp-default-method "rsync"))
220 ;; (setq tramp-multi-file-name-structure (quote ("\\`/r:\\(\\([a-z0-9]+\\)\\)?\\(\\(%s\\)+\\):\\(.*\\)\\'" 2 3 -1))
221 ;; tramp-make-tramp-file-format "/r:%m/%u@%h:%p"
222 ;; tramp-file-name-regexp "\\`/r:"
223 ;; tramp-make-multi-tramp-file-format (quote ("/r:%m" "/%m:%u@%h" ":%p"))
224 ;; tramp-make-tramp-file-user-nil-format "/r:%m/%h:%p"
225 ;; tramp-file-name-structure '("\\`/r:\\(\\([a-zA-Z0-9]+\\)/\\)?\\(\\([-a-zA-Z0-9_#/:]+\\)@\\)?\\([-a-zA-Z0-9_#/:@.]+\\):\\(.*\\)\\'" 2 4 5 6)))
228 (cw/for-emacs-21-and-later
229 (blink-cursor-mode 0)
234 (global-set-key [home] 'beginning-of-buffer)
235 (global-set-key [end] 'end-of-buffer)
237 (setq cursor-in-non-selected-windows nil))
239 (defun tfheen-complete (&optional x)
241 (if (eq major-mode 'jde-mode)
242 (jde-complete-at-point)
245 (global-set-key [C-tab] 'dabbrev-expand)
246 (global-set-key "\M- " 'tfheen-complete)
249 ;(add-hook 'diary-hook 'appt-make-list)
250 ;(add-hook 'diary-hook 'appt-make-list)
256 (cw/for-emacs-22-and-later
257 (setq inhibit-splash-screen t)
258 (setq inhibit-startup-echo-area-message "tfheen")
261 (cw/for-emacs-23-and-later
262 (setq line-move-visual nil))
267 ; (display-battery-mode))
268 (setq display-time-format "%H:%M"
269 display-time-string-forms '(24-hours ":" minutes))
271 (setq show-trailing-whitespace t)
272 ;(setq-default indent-tabs-mode nil)
273 (cw/for-emacs-21-and-later
274 (define-coding-system-alias 'iso885915 'iso-8859-15)
275 (define-coding-system-alias 'utf8 'utf-8)
276 (define-coding-system-alias 'iso-8859-15 'iso-8859-1))
278 (setq add-log-full-name "Tollef Fog Heen"
279 add-log-time-format 'tfheen-dpkg-changelog-time)
281 (defun tfheen-dpkg-changelog-time ()
282 (let* ((time (decode-time))
284 (minute (second time))
291 (zone (second (current-time-zone)))
292 (daynames '("Mon" "Tue" "Wed" "Thu" "Fri" "Sat" "Sun"))
293 (monthnames '("Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"))
296 (setq dayname (nth (- dow 1) daynames)
297 monthname (nth (- month 1) monthnames))
298 (format "%s %s %d %2d:%2d:%2d %s %d" dayname monthname day hour minute sec zone year)))
300 (add-to-list 'load-path (expand-file-name "~/external/slime"))
301 (cw/requiring-package (slime)
302 (add-hook 'lisp-mode-hook (lambda () (slime-mode t)))
303 (add-hook 'inferior-lisp-mode-hook (lambda () (inferior-slime-mode t)))
304 (setq inferior-lisp-program "sbcl-mt"))
306 (setq mouse-yank-at-point t)
310 (setq elmo-imap4-default-stream-type 'ssl
311 elmo-imap4-default-server "mail.raw.no"
312 elmo-imap4-default-port 993)
313 ; wl-folder-access-subscribe-alist '(("^%" . (t . "."))))
314 (setq elmo-imap4-default-authenticate-type 'clear
315 elmo-default-authenticate-type 'clear)
317 (put 'downcase-region 'disabled nil)
319 (defun linux-c-mode ()
320 "C mode with adjusted defaults for use with the Linux kernel."
325 (setq indent-tabs-mode t)
326 (setq c-basic-offset 8))
328 (autoload 'javascript-mode "javascript-mode" "JavaScript mode" t)
329 (setq auto-mode-alist (append '(("\\.js$" . javascript-mode))
332 (cw/for-emacs-22-and-later
333 (setq org-remember-templates
334 '((?t "* TODO %?\n %i\n %a" "~/svn/plans/todo.org")
335 (?a "* Appointment: %?\n%^T\n%i\n %a" "~/svn/plans/todo.org")))
336 (setq remember-annotation-functions '(org-remember-annotation)
337 remember-handler-functions '(org-remember-handler)
338 org-return-follows-link t
339 org-todo-keywords '("TODO" "STARTED" "WAITING" "DONE")
340 org-agenda-include-diary t
341 org-agenda-include-all-todo t
342 org-tags-column (* -1 (- (frame-width) 10))
343 org-agenda-align-tags-to-column (- (frame-width) 10)
344 org-hide-leading-stars nil
345 org-agenda-files '("~/svn/plans/todo.org")
346 org-stuck-projects '("+LEVEL=2-neverstuck/-DONE" ("TODO" "NEXT" "NEXTACTION" "") ("APPOINTMENT") "")
347 org-clock-out-when-done nil
349 org-clock-into-drawer t)
350 (org-clock-persistence-insinuate))
353 (eval-after-load 'remember
354 '(add-hook 'remember-mode-hook 'org-remember-apply-template))
355 (global-set-key (kbd "C-c r") 'remember)
358 (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
359 (global-set-key (kbd "C-c a") 'org-agenda)
360 (setq org-agenda-custom-commands
364 ("h" tags-todo "@hjemme")
365 ("j" tags-todo "@jobb")))
367 (add-to-list 'window-size-change-functions
368 (lambda (frame) (setq org-tags-column (* -1 (- (frame-width) 10))
369 org-agenda-align-tags-to-column (- (frame-width) 10))))
371 (cw/for-host "qurzaw\\|thosu"
372 (setq gnus-home-directory "~/.emacs.d/gnus"
373 gnus-init-file "~/.gnus"
374 message-directory (concat gnus-home-directory "/Mail")))
377 (cw/for-emacs-23-and-later
378 (setq tfheen-base-size 8)
380 (setq tfheen-base-font "DejaVu Sans Mono"
381 tfheen-current-size tfheen-base-size)
382 ;; Firefox-like zooming of fonts.
384 (defun font-zoom-increase-font-size ()
386 (setq tfheen-current-size (+ tfheen-current-size 2))
387 (let ((font-name (format "%s-%d" tfheen-base-font tfheen-current-size)))
388 (set-frame-font font-name)))
390 (defun font-zoom-decrease-font-size ()
392 (setq tfheen-current-size (- tfheen-current-size 2))
393 (let ((font-name (format "%s-%d" tfheen-base-font tfheen-current-size)))
394 (set-frame-font font-name)))
396 (defun font-zoom-reset-font-size ()
398 (let ((font-name (format "%s-%d" tfheen-base-font tfheen-base-size)))
399 (set-frame-font font-name)))
401 (define-key global-map (read-kbd-macro "C--") 'font-zoom-decrease-font-size)
402 (define-key global-map (read-kbd-macro "C-+") 'font-zoom-increase-font-size)
403 (define-key global-map (read-kbd-macro "C-=") 'font-zoom-reset-font-size)
404 (font-zoom-reset-font-size))
406 (defun minutes-to-hours (minutes)
407 (/ (* 1.0 minutes) 60))
409 (defun weekend-p (time)
410 (> (string-to-number (format-time-string "%u" time)) 5))
412 (defun org-dblock-write:timebalance (params)
413 "Display day-by-day summary, giving a balance"
414 (let* ((ts (plist-get params :tstart))
415 (te (plist-get params :tend))
417 (start (time-to-seconds
418 (apply 'encode-time (org-parse-time-string ts))))
419 (end (time-to-seconds
420 (apply 'encode-time (org-parse-time-string te))))
423 (setq params (plist-put params :tstart nil))
424 (setq params (plist-put params :end nil))
425 (move-marker ins (point))
426 (while (<= start end)
429 (org-clock-sum start (+ start 86400))
430 (goto-char (point-min))
432 (while (or (and (bobp) (prog1 st (setq st nil))
433 (get-text-property (point) :org-clock-minutes)
434 (setq p (point-min)))
435 (setq p (next-single-property-change (point) :org-clock-minutes)))
437 (message (format "pre: %s %d %d %s" (format-time-string "%Y-%m-%d" (seconds-to-time start)) sum start (point)))
438 (if (= 1 (car (org-heading-components)))
439 (setq sum (+ sum (or (get-text-property p :org-clock-minutes) 0)))))
440 (push (list start sum) tbl)))
441 (setq start (+ 86400 start)))
442 (setq tbl (nreverse tbl))
446 (let* ((line (car tbl))
447 (ts (seconds-to-time (first line)))
448 (minutes (second line))
449 (hours (minutes-to-hours minutes)))
450 (setq sum (+ sum hours))
451 (if (not (weekend-p ts))
452 (setq sum (- sum 7.5)))
454 (insert-before-markers
455 (format-time-string "%Y-%m-%d" ts)
456 (format " %f %f\n" hours sum))))
457 (setq tbl (cdr tbl)))))
459 (defun org-dblock-write:invoicerounding (params)
460 "Grab hours in a format suitable for an invoice, rounding all times to a full hour"
461 (let* ((ts (plist-get params :tstart))
462 (te (plist-get params :tend))
464 (start (time-to-seconds
465 (apply 'encode-time (org-parse-time-string ts))))
466 (end (time-to-seconds
467 (apply 'encode-time (org-parse-time-string te))))
470 (setq params (plist-put params :tstart nil))
471 (setq params (plist-put params :end nil))
472 (move-marker ins (point))
473 (while (<= start end)
476 (org-clock-sum start (+ start 86400))
477 (goto-char (point-min))
479 (while (or (and (bobp) (prog1 st (setq st nil))
480 (get-text-property (point) :org-clock-minutes)
481 (setq p (point-min)))
482 (setq p (next-single-property-change (point) :org-clock-minutes)))
484 (message (format "pre: %s %d %d %s" (format-time-string "%Y-%m-%d" (seconds-to-time start)) sum start (point)))
485 (if (= 1 (car (org-heading-components)))
486 (setq sum (+ sum (or (get-text-property p :org-clock-minutes) 0)))))
487 (push (list start sum) tbl)))
488 (setq start (+ 86400 start)))
489 (setq tbl (nreverse tbl))
493 (let* ((line (car tbl))
494 (ts (seconds-to-time (first line)))
495 (minutes (second line))
496 (hours (minutes-to-hours minutes)))
497 (setq sum (+ sum hours))
498 (if (not (weekend-p ts))
499 (setq sum (- sum 7.5)))
501 (insert-before-markers
502 (format-time-string "%Y-%m-%d" ts)
503 (format " %f %f\n" hours sum))))
504 (setq tbl (cdr tbl)))))
506 (defun org-dblock-write:gtimelog (params)
507 "Display day-by-day time reports in gtimelog format."
508 (let* ((ts (plist-get params :tstart))
509 (te (plist-get params :tend))
511 (maxlevel (plist-get params :maxlevel))
512 (start (time-to-seconds
513 (apply 'encode-time (org-parse-time-string ts))))
514 (end (time-to-seconds
515 (apply 'encode-time (org-parse-time-string te))))
516 tbl day-numbers heading1-label)
518 (setq params (plist-put params :tstart nil))
519 (setq params (plist-put params :end nil))
520 (move-marker ins (point))
521 (while (<= start end)
523 (org-clock-sum start (+ start 86400))
524 (goto-char (point-min))
526 (while (or (and (bobp) (prog1 st (setq st nil))
527 (get-text-property (point) :org-clock-minutes)
528 (setq p (point-min)))
529 (setq p (next-single-property-change (point) :org-clock-minutes)))
531 (when (setq time (get-text-property p :org-clock-minutes))
533 (beginning-of-line 1)
534 (when (and (looking-at (org-re "^\\(\\*+\\)[ \t]+\\(.*?\\)\\([ \t]+:[[:alnum:]_@:]+:\\)?[ \t]*$"))
535 (setq level (org-reduced-level
536 (- (match-end 1) (match-beginning 1))))
539 (setq heading1-label (match-string 2))
542 (concat heading1-label ": " (match-string 2))
544 (setq start (+ 86400 start)))
545 (setq tbl (nreverse tbl))
549 (let ((line (car tbl)))
550 (if (< ts (car line))
553 (insert-before-markers
554 (format-time-string "%Y-%m-%d %H:%M %z"
555 (seconds-to-time (first line)))
557 (setq ts (first line))))
559 (insert-before-markers
560 (format-time-string "%Y-%m-%d %H:%M %z"
561 (seconds-to-time (+ ts (* 60 (third line)))))
563 (format "%s" (second line))
565 (setq ts (+ ts (* 60 (third line))))
566 (setq tbl (cdr tbl))))))
569 ;(defadvice current-time (after tfheen-floor-current-time activate disable)
570 ; (setq ad-return-value (seconds-to-time (* 900 (floor (time-to-seconds ad-return-value) 900)))))
571 ;(defadvice org-clock-in (around tfheen-round-clock activate)
572 ; (ad-enable-advice 'current-time 'after 'tfheen-floor-current-time)
573 ; (ad-activate 'current-time)
575 ; (ad-disable-advice 'current-time 'after 'tfheen-floor-current-time)
576 ; (ad-activate 'current-time))
578 ;(defadvice current-time (after tfheen-ceiling-current-time activate disable)
579 ; (setq ad-return-value (seconds-to-time (* 900 (ceiling (time-to-seconds ad-return-value) 900)))))
580 ;(defadvice org-clock-out (around tfheen-round-clock activate)
581 ; (ad-enable-advice 'current-time 'after 'tfheen-ceiling-current-time)
582 ; (ad-activate 'current-time)
584 ; (ad-disable-advice 'current-time 'after 'tfheen-ceiling-current-time)
585 ; (ad-activate 'current-time))
587 (autoload 'vala-mode "vala-mode" "Major mode for editing Vala code." t)
588 (add-to-list 'auto-mode-alist '("\\.vala$" . vala-mode))
589 (add-to-list 'auto-mode-alist '("\\.vapi$" . vala-mode))
590 (add-to-list 'file-coding-system-alist '("\\.vala$" . utf-8))
591 (add-to-list 'file-coding-system-alist '("\\.vapi$" . utf-8))
593 (cw/for-host "qurzaw"
594 (require 'twittering-mode))
596 (defun unfill-paragraph ()
598 (let ((fill-column (point-max)))
599 (fill-paragraph nil)))
601 (defun unfill-region ()
603 (let ((fill-column (point-max)))
604 (fill-region (region-beginning) (region-end) nil)))
606 (define-key global-map "\M-Q" 'unfill-paragraph)
607 (define-key global-map "\C-\M-q" 'unfill-region)
609 (setq twittering-use-native-retweet t
610 twittering-use-icon-storage t
611 twittering-icon-mode t)
613 (setq tfheen-twittering-filter-blacklist
614 '((text . "#oslo #planking")
615 (text . "#WEBELIEBE")
616 (user-screen-name . "\\(Oslo_HitHot\\|Map_Game\\|anbud1\\)")))
618 (defun tfheen-twitter-filter-search ()
620 (let ((non-matching-statuses ()))
621 (dolist (status twittering-new-tweets-statuses)
622 (if (eq (cadr (assoc 'source-spec status)) 'search)
623 (let ((matched-tweets 0))
624 (dolist (item tfheen-twittering-filter-blacklist)
625 (let* ((type (car item))
627 (if (string-match pat (cdr (assoc type status)))
628 (setq matched-tweets (+ 1 matched-tweets)))))
629 (if (= 0 matched-tweets)
630 (setq non-matching-statuses (append non-matching-statuses `(,status)))))
631 (setq non-matching-statuses (append non-matching-statuses `(,status)))))
632 (setq new-statuses non-matching-statuses)))
634 (add-hook 'twittering-new-tweets-hook 'tfheen-twitter-filter-search)
636 (setq twittering-initial-timeline-spec-string
641 ":search/#varnish/"))
643 (define-key org-mode-map [home] 'beginning-of-buffer)
644 (define-key org-mode-map [end] 'end-of-buffer)
646 (defun tfheen/weekday-p ()
647 (let ((wday (nth 6 (decode-time))))
651 (defun tfheen/working-p ()
652 (let ((hour (nth 2 (decode-time))))
653 (and (tfheen/weekday-p)
654 (and (>= hour 7) (<= hour 15)))))
656 (defun tfheen/org-auto-exclude-function (tag)
657 "Automatic task exclusion in the agenda with / RET"
659 ((string= tag "@farm")
662 (if (tfheen/working-p)
665 (unless (member (concat "-" tag) org-agenda-filter)
669 (setq org-agenda-auto-exclude-function 'tfheen/org-auto-exclude-function)
674 (replace-regexp "^==== \\(.*\\) ====" "#### \\1" nil (point-min) (point-max))
675 (replace-regexp "^=== \\(.*\\) ===" "### \\1" nil (point-min) (point-max))
676 (replace-regexp "^== \\(.*\\) ==" "## \\1" nil (point-min) (point-max))
677 (replace-regexp "^= \\(.*\\) =" "# \\1" nil (point-min) (point-max))