From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Matthias Pfeifer Newsgroups: gmane.emacs.help Subject: How to use code from solar.el Date: Fri, 25 Nov 2016 10:02:31 +0100 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1480064593 26051 195.159.176.226 (25 Nov 2016 09:03:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 25 Nov 2016 09:03:13 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 25 10:03:08 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cACPR-0005Zl-Sg for geh-help-gnu-emacs@m.gmane.org; Fri, 25 Nov 2016 10:03:06 +0100 Original-Received: from localhost ([::1]:44749 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cACPU-00010f-4l for geh-help-gnu-emacs@m.gmane.org; Fri, 25 Nov 2016 04:03:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cACOx-0000yn-4a for help-gnu-emacs@gnu.org; Fri, 25 Nov 2016 04:02:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cACOv-0005H6-Tw for help-gnu-emacs@gnu.org; Fri, 25 Nov 2016 04:02:34 -0500 Original-Received: from mail-ua0-x233.google.com ([2607:f8b0:400c:c08::233]:33234) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cACOv-0005FB-MW for help-gnu-emacs@gnu.org; Fri, 25 Nov 2016 04:02:33 -0500 Original-Received: by mail-ua0-x233.google.com with SMTP id 20so71019067uak.0 for ; Fri, 25 Nov 2016 01:02:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=ORickPIRaTCaek9ikJIcnYGfoDXBnMIPXlvYffI7FPk=; b=pQiadcEHC9eQbwM9HQt9B8i3Va6EZJcYaUfmTflEh8blo7EM8wU8oYaIg6RRrPHOuJ MYa5qNyCar7cuz69SCC39GEhgHeR1pEtIurNhPzu9mv2QRCYfjb+5yRTSTc8JfD5JgUF ZLY2tFTf9SsKfv7khg9kUypuzem86THtFXjBLpKfgkYCDOyYgL+/QCE1/FpAvnbTCIfT 7ieeYJ7uN/+cKYPNducs5vDpK0Y65QKT1jTOhil5p7YYLOiH0vwfPGGVSMnYxskVkPVB aRSOc2psFpLgxd6DQw9y3RictLSnq6F+v00Di0n9rlo4zameYGo4cDWaQVs31ZxXZ7ke rmhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ORickPIRaTCaek9ikJIcnYGfoDXBnMIPXlvYffI7FPk=; b=K8aSb7a8nQ+TYo41Wk9inuqWgZ7IJ57jg3+/QZF6xpdJDeZUP6l6CyN+DQ30dyLeYI C1hiytQ8nDJ4V+r25CBxM7R0fCYNR+qLakzQ4qmaja5+LO515H5JRNbwt98KDmPo2dlS S+2roGGe1CAccVq0JJhe3AJk+UdD9yjNzyNZFXlx6vVqe0NF1VMYDBCi2lwB0+wRWVh3 WnTmq3sm2+X4tNcRYeI3bbr3hK3xeO+2kaQvb4Qk8aqfvIxbBmqR+gICTTOKQHbXqfnG uZ9B9KJXwBIHTTWlwTg6hSEAsLIt5O8tVBjfwVMLlyv/V7XNwPU3WzjcFfpnq1I067AN HVWQ== X-Gm-Message-State: AKaTC01WLT8/GshuZtn7nasR9NfEd8kGE1IbwhcPsa1u59buH+4qPuZ7ivggs2DF+z9uBcIR3dXS0Ss5PDDowQ== X-Received: by 10.176.86.23 with SMTP id y23mr3943185uaa.88.1480064552318; Fri, 25 Nov 2016 01:02:32 -0800 (PST) Original-Received: by 10.103.74.217 with HTTP; Fri, 25 Nov 2016 01:02:31 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400c:c08::233 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111797 Archived-At: Hi there, solar.el is an emacs lisp library that comes with emacs. It (defun)s the function solar-sunrise-sunset that calculates sunrise, sunset and daylight. I was wanting to have this information available in the mode-line and added to my init.el file this piece of emacs lisp: (require 'solar) (defun mp:sunrise-sunset-for-modeline () (let ((calendar-time-display-form '(24-hours ":" minutes)) (l (solar-sunrise-sunset (calendar-current-date)))) (format "[=E2=86=91%s, =E2=86=93%s]" (apply 'solar-time-string (car l)) (apply 'solar-time-string (cadr l))))) When i was testing the code it was working find. However when I invoke emacs i get during loading of init.el this error message: Debugger entered--Lisp error: (wrong-type-argument arrayp nil) solar-exact-local-noon((11 25 2016)) solar-sunrise-sunset((11 25 2016)) (let ((calendar-time-display-form (quote (24-hours ":" minutes))) (l (solar-sunrise-sunset (calendar-current-date)))) (format "[=E2=86=91%s, =E2= =86=93%s]" (apply (quote solar-time-string) (car l)) (apply (quote solar-time-string) (car (cdr l))))) mp:sunrise-sunset-for-modeline() eval((mp:sunrise-sunset-for-modeline) nil) elisp--eval-last-sexp(nil) eval-last-sexp(nil) funcall-interactively(eval-last-sexp nil) call-interactively(eval-last-sexp nil nil) command-execute(eval-last-sexp) Why is the function not executing? If I invoke calendar before mp:sunrise-sunset-for-modeline then it works without error. Is it possible that i have to require some more dependencies? The debugger error message does not seem to indicate this, but it seems likely to me. Matthias