From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/4175 Path: main.gmane.org!not-for-mail From: Per Abrahamsen Newsgroups: gmane.emacs.gnus.general Subject: Re: Long subjects Date: Thu, 30 Nov 1995 12:33:30 +0100 Message-ID: <199511301133.MAA19469@ssv4.dina.kvl.dk> References: NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035144960 28736 80.91.224.250 (20 Oct 2002 20:16:00 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 20:16:00 +0000 (UTC) Cc: ding@ifi.uio.no Return-Path: ding-request@ifi.uio.no Original-Received: from ifi.uio.no (ifi.uio.no [129.240.64.2]) by miranova.com (8.6.11/8.6.9) with ESMTP id EAA19957 for ; Thu, 30 Nov 1995 04:31:55 -0800 Original-Received: from elc1.dina.kvl.dk (elc1.dina.kvl.dk [130.225.40.228]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Thu, 30 Nov 1995 12:34:30 +0100 Original-Received: from ssv4.dina.kvl.dk (ssv4.dina.kvl.dk [130.225.40.223]) by elc1.dina.kvl.dk (8.6.12/8.6.4) with ESMTP id MAA04840; Thu, 30 Nov 1995 12:31:49 +0100 Original-Received: (abraham@localhost) by ssv4.dina.kvl.dk (8.6.12/8.6.4) id MAA19469; Thu, 30 Nov 1995 12:33:30 +0100 Original-To: steve@miranova.com (Steven L. Baur) In-reply-to: steve@miranova.com's message of 29 Nov 1995 22:39:21 -0800 Xref: main.gmane.org gmane.emacs.gnus.general:4175 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:4175 >>>>> "SLB" == Steven L Baur 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))))))))))