hi This is my first post here, so I hope this is the right place for asking beginner questions.
My question is simple: When I list some files in dired mode I select one file to edit. Now how can I close this file and go back to dired without closing emacs?
Ben Aurel <ben.au...@gmail.com> writes: > My question is simple: When I list some files in dired mode I select one > file to edit. Now how can I close this file and go back to dired without > closing emacs?
Don't think in terms of "file". When editing a "file", you really edit a buffer* containing the content of the file. To "close" the file generally means to save the buffer and to kill the buffer.
If you just want to "go back" to dired, you just need to switch back to the buffer containing the directory listing: C-x b RET
If you want to "close the file", then first save the buffer with C-x C-s then kill the buffer with C-x k RET and you should be back to the buffer containing the directory listing.
HTH,
* Press `C-x C-e' after the closing parenthesis to jump to the info page describing the concept of "buffer" inside GNU Emacs:
On Jul 21, 11:59 am, Ben Aurel <ben.au...@gmail.com> wrote:
> hi > This is my first post here, so I hope this is the right place for asking > beginner questions.
> My question is simple: When I list some files in dired mode I select one > file to edit. Now how can I close this file and go back to dired without > closing emacs?
To close the file, use the menu “File‣Close”. Emacs doesn't have a keyboard shortcut for this due the fact that emacs has build on the 1980's mindset and havn't modernized. But you can add one by putting the following in your emacs preference file. (the file at “~/.emacs”):
(global-set-key (kbd "C-w") 'kill-this-buffer) ; close
This will let you press Ctrl+w to close the current file.
To switch to files or directories you have opened before, you can use the menu “Buffers”. The “buffer” is term used in the 1980s. Today you just call it “Tabs” or “workspace”.
So, for example, to switch to the previous tab, press Ctrl+x Ctrl+←. (this is in the graphical menu Buffers too.)
I don't think its a good idea to teach or insist that people adopt emacs's terminologies.
In particular, the term buffer is unsuitable and outdated. See the following argument:
----------------------------
Q: The Terminology “buffer” and “keybinding” is good as they are.
A: The terminology “buffer” or “keybinding”, are technical terms having to do with software programing. The term “keybinding” refers to the association of a keystroke with a command in a technical, software application programing context. That is to say, a programer “bind” a keystroke event to a command in a software application. The term “buffer” refers to a abstract, temporary area for storing data, in the context of programing or computer science.
These terms are irrelevant to the users of a software application.
As a user of a text editor, he works with files. The terms “opened file” or “untitled file” are more appropriate than “buffer”. Since emacs is also used for many things beside reading files or writing to files, for example, file management, ftp/sftp, shell, email, irc etc., the proper term can be “panel”, “window”, or “work area”. (All modern editors and IDEs use these terms, even though they are all buffers too)
And, the term “keyboard shortcut” refers to typing of a key- combination to activate a command. It is also more appropriate than “binding” or “keybinding”.
Although concepts like “buffer” and “keybinding” are seemingly interchangeable with “panel” or “keyboard shortcut”, but their contexts set them apart. This is why in all modern software application's user documentations, terms like “buffer” or “keybinding” are not to be seen but “windows, panes, tabs, workspace, and keyboard shortcuts”.
The reason emacs uses the technical terminologies throughout is because when emacs started in the 1980s, there really isn't any other text editors or even software applications. And, emacs users are all computer scientists and programers.
Note that Emacs does officially recognize the term Keyboard Shortcut. The following is a excerpt from glossary section of the official emacs manual from emacs 22:
Keyboard Shortcut A keyboard shortcut is a key sequence (q.v.) which invokes a command. What some programs call "assigning a keyboard shortcut," Emacs calls "binding a key sequence." See `binding.'
> Ben Aurel <ben.au...@gmail.com> writes: > > My question is simple: When I list some files in dired mode I select one > > file to edit. Now how can I close this file and go back to dired without > > closing emacs?
> Don't think in terms of "file". When editing a "file", you really edit > a buffer* containing the content of the file. To "close" the file > generally means to save the buffer and to kill the buffer.
> If you just want to "go back" to dired, you just need to switch back to > the buffer containing the directory listing: C-x b RET
> If you want to "close the file", then first save the buffer with C-x C-s > then kill the buffer with C-x k RET and you should be back to the buffer > containing the directory listing.
> HTH,
> * Press `C-x C-e' after the closing parenthesis to jump to the info page > describing the concept of "buffer" inside GNU Emacs:
Ben Aurel <ben.au...@gmail.com> writes: > My question is simple: When I list some files in dired mode I select one > file to edit. Now how can I close this file and go back to dired without > closing emacs?
C-x k RET
is one way.
[Don't pay too much attention to xahlee about keybindings -- he's ... kinda nuts on that issue...]
Xah <xah...@gmail.com> writes: > On Jul 21, 11:59 am, Ben Aurel <ben.au...@gmail.com> wrote: >> hi >> This is my first post here, so I hope this is the right place for asking >> beginner questions.
>> My question is simple: When I list some files in dired mode I select one >> file to edit. Now how can I close this file and go back to dired without >> closing emacs?
> To close the file, use the menu “File‣Close”. Emacs doesn't have a > keyboard shortcut for this due the fact that emacs has build on the > 1980's mindset and havn't modernized.
Or because the concept of "File" is not as central as the concept of "buffer". It is not a question of being modern or not. In the 1980's the notion of "file" already existed, and today, projects like OLPC are putting it aside.
> (global-set-key (kbd "C-w") 'kill-this-buffer) ; close
Please don't suggest this.
`C-w' is for `kill-region' which is fundamental - see the manual
(info "(emacs)Killing")
When you're answering questions about Emacs, better to refer to the manual as much as possible. At least more than your own tutorials, which can give a biaised view about Emacs.
> The “buffer” is term used in the 1980s. Today you > just call it “Tabs” or “workspace”.
Huh?
The notion of "buffer" might be emacs specific, but it's not 1980's. The OP is asking about Emacs, not your own science fiction.
> In particular, the term buffer is unsuitable and outdated. See the > following argument:
> ----------------------------
> Q: The Terminology “buffer” and “keybinding” is good as they are.
> A: > The terminology “buffer” or “keybinding”, are technical terms having > to do with software programing. The term “keybinding” refers to the > association of a keystroke with a command in a technical, software > application programing context. That is to say, a programer “bind” a > keystroke event to a command in a software application. The term > “buffer” refers to a abstract, temporary area for storing data, in the > context of programing or computer science.
> These terms are irrelevant to the users of a software application.
Blatant assertion I disagree with completely.
> As a user of a text editor, he works with files.
Blatant assertion I disagree with completely. As a user of a text editor, I work with text. And I want it neatly buffered for me. I may occasionally load some of the text from a file, and I may occasionally save some of the text to a file, but the majority of the buffers that I use never undergo either.
[SNIP - stuff I presume is either predicated upon your prior unacceptable assertions, or introducing new ones.]
Phil -- Dear aunt, let's set so double the killer delete select all. -- Microsoft voice recognition live demonstration
Xah wrote: > (global-set-key (kbd "C-w") 'kill-this-buffer) ; close
> This will let you press Ctrl+w to close the current file.
PS i forgot to mention, that Ctrl+w is emacs default shortcut to copy text. So, if you set Close to Ctrl+w, then you should find another key for Copy. You can set emacs to Copy by Ctrl+c, by going to the menu “Options‣C-x/C-c/C-v Cut and Paste (CUA)”, Then use menu “Options‣Save Options”.
On Tue, Jul 22, 2008 at 10:23, Bastien Guerry <b...@altern.org> wrote: > Or because the concept of "File" is not as central as the concept of > "buffer".
But Xah Lee is not arguing against the concept. He is arguing against the terminology...
> The notion of "buffer" might be emacs specific, but it's not 1980's.
I don't think the notion of "buffer" is Emacs specific; as Xah Lee has said, in other environments (editors, IDEs, etc.) they exist, it's just that they exist under a different name ("workspace" being a nice alternative).
<thefatphil_demun...@yahoo.co.uk> wrote: > Xah <xah...@gmail.com> writes: >> These terms are irrelevant to the users of a software application.
> Blatant assertion I disagree with completely.
In which way the use of terms like "keybinding" or "buffer" is relevant to the *users* of a software application?
>> As a user of a text editor, he works with files.
> Blatant assertion I disagree with completely. As a user of a text > editor, I work with text. And I want it neatly buffered for me. > I may occasionally load some of the text from a file, and I may > occasionally save some of the text to a file, but the majority > of the buffers that I use never undergo either.
It is true that the user of a text editor works with text. It is also true, I think, that most text is saved to a file, though nowadays I suppose there's also a fair amount that is cut&paste'd into another application, a web form, etc.
Emacs is not a text editor (exclusively): from eshell to dired to BBDB to Gnus, many things can be done that do not match the text editor profile; and for those, certainly many buffers are used that do not correspond to a file in the filesystem. But I think it would be hard to argue that, in its use as a *text editor*, common users have a majority of buffers which are not associated to (and saved into) a file at one point or another...
On Tue, Jul 22, 2008 at 10:26, Bastien Guerry <b...@altern.org> wrote: > Adopting Emacs terminology is not good per se, it's good because it > helps people adopt Emacs.
Adapting Emacs terminology to current conventions would perhaps be good for the very same reason.
I'm not for or against changing Emacs' terminology. I think it would be a huge amount of work. But I don't understand why some people reacts as if the very idea is flawed. There's nothing sacred in "buffer" and "keybinding" and "minibuffer", just history. The change should be susceptible to rational (if perhaps a bit pointless) discussion, because it is not hard to find good arguments for it; "frame/window" vs "window/pane" is a good example.
"Juanma Barranquero" <lek...@gmail.com> writes: > On Tue, Jul 22, 2008 at 11:46, Phil Carmody > <thefatphil_demun...@yahoo.co.uk> wrote: >> Xah <xah...@gmail.com> writes:
>>> These terms are irrelevant to the users of a software application.
>> Blatant assertion I disagree with completely.
> In which way the use of terms like "keybinding" or "buffer" is > relevant to the *users* of a software application?
I, as a user of the software application called "emacs" must be familiar with that functions are bound to what keys in order to use that software application.
For buffers, see below.
I'd have thought the above response would have been so bloody obvious that I'm amazed you even bothered asking the question. The only way I can see you not expecting such a response is if you are of the opinion that I am not a user of emacs, or that you think emacs is not a software application. Either of which is equally bizarre.
>>> As a user of a text editor, he works with files.
>> Blatant assertion I disagree with completely. As a user of a text >> editor, I work with text. And I want it neatly buffered for me. >> I may occasionally load some of the text from a file, and I may >> occasionally save some of the text to a file, but the majority >> of the buffers that I use never undergo either.
> It is true that the user of a text editor works with text. It is also > true, I think, that most text is saved to a file, though nowadays I > suppose there's also a fair amount that is cut&paste'd into another > application, a web form, etc.
An absolute assertion is false as soon as one counter-example is found. An absolute assertion was made. I provided a counter- example. The assertion is therefore false. End of.
Phil -- Dear aunt, let's set so double the killer delete select all. -- Microsoft voice recognition live demonstration
On Tue, Jul 22, 2008 at 13:50, Juanma <juanma_bellon> wrote: > And why should "shortcut" be more fitting than "keybinding"?
I don't know. I'm not even defending the idea that "shortcut" is more fitting. If anything, I'm defending the idea that "keybinding" is not very good, not because of any intrinsic quality or defect of the term "keybinding", just because it is a bit too specifically emacsy for something that many other programs allow, under a different name. The best name is the one the users understand more easily (whichever it may be).
> Emacs does lots more than text editing, and the term > "buffer" fits fine for all the tasks, where term "file" doesn not.
The term "workspace" fits even better, don't you think? And, what does think the average user who does intuitively know (I believe) what a "work space" could be, but not necessarily what a "buffer" is?
> That is called "loosing generality", at least in Spanish, which you > know.
In my Castilian Spanish it'd be more like "perder generalidad", but I get your meaning ;-)
> You say that there are only historical reasons for sticking to Emacs > terminology.
Sorry, but no, I didn't say that. I said:
> There's nothing sacred in > "buffer" and "keybinding" and "minibuffer", just history.
Of course there are at least two reasons, other than history, to stick with the statu quo: lack of resources, and existing users' resistance. :)
I get the feeling that if Emacs had used "shortcut" and "workspace" since the beginning of (Emacs) times, and the current trend were to use "keybinding" and "buffer", some old Emacs hands would react against the idea of change the very same way they do now.
> It's > all about considering that users (and in particular a user able to deal with > Emacs: this is not Notepad, ok?) can't deal with remembering what "buffer" > means, which is nonsense.
Sorry, I don't buy that argument. Of course adopting a commonly used terminology would help those that are not yet "able to deal with Emacs". Standards (like the CUA C-x/C-c/C-v keyb... shortc... whatevers) exist for a reason.
Alternatively, you can use quit-window that allow to quit window without killing buffer (with arg t, it will quit and kill buffer)
,----[ C-h f quit-window RET ] | quit-window is an interactive compiled Lisp function in `window.el'. | | | (quit-window &optional kill window) | | Quit the current buffer. Bury it, and maybe delete the selected frame. | (The frame is deleted if it contains a dedicated window for the buffer.) | With a prefix argument, kill the buffer instead. | | Noninteractively, if kill is non-nil, then kill the current buffer, | otherwise bury it. | | If window is non-nil, it specifies a window; we delete that window, | and the buffer that is killed or buried is the one in that window. | | [back] `----
> closes a file. to switch between files you can use ibuffer
> M-x ibuffer or you can bound it to a key.
> (define-key global-map [(meta \])] 'ibuffer)
-- A + Thierry Volpiatto Location: Saint-Cyr-Sur-Mer - France
"Juanma Barranquero" <lek...@gmail.com> writes: >> And why should "shortcut" be more fitting than "keybinding"?
> I don't know. I'm not even defending the idea that "shortcut" is more > fitting. If anything, I'm defending the idea that "keybinding" is not > very good, not because of any intrinsic quality or defect of the term > "keybinding"
It's not that "keybinding" is somehow extra good, it's that "shortcut" is unusually bad.
The name "shortcut" in most apps carries the implication that it's somehow an unusual method of invoking something, which is only used in rare circumstances for the absolute most heavily used commands (in these apps, the "usual" method is a menu entry). This is not true in emacs -- keybindings are heavily used, and are "normal".
-Miles
-- Yo mama's so fat when she gets on an elevator it HAS to go down.
Xah <xah...@gmail.com> wrote: > I don't think its a good idea to teach or insist that people adopt > emacs's terminologies.
I don't think its a good idea to teach or insist that people learn French before going to Paris. French is a language that has been adopted by France in the 1530s when there really weren't any other other languages around, except big mainframe languages like Latin. In the 20th century English developed as a
> The reason emacs uses the technical terminologies throughout is > because when emacs started in the 1980s, there really isn't any other > text editors or even software applications. And, emacs users are all > computer scientists and programers.
I think it's a ridiculous idea to teach someone English before going to Paris. Of course English is spoken pretty much everywhere in the world, and it would arguably easier to stay in Paris if the
> In particular, the term buffer is unsuitable and outdated. See the > following argument:
> ----------------------------
> Q: The Terminology “buffer” and “keybinding” is good as they are.
> A: > The terminology “buffer” or “keybinding”, are technical terms having > to do with software programing. The term “keybinding” refers to the > association of a keystroke with a command in a technical, software > application programing context. That is to say, a programer “bind” a > keystroke event to a command in a software application. The term > “buffer” refers to a abstract, temporary area for storing data, in the > context of programing or computer science.
> These terms are irrelevant to the users of a software application.
> As a user of a text editor, he works with files. The terms “opened > file” or “untitled file” are more appropriate than “buffer”. Since > emacs is also used for many things beside reading files or writing to > files, for example, file management, ftp/sftp, shell, email, irc etc., > the proper term can be “panel”, “window”, or “work area”. (All modern > editors and IDEs use these terms, even though they are all buffers > too)
> And, the term “keyboard shortcut” refers to typing of a key- > combination to activate a command. It is also more appropriate than > “binding” or “keybinding”.
> Although concepts like “buffer” and “keybinding” are seemingly > interchangeable with “panel” or “keyboard shortcut”, but their > contexts set them apart. This is why in all modern software > application's user documentations, terms like “buffer” or “keybinding” > are not to be seen but “windows, panes, tabs, workspace, and keyboard > shortcuts”.
> The reason emacs uses the technical terminologies throughout is > because when emacs started in the 1980s, there really isn't any other > text editors or even software applications. And, emacs users are all > computer scientists and programers.
> Note that Emacs does officially recognize the term Keyboard Shortcut. > The following is a excerpt from glossary section of the official emacs > manual from emacs 22:
> Keyboard Shortcut > A keyboard shortcut is a key sequence (q.v.) which invokes a > command. What some programs call "assigning a keyboard shortcut," > Emacs calls "binding a key sequence." See `binding.'
> On Jul 21, 4:21 pm, Bastien <b...@altern.org> wrote: >> Ben Aurel <ben.au...@gmail.com> writes: >> > My question is simple: When I list some files in dired mode I select one >> > file to edit. Now how can I close this file and go back to dired without >> > closing emacs?
>> Don't think in terms of "file". When editing a "file", you really edit >> a buffer* containing the content of the file. To "close" the file >> generally means to save the buffer and to kill the buffer.
>> If you just want to "go back" to dired, you just need to switch back to >> the buffer containing the directory listing: C-x b RET
>> If you want to "close the file", then first save the buffer with C-x C-s >> then kill the buffer with C-x k RET and you should be back to the buffer >> containing the directory listing.
>> HTH,
>> * Press `C-x C-e' after the closing parenthesis to jump to the info page >> describing the concept of "buffer" inside GNU Emacs:
Miles Bader wrote: > "Juanma Barranquero" <lek...@gmail.com> writes: >>> And why should "shortcut" be more fitting than "keybinding"? >> I don't know. I'm not even defending the idea that "shortcut" is more >> fitting. If anything, I'm defending the idea that "keybinding" is not >> very good, not because of any intrinsic quality or defect of the term >> "keybinding"
> It's not that "keybinding" is somehow extra good, it's that "shortcut" > is unusually bad.
> The name "shortcut" in most apps carries the implication that it's > somehow an unusual method of invoking something, which is only used in > rare circumstances for the absolute most heavily used commands (in these > apps, the "usual" method is a menu entry). This is not true in emacs -- > keybindings are heavily used, and are "normal".
Yes, the definition of "key binding" in Emacs is in itself quite good, but that does not help new users that are used to the word "shortcut" for similar things in other programs.
My attempted witty answer is somewhat diminished by an accidental premature sending. :)
Xah <xah...@gmail.com> wrote: > I don't think its a good idea to teach or insist that people adopt > emacs's terminologies.
I don't think its a good idea to teach or insist that people learn French before going to Paris. French is a language that has been adopted by France in the 1530s when there really weren't any other other languages around, except big mainframe languages like Latin. In the 20th century English developed as a lingua franca, yet the French failed to modernize. They use technical terms that don't make sense to the non-linguist, like ^Ile de France. It can't even be spelled by a modern-language system.
So, whenever friends of mine visit Paris, give them my favorite English phrases book, so they'll get by. Teaching them words like "oui" would only encourage the French...
Now seriously, Xah. You've posted that link to your website a lot recently. And usually I don't mind, because it was at least somewhat relevant. But there is a place for discussing enhancements to Emacs. Beginner's questions aren't it. They don't even have an interest in modernizing Emacs, because they could just as well start using a "modern" editor in the first place. And those of us who used Emacs long enough are apparently not bothered too much by the terminology to change it. There's no need to bring it up again and again.
>> It's not that "keybinding" is somehow extra good, it's that "shortcut" >> is unusually bad.
>> The name "shortcut" in most apps carries the implication that it's >> somehow an unusual method of invoking something, which is only used in >> rare circumstances for the absolute most heavily used commands (in these >> apps, the "usual" method is a menu entry). This is not true in emacs -- >> keybindings are heavily used, and are "normal".
> Yes, the definition of "key binding" in Emacs is in itself quite good, > but that does not help new users that are used to the word "shortcut" > for similar things in other programs.
> At least it did not help me.
Of course the term shortcuts is something reminiscent of GUI programs. In a text editor menu entries like `compile' might have a shortcut, but calling C-b a shortcut seems weird.
I don't think there even has to be a name for it ... Help says: "It is bound to C-b, <left>.", which sounds reasonable. So what problems could a new user have? I can think only of one: Finding out _how_ to configure the keys.
I just took a look at Eclipse (because that happened to be installed) and it doesn't talk about shortcuts in the preferences, either. It just has a table with "command" and "key sequence" on a page called "Keys", yet its easy to find, because it's in a central place.
Maybe custom should support keymaps, and M-x customize-keys could solve that problem...
On Tue, Jul 22, 2008 at 02:14:20PM +0200, Juanma Barranquero wrote: > On Tue, Jul 22, 2008 at 13:50, Juanma <juanma_bellon> wrote:
> > And why should "shortcut" be more fitting than "keybinding"?
> I don't know. I'm not even defending the idea that "shortcut" is more > fitting. If anything, I'm defending the idea that "keybinding" is not > very good, not because of any intrinsic quality or defect of the term > "keybinding", just because it is a bit too specifically emacsy for > something that many other programs allow, under a different name. The > best name is the one the users understand more easily (whichever it > may be).
Oh, I don't think I agree with that sort of lowest-common-denominator linguistic relativism at all! That sort of attitude, combined with neutral drift over time will result in a terrible, ugly, language with no accuracy or etymological coherency whatsoever!
Nikolaj Schumacher wrote: > Of course the term shortcuts is something reminiscent of GUI programs. > In a text editor menu entries like `compile' might have a shortcut, but > calling C-b a shortcut seems weird.
Maybe, but having manual entries in the index for "Shortcut" and "Key Sequence" would perhaps help a little bit.
> I don't think there even has to be a name for it ... Help says: "It is > bound to C-b, <left>.", which sounds reasonable. So what problems could > a new user have?
My imagination and experience says me that they could have trouble searching for things because of the terminology ;-)
> Maybe custom should support keymaps, and M-x customize-keys could solve > that problem...
<thefatphil_demun...@yahoo.co.uk> wrote: > I, as a user of the software application called "emacs" > must be familiar with that functions are bound to what > keys in order to use that software application.
Which is *absolutely* unrelated to whether that relationship between keystroke and function can be found in the manual and documentation under "keybinding" or "shortcut" or "key assignment" or any other name. Which is what was being discussed.
> An absolute assertion is false as soon as one counter-example > is found. An absolute assertion was made. I provided a counter- > example.
On Tue, Jul 22, 2008 at 14:34, Miles Bader <miles.ba...@necel.com> wrote: > It's not that "keybinding" is somehow extra good, it's that "shortcut" > is unusually bad.
Agreed. I don't like Xah Lee's proposals. But I think that he's right that Emacs' use of outdated terminology sometimes hampers adoption by new users.