all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] org-clock-select-task bugfix (XEmacs incompatibility)
@ 2009-12-01 20:07 Richard KLINDA
  2009-12-02  5:41 ` Carsten Dominik
  0 siblings, 1 reply; 6+ messages in thread
From: Richard KLINDA @ 2009-12-01 20:07 UTC (permalink / raw)
  To: emacs-orgmode

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

See attached simple patch.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-clock-org-clock-select-task-bugfix-XEmacs.patch --]
[-- Type: text/x-diff, Size: 850 bytes --]

From 795d529d622f509f47c2bf17a0139fbe1659cc5f Mon Sep 17 00:00:00 2001
From: Richard Klinda <rklinda@gmail.com>
Date: Tue, 1 Dec 2009 21:03:39 +0100
Subject: [PATCH] org-clock: org-clock-select-task bugfix (XEmacs)

---
 lisp/org-clock.el |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 56dbab5..87017fc 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -344,6 +344,10 @@ of a different task.")
       (org-fit-window-to-buffer)
       (message (or prompt "Select task for clocking:"))
       (setq rpl (read-char-exclusive))
+      (when (featurep 'xemacs)
+        ;; in XEmacs read-char-exclusive returns character, instead of
+        ;; ascii value
+        (setq rpl (char-octet rpl)))
       (cond
        ((eq rpl ?q) nil)
        ((eq rpl ?x) nil)
-- 
1.6.2.1


[-- Attachment #3: Type: text/plain, Size: 13 bytes --]


-- 
Richard

[-- Attachment #4: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: [PATCH] org-clock-select-task bugfix (XEmacs incompatibility)
  2009-12-01 20:07 [PATCH] org-clock-select-task bugfix (XEmacs incompatibility) Richard KLINDA
@ 2009-12-02  5:41 ` Carsten Dominik
  2009-12-02 12:32   ` Richard KLINDA
  0 siblings, 1 reply; 6+ messages in thread
From: Carsten Dominik @ 2009-12-02  5:41 UTC (permalink / raw)
  To: Richard KLINDA; +Cc: emacs-orgmode

Hi Richard,

I don't see why this would be necessary?  Under what circumstances  
does this fail?

- Carsten

On Dec 1, 2009, at 9:07 PM, Richard KLINDA wrote:

> See attached simple patch.
>
> From 795d529d622f509f47c2bf17a0139fbe1659cc5f Mon Sep 17 00:00:00 2001
> From: Richard Klinda <rklinda@gmail.com>
> Date: Tue, 1 Dec 2009 21:03:39 +0100
> Subject: [PATCH] org-clock: org-clock-select-task bugfix (XEmacs)
>
> ---
> lisp/org-clock.el |    4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
> index 56dbab5..87017fc 100644
> --- a/lisp/org-clock.el
> +++ b/lisp/org-clock.el
> @@ -344,6 +344,10 @@ of a different task.")
>       (org-fit-window-to-buffer)
>       (message (or prompt "Select task for clocking:"))
>       (setq rpl (read-char-exclusive))
> +      (when (featurep 'xemacs)
> +        ;; in XEmacs read-char-exclusive returns character, instead  
> of
> +        ;; ascii value
> +        (setq rpl (char-octet rpl)))
>       (cond
>        ((eq rpl ?q) nil)
>        ((eq rpl ?x) nil)
> -- 
> 1.6.2.1
>
>
> -- 
> Richard
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

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

* Re: [PATCH] org-clock-select-task bugfix (XEmacs incompatibility)
  2009-12-02  5:41 ` Carsten Dominik
@ 2009-12-02 12:32   ` Richard KLINDA
  2009-12-03 11:47     ` Carsten Dominik
  0 siblings, 1 reply; 6+ messages in thread
From: Richard KLINDA @ 2009-12-02 12:32 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

Hello Carsten, this failed for me ever since, but as I haven't needed
the functionality I was just lazy to report it.  Oh:) I see why my patch
must be problematic, sorry about that.

