From 7a55472fd6ebfc5487ede548c178ec58a08618dd Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 15 May 2023 16:39:41 -0500 Subject: Fix weird stuff from org-mouse.el --- emacs.el | 47 +++++++++++++++++++++++++++++++++++++---------- 1 file 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 (defun browse-url-browser-function-safe-p (fn) "Return t if FN is a \"safe\" browser function." - (memq f (append browse-url-safe-browser-functions - (mapcar (lambda (i) - (plist-get (cdr i) :value)) - (seq-filter (lambda (i) - (eq (car i) 'function-item)) - (cdr (get 'browse-url-browser-function - 'custom-type))))))) + (memq fn (append browse-url-safe-browser-functions + (mapcar (lambda (i) + (plist-get (cdr i) :value)) + (seq-filter (lambda (i) + (eq (car i) 'function-item)) + (cdr (get 'browse-url-browser-function + 'custom-type))))))) (put 'browse-url-browser-function 'safe-local-variable 'browse-url-browser-function-safe-p) @@ -421,6 +421,11 @@ If REQUIRE is a non-nil value, require the package after adding it." (add-hook 'jabber-chat-mode-hook 'visual-line-mode) (add-hook 'jabber-chat-mode-hook (defun jabber-no-position () (setq-local mode-line-position nil))) + (add-hook 'jabber-activity-mode-hook + (defun jabber-activity-no-global-mode () + (setq global-mode-string + (delete '(t jabber-activity-mode-string) + global-mode-string)))) (add-hook 'jabber-alert-muc-hooks (defun jabber@highlight-acdw (&optional _ _ buf _ _) @@ -547,6 +552,8 @@ mouse-3: Toggle minor modes" (advice-add 'tabify :around #'call-with-region-or-buffer) (advice-add 'untabify :around #'call-with-region-or-buffer) +(keymap-global-set "M-=" #'count-words) + (with-eval-after-load 'scheme (keymap-unset scheme-mode-map "M-o" t) ;; Comparse "keywords" --- CHICKEN (http://wiki.call-cc.org/eggref/5/comparse) @@ -631,7 +638,6 @@ mouse-3: Toggle minor modes" (setopt show-paren-when-point-inside-paren t) (show-paren-mode) - ;; Encodings (set-language-environment "UTF-8") (setopt buffer-file-coding-system 'utf-8-unix) @@ -748,14 +754,28 @@ mouse-3: Toggle minor modes" (keymap-global-set "C-c a" #'org-agenda) (keymap-global-set "C-c c" #'org-capture) -(setopt org-clock-clocked-in-display 'mode-line) -(setopt org-clock-string-limit 24) +(setopt org-clock-clocked-in-display nil) (setopt org-clock-out-remove-zero-time-clocks t) (setopt org-clock-frame-title-format '("%b" " - " (t org-mode-line-string))) (setopt org-tags-column (- (- fill-column 3))) (setopt org-log-into-drawer t) (setopt org-clock-into-drawer t) +;; Fix braindead behavior +(with-eval-after-load 'org-mouse + (defun org--mouse-open-at-point (orig-fun &rest args) + (let ((context (org-context))) + (cond + ;; Don't org-cycle when clicking on headline stars. The biggest problem + ;; is that this function advises `org-open-at-point', so I can't C-c C-o + ;; from a headline star. + ;; ((assq :headline-stars context) (org-cycle)) + ((assq :checkbox context) (org-toggle-checkbox)) + ((assq :item-bullet context) + (let ((org-cycle-include-plain-lists t)) (org-cycle))) + ((org-footnote-at-reference-p) nil) + (t (apply orig-fun args)))))) + ;;; Spelling (defun list-of-strings-p (x) @@ -1122,3 +1142,10 @@ ORG-EXPORT-ARGS are passed to `org-export-to-buffer'." "M-w" #'link-hint-copy-link)) (keymap-global-set "M-l" 'link-hint-map) + +(setq global-mode-string + '((jabber-activity-mode jabber-activity-mode-string) + (:eval (when (and (fboundp 'org-clocking-p) + (org-clocking-p)) + (concat " " (truncate-string-to-width org-mode-line-string + 24 nil nil t)))))) -- cgit 1.4.1-21-gabe81