2021-03-24 02:47:27 +00:00
|
|
|
|
;;; ruler-mode.el --- display a ruler in the header line -*- lexical-binding: t -*-
|
2001-10-09 12:10:17 +00:00
|
|
|
|
|
2024-01-02 01:47:10 +00:00
|
|
|
|
;; Copyright (C) 2001-2024 Free Software Foundation, Inc.
|
2001-10-09 12:10:17 +00:00
|
|
|
|
|
|
|
|
|
;; Author: David Ponce <david@dponce.com>
|
|
|
|
|
;; Created: 24 Mar 2001
|
2020-03-21 01:46:53 +00:00
|
|
|
|
;; Old-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.
|
|
|
|
|
|
2008-05-06 16:29:23 +00:00
|
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
2008-05-06 08:06:51 +00:00
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
2001-10-09 12:10:17 +00:00
|
|
|
|
|
2008-05-06 16:29:23 +00:00
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
2008-05-06 08:06:51 +00:00
|
|
|
|
;; 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.
|
2001-10-09 12:10:17 +00:00
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2017-09-13 22:52:52 +00:00
|
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
2001-10-09 12:10:17 +00:00
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
|
|
;; This library provides a minor mode to display a ruler in the header
|
2021-03-07 04:09:21 +00:00
|
|
|
|
;; line.
|
2001-10-09 12:10:17 +00:00
|
|
|
|
;;
|
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-04-16 12:51:06 +00:00
|
|
|
|
;;
|
|
|
|
|
;; You can override the ruler format by defining an appropriate
|
|
|
|
|
;; 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)
|
|
|
|
|
|
2001-11-25 00:12:11 +00:00
|
|
|
|
|
2001-10-09 12:10:17 +00:00
|
|
|
|
;;; Code:
|
|
|
|
|
(eval-when-compile
|
|
|
|
|
(require 'wid-edit))
|
2004-04-16 12:51:06 +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
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"If non-nil the ruler shows tab stop positions.
|
2001-10-09 12:10:17 +00:00
|
|
|
|
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."
|
|
|
|
|
: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)))
|
2002-08-18 13:37:11 +00:00
|
|
|
|
(unless (characterp value)
|
2001-10-09 12:10:17 +00:00
|
|
|
|
(widget-put widget :error
|
|
|
|
|
(format "Invalid character value: %S" value))
|
|
|
|
|
widget))))
|
2003-01-13 08:22:50 +00:00
|
|
|
|
|
2013-03-05 17:13:01 +00:00
|
|
|
|
(defcustom ruler-mode-fill-column-char (if (char-displayable-p ?¶)
|
|
|
|
|
?\¶
|
2001-10-09 12:10:17 +00:00
|
|
|
|
?\|)
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Character used at the `fill-column' location."
|
2001-10-09 12:10:17 +00:00
|
|
|
|
: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 ?\#
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Character used at the `comment-column' location."
|
2003-01-13 08:22:50 +00:00
|
|
|
|
:type '(choice
|
|
|
|
|
(character :tag "Character")
|
|
|
|
|
(integer :tag "Integer char value"
|
|
|
|
|
:validate ruler-mode-character-validate)))
|
|
|
|
|
|
|
|
|
|
(defcustom ruler-mode-goal-column-char ?G
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Character used at the `goal-column' location."
|
2003-01-13 08:22:50 +00:00
|
|
|
|
:type '(choice
|
|
|
|
|
(character :tag "Character")
|
|
|
|
|
(integer :tag "Integer char value"
|
|
|
|
|
:validate ruler-mode-character-validate)))
|
|
|
|
|
|
2013-03-05 17:13:01 +00:00
|
|
|
|
(defcustom ruler-mode-current-column-char (if (char-displayable-p ?¦)
|
|
|
|
|
?\¦
|
2001-10-09 12:10:17 +00:00
|
|
|
|
?\@)
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Character used at the `current-column' location."
|
2001-10-09 12:10:17 +00:00
|
|
|
|
:type '(choice
|
|
|
|
|
(character :tag "Character")
|
|
|
|
|
(integer :tag "Integer char value"
|
|
|
|
|
:validate ruler-mode-character-validate)))
|
|
|
|
|
|
|
|
|
|
(defcustom ruler-mode-tab-stop-char ?\T
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Character used at `tab-stop-list' locations."
|
2001-10-09 12:10:17 +00:00
|
|
|
|
:type '(choice
|
|
|
|
|
(character :tag "Character")
|
|
|
|
|
(integer :tag "Integer char value"
|
|
|
|
|
:validate ruler-mode-character-validate)))
|
|
|
|
|
|
|
|
|
|
(defcustom ruler-mode-basic-graduation-char ?\.
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Character used for basic graduations."
|
2001-10-09 12:10:17 +00:00
|
|
|
|
:type '(choice
|
|
|
|
|
(character :tag "Character")
|
|
|
|
|
(integer :tag "Integer char value"
|
|
|
|
|
:validate ruler-mode-character-validate)))
|
|
|
|
|
|
|
|
|
|
(defcustom ruler-mode-inter-graduation-char ?\!
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Character used for intermediate graduations."
|
2001-10-09 12:10:17 +00:00
|
|
|
|
: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
|
2008-12-03 05:48:14 +00:00
|
|
|
|
"Non-nil means do `ding' when `goal-column' is set."
|
2003-01-13 08:22:50 +00:00
|
|
|
|
: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)
|
|
|
|
|
)))
|
2021-03-24 02:47:27 +00:00
|
|
|
|
"Default face used by the ruler.")
|
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
|
|
|
|
(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"
|
|
|
|
|
)))
|
2021-03-24 02:47:27 +00:00
|
|
|
|
"Face used to pad inactive ruler areas.")
|
2003-06-01 23:07:31 +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-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"
|
|
|
|
|
)))
|
2021-03-24 02:47:27 +00:00
|
|
|
|
"Face used to highlight margin areas.")
|
2003-06-01 23:07:31 +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-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"
|
|
|
|
|
)))
|
2021-03-24 02:47:27 +00:00
|
|
|
|
"Face used to highlight fringes areas.")
|
2003-06-01 23:07:31 +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-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"
|
|
|
|
|
)))
|
2021-03-24 02:47:27 +00:00
|
|
|
|
"Face used to highlight number 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
|
|
|
|
(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"
|
|
|
|
|
)))
|
2021-03-24 02:47:27 +00:00
|
|
|
|
"Face used to highlight the fill column character.")
|
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
|
|
|
|
(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"
|
|
|
|
|
)))
|
2021-03-24 02:47:27 +00:00
|
|
|
|
"Face used to highlight the comment column character.")
|
2003-01-13 08:22:50 +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-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"
|
|
|
|
|
)))
|
2021-03-24 02:47:27 +00:00
|
|
|
|
"Face used to highlight the goal column character.")
|
2003-01-13 08:22:50 +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-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"
|
|
|
|
|
)))
|
2021-03-24 02:47:27 +00:00
|
|
|
|
"Face used to highlight tab stop characters.")
|
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
|
|
|
|
(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"
|
|
|
|
|
)))
|
2021-03-24 02:47:27 +00:00
|
|
|
|
"Face used to highlight the `current-column' character.")
|
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))))
|
|
|
|
|
|
2022-02-22 14:22:50 +00:00
|
|
|
|
(defsubst ruler-mode-window-col (event)
|
2003-06-01 23:07:31 +00:00
|
|
|
|
"Return a column number relative to the selected window.
|
2022-02-22 14:22:50 +00:00
|
|
|
|
EVENT is the mouse event that gives the current column.
|
2017-08-05 11:22:04 +00:00
|
|
|
|
If required, account for screen estate taken by `display-line-numbers'."
|
2022-02-22 14:22:50 +00:00
|
|
|
|
(let ((n (car (posn-col-row event))))
|
|
|
|
|
(when display-line-numbers
|
2017-10-20 09:36:12 +00:00
|
|
|
|
;; FIXME: ruler-mode relies on N being an integer, so if the
|
|
|
|
|
;; 'line-number' face is customized to use a font that is larger
|
|
|
|
|
;; or smaller than that of the default face, the alignment might
|
|
|
|
|
;; be off by up to half a column, unless the font width is an
|
|
|
|
|
;; integral multiple or divisor of the default face's font.
|
|
|
|
|
(setq n (- n (round (line-number-display-width 'columns)))))
|
2022-02-22 14:22:50 +00:00
|
|
|
|
(- n
|
|
|
|
|
(if (eq (posn-area event) 'header-line)
|
|
|
|
|
(+ (or (car (window-margins)) 0)
|
|
|
|
|
(fringe-columns 'left)
|
|
|
|
|
(scroll-bar-columns 'left))
|
|
|
|
|
0))))
|
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))
|
2014-06-16 06:37:37 +00:00
|
|
|
|
(setq col (- (car (posn-col-row start))
|
2004-04-16 12:51:06 +00:00
|
|
|
|
(scroll-bar-columns 'left))
|
2003-06-01 23:07:31 +00:00
|
|
|
|
w (- (ruler-mode-full-window-width)
|
2004-04-16 12:51: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))
|
2014-06-16 06:37:37 +00:00
|
|
|
|
(setq col (- (car (posn-col-row start))
|
2004-04-16 12:51:06 +00:00
|
|
|
|
(scroll-bar-columns 'left))
|
2003-06-01 23:07:31 +00:00
|
|
|
|
w (- (ruler-mode-full-window-width)
|
2004-04-16 12:51: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.")
|
|
|
|
|
|
2017-05-27 13:25:02 +00:00
|
|
|
|
(defun ruler-mode-text-scaled-width (width)
|
|
|
|
|
"Compute scaled text width according to current font scaling.
|
|
|
|
|
Convert a width of char units into a text-scaled char width units,
|
2021-09-22 18:26:40 +00:00
|
|
|
|
for example `window-hscroll'."
|
2017-05-27 13:25:02 +00:00
|
|
|
|
(/ (* width (frame-char-width)) (default-font-width)))
|
|
|
|
|
|
|
|
|
|
(defun ruler-mode-text-scaled-window-hscroll ()
|
|
|
|
|
"Text scaled `window-hscroll'."
|
|
|
|
|
(ruler-mode-text-scaled-width (window-hscroll)))
|
|
|
|
|
|
|
|
|
|
(defun ruler-mode-text-scaled-window-width ()
|
|
|
|
|
"Text scaled `window-width'."
|
|
|
|
|
(ruler-mode-text-scaled-width (window-width)))
|
|
|
|
|
|
2003-01-13 08:22:50 +00:00
|
|
|
|
(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))
|
2022-02-22 14:22:50 +00:00
|
|
|
|
(setq col (ruler-mode-window-col start)
|
2017-05-27 13:25:02 +00:00
|
|
|
|
newc (+ col (ruler-mode-text-scaled-window-hscroll)))
|
2003-06-01 23:07:31 +00:00
|
|
|
|
(and
|
2017-05-27 13:25:02 +00:00
|
|
|
|
(>= col 0) (< col (ruler-mode-text-scaled-window-width))
|
2003-06-01 23:07:31 +00:00
|
|
|
|
(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.
|
2021-01-02 22:10:17 +00:00
|
|
|
|
(read--potential-mouse-event)
|
2003-06-01 23:07:31 +00:00
|
|
|
|
;; 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
|
2015-06-30 15:59:21 +00:00
|
|
|
|
;; Signal the display engine to freeze the mouse pointer shape.
|
|
|
|
|
(setq track-mouse 'dragging)
|
2021-01-02 22:10:17 +00:00
|
|
|
|
(while (mouse-movement-p (setq event (read--potential-mouse-event)))
|
2003-06-01 23:07:31 +00:00
|
|
|
|
(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))
|
2022-02-22 14:22:50 +00:00
|
|
|
|
(setq col (ruler-mode-window-col end)
|
2017-05-27 13:25:02 +00:00
|
|
|
|
newc (+ col (ruler-mode-text-scaled-window-hscroll)))
|
|
|
|
|
(when (and (>= col 0) (< col (ruler-mode-text-scaled-window-width)))
|
2003-06-01 23:07:31 +00:00
|
|
|
|
(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))
|
2022-02-22 14:22:50 +00:00
|
|
|
|
(setq col (ruler-mode-window-col start)
|
2017-05-27 13:25:02 +00:00
|
|
|
|
ts (+ col (ruler-mode-text-scaled-window-hscroll)))
|
|
|
|
|
(and (>= col 0) (< col (ruler-mode-text-scaled-window-width))
|
2003-06-01 23:07:31 +00:00
|
|
|
|
(not (member ts tab-stop-list))
|
|
|
|
|
(progn
|
|
|
|
|
(message "Tab stop set to %d" ts)
|
2014-06-25 23:53:37 +00:00
|
|
|
|
(when (null tab-stop-list)
|
|
|
|
|
(setq tab-stop-list (indent-accumulate-tab-stops (1- 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))
|
2022-02-22 14:22:50 +00:00
|
|
|
|
(setq col (ruler-mode-window-col start)
|
2017-05-27 13:25:02 +00:00
|
|
|
|
ts (+ col (ruler-mode-text-scaled-window-hscroll)))
|
|
|
|
|
(and (>= col 0) (< col (ruler-mode-text-scaled-window-width))
|
2003-06-01 23:07:31 +00:00
|
|
|
|
(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))
|
|
|
|
|
|
2022-07-02 04:25:01 +00:00
|
|
|
|
(defvar-keymap ruler-mode-map
|
|
|
|
|
:doc "Keymap for `ruler-mode'."
|
|
|
|
|
"<header-line> <down-mouse-1>" #'ignore
|
|
|
|
|
"<header-line> <down-mouse-3>" #'ignore
|
|
|
|
|
"<header-line> <down-mouse-2>" #'ruler-mode-mouse-grab-any-column
|
|
|
|
|
"<header-line> S-<down-mouse-1>" #'ruler-mode-mouse-set-left-margin
|
|
|
|
|
"<header-line> S-<down-mouse-3>" #'ruler-mode-mouse-set-right-margin
|
|
|
|
|
"<header-line> C-<down-mouse-1>" #'ruler-mode-mouse-add-tab-stop
|
|
|
|
|
"<header-line> C-<down-mouse-3>" #'ruler-mode-mouse-del-tab-stop
|
|
|
|
|
"<header-line> C-<down-mouse-2>" #'ruler-mode-toggle-show-tab-stops
|
|
|
|
|
"<header-line> S-<mouse-1>" #'ignore
|
|
|
|
|
"<header-line> S-<mouse-3>" #'ignore
|
|
|
|
|
"<header-line> C-<mouse-1>" #'ignore
|
|
|
|
|
"<header-line> C-<mouse-3>" #'ignore
|
|
|
|
|
"<header-line> C-<mouse-2>" #'ignore)
|
2001-10-09 12:10:17 +00:00
|
|
|
|
|
|
|
|
|
(defvar ruler-mode-header-line-format-old nil
|
|
|
|
|
"Hold previous value of `header-line-format'.")
|
2004-04-16 12:51:06 +00:00
|
|
|
|
|
|
|
|
|
(defvar ruler-mode-ruler-function 'ruler-mode-ruler
|
|
|
|
|
"Function to call to return ruler header line format.
|
|
|
|
|
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-04-16 12:51:06 +00:00
|
|
|
|
'(:eval (funcall ruler-mode-ruler-function))
|
|
|
|
|
"`header-line-format' used in ruler mode.
|
|
|
|
|
Call `ruler-mode-ruler-function' to compute the ruler value.")
|
2001-10-09 12:10:17 +00:00
|
|
|
|
|
2010-06-30 22:43:52 +00:00
|
|
|
|
;;;###autoload
|
Prefer defvar-local in remaining libraries
* lisp/align.el (align-mode-rules-list)
(align-mode-exclude-rules-list):
* lisp/bookmark.el (bookmark-current-bookmark)
(bookmark-annotation-name)
(bookmark--annotation-from-bookmark-list):
* lisp/calc/calc-embed.el (calc-embedded-all-active)
(calc-embedded-some-active):
* lisp/comint.el (comint-password-function):
* lisp/completion.el (completion-syntax-table):
* lisp/dframe.el (dframe-track-mouse-function)
(dframe-help-echo-function, dframe-mouse-click-function)
(dframe-mouse-position-function, dframe-timer)
(dframe-attached-frame, dframe-controlled):
* lisp/ehelp.el (electric-help-orig-major-mode):
* lisp/eshell/esh-util.el (eshell-path-env):
* lisp/expand.el (expand-pos, expand-index, expand-point):
* lisp/face-remap.el (text-scale-mode-remapping)
(text-scale-mode-lighter, text-scale-mode-amount)
(text-scale-remap-header-line, buffer-face-mode-remapping):
* lisp/ffap.el (ffap-menu-alist):
* lisp/files-x.el (connection-local-variables-alist):
* lisp/foldout.el (foldout-fold-list, foldout-mode-line-string):
* lisp/follow.el (follow-start-end-invalid):
* lisp/forms.el (forms--mode-setup):
* lisp/gnus/message.el (message-cross-post-old-target)
(message-options):
* lisp/help-mode.el (help-xref-stack, help-xref-forward-stack)
(help-xref-stack-item, help-xref-stack-forward-item):
* lisp/hexl.el (hexl-mode--old-var-vals, hexl-ascii-overlay):
* lisp/hilit-chg.el (hilit-chg-string):
* lisp/ido.el (ido-eoinput):
* lisp/imenu.el (imenu-generic-expression)
(imenu-create-index-function, imenu-default-goto-function)
(imenu-prev-index-position-function)
(imenu-extract-index-name-function, imenu-name-lookup-function)
(imenu-syntax-alist, imenu-case-fold-search):
* lisp/jka-compr.el (jka-compr-really-do-compress):
* lisp/language/ethio-util.el (ethio-prefer-ascii-space):
* lisp/leim/quail/hangul.el (hangul-input-method-help-text):
* lisp/leim/quail/japanese.el (quail-japanese-package-saved):
* lisp/linum.el (linum-overlays, linum-available):
* lisp/man.el (Man-original-frame, Man-arguments, Man--sections)
(Man--refpages, Man-page-list, Man-current-page)
(Man-page-mode-string):
* lisp/pcomplete.el (pcomplete-current-completions)
(pcomplete-last-completion-length)
(pcomplete-last-completion-stub, pcomplete-last-completion-raw)
(pcomplete-last-window-config, pcomplete-window-restore-timer):
* lisp/reveal.el (reveal-open-spots, reveal-last-tick):
* lisp/ruler-mode.el (ruler-mode):
* lisp/scroll-lock.el (scroll-lock-preserve-screen-pos-save):
* lisp/server.el (server-buffer-clients, server-existing-buffer):
* lisp/tab-line.el (tab-line-exclude):
* lisp/tar-mode.el (tar-data-buffer, tar-data-swapped):
* lisp/thumbs.el (thumbs-current-tmp-filename)
(thumbs-current-image-filename, thumbs-extra-images)
(thumbs-image-num, thumbs-buffer, thumbs-marked-list):
* lisp/tutorial.el (tutorial--point-before-chkeys)
(tutorial--point-after-chkeys, tutorial--lang):
* lisp/url/url-vars.el (url-current-object)
(url-current-mime-headers, url-current-lastloc):
* lisp/view.el (view-mode, view-old-buffer-read-only)
(view-old-Helper-return-blurb, view-page-size)
(view-half-page-size, view-last-regexp, view-return-to-alist)
(view-exit-action, view-overlay):
* lisp/wid-edit.el (widget-global-map, widget-field-new)
(widget-field-list, widget-field-last, widget-field-was):
* lisp/woman.el (woman-imenu-done): Prefer defvar-local.
2021-02-02 08:55:40 +00:00
|
|
|
|
(defvar-local ruler-mode nil
|
2010-06-30 22:43:52 +00:00
|
|
|
|
"Non-nil if Ruler mode is enabled.
|
|
|
|
|
Use the command `ruler-mode' to change this variable.")
|
|
|
|
|
|
|
|
|
|
(defun ruler--save-header-line-format ()
|
|
|
|
|
"Install the header line format for Ruler mode.
|
2010-07-01 05:32:01 +00:00
|
|
|
|
Unless Ruler mode is already enabled, save the old header line
|
2010-06-30 22:43:52 +00:00
|
|
|
|
format first."
|
2010-07-01 05:32:01 +00:00
|
|
|
|
(when (and (not ruler-mode)
|
|
|
|
|
(local-variable-p 'header-line-format)
|
|
|
|
|
(not (local-variable-p 'ruler-mode-header-line-format-old)))
|
2020-12-09 08:44:38 +00:00
|
|
|
|
(setq-local ruler-mode-header-line-format-old
|
|
|
|
|
header-line-format))
|
2010-07-01 05:32:01 +00:00
|
|
|
|
(setq header-line-format ruler-mode-header-line-format))
|
2010-06-30 22:43:52 +00:00
|
|
|
|
|
2001-10-09 12:10:17 +00:00
|
|
|
|
;;;###autoload
|
|
|
|
|
(define-minor-mode ruler-mode
|
2018-07-02 03:34:53 +00:00
|
|
|
|
"Toggle display of ruler in header line (Ruler mode)."
|
2001-10-09 12:10:17 +00:00
|
|
|
|
:group 'ruler-mode
|
2010-06-30 22:43:52 +00:00
|
|
|
|
:variable (ruler-mode
|
|
|
|
|
. (lambda (enable)
|
|
|
|
|
(when enable
|
|
|
|
|
(ruler--save-header-line-format))
|
|
|
|
|
(setq ruler-mode enable)))
|
2001-10-09 12:10:17 +00:00
|
|
|
|
(if ruler-mode
|
2010-06-30 22:43:52 +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-04-16 12:51:06 +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]
|
2018-11-05 00:22:15 +00:00
|
|
|
|
'(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.")
|
2004-04-16 12:51:06 +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."
|
|
|
|
|
(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 ()
|
2007-01-14 03:49:17 +00:00
|
|
|
|
"Compute and return a header line ruler."
|
2017-05-27 13:25:02 +00:00
|
|
|
|
(let* ((w (ruler-mode-text-scaled-window-width))
|
2004-04-16 12:51:06 +00:00
|
|
|
|
(m (window-margins))
|
|
|
|
|
(f (window-fringes))
|
2017-10-20 09:36:12 +00:00
|
|
|
|
(i (if display-line-numbers
|
|
|
|
|
;; FIXME: ruler-mode relies on I being an integer, so
|
|
|
|
|
;; the column numbers might be slightly off if the
|
|
|
|
|
;; line-number face is customized.
|
|
|
|
|
(round (line-number-display-width 'columns))
|
|
|
|
|
0))
|
2017-05-27 13:25:02 +00:00
|
|
|
|
(j (ruler-mode-text-scaled-window-hscroll))
|
2004-04-16 12:51:06 +00:00
|
|
|
|
;; 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-04-16 12:51:06 +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-04-16 12:51:06 +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-04-16 12:51:06 +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-04-16 12:51:06 +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-04-16 12:51:06 +00:00
|
|
|
|
;; Remember the scrollbar vertical type.
|
|
|
|
|
(sbvt (car (window-current-scroll-bars)))
|
|
|
|
|
;; Create an "clean" ruler.
|
|
|
|
|
(ruler
|
|
|
|
|
(propertize
|
2017-11-04 13:00:25 +00:00
|
|
|
|
;; Make the part of header-line corresponding to the
|
|
|
|
|
;; line-number display be blank, not filled with
|
|
|
|
|
;; ruler-mode-basic-graduation-char.
|
|
|
|
|
(if display-line-numbers
|
|
|
|
|
(let* ((lndw (round (line-number-display-width 'columns)))
|
|
|
|
|
;; We need a multibyte string here so we could
|
|
|
|
|
;; later use aset to insert multibyte characters
|
|
|
|
|
;; into that string.
|
|
|
|
|
(s (make-string lndw ?\s t)))
|
|
|
|
|
(concat s (make-string (- w lndw)
|
|
|
|
|
ruler-mode-basic-graduation-char t)))
|
|
|
|
|
(make-string w ruler-mode-basic-graduation-char 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
|
|
|
|
'face 'ruler-mode-default
|
2004-04-16 12:51:06 +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-04-16 12:51:06 +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-04-16 12:51:06 +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-04-16 12:51:06 +00:00
|
|
|
|
ruler)
|
2005-05-23 11:19:17 +00:00
|
|
|
|
(put-text-property
|
|
|
|
|
i (1+ i) 'mouse-face 'mode-line-highlight
|
|
|
|
|
ruler)
|
2004-04-16 12:51:06 +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-04-16 12:51:06 +00:00
|
|
|
|
ruler)
|
2005-05-23 11:19:17 +00:00
|
|
|
|
(put-text-property
|
|
|
|
|
i (1+ i) 'mouse-face 'mode-line-highlight
|
|
|
|
|
ruler)
|
2004-04-16 12:51:06 +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-04-16 12:51:06 +00:00
|
|
|
|
ruler)
|
2005-05-23 11:19:17 +00:00
|
|
|
|
(put-text-property
|
|
|
|
|
i (1+ i) 'mouse-face 'mode-line-highlight
|
|
|
|
|
ruler)
|
2004-04-16 12:51:06 +00:00
|
|
|
|
(put-text-property
|
|
|
|
|
i (1+ i) 'help-echo ruler-mode-fill-column-help-echo
|
|
|
|
|
ruler))
|
|
|
|
|
;; Show the `tab-stop-list' markers.
|
2014-06-25 23:53:37 +00:00
|
|
|
|
((and ruler-mode-show-tab-stops (= j (indent-next-tab-stop (1- j))))
|
2004-04-16 12:51:06 +00:00
|
|
|
|
(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-04-16 12:51:06 +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)
|
|
|
|
|
|
|
|
|
|
;;; ruler-mode.el ends here
|