unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Hongyi Zhao <hongyi.zhao@gmail.com>
To: Drew Adams <drew.adams@oracle.com>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: [External] : Set the default-directory dynamically according to the buffer-file-name.
Date: Fri, 1 Oct 2021 12:41:52 +0800	[thread overview]
Message-ID: <CAGP6POJDHHPrFzdEkwaJdbu802Q4-=wCBbXUeLmbdCLkGvBqaQ@mail.gmail.com> (raw)
In-Reply-To: <SJ0PR10MB5488BF7807671A5503F376B1F3A99@SJ0PR10MB5488.namprd10.prod.outlook.com>

On Wed, Sep 29, 2021 at 11:47 PM Drew Adams <drew.adams@oracle.com> wrote:
>
> >     (if (not file)
> >         (message "no file name here.")
> >       (setq default-directory (file-name-directory
> >                                 (buffer-file-name))))))
>
> (if (not WHATEVER)
>     (message "PROBLEM NOTIFICATION")
>   (DO-STUFF))
>
> If you want to stop everything and be sure the
> message is seen, you might want to raise an error:
>
> (unless WHATEVER (error "PROBLEM")) ; End it all
> (DO-STUFF)

Do you mean this is a good practice for usage scenarios in production
environments?

HZ



  reply	other threads:[~2021-10-01  4:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-29 14:31 Set the default-directory dynamically according to the buffer-file-name Hongyi Zhao
2021-09-29 14:50 ` Hongyi Zhao
2021-09-29 15:31 ` Tassilo Horn
2021-09-30  1:08   ` Hongyi Zhao
2021-09-30  3:37     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-30  7:00       ` Hongyi Zhao
2021-09-30  7:39         ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-30  8:54           ` Hongyi Zhao
2021-09-30  9:58             ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-29 15:47 ` [External] : " Drew Adams
2021-10-01  4:41   ` Hongyi Zhao [this message]
2021-10-01  7:09     ` Emanuel Berg via Users list for the GNU Emacs text editor

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='CAGP6POJDHHPrFzdEkwaJdbu802Q4-=wCBbXUeLmbdCLkGvBqaQ@mail.gmail.com' \
    --to=hongyi.zhao@gmail.com \
    --cc=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    /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.
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).