all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* customize versus own expressions in .emacs
@ 2005-03-27 19:22 Sebastian Luque
       [not found] ` <87d5tklwr5.fsf-by2PdLBuqAc@public.gmane.org>
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Sebastian Luque @ 2005-03-27 19:22 UTC (permalink / raw)


Since I began using Emacs a little over a year now, I've been mixing my
own entries with those made by the Customize interface in my ~/.emacs. As
I learned more and started using more libraries, it has become more
difficult to maintain this file due to the mixing of the two styles.
However, I'm not sure which approach to take in the long run; the
Customize interface is ideal for initially setting options, because you
can look at all the available options at once. OTOH, having a section with
my own expressions in the file is much better for keeping track of
everything afterward.

Something similar to this was discussed in this list ("is Customize the
right advice to give?") back in 1999. Variation in preferences was very
large. Is there some general consensus regarding this today, given that
Customize seems to have improved since 1999?

-- 
Sebastian P. Luque

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

* Re: customize versus own expressions in .emacs
       [not found] ` <87d5tklwr5.fsf-by2PdLBuqAc@public.gmane.org>
@ 2005-03-27 21:39   ` Jochen Küpper
  0 siblings, 0 replies; 14+ messages in thread
From: Jochen Küpper @ 2005-03-27 21:39 UTC (permalink / raw)


Sebastian Luque <sluque-by2PdLBuqAc@public.gmane.org> writes:

> Since I began using Emacs a little over a year now, I've been mixing my
> own entries with those made by the Customize interface in my ~/.emacs. As
> I learned more and started using more libraries, it has become more
> difficult to maintain this file due to the mixing of the two styles.

[...]

> Variation in preferences was very large. Is there some general
> consensus regarding this today, given that Customize seems to have
> improved since 1999?

I find this also a quite interesting question. What I myself is that I
barely use customize, but the few times I do I leave the settings in
.emacs in the beginning. I do have a separate jk-emacs.el (and a few
more files, i.e. for gnus and bbdb) where I put my own customizations.
Once I get to the point that I want to change some of these
"customization" settings further, I move everything from .emacs to
jk-emacs.el and change it by hand there.

.emacs looks like the following (and .gnus looks very similar):
,----
| ;;
| ;; load jk-emacs customization
| ;;
| (add-to-list 'load-path (expand-file-name "~/konfigurationsdateien/lisp/init/"))
| (load-library "jk-emacs")
| 
| 
| ;;
| ;; robot-customization
| ;;
| (custom-set-variables
[...]
`----

Greetings,
Jochen
-- 
Einigkeit und Recht und Freiheit                http://www.Jochen-Kuepper.de
    Liberté, Égalité, Fraternité                GnuPG key: CC1B0B4D
        (Part 3 you find in my messages before fall 2003.)

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

* Re: customize versus own expressions in .emacs
  2005-03-27 19:22 Sebastian Luque
       [not found] ` <87d5tklwr5.fsf-by2PdLBuqAc@public.gmane.org>
@ 2005-03-29 10:11 ` Peter Dyballa
       [not found] ` <mailman.484.1112092111.28103.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 14+ messages in thread
From: Peter Dyballa @ 2005-03-29 10:11 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 27.03.2005 um 21:22 schrieb Sebastian Luque:

> Is there some general consensus regarding this today, given that
> Customize seems to have improved since 1999?

At least this has come up to split own and customize things:

(if (= emacs-major-version 20) (setq custom-file 
"~/.emacs-Abrichtung-20.el"))
(if (= emacs-major-version 21) (setq custom-file 
"~/.emacs-Abrichtung-21.el"))
(if (= emacs-major-version 22) (setq custom-file 
"~/.emacs-Abrichtung-22.el"))
(load custom-file)

--
Greetings

   Pete

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

* Re: customize versus own expressions in .emacs
       [not found] ` <mailman.484.1112092111.28103.help-gnu-emacs@gnu.org>
