unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#27511: 26.0.50; emacsclient requires file argument
@ 2017-06-28  2:03 James Nguyen
  2017-06-28 14:45 ` Noam Postavsky
  0 siblings, 1 reply; 14+ messages in thread
From: James Nguyen @ 2017-06-28  2:03 UTC (permalink / raw)
  To: 27511



Running emacsclient without specifying a file results in:

emacsclient: file name or argument required
Try 'emacsclient --help' for more information

https://www.gnu.org/software/emacs/manual/html_node/emacs/Entering-Emacs.html#Entering-Emacs

Gives the impression *scratch* should show up instead. (though probably
only if running 'emacs' regularly.)



In GNU Emacs 26.0.50 (build 4, x86_64-apple-darwin16.5.0, NS appkit-1504.82 Version 10.12.4 (Build 16E195))
of 2017-06-24 built on jamesretina.local
Repository revision: 16d2695674a4c8abbec846c427fe8abef97e07ef
Windowing system distributor 'Apple', version 10.3.1504
Recent messages:
Setting up indent for shell type zsh
Indentation variables are now local.
Indentation setup for shell type zsh
When done with a buffer, type C-x #
Configuring package dired...done
Configuring package helm...
Configuring package tramp...done
Configuring package helm...done (0.457s)
Configuring package helm-flx...done
Configuring package helm-fuzzier...done

Configured using:
'configure --with-ns'

Configured features:
JPEG RSVG NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Shell-script

Minor modes in effect:
  helm-fuzzier-mode: t
  helm-flx-mode: t
  helm-mode: t
  helm-autoresize-mode: t
  helm--remap-mouse-mode: t
  shell-dirtrack-mode: t
  focus-autosave-mode: t
  company-quickhelp-mode: t
  company-quickhelp-local-mode: t
  eval-sexp-fu-flash-mode: t
  flycheck-pos-tip-mode: t
  flycheck-mode: t
  shackle-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  global-company-mode: t
  company-mode: t
  global-evil-surround-mode: t
  evil-surround-mode: t
  global-evil-visualstar-mode: t
  evil-visualstar-mode: t
  global-evil-matchit-mode: t
  evil-matchit-mode: t
  evil-mode: t
  evil-local-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  recentf-mode: t
  ivy-mode: t
  smartparens-global-mode: t
  smartparens-mode: t
  fold-dwim-org/minor-mode: t
  global-hungry-delete-mode: t
  hungry-delete-mode: t
  ws-butler-global-mode: t
  ws-butler-mode: t
  show-paren-mode: t
  whitespace-mode: t
  global-auto-revert-mode: t
  winner-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  hs-minor-mode: t

Load-path shadows:
/Users/james/.emacs.d/elpa/26/color-theme-solarized-20160626.743/solarized-theme hides /Users/james/.emacs.d/elpa/26/solarized-theme-20170430.800/solarized-theme
~/.emacs.d/fork/evil/evil hides /Users/james/.emacs.d/elpa/26/evil-20170615.1320/evil
~/.emacs.d/fork/evil/evil-vars hides /Users/james/.emacs.d/elpa/26/evil-20170615.1320/evil-vars
~/.emacs.d/fork/evil/evil-types hides /Users/james/.emacs.d/elpa/26/evil-20170615.1320/evil-types
~/.emacs.d/fork/evil/evil-states hides /Users/james/.emacs.d/elpa/26/evil-20170615.1320/evil-states
~/.emacs.d/fork/evil/evil-search hides /Users/james/.emacs.d/elpa/26/evil-20170615.1320/evil-search
~/.emacs.d/fork/evil/evil-repeat hides /Users/james/.emacs.d/elpa/26/evil-20170615.1320/evil-repeat
~/.emacs.d/fork/evil/evil-pkg hides /Users/james/.emacs.d/elpa/26/evil-20170615.1320/evil-pkg
~/.emacs.d/fork/evil/evil-maps hides /Users/james/.emacs.d/elpa/26/evil-20170615.1320/evil-maps
~/.emacs.d/fork/evil/evil-macros hides /Users/james/.emacs.d/elpa/26/evil-20170615.1320/evil-macros
~/.emacs.d/fork/evil/evil-jumps hides /Users/james/.emacs.d/elpa/26/evil-20170615.1320/evil-jumps
~/.emacs.d/fork/evil/evil-integration hides /Users/james/.emacs.d/elpa/26/evil-20170615.1320/evil-integration
~/.emacs.d/fork/evil/evil-ex hides /Users/james/.emacs.d/elpa/26/evil-20170615.1320/evil-ex
~/.emacs.d/fork/evil/evil-digraphs hides /Users/james/.emacs.d/elpa/26/evil-20170615.1320/evil-digraphs
~/.emacs.d/fork/evil/evil-core hides /Users/james/.emacs.d/elpa/26/evil-20170615.1320/evil-core
~/.emacs.d/fork/evil/evil-common hides /Users/james/.emacs.d/elpa/26/evil-20170615.1320/evil-common
~/.emacs.d/fork/evil/evil-commands hides /Users/james/.emacs.d/elpa/26/evil-20170615.1320/evil-commands
~/.emacs.d/fork/evil/evil-command-window hides /Users/james/.emacs.d/elpa/26/evil-20170615.1320/evil-command-window

Features:
(shadow sort mail-extr emacsbug message puny rfc822 mml mml-sec epa epg
gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils helm-fuzzier helm-flx helm-smex
helm-command helm-elisp helm-eval helm-mode helm-files image-dired
image-mode tramp tramp-compat tramp-loaddefs trampver parse-time
format-spec dired-x dired-aux helm-buffers helm-tags helm-bookmark
helm-adaptive helm-info bookmark pp helm-locate helm-grep helm-regexp
helm-external helm-net browse-url xml url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
mailcap helm-utils compile helm-help helm-types helm helm-source
eieio-compat helm-multi-match helm-lib dired dired-loaddefs async smex
ido shell pcomplete comint ansi-color sh-script smie executable colir
counsel jka-compr esh-util term disp-table ehelp server
focus-autosave-mode JJ-security rainbow-delimiters evil-cleverparens
evil-cleverparens-text-objects evil-cleverparens-util paredit lispyville
lispy swiper iedit iedit-lib multiple-cursors-core lispy-inline avy
semantic/db eieio-base semantic/util-modes semantic/util semantic
semantic/tag semantic/lex semantic/fw mode-local cedet evil-ediff
ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init
ediff-util ediff help-fns radix-tree lispy-tags elisp-slime-nav
eval-sexp-fu company-quickhelp warnings highlight font-lock+
flycheck-pos-tip pos-tip flycheck json map find-func shackle
JJ-extra-lang make-mode JJ-elisp edebug-x edebug which-func imenu
JJ-autocomplete elixir-yasnippets yasnippet company-oddmuse
company-keywords company-etags etags xref project company-gtags
company-files company-capf company-cmake company-xcode company-clang
company-semantic company-eclim company-template company-css company-nxml
company-dabbrev-code company-dabbrev company-yasnippet company-bbdb
company JJ-evil evil-surround evil-visualstar evil-matchit evil
evil-integration evil-maps evil-commands flyspell ispell evil-jumps
evil-command-window evil-types evil-search evil-ex evil-macros
evil-repeat evil-states evil-core evil-common derived rect evil-digraphs
evil-vars undo-tree diff JJ-project recentf tree-widget wid-edit ivy flx
delsel ivy-overlay ffap JJ-pair-editing smartparens-config smartparens
thingatpt JJ-misc fold-dwim-org fold-dwim hideshow noutline outline
windmove hungry-delete ws-butler JJ-platform exec-path-from-shell
ls-lisp JJ-defaults paren whitespace autorevert filenotify winner
JJ-theme solarized-light-theme solarized color cl-extra help-mode
theme-changer solar cal-dst cal-menu calendar cal-loaddefs cl
JJ-dependencies hydra ring lv s dash JJ-funcs subr-x use-package
diminish bind-key easy-mmode finder-inf edmacro kmacro rx advice
slime-autoloads info package easymenu epg-config url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache url-vars seq byte-opt gv bytecomp byte-compile cconv
cl-loaddefs pcase cl-lib time-date tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote kqueue cocoa ns multi-tty make-network-process emacs)

Memory information:
((conses 16 756863 475074)
(symbols 48 51456 89)
(miscs 40 429 1329)
(strings 32 126917 238077)
(string-bytes 1 4317014)
(vectors 16 81734)
(vector-slots 8 1505112 226764)
(floats 8 797 989)
(intervals 56 2507 755)
(buffers 976 25))





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#27511: 26.0.50; emacsclient requires file argument
  2017-06-28  2:03 bug#27511: 26.0.50; emacsclient requires file argument James Nguyen
@ 2017-06-28 14:45 ` Noam Postavsky
  2017-06-28 15:00   ` James Nguyen
  0 siblings, 1 reply; 14+ messages in thread
From: Noam Postavsky @ 2017-06-28 14:45 UTC (permalink / raw)
  To: James Nguyen; +Cc: 27511

On Tue, Jun 27, 2017 at 10:03 PM, James Nguyen <jamesn@fastmail.com> wrote:
>
> Running emacsclient without specifying a file results in:
>
> emacsclient: file name or argument required
> Try 'emacsclient --help' for more information
>
> https://www.gnu.org/software/emacs/manual/html_node/emacs/Entering-Emacs.html#Entering-Emacs
>
> Gives the impression *scratch* should show up instead. (though probably
> only if running 'emacs' regularly.)

Which part gives you that impression? Or in other words, what do you
want to change?





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#27511: 26.0.50; emacsclient requires file argument
  2017-06-28 14:45 ` Noam Postavsky
