Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: how do I save a region to file?

10 views
Skip to first unread message

Phaustus

unread,
Nov 11, 2010, 1:16:22 PM11/11/10
to help-gn...@gnu.org

Hi,

I would just like to know the shortest key sequence that can be
used to save the currently-selected region to a file.  A bit like C-x i,
except in reverse.

Thanks,

Ph


Drew Adams

unread,
Nov 11, 2010, 5:51:07 PM11/11/10
to Phaustus, help-gn...@gnu.org
> I would just like to know the shortest key sequence that can be
> used to save the currently-selected region to a file.

M-x write-region.

(M-x apropos is your friend.)

Stefan Monnier

unread,
Nov 11, 2010, 6:29:25 PM11/11/10
to
> I would just like to know the shortest key sequence that can be
> used to save the currently-selected region to a file. A bit like C-x i,
> except in reverse.

M-x wr-r RET


Stefan "who actually has code that finds this for you"

rustom

unread,
Nov 11, 2010, 8:04:22 PM11/11/10
to

Some new kind of completion here - whats the hyphen?

Rusi "who after 20 years emacs usage remains a noob"

Message has been deleted

Maindoor

unread,
Nov 12, 2010, 1:02:31 AM11/12/10
to help-gn...@gnu.org
Hi,
I've been using emacs-snapshot for a while for anti-aliasing support.
But now since emacs itself supports anti-aliasing fonts, I'm now
left with a dilemma, which one to use.
So next I went to find proof of which is latest and bleeding edge.
and saw the version. emacs-snapshot is of course the
latest(23.1.50.1)
but uses the old GTK+ (2.18.0) version. The emacs package
version is older (23.1.1) but uses a newer GTK+ (2.20.0) version.
Can someone provide the pros and cons of each and which
one might be better to use ?

Thanks.

Pascal J. Bourguignon

unread,
Nov 12, 2010, 7:33:11 AM11/12/10
to
rustom <rusto...@gmail.com> writes:

> On Nov 12, 4:29 am, Stefan Monnier <monn...@iro.umontreal.ca> wrote:
>> > I would just like to know the shortest key sequence that can be
>> > used to save the currently-selected region to a file.  A bit like C-x i,
>> > except in reverse.
>>
>> M-x wr-r RET
>>
>>         Stefan "who actually has code that finds this for you"
>
> Some new kind of completion here - whats the hyphen?

Yes, emacs-23 completion has been improved, and it's very nice.


> Rusi "who after 20 years emacs usage remains a noob"

The target is big, but it's moving fast! :-)

--
__Pascal Bourguignon__ http://www.informatimago.com/
A bad day in () is better than a good day in {}.

Pascal J. Bourguignon

unread,
Nov 12, 2010, 7:34:03 AM11/12/10
to
"Drew Adams" <drew....@oracle.com> writes:

>> I would just like to know the shortest key sequence that can be
>> used to save the currently-selected region to a file.
>
> M-x write-region.

You lose, he asked for the shortest key sequence.

> (M-x apropos is your friend.)

Unfortunately, they're not documented ;-)

Pascal J. Bourguignon

unread,
Nov 12, 2010, 7:35:03 AM11/12/10
to
Maindoor <sanjee...@yahoo.com> writes:

Depends on your usage pattern. Why not try them and see for yourself
which you prefer.

In my case, I compile my emacs myself. Do you want my compile-emacs
script?

Stefan Monnier

unread,
Nov 12, 2010, 12:18:52 PM11/12/10
to
> So next I went to find proof of which is latest and bleeding edge.
> and saw the version. emacs-snapshot is of course the
> latest(23.1.50.1)
> but uses the old GTK+ (2.18.0) version. The emacs package
> version is older (23.1.1) but uses a newer GTK+ (2.20.0) version.

Not sure which "emacs-snapshot" package this is: 23.1.50 is very old
for a snapshot (it predates 23.2 which was released early 2010).
I'd expect an "emacs-snapshot" to be "24.0.50" nowadays.

We (Emacs maintainers) strongly discourage people from using old
snapshots (snapshots tend to have more bugs, so it's great if people use
them to try and help us fix bugs before the release, but using an old
snapshot is a wasted effort since the bugs may have been fixed already).


Stefan

