unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* problem passing argument to global-set-key
@ 2004-08-27 20:49 Sarir Khamsi
  2004-08-27 21:06 ` Drew Adams
  0 siblings, 1 reply; 2+ messages in thread
From: Sarir Khamsi @ 2004-08-27 20:49 UTC (permalink / raw)


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

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

end of thread, other threads:[~2004-08-27 21:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-27 20:49 problem passing argument to global-set-key Sarir Khamsi
2004-08-27 21:06 ` Drew Adams

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).