@ 2017-06-28 15:00   ` James Nguyen
  2017-06-28 17:03     ` Ken Brown
  0 siblings, 1 reply; 14+ messages in thread
From: James Nguyen @ 2017-06-28 15:00 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 27511

"Emacs simply displays those files; otherwise, it displays a buffer named *scratch*, which can be used to evaluate Emacs Lisp expressions interactively."

I think it’s preferable it behaves just like regular ‘emacs’ does, opening a *scratch* buffer as a fallback. 

> On Jun 28, 2017, at 7:45 AM, Noam Postavsky <npostavs@users.sourceforge.net> wrote:
> 
> On Tue, Jun 27, 2017 at 10:03 PM, James Nguyen <jamesn@fastmail.com> wrote:
>> 
>> Running emacsclient without specifying a file results in:
>> 
>> emacsclient: file name or argument required
>> Try 'emacsclient --help' for more information
>> 
>> https://www.gnu.org/software/emacs/manual/html_node/emacs/Entering-Emacs.html#Entering-Emacs
>> 
>> Gives the impression *scratch* should show up instead. (though probably
>> only if running 'emacs' regularly.)
> 
> Which part gives you that impression? Or in other words, what do you
> want to change?






^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#27511: 26.0.50; emacsclient requires file argument
  2017-06-28 15:00   ` James Nguyen
@ 2017-06-28 17:03     ` Ken Brown
  2017-06-28 17:22       ` James Nguyen
  0 siblings, 1 reply; 14+ messages in thread
From: Ken Brown @ 2017-06-28 17:03 UTC (permalink / raw)
  To: James Nguyen, Noam Postavsky; +Cc: 27511

On 6/28/2017 11:00 AM, James Nguyen wrote:
> "Emacs simply displays those files; otherwise, it displays a buffer named *scratch*, which can be used to evaluate Emacs Lisp expressions interactively."
> 
> I think it’s preferable it behaves just like regular ‘emacs’ does, opening a *scratch* buffer as a fallback.

I think you're misunderstanding the purpose of emacsclient:

$ emacsclient --help
Usage: emacsclient [OPTIONS] FILE...
Tell the Emacs server to visit the specified files.


See 
https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html#Emacs-Server 
for typical use cases.

Ken





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#27511: 26.0.50; emacsclient requires file argument
  2017-06-28 17:03     ` Ken Brown