Nerius Landys

unread,
Nov 12, 2010, 1:58:14 PM11/12/10
to Maindoor, help-gn...@gnu.org
I use emacs23-nox.  It runs in a terminal, but you get the antialiasing from the terminal it's running in.
I actually find the full emacs GUI to be very annoying.

On Thu, Nov 11, 2010 at 10:02 PM, Maindoor <sanjee...@yahoo.com> wrote:
Hi,
I've been using emacs-snapshot for a while for anti-aliasing support.
But now since emacs itself supports anti-aliasing fonts, I'm now
left with a dilemma, which one to use.
So next I went to find proof of which is latest and bleeding edge.
and saw the version. emacs-snapshot is of course the
latest(23.1.50.1)
but uses the old GTK+ (2.18.0) version. The emacs package
version is older (23.1.1) but uses a newer GTK+ (2.20.0) version.
Can someone provide the pros and cons of each and which
one might be better to use ?

Thanks.


Elena

unread,
Nov 12, 2010, 2:02:24 PM11/12/10
to
On Nov 12, 1:35 pm, p...@informatimago.com (Pascal J. Bourguignon)
wrote:

> In my case, I compile my emacs myself.  Do you want my compile-emacs
> script?

Does such script perform anything besides setting some ./configure
options? If so, I'd like to see it. Thanks.

Dmitriy Igrishin

unread,
Nov 12, 2010, 5:58:21 PM11/12/10
to Nerius Landys, help-gn...@gnu.org
Hey all,

I use 23.2 compiled by myself. Works just fine.

2010/11/12 Nerius Landys <nla...@gmail.com>



--
// Dmitriy.


rustom

unread,
Nov 13, 2010, 3:54:15 AM11/13/10
to
On Nov 12, 11:58 pm, Nerius Landys <nlan...@gmail.com> wrote:
> I use emacs23-nox.  It runs in a terminal, but you get the antialiasing from
> the terminal it's running in.
> I actually find the full emacs GUI to be very annoying.

I have the following in my init that reduces the annoyances

(scroll-bar-mode 0)
(tool-bar-mode 0)
(setq inhibit-startup-message t)
(setq initial-scratch-message nil)

You can even add: (menu-bar-bode 0) if you want it more bare

Tyler Smith

unread,
Nov 13, 2010, 9:34:19 AM11/13/10
to help-gn...@gnu.org
Maindoor <sanjee...@yahoo.com> writes:

> |But now since emacs itself supports anti-aliasing fonts, I'm now |
> |left with a dilemma, which one to use. |
> |So next I went to find proof of which is latest and bleeding edge. |
> |and saw the version. emacs-snapshot is of course the |
> |latest(23.1.50.1) |
> |but uses the old GTK+ (2.18.0) version. The emacs package |
> |version is older (23.1.1) but uses a newer GTK+ (2.20.0) version. |
> |Can someone provide the pros and cons of each and which |
> |one might be better to use ? |


The difference between 23.1.50.1 and 23.1.1 are unlikely to be
noticeable to you unless you already have a specific problem with
23.1.1. Similarly, I don't think you'd notice any difference between
GTK+ 2.18.0 and 2.20.0. Just pick one.

If you are really concerned about using the bleeding edge, you can get
the latest development version here:

http://savannah.gnu.org/projects/emacs/

