* menu command
@ 2018-08-27 9:45 Lajos Bodnar
2018-08-27 11:21 ` tomas
0 siblings, 1 reply; 6+ messages in thread
From: Lajos Bodnar @ 2018-08-27 9:45 UTC (permalink / raw)
To: help-gnu-emacs
Hi,
I'd like to know what is the "visit new file" command in the menubar.
This command can open a filedialog ...
I tried to find it but ...
regards,
Lajos
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: menu command
2018-08-27 9:45 menu command Lajos Bodnar
@ 2018-08-27 11:21 ` tomas
2018-08-27 12:19 ` Lajos Bodnar
0 siblings, 1 reply; 6+ messages in thread
From: tomas @ 2018-08-27 11:21 UTC (permalink / raw)
To: help-gnu-emacs
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Mon, Aug 27, 2018 at 11:45:30AM +0200, Lajos Bodnar wrote:
> Hi,
> I'd like to know what is the "visit new file" command in the menubar.
> This command can open a filedialog ...
> I tried to find it but ...
I'm not sure I understand your question, but let me try :-)
"Visit new file" is there to open an existent file or to create
a new file. It is the usual way to open files in Emacs, also
bound to the key sequence C-x C-f. This is what I always use
(I don't use menus very often in Emacs).
"Open file" (just one down in the menu) will only let you open
existing files, i.e. you can't create a new one. Perhaps it is
there to prevent mistakes (e.g. by mis-typing a name) when you
expect that the file already exists.
Perhaps a way to find out such things in Emacs is C-h C-k ("describe
key"). You first type C-h C-k (i.e. <CONTROL>-h then <CONTROL>-k),
and then you click on the menu entry you are trying to understand.
Then you get a description of the function behind that menu
entry (this works also for keyboard shortcuts).
Cheers
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAluD3s4ACgkQBcgs9XrR2kZgDACaAlkhmXfr5Yfjbie6kveDPUb7
QGYAn388CvGbLcptfchQUfHn1t3j4k+9
=aAFO
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: menu command
2018-08-27 11:21 ` tomas
@ 2018-08-27 12:19 ` Lajos Bodnar
2018-08-27 13:03 ` tomas
0 siblings, 1 reply; 6+ messages in thread
From: Lajos Bodnar @ 2018-08-27 12:19 UTC (permalink / raw)
To: tomas; +Cc: help-gnu-emacs
Thanks,
I haven't found command in the "describe-key" result which open a
filedialog.
I found a description that I can open a filedialog with the getfile.exe
which is an external program ...
I created an external program to linux too but then I realized that there
is a solution in emacs when I use "visit ..." menu item.
I wouldn't like to find out this solution again ... :)
regards,
Lajos
On Mon, Aug 27, 2018 at 1:22 PM <tomas@tuxteam.de> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Mon, Aug 27, 2018 at 11:45:30AM +0200, Lajos Bodnar wrote:
> > Hi,
> > I'd like to know what is the "visit new file" command in the menubar.
> > This command can open a filedialog ...
> > I tried to find it but ...
>
> I'm not sure I understand your question, but let me try :-)
>
> "Visit new file" is there to open an existent file or to create
> a new file. It is the usual way to open files in Emacs, also
> bound to the key sequence C-x C-f. This is what I always use
> (I don't use menus very often in Emacs).
>
> "Open file" (just one down in the menu) will only let you open
> existing files, i.e. you can't create a new one. Perhaps it is
> there to prevent mistakes (e.g. by mis-typing a name) when you
> expect that the file already exists.
>
> Perhaps a way to find out such things in Emacs is C-h C-k ("describe
> key"). You first type C-h C-k (i.e. <CONTROL>-h then <CONTROL>-k),
> and then you click on the menu entry you are trying to understand.
> Then you get a description of the function behind that menu
> entry (this works also for keyboard shortcuts).
>
> Cheers
> - -- tomás
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
>
> iEYEARECAAYFAluD3s4ACgkQBcgs9XrR2kZgDACaAlkhmXfr5Yfjbie6kveDPUb7
> QGYAn388CvGbLcptfchQUfHn1t3j4k+9
> =aAFO
> -----END PGP SIGNATURE-----
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: menu command
2018-08-27 12:19 ` Lajos Bodnar
@ 2018-08-27 13:03 ` tomas
2018-08-27 13:38 ` Lajos Bodnar
0 siblings, 1 reply; 6+ messages in thread
From: tomas @ 2018-08-27 13:03 UTC (permalink / raw)
To: Lajos Bodnar; +Cc: help-gnu-emacs
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Mon, Aug 27, 2018 at 02:19:24PM +0200, Lajos Bodnar wrote:
> Thanks,
> I haven't found command in the "describe-key" result which open a
> filedialog.
Ah, I think I get it now: what confuses you is the opening
of a GUI like file dialog?
If I got you right this time, the best answer is in the
source code:
`find-file' calls `find-file-read-args' to to ask the user which
file name (s)he wants. This one calls `read-file-name', which has
a pretty extensive documentation string. I insert the relevant
part here:
If this command was invoked with the mouse, use a graphical file
dialog if ‘use-dialog-box’ is non-nil, and the window system or X
toolkit in use provides a file dialog box, and DIR is not a
remote file. For graphical file dialogs, any of the special values
of MUSTMATCH ‘confirm’ and ‘confirm-after-completion’ are
treated as equivalent to nil. Some graphical file dialogs respect
a MUSTMATCH value of t, and some do not (or it only has a cosmetic
effect, and does not actually prevent the user from entering a
non-existent file).
So this is the mechanism which adapts to how the user invoked `find-file':
if the user used keys, then the question appears in the minibuffer, but
if the user clicked on a menu, (s)he gets a GUI-like file browser (to
me that makes a lot of sense).
I hope I've understood your question better now.
Cheers
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAluD9oQACgkQBcgs9XrR2kYXNACfYdvSKA/fgTkT/FYC9v4cp6mE
YiwAniDADh9f6yZgxZvI7lnoKG26Um/l
=cJi4
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: menu command
2018-08-27 13:03 ` tomas
@ 2018-08-27 13:38 ` Lajos Bodnar
2018-08-28 16:13 ` Lajos Bodnar
0 siblings, 1 reply; 6+ messages in thread
From: Lajos Bodnar @ 2018-08-27 13:38 UTC (permalink / raw)
To: tomas; +Cc: help-gnu-emacs
Hi Tomas,
Yes it's a correct answer. I found it before and I haven't seen that it's
working only if I use the mouse ...
I'd like to avoid the mouse click and external program (getfile.exe) in
this case.
thanks again!
regards,
Lajos
On Mon, Aug 27, 2018 at 3:03 PM <tomas@tuxteam.de> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Mon, Aug 27, 2018 at 02:19:24PM +0200, Lajos Bodnar wrote:
> > Thanks,
> > I haven't found command in the "describe-key" result which open a
> > filedialog.
>
> Ah, I think I get it now: what confuses you is the opening
> of a GUI like file dialog?
>
> If I got you right this time, the best answer is in the
> source code:
>
> `find-file' calls `find-file-read-args' to to ask the user which
> file name (s)he wants. This one calls `read-file-name', which has
> a pretty extensive documentation string. I insert the relevant
> part here:
>
> If this command was invoked with the mouse, use a graphical file
> dialog if ‘use-dialog-box’ is non-nil, and the window system or X
> toolkit in use provides a file dialog box, and DIR is not a
> remote file. For graphical file dialogs, any of the special values
> of MUSTMATCH ‘confirm’ and ‘confirm-after-completion’ are
> treated as equivalent to nil. Some graphical file dialogs respect
> a MUSTMATCH value of t, and some do not (or it only has a cosmetic
> effect, and does not actually prevent the user from entering a
> non-existent file).
>
> So this is the mechanism which adapts to how the user invoked `find-file':
> if the user used keys, then the question appears in the minibuffer, but
> if the user clicked on a menu, (s)he gets a GUI-like file browser (to
> me that makes a lot of sense).
>
> I hope I've understood your question better now.
>
> Cheers
> - -- tomás
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
>
> iEYEARECAAYFAluD9oQACgkQBcgs9XrR2kYXNACfYdvSKA/fgTkT/FYC9v4cp6mE
> YiwAniDADh9f6yZgxZvI7lnoKG26Um/l
> =cJi4
> -----END PGP SIGNATURE-----
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: menu command
2018-08-27 13:38 ` Lajos Bodnar
@ 2018-08-28 16:13 ` Lajos Bodnar
0 siblings, 0 replies; 6+ messages in thread
From: Lajos Bodnar @ 2018-08-28 16:13 UTC (permalink / raw)
To: tomas; +Cc: help-gnu-emacs
I found the correct and working answer here:
https://stackoverflow.com/questions/26483918/bind-file-open-file-with-gui-dialog-to-c-o-as-global-set-key
Thanks again Tomas!
On Mon, Aug 27, 2018 at 3:38 PM Lajos Bodnar <bodnarlajoska@gmail.com>
wrote:
> Hi Tomas,
> Yes it's a correct answer. I found it before and I haven't seen that it's
> working only if I use the mouse ...
> I'd like to avoid the mouse click and external program (getfile.exe) in
> this case.
>
> thanks again!
>
> regards,
> Lajos
>
> On Mon, Aug 27, 2018 at 3:03 PM <tomas@tuxteam.de> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On Mon, Aug 27, 2018 at 02:19:24PM +0200, Lajos Bodnar wrote:
>> > Thanks,
>> > I haven't found command in the "describe-key" result which open a
>> > filedialog.
>>
>> Ah, I think I get it now: what confuses you is the opening
>> of a GUI like file dialog?
>>
>> If I got you right this time, the best answer is in the
>> source code:
>>
>> `find-file' calls `find-file-read-args' to to ask the user which
>> file name (s)he wants. This one calls `read-file-name', which has
>> a pretty extensive documentation string. I insert the relevant
>> part here:
>>
>> If this command was invoked with the mouse, use a graphical file
>> dialog if ‘use-dialog-box’ is non-nil, and the window system or X
>> toolkit in use provides a file dialog box, and DIR is not a
>> remote file. For graphical file dialogs, any of the special values
>> of MUSTMATCH ‘confirm’ and ‘confirm-after-completion’ are
>> treated as equivalent to nil. Some graphical file dialogs respect
>> a MUSTMATCH value of t, and some do not (or it only has a cosmetic
>> effect, and does not actually prevent the user from entering a
>> non-existent file).
>>
>> So this is the mechanism which adapts to how the user invoked `find-file':
>> if the user used keys, then the question appears in the minibuffer, but
>> if the user clicked on a menu, (s)he gets a GUI-like file browser (to
>> me that makes a lot of sense).
>>
>> I hope I've understood your question better now.
>>
>> Cheers
>> - -- tomás
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.12 (GNU/Linux)
>>
>> iEYEARECAAYFAluD9oQACgkQBcgs9XrR2kYXNACfYdvSKA/fgTkT/FYC9v4cp6mE
>> YiwAniDADh9f6yZgxZvI7lnoKG26Um/l
>> =cJi4
>> -----END PGP SIGNATURE-----
>>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-08-28 16:13 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-27 9:45 menu command Lajos Bodnar
2018-08-27 11:21 ` tomas
2018-08-27 12:19 ` Lajos Bodnar
2018-08-27 13:03 ` tomas
2018-08-27 13:38 ` Lajos Bodnar
2018-08-28 16:13 ` Lajos Bodnar
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).