all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: kobarity <kobarity@gmail.com>
Cc: erjoalgo@gmail.com, monnier@iro.umontreal.ca, 63818@debbugs.gnu.org
Subject: bug#63818: 27.1; unbound local variables break python-util-clone-local-variables
Date: Sat, 03 Jun 2023 10:22:41 +0300	[thread overview]
Message-ID: <838rd19fi6.fsf@gnu.org> (raw)
In-Reply-To: <eke7ilc79rmf.wl-kobarity@gmail.com> (message from kobarity on Thu, 01 Jun 2023 23:36:24 +0900)

> Date: Thu, 01 Jun 2023 23:36:24 +0900
> From: kobarity <kobarity@gmail.com>
> Cc: Ernesto Alfonso <erjoalgo@gmail.com>,
> 	Stefan Monnier <monnier@iro.umontreal.ca>,
> 	63818@debbugs.gnu.org
> 
> > Stefan and kobarity, any comments?
> 
> I'm not familiar with this area, but I looked at the Orgmode code.  It
> was changed to use pcase.
> 
> (defun org-clone-local-variables (from-buffer &optional regexp)
>   "Clone local variables from FROM-BUFFER.
> Optional argument REGEXP selects variables to clone."
>   (dolist (pair (buffer-local-variables from-buffer))
>     (pcase pair
>       (`(,name . ,value)		;ignore unbound variables
>        (when (and (not (memq name org-unique-local-variables))
> 		  (or (null regexp) (string-match-p regexp (symbol-name name))))
> 	 (ignore-errors (set (make-local-variable name) value)))))))
> 
> This change seems to be based on the following discussion.
> 
> https://lists.gnu.org/archive/html/emacs-orgmode/2017-06/msg00037.html
> 
> Maybe we can adopt the same approach?

Our code is much simpler, so I don't see any need to use pcase here.

Thanks.





  reply	other threads:[~2023-06-03  7:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31 21:47 bug#63818: 27.1; unbound local variables break python-util-clone-local-variables Ernesto Alfonso
2023-06-01 11:39 ` Eli Zaretskii
2023-06-01 14:36   ` kobarity
2023-06-03  7:22     ` Eli Zaretskii [this message]
2023-06-01 13:06 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-03  7:21   ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=838rd19fi6.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=63818@debbugs.gnu.org \
    --cc=erjoalgo@gmail.com \
    --cc=kobarity@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.