ankurdave / color-identifiers-mode

Emacs minor mode to highlight each source code identifier uniquely based on its name
308 stars 23 forks source link

global-color-identifiers-mode fails altogether, if it fails on some files #82

Closed ghost closed 1 year ago

ghost commented 3 years ago

Hello, and thank you for your awesome package!

I found the following issue:

I have an org-mode file with the following fragment:

#+begin_src: elisp
(defun my-rtcite-export-handler (path desc format)
    "See http://www-public.imtbs-tsp.eu/~berger_o/weblog/2012/03/23/how-to-manage-and-export-bibliographic-notesrefs-in-org-mode/"
    (message "my-rtcite-export-handler is called : path = %s, desc = %s, format = %s" path desc format)
    (let* ((search (when (string-match "::#?\\(.+\\)\\'" path)
             (match-string 1 path)))
       []         (path (substring path 0 (match-beginning 0))))
      (cond ((eq format 'latex)
         (if (or (not desc)
             (equal 0 (search "rtcite:" desc)))
         (format "\\cite{%s}" search)
           (format "\\cite[%s]{%s}" desc search))))))
#+end_src

The code there is wrong, as the [] is there by mistake. However, color-identifiers-mode fails, and the global-color-identifiers-mode fails too.

Hi-Angel commented 1 year ago

Can't seem to reproduce it. What I did:

  1. Commented out everything related to color-identifiers in my .emacs
  2. Replaced my color-identifiers-mode.el with the upstream one (I had some local changes to it), removed the .elc file
  3. Opened emacs, removed everything from *scratch* buffer, did a M-x org-mode, copy-pasted your snippet
  4. Did a M-x global-color-identifiers-mode. It got successfully enabled
  5. Opened another file test.c and checked that it actually works and identifiers are getting highlighted

Is it perhaps fixed?

ghost commented 1 year ago

I don't seem to be able to reproduce this on -master. Seemingly, fixed.

Hi-Angel commented 1 year ago

I should note separately that I can't seem to find a way to make global-color-identifiers-mode fail when a color-identifiers-mode fails in a buffer.