@ 2005-03-29 11:33   ` Thien-Thi Nguyen
  2005-03-29 14:47     ` Joe Corneli
  2005-03-29 14:57   ` Stefan Monnier
  1 sibling, 1 reply; 14+ messages in thread
From: Thien-Thi Nguyen @ 2005-03-29 11:33 UTC (permalink / raw)


Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> (if [...])
> (if [...])
> (if [...])

alternatively:

(setq custom-file
      (format "~/.emacs-Abrichtung-%d.el"
              emacs-major-version))

thi

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

* Re: customize versus own expressions in .emacs
  2005-03-29 11:33   ` Thien-Thi Nguyen
@ 2005-03-29 14:47     ` Joe Corneli
  0 siblings, 0 replies; 14+ messages in thread
From: Joe Corneli @ 2005-03-29 14:47 UTC (permalink / raw)


I think that `after-init-hook' needs to be set in .emacs, and
I think configuration of frame parameters belongs there, but
all other personal configurations can go elsewhere.

I have an alias that I use to start my emacs with

 /path/to/emacs --no-site-file -l ~/site-lisp/joes_stuff/joes_loads.el

That way, if I want to use a "plainer" emacs, I can leave off all the
loaded files at once, saving time.  One could also define various
aliases/load files, which would afford several degrees of plainness.

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

* Re: customize versus own expressions in .emacs
       [not found] <mailman.353.1111951880.28103.help-gnu-emacs@gnu.org>
@ 2005-03-29 14:55 ` Stefan Monnier
  2005-04-02  4:29 ` Tim X
  1 sibling, 0 replies; 14+ messages in thread
From: Stefan Monnier @ 2005-03-29 14:55 UTC (permalink / raw)