The problem is that, when pressed a number as a reply to the question,
this cond command (see below) always goes to the error clause, because
rpl gets the value of ?1 for example, but sel-list look like ((49 . ...) 
(50 . ...)) so the assoc can't find ?1.  With my patch, the assoc finds
it because rpl is converted to ASCII code, but now ?q and ?x clauses
don't work.:)

      (cond
       ((eq rpl ?q) nil)
       ((eq rpl ?x) nil)
       ((assoc rpl sel-list) (cdr (assoc rpl sel-list)))
       (t (error "Invalid task choice %c" rpl)))

I hope you see what the problem is, I think it must be an XEmacs issue.

>>>>> Regarding 'Re: [Orgmode] [PATCH] org-clock-select-task bugfix (XEmacs incompatibility)'; Carsten Dominik adds:

  > Hi Richard, I don't see why this would be necessary?  Under what
  > circumstances does this fail?

  > - Carsten

  > On Dec 1, 2009, at 9:07 PM, Richard KLINDA wrote:

  >> See attached simple patch.

  >> From 795d529d622f509f47c2bf17a0139fbe1659cc5f Mon Sep 17 00:00:00
  >> 2001 From: Richard Klinda <rklinda@gmail.com> Date: Tue, 1 Dec 2009
  >> 21:03:39 +0100 Subject: [PATCH] org-clock: org-clock-select-task
  >> bugfix (XEmacs)

  >> --- lisp/org-clock.el | 4 ++++ 1 files changed, 4 insertions(+), 0
  >> deletions(-)

  >> diff --git a/lisp/org-clock.el b/lisp/org-clock.el index
  >> 56dbab5..87017fc 100644
  >> --- a/lisp/org-clock.el
  >> +++ b/lisp/org-clock.el
  >> @@ -344,6 +344,10 @@ of a different task.")
  >> (org-fit-window-to-buffer) (message (or prompt "Select task for
  >> clocking:")) (setq rpl (read-char-exclusive))
  >> + (when (featurep 'xemacs)
  >> + ;; in XEmacs read-char-exclusive returns character, instead
  >> of
  >> + ;; ascii value
  >> + (setq rpl (char-octet rpl)))
  >> (cond ((eq rpl ?q) nil) ((eq rpl ?x) nil) -- 1.6.2.1


  >> -- Richard _______________________________________________
  >> Emacs-orgmode mailing list Please use `Reply All' to send replies
  >> to the list.  Emacs-orgmode@gnu.org
  >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  > - Carsten

-- 
Richard

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

* Re: [PATCH] org-clock-select-task bugfix (XEmacs incompatibility)
  2009-12-02 12:32   ` Richard KLINDA
@ 2009-12-03 11:47     ` Carsten Dominik
  2009-12-03 12:41       ` Richard KLINDA
  0 siblings, 1 reply; 6+ messages in thread
From: Carsten Dominik @ 2009-12-03 11:47 UTC (permalink / raw)
  To: Richard KLINDA; +Cc: emacs-orgmode

Hi Richard,

I ave fixed this in a different way.  Please verify!

- Carsten

On Dec 2, 2009, at 1:32 PM, Richard KLINDA wrote:

> Hello Carsten, this failed for me ever since, but as I haven't needed
> the functionality I was just lazy to report it.  Oh:) I see why my  
> patch
> must be problematic, sorry about that.
>
> The problem is that, when pressed a number as a reply to the question,
> this cond command (see below) always goes to the error clause, because
> rpl gets the value of ?1 for example, but sel-list look like  
> ((49 . ...)
> (50 . ...)) so the assoc can't find ?1.  With my patch, the assoc  
> finds
> it because rpl is converted to ASCII code, but now ?q and ?x clauses
> don't work.:)
>
>      (cond
>       ((eq rpl ?q) nil)
>       ((eq rpl ?x) nil)
>       ((assoc rpl sel-list) (cdr (assoc rpl sel-list)))
>       (t (error "Invalid task choice %c" rpl)))
>
> I hope you see what the problem is, I think it must be an XEmacs  
> issue.
>
>>>>>> Regarding 'Re: [Orgmode] [PATCH] org-clock-select-task bugfix  
>>>>>> (XEmacs incompatibility)'; Carsten Dominik adds:
>
>> Hi Richard, I don't see why this would be necessary?  Under what
>> circumstances does this fail?
>
>> - Carsten
>
>> On Dec 1, 2009, at 9:07 PM, Richard KLINDA wrote:
>
>>> See attached simple patch.
>
>>> From 795d529d622f509f47c2bf17a0139fbe1659cc5f Mon Sep 17 00:00:00
>>> 2001 From: Richard Klinda <rklinda@gmail.com> Date: Tue, 1 Dec 2009
>>> 21:03:39 +0100 Subject: [PATCH] org-clock: org-clock-select-task
>>> bugfix (XEmacs)
>
>>> --- lisp/org-clock.el | 4 ++++ 1 files changed, 4 insertions(+), 0
>>> deletions(-)
>
>>> diff --git a/lisp/org-clock.el b/lisp/org-clock.el index
>>> 56dbab5..87017fc 100644
>>> --- a/lisp/org-clock.el
>>> +++ b/lisp/org-clock.el
>>> @@ -344,6 +344,10 @@ of a different task.")
>>> (org-fit-window-to-buffer) (message (or prompt "Select task for
>>> clocking:")) (setq rpl (read-char-exclusive))
>>> + (when (featurep 'xemacs)
>>> + ;; in XEmacs read-char-exclusive returns character, instead
>>> of
>>> + ;; ascii value
>>> + (setq rpl (char-octet rpl)))
>>> (cond ((eq rpl ?q) nil) ((eq rpl ?x) nil) -- 1.6.2.1
>
>
>>> -- Richard _______________________________________________
>>> Emacs-orgmode mailing list Please use `Reply All' to send replies
>>> to the list.  Emacs-orgmode@gnu.org
>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>> - Carsten
>
> -- 
> Richard

- Carsten

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

* Re: [PATCH] org-clock-select-task bugfix (XEmacs incompatibility)
  2009-12-03 11:47     ` Carsten Dominik
@ 2009-12-03 12:41       ` Richard KLINDA
  2009-12-03 13:54         ` Carsten Dominik
  0 siblings, 1 reply; 6+ messages in thread
From: Richard KLINDA @ 2009-12-03 12:41 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

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

Almost good, but the variable "s" contains a list, we need to
int-to-char the "car" of that, see attached trivial patch.  It works
with this.  Thank you.


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

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 321dd95..ce309ef 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -339,7 +339,7 @@ of a different task.")
                    (if (< i 10)
                        (+ i ?0)
                      (+ i (- ?A 10))) m))
-          (if (fboundp 'int-to-char) (setq s (int-to-char s)))
+          (if (fboundp 'int-to-char) (setf (car s) (int-to-char (car s))))
           (push s sel-list)))
        org-clock-history)
       (org-fit-window-to-buffer)

[-- Attachment #3: Type: text/plain, Size: 2668 bytes --]



>>>>> Regarding 'Re: [Orgmode] [PATCH] org-clock-select-task bugfix (XEmacs incompatibility)'; Carsten Dominik adds:

  > Hi Richard, I ave fixed this in a different way.  Please verify!

  > - Carsten

  > On Dec 2, 2009, at 1:32 PM, Richard KLINDA wrote:

  >> Hello Carsten, this failed for me ever since, but as I haven't
  >> needed the functionality I was just lazy to report it.  Oh:) I see
  >> why my patch must be problematic, sorry about that.

  >> The problem is that, when pressed a number as a reply to the
  >> question, this cond command (see below) always goes to the error
  >> clause, because rpl gets the value of ?1 for example, but sel-list
  >> look like ((49 . ...)  (50 . ...)) so the assoc can't find ?1.
  >> With my patch, the assoc finds it because rpl is converted to ASCII
  >> code, but now ?q and ?x clauses don't work.:)

  >> (cond ((eq rpl ?q) nil) ((eq rpl ?x) nil) ((assoc rpl sel-list)
  >> (cdr (assoc rpl sel-list))) (t (error "Invalid task choice %c"
  >> rpl)))

  >> I hope you see what the problem is, I think it must be an XEmacs
  >> issue.

  >>>>>>> Regarding 'Re: [Orgmode] [PATCH] org-clock-select-task bugfix
  >>>>>>> (XEmacs incompatibility)'; Carsten Dominik adds:

  >>> Hi Richard, I don't see why this would be necessary?  Under what
  >>> circumstances does this fail?

  >>> - Carsten

  >>> On Dec 1, 2009, at 9:07 PM, Richard KLINDA wrote:

  >>>> See attached simple patch.

  >>>> From 795d529d622f509f47c2bf17a0139fbe1659cc5f Mon Sep 17 00:00:00
  >>>> 2001 From: Richard Klinda <rklinda@gmail.com> Date: Tue, 1 Dec
  >>>> 2009 21:03:39 +0100 Subject: [PATCH] org-clock:
  >>>> org-clock-select-task bugfix (XEmacs)

  >>>> --- lisp/org-clock.el | 4 ++++ 1 files changed, 4 insertions(+),
  >>>>     0
  >>>> deletions(-)

  >>>> diff --git a/lisp/org-clock.el b/lisp/org-clock.el index
  >>>> 56dbab5..87017fc 100644
  >>>> --- a/lisp/org-clock.el
  >>>> +++ b/lisp/org-clock.el
  >>>> @@ -344,6 +344,10 @@ of a different task.")
  >>>> (org-fit-window-to-buffer) (message (or prompt "Select task for
  >>>> clocking:")) (setq rpl (read-char-exclusive))
  >>>> + (when (featurep 'xemacs)
  >>>> + ;; in XEmacs read-char-exclusive returns character, instead
  >>>> of
  >>>> + ;; ascii value
  >>>> + (setq rpl (char-octet rpl)))
  >>>> (cond ((eq rpl ?q) nil) ((eq rpl ?x) nil) -- 1.6.2.1


  >>>> -- Richard _______________________________________________
  >>>> Emacs-orgmode mailing list Please use `Reply All' to send replies
  >>>> to the list.  Emacs-orgmode@gnu.org
  >>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  >>> - Carsten

  >> -- Richard

  > - Carsten

-- 
Udv, Richard

[-- Attachment #4: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: [PATCH] org-clock-select-task bugfix (XEmacs incompatibility)
  2009-12-03 12:41       ` Richard KLINDA
@ 2009-12-03 13:54         ` Carsten Dominik
  0 siblings, 0 replies; 6+ messages in thread
From: Carsten Dominik @ 2009-12-03 13:54 UTC (permalink / raw)
  To: Richard KLINDA; +Cc: emacs-orgmode

Ah, of course, sorry about that, thanks.

- Carsten

On Dec 3, 2009, at 1:41 PM, Richard KLINDA wrote:

> Almost good, but the variable "s" contains a list, we need to
> int-to-char the "car" of that, see attached trivial patch.  It works
> with this.  Thank you.
>
> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
> index 321dd95..ce309ef 100644
> --- a/lisp/org-clock.el
> +++ b/lisp/org-clock.el
> @@ -339,7 +339,7 @@ of a different task.")
>                    (if (< i 10)
>                        (+ i ?0)
>                      (+ i (- ?A 10))) m))
> -          (if (fboundp 'int-to-char) (setq s (int-to-char s)))
> +          (if (fboundp 'int-to-char) (setf (car s) (int-to-char  
> (car s))))
>           (push s sel-list)))
>        org-clock-history)
>       (org-fit-window-to-buffer)
>
>
>>>>>> Regarding 'Re: [Orgmode] [PATCH] org-clock-select-task bugfix  
>>>>>> (XEmacs incompatibility)'; Carsten Dominik adds:
>
>> Hi Richard, I ave fixed this in a different way.  Please verify!
>
>> - Carsten
>
>> On Dec 2, 2009, at 1:32 PM, Richard KLINDA wrote:
>
>>> Hello Carsten, this failed for me ever since, but as I haven't
>>> needed the functionality I was just lazy to report it.  Oh:) I see
>>> why my patch must be problematic, sorry about that.
>
>>> The problem is that, when pressed a number as a reply to the
>>> question, this cond command (see below) always goes to the error
>>> clause, because rpl gets the value of ?1 for example, but sel-list
>>> look like ((49 . ...)  (50 . ...)) so the assoc can't find ?1.
>>> With my patch, the assoc finds it because rpl is converted to ASCII
>>> code, but now ?q and ?x clauses don't work.:)
>
>>> (cond ((eq rpl ?q) nil) ((eq rpl ?x) nil) ((assoc rpl sel-list)
>>> (cdr (assoc rpl sel-list))) (t (error "Invalid task choice %c"
>>> rpl)))
>
>>> I hope you see what the problem is, I think it must be an XEmacs
>>> issue.
>
>>>>>>>> Regarding 'Re: [Orgmode] [PATCH] org-clock-select-task bugfix
>>>>>>>> (XEmacs incompatibility)'; Carsten Dominik adds:
>
>>>> Hi Richard, I don't see why this would be necessary?  Under what
>>>> circumstances does this fail?
>
>>>> - Carsten
>
>>>> On Dec 1, 2009, at 9:07 PM, Richard KLINDA wrote:
>
>>>>> See attached simple patch.
>
>>>>> From 795d529d622f509f47c2bf17a0139fbe1659cc5f Mon Sep 17 00:00:00
>>>>> 2001 From: Richard Klinda <rklinda@gmail.com> Date: Tue, 1 Dec
>>>>> 2009 21:03:39 +0100 Subject: [PATCH] org-clock:
>>>>> org-clock-select-task bugfix (XEmacs)
>
>>>>> --- lisp/org-clock.el | 4 ++++ 1 files changed, 4 insertions(+),
>>>>>    0
>>>>> deletions(-)
>
>>>>> diff --git a/lisp/org-clock.el b/lisp/org-clock.el index
>>>>> 56dbab5..87017fc 100644
>>>>> --- a/lisp/org-clock.el
>>>>> +++ b/lisp/org-clock.el
>>>>> @@ -344,6 +344,10 @@ of a different task.")
>>>>> (org-fit-window-to-buffer) (message (or prompt "Select task for
>>>>> clocking:")) (setq rpl (read-char-exclusive))
>>>>> + (when (featurep 'xemacs)
>>>>> + ;; in XEmacs read-char-exclusive returns character, instead
>>>>> of
>>>>> + ;; ascii value
>>>>> + (setq rpl (char-octet rpl)))
>>>>> (cond ((eq rpl ?q) nil) ((eq rpl ?x) nil) -- 1.6.2.1
>
>
>>>>> -- Richard _______________________________________________
>>>>> Emacs-orgmode mailing list Please use `Reply All' to send replies
>>>>> to the list.  Emacs-orgmode@gnu.org
>>>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>>>> - Carsten
>
>>> -- Richard
>
>> - Carsten
>
> -- 
> Udv, Richard

- Carsten

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

end of thread, other threads:[~2009-12-03 13:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-01 20:07 [PATCH] org-clock-select-task bugfix (XEmacs incompatibility) Richard KLINDA
2009-12-02  5:41 ` Carsten Dominik
2009-12-02 12:32   ` Richard KLINDA
2009-12-03 11:47     ` Carsten Dominik
2009-12-03 12:41       ` Richard KLINDA
2009-12-03 13:54         ` Carsten Dominik

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.