@ 2017-06-28 17:22       ` James Nguyen
  2017-06-28 17:35         ` Noam Postavsky
  0 siblings, 1 reply; 14+ messages in thread
From: James Nguyen @ 2017-06-28 17:22 UTC (permalink / raw)
  To: Ken Brown; +Cc: Noam Postavsky, 27511

At the very least, I understand how to use emacsclient (e.g. to connect to a running emacs server).

I am just wondering if it makes sense to give an error message instead of `falling back` the way ‘emacs’ does. (scratch buffer or title screen (though a title screen might not make sense assuming the server/emacs instance was already started)).

I’ve also been told emacsclient used to be able to handle the ‘no file arguments’ case, although I can’t confirm if this is true or not.

https://www.reddit.com/r/emacs/comments/45mtdz/can_someone_explain_why_emacsclient_requires_a/

Shows 1 or 2 users being able to use emacsclient without passing a file argument.

> On Jun 28, 2017, at 10:03 AM, Ken Brown <kbrown@cornell.edu> wrote:
> 
> On 6/28/2017 11:00 AM, James Nguyen wrote:
>> "Emacs simply displays those files; otherwise, it displays a buffer named *scratch*, which can be used to evaluate Emacs Lisp expressions interactively."
>> I think it’s preferable it behaves just like regular ‘emacs’ does, opening a *scratch* buffer as a fallback.
> 
> I think you're misunderstanding the purpose of emacsclient:
> 
> $ emacsclient --help
> Usage: emacsclient [OPTIONS] FILE...
> Tell the Emacs server to visit the specified files.
> 
> 
> See https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html#Emacs-Server for typical use cases.
> 
> Ken