> Something similar to this was discussed in this list ("is Customize the
> right advice to give?") back in 1999. Variation in preferences was very
> large. Is there some general consensus regarding this today, given that
> Customize seems to have improved since 1999?

I don't think things have changed.


        Stefan

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

* Re: customize versus own expressions in .emacs
       [not found] ` <mailman.484.1112092111.28103.help-gnu-emacs@gnu.org>
  2005-03-29 11:33   ` Thien-Thi Nguyen
@ 2005-03-29 14:57   ` Stefan Monnier
  1 sibling, 0 replies; 14+ messages in thread
From: Stefan Monnier @ 2005-03-29 14:57 UTC (permalink / raw)


> (if (= emacs-major-version 20) (setq custom-file
> "~/.emacs-Abrichtung-20.el"))
> (if (= emacs-major-version 21) (setq custom-file
> "~/.emacs-Abrichtung-21.el"))
> (if (= emacs-major-version 22) (setq custom-file
> "~/.emacs-Abrichtung-22.el"))
> (load custom-file)

I of course strongly recommend against this style, since it naturally leads
to duplication of settings.
Just use `fboundp' or `boundp' where needed, or `ignore-errors'.
This way you have a single file to manage and you know the configuration
will be as close as possible between the different Emacs versions you
may use.


        Stefan

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

* Re: customize versus own expressions in .emacs
       [not found] <mailman.353.1111951880.28103.help-gnu-emacs@gnu.org>
  2005-03-29 14:55 ` customize versus own expressions in .emacs Stefan Monnier
@ 2005-04-02  4:29 ` Tim X
  2005-04-04 13:39   ` J. David Boyd
  1 sibling, 1 reply; 14+ messages in thread
From: Tim X @ 2005-04-02  4:29 UTC (permalink / raw)


Sebastian Luque <sluque@mun.ca> writes:


> Since I began using Emacs a little over a year now, I've been mixing my
> own entries with those made by the Customize interface in my ~/.emacs. As
> I learned more and started using more libraries, it has become more
> difficult to maintain this file due to the mixing of the two styles.
> However, I'm not sure which approach to take in the long run; the
> Customize interface is ideal for initially setting options, because you
> can look at all the available options at once. OTOH, having a section with
> my own expressions in the file is much better for keeping track of
> everything afterward.
>
> Something similar to this was discussed in this list ("is Customize the
> right advice to give?") back in 1999. Variation in preferences was very
> large. Is there some general consensus regarding this today, given that
> Customize seems to have improved since 1999?
>

What I found works well for me is to put a bit of elisp at the
beginning of my .emacs file which tells emacs to look in my own
.emacs.d directory and load the files in that directory. I then can
break up all my own customization code into individual files within
this directory, which makes it easy to temporarily remove a
customization or add new ones. The side effect of doing this is that
my .emacs file only contains one bit of elisp code and the 'customize'
settings. 

Prior to adding the bit of elisp, I took an even simpler approach
where I added my .emacs.d directory to the load path and then put
(provide 'my-xxx)  lines in all my setup files. Then I'd have lines like

(require 'my-gnusconf)
(require 'my-vmconf)

in my .emacs file to load each of my config files. 

both methods worked fine. However, I like the version I have now with
the function to load the files as it provides better debuggin/tracking
mechanisms. If some new change causes a problem with .emacs and you
get the "Cannot load .emacs" error at startup, you can identify which
is the offending file slightly more easily than you can using the
require/provide approach. The require/provide approach has the
advantage that your configs won't be loaded more than once (which can
have unexpected side effects) should you decide to re-load .emacs

Tim
-- 
Tim Cross
The e-mail address on this message is FALSE (obviously!). My real e-mail is
to a company in Australia called rapttech and my login is tcross - if you 
really need to send mail, you should be able to work it out!

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

* Re: customize versus own expressions in .emacs
  2005-04-02  4:29 ` Tim X
@ 2005-04-04 13:39   ` J. David Boyd
  2005-04-07  9:42     ` Tim X
  0 siblings, 1 reply; 14+ messages in thread
From: J. David Boyd @ 2005-04-04 13:39 UTC (permalink / raw)


Tim X <timx@spamto.devnul.com> writes:

>
> What I found works well for me is to put a bit of elisp at the
> beginning of my .emacs file which tells emacs to look in my own
> .emacs.d directory and load the files in that directory. 

And you aren't going to share this piece of code?  We have to work it out for
ourselves? :->

Dave

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

* Re: customize versus own expressions in .emacs
  2005-04-04 13:39   ` J. David Boyd
@ 2005-04-07  9:42     ` Tim X
  2005-04-07 11:42       ` Pascal Bourguignon
  2005-04-07 12:34       ` J. David Boyd
  0 siblings, 2 replies; 14+ messages in thread
From: Tim X @ 2005-04-07  9:42 UTC (permalink / raw)


dave@adboyd.com (J. David Boyd) writes:


> Tim X <timx@spamto.devnul.com> writes:
>
>>
>> What I found works well for me is to put a bit of elisp at the
>> beginning of my .emacs file which tells emacs to look in my own
>> .emacs.d directory and load the files in that directory. 
>
> And you aren't going to share this piece of code?  We have to work it out for
> ourselves? :->
>

Hey, half the fun of emacs is working that sort of stuff out
yourself! However, if someone really does want my bit of unworthy
code, I'll provide it.

Tim

-- 
Tim Cross
The e-mail address on this message is FALSE (obviously!). My real e-mail is
to a company in Australia called rapttech and my login is tcross - if you 
really need to send mail, you should be able to work it out!

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

* Re: customize versus own expressions in .emacs
  2005-04-07  9:42     ` Tim X
@ 2005-04-07 11:42       ` Pascal Bourguignon
  2005-04-07 12:34       ` J. David Boyd
  1 sibling, 0 replies; 14+ messages in thread
From: Pascal Bourguignon @ 2005-04-07 11:42 UTC (permalink / raw)


Tim X <timx@spamto.devnul.com> writes:

> dave@adboyd.com (J. David Boyd) writes:
> 
> 
> > Tim X <timx@spamto.devnul.com> writes:
> >
> >>
> >> What I found works well for me is to put a bit of elisp at the
> >> beginning of my .emacs file which tells emacs to look in my own
> >> .emacs.d directory and load the files in that directory. 
> >
> > And you aren't going to share this piece of code?  We have to work it out for
> > ourselves? :->
> >
> 
> Hey, half the fun of emacs is working that sort of stuff out
> yourself! However, if someone really does want my bit of unworthy
> code, I'll provide it.

Let's compare:

(let ((show-messages nil)) ;;should we show *Messages*
  (mapcar
   (lambda (path)
     (unless (and pjb:+light-emacs+
                  (member path
                          '("pjb-banks-old"
                            "pjb-banks"
                            "pjb-bourse"
                            "pjb-cl-faces"
                            "pjb-computer-paper"
                            "pjb-constants"
                            "pjb-cvs"
                            "pjb-cvspass"
                            "pjb-dot"
                            "pjb-graph"
                            "pjb-i2p-expression"
                            "pjb-invoices"
                            "pjb-layers"
                            "pjb-make-depends"
                            "pjb-roman"
                            "pjb-s2p-expression"
                            "pjb-secouer"
                            "pjb-selftrade"
                            "pjb-server"
                            "pjb-transpose"
                            "pjb-vm-kill-file"
                            "pjb-worldfact")))
       (condition-case cc
           (progn
             (load path  pjb:*load-noerror* nil) ;;pjb:*load-silent*)
            )
         ('error
          (setq show-messages t)
          (message (format "ERROR: %S" cc ))))))
   (append
    ;; all the files
    (if (file-directory-p
         (concatenate 'string (USER-HOMEDIR-PATHNAME) "/src/public/emacs"))
      (mapcar (FUNCTION PATHNAME-NAME)
              (DIRECTORY (concatenate 'string (USER-HOMEDIR-PATHNAME)
                                      "/src/public/emacs/pjb-*.el")))
      (mapcar
       (FUNCTION PATHNAME-NAME)
       (DIRECTORY
        "/usr/local/share/lisp/packages/com/informatimago/emacs/pjb-*.el")))
    (list ;; some additional dynamic data:
     "~/.emacs-devises" )))
  (when show-messages
    (switch-to-buffer "*Messages*")
    (split-window-vertically)) )


(It's all very personnal...)

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
Grace personified,
I leap into the window.
I meant to do that.

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

* Re: customize versus own expressions in .emacs
  2005-04-07  9:42     ` Tim X
  2005-04-07 11:42       ` Pascal Bourguignon
@ 2005-04-07 12:34       ` J. David Boyd
  2005-04-07 16:45         ` Joe Corneli
  2005-04-11  9:47         ` Tim X
  1 sibling, 2 replies; 14+ messages in thread
From: J. David Boyd @ 2005-04-07 12:34 UTC (permalink / raw)


Tim X <timx@spamto.devnul.com> writes:

> dave@adboyd.com (J. David Boyd) writes:
>
>
>> Tim X <timx@spamto.devnul.com> writes:
>>
>>>
>>> What I found works well for me is to put a bit of elisp at the beginning
>>> of my .emacs file which tells emacs to look in my own .emacs.d directory
>>> and load the files in that directory.
>>
>> And you aren't going to share this piece of code?  We have to work it out
>> for ourselves? :->
>>
>
> Hey, half the fun of emacs is working that sort of stuff out yourself!
> However, if someone really does want my bit of unworthy code, I'll provide
> it.
>

I want it.  I'm not looking for fun, I'm using Emacs! :->

Dave

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

* Re: customize versus own expressions in .emacs
  2005-04-07 12:34       ` J. David Boyd
@ 2005-04-07 16:45         ` Joe Corneli
  2005-04-11  9:47         ` Tim X
  1 sibling, 0 replies; 14+ messages in thread
From: Joe Corneli @ 2005-04-07 16:45 UTC (permalink / raw)



   >>> What I found works well for me is to put a bit of elisp at the beginning
   >>> of my .emacs file which tells emacs to look in my own .emacs.d directory
   >>> and load the files in that directory.
   >>
   >> And you aren't going to share this piece of code?  We have to work it out
   >> for ourselves? :->
   >>
   >
   > Hey, half the fun of emacs is working that sort of stuff out yourself!
   > However, if someone really does want my bit of unworthy code, I'll provide
   > it.
   >

   I want it.  I'm not looking for fun, I'm using Emacs! :->

As I think I may have mentioned somewhere else on this thread, I have
an alias causes emacs to run with '-l joes_loads.el' command line
argument.  This is, to me, a better idea than putting your own "own"
expressions in .emacs or even having the command to load them in the
.emacs, except in the case of code that really needs to be there
(e.g. as with frame configs), because this way you can drop the flag
or change it.

And, as you see, it is really a 0 line program.

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

* Re: customize versus own expressions in .emacs
  2005-04-07 12:34       ` J. David Boyd
  2005-04-07 16:45         ` Joe Corneli
@ 2005-04-11  9:47         ` Tim X
  1 sibling, 0 replies; 14+ messages in thread
From: Tim X @ 2005-04-11  9:47 UTC (permalink / raw)


dave@adboyd.com (J. David Boyd) writes:

> Tim X <timx@spamto.devnul.com> writes:
>
>> dave@adboyd.com (J. David Boyd) writes:
>>
>>
>>> Tim X <timx@spamto.devnul.com> writes:
>>>
>>>>
>>>> What I found works well for me is to put a bit of elisp at the beginning
>>>> of my .emacs file which tells emacs to look in my own .emacs.d directory
>>>> and load the files in that directory.
>>>
>>> And you aren't going to share this piece of code?  We have to work it out
>>> for ourselves? :->
>>>
>>
>> Hey, half the fun of emacs is working that sort of stuff out yourself!
>> However, if someone really does want my bit of unworthy code, I'll provide
>> it.
>>
>
> I want it.  I'm not looking for fun, I'm using Emacs! :->
>

OK - if you want it, you get it. I've used a number of 'incantations'
at the beginning of my .emacs to load my own files. As previously
mentioned, I now just use (provide 'xxx) at the end of each of my
emacs files and then just put a (require 'xxx) in my .emacs to load
them. However, before doing that, I used 

(defvar my-load-dir "~/.emacs.d")

(let ((files (directory-files (expand-file-name my-load-dir) t ".*\\.el$")))
  (mapcar (lambda (file)
			(load-file file)
		  files)))

which works OK, but doesn't really have enough (any) error checking. I
then decided to see what other solutions I could find and stumbled on
the debian-run-directories, which is included in debian-startup.el on
all debian Linux based systems. This did what I wanted a little more
robustly than my simple 'mapcar' approach. then I moved to using
provide/require - which is where I am at now.

The thing I discovered from this process was that for a large number
of things you will probably find either the answer or some code which
is close to what you need right there on your system already. Use
apropos and the sources and you will rarely need to be original!

Tim



-- 
Tim Cross
The e-mail address on this message is FALSE (obviously!). My real e-mail is
to a company in Australia called rapttech and my login is tcross - if you 
really need to send mail, you should be able to work it out!

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

end of thread, other threads:[~2005-04-11  9:47 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.353.1111951880.28103.help-gnu-emacs@gnu.org>
2005-03-29 14:55 ` customize versus own expressions in .emacs Stefan Monnier
2005-04-02  4:29 ` Tim X
2005-04-04 13:39   ` J. David Boyd
2005-04-07  9:42     ` Tim X
2005-04-07 11:42       ` Pascal Bourguignon
2005-04-07 12:34       ` J. David Boyd
2005-04-07 16:45         ` Joe Corneli
2005-04-11  9:47         ` Tim X
2005-03-27 19:22 Sebastian Luque
     [not found] ` <87d5tklwr5.fsf-by2PdLBuqAc@public.gmane.org>
2005-03-27 21:39   ` Jochen Küpper
2005-03-29 10:11 ` Peter Dyballa
     [not found] ` <mailman.484.1112092111.28103.help-gnu-emacs@gnu.org>
2005-03-29 11:33   ` Thien-Thi Nguyen
2005-03-29 14:47     ` Joe Corneli
2005-03-29 14:57   ` Stefan Monnier

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.