emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: David Maus <dmaus@ictsoc.de>
To: emacs-orgmode@gnu.org
Cc: bzg@altern.org
Subject: [PATCH] Small fix for contrib/lisp/org-elisp-symbol.el
Date: Fri, 02 Sep 2011 06:53:20 +0200	[thread overview]
Message-ID: <8739gfee9r.wl%dmaus@ictsoc.de> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 445 bytes --]

Attached patch fixes a small issue with
contrib/lisp/org-elisp-symbol.el, a contributed package that defines a
link type for elisp symbols.

Currently org-elisp-symbol.el uses `eq' to compare a symbol value with
a string. Such a comparism always evals to nil:

#+begin_src emacs-lisp
(let ((foo "foo"))
  (eq foo "foo")) => nil
#+end_src

Best,
  -- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #1.2: 0001-Use-string-to-compare-strings.patch --]
[-- Type: text/plain, Size: 1070 bytes --]

From 4b5d2e726d8f64e111c42623ae0cd5cf8d82ad70 Mon Sep 17 00:00:00 2001
From: David Maus <dmaus@ictsoc.de>
Date: Thu, 1 Sep 2011 06:49:29 +0200
Subject: [PATCH] Use `string=' to compare strings

* org-elisp-symbol.el (org-elisp-symbol-store-link): Use `string=' to
compare strings.

(let ((foo "foo"))
  (eq foo "foo")) => nil
---
 contrib/lisp/org-elisp-symbol.el |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/lisp/org-elisp-symbol.el b/contrib/lisp/org-elisp-symbol.el
index e614e97..6eb8114 100644
--- a/contrib/lisp/org-elisp-symbol.el
+++ b/contrib/lisp/org-elisp-symbol.el
@@ -104,8 +104,8 @@
 	     (stype (cond ((commandp sym-name) "Command")
 			  ((functionp sym-name) "Function")
 			  ((user-variable-p sym-name) "User variable")
-			  ((eq def "defvar") "Variable")
-			  ((eq def "defmacro") "Macro")
+			  ((string= def "defvar") "Variable")
+			  ((string= def "defmacro") "Macro")
 			  (t "Symbol")))
 	     (args (if (match-string 3)
 		       (mapconcat (lambda (a) (unless (string-match "^&" a) a))
-- 
1.7.2.5


[-- Attachment #2: Type: application/pgp-signature, Size: 230 bytes --]

             reply	other threads:[~2011-09-02  4:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-02  4:53 David Maus [this message]
2011-09-06 16:12 ` [PATCH] Small fix for contrib/lisp/org-elisp-symbol.el Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8739gfee9r.wl%dmaus@ictsoc.de \
    --to=dmaus@ictsoc.de \
    --cc=bzg@altern.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).