^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#27511: 26.0.50; emacsclient requires file argument
  2017-06-28 17:22       ` James Nguyen
@ 2017-06-28 17:35         ` Noam Postavsky
  2017-06-28 23:49           ` James Nguyen
  0 siblings, 1 reply; 14+ messages in thread
From: Noam Postavsky @ 2017-06-28 17:35 UTC (permalink / raw)
  To: James Nguyen; +Cc: 27511

On Wed, Jun 28, 2017 at 1:22 PM, James Nguyen <jamesn@fastmail.com> wrote:
>
> I’ve also been told emacsclient used to be able to handle the ‘no file arguments’ case, although I can’t confirm if this is true or not.

Does 'emacsclient -c' or 'emacsclient -t' not work for you?





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#27511: 26.0.50; emacsclient requires file argument
  2017-06-28 17:35         ` Noam Postavsky
@ 2017-06-28 23:49           ` James Nguyen
  2017-06-29  1:13             ` npostavs
  0 siblings, 1 reply; 14+ messages in thread
From: James Nguyen @ 2017-06-28 23:49 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 27511

Those work for me but -c creates a new gui frame and -t opens in terminal.

Usually I have a gui client up already and $ emacsclient $FILE is the only choice that opens it in that current frame.


> On Jun 28, 2017, at 10:35 AM, Noam Postavsky <npostavs@users.sourceforge.net> wrote:
> 
> On Wed, Jun 28, 2017 at 1:22 PM, James Nguyen <jamesn@fastmail.com> wrote:
>> 
>> I’ve also been told emacsclient used to be able to handle the ‘no file arguments’ case, although I can’t confirm if this is true or not.
> 
> Does 'emacsclient -c' or 'emacsclient -t' not work for you?






^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#27511: 26.0.50; emacsclient requires file argument
  2017-06-28 23:49           ` James Nguyen
@ 2017-06-29  1:13             ` npostavs
  2017-06-29  3:35               ` James Nguyen
  0 siblings, 1 reply; 14+ messages in thread
From: npostavs @ 2017-06-29  1:13 UTC (permalink / raw)
  To: James Nguyen; +Cc: 27511

James Nguyen <jamesn@fastmail.com> writes:

> Those work for me but -c creates a new gui frame and -t opens in terminal.

Oh, all the responses I saw in the reddit thread you linked were using
-c or -t, so I thought that's what you wanted.

> Usually I have a gui client up already and $ emacsclient $FILE is the
> only choice that opens it in that current frame.

But it sounds like you're actually after something like

    emacsclient --eval '(select-frame-set-input-focus (car (frame-list)))'





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#27511: 26.0.50; emacsclient requires file argument
  2017-06-29  1:13             ` npostavs
