[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fringe arrow conflict between compile and gud?
From: |
Juri Linkov |
Subject: |
Re: fringe arrow conflict between compile and gud? |
Date: |
Sat, 02 Apr 2005 03:17:48 +0300 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) Emacs/22.0.50 (gnu/linux) |
> It looks good now. In compilation-sentinel you might like to add:
>
> ;; buffer killed
> (set-process-buffer proc nil)
> + (delq 'next-error-overlay-arrow-position overlay-arrow-variable-list)
>
> although I don't know what the performance penalty is, if any, if you don't.
This is not the right place to put this code. The better place is
`kill-buffer-hook'. And removing next-error-overlay-arrow-position
from overlay-arrow-variable-list is not good after killing the
compilation buffer because there be be other existing compilation/grep
buffers, where users might want to navigate to their locations with
`next-error'. But anyway thanks for the hint about the case
of killing the compilation buffer. I think next-error-overlay-arrow-position
should be set to nil in the local hook kill-buffer-hook.
This might remove the arrow associated with another compilation/grep
buffer since they all share the same next-error arrow, but this is
better than to leave the next-error arrow after killing the compilation
buffer.
The lines
(set (make-local-variable 'overlay-arrow-string) "=>")
and
(put 'next-error-overlay-arrow-position 'overlay-arrow-string "=>")
exist in the following patch until Kim decides to set
overlay-arrow-string to "=>" by default.
Index: lisp/progmodes/compile.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/compile.el,v
retrieving revision 1.348
diff -u -r1.348 compile.el
--- lisp/progmodes/compile.el 29 Mar 2005 04:56:44 -0000 1.348
+++ lisp/progmodes/compile.el 2 Apr 2005 00:16:31 -0000
@@ -1233,6 +1233,11 @@
(make-local-variable 'compilation-messages-start)
(make-local-variable 'compilation-error-screen-columns)
(make-local-variable 'overlay-arrow-position)
+ (set (make-local-variable 'overlay-arrow-string) "=>")
+ (setq next-error-overlay-arrow-position nil)
+ (add-to-list 'overlay-arrow-variable-list 'next-error-overlay-arrow-position)
+ (add-hook 'kill-buffer-hook
+ (lambda () (setq next-error-overlay-arrow-position nil)) nil t)
;; Note that compilation-next-error-function is for interfacing
;; with the next-error function in simple.el, and it's only
;; coincidentally named similarly to compilation-next-error.
@@ -1641,8 +1646,9 @@
(numberp next-error-highlight)))
(delete-overlay compilation-highlight-overlay))))))
(when (and (eq next-error-highlight 'fringe-arrow))
- (set (make-local-variable 'overlay-arrow-position)
- (copy-marker (line-beginning-position))))))
+ (setq next-error-overlay-arrow-position
+ (copy-marker (line-beginning-position))))))
+
(defun compilation-find-file (marker filename dir &rest formats)
"Find a buffer for file FILENAME.
Index: lisp/simple.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/simple.el,v
retrieving revision 1.705
diff -u -r1.705 simple.el
--- lisp/simple.el 29 Mar 2005 23:17:30 -0000 1.705
+++ lisp/simple.el 2 Apr 2005 00:15:56 -0000
@@ -114,6 +114,9 @@
(defvar next-error-highlight-timer nil)
+(defvar next-error-overlay-arrow-position nil)
+(put 'next-error-overlay-arrow-position 'overlay-arrow-string "=>")
+
(defvar next-error-last-buffer nil
"The most recent next-error buffer.
A buffer becomes most recent when its compilation, grep, or
--
Juri Linkov
http://www.jurta.org/emacs/