From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuchen Pei Newsgroups: gmane.emacs.devel Subject: Strange inconsistency with face preservation in yanking Date: Sun, 05 Jan 2025 14:40:27 +1100 Message-ID: <87ldvq53o4.fsf@think.gnu> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40481"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: Emacs Devel mailing list Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jan 05 04:41:27 2025 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tUHW2-000ANl-Ru for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Jan 2025 04:41:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUHV4-0001mH-HM; Sat, 04 Jan 2025 22:40:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tUHV2-0001m2-GZ for emacs-devel@gnu.org; Sat, 04 Jan 2025 22:40:24 -0500 Original-Received: from fhigh-b7-smtp.messagingengine.com ([202.12.124.158]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tUHV0-0007l4-B9 for emacs-devel@gnu.org; Sat, 04 Jan 2025 22:40:24 -0500 Original-Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfhigh.stl.internal (Postfix) with ESMTP id 16284254011D for ; Sat, 4 Jan 2025 22:40:19 -0500 (EST) Original-Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-07.internal (MEProxy); Sat, 04 Jan 2025 22:40:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ypei.org; h=cc :content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:subject:subject:to:to; s=fm3; t=1736048418; x=1736134818; bh=IFVGkxjt34Vwe5iTGcm/DSVNF/rGoQG2 /oJ2G5xS84s=; b=KVqhyk32AtHw9B6vtsUsFuzDiOQYXyuQEjLqkOwE3RBcjEv2 D3zBcVKuxPPuhZq+lBPCxHoHrF9+mvkWghOJKT/a+7EguVvGNnHV5JPS7Xom0Ll8 QprmFIsUvHUd+UWJh0Grp78uXlduNKMcKJxD7qeJXqV+YwQv4g9mMpVmfdxTrRu8 v04ryzeLyqT2ON1OPiS3HygLuFDe3XPSwb+J387Wz6uUUU8c+SM4DXUZr2h+4Jrj /ksKOAzv17u10GhVn0Anvx4O3fez+JkEpos6KXo/KwzqbLHJEEAABfemelOrjb6b qNdU1uwHW/SOeQZX0JL44tC8qQgx59g+47Z6/A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1736048418; x= 1736134818; bh=IFVGkxjt34Vwe5iTGcm/DSVNF/rGoQG2/oJ2G5xS84s=; b=J 7EyFiyUyfWtAER+PomSyQ0EuL52PCkQ7sQggKc1UeaTG1qXv0ruHlQNUQXLhIXEc 0NruLzSD4U1muqOZJ51l7zn50sS+mTFMTK1YSm5n1xfkYnnTVfmT4nm7X/ok+QiM T5pgZ4cqnyURJF2fNpb7SAdDmPEWJL73/lw0bWgc0kA+hbpK6WIeBdJ17+JF/FBw yv9gVUWkVBPvPjzwk2b5SsdVSM9uZCzXreD1F1SQ+KyTd7U2pduOUbgm+U8G6g8h boC9oWiZZJ2W4i5stKMCotdywT0D1DC3o0EVsx4hllBDr86IE6MWCRYoeeLBQ//e aBhd4W6quqB3uoZb9Yu1Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudefjedgieefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhephffvufffkfgfgggtsehttdertddtredtnecuhfhr ohhmpegjuhgthhgvnhcurfgvihcuoehiugeshihpvghirdhorhhgqeenucggtffrrghtth gvrhhnpeejjedugeetieefveeftdffudehlefhtdelffegleelfeeftdekgfejieeujeeh heenucffohhmrghinhephihpvghirdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepihguseihphgvihdrohhrghdpnhgspghrtghpthht ohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepvghmrggtshdquggvvhgvlh esghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: i51b146f9:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sat, 4 Jan 2025 22:40:17 -0500 (EST) Received-SPF: pass client-ip=202.12.124.158; envelope-from=id@ypei.org; helo=fhigh-b7-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:327698 Archived-At: Hi, If I do #+begin_src emacs-lisp (setq bar " (defun my-hello () (message \"hello\") ") (defun my-insert-copy () (insert bar) (copy-region-as-kill (point-min) (point-max))) #+end_src Open a new elisp file, e.g. foo.el in a buffer, and another file with no extension, e.g. foo in another buffer. Have them both side by side in two windows. In the buffer foo.el, if we eval the function call (my-insert-copy), then switch to the buffer foo, and call (yank) or just do C-y. The text is pasted without elisp syntax highlight. However, if we eval the two expressions inside the body of my-insert-copy one by one, i.e. (insert bar) (copy-region-as-kill (point-min) (point-max)) Then switch to the buffer foo, and do C-y The highlight is preserved. Why? Best, Yuchen -- Dr Yuchen Pei | https://ypei.org | Timezone: UTC+11 PGP Key: 47F9 D050 1E11 8879 9040 4941 2126 7E93 EF86 DFD0 https://ypei.org/assets/ypei-pubkey.txt