universal-ctags / citre

A superior code reading & auto-completion tool with pluggable backends.
GNU General Public License v3.0
337 stars 26 forks source link

citre-peek-restore when calling citre-peek on a whitespace character #73

Closed railwaycat closed 3 years ago

railwaycat commented 3 years ago

Currently when calling citre-peek on a white space character, it throws an error: "Wrong type argument: stringp, nil".

I would like to see if it's a good idea to bring citre-peek-restore out in this case?

AmaiKinono commented 3 years ago

I don't think so. We shouldn't guess the user's intention for a not well-defined operation.

But hey it's Emacs! You can do whatever you want

(require 'thingatpt)

(defun citre-peek+ ()
  (interactive)
  (if (thing-at-point 'symbol)
      (citre-peek)
    (citre-peek-restore)))
railwaycat commented 3 years ago

Thanks! That is exactly what I want.