* problems with ediff-startup-hooks
@ 2006-02-27 14:38 bhenz
2006-03-01 18:45 ` Kevin Rodgers
0 siblings, 1 reply; 3+ messages in thread
From: bhenz @ 2006-02-27 14:38 UTC (permalink / raw)
[-- Attachment #1.1: Type: text/plain, Size: 1544 bytes --]
Hi all,
I running emacs 21.4.1. I'm trying to do some fancy ediff stuff.
Actually not terribly fancy, I just want to invoke it from the command
line with parmeters similar to "diff", specifically using the -L option to
give more descriptive names to the buffers. Currently I can ediff two
files by doing the following...
emacs --eval='(progn (setq ediff-diff-options "-wbB") (ediff-files "file1"
"file2"))'
Maybe there's an easier/better way?
ANYWAY,
The path I'm currently on requires me to hook into the
"ediff-startup-hooks" with the following code in my .emacs file...
(require 'ediff)
;; Get rid of the annoying little (separate) ediff window and
;; turn it into a 3rd pane in the main emacs window.
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
;; Put files side-by-side
;(setq ediff-split-window-function 'split-window-horizontally)
(defun my-ediff-startup-hooks ()
(set-buffer ediff-buffer-A)
(rename-buffer "bobA")
(set-buffer ediff-buffer-B)
(rename-buffer "bobB")
)
(add-hook 'ediff-startup-hooks 'my-ediff-startup-hooks)
OK, so this is just baby-step code because clearly "bobA" and "bobB" are
not useful, but I can't even get THIS to work! I even tried inserting a
line I knew would fail in the defined function (something like
(undefined_bob_qwerty)) and I never got a complaint when I fired up a new
instance of ediff.
(but I know it was picking up my changes to .emacs because if I made a syntax error then it would warn me about that.)
What am I doing wrong?
Thanks,
Bob
[-- Attachment #1.2: Type: text/html, Size: 2797 bytes --]
[-- Attachment #2: Type: text/plain, Size: 152 bytes --]
_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: problems with ediff-startup-hooks
2006-02-27 14:38 problems with ediff-startup-hooks bhenz
@ 2006-03-01 18:45 ` Kevin Rodgers
0 siblings, 0 replies; 3+ messages in thread
From: Kevin Rodgers @ 2006-03-01 18:45 UTC (permalink / raw)
bhenz@Lexmark.com wrote:
> I running emacs 21.4.1. I'm trying to do some fancy ediff stuff.
>
> Actually not terribly fancy, I just want to invoke it from the command
> line with parmeters similar to "diff", specifically using the -L option
> to give more descriptive names to the buffers. Currently I can ediff two
> files by doing the following...
>
> emacs --eval='(progn (setq ediff-diff-options "-wbB") (ediff-files
> "file1" "file2"))'
>
> Maybe there's an easier/better way?
Looks good to me, but here's a snippet that'll let you run
emacs --diff file1 file2
Perhaps you can tweak it to accept ediff-diff-options as a command line
argument as well.
(defun diff-command-line-args (switch)
"Run `ediff-files' on the following 2 command line arguments (after
SWITCH)."
;; (prog1 ...) == (pop command-line-args-left):
(let ((file-a (prog1 (car command-line-args-left)
(setq command-line-args-left
(cdr command-line-args-left))))
(file-b (prog1 (car command-line-args-left)
(setq command-line-args-left
(cdr command-line-args-left)))))
(ediff-files file-a file-b)))
(setq command-switch-alist
(cons '("--diff" . diff-command-line-args) command-switch-alist))
> ANYWAY,
>
> The path I'm currently on requires me to hook into the
> "ediff-startup-hooks" with the following code in my .emacs file...
>
> (require 'ediff)
>
> ;; Get rid of the annoying little (separate) ediff window and
> ;; turn it into a 3rd pane in the main emacs window.
> (setq ediff-window-setup-function 'ediff-setup-windows-plain)
>
> ;; Put files side-by-side
> ;(setq ediff-split-window-function 'split-window-horizontally)
>
> (defun my-ediff-startup-hooks ()
> (set-buffer ediff-buffer-A)
> (rename-buffer "bobA")
> (set-buffer ediff-buffer-B)
> (rename-buffer "bobB")
> )
>
> (add-hook 'ediff-startup-hooks 'my-ediff-startup-hooks)
>
> OK, so this is just baby-step code because clearly "bobA" and "bobB" are
> not useful, but I can't even get THIS to work! I even tried inserting a
> line I knew would fail in the defined function (something like
> (undefined_bob_qwerty)) and I never got a complaint when I fired up a
> new instance of ediff.
>
> (but I know it was picking up my changes to .emacs because if I made a
> /syntax/ error then it would warn me about that.)
>
> What am I doing wrong?
AFAIK, the name of the variable is ediff-startup-hook (no "s").
--
Kevin Rodgers
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: problems with ediff-startup-hooks
@ 2006-03-02 14:42 bhenz
0 siblings, 0 replies; 3+ messages in thread
From: bhenz @ 2006-03-02 14:42 UTC (permalink / raw)
[-- Attachment #1.1: Type: text/plain, Size: 2015 bytes --]
why do I keep getting this message over-and-over when I only sent it
once?!
bhenz@Lexmark.com
Sent by: help-gnu-emacs-bounces+bhenz=lexmark.com@gnu.org
02/27/2006 09:38 AM
To: help-gnu-emacs@gnu.org
cc:
Subject: problems with ediff-startup-hooks
Hi all,
I running emacs 21.4.1. I'm trying to do some fancy ediff stuff.
Actually not terribly fancy, I just want to invoke it from the command
line with parmeters similar to "diff", specifically using the -L option to
give more descriptive names to the buffers. Currently I can ediff two
files by doing the following...
emacs --eval='(progn (setq ediff-diff-options "-wbB") (ediff-files "file1"
"file2"))'
Maybe there's an easier/better way?
ANYWAY,
The path I'm currently on requires me to hook into the
"ediff-startup-hooks" with the following code in my .emacs file...
(require 'ediff)
;; Get rid of the annoying little (separate) ediff window and
;; turn it into a 3rd pane in the main emacs window.
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
;; Put files side-by-side
;(setq ediff-split-window-function 'split-window-horizontally)
(defun my-ediff-startup-hooks ()
(set-buffer ediff-buffer-A)
(rename-buffer "bobA")
(set-buffer ediff-buffer-B)
(rename-buffer "bobB")
)
(add-hook 'ediff-startup-hooks 'my-ediff-startup-hooks)
OK, so this is just baby-step code because clearly "bobA" and "bobB" are
not useful, but I can't even get THIS to work! I even tried inserting a
line I knew would fail in the defined function (something like
(undefined_bob_qwerty)) and I never got a complaint when I fired up a new
instance of ediff.
(but I know it was picking up my changes to .emacs because if I made a syntax error then it would warn me about that.)
What am I doing wrong?
Thanks,
Bob_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
[-- Attachment #1.2: Type: text/html, Size: 4935 bytes --]
[-- Attachment #2: Type: text/plain, Size: 152 bytes --]
_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-03-02 14:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-27 14:38 problems with ediff-startup-hooks bhenz
2006-03-01 18:45 ` Kevin Rodgers
-- strict thread matches above, loose matches on Subject: below --
2006-03-02 14:42 bhenz
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).