unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#9409: 24.0.50; log-view-msg-prev, easy-mmode
@ 2011-08-30 19:31 Eduard Wiebe
  2011-09-03  0:37 ` Glenn Morris
  0 siblings, 1 reply; 7+ messages in thread
From: Eduard Wiebe @ 2011-08-30 19:31 UTC (permalink / raw)
  To: 9409

[-- Attachment #1: Type: text/plain, Size: 178 bytes --]


 Hi all,

it bothers me that in some situation i cannot reach the head information
of the `vc-print-log' via `log-view-msg-prev'.

I fixed the issue by following simple patch.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: easy-mmode.el.patch --]
[-- Type: text/x-diff, Size: 530 bytes --]

=== modified file 'lisp/emacs-lisp/easy-mmode.el'
--- lisp/emacs-lisp/easy-mmode.el	2011-01-25 04:08:28 +0000
+++ lisp/emacs-lisp/easy-mmode.el	2011-08-27 16:50:49 +0000
@@ -578,7 +578,8 @@
 	 (if (< count 0) (,next-sym (- count))
            ,(funcall when-narrowed
              `(unless (re-search-backward ,re nil t count)
-                (error "No previous %s" ,name)))
+                (goto-char (point-min))
+		(error "No previous %s" ,name)))
            ,@body))
        (put ',prev-sym 'definition-name ',base))))
 


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

* bug#9409: 24.0.50; log-view-msg-prev, easy-mmode
  2011-08-30 19:31 bug#9409: 24.0.50; log-view-msg-prev, easy-mmode Eduard Wiebe
@ 2011-09-03  0:37 ` Glenn Morris
  2011-09-03 17:41   ` Eduard Wiebe
  0 siblings, 1 reply; 7+ messages in thread
From: Glenn Morris @ 2011-09-03  0:37 UTC (permalink / raw)
  To: Eduard Wiebe; +Cc: 9409

Eduard Wiebe wrote:

>               `(unless (re-search-backward ,re nil t count)
> -                (error "No previous %s" ,name)))
> +                (goto-char (point-min))
> +		(error "No previous %s" ,name)))

Or:

