unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Patch for a simple nil check in `calc-graph-add-curve'
@ 2020-03-21 19:48 Narendra Joshi
  2020-03-21 20:27 ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Narendra Joshi @ 2020-03-21 19:48 UTC (permalink / raw)
  To: emacs-devel

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

Hi,

Can someone please add this simple `nil' check in the attached patch?

Best,
Narendra

[-- Attachment #2: 0001-Add-nil-check-for-pstyle-and-lstyle-in-calc-graph-ad.patch --]
[-- Type: text/x-patch, Size: 1134 bytes --]

From e6132b54351ecb487001cc4592f313efcb3d8f15 Mon Sep 17 00:00:00 2001
From: Narendra Joshi <narendraj9@gmail.com>
Date: Sat, 21 Mar 2020 20:45:38 +0100
Subject: [PATCH] Add nil check for pstyle and lstyle in calc-graph-add-curve.

---
 lisp/calc/calc-graph.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/calc/calc-graph.el b/lisp/calc/calc-graph.el
index 4cdfdbd4b9..4feddd9e4d 100644
--- a/lisp/calc/calc-graph.el
+++ b/lisp/calc/calc-graph.el
@@ -211,9 +211,9 @@ calc-graph-add-curve
       (setq pstyle (and (eq (car-safe pstyle) 'vec) (nth (1+ num) pstyle)))
       (setq lstyle (and (eq (car-safe lstyle) 'vec) (nth (1+ num) lstyle))))
     (calc-graph-set-styles
-     (or (and (Math-num-integerp lstyle) (math-trunc lstyle))
+     (or (and lstyle (Math-num-integerp lstyle) (math-trunc lstyle))
          0)
-     (or (and (Math-num-integerp pstyle) (math-trunc pstyle))
+     (or (and pstyle (Math-num-integerp pstyle) (math-trunc pstyle))
          (if (eq (car-safe (calc-var-value (nth 2 ydata))) 'vec)
              0 -1))
      (math-contains-sdev-p (eval (nth 2 ydata))))))
-- 
2.20.1


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

end of thread, other threads:[~2020-04-10 15:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-21 19:48 Patch for a simple nil check in `calc-graph-add-curve' Narendra Joshi
2020-03-21 20:27 ` Eli Zaretskii
2020-03-21 21:56   ` Narendra Joshi
2020-04-08 14:47     ` Bruno Félix Rezende Ribeiro
2020-04-08 15:10       ` Eli Zaretskii
2020-04-08 15:27         ` Narendra Joshi
2020-04-10 14:07         ` Bruno Félix Rezende Ribeiro
2020-04-10 14:31           ` Robert Pluim
2020-04-10 15:33           ` Eli Zaretskii

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