aboutsummaryrefslogtreecommitdiff
path: root/emacs/.emacs.d/lisp
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2024-05-09 19:54:35 +1000
committerYuchen Pei <id@ypei.org>2024-05-09 19:54:35 +1000
commitc725c4d789ba6d1a7fa2ee3107fe443639bae724 (patch)
tree910716493f4a0ca604024d5e6a9881911d2a8677 /emacs/.emacs.d/lisp
parent13ab7e08cb0abe626f9c5cf678b6049db7251909 (diff)
[emacs] disable which-function in json mode when buffer is big
Diffstat (limited to 'emacs/.emacs.d/lisp')
-rw-r--r--emacs/.emacs.d/lisp/my/my-prog.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-prog.el b/emacs/.emacs.d/lisp/my/my-prog.el
index 7e37611..9d6a778 100644
--- a/emacs/.emacs.d/lisp/my/my-prog.el
+++ b/emacs/.emacs.d/lisp/my/my-prog.el
@@ -149,7 +149,7 @@
(cons 'annotation-function
(lambda (c)
(alist-get c pairs nil nil #'equal)))))
- (t
+ (_
(if (string-blank-p str)
(all-completions str pairs)
(all-completions
@@ -241,7 +241,7 @@ With a prefix arg, convert from bottom to top."
(cond ((not file-location-from) file-location-at)
((not file-location-at) file-location-from)
((< point-at point-from) file-location-at)
- (t file-location-from)))
+ (_ file-location-from)))
(when (and func-name file-location)
(push (concat "[[" file-location "][" func-name "]]") results))))
(unless current-prefix-arg (setq results (reverse results)))
@@ -415,8 +415,10 @@ left and the source buffer on the right.
(mapcar 'prin1-to-string (plist-get (json-path-to-position (point)) :path))
"/"))
-(defun my-json-set-header-line-hook ()
- (when (< (point-max) 100000) (my-json-set-header-line-to-path)))
+(defun my-json-setup-hook ()
+ (if (< (point-max) 100000)
+ (my-json-set-header-line-to-path)
+ (setq which-func-mode nil)))
(defun my-json-set-header-line-to-path ()
(setq header-line-format