[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proper namespaces in Elisp

From: João Távora
Subject: Re: Proper namespaces in Elisp
Date: Thu, 7 May 2020 23:12:33 +0100

On Thu, May 7, 2020 at 10:56 PM Daniel Colascione <address@hidden> wrote:

It's not that your solution is bad per se --- it's that it's a bespoke
solution that solves fewer problems than the general CL mechanism. Sure,
the implementation is simple, but the CL approach isn't really that hard
to implement either if we decide to do it.

Believe me, Daniel, when I tell you it's not me you need to convince ;-)

We should prefer familiar solutions to unfamiliar ones unless the new
solution comes with some compelling advantage that compensates for its
novelty, and I don't see the scheme you've proposed having enough of an
advantage of the CL approach (which also allows prefix aliases) to
compensate for being novel.

I couldn't agree more.  Really, I agree 100%.

Anyway, if you want to play around with my shorthand.el thing, here's
a dirty hack that fixes eldoc.

(defun shorthand-probe (w)
   for (short-pat . long-pat) in shorthand-shorthands
   thereis (intern-soft
            (replace-regexp-in-string short-pat long-pat w))))

(defun elisp--current-symbol ()
  (let ((c (char-after (point))))
    (and c
         (memq (char-syntax c) '(?w ?_))
         (let ((w (current-word)))
           (or (intern-soft w)
               (shorthand-probe w))))))

Stefan, can we make elisp--current-symbol use thingatpt.el so that
I only have to do this trick once (since I'll have to do it for M-. , too)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]