[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-devel] suggestion for improving inverse search
From: |
Olive |
Subject: |
[AUCTeX-devel] suggestion for improving inverse search |
Date: |
Tue, 05 Apr 2005 16:26:11 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040618 |
The default behaviour of emacsclient has a major inconvenient with
auctex: if a file is modified and we perform an inverse search on it he
ask the question if the user want to revert the buffer. This is annoying
and dangerous if the user answer yes too fast because he losts all his
change. In my experience of typing, I perform quite often an inverse
search after having corrected small typing mistakes for which it is not
worthwhile to recompile. I have patched server.el in order to add a
customizable option allowing the user to disable this feature. This
patch is quite obvious for developper but maybe not for a newbie.
Another problem is that auctex should chhose the window where too
display the buffer in a smart way. I pe-ropose the following algorithm:
1) If the file is already displayed somewhere, just go to the correct
line in the good place.
2) If 1) is false try to choose a window not displaying a compilation
result (rationale: it is common to have the upper window displaying some
latex file and the bottom the compilation; inverse serach should ne
break this.
3) Otherwise display the result in any available window.
In order to implement this I need to know if is easily possible to test
if a buffer is a compilation buffer. Anyone has a suggestion? (I am new
to auctex and also to elisp)
Implementing this need gnuclient or the CVS-version of emacsclient (with
the ability to evaluate an arbitrary lisp expression).
Olive
*** server.el.orig 2005-03-30 11:28:24.000000000 +0200
--- server.el 2005-03-30 11:38:42.000000000 +0200
***************
*** 141,146 ****
--- 141,154 ----
:type 'boolean
:version "21.1")
+ (defcustom server-ask-revert-buffer t
+ "*If non-nil, if the server visit a buffer which have been modified
+ without being saved, ask wether we should revert the buffer to the file.
+ If nil, don't ask the question and assume the answer is no"
+ :type 'boolean
+ :group 'server)
+
+
(or (assq 'server-buffer-clients minor-mode-alist)
(setq minor-mode-alist (cons '(server-buffer-clients " Server")
minor-mode-alist)))
***************
*** 320,327 ****
(if (and obuf (set-buffer obuf))
(progn
(cond ((file-exists-p filen)
! (if (or (not (verify-visited-file-modtime obuf))
! (buffer-modified-p obuf))
(revert-buffer t nil)))
(t
(if (y-or-n-p
--- 328,335 ----
(if (and obuf (set-buffer obuf))
(progn
(cond ((file-exists-p filen)
! (if (and server-ask-revert-buffer (or (not
(verify-visited-file-modtime obuf))
!
(buffer-modified-p obuf)))
(revert-buffer t nil)))
(t
(if (y-or-n-p
- [AUCTeX-devel] suggestion for improving inverse search,
Olive <=