all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* emacs configuration
@ 2021-09-30 15:13 Jude DaShiell
  2021-09-30 15:56 ` tomas
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Jude DaShiell @ 2021-09-30 15:13 UTC (permalink / raw)
  To: help-gnu-emacs

Has emacs got something like an #include directive that can be used as it
is in C?  If so, it might be worth using it to tidy up my .emacs file.




^ permalink raw reply	[flat|nested] 19+ messages in thread
[parent not found: <mailman.1033485728.6848.help-gnu-emacs@gnu.org>]
* Re: Emacs configuration
@ 2002-10-01 15:21 arthur.chereau
  0 siblings, 0 replies; 19+ messages in thread
From: arthur.chereau @ 2002-10-01 15:21 UTC (permalink / raw)
  Cc: harder

> Right, setf is defined in cl, try this:
>
>   (require 'cl)
>   (setf (nth 3 (assoc 'print-buffer tool-bar-map)) 'a2ps-buffer)

That works, thanks !

> Try this instead:

> (defun jh-setup-scratch ()
>   (with-current-buffer "*scratch*"
>     (setq buffer-offer-save t)
>     (make-local-variable 'kill-buffer-query-functions)
>     (setq kill-buffer-query-functions
>           (list (lambda ()
>                   (if (buffer-modified-p)
>                       (y-or-n-p "Really kill buffer? ")
>                    t))))))
>
> (add-hook 'emacs-startup-hook 'jh-setup-scratch)

That works too !

> I think that should be
>
> (setq user-init-file "/path/to/home/.emacs.d/.emacs")
>
> What do you see when you do `C-h v user-init-file'?

It's undefined if .emacs is in ~/.emacs.d/, and if I put 2 .emacs (one in ~/ and one in
~/.emacs.d/), it always says "/home/arthur/.emacs".

What's strange is that strace reports:
stat64("/usr/share/emacs/site-lisp/site-start.el", {st_mode=S_IFREG|0644, st_size=1001,
...}) = 0
open("/usr/share/emacs/site-lisp/site-start.el", O_RDONLY|O_LARGEFILE) = 3
close(3)                                = 0
stat64("/usr/share/emacs/site-lisp/site-start.el", {st_mode=S_IFREG|0644, st_size=1001,
...}) = 0
open("/usr/share/emacs/site-lisp/site-start.el", O_RDONLY|O_LARGEFILE) = 3
close(3)                                = 0
stat64("/usr/share/emacs/site-lisp/site-start.el", {st_mode=S_IFREG|0644, st_size=1001,
...}) = 0
open("/usr/share/emacs/site-lisp/site-start.el", O_RDONLY|O_LARGEFILE) = 3
read(3, "(setq user-init-file \"/home/arth"..., 1053) = 1053
close(3)                                = 0
stat64("/home/arthur/.emacs.elc", 0xbfffeb28) = -1 ENOENT (No such file or directory)
stat64("/home/arthur/.emacs.elc.gz", 0xbfffeb28) = -1 ENOENT (No such file or directory)
stat64("/home/arthur/.emacs.el.gz", 0xbfffeb28) = -1 ENOENT (No such file or directory)
stat64("/home/arthur/.emacs.el", 0xbfffeb28) = -1 ENOENT (No such file or directory)
stat64("/home/arthur/.emacs", {st_mode=S_IFREG|0644, st_size=15632, ...}) = 0
open("/home/arthur/.emacs", O_RDONLY|O_LARGEFILE) = 3
close(3)                                = 0

site-start.el is:
(setq user-init-file "/home/arthur/.emacs.d/.emacs")

So I think I'm missing something with site-start.el but can't figure out what.

------------------------------------------

Faites un voeu et puis Voila ! www.voila.fr

^ permalink raw reply	[flat|nested] 19+ messages in thread
[parent not found: <mailman.1033477527.28155.help-gnu-emacs@gnu.org>]
* Re: Emacs configuration
@ 2002-10-01 13:04 arthur.chereau
  0 siblings, 0 replies; 19+ messages in thread
From: arthur.chereau @ 2002-10-01 13:04 UTC (permalink / raw)
  Cc: harder

Hi,

Thanks for your answers !

> I don't know the command `a2ps-buffer' -- do you mean `ps-print-buffer'?

a2ps-buffer is from a2ps-print.el. It makes emacs print through a2ps.
You can find it at ftp://ftp.cppsig.org/pub/tools/emacs/

> You can change the command from `print-buffer' to `ps-print-buffer' like
> this:

