* Re: compilation-forget-errors still used by tex-mode.el
2004-03-19 14:25 ` Stefan Monnier
@ 2004-03-19 21:41 ` Miles Bader
2004-03-20 17:01 ` Markus Rost
2004-03-31 11:57 ` Daniel Pfeiffer
2 siblings, 0 replies; 17+ messages in thread
From: Miles Bader @ 2004-03-19 21:41 UTC (permalink / raw)
Cc: Markus Rost, occitan, emacs-devel, Kim F. Storm
On Fri, Mar 19, 2004 at 09:25:39AM -0500, Stefan Monnier wrote:
> > There should be commands for both, e.g. C-x ` (next-error) takes next
> > error independently of point, while some other command (I'd prefer
> > RET, but that's another, old, discussion) takes you to the error on the
> > current line (or next error following it (and moves next-error marker
> > accordingly).
>
> There's already M-RET (or something like that: compilation-goto-error,
> together with the mouse version compilation-mouse-goto-error).
There's certainly `C-c C-c', which is what I always use...
-Miles
--
Next to fried food, the South has suffered most from oratory.
-- Walter Hines Page
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: compilation-forget-errors still used by tex-mode.el
2004-03-19 14:25 ` Stefan Monnier
2004-03-19 21:41 ` Miles Bader
@ 2004-03-20 17:01 ` Markus Rost
2004-03-20 19:41 ` Daniel Pfeiffer
2004-03-31 11:57 ` Daniel Pfeiffer
2 siblings, 1 reply; 17+ messages in thread
From: Markus Rost @ 2004-03-20 17:01 UTC (permalink / raw)
Cc: occitan, emacs-devel, storm
As for ideas: What about having for tex compilation parses an option
like
(defcustom tex-plus-error-parse-level nil
"*If non-nil, consider also over/underfull hbox messages as errors.
This enables you to jump to the corresponding source locations."
:type 'boolean
:group 'tex-run)
I once wrote a corresponding hack and use it a lot.
It seems however that one can't use it directly with the new
compile.el and I don't have the time to adjust it. In case someone is
interested, I append here the file containing the code.
===File ~/emacs/lisp/emacs-21/tex-plus.el===================
(let ((l0 (car ispell-tex-skip-alists))
(l1 (cadr ispell-tex-skip-alists)))
(add-to-list 'l0 '("\\\\\\(eq\\)?ref" ispell-tex-arg-end))
(add-to-list 'l0 '("\\\\label" ispell-tex-arg-end))
(add-to-list 'l0 '("[^\\]%.*$"))
(add-to-list 'l1 '("gather\\*?" . "\\\\end[ \t\n]*{[ \t\n]*gather\\*?[ \t\n]*}") t)
(add-to-list 'l1 '("align\\*?" . "\\\\end[ \t\n]*{[ \t\n]*align\\*?[ \t\n]*}") t)
(setcar ispell-tex-skip-alists l0)
(setcar (cdr ispell-tex-skip-alists) l1))
(require 'tex-mode)
(if (string-lessp emacs-version "21.3.49")
(defvar tex-compile-commands nil))
(defvar tex-compile-commands-0 tex-compile-commands
"The original value of `tex-compile-commands'
Used in combination with `tex-compile-commands-1'
Don't set this variable yourself.")
(defcustom tex-compile-commands-1 nil
"List of additional commands for `tex-compile'.
Prepended to `tex-compile-commands-0' to set `tex-compile-commands'.
Set this variable with customize.
See `tex-compile-commands' for the syntax."
:type '(repeat (list
(radio :tag "Commands"
string sexp)
(choice :tag "Input File"
(string :tag "String")
(const :tag "TeX files of the document" t)
(const :tag "Don't know" nil))
(choice :tag "Output File"
(string :tag "String")
(const :tag "No Output File" nil))))
:set (lambda (symbol value)
(set-default symbol value)
(setq tex-compile-commands
(append value (copy-sequence tex-compile-commands-0))))
:group 'tex-run)
;;; Customize the tex-shell.
;; I want it to use HISTFILE=~/.bash/.bash1_history
(defcustom tex-shell-hook nil
"Hook for `tex-shell'."
:type 'hook
:group 'tex-run)
(defcustom tex-shell-file-name nil
"*If non-nil, the shell file name to run in the subshell used to run TeX.
See also `tex-shell-arg-list'."
:type '(choice (const :tag "None" nil)
string)
:group 'tex-run)
(defcustom tex-shell-arg-list nil
"*Alist of options passed to subshell used to run TeX.
See also `tex-shell-file-name'."
:type '(repeat :tag "Option list" string)
:group 'tex-run)
(defun tex-start-shell ()
(with-current-buffer
(apply 'make-comint
"tex-shell"
(or tex-shell-file-name explicit-shell-file-name
(getenv "ESHELL") (getenv "SHELL") "/bin/sh")
nil (or tex-shell-arg-list '("-i")))
(let ((proc (get-process "tex-shell")))
(set-process-sentinel proc 'tex-shell-sentinel)
(process-kill-without-query proc)
(tex-shell)
(while (zerop (buffer-size))
(sleep-for 1)))))
;;; My error parsing.
(defadvice tex-send-tex-command (after tex-plus-compilation activate)
(when (tex-shell-running)
(with-current-buffer (process-buffer (tex-shell-running))
(setq compilation-parse-errors-function
'tex-plus-compilation-parse-errors)
;; Clean up.
(let ((buffer-undo-list t)
(inhibit-read-only t)
deactivate-mark)
;; Remove the text-properties added by
;; tex-plus-compilation-parse-errors.
(if compilation-old-error-list
(remove-text-properties (point-min) (point-max)
'(syntax-table nil)))))))
(defvar tex-plus-start-tex-marker nil
"Marker pointing after last TeX-running command in the TeX shell buffer.")
(defcustom tex-plus-error-parse-level nil
"*If non-nil, consider also over/underfull hbox messages as errors.
This enables you to jump to the corresponding source locations."
:type 'boolean
:group 'tex-run)
;;; Error Parsing
(easy-mmode-defsyntax
tex-plus-error-parse-syntax-table
'((?\{ . "_")
(?\} . "_")
(?\[ . "_")
(?\] . "_")
(?\" . "_"))
"A syntax table used by `tex-plus-compilation-parse-errors'.
Only \"(\" and \")\" are seen by backward-list.")
(easy-mmode-defsyntax
tex-plus-error-skip-syntax-table
'((?\( . "_")
(?\) . "_")
(?\{ . "_")
(?\} . "_")
(?\[ . "_")
(?\] . "_")
(?\" . "_"))
"A syntax table used by `tex-plus-compilation-parse-errors'.
No characters are seen by backward-list.")
(defun tex-plus-compilation-parse-errors (limit-search find-at-least)
"Parse the current buffer as TeX error messages.
See the variable `compilation-parse-errors-function' for the interface it uses.
This function parses only the last TeX compilation.
A special parsing routine is necessary, since TeX does not put file
names and line numbers on the same line as for the error messages."
(require 'thingatpt)
(setq compilation-error-list nil)
(message "Parsing error messages...")
(let (;; First a kind of buffer-save-state.
(buffer-undo-list t) (inhibit-read-only t) deactivate-mark
;; Dir may have changed.
(default-directory
(file-name-directory (buffer-file-name tex-last-buffer-texed)))
;; We use syntax-table text-properties.
(parse-sexp-lookup-properties t)
;; To restore it later.
(err-buf (current-buffer))
;; We need a table with only "(" and ")" seen by backward-list.
;; (tex-plus-error-parse-syntax-table
;; (let ((table (copy-syntax-table)))
;; (modify-syntax-entry ?\{ "_" table)
;; (modify-syntax-entry ?\} "_" table)
;; (modify-syntax-entry ?\[ "_" table)
;; (modify-syntax-entry ?\] "_" table)
;; (modify-syntax-entry ?\" "_" table)
;; table))
;; We need a table with no characters seen by backward-list.
;; (tex-plus-error-skip-syntax-table
;; (let ((table (copy-syntax-table)))
;; (modify-syntax-entry ?\( "_" table)
;; (modify-syntax-entry ?\) "_" table)
;; (modify-syntax-entry ?\{ "_" table)
;; (modify-syntax-entry ?\} "_" table)
;; (modify-syntax-entry ?\[ "_" table)
;; (modify-syntax-entry ?\] "_" table)
;; (modify-syntax-entry ?\" "_" table)
;; table))
;; We freeze point-max here to care about a running tex
;; process.
(current-point-max (point-max)) output-finished
;; The variables to play with.
(num-errors-found 0) parsing-end
last-error last-linenum
error-msg error-type error-start error-end error-text
linenum filename error-source)
;; Do we reparse or parse the first time?
(when (eq (marker-position compilation-parsing-end) 1)
;; If `compilation-forget-errors' would run a hook, that should
;; go there. What about a compilation-forget-errors-function?
(if (and (markerp tex-plus-start-tex-marker)
(eq (current-buffer) (marker-buffer tex-plus-start-tex-marker)))
(set-marker compilation-parsing-end tex-plus-start-tex-marker))
(remove-text-properties (point-min) (point-max) '(syntax-table nil)))
(goto-char compilation-parsing-end)
;; Is the tex run finished?
(save-excursion
(if (setq output-finished
(re-search-forward
"^Transcript written on " nil t))
;; Then limit the parse to its output.
(setq current-point-max output-finished)))
;; Parse messages.
;; To determine the error file we use backward-list with
;; syntax-table tex-plus-error-parse-syntax-table. The messages may
;; contain characters "(" and ")" which irritate the scanning.
;; Therefore the messages receive the syntax-table text-property
;; tex-plus-error-skip-syntax-table.
;; There are basically two types of messages: (I) true tex errors
;; and (II) messages about overfull hboxes and similar things.
;; If the user option `tex-plus-error-parse-level' is nil, type (II)
;; errors are neglected by default for
;; `compilation-error-list'. Otherwise they are treated in the
;; same way as type (I) errors.
(catch 'parsing-end
(while t
(unless
(re-search-forward
;; A regexp for all relevant messages.
;; It is probably incomplete.
"^\\(! \\|\\(Over\\|Under\\)full \\\\.*lines? \\([0-9]+\\)\\)"
current-point-max t)
;; No more messages: exit.
(setq parsing-end current-point-max)
(throw 'parsing-end nil))
(goto-char (match-beginning 0))
(setq error-msg (point-marker))
(setq error-start error-msg)
(cond
((looking-at "^! Emergency stop\\.")
;; A special case: We are at the end.
(setq parsing-end current-point-max)
(throw 'parsing-end nil))
((looking-at "^! ")
;; It is a type (I) error.
(setq error-type t)
;; In a "Runaway argument?", the error lines start before the
;; error message "! Paragraph ended..."
(if (looking-at "^! Paragraph ended before .* was complete.$")
(save-excursion
(forward-line -2)
(if (looking-at "^Runaway argument\\?\n ")
(setq error-start (point-marker)))))
(unless (re-search-forward
"^l\\.\\([0-9]+\\) \\(\\.\\.\\.\\)?\\(.*\\)$"
current-point-max t)
;; The output is not finished: forget this error and exit.
(setq parsing-end error-msg)
(throw 'parsing-end nil))
;; Find the end of this error.
(goto-char (match-end 0))
(forward-line)
(end-of-line)
(setq error-end (point))
;; Get line number and text for searching the source.
(setq linenum (string-to-int (match-string 1)))
(setq error-text (regexp-quote (match-string 3))))
((looking-at "^\\(Over\\|Under\\)full \\\\.*lines? \\([0-9]*\\)")
;; It is a type (II) error.
(setq error-type tex-plus-error-parse-level)
;; Find the end of this error. Code in parts stolen from
;; TeX-warning in tex-buf.el from AUC TeX.
(forward-line)
(end-of-line)
(while (or (equal (current-column) 79)
(save-excursion
(forward-line)
(save-match-data
;; perhaps incomplete or/and incorrect.
;; Maybe just exclude all lines with a \
;; (except for "^! " lines)?
(looking-at "\\( \\\\\\|.*\\[\\]\\)"))))
(forward-line)
(end-of-line))
(setq error-end (point))
(when (>= error-end current-point-max)
;; Output of this error is probably not finished:
;; forget this error and exit.
(setq parsing-end error-msg)
(throw 'parsing-end nil))
;; Get the line number of the source.
(setq linenum (string-to-int (match-string 2)))
;; Getting the error-text is too hard.
;; It is anyway not interesting if `tex-plus-error-parse-level' is nil.
(setq error-text nil)))
;; Put appropriate syntax around the message.
(add-text-properties
error-start error-end
(list 'syntax-table tex-plus-error-skip-syntax-table))
(when error-type
;; Search for and in the source.
(goto-char error-start)
(save-excursion
(with-syntax-table tex-plus-error-parse-syntax-table
(if (or (null last-error)
(save-restriction
(narrow-to-region (car last-error) (point))
(condition-case ()
(while (not (bobp)) (backward-list 1))
(error t))))
;; Have to scan for the file.
(progn
(backward-up-list 1)
(skip-syntax-forward "(_")
(setq filename (thing-at-point 'filename))
(if (or (= 0 (length filename))
(not (file-exists-p filename)))
;; We failed, but continue the parse.
;; Here we could also give up with (error ...)
(message "Couldn't guess source file for error %s"
error-msg))
(if (equal filename (concat tex-zap-file ".tex"))
(set-buffer tex-last-buffer-texed)
(set-buffer (find-file-noselect filename)))
(save-restriction
(widen)
(goto-line linenum)
(or (null error-text)
(re-search-forward error-text nil t)
(re-search-backward error-text nil t))
(setq error-source (point-marker))))
;; No new file.
(set-buffer (marker-buffer (cdr last-error)))
(goto-char (cdr last-error))
(forward-line (- linenum last-linenum))
;; First try a forward search for the error text,
;; then a backward search limited by the last error
;; in this file, if it exists.
(or (null error-text)
(re-search-forward error-text nil t)
(re-search-backward error-text (cdr last-error) t))
(setq error-source (point-marker)))
(set-buffer err-buf)))
;; Have we found more than enough errors? Yes, if we are
;; beyond the requirements, if there is a previous error,
;; and if the following is true: The error is in a new file
;; or we have parsed already 50 errors.
;; The limit 50 is a heuristic. It avoids a long parse if
;; something really bad happened with the tex run and one
;; just wants to jump to the first few errors.
;; Such a break should be allowed by compilation-mode: An
;; equivalent break happens once in a while when the grep
;; process is running while parsing.
(when (and
(if limit-search
(>= error-msg limit-search) t)
(if find-at-least
(>= num-errors-found find-at-least) t)
compilation-error-list
(or (not (eq (marker-buffer error-source)
(marker-buffer (cdr last-error))))
(>= num-errors-found 50)))
;; We forget this error and exit.
(setq parsing-end error-msg)
(throw 'parsing-end nil))
;; Put it on the list and prepare for the next error.
(setq last-error (cons error-msg error-source)
compilation-error-list (nconc compilation-error-list
(list last-error))
num-errors-found (1+ num-errors-found)
last-linenum linenum
parsing-end error-end)
(if (>= num-errors-found 10)
(message "Parsing error messages...[%s]"
(+ num-errors-found
(length compilation-old-error-list)))))
;; Go to the end of message and continue the loop.
(goto-char error-end)))
;; Set `compilation-parsing-end' only here, in case of an error
;; while parsing.
(if (and output-finished (eq parsing-end current-point-max))
;; All errors are parsed. Put compilation-parsing-end at the
;; very end of buffer, moving with insertions. This avoids
;; unnecessary reparsing in some situations.
(progn (set-marker compilation-parsing-end (point-max-marker))
(set-marker-insertion-type compilation-parsing-end t))
(set-marker compilation-parsing-end parsing-end)))
(message "Parsing error messages...done"))
(provide 'tex-plus)
============================================================
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: compilation-forget-errors still used by tex-mode.el
2004-03-20 17:01 ` Markus Rost
@ 2004-03-20 19:41 ` Daniel Pfeiffer
2004-03-21 0:14 ` Markus Rost
0 siblings, 1 reply; 17+ messages in thread
From: Daniel Pfeiffer @ 2004-03-20 19:41 UTC (permalink / raw)
Cc: emacs-devel, Stefan Monnier, storm
Saluton, Moin,
Markus Rost <rost@mathematik.uni-bielefeld.de> skribis:
> As for ideas: What about having for tex compilation parses an option
> like
>
> (defcustom tex-plus-error-parse-level nil
> "*If non-nil, consider also over/underfull hbox messages as errors.
> This enables you to jump to the corresponding source locations."
What happens if you call TeX with -file-line-error-style in normal M-x
compile? Is this something that would come up as a warning?
coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer
--
lerne / learn / apprends / läramå / ucz się Esperanto:
http://lernu.net/
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: compilation-forget-errors still used by tex-mode.el
2004-03-19 14:25 ` Stefan Monnier
2004-03-19 21:41 ` Miles Bader
2004-03-20 17:01 ` Markus Rost
@ 2004-03-31 11:57 ` Daniel Pfeiffer
2004-04-01 13:13 ` Kim F. Storm
2004-04-01 16:18 ` monnier
2 siblings, 2 replies; 17+ messages in thread
From: Daniel Pfeiffer @ 2004-03-31 11:57 UTC (permalink / raw)
Cc: Markus Rost, emacs-devel, Kim F. Storm
Saluton,
Stefan Monnier <monnier@iro.umontreal.ca> skribis:
> >> We should maybe just introduce a new `compilation-current-error' marker
>
> > And add compilation-current-error to overlay-arrow-variable-list :-)
>
> Now there's an idea.
overlay-arrow-variable-list seems to be a very embryonic feature. While you
can put more than one variable into it, only the first occurence in the buffer
actually gets a little arrow in the fringe. And even though there is a string
to
use instead on non-window frames, the feature is not even present on a
text-terminal. And it only works at BOL, whereas error-messages are now
recognized anywhere on a line, even one behind another.
So I'll have to use my own overlay. I'm wondering if flashing this for half a
second, like the jumped to position, is useful. While that is more of a toy,
since the cursor lands there anyways, highlighting the message seems to be an
essential feature for some people. If you get distracted after Cx- ` you can
easily miss this within half a second — especially if it takes a second to
fetch a remote file first.
Maybe I should combine half a second with a pre command hook? Or leave it
until another message gets located?
coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer
--
lerne / learn / apprends / läramå / ucz się Esperanto:
http://lernu.net/
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: compilation-forget-errors still used by tex-mode.el
2004-03-31 11:57 ` Daniel Pfeiffer
@ 2004-04-01 13:13 ` Kim F. Storm
2004-04-01 16:18 ` monnier
1 sibling, 0 replies; 17+ messages in thread
From: Kim F. Storm @ 2004-04-01 13:13 UTC (permalink / raw)
Cc: Markus Rost, Stefan Monnier, emacs-devel
dapfy@t-online.de (Daniel Pfeiffer) writes:
> Saluton,
>
> Stefan Monnier <monnier@iro.umontreal.ca> skribis:
>
> > >> We should maybe just introduce a new `compilation-current-error' marker
> >
> > > And add compilation-current-error to overlay-arrow-variable-list :-)
> >
> > Now there's an idea.
>
> overlay-arrow-variable-list seems to be a very embryonic feature. While you
> can put more than one variable into it, only the first occurence in the buffer
> actually gets a little arrow in the fringe.
In a compile buffer, I would think that one current error marker is enough.
Why do you need more than that?!
> And even though there is a string
> to
> use instead on non-window frames, the feature is not even present on a
> text-terminal.
It is supposed to work, so if not, that's a bug.
> And it only works at BOL, whereas error-messages are now
> recognized anywhere on a line, even one behind another.
Yes, ok, but you can still use it to point out the line as such.
>
> So I'll have to use my own overlay. I'm wondering if flashing this for half a
> second, like the jumped to position, is useful. While that is more of a toy,
> since the cursor lands there anyways, highlighting the message seems to be an
> essential feature for some people. If you get distracted after Cx- ` you can
> easily miss this within half a second — especially if it takes a second to
> fetch a remote file first.
If you decide to use your own overlay, I suggest that you keep the highlight
on the error message. I don't see a need to just highlight it briefly.
In any case, the highlight will disappear when you have reached past
the last error.
>
> Maybe I should combine half a second with a pre command hook? Or leave it
> until another message gets located?
Leave it.
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: compilation-forget-errors still used by tex-mode.el
2004-03-31 11:57 ` Daniel Pfeiffer
2004-04-01 13:13 ` Kim F. Storm
@ 2004-04-01 16:18 ` monnier
2004-04-01 18:34 ` Daniel Pfeiffer
1 sibling, 1 reply; 17+ messages in thread
From: monnier @ 2004-04-01 16:18 UTC (permalink / raw)
Cc: Markus Rost, emacs-devel, Kim F. Storm
> text-terminal. And it only works at BOL, whereas error-messages are now
> recognized anywhere on a line, even one behind another.
Big deal. All people complained about is that the error-line is not
clearly indicated now that we keep 2-lines of context because there is
nothing more than the cursor (which is going to be hollow or maybe even
completely absent) to tell you what line to look at.
So adding an arrow will address this issue just fine, methinks.
> So I'll have to use my own overlay.
I guess I can't stop you, but it doesn't seem necessary for now.
Stefan
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: compilation-forget-errors still used by tex-mode.el
2004-04-01 16:18 ` monnier
@ 2004-04-01 18:34 ` Daniel Pfeiffer
2004-04-01 21:34 ` Kim F. Storm
0 siblings, 1 reply; 17+ messages in thread
From: Daniel Pfeiffer @ 2004-04-01 18:34 UTC (permalink / raw)
Cc: Markus Rost, emacs-devel, Kim F. Storm
Saluton,
monnier <monnier@iro.umontreal.ca> skribis:
> > text-terminal. And it only works at BOL, whereas error-messages are now
> > recognized anywhere on a line, even one behind another.
>
> Big deal. All people complained about is that the error-line is not
> clearly indicated now that we keep 2-lines of context because there is
> nothing more than the cursor (which is going to be hollow or maybe even
> completely absent) to tell you what line to look at.
> So adding an arrow will address this issue just fine, methinks.
>
> > So I'll have to use my own overlay.
>
> I guess I can't stop you, but it doesn't seem necessary for now.
Well, overlay-arrow-variable-list is apparently intended to be extended. If
various commands add their own arrow-wish to this, and only the first gets
displayed, it can still be that compile's arrow doesn't appear.
And as long as this is not available on text displays it's not so good. I was
mistaken however because I'd used the 6 months old standard emacs there. The
only thing missing is assigning something like "-->" to overlay-arrow-string,
maybe with some face applied.
Otoh, it would be the quickest patch to make... Since there can be only one
arrow anyway, I wouldn't worry about a new variable, simply assign something
to overlay-arrow-position.
coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer
--
lerne / learn / apprends / läramå / ucz się Esperanto:
http://lernu.net/
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: compilation-forget-errors still used by tex-mode.el
2004-04-01 18:34 ` Daniel Pfeiffer
@ 2004-04-01 21:34 ` Kim F. Storm
2004-04-02 2:01 ` Miles Bader
0 siblings, 1 reply; 17+ messages in thread
From: Kim F. Storm @ 2004-04-01 21:34 UTC (permalink / raw)
Cc: Markus Rost, monnier, emacs-devel
dapfy@t-online.de (Daniel Pfeiffer) writes:
> Well, overlay-arrow-variable-list is apparently intended to be extended. If
> various commands add their own arrow-wish to this, and only the first gets
> displayed, it can still be that compile's arrow doesn't appear.
My vision with overlay-arrow-variable-list was that each mode (gdb,
compile, grep, ...) would need just one arrow each, and in their "own"
buffer. So, IMO, it doesn't really make sense to have more than one
arrow in each window.
>
> And as long as this is not available on text displays it's not so good. I was
> mistaken however because I'd used the 6 months old standard emacs there.
So does it work, or not?
> The
> only thing missing is assigning something like "-->" to overlay-arrow-string,
> maybe with some face applied.
You can assign a separate overlay arrow string to your own variable via the
overlay-arrow-string property on that variable.
>
> Otoh, it would be the quickest patch to make... Since there can be only one
> arrow anyway, I wouldn't worry about a new variable, simply assign something
> to overlay-arrow-position.
You should definitely make a separate variable for compile, as the
"standard" arrow is reserved for gdb. I can easily envision running
compile and gdb simultaneously.
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: compilation-forget-errors still used by tex-mode.el
2004-04-01 21:34 ` Kim F. Storm
@ 2004-04-02 2:01 ` Miles Bader
2004-04-02 11:07 ` Kim F. Storm
0 siblings, 1 reply; 17+ messages in thread
From: Miles Bader @ 2004-04-02 2:01 UTC (permalink / raw)
Cc: Daniel Pfeiffer, emacs-devel, monnier, Markus Rost
storm@cua.dk (Kim F. Storm) writes:
> You should definitely make a separate variable for compile, as the
> "standard" arrow is reserved for gdb. I can easily envision running
> compile and gdb simultaneously.
Yeah, but I thought the arrow in question was in the *compilation*
buffer; why would gdb want a pointer in there?!?
-Miles
--
Is it true that nothing can be known? If so how do we know this? -Woody Allen
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: compilation-forget-errors still used by tex-mode.el
2004-04-02 2:01 ` Miles Bader
@ 2004-04-02 11:07 ` Kim F. Storm
2004-04-02 16:10 ` Daniel Pfeiffer
2004-04-02 16:19 ` Stefan Monnier
0 siblings, 2 replies; 17+ messages in thread
From: Kim F. Storm @ 2004-04-02 11:07 UTC (permalink / raw)
Cc: Daniel Pfeiffer, emacs-devel, monnier, Markus Rost
Miles Bader <miles@lsi.nec.co.jp> writes:
> storm@cua.dk (Kim F. Storm) writes:
> > You should definitely make a separate variable for compile, as the
> > "standard" arrow is reserved for gdb. I can easily envision running
> > compile and gdb simultaneously.
>
> Yeah, but I thought the arrow in question was in the *compilation*
> buffer; why would gdb want a pointer in there?!?
The overlay-arrow variables are global (although some modes use them
as buffer-local, but redisplay isn't really prepared for that).
So you have one variable for gdb (the default one), and define another
for compile.
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: compilation-forget-errors still used by tex-mode.el
2004-04-02 11:07 ` Kim F. Storm
@ 2004-04-02 16:10 ` Daniel Pfeiffer
2004-04-02 16:19 ` Stefan Monnier
1 sibling, 0 replies; 17+ messages in thread
From: Daniel Pfeiffer @ 2004-04-02 16:10 UTC (permalink / raw)
Cc: Markus Rost, emacs-devel, monnier, Miles Bader
Saluton,
storm@cua.dk (Kim F. Storm) skribis:
> Miles Bader <miles@lsi.nec.co.jp> writes:
>
> > storm@cua.dk (Kim F. Storm) writes:
> > And as long as this is not available on text displays it's not so good. I
> > was mistaken however because I'd used the 6 months old standard emacs
> > there.
>
> So does it work, or not?
Well, not by default, only if you configure a string. Which for the normal
user would mean: no.
> > > You should definitely make a separate variable for compile, as the
> > > "standard" arrow is reserved for gdb. I can easily envision running
> > > compile and gdb simultaneously.
> >
> > Yeah, but I thought the arrow in question was in the *compilation*
> > buffer; why would gdb want a pointer in there?!?
>
> The overlay-arrow variables are global (although some modes use them
> as buffer-local, but redisplay isn't really prepared for that).
I see no problem at first sight. I have even mixed global and local, and they
both scroll in and out of view fine.
> So you have one variable for gdb (the default one), and define another
> for compile.
If it's gdb's personal one, the list should initially be empty. Gdb should
add one with a name indicating ownership like gdb-overlay-arrow, when it gets
called.
Otoh compile's doc has long stated:
To run more than one compilation at once, start one and rename
the \`*compilation*' buffer to some other name with
\\[rename-buffer].
So, whichever var I use, it would have to be buffer local anyways.
coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer
--
lerne / learn / apprends / läramå / ucz się Esperanto:
http://lernu.net/
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: compilation-forget-errors still used by tex-mode.el
2004-04-02 11:07 ` Kim F. Storm
2004-04-02 16:10 ` Daniel Pfeiffer
@ 2004-04-02 16:19 ` Stefan Monnier
2004-04-02 19:28 ` Kim F. Storm
1 sibling, 1 reply; 17+ messages in thread
From: Stefan Monnier @ 2004-04-02 16:19 UTC (permalink / raw)
Cc: Daniel Pfeiffer, Markus Rost, emacs-devel, Miles Bader
> The overlay-arrow variables are global (although some modes use them
> as buffer-local, but redisplay isn't really prepared for that).
If the redisplay only ever supports one arrow per buffer, then it would
make more sense to use a single hard-coded variable and make sure that
buffer-local values are handled correctly.
It seems that the current interface is overly general w.r.t
the implementation.
Stefan
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: compilation-forget-errors still used by tex-mode.el
2004-04-02 16:19 ` Stefan Monnier
@ 2004-04-02 19:28 ` Kim F. Storm
0 siblings, 0 replies; 17+ messages in thread
From: Kim F. Storm @ 2004-04-02 19:28 UTC (permalink / raw)
Cc: Daniel Pfeiffer, Markus Rost, emacs-devel, Miles Bader
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> > The overlay-arrow variables are global (although some modes use them
> > as buffer-local, but redisplay isn't really prepared for that).
>
> If the redisplay only ever supports one arrow per buffer, then it would
> make more sense to use a single hard-coded variable and make sure that
> buffer-local values are handled correctly.
But for some uses (like gdb), the overlay arrow isn't tied to a single
buffer. Making it buffer local would mean we would have to keep track
of where we put that arrow by other means, so we can remove it when
moving to a different buffer.
Supporting buffer local overlay arrows works for the most part, but
the handling of overlay arrows used to rely on global state variables;
with my latest changes, those global state variables are now
implemented as properties on each overlay arrow variable, so you can
safely have more than one arrow.
IIRC, the limitation of one overlay arrow in each buffer could easily
be lifted... Well, I can look into that.
>
> It seems that the current interface is overly general w.r.t
> the implementation.
Can something be too general -- if it is also simple...
--
Kim F. Storm <storm@cua.dk> http://www.cua.dk
^ permalink raw reply [flat|nested] 17+ messages in thread