emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: finger-pointer curser as default for mouse-face text


From: Miles Bader
Subject: Re: finger-pointer curser as default for mouse-face text
Date: Tue, 2 Nov 2004 16:51:35 -0500
User-agent: Mutt/1.3.28i

On Tue, Nov 02, 2004 at 07:08:34PM +0100, Karl Eichwalder wrote:
> > It is interesting to find a user who often specifies faces.
> > Can you tell us the circumstances where you do that?
> 
> >From time to time it is necessary to increase the font size: When I want
> to demonstrate something to somebody watching my screen, or when I want
> to check some accented or foreign characters more closely.

Something like the following elisp code might be more useful for this.  It
implements the C-+ and C-- (that's control-minus :-) bindings many modern GUI
programs use to grow/shrink the default face.

The main problem with these commands -- and so why I haven't pursued adding
them to the official sources[*] -- is that they don't interact well with a
default face which has been set using customize-face (because the Emacs
face-customization machinery sucks).  However the traditional font-setting
menu _also_ doesn't work if you've customized the `default' face, so I'm
assuming you haven't done that... :-)

[*] Perhaps the benefits of these commands outweigh their drawbacks however
and they _should_ be added to CVS; after all the traditional "set font" menu
has the same problem.  Of course the real solution is to overhaul the
face-setting mechanism to not have the horrible looping problems it has.

-Miles


;;; default-grow.el

(defun increase-default-face-height (&optional steps)
  "Increase the height of the default face by STEPS steps.
Each step multiplies the height by 1.2; a negative number of steps
decreases the height by the same amount."
  (interactive
   (list
    (cond ((eq current-prefix-arg '-) -1)
          ((numberp current-prefix-arg) current-prefix-arg)
          ((consp current-prefix-arg) -1)
          (t 1))))
  (let ((frame (selected-frame)))
    (set-face-attribute 'default frame
                        :height (floor
                                 (* (face-attribute 'default :height frame)
                                    (expt 1.3 steps))))))

(defun decrease-default-face-height (&optional steps)
  "Decrease the height of the default face by STEPS steps.
Each step divides the height by 1.2; a negative number of steps
increases the height by the same amount."
  (interactive
   (list
    (cond ((eq current-prefix-arg '-) -1)
          ((numberp current-prefix-arg) current-prefix-arg)
          ((consp current-prefix-arg) -1)
          (t 1))))
  (increase-default-face-height (- steps)))

(global-set-key [(control =)] 'increase-default-face-height)
(global-set-key [(control +)] 'increase-default-face-height)
(global-set-key [(control -)] 'decrease-default-face-height)


-- 
"Unless there are slaves to do the ugly, horrible, uninteresting work, culture
and contemplation become almost impossible. Human slavery is wrong, insecure,
and demoralizing.  On mechanical slavery, on the slavery of the machine, the
future of the world depends." -Oscar Wilde, "The Soul of Man Under Socialism"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]