@ 2017-06-29  3:35               ` James Nguyen
  2017-06-29 12:32                 ` npostavs
  0 siblings, 1 reply; 14+ messages in thread
From: James Nguyen @ 2017-06-29  3:35 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 27511

Hmnn, yeah sorry for not expounding earlier.

That snip you sent doesn’t work the way I want. It just opens the Gui Emacs up without opening a new scratch buffer.

At this point, my takeaway is that we think this is 1. not a bug and 2. unlikely to have the default change (emacsclient behaving similarly in spirit to emacs)

I will just have to write a bash function that wraps emacsclient and check for the file arg (or lackof) myself.

Thanks Noam for the help.

> On Jun 28, 2017, at 6:13 PM, npostavs@users.sourceforge.net wrote:
> 
> James Nguyen <jamesn@fastmail.com> writes:
> 
>> Those work for me but -c creates a new gui frame and -t opens in terminal.
> 
> Oh, all the responses I saw in the reddit thread you linked were using
> -c or -t, so I thought that's what you wanted.
> 
>> Usually I have a gui client up already and $ emacsclient $FILE is the
>> only choice that opens it in that current frame.
> 
> But it sounds like you're actually after something like
> 
>    emacsclient --eval '(select-frame-set-input-focus (car (frame-list)))'






^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#27511: 26.0.50; emacsclient requires file argument
  2017-06-29  3:35               ` James Nguyen
@ 2017-06-29 12:32                 ` npostavs
  2017-06-29 14:11                   ` Ken Brown
  0 siblings, 1 reply; 14+ messages in thread
From: npostavs @ 2017-06-29 12:32 UTC (permalink / raw)
  To: James Nguyen; +Cc: 27511

tags 27511 notabug
close 27511
quit

James Nguyen <jamesn@fastmail.com> writes:

> That snip you sent doesn’t work the way I want. It just opens the Gui
> Emacs up without opening a new scratch buffer.

Oh you want a *new* scratch buffer?  As in, you end up with multiple
scratch buffers if you run emacsclient several times?

> At this point, my takeaway is that we think this is 1. not a bug and
> 2. unlikely to have the default change (emacsclient behaving similarly
> in spirit to emacs)
>
> I will just have to write a bash function that wraps emacsclient and
> check for the file arg (or lackof) myself.

Yeah, changing the defaults is tricky because you have to get a lot of
people to agree on what the new default should be.  Although it seems to
me that the current default of just printing an error message is not
especially useful for anyone...







^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#27511: 26.0.50; emacsclient requires file argument
  2017-06-29 12:32                 ` npostavs
@ 2017-06-29 14:11                   ` Ken Brown
  2017-06-29 16:48                     ` James Nguyen
  0 siblings, 1 reply; 14+ messages in thread
From: Ken Brown @ 2017-06-29 14:11 UTC (permalink / raw)
  To: npostavs, James Nguyen; +Cc: 27511

On 6/29/2017 8:32 AM, npostavs@users.sourceforge.net wrote> James Nguyen 
<jamesn@fastmail.com> writes:
> 
>> That snip you sent doesn’t work the way I want. It just opens the Gui
>> Emacs up without opening a new scratch buffer.
> 
> Oh you want a *new* scratch buffer?  As in, you end up with multiple
> scratch buffers if you run emacsclient several times?
> 
>> At this point, my takeaway is that we think this is 1. not a bug and
>> 2. unlikely to have the default change (emacsclient behaving similarly
>> in spirit to emacs)
>>
>> I will just have to write a bash function that wraps emacsclient and
>> check for the file arg (or lackof) myself.
> 
> Yeah, changing the defaults is tricky because you have to get a lot of
> people to agree on what the new default should be.  Although it seems to
> me that the current default of just printing an error message is not
> especially useful for anyone...

