unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Remove unnecessary functions from ruler-mode
@ 2004-03-15  8:25 David PONCE
  2004-03-15  8:42 ` Masatake YAMATO
  0 siblings, 1 reply; 2+ messages in thread
From: David PONCE @ 2004-03-15  8:25 UTC (permalink / raw)


Hi,

Following this changes to ruler-mode:

2004-03-15  Masatake YAMATO  <jet@gyve.org>

	* ruler-mode.el
	(ruler-mode-left-fringe-cols)
	(ruler-mode-right-fringe-cols): Use `fringe-columns'.
	(ruler-mode-right-scroll-bar-cols)
	(ruler-mode-left-scroll-bar-cols): Use `scroll-bar-columns'.
        [...]

Here is a patch to remove the now unnecessary above functions which
have been replaced by: `fringe-columns' and `scroll-bar-columns'.

Please, could someone install the patch for me?
Thanks!

Sincerely,
David

Index: lisp/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.5766
diff -c -r1.5766 ChangeLog
*** lisp/ChangeLog	15 Mar 2004 07:28:38 -0000	1.5766
--- lisp/ChangeLog	15 Mar 2004 08:10:44 -0000
***************
*** 1,3 ****
--- 1,12 ----
+ 2004-03-15  David Ponce  <david@dponce.com>
+ 
+ 	* ruler-mode.el: (ruler-mode-left-fringe-cols)
+ 	(ruler-mode-right-fringe-cols, ruler-mode-left-scroll-bar-cols)
+ 	(ruler-mode-right-scroll-bar-cols): Remove.
+ 	(ruler-mode-window-col, ruler-mode-mouse-set-left-margin)
+ 	(ruler-mode-mouse-set-right-margin, ruler-mode-ruler): Use
+ 	fringe-columns and scroll-bar-columns.
+ 
  2004-03-15  Masatake YAMATO  <jet@gyve.org>
  
  	* hl-line.el (hl-line-range-function): New variable.
Index: lisp/ruler-mode.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ruler-mode.el,v
retrieving revision 1.18
diff -c -r1.18 ruler-mode.el
*** lisp/ruler-mode.el	15 Mar 2004 07:27:02 -0000	1.18
--- lisp/ruler-mode.el	15 Mar 2004 08:10:44 -0000
***************
*** 299,323 ****
    "Face used to highlight the `current-column' character."
    :group 'ruler-mode)
  \f
