unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Yiyi Hu" <yiyihu@gmail.com>
To: emacs-pretest-bug@gnu.org
Subject: bug#940: Is there a way to quit loading of ~/.emacs please?
Date: Tue, 9 Sep 2008 14:50:15 +0800	[thread overview]
Message-ID: <f469f8de0809082350n503279b0pe511fe1277e275ae@mail.gmail.com> (raw)

Hi, all. For now, I got a problem on how to do this.

Here is the sample ~/.emacs

(defun byte-compile-file-if-newer (src)
  (let ((result (concat src ".elc")))
    (when (file-newer-than-file-p src result)
      (byte-compile-file src)
      (load-file result))))

(byte-compile-file-if-newer "~/.emacs")

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(auto-compression-mode t)
 '(column-number-mode t)
 '(cperl-indent-level 4)
 '(delete-selection-mode t)
 '(display-battery-mode t)
 '(display-time-24hr-format t)
 '(display-time-day-and-date t)
 '(display-time-mode t)
 '(encoded-kbd-mode t)
 '(gnus-nntp-server "news.readfreenews.net")
 '(indent-tabs-mode nil)
 '(inferior-lisp-program "sbcl")
 '(inhibit-eol-conversion t)
 '(inhibit-startup-screen t)
 '(initial-scratch-message nil)
 '(menu-bar-mode nil)
 '(mouse-avoidance-mode (quote exile) nil (avoid)))

Is there a way to quit the loading after we compile the ~/.emacs and
load the ~/.emacs.elc file?

Ok, please don't bother talking about It's worthy or not for compiling
~/.emacs, I am talking a feature which *should* be supported by elisp
IMHO.

Yes, we can have a big condition around the rest of the ~/.emacs, But
that's not good practise. And If I do this, It will also confuse
things in M-x customize-group.

It's a bit like 'if' statements in emacs, 'if' is enough, but 'when'
and 'cond' statements is still there for supporting programming more
practically.

Also, I've ever done considering split ~/.emacs. To me, It's not a
good journey. There will be other problem when manage multiple start
up file.

I've tried add (return) to ~/.emacs, But there will be error as It's
not in a defun.

So, other possibility to quit the load of lib? Or enhance elisp by
adding a new 'keyword' or 'statement' to do this kind of job.

I also tried with (signal 'error nil) and (keyboard-quit), This worked
when you invoke emacs without any args. But when there is no
~/.emacs.elc file, and you invoke emacs with args, The passing args
won't be process by emacs.

I am using the newest emacs-cvs BTW.

Thanks.






             reply	other threads:[~2008-09-09  6:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-09  6:50 Yiyi Hu [this message]
2008-09-09 13:52 ` bug#940: Is there a way to quit loading of ~/.emacs please? Juanma Barranquero
2008-09-09 14:19 ` Lennart Borgman (gmail)
2008-09-09 18:24   ` Yiyi Hu
2008-09-09 22:10     ` Lennart Borgman (gmail)
2008-09-09 23:45       ` Yiyi Hu
     [not found]     ` <18631.27735.100063.263157@kahikatea.snap.net.nz>
2008-09-10  7:53       ` Yiyi Hu
2008-09-09 14:52 ` Stefan Monnier
2011-10-04 19:31 ` Glenn Morris

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=f469f8de0809082350n503279b0pe511fe1277e275ae@mail.gmail.com \
    --to=yiyihu@gmail.com \
    --cc=940@emacsbugs.donarmstrong.com \
    --cc=emacs-pretest-bug@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.
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).