Browse Source

Add fixes

- Add declare-functions
- Fix load
- Fix auto-highlight-symbol
master
10sr 4 years ago
parent
commit
0590e3a11f
Signed by: 10sr GPG Key ID: 7BEC428194130EB2
1 changed files with 21 additions and 11 deletions
  1. +21
    -11
      emacs.el

+ 21
- 11
emacs.el View File

@@ -492,7 +492,7 @@ Otherwize hook it."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; title and mode-line ;; title and mode-line


(when (require 'terminal-title nil t)
(when (fboundp 'terminal-title-mode)
;; if TERM is not screen use default value ;; if TERM is not screen use default value
(if (getenv "TMUX") (if (getenv "TMUX")
;; if use tmux locally just basename of current dir ;; if use tmux locally just basename of current dir
@@ -540,7 +540,7 @@ Otherwize hook it."
"") "")
))) )))


(when (require 'diminish nil t)
(when (fboundp 'diminish)
(eval-after-init (eval-after-init
(diminish 'recently-mode) (diminish 'recently-mode)
(diminish 'editorconfig-mode) (diminish 'editorconfig-mode)
@@ -638,8 +638,10 @@ Otherwize hook it."
(define-key minibuffer-local-map (kbd "C-p") (kbd "ESC p")) (define-key minibuffer-local-map (kbd "C-p") (kbd "ESC p"))
(define-key minibuffer-local-map (kbd "C-n") (kbd "ESC n")) (define-key minibuffer-local-map (kbd "C-n") (kbd "ESC n"))


(when (require 'minibuffer-line nil t)
(with-eval-after-load 'minibuffer-line
(set-face-underline 'minibuffer-line nil) (set-face-underline 'minibuffer-line nil)
)
(when (fboundp 'minibuffer-line-mode)
(set-variable 'minibuffer-line-refresh-interval (set-variable 'minibuffer-line-refresh-interval
25) 25)


@@ -673,7 +675,7 @@ Otherwize hook it."
(minibuffer-line-mode 1) (minibuffer-line-mode 1)
) )


(when (require 'prompt-text nil t)
(when (fboundp 'prompt-text-mode)


(set-variable 'prompt-text-format (set-variable 'prompt-text-format
`(,(concat "" `(,(concat ""
@@ -888,9 +890,13 @@ Otherwize hook it."
end))) end)))
(setq deactivate-mark t))) (setq deactivate-mark t)))


(when (fboundp 'global-auto-highlight-symbol-mode)
(add-hook 'after-first-visit-hook
'global-auto-highlight-symbol-mode))
(when (fboundp 'auto-highlight-symbol-mode)
(add-hook 'prog-mode-hook
'auto-highlight-symbol-mode))
;; Not work in combination with flyspell-mode
;; (when (fboundp 'global-auto-highlight-symbol-mode)
;; (add-hook 'after-first-visit-hook
;; 'global-auto-highlight-symbol-mode))
(set-variable 'ahs-idle-interval 0.6) (set-variable 'ahs-idle-interval 0.6)




@@ -957,6 +963,7 @@ Otherwize hook it."
;; (set-variable 'fzf/args "--print-query --ansi --inline-info --cycle") ;; (set-variable 'fzf/args "--print-query --ansi --inline-info --cycle")
;; (set-variable 'fzf/args "--print-query --ansi --color=bw --inline-info --cycle") ;; (set-variable 'fzf/args "--print-query --ansi --color=bw --inline-info --cycle")


(declare-function fzf "fzf" t)
(defun my-fzf-or-find-file () (defun my-fzf-or-find-file ()
"Call fzf if usable or call find-file." "Call fzf if usable or call find-file."
(declare (interactive-only t)) (declare (interactive-only t))
@@ -979,19 +986,21 @@ Otherwize hook it."
;; recently ;; recently


;; TODO: Enable after first visit file? ;; TODO: Enable after first visit file?
(when (require 'recently nil t)
(define-key ctl-x-map (kbd "C-r") 'recently-show)
(set-variable 'recently-max 1000)
(with-eval-after-load 'recently
(defvar recently-excludes) (defvar recently-excludes)
(add-to-list 'recently-excludes (add-to-list 'recently-excludes
(rx-to-string (list 'and (rx-to-string (list 'and
'string-start 'string-start
(expand-file-name package-user-dir)) (expand-file-name package-user-dir))
t))
t)))
(when (fboundp 'recently-mode)
(define-key ctl-x-map (kbd "C-r") 'recently-show)
(set-variable 'recently-max 1000)
(recently-mode 1)) (recently-mode 1))


(defvar my-cousel-recently-history nil "History of `my-counsel-recently'.") (defvar my-cousel-recently-history nil "History of `my-counsel-recently'.")


(declare-function recently-list "recently" t)
(when (and (require 'recently nil t) (when (and (require 'recently nil t)
(fboundp 'ivy-read)) (fboundp 'ivy-read))
(defun my-counsel-recently () (defun my-counsel-recently ()
@@ -1981,6 +1990,7 @@ Otherwize hook it."
;; (apply 'concat (my-file-head "./shrc" 10) ;; (apply 'concat (my-file-head "./shrc" 10)




(declare-function dired-get-filename "dired" t)
(defun my-dired-echo-file-head (arg) (defun my-dired-echo-file-head (arg)
"Echo head of current file. "Echo head of current file.




Loading…
Cancel
Save