From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nick Roberts Newsgroups: gmane.emacs.devel Subject: Re: Overlay arrow in *compilation* and *grep* buffers Date: Sun, 15 May 2005 14:44:22 +1200 Message-ID: <17030.46982.754961.996335@farnswood.snap.net.nz> References: <01c548ba$Blat.v2.4$e4827900@zahav.net.il> <01c54909$Blat.v2.4$070f3e60@zahav.net.il> <01c54c2b$Blat.v2.4$e15e8560@zahav.net.il> <17009.19855.763603.487800@farnswood.snap.net.nz> <01c54c8a$Blat.v2.4$6afa17e0@zahav.net.il> <17009.62951.957607.360268@farnswood.snap.net.nz> <87oebkw22l.fsf@jurta.org> <17027.16429.215672.493633@farnswood.snap.net.nz> <87is1nlnt1.fsf@jurta.org> <17028.42314.992815.2073@farnswood.snap.net.nz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1116130901 25480 80.91.229.2 (15 May 2005 04:21:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 15 May 2005 04:21:41 +0000 (UTC) Cc: juri@jurta.org, eliz@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 15 06:21:39 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DXAd1-0001J9-Ir for ged-emacs-devel@m.gmane.org; Sun, 15 May 2005 06:21:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DXALz-00051f-4B for ged-emacs-devel@m.gmane.org; Sun, 15 May 2005 00:03:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DX9Fw-0003MB-PM for emacs-devel@gnu.org; Sat, 14 May 2005 22:53:29 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DX9Fu-0003LK-8X for emacs-devel@gnu.org; Sat, 14 May 2005 22:53:26 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DX9Bt-0002Jo-41 for emacs-devel@gnu.org; Sat, 14 May 2005 22:49:17 -0400 Original-Received: from [202.37.101.8] (helo=viper.snap.net.nz) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DX9DF-0006Bv-Go; Sat, 14 May 2005 22:50:42 -0400 Original-Received: from farnswood.snap.net.nz (p28-tnt1.snap.net.nz [202.124.110.28]) by viper.snap.net.nz (Postfix) with ESMTP id DEB3053465B; Sun, 15 May 2005 14:43:10 +1200 (NZST) Original-Received: by farnswood.snap.net.nz (Postfix, from userid 501) id 9C87662AC6; Sun, 15 May 2005 03:44:23 +0100 (BST) Original-To: rms@gnu.org In-Reply-To: X-Mailer: VM 7.19 under Emacs 22.0.50.45 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:37156 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37156 Richard Stallman writes: > > 1. New defcustom compilation-current-message-highlight. > > Please don't add this option. It isn't necessary to fix a problem. Here's a patch that will hopefully keep everyone happy ;-) 1) No new option. 1) Overlay arrow and no scrolling with left-hand fringe e.g. graphical terminal. 2) No overlay arrow and scrolling with no left-hand fringe e.g. text terminal. The best way to test for a left-hand fringe (absence of) seems to be: (if (equal (car (window-fringes)) 0)... Its about the simplest patch I could think of that meets the requirements. Shall I install it? Nick *** /home/nick/emacs/lisp/progmodes/compile.el.~1.353~ 2005-05-15 14:40:42.000000000 +1200 --- /home/nick/emacs/lisp/progmodes/compile.el 2005-05-15 14:42:19.000000000 +1200 *************** *** 1247,1254 **** (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) ! (if (display-graphic-p) "=>" "")) (setq next-error-overlay-arrow-position nil) (add-hook 'kill-buffer-hook (lambda () (setq next-error-overlay-arrow-position nil)) nil t) --- 1247,1253 ---- (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-hook 'kill-buffer-hook (lambda () (setq next-error-overlay-arrow-position nil)) nil t) *************** *** 1575,1595 **** (setcdr loc (list line file marker))) loc)) ! (defcustom compilation-context-lines 0 "*Display this many lines of leading context before message. ! If nil, don't scroll the compilation output window." :type '(choice integer (const :tag "No window scrolling" nil)) :group 'compilation :version "22.1") (defsubst compilation-set-window (w mk) "Align the compilation output window W with marker MK near top." ! (if (integerp compilation-context-lines) (set-window-start w (save-excursion ! (goto-char mk) ! (beginning-of-line (- 1 compilation-context-lines)) ! (point)))) ! (set-window-point w mk)) (defvar next-error-highlight-timer) --- 1574,1602 ---- (setcdr loc (list line file marker))) loc)) ! (defcustom compilation-context-lines nil "*Display this many lines of leading context before message. ! If nil, don't scroll the compilation output window unless there ! is no left-hand fringe. In this case, the message displays at the ! top of the window because no overlay arrow is present." :type '(choice integer (const :tag "No window scrolling" nil)) :group 'compilation :version "22.1") (defsubst compilation-set-window (w mk) "Align the compilation output window W with marker MK near top." ! (if (equal (car (window-fringes)) 0) (set-window-start w (save-excursion ! (goto-char mk) ! (beginning-of-line 1) ! (point))) ! (if (integerp compilation-context-lines) ! (set-window-start w (save-excursion ! (goto-char mk) ! (beginning-of-line ! (- 1 compilation-context-lines)) ! (point))))) ! (set-window-point w mk)) (defvar next-error-highlight-timer)