X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/77ab81d0545e980c57c0a35510ade29a9e43b4cd..b8657d829a50110930decf87545ca2a19ff991c1:/lisp/ruler-mode.el diff --git a/lisp/ruler-mode.el b/lisp/ruler-mode.el index 13e3fdffa6..de31f2ec4a 100644 --- a/lisp/ruler-mode.el +++ b/lisp/ruler-mode.el @@ -1,7 +1,6 @@ ;;; ruler-mode.el --- display a ruler in the header line -;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, -;; 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +;; Copyright (C) 2001-2014 Free Software Foundation, Inc. ;; Author: David Ponce ;; Maintainer: David Ponce @@ -138,8 +137,8 @@ or remove a tab stop. \\[ruler-mode-toggle-show-tab-stops] or (format "Invalid character value: %S" value)) widget)))) -(defcustom ruler-mode-fill-column-char (if (char-displayable-p ?¶) - ?\¶ +(defcustom ruler-mode-fill-column-char (if (char-displayable-p ?¶) + ?\¶ ?\|) "Character used at the `fill-column' location." :group 'ruler-mode @@ -164,8 +163,8 @@ or remove a tab stop. \\[ruler-mode-toggle-show-tab-stops] or (integer :tag "Integer char value" :validate ruler-mode-character-validate))) -(defcustom ruler-mode-current-column-char (if (char-displayable-p ?¦) - ?\¦ +(defcustom ruler-mode-current-column-char (if (char-displayable-p ?¦) + ?\¦ ?\@) "Character used at the `current-column' location." :group 'ruler-mode @@ -307,7 +306,6 @@ or remove a tab stop. \\[ruler-mode-toggle-show-tab-stops] or "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) (fringe-columns 'left) (scroll-bar-columns 'left))) @@ -322,7 +320,7 @@ START-EVENT is the mouse click event." (when (eq start end) ;; mouse click (save-selected-window (select-window (posn-window start)) - (setq col (- (car (posn-col-row start)) (car (window-edges)) + (setq col (- (car (posn-col-row start)) (scroll-bar-columns 'left)) w (- (ruler-mode-full-window-width) (scroll-bar-columns 'left) @@ -344,7 +342,7 @@ START-EVENT is the mouse click event." (when (eq start end) ;; mouse click (save-selected-window (select-window (posn-window start)) - (setq col (- (car (posn-col-row start)) (car (window-edges)) + (setq col (- (car (posn-col-row start)) (scroll-bar-columns 'left)) w (- (ruler-mode-full-window-width) (scroll-bar-columns 'left) @@ -478,8 +476,9 @@ START-EVENT is the mouse click event." (not (member ts tab-stop-list)) (progn (message "Tab stop set to %d" ts) - (setq tab-stop-list (sort (cons ts tab-stop-list) - #'<))))))))) + (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) #'<))))))))) (defun ruler-mode-mouse-del-tab-stop (start-event) "Delete tab stop at the graduation where the mouse pointer is on. @@ -568,8 +567,10 @@ format first." ;;;###autoload (define-minor-mode ruler-mode - "Toggle Ruler mode. -In Ruler mode, Emacs displays a ruler in the header line." + "Toggle display of ruler in header line (Ruler mode). +With a prefix argument ARG, enable Ruler mode if ARG is positive, +and disable it otherwise. If called from Lisp, enable the mode +if ARG is omitted or nil." nil nil ruler-mode-map :group 'ruler-mode @@ -753,7 +754,7 @@ Optional argument PROPS specifies other text properties to apply." 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)) + ((and ruler-mode-show-tab-stops (= j (indent-next-tab-stop (1- j)))) (aset ruler i ruler-mode-tab-stop-char) (put-text-property i (1+ i) 'face 'ruler-mode-tab-stop @@ -773,8 +774,7 @@ Optional argument PROPS specifies other text properties to apply." (provide 'ruler-mode) ;; Local Variables: -;; coding: iso-latin-1 +;; coding: utf-8 ;; End: -;; arch-tag: b2f24546-5605-44c4-b67b-c9a4eeba3ee8 ;;; ruler-mode.el ends here