summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmin Bandali <bandali@gnu.org>2018-12-22 13:32:59 -0500
committerAmin Bandali <bandali@gnu.org>2018-12-22 13:32:59 -0500
commit5e07a0910b5ee74100ef0a42ab5210d47292d52f (patch)
tree7e50cce119c85b4395288be378b906e05909cb12
parentf79ed7c654cadb5f3b48a6aa7fecb4e7adcd95f8 (diff)
downloadconfigs-5e07a0910b5ee74100ef0a42ab5210d47292d52f.tar.gz
configs-5e07a0910b5ee74100ef0a42ab5210d47292d52f.tar.xz
configs-5e07a0910b5ee74100ef0a42ab5210d47292d52f.zip
[emacs/compile] better silence the ad-redefinition-action
just wrap the whole workaround in a use-package
Diffstat (limited to '')
-rw-r--r--init.org37
1 files changed, 18 insertions, 19 deletions
diff --git a/init.org b/init.org
index f05e53c..5006e56 100644
--- a/init.org
+++ b/init.org
@@ -652,27 +652,27 @@ Based on https://stackoverflow.com/a/17788551, with changes to use
=cl-letf= instead of the now obsolete =flet=.
#+begin_src emacs-lisp
-(defun amin--compilation-finish-function (buffer outstr)
- (unless (string-match "finished" outstr)
- (switch-to-buffer-other-window buffer))
- t)
-
-(setq compilation-finish-functions #'amin--compilation-finish-function)
+(use-package compile
+ :config
+ (defun amin--compilation-finish-function (buffer outstr)
+ (unless (string-match "finished" outstr)
+ (switch-to-buffer-other-window buffer))
+ t)
-(require 'cl-macs)
+ (setq compilation-finish-functions #'amin--compilation-finish-function)
-(setq ad-redefinition-action 'accept)
-(defadvice compilation-start
- (around inhibit-display
- (command &optional mode name-function highlight-regexp))
- (if (not (string-match "^\\(find\\|grep\\)" command))
- (cl-letf (((symbol-function 'display-buffer) #'ignore)
- ((symbol-function 'set-window-point) #'ignore)
- ((symbol-function 'goto-char) #'ignore))
- (save-window-excursion ad-do-it))
- ad-do-it))
+ (require 'cl-macs)
-(ad-activate 'compilation-start)
+ (defadvice compilation-start
+ (around inhibit-display
+ (command &optional mode name-function highlight-regexp))
+ (if (not (string-match "^\\(find\\|grep\\)" command))
+ (cl-letf (((symbol-function 'display-buffer) #'ignore)
+ ((symbol-function 'set-window-point) #'ignore)
+ ((symbol-function 'goto-char) #'ignore))
+ (save-window-excursion ad-do-it))
+ ad-do-it))
+ (ad-activate 'compilation-start))
#+end_src
*** Search for non-ASCII characters
@@ -2280,7 +2280,6 @@ Display how long it took to load the init file.
(message "Loading %s...done (%.3fs)" user-init-file
(float-time (time-subtract (current-time)
amin--before-user-init-time)))
-(setq ad-redefinition-action 'warn)
#+end_src
* Footer