help-gnu-emacs
[Top][All Lists]
Advanced

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

problem passing argument to global-set-key


From: Sarir Khamsi
Subject: problem passing argument to global-set-key
Date: Fri, 27 Aug 2004 13:49:30 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt)

I am trying to write a function that will grow or shrink a frame
using:

(defun sk-grow-frame (&optional n)
  "Grow or shrink the current frame."
  (interactive "p")
  (let ((my-arg n))
    (message (format "%d" my-arg)) ; some debug
    (set-frame-height nil (+ (screen-height) my-arg))))

and assigning it to some keys with:

(global-set-key (quote [C-M-up]) (quote sk-grow-frame))
(global-set-key (quote [C-M-down]) (quote sk-grow-frame -1))

The first keyboard shortcut works, ie, growing the frame by one, but
the second does not...it still increases the frame by one (instead of
decreasing it, which is what I want). What am I missing? I'm sure it's
something simple. Thanks.

Sarir


reply via email to

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