The purpose of emacsclient is to contact an emacs server and give it 
some action to perform (visit a file, open a new frame, evaluate some 
lisp, ...).  If you run emacsclient with no arguments, you're not 
specifying any action.  I can think of two possibilities for what 
emacsclient should do in that case: (a) Silently do nothing.  (b) Print 
an error message.  I would find it very surprising if emacsclient were 
to tell the server to create a new buffer when I've specified no action.

Ken






^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#27511: 26.0.50; emacsclient requires file argument
  2017-06-29 14:11                   ` Ken Brown
@ 2017-06-29 16:48                     ` James Nguyen
  2017-06-29 18:11                       ` Ken Brown
  0 siblings, 1 reply; 14+ messages in thread
From: James Nguyen @ 2017-06-29 16:48 UTC (permalink / raw)
  To: Ken Brown; +Cc: npostavs, 27511

@Noam
I’d like it to switch to the scratch buffer if anything and to create a new one if it doesn’t exist. I should be able to jigger something up with the —eval option on emacsclient though.

Thanks.

@Ken

Why would you find it surprising? Personally, I like the DWIM style of many emacs commands. If I ever type ‘emacsclient’ and press <RET>, DWIM suggests I’m trying to connect to an instance of an Emacs server.

I don’t think I’d ever expect an error message to show up in that case. Imagine typing ‘vim’ and being forced to specify a file. (It’s not lost on my you’ve indicated they have separate purposes.)

At the very least, connecting to the server and doing nothing (similar to what Noam posted a few messages back) should be similar in spirit to what you’ve just said.


> On Jun 29, 2017, at 7:11 AM, Ken Brown <kbrown@cornell.edu> wrote:
> 
> On 6/29/2017 8:32 AM, npostavs@users.sourceforge.net wrote> James Nguyen <jamesn@fastmail.com> writes:
>>> That snip you sent doesn’t work the way I want. It just opens the Gui
>>> Emacs up without opening a new scratch buffer.
>> Oh you want a *new* scratch buffer?  As in, you end up with multiple
>> scratch buffers if you run emacsclient several times?
>>> At this point, my takeaway is that we think this is 1. not a bug and
>>> 2. unlikely to have the default change (emacsclient behaving similarly
>>> in spirit to emacs)
>>> 
>>> I will just have to write a bash function that wraps emacsclient and
>>> check for the file arg (or lackof) myself.
>> Yeah, changing the defaults is tricky because you have to get a lot of
>> people to agree on what the new default should be.  Although it seems to
>> me that the current default of just printing an error message is not
>> especially useful for anyone...
> 
> The purpose of emacsclient is to contact an emacs server and give it some action to perform (visit a file, open a new frame, evaluate some lisp, ...).  If you run emacsclient with no arguments, you're not specifying any action.  I can think of two possibilities for what emacsclient should do in that case: (a) Silently do nothing.  (b) Print an error message.  I would find it very surprising if emacsclient were to tell the server to create a new buffer when I've specified no action.
> 
> Ken
> 






^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#27511: 26.0.50; emacsclient requires file argument
  2017-06-29 16:48                     ` James Nguyen
@ 2017-06-29 18:11                       ` Ken Brown
  2017-06-30  1:06                         ` James Nguyen
  0 siblings, 1 reply; 14+ messages in thread
From: Ken Brown @ 2017-06-29 18:11 UTC (permalink / raw)
  To: James Nguyen; +Cc: npostavs, 27511

On 6/29/2017 12:48 PM, James Nguyen wrote:
> @Noam
> I’d like it to switch to the scratch buffer if anything and to create a new one if it doesn’t exist. I should be able to jigger something up with the —eval option on emacsclient though.
> 
> Thanks.
> 
> @Ken
> 
> Why would you find it surprising? Personally, I like the DWIM style of many emacs commands. If I ever type ‘emacsclient’ and press <RET>, DWIM suggests I’m trying to connect to an instance of an Emacs server.

