unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: John Mastro <john.b.mastro@gmail.com>
To: 23509@debbugs.gnu.org
Cc: "Alfonsogonzalez,
	Ernesto \(GE Digital\)" <ernesto.alfonsogonzalez@ge.com>
Subject: bug#23509: 24.4; initial-buffer-choice bug with zero-argument lambda
Date: Tue, 10 May 2016 13:07:30 -0700	[thread overview]
Message-ID: <CAOj2CQRGxgxb2GhiDG3tQ5yF3T26D3GDhoQG-qM6M51XdOo4vg@mail.gmail.com> (raw)
In-Reply-To: <2A734D896A45164C887E476E942BF4F9B601A2@CINMBCNA09.e2k.ad.ge.com>

Alfonsogonzalez, Ernesto (GE Digital) <ernesto.alfonsogonzalez@ge.com> wrote:

> 1. create file /tmp/emacs-bug.el with contents
>
> (setq initial-buffer-choice
>       ;"~/";;works
>       (lambda ()
>         '(call-interactively 'org-agenda-list)
>         "*Org Agenda*"
>         "~/");;doesn't work, opens scratch buffer
>       )
>
> 2. emacs -Q -l /tmp/emacs-bug.el
> 3. scratch buffer opens.
>
> According to docs,
>
> If the value is nil and `inhibit-startup-screen' is nil, show the
> startup screen.  If the value is a string, switch to a buffer
> visiting the file or directory that the string specifies.  If the
> value is a function, call it with no arguments and switch to the buffer
> that it returns.  If t, open the `*scratch*' buffer.
> If the value is nil and `inhibit-startup-screen' is nil, show the
> startup screen.  If the value is a string, switch to a buffer
> visiting the file or directory that the string specifies.  If the
> value is a function, call it with no arguments and switch to the buffer
> that it returns.  If t, open the `*scratch*' buffer.

The docs you quoted say "if the value is a function, call it with no
arguments and switch to the buffer that it returns", but your function
does not return a buffer (it returns the string "~/").

I'm not sure what your ultimate intent was. However, if you're trying to
run `org-agenda-list' but show a buffer visiting your home directory,
maybe this will help:

(setq initial-buffer-choice
      (lambda ()
        (org-agenda-list)
        (find-file "~/")))

The difference is that `find-file' visits "~/" and returns a buffer. I
omitted the "*Org Agenda*" line from your example because it has no
effect.

-- 
john





  reply	other threads:[~2016-05-10 20:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-10 18:54 bug#23509: 24.4; initial-buffer-choice bug with zero-argument lambda Alfonsogonzalez, Ernesto (GE Digital)
2016-05-10 20:07 ` John Mastro [this message]
2016-05-10 20:12 ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOj2CQRGxgxb2GhiDG3tQ5yF3T26D3GDhoQG-qM6M51XdOo4vg@mail.gmail.com \
    --to=john.b.mastro@gmail.com \
    --cc=23509@debbugs.gnu.org \
    --cc=ernesto.alfonsogonzalez@ge.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).