emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Fix: Emacs 25 fancy diary inclusion in agenda
@ 2014-10-10 14:20 Marco Wahl
  2014-10-10 16:25 ` Aaron Ecay
  0 siblings, 1 reply; 10+ messages in thread
From: Marco Wahl @ 2014-10-10 14:20 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi,

it has just been reported on the emacs devel list that
'fancy-diary-display' has been replaced by 'diary-fancy-display' in
Emacs 25.

This breaks diary inclusion into the agenda.

I think the appropriate fix is to choose the display function
dependending on the Emacs version.  See the patch below.  Comments are
welcome.


Best regards,  Marco

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] Fix: Emacs 25 fancy diary inclusion in agenda --]
[-- Type: text/x-diff, Size: 1224 bytes --]

From ebf45bd1c6d7435a8f9f991c6466bf704f223ce9 Mon Sep 17 00:00:00 2001
From: Marco Wahl <marcowahlsoft@gmail.com>
Date: Fri, 10 Oct 2014 15:49:38 +0200
Subject: [PATCH] Fix: Emacs 25 fancy diary inclusion in agenda

* lisp/org-agenda.el (org-get-entries-from-diary): Choose display
  function depending on version

`fancy-diary-display' is `diary-fancy-display' in Emacs 25.
---
 lisp/org-agenda.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index da7993c..5fd9fbc 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -5112,8 +5112,10 @@ of what a project is and how to check if it stuck, customize the variable
   "Get the (Emacs Calendar) diary entries for DATE."
   (require 'diary-lib)
   (let* ((diary-fancy-buffer "*temporary-fancy-diary-buffer*")
-	 (diary-display-hook '(fancy-diary-display))
-	 (diary-display-function 'fancy-diary-display)
+	 (diary-display-function (if (version< emacs-version "25")
+				     'fancy-diary-display
+				   'diary-fancy-display))
+	 (diary-display-hook '(diary-display-function))
 	 (pop-up-frames nil)
 	 (diary-list-entries-hook
 	  (cons 'org-diary-default-entry diary-list-entries-hook))
-- 
2.1.2


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

-- 
http://www.wahlzone.de
PGP: 0x0A3AE6F2

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

* Re: [PATCH] Fix: Emacs 25 fancy diary inclusion in agenda
  2014-10-10 14:20 [PATCH] Fix: Emacs 25 fancy diary inclusion in agenda Marco Wahl
@ 2014-10-10 16:25 ` Aaron Ecay
  2014-10-11 10:36   ` Marco Wahl
  0 siblings, 1 reply; 10+ messages in thread
From: Aaron Ecay @ 2014-10-10 16:25 UTC (permalink / raw)
  To: Marco Wahl, emacs-orgmode

Hi Marco,

Thanks for the patch.

2014ko urriak 10an, Marco Wahl-ek idatzi zuen:
> 
> Hi,
> 
> it has just been reported on the emacs devel list that
> 'fancy-diary-display' has been replaced by 'diary-fancy-display' in
> Emacs 25.
> 
> This breaks diary inclusion into the agenda.
> 
> I think the appropriate fix is to choose the display function
> dependending on the Emacs version.  See the patch below.  Comments are
> welcome.
> 
> 
> Best regards,  Marco
> From ebf45bd1c6d7435a8f9f991c6466bf704f223ce9 Mon Sep 17 00:00:00 2001
> From: Marco Wahl <marcowahlsoft@gmail.com>
> Date: Fri, 10 Oct 2014 15:49:38 +0200
> Subject: [PATCH] Fix: Emacs 25 fancy diary inclusion in agenda
> 
> * lisp/org-agenda.el (org-get-entries-from-diary): Choose display
>   function depending on version
> 
> `fancy-diary-display' is `diary-fancy-display' in Emacs 25.
> ---
>  lisp/org-agenda.el | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
> index da7993c..5fd9fbc 100644
> --- a/lisp/org-agenda.el
> +++ b/lisp/org-agenda.el
> @@ -5112,8 +5112,10 @@ of what a project is and how to check if it stuck, customize the variable
>    "Get the (Emacs Calendar) diary entries for DATE."
>    (require 'diary-lib)
>    (let* ((diary-fancy-buffer "*temporary-fancy-diary-buffer*")
> -	 (diary-display-hook '(fancy-diary-display))
> -	 (diary-display-function 'fancy-diary-display)
> +	 (diary-display-function (if (version< emacs-version "25")
> +				     'fancy-diary-display
> +				   'diary-fancy-display))

The rule of thumb is that Org should support the current major version
of emacs and one previous.  These functions have been aliased for a
while, with fancy-diary-display marked as deprecated.  The commit that
removed them from emacs
<http://bzr.savannah.gnu.org/lh/emacs/trunk/revision/118057> says this
is at least since v 23.1, so it’s safe to just use the new name
unconditionally.

> +	 (diary-display-hook '(diary-display-function))

This puts the symbol ‘diary-display-function’ in the list, which may
or may not be correct (it’s different than the old behavior, which
effectively put the value of that variable).  Maybe you want ‘(list
diary-display-function)’ instead?

-- 
Aaron Ecay

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

* Re: [PATCH] Fix: Emacs 25 fancy diary inclusion in agenda
  2014-10-10 16:25 ` Aaron Ecay
@ 2014-10-11 10:36   ` Marco Wahl
  2014-10-11 12:38     ` Bastien
  0 siblings, 1 reply; 10+ messages in thread
From: Marco Wahl @ 2014-10-11 10:36 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Aaron Ecay

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

Hi Aaron,

Aaron Ecay <aaronecay@gmail.com> writes:
> 2014ko urriak 10an, Marco Wahl-ek idatzi zuen:
>> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
>> index da7993c..5fd9fbc 100644
>> --- a/lisp/org-agenda.el
>> +++ b/lisp/org-agenda.el
>> @@ -5112,8 +5112,10 @@ of what a project is and how to check if it stuck, customize the variable
>>    "Get the (Emacs Calendar) diary entries for DATE."
>>    (require 'diary-lib)
>>    (let* ((diary-fancy-buffer "*temporary-fancy-diary-buffer*")
>> -	 (diary-display-hook '(fancy-diary-display))
>> -	 (diary-display-function 'fancy-diary-display)
>> +	 (diary-display-function (if (version< emacs-version "25")
>> +				     'fancy-diary-display
>> +				   'diary-fancy-display))
>
> The rule of thumb is that Org should support the current major version
> of emacs and one previous.

Just to be sure: Are 23.1 and 25.0 major versions of emacs?

> These functions have been aliased for a
> while, with fancy-diary-display marked as deprecated.  The commit that
> removed them from emacs
> <http://bzr.savannah.gnu.org/lh/emacs/trunk/revision/118057> says this
> is at least since v 23.1, so it’s safe to just use the new name
> unconditionally.

Thanks for pointing that out.

>> +	 (diary-display-hook '(diary-display-function))
>
> This puts the symbol ‘diary-display-function’ in the list, which may
> or may not be correct (it’s different than the old behavior, which
> effectively put the value of that variable).  Maybe you want ‘(list
> diary-display-function)’ instead?

I would have wanted the latter.  Thanks again for the clarification.
But actually it does not matter since diary-display-hook has been marked
obsolete some versions ago.  See the emacs ChangeLog entry

2014-10-06  Glenn Morris  <rgm@gnu.org>
	Remove calendar code obsolete since at least version 23.1.
        ...diary-display-hook...fancy-diary-display...

The patch has shrunk considerably and hopefully is worth for the push
now.


Best regards,  Marco

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Fix: Emacs 25 fancy diary inclusion in agenda --]
[-- Type: text/x-diff, Size: 1266 bytes --]

From 3bc2837ebad7d6a6ffdceb53d4f95c260c1ee342 Mon Sep 17 00:00:00 2001
From: Marco Wahl <marcowahlsoft@gmail.com>
Date: Sat, 11 Oct 2014 11:39:02 +0200
Subject: [PATCH] Fix: Emacs 25 fancy diary inclusion in agenda

* lisp/org-agenda.el (org-get-entries-from-diary): Use the suitable
  display function.  Drop the usage of the obsolete diary-display-hook.

fancy-diary-display has been dropped in Emacs 25.  diary-fancy-display
is the long known replacement of fancy-diary-display.

diary-display-hook has been marked obsolete before Emacs 23.2.
---
 lisp/org-agenda.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index da7993c..fd99bc9 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -5112,8 +5112,7 @@ of what a project is and how to check if it stuck, customize the variable
   "Get the (Emacs Calendar) diary entries for DATE."
   (require 'diary-lib)
   (let* ((diary-fancy-buffer "*temporary-fancy-diary-buffer*")
-	 (diary-display-hook '(fancy-diary-display))
-	 (diary-display-function 'fancy-diary-display)
+	 (diary-display-function 'diary-fancy-display)
 	 (pop-up-frames nil)
 	 (diary-list-entries-hook
 	  (cons 'org-diary-default-entry diary-list-entries-hook))
-- 
2.1.2


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

-- 
http://www.wahlzone.de
GPG: 0x0A3AE6F2

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

* Re: [PATCH] Fix: Emacs 25 fancy diary inclusion in agenda
  2014-10-11 10:36   ` Marco Wahl
@ 2014-10-11 12:38     ` Bastien
  2014-10-11 16:20       ` Marco Wahl
  0 siblings, 1 reply; 10+ messages in thread
From: Bastien @ 2014-10-11 12:38 UTC (permalink / raw)
  To: Marco Wahl; +Cc: Aaron Ecay, emacs-orgmode

Hi Marco,

Marco Wahl <marcowahlsoft@gmail.com> writes:

> The patch has shrunk considerably and hopefully is worth for the push
> now.

The patch looks good, please go ahead.  Thanks!

-- 
 Bastien

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

* Re: [PATCH] Fix: Emacs 25 fancy diary inclusion in agenda
  2014-10-11 12:38     ` Bastien
@ 2014-10-11 16:20       ` Marco Wahl
  2014-10-11 17:45         ` Achim Gratz
  0 siblings, 1 reply; 10+ messages in thread
From: Marco Wahl @ 2014-10-11 16:20 UTC (permalink / raw)
  To: emacs-orgmode

Bastien <bzg@gnu.org> writes:

>> The patch has shrunk considerably and hopefully is worth for the push
>> now.
>
> The patch looks good, please go ahead.  Thanks!

Patch pushed!


Thanks and regards,  Marco
-- 
http://www.wahlzone.de
GPG: 0x0A3AE6F2

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

* Re: [PATCH] Fix: Emacs 25 fancy diary inclusion in agenda
  2014-10-11 16:20       ` Marco Wahl
@ 2014-10-11 17:45         ` Achim Gratz
  2014-10-11 20:36           ` Aaron Ecay
  2014-10-13  9:43           ` Marco Wahl
  0 siblings, 2 replies; 10+ messages in thread
From: Achim Gratz @ 2014-10-11 17:45 UTC (permalink / raw)
  To: emacs-orgmode

Marco Wahl writes:
> Bastien <bzg@gnu.org> writes:
>
>>> The patch has shrunk considerably and hopefully is worth for the push
>>> now.
>>
>> The patch looks good, please go ahead.  Thanks!
>
> Patch pushed!

It looks like that patch should have gone to maint rather than master
and please use a properly formatted commit message in the future:

- The first line of the commit has been taken from the subject of your
  post rather than being in the form that Org uses.
- The commit description itself will be shortened to unintelligible
  gibberish in the Emacs Changelog since the text before the first blank
  line doesn't actually tell what the change has been about.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for KORG EX-800 and Poly-800MkII V0.9:
http://Synth.Stromeko.net/Downloads.html#KorgSDada

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

* Re: [PATCH] Fix: Emacs 25 fancy diary inclusion in agenda
  2014-10-11 17:45         ` Achim Gratz
@ 2014-10-11 20:36           ` Aaron Ecay
  2014-10-13  9:49             ` Marco Wahl
  2014-10-13  9:43           ` Marco Wahl
  1 sibling, 1 reply; 10+ messages in thread
From: Aaron Ecay @ 2014-10-11 20:36 UTC (permalink / raw)
  To: Achim Gratz, emacs-orgmode

2014ko urriak 11an, Achim Gratz-ek idatzi zuen:
> It looks like that patch should have gone to maint rather than master
> and please use a properly formatted commit message in the future:

For reference, this link describes what Achim means about commit messages:
<http://orgmode.org/worg/org-contribute.html#unnumbered-10>.

-- 
Aaron Ecay

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

* Re: [PATCH] Fix: Emacs 25 fancy diary inclusion in agenda
  2014-10-11 17:45         ` Achim Gratz
  2014-10-11 20:36           ` Aaron Ecay
@ 2014-10-13  9:43           ` Marco Wahl
  2014-10-13 16:59             ` Achim Gratz
  1 sibling, 1 reply; 10+ messages in thread
From: Marco Wahl @ 2014-10-13  9:43 UTC (permalink / raw)
  To: emacs-orgmode

Hi Achim,

Thanks for your corrections and hints.

>> Patch pushed!
>
> It looks like that patch should have gone to maint rather than master

Sorry for that.  I was not aware that fixes should go to maint.  I just
naively took the first best branch (which was master) for applying the
change.  BTW: It looks like a good soul already merged the patch into
the maint branch.

> and please use a properly formatted commit message in the future:
>
> - The first line of the commit has been taken from the subject of your
>   post rather than being in the form that Org uses.
> - The commit description itself will be shortened to unintelligible
>   gibberish in the Emacs Changelog since the text before the first blank
>   line doesn't actually tell what the change has been about.

A formal error plus unintelligible gibberish.  Hard to imagine how a
commit message could be worse.  I try to be more careful the next time.


Thanks again,  Marco
-- 
http://www.wahlzone.de
GPG: 0x0A3AE6F2

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

* Re: [PATCH] Fix: Emacs 25 fancy diary inclusion in agenda
  2014-10-11 20:36           ` Aaron Ecay
@ 2014-10-13  9:49             ` Marco Wahl
  0 siblings, 0 replies; 10+ messages in thread
From: Marco Wahl @ 2014-10-13  9:49 UTC (permalink / raw)
  To: emacs-orgmode

Aaron Ecay <aaronecay@gmail.com> writes:

> 2014ko urriak 11an, Achim Gratz-ek idatzi zuen:
>> It looks like that patch should have gone to maint rather than master
>> and please use a properly formatted commit message in the future:
>
> For reference, this link describes what Achim means about commit messages:
> <http://orgmode.org/worg/org-contribute.html#unnumbered-10>.

Thanks for the link.

I just wonder if the text about line 1 is correct.

--8<---------------cut here---------------start------------->8---
Generally, it starts with the filename that has been changed, followed
by a column.
     ^^^^^^
--8<---------------cut here---------------end--------------->8---

Shouldn't this be 'colon'?


Best,  Marco
-- 
http://www.wahlzone.de
GPG: 0x0A3AE6F2

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

* Re: [PATCH] Fix: Emacs 25 fancy diary inclusion in agenda
  2014-10-13  9:43           ` Marco Wahl
@ 2014-10-13 16:59             ` Achim Gratz
  0 siblings, 0 replies; 10+ messages in thread
From: Achim Gratz @ 2014-10-13 16:59 UTC (permalink / raw)
  To: emacs-orgmode

Marco Wahl writes:
> Sorry for that.  I was not aware that fixes should go to maint.  I just
> naively took the first best branch (which was master) for applying the
> change.  BTW: It looks like a good soul already merged the patch into
> the maint branch.

The general rule is that bugfixes for bugs that are (also) in maint are
fixed there and then merged into master.  If backwards compatibility is
broken or new features get introduced, things go directly to master.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

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

end of thread, other threads:[~2014-10-13 16:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-10 14:20 [PATCH] Fix: Emacs 25 fancy diary inclusion in agenda Marco Wahl
2014-10-10 16:25 ` Aaron Ecay
2014-10-11 10:36   ` Marco Wahl
2014-10-11 12:38     ` Bastien
2014-10-11 16:20       ` Marco Wahl
2014-10-11 17:45         ` Achim Gratz
2014-10-11 20:36           ` Aaron Ecay
2014-10-13  9:49             ` Marco Wahl
2014-10-13  9:43           ` Marco Wahl
2014-10-13 16:59             ` Achim Gratz

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).