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

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

RE: Question about backup files


From: Bingham, Jay
Subject: RE: Question about backup files
Date: Tue, 1 Oct 2002 12:07:58 -0500

Ben,

The lisp reference manual will answer many questions of this type.  If you do 
not have a copy installed on your system you can find a copy on the web.
The lisp reference manual for emacs 21.2 is at: 
http://www.gnu.org/manual/elisp-manual-21-2.8/html_mono/elisp.html 
The lisp reference manual for emacs 20.3 is at: 
http://www.gnu.org/manual/elisp-manual-20-2.5/html_mono/elisp.html

The answer to your question can be found in the section on 'prefix command 
arguments'.

Briefly here is what it says:  The default prefix argument is 1, each time that 
C-u is pressed the current prefix arg value is multiplied 4.  Therefore for the 
first C-u the arg value is 4, for the next it becomes 16, for the next 64 and 
so on.

-_
J_)
C_)ingham
.    HP - NonStop Austin Software & Services - Software Product Assurance
.    Austin, TX
. Language is the apparel in which your thoughts parade in public.
. Never clothe them in vulgar and shoddy attire.          -Dr. George W. Crane-

 -----Original Message-----
From:   Ben Key [mailto:BenK@FreedomScientific.com] 
Sent:   Tuesday, October 01, 2002 10:04 AM
To:     Bingham, Jay
Subject:        RE: Question about backup files

Thanks for your response.  How can I figure out what arguments are passed to
save-buffer when multiple C-u are typed?

-----Original Message-----
From: Bingham, Jay [mailto:Jay.Bingham@hp.com]
Sent: Tuesday, October 01, 2002 10:27 AM
To: Ben Key
Subject: RE: Question about backup files


Ben,

In emacs, all (well most things) are possible depending on how much effort
you want to expend to make it happen.

What the C-u does is pass a numeric argument to the function.  I am not
certain what gets passed  when multiple C-u are typed.  It is obvious that
it either causes a different numeric value or a different number of
arguments of the same value to be passed in each case.  The best way to find
out is to go look at the lisp for the command save-buffer which is an
interactive compiled Lisp function in `files.el'.  The argument list for
this command is (save-buffer &optional ARGS).

Once you know what to pass then you can write your own function that calls
save-buffer with the appropriate arguments and assign it to your key
sequence.  You may have to replicate some of the code that gets the name of
the buffer to save.

Good luck
-_
J_)
C_)ingham
.    HP - NonStop Austin Software & Services - Software Product Assurance
.    Austin, TX
. Language is the apparel in which your thoughts parade in public.
. Never clothe them in vulgar and shoddy attire.          -Dr. George W.
Crane-

 -----Original Message-----
From:   Ben Key [mailto:BenK@FreedomScientific.com] 
Sent:   Tuesday, October 01, 2002 8:16 AM
To:     help-gnu-emacs@gnu.org
Subject:        Question about backup files

The following is an excerpt from the GNU Emacs manual:
  "You can also explicitly request making another backup
  file from a buffer even though it has already been saved
  at least once.  If you save the buffer with `C-u C-x C-s',
  the version thus saved will be made into a backup file
  if you save the buffer again.  `C-u C-u C-x C-s' saves the
  buffer, but first makes the previous file contents into a new
  backup file.  `C-u C-u C-u C-x C-s' does both things: it
  makes a backup from the previous contents, and arranges
  to make another from the newly saved contents if you save
  again."

My question is, is it possible to create a more simplified
keystroke assignment that implements the same behavior
as `C-u C-u C-u C-x C-s'.  For example, I would like to assign
this behavior to 'ESC C-x C-s'.


_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/help-gnu-emacs





reply via email to

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