Mercurial > hg > xemacs-beta
diff lisp/prim/scrollbar.el @ 102:a145efe76779 r20-1b3
Import from CVS: tag r20-1b3
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:15:49 +0200 |
parents | 131b0175ea99 |
children |
line wrap: on
line diff
--- a/lisp/prim/scrollbar.el Mon Aug 13 09:15:13 2007 +0200 +++ b/lisp/prim/scrollbar.el Mon Aug 13 09:15:49 2007 +0200 @@ -14,21 +14,23 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with XEmacs; see the file COPYING. If not, write to the Free -;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +;; along with XEmacs; see the file COPYING. If not, write to the +;; Free Software Foundation, 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. ;;; Synched up with: Not in FSF. (Completely divergent from FSF scroll-bar.el) (defun init-scrollbar-from-resources (locale) - (if (and (featurep 'x) - (or (eq locale 'global) - (eq 'x (device-or-frame-type locale))) - (x-init-scrollbar-from-resources locale)))) + (when (and (featurep 'x) + (or (eq locale 'global) + (eq 'x (device-or-frame-type locale)))) + (x-init-scrollbar-from-resources locale))) ;; ;; vertical scrollbar functions ;; +;;; ### Move functions from C into Lisp here! ;; ;; horizontal scrollbar functions @@ -39,8 +41,7 @@ This is the little arrow to the left of the scrollbar. One argument is passed, the scrollbar's window. You can advise this function to change the scrollbar behavior." - (if (not (window-live-p window)) - nil + (when (window-live-p window) (scrollbar-set-hscroll window (- (window-hscroll window) 1)) (setq zmacs-region-stays t) nil)) @@ -50,8 +51,7 @@ This is the little arrow to the right of the scrollbar. One argument is passed, the scrollbar's window. You can advise this function to change the scrollbar behavior." - (if (not (window-live-p window)) - nil + (when (window-live-p window) (scrollbar-set-hscroll window (+ (window-hscroll window) 1)) (setq zmacs-region-stays t) nil)) @@ -61,8 +61,7 @@ \(The way this is done can vary from scrollbar to scrollbar.\) One argument is passed, the scrollbar's window. You can advise this function to change the scrollbar behavior." - (if (not (window-live-p window)) - nil + (when (window-live-p window) (scrollbar-set-hscroll window (- (window-hscroll window) (- (window-width window) 2))) (setq zmacs-region-stays t) @@ -73,8 +72,7 @@ \(The way this is done can vary from scrollbar to scrollbar.\) One argument is passed, the scrollbar's window. You can advise this function to change the scrollbar behavior." - (if (not (window-live-p window)) - nil + (when (window-live-p window) (scrollbar-set-hscroll window (+ (window-hscroll window) (- (window-width window) 2))) (setq zmacs-region-stays t) @@ -85,8 +83,7 @@ \(The way this is done can vary from scrollbar to scrollbar.\). One argument is passed, the scrollbar's window. You can advise this function to change the scrollbar behavior." - (if (not (window-live-p window)) - nil + (when (window-live-p window) (scrollbar-set-hscroll window 0) (setq zmacs-region-stays t) nil)) @@ -96,8 +93,7 @@ \(The way this is done can vary from scrollbar to scrollbar.\). One argument is passed, the scrollbar's window. You can advise this function to change the scrollbar behavior." - (if (not (window-live-p window)) - nil + (when (window-live-p window) (scrollbar-set-hscroll window 'max) (setq zmacs-region-stays t) nil)) @@ -108,9 +104,8 @@ representing how many columns the thumb is slid over. You can advise this function to change the scrollbar behavior." (let ((window (car data)) - (value (cdr data))) - (if (not (or (window-live-p window) (integerp value))) - nil + (value (cdr data))) + (when (and (window-live-p window) (integerp value)) (scrollbar-set-hscroll window value) (setq zmacs-region-stays t) nil)))