What does it mean to connect to a server without asking the server to do 
something?  Does DWIM suggest an obvious guess?  One possible guess 
would be that you forgot to specify a file, in which case an error 
message (or at least a query) is precisely the right thing.  Maybe there 
are other possible guesses, but I personally wouldn't expect emacsclient 
to guess that I want the server to do something involving the scratch 
buffer.

> I don’t think I’d ever expect an error message to show up in that case. Imagine typing ‘vim’ and being forced to specify a file. (It’s not lost on my you’ve indicated they have separate purposes.)

vim is not a client connecting to a server.  A better analogy would be a 
mail client/server pair.  What would you expect a mail client to do if 
you ask it to connect to an outgoing mail server but you don't specify a 
message to send?  I would expect either (a) the client should do nothing 
or (b) the client should issue an error message.

> At the very least, connecting to the server and doing nothing (similar to what Noam posted a few messages back) should be similar in spirit to what you’ve just said.

Noam suggested that you should use 'emacsclient -c' or 'emacsclient -t', 
neither of which does nothing; they each create a new frame.  AFAIU, he 
didn't suggest that emacsclient should try to guess which of these you 
want if you don't specify either.

As to "connecting to the server and doing nothing", how is this 
different from just "doing nothing"?  I think doing nothing would be 
acceptable, but I personally find the current behavior to be more 
friendly (do nothing and explain why).  In the mail example, what would 
it mean for a mail client to connect to a mail server and do nothing?

Anyway, it might be time for us to agree to disagree.

Ken





^ permalink raw reply	[flat|nested] 14+ messages in thread

* bug#27511: 26.0.50; emacsclient requires file argument
  2017-06-29 18:11                       ` Ken Brown
@ 2017-06-30  1:06                         ` James Nguyen
  0 siblings, 0 replies; 14+ messages in thread
From: James Nguyen @ 2017-06-30  1:06 UTC (permalink / raw)
  To: Ken Brown; +Cc: Noam Postavsky, 27511

>> What does it mean to connect to a server without asking the server to do something?  Does DWIM suggest an obvious guess?  One possible guess would be that you forgot to specify a file, in which case an error message (or at least a query) is precisely the right thing.  Maybe there are other possible guesses, but I personally wouldn't expect emacsclient to guess that I want the server to do something involving the scratch buffer.

`Anything` but failing and throwing an error message would be a 'sane default' (in my opinion).

>> vim is not a client connecting to a server.  A better analogy would be a mail client/server pair.  What would you expect a mail client to do if you ask it to connect to an outgoing mail server but you don't specify a message to send?  I would expect either (a) the client should do nothing or (b) the client should issue an error message.

Sure, a mail client/server is a good analogy. If I click 'mail app' in OSX, it opens up to a list of my emails/inbox (and even queries for mail!) despite myself not micromanaging that fact.

>> Noam suggested that you should use 'emacsclient -c' or 'emacsclient -t', neither of which does nothing; they each create a new frame.  AFAIU, he didn't suggest that emacsclient should try to guess which of these you want if you don't specify either.

This was what I was referring to.

  emacsclient --eval '(select-frame-set-input-focus (car (frame-list)))'

>> Anyway, it might be time for us to agree to disagree.

Agreed.






^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-06-30  1:06 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-28  2:03 bug#27511: 26.0.50; emacsclient requires file argument James Nguyen
2017-06-28 14:45 ` Noam Postavsky
2017-06-28 15:00   ` James Nguyen
2017-06-28 17:03     ` Ken Brown
2017-06-28 17:22       ` James Nguyen
2017-06-28 17:35         ` Noam Postavsky
2017-06-28 23:49           ` James Nguyen
2017-06-29  1:13             ` npostavs
2017-06-29  3:35               ` James Nguyen
2017-06-29 12:32                 ` npostavs
2017-06-29 14:11                   ` Ken Brown
2017-06-29 16:48                     ` James Nguyen
2017-06-29 18:11                       ` Ken Brown
2017-06-30  1:06                         ` James Nguyen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).