unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Subject: RE: problem passing argument to global-set-key
Date: Fri, 27 Aug 2004 14:06:18 -0700	[thread overview]
Message-ID: <FDELKNEBLPKKDCEBEJCBIEAOCHAA.drew.adams@oracle.com> (raw)
In-Reply-To: <uk6vki9wl.fsf@raytheon.com>

(global-set-key [C-M-down] (lambda () (interactive) (sk-grow-frame -1)))

 - Drew

P.S. See also http://www.emacswiki.org/cgi-bin/wiki/Shrink-Wrapping_Frames
for command resize-frame, which resizes a frame to the "right size".


-----Original Message-----
From: help-gnu-emacs-bounces+drew.adams=oracle.com@gnu.org
[mailto:help-gnu-emacs-bounces+drew.adams=oracle.com@gnu.org]On Behalf
Of Sarir Khamsi
Sent: Friday, August 27, 2004 1:50 PM
To: help-gnu-emacs@gnu.org
Subject: problem passing argument to global-set-key


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	other threads:[~2004-08-27 21:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-27 20:49 problem passing argument to global-set-key Sarir Khamsi
2004-08-27 21:06 ` Drew Adams [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FDELKNEBLPKKDCEBEJCBIEAOCHAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).