It's not too difficult to compile it from source yourself, and it seems
to work just fine. The latest version is somewhere beyond 24.0.50.1 (I
haven't updated in a few weeks).

Cheers,

Tyler


Tyler Smith

unread,
Nov 13, 2010, 9:35:38 AM11/13/10
to help-gn...@gnu.org
Nerius Landys <nla...@gmail.com> writes:

> I use emacs23-nox.  It runs in a terminal, but you get the
> antialiasing from the terminal it's running in.
> I actually find the full emacs GUI to be very annoying.


If you don't like the GUI features of the GTK emacs, you can turn them
off. I have the following in my .emacs:

(menu-bar-mode -1)
(fringe-mode 1)

and I've disabled the toolbar-mode and scroll-bar-mode using the
customize-variable stuff. This gets rid of all the GUI distractions, but
you can still use the alt/meta key, which is tricky to do with emacs-nox
(at least it was tricky to me last time I tried to do so).

Tyler

Tim X

unread,
Nov 14, 2010, 10:43:24 PM11/14/10
to
Maindoor <sanjee...@yahoo.com> writes:

> +---------------------------------------------------------------------+

> +---------------------------------------------------------------------+
>

I'm finding emacs support under Ubuntu is beginning to fall behind. For
example, the latest Ubuntu comes with emacs 23.1, but 23.2 has been out
for months. The emacs-snapshot package is also very old and no where
near the latest.

I add the emacs lisp ppa to my sources and that gets me 23.2

I've also used some of the other PPA's that have more recent emacs
snapshot packages. However, I've found the best solution is to build
from bzr sources. To keep integration with the Ubuntu/Debian emacs
infrastructure, so that I can still use deb packages of some emacs lisp
add-ons, it is necessary to make some changes to the emacs bzr sources.

The minimum change you need to make is to update the lisp/startup.el
file. You need to add a variable called debian-emacs-flavor and set it
to something like emacs-snapshot and you need to make some modifications
further down in that file to add some load paths. Probably the easiest
way to work all this out is

1. Install emacs-snapshot package

2. Do a diff between the startup.el file from that package and the one
which comes from the bzr sources. Yolu will see the obvious diffeences
you need to add to the bzr version of that file.

3. Do a normal configure and make bootstrap to compile and build from
sources

4. (Optional) Install in /usr/local. Remove the site-lisp directory the
installation process creates in /usr/local/share/emacs/24.0.50 and
replace it with a symbolic link the /usr/share/emacs-snapshot/site-lisp

Then your all set. You may want to make modifications to the
/etc/alternatives stuff so that the command emacs runs your version.
Note that most of the changes made above only need to be done once. (you
may need to re-do the symlink if emacs bzr version increases/changes its
version number i.e. to 24.0.90 or 24.1.0 or whatever.). It is also
possible that there may be some changes in the bzr startup.el file that
bzr cannot automaticalloy merge into your modified one. However, this is
very rare and when it has happened to me, the fix has been trivial.

With this setup, you can now run the Official ubuntu version, the
emacs-snapshot version or your version from the head of the bzr
repository. I find this useful because when you are running the latest
dev sources, there can be short periods of instability and its useful to
be able to revert back to running an older stable version until the bzr
sources get fixed.

Tim

--
tcross (at) rapttech dot com dot au

Drew Adams

unread,
Dec 9, 2010, 10:58:12 PM12/9/10
to Phaustus, help-gn...@gnu.org
> I would just like to know the shortest key sequence that can be
> used to save the currently-selected region to a file.

Answer: The shortest key sequence that you want to sacrifice to `write-region'.

Personally, I use a command `region-to-file', which does `write-region' or, with
a prefix arg, `append-to-file'. I bind it to `C-x M-f' (which doesn't win
awards for shortness, but is fine for a command I don't use super often). It's
here: http://www.emacswiki.org/emacs/misc-cmds.el.

Kevin Rodgers

unread,
Dec 14, 2010, 11:34:07 PM12/14/10
to help-gn...@gnu.org
On 11/13/10 7:35 AM, Tyler Smith wrote:
> If you don't like the GUI features of the GTK emacs, you can turn them
> off. I have the following in my .emacs:
>
> (menu-bar-mode -1)
> (fringe-mode 1)
>
> and I've disabled the toolbar-mode and scroll-bar-mode using the
> customize-variable stuff. This gets rid of all the GUI distractions, but
> you can still use the alt/meta key, which is tricky to do with emacs-nox
> (at least it was tricky to me last time I tried to do so).

From etc/PROBLEMS:

... you might also want to consider
switching off scroll bars, menu bar, and tool bar. Adding the
following forms to your .emacs file will accomplish that, but only
after the the initial frame is displayed:

(scroll-bar-mode -1)
(menu-bar-mode -1)
(tool-bar-mode -1)

For still quicker startup, put these X resources in your .Xdefaults
file:

Emacs.verticalScrollBars: off
Emacs.menuBar: off
Emacs.toolBar: off

But I haven't been able to find out how to turn off fringe mode via X
resources -- is that a missing feature or a documentation bug?

--
Kevin Rodgers
Denver, Colorado, USA


0 new messages