unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Nick Roberts <nickrob@snap.net.nz>
Cc: juri@jurta.org, eliz@gnu.org, emacs-devel@gnu.org
Subject: Re: Overlay arrow in *compilation* and *grep* buffers
Date: Sun, 15 May 2005 14:44:22 +1200	[thread overview]
Message-ID: <17030.46982.754961.996335@farnswood.snap.net.nz> (raw)
In-Reply-To: <E1DWkTP-0005wA-PI@fencepost.gnu.org>

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)

  reply	other threads:[~2005-05-15  2:44 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-24 10:45 Overlay arrow in *compilation* and *grep* buffers Eli Zaretskii
2005-04-24 18:42 ` Kim F. Storm
2005-04-24 20:04   ` Eli Zaretskii
2005-04-27 13:10     ` Kim F. Storm
2005-04-27 14:39       ` Eli Zaretskii
2005-04-28 11:01       ` Richard Stallman
2005-04-28 19:51         ` Eli Zaretskii
2005-04-28 20:54           ` Nick Roberts
2005-04-29  7:08             ` Eli Zaretskii
2005-04-29  8:52               ` Nick Roberts
2005-05-09 20:55                 ` Juri Linkov
2005-05-10  6:40                   ` David Kastrup
2005-05-12 11:38                   ` Nick Roberts
2005-05-13  1:34                     ` Richard Stallman
2005-05-13  5:03                     ` Juri Linkov
2005-05-13  6:08                       ` Eli Zaretskii
2005-05-13  7:18                         ` Nick Roberts
2005-05-13 13:28                           ` Eli Zaretskii
2005-05-14  0:26                             ` Richard Stallman
2005-05-14  7:17                               ` Eli Zaretskii
2005-05-14 22:20                                 ` Kim F. Storm
2005-05-15 15:58                                   ` Richard Stallman
2005-05-13 13:02                       ` Nick Roberts
2005-05-14  0:25                         ` Richard Stallman
2005-05-15  2:44                           ` Nick Roberts [this message]
2005-05-15  4:12                             ` Eli Zaretskii
2005-05-15  4:21                             ` Eli Zaretskii
2005-05-15 22:39                             ` Richard Stallman
2005-05-16  1:20                               ` Nick Roberts
2005-05-16 19:28                                 ` Richard Stallman
2005-05-16 19:28                                 ` Richard Stallman
2005-05-16 22:16                                   ` Nick Roberts
2005-05-17 13:23                                     ` Richard Stallman
2005-04-29 10:49         ` Nick Roberts
2005-05-07 16:20         ` Eli Zaretskii
2005-05-07 21:10           ` Kim F. Storm
2005-05-08  0:41             ` Nick Roberts
2005-05-08  4:21               ` Eli Zaretskii
2005-05-08  5:49                 ` Nick Roberts
2005-05-08 16:12                 ` Richard Stallman
2005-05-08 19:37                   ` Eli Zaretskii
2005-04-25 16:05 ` Richard Stallman
2005-04-25 16:46   ` Eli Zaretskii
2005-04-26 14:33     ` Richard Stallman
2005-04-28 11:34 ` Nick Roberts
2005-04-28 19:50   ` Eli Zaretskii
2005-04-28 21:16     ` Nick Roberts
2005-04-29 10:15   ` Richard Stallman
2005-04-29 12:19     ` Nick Roberts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17030.46982.754961.996335@farnswood.snap.net.nz \
    --to=nickrob@snap.net.nz \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=juri@jurta.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).