Gnus development mailing list
 help / color / mirror / Atom feed
From: Per Abrahamsen <abraham@dina.kvl.dk>
Cc: ding@ifi.uio.no
Subject: Re: Long subjects
Date: Thu, 30 Nov 1995 12:33:30 +0100	[thread overview]
Message-ID: <199511301133.MAA19469@ssv4.dina.kvl.dk> (raw)
In-Reply-To: steve@miranova.com's message of 29 Nov 1995 22:39:21 -0800


>>>>> "SLB" == Steven L Baur <steve@miranova.com> writes:

SLB> How do you all on Emacs see the right side of long subjects without a
SLB> horizontal scrollbar?

`C-e' and this little gem:

;;  LCD Archive Entry:
;;  auto-show|Pete Ware|ware@cis.ohio-state.edu|
;;  Automatically scroll horizontally|
;;  95-02-07|1.4|~/misc/auto-show.el|
;;
;;;
;;; Author:
;;;
;;;	Pete Ware					ware@cis.ohio-state.edu
;;;	CIS Dept, Ohio State University			w/ (614) 292-8501
;;;	774 Dreese, 2015 Neil Ave.			h/ (614) 791-1347
;;;	Columbus, OH 43210		http://www.cis.ohio-state.edu/~ware
;;;
;;;
;;; Modification history:
;;; 02/07/95	Rewrote for emacs 19: much, much cleaner.  Renamed auto-show
;;; 8/6/90	Make next-line/previous-line do better job following movement.
;;; 3/21/90         better calculation of w-width in e-make-point-visible
;;;                 test for truncated windows
;;;                 added substitute-in-keymap
;;;                 renamed to auto-horizontal
;;;                 added backward-delete-char
;;; 8/13/88	Created

;;;
;;; This is a rewrite of auto-horizontal.  It is comparable in functionality
;;; hscroll.el except it is not a minor mode and does not use any timers.
;;;
;;; This file provides functions that automatically scroll the window
;;; horizontally when the point moves off the left or right side of
;;; the window.  To enable, the variable truncate-lines must be
;;; non-nil -- truncate-lines becomes buffer-local whenever it is set..
;;; This causes long lines to disappear off the end of the screen instead of
;;; wrapping to the beginning of the next line.  To cause this to be the
;;; default for all buffers and to load this package, add the following lines
;;; to your .emacs (sans ;;;):
;;;
;;; (setq default-truncate-lines t)
;;; (require 'auto-show)

;;; I've found that I only want this when I'm editing C code.  Accordingly
;;; I have something like the following in my .emacs:
;;;
;;; (load-library "auto-show")
;;; (defun my-c-mode-hook ()
;;;   "Run when C-mode starts up.  Changes the comment column to be 40"
;;;   ... set various personal preferences ...
;;;   (setq truncate-lines t))
;;; (add-hook 'c-mode-hook 'my-c-mode-hook)

(provide 'auto-show)

;;;************************************************************
;;;*
;;;*  Define Automatic Horizontal Scrolling Functions
;;;*
;;;************************************************************

(add-hook 'post-command-hook 'auto-show-make-point-visible)

(defvar auto-show-shift-amount 8 
  "extra amount to shift a line when point is not visible")

(defun auto-show-truncationp ()
  "True if truncation is on for current window"
  (or truncate-lines 
      (and truncate-partial-width-windows
	   (< (window-width) (screen-width)))))
  
(defun auto-show-make-point-visible ()
  "Scrolls the screen horizontally to make point visible"
  (interactive)
  (if (auto-show-truncationp)
      (progn
	(let ((col (current-column))	;column on line point is at
	      (scroll (window-hscroll))	;how far window is scrolled
	      (w-width (- (window-width) 
			  (if (> (window-hscroll) 0)
			      2 1))))	;how wide window is on the screen
	  (if (< col scroll)		;to the left of the screen
	      (scroll-right (+ (- scroll col) auto-show-shift-amount))
	      (if (>= col (+ scroll w-width)) ;to the right of the screen
		  (scroll-left (+ auto-show-shift-amount 
				  (- col (+ scroll w-width))))))))))


  parent reply	other threads:[~1995-11-30 11:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-11-30  6:39 Steven L. Baur
1995-11-30 11:29 ` David K}gedal
1995-11-30 11:33 ` Per Abrahamsen [this message]
1995-11-30 14:05 ` Jack Vinson
1995-11-30 17:49 ` Luis Fernandes
1995-11-30 15:17 Re2: " Jari Aalto
1995-11-30 20:01 ` Steven L. Baur

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

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

  git send-email \
    --in-reply-to=199511301133.MAA19469@ssv4.dina.kvl.dk \
    --to=abraham@dina.kvl.dk \
    --cc=ding@ifi.uio.no \
    /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.
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 NNTP newsgroup(s).