about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--emacs.el47
1 files changed, 37 insertions, 10 deletions
diff --git a/emacs.el b/emacs.el index 4b39c26..f466b83 100644 --- a/emacs.el +++ b/emacs.el
@@ -279,13 +279,13 @@ With prefix ARG, toggle the value of
279 279
280(defun browse-url-browser-function-safe-p (fn) 280(defun browse-url-browser-function-safe-p (fn)
281 "Return t if FN is a \"safe\" browser function." 281 "Return t if FN is a \"safe\" browser function."
282 (memq f (append browse-url-safe-browser-functions 282 (memq fn (append browse-url-safe-browser-functions
283 (mapcar (lambda (i) 283 (mapcar (lambda (i)
284 (plist-get (cdr i) :value)) 284 (plist-get (cdr i) :value))
285 (seq-filter (lambda (i) 285 (seq-filter (lambda (i)
286 (eq (car i) 'function-item)) 286 (eq (car i) 'function-item))
287 (cdr (get 'browse-url-browser-function 287 (cdr (get 'browse-url-browser-function
288 'custom-type))))))) 288 'custom-type)))))))
289 289
290(put 'browse-url-browser-function 'safe-local-variable 290(put 'browse-url-browser-function 'safe-local-variable
291 'browse-url-browser-function-safe-p) 291 'browse-url-browser-function-safe-p)
@@ -421,6 +421,11 @@ If REQUIRE is a non-nil value, require the package after adding it."
421 (add-hook 'jabber-chat-mode-hook 'visual-line-mode) 421 (add-hook 'jabber-chat-mode-hook 'visual-line-mode)
422 (add-hook 'jabber-chat-mode-hook (defun jabber-no-position () 422 (add-hook 'jabber-chat-mode-hook (defun jabber-no-position ()
423 (setq-local mode-line-position nil))) 423 (setq-local mode-line-position nil)))
424 (add-hook 'jabber-activity-mode-hook
425 (defun jabber-activity-no-global-mode ()
426 (setq global-mode-string
427 (delete '(t jabber-activity-mode-string)
428 global-mode-string))))
424 429
425 (add-hook 'jabber-alert-muc-hooks 430 (add-hook 'jabber-alert-muc-hooks
426 (defun jabber@highlight-acdw (&optional _ _ buf _ _) 431 (defun jabber@highlight-acdw (&optional _ _ buf _ _)
@@ -547,6 +552,8 @@ mouse-3: Toggle minor modes"
547(advice-add 'tabify :around #'call-with-region-or-buffer) 552(advice-add 'tabify :around #'call-with-region-or-buffer)
548(advice-add 'untabify :around #'call-with-region-or-buffer) 553(advice-add 'untabify :around #'call-with-region-or-buffer)
549 554
555(keymap-global-set "M-=" #'count-words)
556
550(with-eval-after-load 'scheme 557(with-eval-after-load 'scheme
551 (keymap-unset scheme-mode-map "M-o" t) 558 (keymap-unset scheme-mode-map "M-o" t)
552 ;; Comparse "keywords" --- CHICKEN (http://wiki.call-cc.org/eggref/5/comparse) 559 ;; Comparse "keywords" --- CHICKEN (http://wiki.call-cc.org/eggref/5/comparse)
@@ -631,7 +638,6 @@ mouse-3: Toggle minor modes"
631(setopt show-paren-when-point-inside-paren t) 638(setopt show-paren-when-point-inside-paren t)
632(show-paren-mode) 639(show-paren-mode)
633 640
634
635;; Encodings 641;; Encodings
636(set-language-environment "UTF-8") 642(set-language-environment "UTF-8")
637(setopt buffer-file-coding-system 'utf-8-unix) 643(setopt buffer-file-coding-system 'utf-8-unix)
@@ -748,14 +754,28 @@ mouse-3: Toggle minor modes"
748 754
749(keymap-global-set "C-c a" #'org-agenda) 755(keymap-global-set "C-c a" #'org-agenda)
750(keymap-global-set "C-c c" #'org-capture) 756(keymap-global-set "C-c c" #'org-capture)
751(setopt org-clock-clocked-in-display 'mode-line) 757(setopt org-clock-clocked-in-display nil)
752(setopt org-clock-string-limit 24)
753(setopt org-clock-out-remove-zero-time-clocks t) 758(setopt org-clock-out-remove-zero-time-clocks t)
754(setopt org-clock-frame-title-format '("%b" " - " (t org-mode-line-string))) 759(setopt org-clock-frame-title-format '("%b" " - " (t org-mode-line-string)))
755(setopt org-tags-column (- (- fill-column 3))) 760(setopt org-tags-column (- (- fill-column 3)))
756(setopt org-log-into-drawer t) 761(setopt org-log-into-drawer t)
757(setopt org-clock-into-drawer t) 762(setopt org-clock-into-drawer t)
758 763
764;; Fix braindead behavior
765(with-eval-after-load 'org-mouse
766 (defun org--mouse-open-at-point (orig-fun &rest args)
767 (let ((context (org-context)))
768 (cond
769 ;; Don't org-cycle when clicking on headline stars. The biggest problem
770 ;; is that this function advises `org-open-at-point', so I can't C-c C-o
771 ;; from a headline star.
772 ;; ((assq :headline-stars context) (org-cycle))
773 ((assq :checkbox context) (org-toggle-checkbox))
774 ((assq :item-bullet context)
775 (let ((org-cycle-include-plain-lists t)) (org-cycle)))
776 ((org-footnote-at-reference-p) nil)
777 (t (apply orig-fun args))))))
778
759;;; Spelling 779;;; Spelling
760 780
761(defun list-of-strings-p (x) 781(defun list-of-strings-p (x)
@@ -1122,3 +1142,10 @@ ORG-EXPORT-ARGS are passed to `org-export-to-buffer'."
1122 "M-w" #'link-hint-copy-link)) 1142 "M-w" #'link-hint-copy-link))
1123 1143
1124(keymap-global-set "M-l" 'link-hint-map) 1144(keymap-global-set "M-l" 'link-hint-map)
1145
1146(setq global-mode-string
1147 '((jabber-activity-mode jabber-activity-mode-string)
1148 (:eval (when (and (fboundp 'org-clocking-p)
1149 (org-clocking-p))
1150 (concat " " (truncate-string-to-width org-mode-line-string
1151 24 nil nil t))))))