惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The GitHub Blog
The GitHub Blog
有赞技术团队
有赞技术团队
Apple Machine Learning Research
Apple Machine Learning Research
V
V2EX
Engineering at Meta
Engineering at Meta
美团技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 司徒正美
I
InfoQ
S
SegmentFault 最新的问题
博客园 - 叶小钗
N
Netflix TechBlog - Medium
Y
Y Combinator Blog
IT之家
IT之家
博客园 - Franky
大猫的无限游戏
大猫的无限游戏
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
月光博客
月光博客
The Cloudflare Blog
U
Unit 42
GbyAI
GbyAI
L
LangChain Blog
Microsoft Azure Blog
Microsoft Azure Blog

elpa/gnu.git, branch externals/auctex

Release GNU AUCTeX 14.2.0 - elpa/gnu.git * latex.el (LaTeX-what-macro): Fix chars to skip backwards. - elpa/gnu.git * tex-ispell.el: Consolidate regexp for tabular environments. - elpa/gnu.git ; * latex.el (LaTeX-what-macro): Fix last change. - elpa/gnu.git * latex.el (LaTeX-what-macro): Improve macro recognition. - elpa/gnu.git Preserve `crm--choose-completion-string' - elpa/gnu.git - GNU ELPA Accept '-' as macro modifier - elpa/gnu.git Add new styles - elpa/gnu.git ; * tex-info.el (outline-heading-alist): Silence the compiler. - elpa/gnu.git Update style/simpleicons.el to package v16.29.0 - elpa/gnu.git Update NEWS.org for new preview feature - elpa/gnu.git Robustify check for escaped math switches/togglers - elpa/gnu.git Fix custom prompt with a default-value - elpa/gnu.git Fix prompt with a default-value - elpa/gnu.git Make `TeX-listify' an obsolete alias - elpa/gnu.git Fix 'syntax-propertize because of narrowing!' error - elpa/gnu.git Update style/ltx-talk.el to class v0.6.0 - elpa/gnu.git elpa/gnu.git - GNU ELPA elpa/gnu.git - GNU ELPA elpa/gnu.git - GNU ELPA elpa/gnu.git - GNU ELPA Return context for RefTeX also for macros - elpa/gnu.git ; Fix last change - elpa/gnu.git Add in-buffer completion for citation keys - elpa/gnu.git ; Adjust Copyright years - elpa/gnu.git Improve query of the optional float placement - elpa/gnu.git Sort predefined environment hooks - elpa/gnu.git Sort predefined hooks - elpa/gnu.git Allow additional properties for in-buffer completion - elpa/gnu.git Use ConTeXt Mark XL instead of LMTX - elpa/gnu.git
elpa/gnu.git - GNU ELPA
Arash Esbati · 2026-08-19 · via elpa/gnu.git, branch externals/auctex
authorArash Esbati <arash@gnu.org>2026-08-19 12:31:29 +0200
committerArash Esbati <arash@gnu.org>2026-08-19 12:31:29 +0200
commit34e5496f1205181dfd995066ed599197229bacfa (patch)
tree2e249f4a094b7d0121ac5935b53853e8e61cdbc1
parent228e2c7ff54b1d192bc8054bb02a9a31744eece4 (diff)

Deal with wrong monitor height and width

* preview.el (preview-get-dpi): Guard against the case where `frame-monitor-attributes' returns a 0-pair for the monitor width and height in millimeters. See below for the original report and further discussion: https://emacs.stackexchange.com/q/85878/12242 https://lists.gnu.org/archive/html/emacs-devel/2026-07/msg00495.html

-rw-r--r--preview.el12

1 files changed, 9 insertions, 3 deletions

diff --git a/preview.el b/preview.el
index 37da8f1d0da..962712481b3 100644
--- a/preview.el
+++ b/preview.el

@@ -1,6 +1,6 @@

;;; preview.el --- embed preview LaTeX images in source buffer -*- lexical-binding: t; -*-

-;; Copyright (C) 2001-2025 Free Software Foundation, Inc.

+;; Copyright (C) 2001-2026 Free Software Foundation, Inc.

;; Author: David Kastrup

;; Keywords: tex, text, convenience

@@ -4009,8 +4009,14 @@ name(\\([^)]+\\))\\)\\|\

(defun preview-get-dpi ()

(let* ((monitor-attrs (frame-monitor-attributes))

(mm-dims (cdr (assoc 'mm-size monitor-attrs)))

- (mm-width (or (nth 0 mm-dims) 1))

- (mm-height (or (nth 1 mm-dims) 1))

+ (mm-width (or (and (integerp (nth 0 mm-dims))

+ (> (nth 0 mm-dims) 0)

+ (nth 0 mm-dims))

+ 1))

+ (mm-height (or (and (integerp (nth 1 mm-dims))

+ (> (nth 1 mm-dims) 0)

+ (nth 1 mm-dims))

+ 1))

(pixel-dims (cl-cdddr (assoc 'geometry monitor-attrs)))

(pixel-width (nth 0 pixel-dims))

(pixel-height (nth 1 pixel-dims)))