Package 管理里面包名字太长有什么办法吗?

包名太长,后面都显示 … 看不到全名,请问有什么好的办法吗?

估计你说的是 M-x list-packages。有以下几种方法:

  1. RET 点开就能查看到这个包的详细信息,包括全名;

  2. 手动增加宽度,包名预设宽度为 18,改成 25 可用;

    (setf (nth 1 (aref tabulated-list-format 0)) 25)
    
  3. 提交一个 Bug Report,让上游想办法解决。

1 个赞

默认长度确实是18,不过改成25好像不起作用,我是在(require 'package) 后面加的这个设置,不知道怎么调试这个

我用emacs --debug-init 启动,报错是 tabulated-list-format 是 nil 查了GNU手册,应该是有这个变量的呀。。怎么回事

— Variable: tabulated-list-format

This buffer-local variable specifies the format of the Tabulated List data. Its value should be a vector. Each element of the vector represents a data column, and should be a list (name width sort), where

    name is the column's name (a string).
    width is the width to reserve for the column (an integer). This is meaningless for the last column, which runs to the end of each line.
    sort specifies how to sort entries by the column. If nil, the column cannot be used for sorting. If t, the column is sorted by comparing string values.

要使用法二,你得清楚 Buffer Local 变量的概念,并且知道使用 Hook。推荐法一作为 Workaround,法三作为潜在的、能永久解决问题的办法。