2002-01-19 14:01:25 +00:00
|
|
|
|
;;; ruler-mode.el --- display a ruler in the header line
|
2001-10-09 12:10:17 +00:00
|
|
|
|
|
2006-02-06 15:23:23 +00:00
|
|
|
|
;; Copyright (C) 2001, 2002, 2003, 2004, 2005,
|
|
|
|
|
;; 2006 Free Software Foundation, Inc.
|
2001-10-09 12:10:17 +00:00
|
|
|
|
|
|
|
|
|
;; Author: David Ponce <david@dponce.com>
|
|
|
|
|
;; Maintainer: David Ponce <david@dponce.com>
|
|
|
|
|
;; Created: 24 Mar 2001
|
2003-06-01 23:07:31 +00:00
|
|
|
|
;; Version: 1.6
|
2002-09-01 13:30:19 +00:00
|
|
|
|
;; Keywords: convenience
|
2001-10-09 12:10:17 +00:00
|
|
|
|
|
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
|
|
|
|
|
;; This program is free software; you can redistribute it and/or
|
|
|
|
|
;; modify it under the terms of the GNU General Public License as
|
|
|
|
|
;; published by the Free Software Foundation; either version 2, or (at
|
|
|
|
|
;; your option) any later version.
|
|
|
|
|
|
|
|
|
|
;; This program is distributed in the hope that it will be useful, but
|
|
|
|
|
;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
;; General Public License for more details.
|
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
|
;; along with this program; see the file COPYING. If not, write to
|
2005-07-04 23:32:44 +00:00
|
|
|
|
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
|
;; Boston, MA 02110-1301, USA.
|
2001-10-09 12:10:17 +00:00
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
|
|
;; This library provides a minor mode to display a ruler in the header
|
|
|
|
|
;; line. It works only on Emacs 21.
|
|
|
|
|
;;
|
2003-01-13 08:22:50 +00:00
|
|
|
|
;; You can use the mouse to change the `fill-column' `comment-column',
|
|
|
|
|
;; `goal-column', `window-margins' and `tab-stop-list' settings:
|
2001-10-09 12:10:17 +00:00
|
|
|
|
;;
|
2003-06-01 23:07:31 +00:00
|
|
|
|
;; [header-line (shift down-mouse-1)] set left margin end to the ruler
|
2001-10-09 12:10:17 +00:00
|
|
|
|
;; graduation where the mouse pointer is on.
|
|
|
|
|
;;
|
2003-06-01 23:07:31 +00:00
|
|
|
|
;; [header-line (shift down-mouse-3)] set right margin beginning to
|
|
|
|
|
;; the ruler graduation where the mouse pointer is on.
|
2001-10-09 12:10:17 +00:00
|
|
|
|
;;
|
2003-06-01 23:07:31 +00:00
|
|
|
|
;; [header-line down-mouse-2] Drag the `fill-column', `comment-column'
|
|
|
|
|
;; or `goal-column' to a ruler graduation.
|
2001-10-09 12:10:17 +00:00
|
|
|
|
;;
|
|
|
|
|
;; [header-line (control down-mouse-1)] add a tab stop to the ruler
|
|
|
|
|
;; graduation where the mouse pointer is on.
|
|
|
|
|
;;
|
|
|
|
|
;; [header-line (control down-mouse-3)] remove the tab stop at the
|
|
|
|
|
;; ruler graduation where the mouse pointer is on.
|
|
|
|
|
;;
|
|
|
|
|
;; [header-line (control down-mouse-2)] or M-x
|
|
|
|
|
;; `ruler-mode-toggle-show-tab-stops' toggle showing and visually
|
|
|
|
|
;; editing `tab-stop-list' setting. The `ruler-mode-show-tab-stops'
|
|
|
|
|
;; option controls if the ruler shows tab stops by default.
|
|
|
|
|
;;
|
|
|
|
|
;; In the ruler the character `ruler-mode-current-column-char' shows
|
|
|
|
|
;; the `current-column' location, `ruler-mode-fill-column-char' shows
|
2003-01-13 08:22:50 +00:00
|
|
|
|
;; the `fill-column' location, `ruler-mode-comment-column-char' shows
|
|
|
|
|
;; the `comment-column' location, `ruler-mode-goal-column-char' shows
|
2003-06-01 23:07:31 +00:00
|
|
|
|
;; the `goal-column' and `ruler-mode-tab-stop-char' shows tab stop
|
|
|
|
|
;; locations. Graduations in `window-margins' and `window-fringes'
|
|
|
|
|
;; areas are shown with a different foreground color.
|
2001-10-09 12:10:17 +00:00
|
|
|
|
;;
|
|
|
|
|
;; It is also possible to customize the following characters:
|
|
|
|
|
;;
|
|
|
|
|
;; - `ruler-mode-basic-graduation-char' character used for basic
|
|
|
|
|
;; graduations ('.' by default).
|
|
|
|
|
;; - `ruler-mode-inter-graduation-char' character used for
|
|
|
|
|
;; intermediate graduations ('!' by default).
|
|
|
|
|
;;
|
|
|
|
|
;; The following faces are customizable:
|
|
|
|
|
;;
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
;; - `ruler-mode-default' the ruler default face.
|
|
|
|
|
;; - `ruler-mode-fill-column' the face used to highlight the
|
2001-10-09 12:10:17 +00:00
|
|
|
|
;; `fill-column' character.
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
;; - `ruler-mode-comment-column' the face used to highlight the
|
2003-01-13 08:22:50 +00:00
|
|
|
|
;; `comment-column' character.
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
;; - `ruler-mode-goal-column' the face used to highlight the
|
2003-01-13 08:22:50 +00:00
|
|
|
|
;; `goal-column' character.
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
;; - `ruler-mode-current-column' the face used to highlight the
|
2001-10-09 12:10:17 +00:00
|
|
|
|
;; `current-column' character.
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
;; - `ruler-mode-tab-stop' the face used to highlight tab stop
|
2001-10-09 12:10:17 +00:00
|
|
|
|
;; characters.
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
;; - `ruler-mode-margins' the face used to highlight graduations
|
2003-06-01 23:07:31 +00:00
|
|
|
|
;; in the `window-margins' areas.
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
;; - `ruler-mode-fringes' the face used to highlight graduations
|
2003-06-01 23:07:31 +00:00
|
|
|
|
;; in the `window-fringes' areas.
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
;; - `ruler-mode-column-number' the face used to highlight the
|
2003-06-01 23:07:31 +00:00
|
|
|
|
;; numbered graduations.
|
2001-10-09 12:10:17 +00:00
|
|
|
|
;;
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
;; `ruler-mode-default' inherits from the built-in `default' face.
|
|
|
|
|
;; All `ruler-mode' faces inherit from `ruler-mode-default'.
|
2001-10-09 12:10:17 +00:00
|
|
|
|
;;
|
|
|
|
|
;; WARNING: To keep ruler graduations aligned on text columns it is
|
|
|
|
|
;; important to use the same font family and size for ruler and text
|
|
|
|
|
;; areas.
|
2004-03-15 07:27:02 +00:00
|
|
|
|
;;
|
2004-03-19 13:17:16 +00:00
|
|
|
|
;; You can override the ruler format by defining an appropriate
|
2004-03-15 07:27:02 +00:00
|
|
|
|
;; function as the buffer-local value of `ruler-mode-ruler-function'.
|
2001-10-09 12:10:17 +00:00
|
|
|
|
|
|
|
|
|
;; Installation
|
|
|
|
|
;;
|
|
|
|
|
;; To automatically display the ruler in specific major modes use:
|
|
|
|
|
;;
|
|
|
|
|
;; (add-hook '<major-mode>-hook 'ruler-mode)
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
;;; History:
|
|
|
|
|
;;
|
2001-11-25 00:12:11 +00:00
|
|
|
|
|
2001-10-09 12:10:17 +00:00
|
|
|
|
;;; Code:
|
|
|
|
|
(eval-when-compile
|
|
|
|
|
(require 'wid-edit))
|
2004-03-15 07:27:02 +00:00
|
|
|
|
(require 'scroll-bar)
|
|
|
|
|
(require 'fringe)
|
2001-10-09 12:10:17 +00:00
|
|
|
|
|
|
|
|
|
(defgroup ruler-mode nil
|
|
|
|
|
"Display a ruler in the header line."
|
2005-02-09 15:50:47 +00:00
|
|
|
|
:version "22.1"
|
2002-09-01 13:30:19 +00:00
|
|
|
|
:group 'convenience)
|
2001-10-09 12:10:17 +00:00
|
|
|
|
|
|
|
|
|
(defcustom ruler-mode-show-tab-stops nil
|
|
|
|
|
"*If non-nil the ruler shows tab stop positions.
|
|
|
|
|
Also allowing to visually change `tab-stop-list' setting using
|
|
|
|
|
<C-down-mouse-1> and <C-down-mouse-3> on the ruler to respectively add
|
|
|
|
|
or remove a tab stop. \\[ruler-mode-toggle-show-tab-stops] or
|
|
|
|
|
<C-down-mouse-2> on the ruler toggles showing/editing of tab stops."
|
|
|
|
|
:group 'ruler-mode
|
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
|
|
|
|
;; IMPORTANT: This function must be defined before the following
|
|
|
|
|
;; defcustoms because it is used in their :validate clause.
|
|
|
|
|
(defun ruler-mode-character-validate (widget)
|
|
|
|
|
"Ensure WIDGET value is a valid character value."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let ((value (widget-value widget)))
|
|
|
|
|
(if (char-valid-p value)
|
|
|
|
|
nil
|
|
|
|
|
(widget-put widget :error
|
|
|
|
|
(format "Invalid character value: %S" value))
|
|
|
|
|
widget))))
|
2003-01-13 08:22:50 +00:00
|
|
|
|
|
2003-09-04 16:23:25 +00:00
|
|
|
|
(defcustom ruler-mode-fill-column-char (if (char-displayable-p ?<3F>)
|
2001-10-09 12:10:17 +00:00
|
|
|
|
?\<5C>
|
|
|
|
|
?\|)
|
|
|
|
|
"*Character used at the `fill-column' location."
|
|
|
|
|
:group 'ruler-mode
|
|
|
|
|
:type '(choice
|
|
|
|
|
(character :tag "Character")
|
|
|
|
|
(integer :tag "Integer char value"
|
|
|
|
|
:validate ruler-mode-character-validate)))
|
|
|
|
|
|
2003-01-13 08:22:50 +00:00
|
|
|
|
(defcustom ruler-mode-comment-column-char ?\#
|
|
|
|
|
"*Character used at the `comment-column' location."
|
|
|
|
|
:group 'ruler-mode
|
|
|
|
|
:type '(choice
|
|
|
|
|
(character :tag "Character")
|
|
|
|
|
(integer :tag "Integer char value"
|
|
|
|
|
:validate ruler-mode-character-validate)))
|
|
|
|
|
|
|
|
|
|
(defcustom ruler-mode-goal-column-char ?G
|
|
|
|
|
"*Character used at the `goal-column' location."
|
|
|
|
|
:group 'ruler-mode
|
|
|
|
|
:type '(choice
|
|
|
|
|
(character :tag "Character")
|
|
|
|
|
(integer :tag "Integer char value"
|
|
|
|
|
:validate ruler-mode-character-validate)))
|
|
|
|
|
|
2003-09-04 16:23:25 +00:00
|
|
|
|
(defcustom ruler-mode-current-column-char (if (char-displayable-p ?<3F>)
|
2001-10-09 12:10:17 +00:00
|
|
|
|
?\<5C>
|
|
|
|
|
?\@)
|
|
|
|
|
"*Character used at the `current-column' location."
|
|
|
|
|
:group 'ruler-mode
|
|
|
|
|
:type '(choice
|
|
|
|
|
(character :tag "Character")
|
|
|
|
|
(integer :tag "Integer char value"
|
|
|
|
|
:validate ruler-mode-character-validate)))
|
|
|
|
|
|
|
|
|
|
(defcustom ruler-mode-tab-stop-char ?\T
|
|
|
|
|
"*Character used at `tab-stop-list' locations."
|
|
|
|
|
:group 'ruler-mode
|
|
|
|
|
:type '(choice
|
|
|
|
|
(character :tag "Character")
|
|
|
|
|
(integer :tag "Integer char value"
|
|
|
|
|
:validate ruler-mode-character-validate)))
|
|
|
|
|
|
|
|
|
|
(defcustom ruler-mode-basic-graduation-char ?\.
|
|
|
|
|
"*Character used for basic graduations."
|
|
|
|
|
:group 'ruler-mode
|
|
|
|
|
:type '(choice
|
|
|
|
|
(character :tag "Character")
|
|
|
|
|
(integer :tag "Integer char value"
|
|
|
|
|
:validate ruler-mode-character-validate)))
|
|
|
|
|
|
|
|
|
|
(defcustom ruler-mode-inter-graduation-char ?\!
|
|
|
|
|
"*Character used for intermediate graduations."
|
|
|
|
|
:group 'ruler-mode
|
|
|
|
|
:type '(choice
|
|
|
|
|
(character :tag "Character")
|
|
|
|
|
(integer :tag "Integer char value"
|
|
|
|
|
:validate ruler-mode-character-validate)))
|
2003-01-13 08:22:50 +00:00
|
|
|
|
|
|
|
|
|
(defcustom ruler-mode-set-goal-column-ding-flag t
|
|
|
|
|
"*Non-nil means do `ding' when `goal-column' is set."
|
|
|
|
|
:group 'ruler-mode
|
|
|
|
|
:type 'boolean)
|
2001-11-25 00:12:11 +00:00
|
|
|
|
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
(defface ruler-mode-default
|
2001-10-09 12:10:17 +00:00
|
|
|
|
'((((type tty))
|
|
|
|
|
(:inherit default
|
|
|
|
|
:background "grey64"
|
|
|
|
|
:foreground "grey50"
|
|
|
|
|
))
|
|
|
|
|
(t
|
|
|
|
|
(:inherit default
|
|
|
|
|
:background "grey76"
|
|
|
|
|
:foreground "grey64"
|
|
|
|
|
:box (:color "grey76"
|
|
|
|
|
:line-width 1
|
|
|
|
|
:style released-button)
|
|
|
|
|
)))
|
|
|
|
|
"Default face used by the ruler."
|
|
|
|
|
:group 'ruler-mode)
|
|
|
|
|
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
(defface ruler-mode-pad
|
2003-06-01 23:07:31 +00:00
|
|
|
|
'((((type tty))
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
(:inherit ruler-mode-default
|
2003-06-01 23:07:31 +00:00
|
|
|
|
:background "grey50"
|
|
|
|
|
))
|
|
|
|
|
(t
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
(:inherit ruler-mode-default
|
2003-06-01 23:07:31 +00:00
|
|
|
|
:background "grey64"
|
|
|
|
|
)))
|
|
|
|
|
"Face used to pad inactive ruler areas."
|
|
|
|
|
:group 'ruler-mode)
|
|
|
|
|
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
(defface ruler-mode-margins
|
2003-06-01 23:07:31 +00:00
|
|
|
|
'((t
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
(:inherit ruler-mode-default
|
2003-06-01 23:07:31 +00:00
|
|
|
|
:foreground "white"
|
|
|
|
|
)))
|
|
|
|
|
"Face used to highlight margin areas."
|
|
|
|
|
:group 'ruler-mode)
|
|
|
|
|
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
(defface ruler-mode-fringes
|
2003-06-01 23:07:31 +00:00
|
|
|
|
'((t
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
(:inherit ruler-mode-default
|
2003-06-01 23:07:31 +00:00
|
|
|
|
:foreground "green"
|
|
|
|
|
)))
|
|
|
|
|
"Face used to highlight fringes areas."
|
|
|
|
|
:group 'ruler-mode)
|
|
|
|
|
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
(defface ruler-mode-column-number
|
2001-10-09 12:10:17 +00:00
|
|
|
|
'((t
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
(:inherit ruler-mode-default
|
2001-10-09 12:10:17 +00:00
|
|
|
|
:foreground "black"
|
|
|
|
|
)))
|
|
|
|
|
"Face used to highlight number graduations."
|
|
|
|
|
:group 'ruler-mode)
|
|
|
|
|
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
(defface ruler-mode-fill-column
|
2001-10-09 12:10:17 +00:00
|
|
|
|
'((t
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
(:inherit ruler-mode-default
|
2001-10-09 12:10:17 +00:00
|
|
|
|
:foreground "red"
|
|
|
|
|
)))
|
|
|
|
|
"Face used to highlight the fill column character."
|
|
|
|
|
:group 'ruler-mode)
|
|
|
|
|
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
(defface ruler-mode-comment-column
|
2003-01-13 08:22:50 +00:00
|
|
|
|
'((t
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
(:inherit ruler-mode-default
|
2003-01-13 08:22:50 +00:00
|
|
|
|
:foreground "red"
|
|
|
|
|
)))
|
|
|
|
|
"Face used to highlight the comment column character."
|
|
|
|
|
:group 'ruler-mode)
|
|
|
|
|
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
(defface ruler-mode-goal-column
|
2003-01-13 08:22:50 +00:00
|
|
|
|
'((t
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
(:inherit ruler-mode-default
|
2003-01-13 08:22:50 +00:00
|
|
|
|
:foreground "red"
|
|
|
|
|
)))
|
|
|
|
|
"Face used to highlight the goal column character."
|
|
|
|
|
:group 'ruler-mode)
|
|
|
|
|
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
(defface ruler-mode-tab-stop
|
2001-10-09 12:10:17 +00:00
|
|
|
|
'((t
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
(:inherit ruler-mode-default
|
2001-10-09 12:10:17 +00:00
|
|
|
|
:foreground "steelblue"
|
|
|
|
|
)))
|
|
|
|
|
"Face used to highlight tab stop characters."
|
|
|
|
|
:group 'ruler-mode)
|
|
|
|
|
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
(defface ruler-mode-current-column
|
2001-10-09 12:10:17 +00:00
|
|
|
|
'((t
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
(:inherit ruler-mode-default
|
2001-10-09 12:10:17 +00:00
|
|
|
|
:weight bold
|
|
|
|
|
:foreground "yellow"
|
|
|
|
|
)))
|
|
|
|
|
"Face used to highlight the `current-column' character."
|
|
|
|
|
:group 'ruler-mode)
|
2001-11-25 00:12:11 +00:00
|
|
|
|
|
2003-06-01 23:07:31 +00:00
|
|
|
|
|
|
|
|
|
(defsubst ruler-mode-full-window-width ()
|
|
|
|
|
"Return the full width of the selected window."
|
|
|
|
|
(let ((edges (window-edges)))
|
|
|
|
|
(- (nth 2 edges) (nth 0 edges))))
|
|
|
|
|
|
|
|
|
|
(defsubst ruler-mode-window-col (n)
|
|
|
|
|
"Return a column number relative to the selected window.
|
|
|
|
|
N is a column number relative to selected frame."
|
|
|
|
|
(- n
|
|
|
|
|
(car (window-edges))
|
|
|
|
|
(or (car (window-margins)) 0)
|
2004-03-15 08:39:06 +00:00
|
|
|
|
(fringe-columns 'left)
|
|
|
|
|
(scroll-bar-columns 'left)))
|
2003-06-01 23:07:31 +00:00
|
|
|
|
|
2001-10-09 12:10:17 +00:00
|
|
|
|
(defun ruler-mode-mouse-set-left-margin (start-event)
|
2003-06-01 23:07:31 +00:00
|
|
|
|
"Set left margin end to the graduation where the mouse pointer is on.
|
2001-10-09 12:10:17 +00:00
|
|
|
|
START-EVENT is the mouse click event."
|
|
|
|
|
(interactive "e")
|
|
|
|
|
(let* ((start (event-start start-event))
|
|
|
|
|
(end (event-end start-event))
|
2003-06-01 23:07:31 +00:00
|
|
|
|
col w lm rm)
|
|
|
|
|
(when (eq start end) ;; mouse click
|
|
|
|
|
(save-selected-window
|
|
|
|
|
(select-window (posn-window start))
|
|
|
|
|
(setq col (- (car (posn-col-row start)) (car (window-edges))
|
2004-03-15 08:39:06 +00:00
|
|
|
|
(scroll-bar-columns 'left))
|
2003-06-01 23:07:31 +00:00
|
|
|
|
w (- (ruler-mode-full-window-width)
|
2004-03-15 08:39:06 +00:00
|
|
|
|
(scroll-bar-columns 'left)
|
|
|
|
|
(scroll-bar-columns 'right)))
|
2003-06-01 23:07:31 +00:00
|
|
|
|
(when (and (>= col 0) (< col w))
|
|
|
|
|
(setq lm (window-margins)
|
|
|
|
|
rm (or (cdr lm) 0)
|
|
|
|
|
lm (or (car lm) 0))
|
|
|
|
|
(message "Left margin set to %d (was %d)" col lm)
|
|
|
|
|
(set-window-margins nil col rm))))))
|
2001-10-09 12:10:17 +00:00
|
|
|
|
|
|
|
|
|
(defun ruler-mode-mouse-set-right-margin (start-event)
|
2003-06-01 23:07:31 +00:00
|
|
|
|
"Set right margin beginning to the graduation where the mouse pointer is on.
|
2001-10-09 12:10:17 +00:00
|
|
|
|
START-EVENT is the mouse click event."
|
|
|
|
|
(interactive "e")
|
|
|
|
|
(let* ((start (event-start start-event))
|
|
|
|
|
(end (event-end start-event))
|
2003-06-01 23:07:31 +00:00
|
|
|
|
col w lm rm)
|
|
|
|
|
(when (eq start end) ;; mouse click
|
|
|
|
|
(save-selected-window
|
|
|
|
|
(select-window (posn-window start))
|
|
|
|
|
(setq col (- (car (posn-col-row start)) (car (window-edges))
|
2004-03-15 08:39:06 +00:00
|
|
|
|
(scroll-bar-columns 'left))
|
2003-06-01 23:07:31 +00:00
|
|
|
|
w (- (ruler-mode-full-window-width)
|
2004-03-15 08:39:06 +00:00
|
|
|
|
(scroll-bar-columns 'left)
|
|
|
|
|
(scroll-bar-columns 'right)))
|
2003-06-01 23:07:31 +00:00
|
|
|
|
(when (and (>= col 0) (< col w))
|
|
|
|
|
(setq lm (window-margins)
|
|
|
|
|
rm (or (cdr lm) 0)
|
|
|
|
|
lm (or (car lm) 0)
|
|
|
|
|
col (- w col 1))
|
|
|
|
|
(message "Right margin set to %d (was %d)" col rm)
|
|
|
|
|
(set-window-margins nil lm col))))))
|
|
|
|
|
|
|
|
|
|
(defvar ruler-mode-dragged-symbol nil
|
2003-01-13 08:22:50 +00:00
|
|
|
|
"Column symbol dragged in the ruler.
|
|
|
|
|
That is `fill-column', `comment-column', `goal-column', or nil when
|
|
|
|
|
nothing is dragged.")
|
|
|
|
|
|
|
|
|
|
(defun ruler-mode-mouse-grab-any-column (start-event)
|
2003-06-01 23:07:31 +00:00
|
|
|
|
"Drag a column symbol on the ruler.
|
|
|
|
|
Start dragging on mouse down event START-EVENT, and update the column
|
|
|
|
|
symbol value with the current value of the ruler graduation while
|
|
|
|
|
dragging. See also the variable `ruler-mode-dragged-symbol'."
|
2001-10-09 12:10:17 +00:00
|
|
|
|
(interactive "e")
|
2003-06-01 23:07:31 +00:00
|
|
|
|
(setq ruler-mode-dragged-symbol nil)
|
2003-01-13 08:22:50 +00:00
|
|
|
|
(let* ((start (event-start start-event))
|
2003-06-01 23:07:31 +00:00
|
|
|
|
col newc oldc)
|
2003-01-13 08:22:50 +00:00
|
|
|
|
(save-selected-window
|
|
|
|
|
(select-window (posn-window start))
|
2003-06-01 23:07:31 +00:00
|
|
|
|
(setq col (ruler-mode-window-col (car (posn-col-row start)))
|
|
|
|
|
newc (+ col (window-hscroll)))
|
|
|
|
|
(and
|
|
|
|
|
(>= col 0) (< col (window-width))
|
|
|
|
|
(cond
|
|
|
|
|
|
|
|
|
|
;; Handle the fill column.
|
|
|
|
|
((eq newc fill-column)
|
|
|
|
|
(setq oldc fill-column
|
|
|
|
|
ruler-mode-dragged-symbol 'fill-column)
|
|
|
|
|
t) ;; Start dragging
|
|
|
|
|
|
|
|
|
|
;; Handle the comment column.
|
|
|
|
|
((eq newc comment-column)
|
|
|
|
|
(setq oldc comment-column
|
|
|
|
|
ruler-mode-dragged-symbol 'comment-column)
|
|
|
|
|
t) ;; Start dragging
|
|
|
|
|
|
|
|
|
|
;; Handle the goal column.
|
|
|
|
|
;; A. On mouse down on the goal column character on the ruler,
|
|
|
|
|
;; update the `goal-column' value while dragging.
|
|
|
|
|
;; B. If `goal-column' is nil, set the goal column where the
|
|
|
|
|
;; mouse is clicked.
|
|
|
|
|
;; C. On mouse click on the goal column character on the
|
|
|
|
|
;; ruler, unset the goal column.
|
|
|
|
|
((eq newc goal-column) ; A. Drag the goal column.
|
|
|
|
|
(setq oldc goal-column
|
|
|
|
|
ruler-mode-dragged-symbol 'goal-column)
|
|
|
|
|
t) ;; Start dragging
|
|
|
|
|
|
|
|
|
|
((null goal-column) ; B. Set the goal column.
|
|
|
|
|
(setq oldc goal-column
|
|
|
|
|
goal-column newc)
|
|
|
|
|
;; mouse-2 coming AFTER drag-mouse-2 invokes `ding'. This
|
|
|
|
|
;; `ding' flushes the next messages about setting goal
|
|
|
|
|
;; column. So here I force fetch the event(mouse-2) and
|
|
|
|
|
;; throw away.
|
|
|
|
|
(read-event)
|
|
|
|
|
;; Ding BEFORE `message' is OK.
|
|
|
|
|
(when ruler-mode-set-goal-column-ding-flag
|
|
|
|
|
(ding))
|
|
|
|
|
(message "Goal column set to %d (click on %s again to unset it)"
|
|
|
|
|
newc
|
|
|
|
|
(propertize (char-to-string ruler-mode-goal-column-char)
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
'face 'ruler-mode-goal-column))
|
2003-06-01 23:07:31 +00:00
|
|
|
|
nil) ;; Don't start dragging.
|
|
|
|
|
)
|
|
|
|
|
(if (eq 'click (ruler-mode-mouse-drag-any-column-iteration
|
|
|
|
|
(posn-window start)))
|
|
|
|
|
(when (eq 'goal-column ruler-mode-dragged-symbol)
|
|
|
|
|
;; C. Unset the goal column.
|
|
|
|
|
(set-goal-column t))
|
|
|
|
|
;; At end of dragging, report the updated column symbol.
|
|
|
|
|
(message "%s is set to %d (was %d)"
|
|
|
|
|
ruler-mode-dragged-symbol
|
|
|
|
|
(symbol-value ruler-mode-dragged-symbol)
|
|
|
|
|
oldc))))))
|
2003-01-13 08:22:50 +00:00
|
|
|
|
|
|
|
|
|
(defun ruler-mode-mouse-drag-any-column-iteration (window)
|
|
|
|
|
"Update the ruler while dragging the mouse.
|
2003-06-01 23:07:31 +00:00
|
|
|
|
WINDOW is the window where occurred the last down-mouse event.
|
|
|
|
|
Return the symbol `drag' if the mouse has been dragged, or `click' if
|
|
|
|
|
the mouse has been clicked."
|
|
|
|
|
(let ((drags 0)
|
|
|
|
|
event)
|
2003-01-13 08:22:50 +00:00
|
|
|
|
(track-mouse
|
2003-06-01 23:07:31 +00:00
|
|
|
|
(while (mouse-movement-p (setq event (read-event)))
|
|
|
|
|
(setq drags (1+ drags))
|
|
|
|
|
(when (eq window (posn-window (event-end event)))
|
|
|
|
|
(ruler-mode-mouse-drag-any-column event)
|
|
|
|
|
(force-mode-line-update))))
|
|
|
|
|
(if (and (zerop drags) (eq 'click (car (event-modifiers event))))
|
2003-01-13 08:22:50 +00:00
|
|
|
|
'click
|
|
|
|
|
'drag)))
|
|
|
|
|
|
|
|
|
|
(defun ruler-mode-mouse-drag-any-column (start-event)
|
2003-06-01 23:07:31 +00:00
|
|
|
|
"Update the value of the symbol dragged on the ruler.
|
|
|
|
|
Called on each mouse motion event START-EVENT."
|
2001-10-09 12:10:17 +00:00
|
|
|
|
(let* ((start (event-start start-event))
|
|
|
|
|
(end (event-end start-event))
|
2003-06-01 23:07:31 +00:00
|
|
|
|
col newc)
|
2003-01-13 08:22:50 +00:00
|
|
|
|
(save-selected-window
|
|
|
|
|
(select-window (posn-window start))
|
2003-06-01 23:07:31 +00:00
|
|
|
|
(setq col (ruler-mode-window-col (car (posn-col-row end)))
|
|
|
|
|
newc (+ col (window-hscroll)))
|
|
|
|
|
(when (and (>= col 0) (< col (window-width)))
|
|
|
|
|
(set ruler-mode-dragged-symbol newc)))))
|
2001-11-25 00:12:11 +00:00
|
|
|
|
|
2001-10-09 12:10:17 +00:00
|
|
|
|
(defun ruler-mode-mouse-add-tab-stop (start-event)
|
|
|
|
|
"Add a tab stop to the graduation where the mouse pointer is on.
|
|
|
|
|
START-EVENT is the mouse click event."
|
|
|
|
|
(interactive "e")
|
2003-06-01 23:07:31 +00:00
|
|
|
|
(when ruler-mode-show-tab-stops
|
|
|
|
|
(let* ((start (event-start start-event))
|
|
|
|
|
(end (event-end start-event))
|
|
|
|
|
col ts)
|
|
|
|
|
(when (eq start end) ;; mouse click
|
|
|
|
|
(save-selected-window
|
|
|
|
|
(select-window (posn-window start))
|
|
|
|
|
(setq col (ruler-mode-window-col (car (posn-col-row start)))
|
|
|
|
|
ts (+ col (window-hscroll)))
|
|
|
|
|
(and (>= col 0) (< col (window-width))
|
|
|
|
|
(not (member ts tab-stop-list))
|
|
|
|
|
(progn
|
|
|
|
|
(message "Tab stop set to %d" ts)
|
|
|
|
|
(setq tab-stop-list (sort (cons ts tab-stop-list)
|
|
|
|
|
#'<)))))))))
|
2001-10-09 12:10:17 +00:00
|
|
|
|
|
|
|
|
|
(defun ruler-mode-mouse-del-tab-stop (start-event)
|
|
|
|
|
"Delete tab stop at the graduation where the mouse pointer is on.
|
|
|
|
|
START-EVENT is the mouse click event."
|
|
|
|
|
(interactive "e")
|
2003-06-01 23:07:31 +00:00
|
|
|
|
(when ruler-mode-show-tab-stops
|
|
|
|
|
(let* ((start (event-start start-event))
|
|
|
|
|
(end (event-end start-event))
|
|
|
|
|
col ts)
|
|
|
|
|
(when (eq start end) ;; mouse click
|
|
|
|
|
(save-selected-window
|
|
|
|
|
(select-window (posn-window start))
|
|
|
|
|
(setq col (ruler-mode-window-col (car (posn-col-row start)))
|
|
|
|
|
ts (+ col (window-hscroll)))
|
|
|
|
|
(and (>= col 0) (< col (window-width))
|
|
|
|
|
(member ts tab-stop-list)
|
|
|
|
|
(progn
|
|
|
|
|
(message "Tab stop at %d deleted" ts)
|
|
|
|
|
(setq tab-stop-list (delete ts tab-stop-list)))))))))
|
2001-10-09 12:10:17 +00:00
|
|
|
|
|
|
|
|
|
(defun ruler-mode-toggle-show-tab-stops ()
|
|
|
|
|
"Toggle showing of tab stops on the ruler."
|
|
|
|
|
(interactive)
|
2001-11-25 00:12:11 +00:00
|
|
|
|
(setq ruler-mode-show-tab-stops (not ruler-mode-show-tab-stops))
|
|
|
|
|
(force-mode-line-update))
|
|
|
|
|
|
2001-10-09 12:10:17 +00:00
|
|
|
|
(defvar ruler-mode-map
|
|
|
|
|
(let ((km (make-sparse-keymap)))
|
|
|
|
|
(define-key km [header-line down-mouse-1]
|
|
|
|
|
#'ignore)
|
|
|
|
|
(define-key km [header-line down-mouse-3]
|
|
|
|
|
#'ignore)
|
|
|
|
|
(define-key km [header-line down-mouse-2]
|
2003-01-13 08:22:50 +00:00
|
|
|
|
#'ruler-mode-mouse-grab-any-column)
|
2001-10-09 12:10:17 +00:00
|
|
|
|
(define-key km [header-line (shift down-mouse-1)]
|
|
|
|
|
#'ruler-mode-mouse-set-left-margin)
|
|
|
|
|
(define-key km [header-line (shift down-mouse-3)]
|
|
|
|
|
#'ruler-mode-mouse-set-right-margin)
|
|
|
|
|
(define-key km [header-line (control down-mouse-1)]
|
|
|
|
|
#'ruler-mode-mouse-add-tab-stop)
|
|
|
|
|
(define-key km [header-line (control down-mouse-3)]
|
|
|
|
|
#'ruler-mode-mouse-del-tab-stop)
|
|
|
|
|
(define-key km [header-line (control down-mouse-2)]
|
|
|
|
|
#'ruler-mode-toggle-show-tab-stops)
|
|
|
|
|
km)
|
|
|
|
|
"Keymap for ruler minor mode.")
|
|
|
|
|
|
|
|
|
|
(defvar ruler-mode-header-line-format-old nil
|
|
|
|
|
"Hold previous value of `header-line-format'.")
|
|
|
|
|
|
2004-03-19 13:17:16 +00:00
|
|
|
|
(defvar ruler-mode-ruler-function 'ruler-mode-ruler
|
|
|
|
|
"Function to call to return ruler header line format.
|
2004-03-15 07:27:02 +00:00
|
|
|
|
This variable is expected to be made buffer-local by modes.")
|
|
|
|
|
|
2001-10-09 12:10:17 +00:00
|
|
|
|
(defconst ruler-mode-header-line-format
|
2004-03-19 13:17:16 +00:00
|
|
|
|
'(:eval (funcall ruler-mode-ruler-function))
|
2004-03-15 07:27:02 +00:00
|
|
|
|
"`header-line-format' used in ruler mode.
|
2004-03-19 13:17:16 +00:00
|
|
|
|
Call `ruler-mode-ruler-function' to compute the ruler value.")
|
2001-10-09 12:10:17 +00:00
|
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
|
(define-minor-mode ruler-mode
|
|
|
|
|
"Display a ruler in the header line if ARG > 0."
|
|
|
|
|
nil nil
|
|
|
|
|
ruler-mode-map
|
|
|
|
|
:group 'ruler-mode
|
|
|
|
|
(if ruler-mode
|
|
|
|
|
(progn
|
|
|
|
|
;; When `ruler-mode' is on save previous header line format
|
|
|
|
|
;; and install the ruler header line format.
|
2003-01-13 08:22:50 +00:00
|
|
|
|
(when (local-variable-p 'header-line-format)
|
2004-03-19 13:17:16 +00:00
|
|
|
|
(set (make-local-variable 'ruler-mode-header-line-format-old)
|
|
|
|
|
header-line-format))
|
2003-01-13 08:22:50 +00:00
|
|
|
|
(setq header-line-format ruler-mode-header-line-format)
|
2004-03-19 13:17:16 +00:00
|
|
|
|
(add-hook 'post-command-hook 'force-mode-line-update nil t))
|
2001-10-09 12:10:17 +00:00
|
|
|
|
;; When `ruler-mode' is off restore previous header line format if
|
|
|
|
|
;; the current one is the ruler header line format.
|
2003-01-13 08:22:50 +00:00
|
|
|
|
(when (eq header-line-format ruler-mode-header-line-format)
|
|
|
|
|
(kill-local-variable 'header-line-format)
|
2003-06-01 23:07:31 +00:00
|
|
|
|
(when (local-variable-p 'ruler-mode-header-line-format-old)
|
2004-03-19 13:17:16 +00:00
|
|
|
|
(setq header-line-format ruler-mode-header-line-format-old)
|
|
|
|
|
(kill-local-variable 'ruler-mode-header-line-format-old)))
|
|
|
|
|
(remove-hook 'post-command-hook 'force-mode-line-update t)))
|
2001-11-25 00:12:11 +00:00
|
|
|
|
|
2002-01-13 10:09:20 +00:00
|
|
|
|
;; Add ruler-mode to the minor mode menu in the mode line
|
2001-10-09 12:10:17 +00:00
|
|
|
|
(define-key mode-line-mode-menu [ruler-mode]
|
|
|
|
|
`(menu-item "Ruler" ruler-mode
|
2003-01-13 08:22:50 +00:00
|
|
|
|
:button (:toggle . ruler-mode)))
|
2001-10-09 12:10:17 +00:00
|
|
|
|
|
|
|
|
|
(defconst ruler-mode-ruler-help-echo
|
|
|
|
|
"\
|
|
|
|
|
S-mouse-1/3: set L/R margin, \
|
2003-01-13 08:22:50 +00:00
|
|
|
|
mouse-2: set goal column, \
|
2001-10-09 12:10:17 +00:00
|
|
|
|
C-mouse-2: show tabs"
|
2003-01-13 08:22:50 +00:00
|
|
|
|
"Help string shown when mouse is over the ruler.
|
2001-10-09 12:10:17 +00:00
|
|
|
|
`ruler-mode-show-tab-stops' is nil.")
|
|
|
|
|
|
2003-01-13 08:22:50 +00:00
|
|
|
|
(defconst ruler-mode-ruler-help-echo-when-goal-column
|
|
|
|
|
"\
|
|
|
|
|
S-mouse-1/3: set L/R margin, \
|
|
|
|
|
C-mouse-2: show tabs"
|
|
|
|
|
"Help string shown when mouse is over the ruler.
|
|
|
|
|
`goal-column' is set and `ruler-mode-show-tab-stops' is nil.")
|
|
|
|
|
|
|
|
|
|
(defconst ruler-mode-ruler-help-echo-when-tab-stops
|
2001-10-09 12:10:17 +00:00
|
|
|
|
"\
|
|
|
|
|
C-mouse1/3: set/unset tab, \
|
|
|
|
|
C-mouse-2: hide tabs"
|
2003-01-13 08:22:50 +00:00
|
|
|
|
"Help string shown when mouse is over the ruler.
|
2001-10-09 12:10:17 +00:00
|
|
|
|
`ruler-mode-show-tab-stops' is non-nil.")
|
|
|
|
|
|
2003-01-13 08:22:50 +00:00
|
|
|
|
(defconst ruler-mode-fill-column-help-echo
|
|
|
|
|
"drag-mouse-2: set fill column"
|
|
|
|
|
"Help string shown when mouse is on the fill column character.")
|
|
|
|
|
|
|
|
|
|
(defconst ruler-mode-comment-column-help-echo
|
|
|
|
|
"drag-mouse-2: set comment column"
|
|
|
|
|
"Help string shown when mouse is on the comment column character.")
|
|
|
|
|
|
|
|
|
|
(defconst ruler-mode-goal-column-help-echo
|
|
|
|
|
"\
|
|
|
|
|
drag-mouse-2: set goal column, \
|
|
|
|
|
mouse-2: unset goal column"
|
|
|
|
|
"Help string shown when mouse is on the goal column character.")
|
|
|
|
|
|
2003-06-01 23:07:31 +00:00
|
|
|
|
(defconst ruler-mode-margin-help-echo
|
|
|
|
|
"%s margin %S"
|
|
|
|
|
"Help string shown when mouse is over a margin area.")
|
2001-10-09 12:10:17 +00:00
|
|
|
|
|
2003-06-01 23:07:31 +00:00
|
|
|
|
(defconst ruler-mode-fringe-help-echo
|
|
|
|
|
"%s fringe %S"
|
|
|
|
|
"Help string shown when mouse is over a fringe area.")
|
2003-10-20 23:27:52 +00:00
|
|
|
|
|
|
|
|
|
(defsubst ruler-mode-space (width &rest props)
|
|
|
|
|
"Return a single space string of WIDTH times the normal character width.
|
|
|
|
|
Optional argument PROPS specifies other text properties to apply."
|
2004-03-19 13:17:16 +00:00
|
|
|
|
(apply 'propertize " " 'display (list 'space :width width) props))
|
2001-11-25 00:12:11 +00:00
|
|
|
|
|
2001-10-09 12:10:17 +00:00
|
|
|
|
(defun ruler-mode-ruler ()
|
2004-03-19 13:17:16 +00:00
|
|
|
|
"Compute and return an header line ruler."
|
|
|
|
|
(let* ((w (window-width))
|
|
|
|
|
(m (window-margins))
|
|
|
|
|
(f (window-fringes))
|
|
|
|
|
(i 0)
|
|
|
|
|
(j (window-hscroll))
|
|
|
|
|
;; Setup the scrollbar, fringes, and margins areas.
|
|
|
|
|
(lf (ruler-mode-space
|
|
|
|
|
'left-fringe
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
'face 'ruler-mode-fringes
|
2004-03-19 13:17:16 +00:00
|
|
|
|
'help-echo (format ruler-mode-fringe-help-echo
|
|
|
|
|
"Left" (or (car f) 0))))
|
|
|
|
|
(rf (ruler-mode-space
|
|
|
|
|
'right-fringe
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
'face 'ruler-mode-fringes
|
2004-03-19 13:17:16 +00:00
|
|
|
|
'help-echo (format ruler-mode-fringe-help-echo
|
|
|
|
|
"Right" (or (cadr f) 0))))
|
|
|
|
|
(lm (ruler-mode-space
|
|
|
|
|
'left-margin
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
'face 'ruler-mode-margins
|
2004-03-19 13:17:16 +00:00
|
|
|
|
'help-echo (format ruler-mode-margin-help-echo
|
|
|
|
|
"Left" (or (car m) 0))))
|
|
|
|
|
(rm (ruler-mode-space
|
|
|
|
|
'right-margin
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
'face 'ruler-mode-margins
|
2004-03-19 13:17:16 +00:00
|
|
|
|
'help-echo (format ruler-mode-margin-help-echo
|
|
|
|
|
"Right" (or (cdr m) 0))))
|
|
|
|
|
(sb (ruler-mode-space
|
|
|
|
|
'scroll-bar
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
'face 'ruler-mode-pad))
|
2004-03-19 13:17:16 +00:00
|
|
|
|
;; Remember the scrollbar vertical type.
|
|
|
|
|
(sbvt (car (window-current-scroll-bars)))
|
|
|
|
|
;; Create an "clean" ruler.
|
|
|
|
|
(ruler
|
|
|
|
|
(propertize
|
|
|
|
|
(make-string w ruler-mode-basic-graduation-char)
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
'face 'ruler-mode-default
|
2004-03-19 13:17:16 +00:00
|
|
|
|
'local-map ruler-mode-map
|
|
|
|
|
'help-echo (cond
|
|
|
|
|
(ruler-mode-show-tab-stops
|
|
|
|
|
ruler-mode-ruler-help-echo-when-tab-stops)
|
|
|
|
|
(goal-column
|
|
|
|
|
ruler-mode-ruler-help-echo-when-goal-column)
|
|
|
|
|
(ruler-mode-ruler-help-echo))))
|
|
|
|
|
k c)
|
|
|
|
|
;; Setup the active area.
|
|
|
|
|
(while (< i w)
|
|
|
|
|
;; Graduations.
|
|
|
|
|
(cond
|
|
|
|
|
;; Show a number graduation.
|
|
|
|
|
((= (mod j 10) 0)
|
|
|
|
|
(setq c (number-to-string (/ j 10))
|
|
|
|
|
m (length c)
|
|
|
|
|
k i)
|
|
|
|
|
(put-text-property
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
i (1+ i) 'face 'ruler-mode-column-number
|
2004-03-19 13:17:16 +00:00
|
|
|
|
ruler)
|
|
|
|
|
(while (and (> m 0) (>= k 0))
|
|
|
|
|
(aset ruler k (aref c (setq m (1- m))))
|
|
|
|
|
(setq k (1- k))))
|
|
|
|
|
;; Show an intermediate graduation.
|
|
|
|
|
((= (mod j 5) 0)
|
|
|
|
|
(aset ruler i ruler-mode-inter-graduation-char)))
|
|
|
|
|
;; Special columns.
|
|
|
|
|
(cond
|
|
|
|
|
;; Show the `current-column' marker.
|
|
|
|
|
((= j (current-column))
|
|
|
|
|
(aset ruler i ruler-mode-current-column-char)
|
|
|
|
|
(put-text-property
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
i (1+ i) 'face 'ruler-mode-current-column
|
2004-03-19 13:17:16 +00:00
|
|
|
|
ruler))
|
|
|
|
|
;; Show the `goal-column' marker.
|
|
|
|
|
((and goal-column (= j goal-column))
|
|
|
|
|
(aset ruler i ruler-mode-goal-column-char)
|
|
|
|
|
(put-text-property
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
i (1+ i) 'face 'ruler-mode-goal-column
|
2004-03-19 13:17:16 +00:00
|
|
|
|
ruler)
|
2005-05-23 11:19:17 +00:00
|
|
|
|
(put-text-property
|
|
|
|
|
i (1+ i) 'mouse-face 'mode-line-highlight
|
|
|
|
|
ruler)
|
2004-03-19 13:17:16 +00:00
|
|
|
|
(put-text-property
|
|
|
|
|
i (1+ i) 'help-echo ruler-mode-goal-column-help-echo
|
|
|
|
|
ruler))
|
|
|
|
|
;; Show the `comment-column' marker.
|
|
|
|
|
((= j comment-column)
|
|
|
|
|
(aset ruler i ruler-mode-comment-column-char)
|
|
|
|
|
(put-text-property
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
i (1+ i) 'face 'ruler-mode-comment-column
|
2004-03-19 13:17:16 +00:00
|
|
|
|
ruler)
|
2005-05-23 11:19:17 +00:00
|
|
|
|
(put-text-property
|
|
|
|
|
i (1+ i) 'mouse-face 'mode-line-highlight
|
|
|
|
|
ruler)
|
2004-03-19 13:17:16 +00:00
|
|
|
|
(put-text-property
|
|
|
|
|
i (1+ i) 'help-echo ruler-mode-comment-column-help-echo
|
|
|
|
|
ruler))
|
|
|
|
|
;; Show the `fill-column' marker.
|
|
|
|
|
((= j fill-column)
|
|
|
|
|
(aset ruler i ruler-mode-fill-column-char)
|
|
|
|
|
(put-text-property
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
i (1+ i) 'face 'ruler-mode-fill-column
|
2004-03-19 13:17:16 +00:00
|
|
|
|
ruler)
|
2005-05-23 11:19:17 +00:00
|
|
|
|
(put-text-property
|
|
|
|
|
i (1+ i) 'mouse-face 'mode-line-highlight
|
|
|
|
|
ruler)
|
2004-03-19 13:17:16 +00:00
|
|
|
|
(put-text-property
|
|
|
|
|
i (1+ i) 'help-echo ruler-mode-fill-column-help-echo
|
|
|
|
|
ruler))
|
|
|
|
|
;; Show the `tab-stop-list' markers.
|
|
|
|
|
((and ruler-mode-show-tab-stops (member j tab-stop-list))
|
|
|
|
|
(aset ruler i ruler-mode-tab-stop-char)
|
|
|
|
|
(put-text-property
|
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-372
Remove "-face" suffix from ruler-mode faces
2005-06-10 Miles Bader <miles@gnu.org>
* lisp/ruler-mode.el (ruler-mode-default, ruler-mode-pad)
(ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column):
Remove "-face" suffix from face names.
(ruler-mode-default-face, ruler-mode-pad-face)
(ruler-mode-margins-face, ruler-mode-fringes-face)
(ruler-mode-column-number-face, ruler-mode-fill-column-face)
(ruler-mode-comment-column-face, ruler-mode-goal-column-face)
(ruler-mode-tab-stop-face, ruler-mode-current-column-face):
New backward-compatibility aliases for renamed faces.
(ruler-mode-pad, ruler-mode-margins, ruler-mode-fringes)
(ruler-mode-column-number, ruler-mode-fill-column)
(ruler-mode-comment-column, ruler-mode-goal-column)
(ruler-mode-tab-stop, ruler-mode-current-column)
(ruler-mode-mouse-grab-any-column, ruler-mode-ruler): Use renamed faces.
2005-06-10 08:20:44 +00:00
|
|
|
|
i (1+ i) 'face 'ruler-mode-tab-stop
|
2004-03-19 13:17:16 +00:00
|
|
|
|
ruler)))
|
|
|
|
|
(setq i (1+ i)
|
|
|
|
|
j (1+ j)))
|
|
|
|
|
;; Return the ruler propertized string. Using list here,
|
|
|
|
|
;; instead of concat visually separate the different areas.
|
|
|
|
|
(if (nth 2 (window-fringes))
|
|
|
|
|
;; fringes outside margins.
|
|
|
|
|
(list "" (and (eq 'left sbvt) sb) lf lm
|
|
|
|
|
ruler rm rf (and (eq 'right sbvt) sb))
|
|
|
|
|
;; fringes inside margins.
|
|
|
|
|
(list "" (and (eq 'left sbvt) sb) lm lf
|
|
|
|
|
ruler rf rm (and (eq 'right sbvt) sb)))))
|
2001-10-09 12:10:17 +00:00
|
|
|
|
|
|
|
|
|
(provide 'ruler-mode)
|
|
|
|
|
|
|
|
|
|
;; Local Variables:
|
|
|
|
|
;; coding: iso-latin-1
|
|
|
|
|
;; End:
|
|
|
|
|
|
2003-09-01 15:45:59 +00:00
|
|
|
|
;;; arch-tag: b2f24546-5605-44c4-b67b-c9a4eeba3ee8
|
2001-10-09 12:10:17 +00:00
|
|
|
|
;;; ruler-mode.el ends here
|