>   (setf (nth 3 (assoc 'print-buffer tool-bar-map)) 'ps-print-buffer)

Unfortunately I get the following error when I try this:
Symbol's function definition is void: setf

In fact I would like to keep the print-buffer and ps-print-buffer commands, but
to attach a2ps-buffer to the printer icon.

> > - How is it possible to force emacs to confirm when killing the
> >  *scratch* buffer ?

> (save-excursion
>   (set-buffer "*scratch*")
>   (make-local-variable 'kill-buffer-query-functions)
>   (setq kill-buffer-query-functions
>         (list (lambda ()
>                 (if (buffer-modified-p)
>                     (y-or-n-p "Really kill buffer? ")
>                   t)))))

Unfortunately this doesn't work either. When I just call
$ emacs
then type in and C-x C-c, emacs dies without prompting to save the buffer.

I use emacs 21.2 and I've changed
(setq default-major-mode 'text-mode)
(setq initial-major-mode 'text-mode)

but when I use a minimal .emacs only containing your code it's the same, so I
don't understand why it doesn't work.

Maybe it's possible to automatically kill the *scratch* buffer when emacs
starts and replace it with something like a "_scratch_" buffer that would be a
normal text buffer ("_scratch_" being a default name used when emacs is called
without an argument). But I've read that killing the *scratch* buffer may be
dangereous, so I don't know...

> You can set `user-init-file' in your site-start.el file to tell Emacs
> where to look for .emacs.

I've tried to use site-start.el but I think I'm missing something:

First, I'm sure site-start.el is read by emacs (seen with strace and if
something is wrong in site-start.el emacs complains)

I had these lines in my .emacs:
(setq my-emacsdir (expand-file-name "~/.emacs.d"))
(setq recentf-save-file (concat my-emacsdir "recentf"))
(setq save-place-file (concat my-emacsdir "places"))
When I put them in site-start.el they have no effect.

I tried to put some variants of
(setq user-init-file ".emacs.d/.emacs")
in site-start.el, but it didn't work, maybe for the same reason the previous
setq had no effect.

What I would like to do is to change
- the ~/.emacs.d/ directory into ~/.emacs/
- the .emacs location to ~/.emacs/
- the .emacs name into emacs.el
so that everything would be in ~/.emacs/ and the init file would be
~/.emacs/emacs.el

I don't know if emacs can do that.

------------------------------------------

Faites un voeu et puis Voila ! www.voila.fr

^ permalink raw reply	[flat|nested] 19+ messages in thread
* Emacs configuration
@ 2002-09-30  9:22 arthur.chereau
  0 siblings, 0 replies; 19+ messages in thread
From: arthur.chereau @ 2002-09-30  9:22 UTC (permalink / raw)


Hi,

I'm configuring emacs 21.2 and there are some things I can't find any doc about, so I'm
asking you:

- How is it possible to configure the action done by the printer icon ? I'd like it to
call a2ps-buffer.

- How is it possible to force emacs to confirm when killing the *scratch* buffer ?

- Is it possible to change the menu ordering, for instance moving Buffers before Files ?

- Is there any means of having only one emacs process running for all the emacs windows
? I mean, not like emacsclient or gnuserv, but when one calls emacs from the command
line, having emacs spawn a new window like C-x 5 2 but no new process (to speed up the
start). Then, is it possible to have multiple emacs windows that share the same process
but don't share buffers (that is, "independant" windows) ?

- Last, is it possible to put all the configuration files under a ~/.emacs/ directory,
containing the .emacs file and the contents of the ~/ .emacs.d/ directory ?

Thanks !

------------------------------------------

Faites un voeu et puis Voila ! www.voila.fr

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

end of thread, other threads:[~2021-10-01 20:34 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1033377809.21117.help-gnu-emacs@gnu.org>
2002-09-30 17:01 ` Emacs configuration Jesper Harder
2002-09-30 17:02 ` Kevin Rodgers
2002-10-01  6:04 ` Evgeny Roubinchtein
2002-10-01 14:57 ` Stefan Monnier <foo@acm.com>
2021-09-30 15:13 emacs configuration Jude DaShiell
2021-09-30 15:56 ` tomas
2021-09-30 16:05   ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-30 15:57 ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-09-30 17:32   ` 2QdxY4RzWzUUiLuE
2021-09-30 21:49   ` Jean Louis
2021-09-30 22:11     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-10-01 20:34       ` Jean Louis
2021-09-30 16:03 ` 2QdxY4RzWzUUiLuE
2021-09-30 16:38 ` John W Higgins
     [not found] <mailman.1033485728.6848.help-gnu-emacs@gnu.org>
2002-10-01 20:45 ` Emacs configuration Jesper Harder
  -- strict thread matches above, loose matches on Subject: below --
2002-10-01 15:21 arthur.chereau
     [not found] <mailman.1033477527.28155.help-gnu-emacs@gnu.org>
2002-10-01 14:09 ` Jesper Harder
2002-10-01 13:04 arthur.chereau
2002-09-30  9:22 arthur.chereau

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.