From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Bug: Can't report org bugs when org-pomodoro is installed [8.2.1 (8.2.1-15-ge5cecc-elpaplus @ /home/cassou/.emacs.d/.cask/24.3.1/elpa/org-plus-contrib-20131021/)] Date: Tue, 05 Nov 2013 19:12:38 +0100 Message-ID: <874n7qsoo9.fsf@bzg.ath.cx> References: <87li136oym.fsf@gmail.com> <87iow6u7z0.fsf@bzg.ath.cx> <87txfqsscd.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vdl7S-0002Ff-P2 for emacs-orgmode@gnu.org; Tue, 05 Nov 2013 13:12:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vdl7L-0006bc-MP for emacs-orgmode@gnu.org; Tue, 05 Nov 2013 13:12:50 -0500 Received: from mail-wi0-x230.google.com ([2a00:1450:400c:c05::230]:38624) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vdl7L-0006bH-GE for emacs-orgmode@gnu.org; Tue, 05 Nov 2013 13:12:43 -0500 Received: by mail-wi0-f176.google.com with SMTP id ex4so2547137wid.15 for ; Tue, 05 Nov 2013 10:12:42 -0800 (PST) In-Reply-To: (Damien Cassou's message of "Tue, 5 Nov 2013 18:21:35 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Damien Cassou Cc: emacs-orgmode@gnu.org Damien Cassou writes: > On Tue, Nov 5, 2013 at 5:53 PM, Bastien wrote: >>> However, I'm not sure I agree with you. >> >> What do you mean exactly? > > I'm not sure this is a bug of org-pomodoro. I think org-pomodoro is > correct in its assumption that `load-file-name' is non-nil. Not in all circumstances. -- Macro: defcustom option standard doc [keyword value]… This macro declares OPTION as a user option (i.e., a customizable variable). You should not quote OPTION. The argument STANDARD is an expression that specifies the standard value for OPTION. Evaluating the ‘defcustom’ form evaluates STANDARD, but does not necessarily install the standard value. If OPTION already has a default value, ‘defcustom’ does not change it. If the user has saved a customization for OPTION, ‘defcustom’ installs the user’s customized value as OPTION’s default value. If neither of those cases applies, ‘defcustom’ installs the result of evaluating STANDARD as the default value. The expression STANDARD can be evaluated at various other times, too—whenever the customization facility needs to know OPTION’s standard value. So be sure to use an expression which is harmless to evaluate at any time. The last sentence is the one important here. Maybe org-pomodoro should use something like this: (defcustom org-pomodoro-sound "/resources/bell.wav" "The path to a sound file that´s to be played when a pomodoro was finished." :group 'org-pomodoro :initialize 'custom-initialize-set :set (lambda (var val) (if load-file-name (set-default var (concat (file-name-directory load-file-name) "/resources/bell.wav")) "/resources/bell.wav")) :type 'file) That way (get 'org-pomodoro-sound 'standard-value) would *always* return something, which is the whole point. Feel free to point to this suggestion when following up on github. Best, -- Bastien