-             `(unless (re-search-backward ,re nil t count)
+             `(unless (re-search-backward ,re nil 'move count)






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

* bug#9409: 24.0.50; log-view-msg-prev, easy-mmode
  2011-09-03  0:37 ` Glenn Morris
@ 2011-09-03 17:41   ` Eduard Wiebe
  2011-09-07  0:40     ` Glenn Morris
  0 siblings, 1 reply; 7+ messages in thread
From: Eduard Wiebe @ 2011-09-03 17:41 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 9409

Glenn Morris <rgm@gnu.org> writes:

> Eduard Wiebe wrote:
>
>>               `(unless (re-search-backward ,re nil t count)
>> -                (error "No previous %s" ,name)))
>> +                (goto-char (point-min))
>> +		(error "No previous %s" ,name)))
>
> Or:
>
> -             `(unless (re-search-backward ,re nil t count)
> +             `(unless (re-search-backward ,re nil 'move count)

Yes, much nicer. Thanks.
Can you apply this patch to the trunk.

-- 
Eduard Wiebe





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

* bug#9409: 24.0.50; log-view-msg-prev, easy-mmode
  2011-09-03 17:41   ` Eduard Wiebe
@ 2011-09-07  0:40     ` Glenn Morris
  2011-09-07 12:39       ` Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: Glenn Morris @ 2011-09-07  0:40 UTC (permalink / raw)
  To: Eduard Wiebe; +Cc: 9409

Eduard Wiebe wrote:

> Can you apply this patch to the trunk.

I'm not sure if the change is appropriate, for all users of that macro.
(I don't have much of an opinion about it.)





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

* bug#9409: 24.0.50; log-view-msg-prev, easy-mmode
  2011-09-07  0:40     ` Glenn Morris
@ 2011-09-07 12:39       ` Stefan Monnier
  2011-09-13 19:38         ` Eduard Wiebe
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2011-09-07 12:39 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 9409, Eduard Wiebe

>> Can you apply this patch to the trunk.
> I'm not sure if the change is appropriate, for all users of that macro.
> (I don't have much of an opinion about it.)

I think the change is a good one.  So if someone could check the various
uses of that macro to make sure it doesn't break anything, we can
install it.


        Stefan





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

* bug#9409: 24.0.50; log-view-msg-prev, easy-mmode
  2011-09-07 12:39       ` Stefan Monnier
@ 2011-09-13 19:38         ` Eduard Wiebe
  2011-09-13 21:02           ` Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: Eduard Wiebe @ 2011-09-13 19:38 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 9409

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>> Can you apply this patch to the trunk.
>> I'm not sure if the change is appropriate, for all users of that macro.
>> (I don't have much of an opinion about it.)
>
> I think the change is a good one. 

1+

> So if someone could check the various uses of that macro to make sure
> it doesn't break anything, we can install it.

I found following uses of the macro:

  1889060   84 -rw-r--r--   1 ew       ew          80974 Sep  9 20:59 vc/diff-mode.el
  1892302   24 -rw-r--r--   1 ew       ew          21559 Aug 27 17:25 vc/log-view.el
  1892363   56 -rw-r--r--   1 ew       ew          51035 Aug 27 17:25 vc/smerge-mode.el
  1889741   20 -rw-r--r--   1 ew       ew          17799 Aug 27 17:25 vc/cvs-status.el

I patched `easy-mmode-define-navigation' as above and tested (marked as X) the
most functions without any trouble.

* diff-mode.el
  - [X] diff-hunk-prev
  - [X] diff-hunk-next
  - [X] diff-file-prev
  - [X] diff-file-next

* log-view.el
  - [X] log-view-msg-prev
  - [X] log-view-msg-next
  - [ ] log-view-file-prev
  - [ ] log-view-file-next

* smerge-mode
  - [ ] smerge-next
  - [ ] smerge-prev

* cvs-status
  - [X] cvs-status-next
  - [X] cvs-status-prev

-- 
Eduard Wiebe





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

* bug#9409: 24.0.50; log-view-msg-prev, easy-mmode
  2011-09-13 19:38         ` Eduard Wiebe
@ 2011-09-13 21:02           ` Stefan Monnier
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2011-09-13 21:02 UTC (permalink / raw)
  To: Eduard Wiebe; +Cc: 9409

> I patched `easy-mmode-define-navigation' as above and tested (marked
> as X) the most functions without any trouble.

> * diff-mode.el
>   - [X] diff-hunk-prev
>   - [X] diff-hunk-next
>   - [X] diff-file-prev
>   - [X] diff-file-next

> * log-view.el
>   - [X] log-view-msg-prev
>   - [X] log-view-msg-next
>   - [ ] log-view-file-prev
>   - [ ] log-view-file-next

> * smerge-mode
>   - [ ] smerge-next
>   - [ ] smerge-prev

> * cvs-status
>   - [X] cvs-status-next
>   - [X] cvs-status-prev

If a problem shows up it's not going to be in the *-prev commands, but
in commands that call those functions internally.  So you need to check
the callers of diff-hunk-prev, diff-file-prev, etc..
It's always good to check with actual testing, but it's also important
to check by looking at the code.  IIUC this will be safe because in the
case where the behavior is changed, the function signals an error, so
only callers which catch this error (with condition-case) might
be affected.


        Stefan





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

end of thread, other threads:[~2011-09-13 21:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-30 19:31 bug#9409: 24.0.50; log-view-msg-prev, easy-mmode Eduard Wiebe
2011-09-03  0:37 ` Glenn Morris
2011-09-03 17:41   ` Eduard Wiebe
2011-09-07  0:40     ` Glenn Morris
2011-09-07 12:39       ` Stefan Monnier
2011-09-13 19:38         ` Eduard Wiebe
2011-09-13 21:02           ` Stefan Monnier

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).