- (defsubst ruler-mode-left-fringe-cols (&optional real)
-   "Return the width, measured in columns, of the left fringe area.
- If optional argument REAL is non-nil, return a real floating point
- number instead of a rounded integer value."
-   (fringe-columns 'left real))
- 
- (defsubst ruler-mode-right-fringe-cols (&optional real)
-   "Return the width, measured in columns, of the right fringe area.
- If optional argument REAL is non-nil, return a real floating point
- number instead of a rounded integer value."
-   (fringe-columns 'right real))
- 
- (defmacro ruler-mode-right-scroll-bar-cols ()
-   "Return the width, measured in columns, of the right vertical scrollbar."
-   '(scroll-bar-columns 'right))
- 
- (defmacro ruler-mode-left-scroll-bar-cols ()
-   "Return the width, measured in columns, of the left vertical scrollbar."
-   '(scroll-bar-columns 'left))
  
  (defsubst ruler-mode-full-window-width ()
    "Return the full width of the selected window."
--- 299,304 ----
***************
*** 330,337 ****
    (- n
       (car (window-edges))
       (or (car (window-margins)) 0)
!      (ruler-mode-left-fringe-cols)
!      (ruler-mode-left-scroll-bar-cols)))
  \f
  (defun ruler-mode-mouse-set-left-margin (start-event)
    "Set left margin end to the graduation where the mouse pointer is on.
--- 311,318 ----
    (- n
       (car (window-edges))
       (or (car (window-margins)) 0)
!      (fringe-columns 'left)
!      (scroll-bar-columns 'left)))
  \f
  (defun ruler-mode-mouse-set-left-margin (start-event)
    "Set left margin end to the graduation where the mouse pointer is on.
***************
*** 344,353 ****
        (save-selected-window
          (select-window (posn-window start))
          (setq col (- (car (posn-col-row start)) (car (window-edges))
!                      (ruler-mode-left-scroll-bar-cols))
                w   (- (ruler-mode-full-window-width)
!                      (ruler-mode-left-scroll-bar-cols)
!                      (ruler-mode-right-scroll-bar-cols)))
          (when (and (>= col 0) (< col w))
            (setq lm (window-margins)
                  rm (or (cdr lm) 0)
--- 325,334 ----
        (save-selected-window
          (select-window (posn-window start))
          (setq col (- (car (posn-col-row start)) (car (window-edges))
!                      (scroll-bar-columns 'left))
                w   (- (ruler-mode-full-window-width)
!                      (scroll-bar-columns 'left)
!                      (scroll-bar-columns 'right)))
          (when (and (>= col 0) (< col w))
            (setq lm (window-margins)
                  rm (or (cdr lm) 0)
***************
*** 366,375 ****
        (save-selected-window
          (select-window (posn-window start))
          (setq col (- (car (posn-col-row start)) (car (window-edges))
!                      (ruler-mode-left-scroll-bar-cols))
                w   (- (ruler-mode-full-window-width)
!                      (ruler-mode-left-scroll-bar-cols)
!                      (ruler-mode-right-scroll-bar-cols)))
          (when (and (>= col 0) (< col w))
            (setq lm  (window-margins)
                  rm  (or (cdr lm) 0)
--- 347,356 ----
        (save-selected-window
          (select-window (posn-window start))
          (setq col (- (car (posn-col-row start)) (car (window-edges))
!                      (scroll-bar-columns 'left))
                w   (- (ruler-mode-full-window-width)
!                      (scroll-bar-columns 'left)
!                      (scroll-bar-columns 'right)))
          (when (and (>= col 0) (< col w))
            (setq lm  (window-margins)
                  rm  (or (cdr lm) 0)
***************
*** 649,659 ****
    (when ruler-mode
      (let* ((w     (window-width))
             (m     (window-margins))
!            (lsb   (ruler-mode-left-scroll-bar-cols))
!            (lf    (ruler-mode-left-fringe-cols t))
             (lm    (or (car m) 0))
!            (rsb   (ruler-mode-right-scroll-bar-cols))
!            (rf    (ruler-mode-right-fringe-cols t))
             (rm    (or (cdr m) 0))
             (ruler (make-string w ruler-mode-basic-graduation-char))
             (i     0)
--- 630,640 ----
    (when ruler-mode
      (let* ((w     (window-width))
             (m     (window-margins))
!            (lsb   (scroll-bar-columns 'left))
!            (lf    (fringe-columns 'left t))
             (lm    (or (car m) 0))
!            (rsb   (scroll-bar-columns 'right))
!            (rf    (fringe-columns 'right t))
             (rm    (or (cdr m) 0))
             (ruler (make-string w ruler-mode-basic-graduation-char))
             (i     0)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Remove unnecessary functions from ruler-mode
  2004-03-15  8:25 Remove unnecessary functions from ruler-mode David PONCE
@ 2004-03-15  8:42 ` Masatake YAMATO
  0 siblings, 0 replies; 2+ messages in thread
From: Masatake YAMATO @ 2004-03-15  8:42 UTC (permalink / raw)
  Cc: emacs-devel

> Following this changes to ruler-mode:
> 
> 2004-03-15  Masatake YAMATO  <jet@gyve.org>
> 
> 	* ruler-mode.el
> 	(ruler-mode-left-fringe-cols)
> 	(ruler-mode-right-fringe-cols): Use `fringe-columns'.
> 	(ruler-mode-right-scroll-bar-cols)
> 	(ruler-mode-left-scroll-bar-cols): Use `scroll-bar-columns'.
>         [...]
> 
> Here is a patch to remove the now unnecessary above functions which
> have been replaced by: `fringe-columns' and `scroll-bar-columns'.
> 
> Please, could someone install the patch for me?
> Thanks!
> 
> Sincerely,
> David

I've just installed your patch.

(defun scroll-bar-columns (side) ...

Do you think that defsubst should be used here?

Masatake YAMATO

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-03-15  8:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-15  8:25 Remove unnecessary functions from ruler-mode David PONCE
2004-03-15  8:42 ` Masatake YAMATO

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).