* how to patch diff into source code?
@ 2009-01-21 2:08 Xah Lee
2009-01-21 21:29 ` Lennart Borgman
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Xah Lee @ 2009-01-21 2:08 UTC (permalink / raw)
To: help-gnu-emacs
could anyone help me with a diff/patch question?
i got the following patch:
--- lisp\textmodes\css-mode.el.orig 2008-03-01 20:28:16.000000000
+0100
+++ lisp\textmodes\css-mode.el 2009-01-19 09:14:55.138125000 +0100
@@ -369,5 +369,5 @@
(forward-comment (- (point-max)))
;; FIXME: We should also skip punctuation.
- (not (memq (char-before) '(?\; ?\
{)))))))))))
+ (not (or (bobp) (memq (char-before) '(?\;
?\{))))))))))))
(defun css-forward-sexp (n)
how do i use diff (or other?) to merge it into source?
i've never used diff for patching.
i just found and used menu Tools‣Apply Patch, but then i got
patching file /Users/xah/web/emacs/css-mode.el
patch: **** malformed patch at line 8: ?\{))))))))))))
is it something i did wrong or the patch?
Thanks.
Xah
∑ http://xahlee.org/
☄
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: how to patch diff into source code?
2009-01-21 2:08 how to patch diff into source code? Xah Lee
@ 2009-01-21 21:29 ` Lennart Borgman
2009-01-21 21:30 ` Xah Lee
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Lennart Borgman @ 2009-01-21 21:29 UTC (permalink / raw)
To: Xah Lee; +Cc: help-gnu-emacs
On Wed, Jan 21, 2009 at 3:08 AM, Xah Lee <xahlee@gmail.com> wrote:
> could anyone help me with a diff/patch question?
>
> i got the following patch:
>
> --- lisp\textmodes\css-mode.el.orig 2008-03-01 20:28:16.000000000
> +0100
> +++ lisp\textmodes\css-mode.el 2009-01-19 09:14:55.138125000 +0100
> @@ -369,5 +369,5 @@
> (forward-comment (- (point-max)))
> ;; FIXME: We should also skip punctuation.
> - (not (memq (char-before) '(?\; ?\
> {)))))))))))
> + (not (or (bobp) (memq (char-before) '(?\;
> ?\{))))))))))))
>
> (defun css-forward-sexp (n)
>
> how do i use diff (or other?) to merge it into source?
> i've never used diff for patching.
>
> i just found and used menu Tools‣Apply Patch, but then i got
>
> patching file /Users/xah/web/emacs/css-mode.el
> patch: **** malformed patch at line 8: ?\{))))))))))))
>
> is it something i did wrong or the patch?
I know very little about diff, but it looks like the -+ rows are
wrapped. However when I recently applied a patch with CVS Emacs (using
the commands in the Diff menu) Emacs asked me if it should correct the
wrapped lines.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: how to patch diff into source code?
2009-01-21 2:08 how to patch diff into source code? Xah Lee
2009-01-21 21:29 ` Lennart Borgman
@ 2009-01-21 21:30 ` Xah Lee
2009-01-21 22:55 ` Ian Eure
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Xah Lee @ 2009-01-21 21:30 UTC (permalink / raw)
To: help-gnu-emacs
it turns out the patch is corrupted by email.
Xah
On Jan 20, 6:08 pm, Xah Lee <xah...@gmail.com> wrote:
> could anyone help me with a diff/patch question?
>
> i got the following patch:
>
> --- lisp\textmodes\css-mode.el.orig 2008-03-01 20:28:16.000000000
> +0100
> +++ lisp\textmodes\css-mode.el 2009-01-19 09:14:55.138125000 +0100
> @@ -369,5 +369,5 @@
> (forward-comment (- (point-max)))
> ;; FIXME: We should also skip punctuation.
> - (not (memq (char-before) '(?\; ?\
> {)))))))))))
> + (not (or (bobp) (memq (char-before) '(?\;
> ?\{))))))))))))
>
> (defun css-forward-sexp (n)
>
> how do i use diff (or other?) to merge it into source?
> i've never used diff for patching.
>
> i just found and used menu Tools‣Apply Patch, but then i got
>
> patching file /Users/xah/web/emacs/css-mode.el
> patch: **** malformed patch at line 8: ?\{))))))))))))
>
> is it something i did wrong or the patch?
>
> Thanks.
>
> Xah
> ∑http://xahlee.org/
>
> ☄
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: how to patch diff into source code?
2009-01-21 2:08 how to patch diff into source code? Xah Lee
2009-01-21 21:29 ` Lennart Borgman
2009-01-21 21:30 ` Xah Lee
@ 2009-01-21 22:55 ` Ian Eure
2009-01-21 23:23 ` Juanma Barranquero
[not found] ` <mailman.5472.1232580233.26697.help-gnu-emacs@gnu.org>
4 siblings, 0 replies; 6+ messages in thread
From: Ian Eure @ 2009-01-21 22:55 UTC (permalink / raw)
To: Xah Lee; +Cc: help-gnu-emacs
On Jan 20, 2009, at 6:08 PM, Xah Lee wrote:
> could anyone help me with a diff/patch question?
>
> i got the following patch:
>
> (snip)
>
> is it something i did wrong or the patch?
>
Maybe both, it's hard to tell if that's the patch, or if it's getting
mangled because of email.
Generally, you create patches with diff and apply them with patch. E.g.:
$ patch < thepatchfile
You need to make note of the paths in the header, and make sure you:
1. Put the patch in the same relative location as it was generated
from, i.e. you can do "ls lisp\textmodes\css-mode.el" and you see the
correct file.
2. Pass a prune argument to patch; this strips off the leading part
of the path in the patch. So if you were in the `lisp' directory,
you'd give it -p1, if you were in `textmodes', you'd give it -p2, and
so on.
Alternately, you can place the patch file in the correct location,
open it with Emacs, and use C-c C-a (diff-apply-hunk) to apply the
changes within Emacs.
- Ian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: how to patch diff into source code?
2009-01-21 2:08 how to patch diff into source code? Xah Lee
` (2 preceding siblings ...)
2009-01-21 22:55 ` Ian Eure
@ 2009-01-21 23:23 ` Juanma Barranquero
[not found] ` <mailman.5472.1232580233.26697.help-gnu-emacs@gnu.org>
4 siblings, 0 replies; 6+ messages in thread
From: Juanma Barranquero @ 2009-01-21 23:23 UTC (permalink / raw)
To: Xah Lee; +Cc: help-gnu-emacs
On Wed, Jan 21, 2009 at 03:08, Xah Lee <xahlee@gmail.com> wrote:
> could anyone help me with a diff/patch question?
> - (not (memq (char-before) '(?\; ?\
> {)))))))))))
> + (not (or (bobp) (memq (char-before) '(?\;
> ?\{))))))))))))
??
I sent you a private e-mail explaining that the patch had been mangled
by the mail program, and I sent you the corrected lines. Did you
receive it?
> patching file /Users/xah/web/emacs/css-mode.el
> patch: **** malformed patch at line 8: ?\{))))))))))))
>
> is it something i did wrong or the patch?
The lines are mangled. The line starting with "-" should be
concatenated with the following one, but inserting one space between
both lines. The same goes for the line starting with "+" and the
following line.
But it is easier if you just copy them from my e-mail (or patch it by
hand, which is even easier).
Juanma
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: how to patch diff into source code?
[not found] ` <mailman.5472.1232580233.26697.help-gnu-emacs@gnu.org>
@ 2009-01-21 23:33 ` Xah Lee
0 siblings, 0 replies; 6+ messages in thread
From: Xah Lee @ 2009-01-21 23:33 UTC (permalink / raw)
To: help-gnu-emacs
On Jan 21, 3:23 pm, Juanma Barranquero <lek...@gmail.com> wrote:
> I sent you a private e-mail explaining that the patch had been mangled
> by the mail program, and I sent you the corrected lines. Did you
> receive it?
Yes. Got it. That caused me to post a addendum in this thread that the
patch i posed was mangled just for public info.
Thanks again.
Xah
∑ http://xahlee.org/
☄
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-01-21 23:33 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-21 2:08 how to patch diff into source code? Xah Lee
2009-01-21 21:29 ` Lennart Borgman
2009-01-21 21:30 ` Xah Lee
2009-01-21 22:55 ` Ian Eure
2009-01-21 23:23 ` Juanma Barranquero
[not found] ` <mailman.5472.1232580233.26697.help-gnu-emacs@gnu.org>
2009-01-21 23:33 ` Xah Lee
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).