Titus von der Malsburg | 22 Dec 15:39 2014

[PATCH] Implement functions for measuring fonts and max chars per line


I produced a patch that adds convenient capabilities for measuring font
sizes and for calculating how many characters fit on a line given a
window and a font.  This is in response to bug#19395 and builds on Eli
Zaretskii's recent extension of `font-info' (commit

I'm a first-time submitter and would appreciate some feedback and
additional information.

Question 1: The file CONTRIBUTING says that I should ask on the list for
the procedure regarding the copyright assignment.  I currently live in
the US but I think I do not have resident status.

Question 2: It there a 1-to-1 relationship of commit messages and
ChangeLog entries?  The file CONTRIBUTING makes it sound like that but I
see that some entries in ChangeLog are quite heavy which makes me
suspect that they may represent several commits.

Description of the new features:

The background for this work is that I need a reliable way to determine
how many characters I can fit on a line in a given font and
window.  This information is needed for presenting data in table format,
for instance, when displaying search results in Helm.  `window-width'
looks like a solution for that but there are two problems: it
assumes the frame's default font when doing the calculations and it does
not account for the column reserved for the continuation glyph.  (If
(Continue reading)

Eric Abrahamsen | 21 Dec 06:20 2014

extracting commits from Elpa to original repo

Here's another addressed-to-stefan-but-probably-of-general-interest

I first put my "Gnorb" package into Elpa using the git subtree approach.
Stefan made a commit into it, fixing up some compilation issues and code
style stuff. When I went to pull my latest changes into Elpa I got
conflicts (I wasn't expecting anyone else to be committing into that
package!), assumed I'd screwed something up, backed out about half the
changes, and didn't figure out what had happened until after I'd pushed

I keep Gnorb in a separate repo which I consider its home. I have added
that repo to my local Elpa repo as a remote, and have been pulling
changes from there into the Elpa repo.

Stefan you made another similar commit a month or so ago (which I
appreciate!), which I'd like to have in my main repo, but now I'm not
sure how to handle it.

Here's what I do in Elpa to get my changes:

git fetch gnorb
git subtree pull --prefix=packages/gnorb gnorb master --squash

(I've been using the instructions found here[1])

I also used the "subtree split" command to create a separate branch
within Elpa containing only the commits made on "packages/gnorb".

I'd like to get Stefan's patch into my general Gnorb repo, in such a way
(Continue reading)

David Kastrup | 20 Dec 10:05 2014

Creating a coding system

Ok, what am I doing wrong here?  Why does decode-coding-string not do
anything here?

Attachment (midi.el): application/emacs-lisp, 3695 bytes


David Kastrup
David Kastrup | 19 Dec 17:26 2014

Are CCL programs phased out?

I'm currently considering writing a coding system "midi" which would
basically turn byte sequences into strings like "(note-on 4 23)" so that
you'd get one Midi event per read.  Now grepping for define-ccl-program
makes it appear as if the only uses are in lisp/obsolete/pgg-parse.el
and lisp/language/ethiopic.el.

What's up with that?


David Kastrup

John Yates | 18 Dec 17:19 2014

Electric indentation sub-optimality and resolution

Emacs-24's cc-mode has added electric indentation.  I am sympathetic to the basic motivation.  The current implementation leaves me frustrated.  This is because electric indentation introduces lines with trailing whitespace when one adds no actual text to an indented new line.

Disclaimer: I am C++ programmer with minimal elisp experience.  That said, starting from a sketch provided by Alan Mackenzie, I have come up with the following.  It cleans trailing whitespace _only_ from modified lines.

(defvar my/modified-line nil)

(defun my/modified-line-note (beg end old-len)
  (let ((bol (line-beginning-position)))
    (if (/= (point) bol)
        (setq-local my/modified-line bol))))

(defun my/modified-line-cleanup-after-leaving ()
  (if my/modified-line
        (when (/= (point) my/modified-line)
          (goto-char my/modified-line)
          (while (memq (char-before) '(?\  ?\t))
            (delete-char -1))
          (setq-local my/modified-line nil)))))

(defun my/modified-line-first-change ()
  (add-hook 'post-command-hook 'my/modified-line-cleanup-after-leaving t))

(add-hook 'after-change-functions 'my/modified-line-note)
(add-hook 'first-change-hook 'my/modified-line-first-change)

I make no claim that this is a good solution to the problem.  It merely demonstrates that electric indentation can be made more compatible with whitespace hygiene.  Further since I merely tweaked Alan's untested sketch I claim no ownership in the code.  Do with it as you choose.

Nicolas Petton | 17 Dec 23:26 2014

flymake-tests.el failures


I just saw that flymake-tests.el isn't passing on my machine. The two
perl-related tests are failing. I had a quick look but I'm no Perl
expert, yet it looks like perl should be emitting warnings for the
test.pl file and isn't.

Am I the only one having this issue? I couldn't find anything related to
it on the issue tracker.

perl --version
This is perl 5, version 20, subversion 1 (v5.20.1) built for

(On Ubuntu 14.10)


Nicolas Petton

Harry Putnam | 17 Dec 19:31 2014

emacs-25 in console mode ... need debug coaching

   Fresh install of gentoo linux
   emacs from bzr sources of 2 days ago (12/15/2014)

I have two errors to report but they only happen when I do NOT run
emacs -Q.  So, likely to be something in my local setup.

Thing is, I don't have an idea how to track them down to the source

1) On startup in console mode... this error occurs:
  [From *Messages* buffer]
 |   seconds-to-time: Wrong type argument: listp, 0
 |   Error in post-command-hook
 (global-font-lock-mode-check-buffers): (wrong-type-argument listp 0)
 |   Error in post-command-hook (eldoc-schedule-timer):
 (wrong-type-argument listp 0)

In dired mode:
  This occurs when defining an unwanted directory with `d' and
  attempting removal with `x'

  Ditto for `d' `x' on a regular file
  [From *Messages* buffer]
  |  seconds-to-time: Wrong type argument: listp, 0

Can anyone recognize what might be happening or suggest where I can
look for the cause.

If I start with emacs -Q, none of this happens.

Sven Axelsson | 17 Dec 18:54 2014

Have you all gone crazy? Was: On being web-friendly and why info must die

I have watched several of the recent threads regarding changing the
documentation tool chain for no reason whatsoever from the sideline.
And I really can't understand what's going on. Texinfo looks to me as
a perfectly good format for writing structured documentation. The
markup is a bit chatty, but not unreasonably so. And none of the
suggested alternatives makes any /real/ difference for a potential
documentation writer as far as I can see. Most of what has been
discussed has /less/ functionality and /worse/ performance than what
is used currently. So, why?

If the only remaining reason for this change is to attract new, young
and hip contributors, maybe it is also time to rewrite Emacs in
Haskell and CoffeScript. That would surely bring in lots of new
contributors and breathe new life into the project. Right?


Sven Axelsson

Dmitry Gutov | 16 Dec 22:40 2014

Re: Generalizing find-definition

On 12/16/2014 10:42 PM, Helmut Eller wrote:
> Not everything needs to be entered by the user.  The namespace part
> could comes from the buffer (inferred)

But what if they want to jump to a symbol defined in a different 

I would imagine that jumping to a symbol in the current package would be 
relatively infrequent (in one-file-per-class languages), or at least not 
as important (in other languages, where Imenu probably covers that).

Admittedly, if the language requires all used external symbols (classes, 
or functions) to be declared at the top of the file, for all symbols 
mentioned in the current file "jump to definition" could just be based 
on the local name (maybe imported alias) and the name of the current 
unit of computation (package or class, like in Java), but that discounts 
all symbols that aren't referenced in the current file.

I think allowing to jump to an arbitrary symbol (not just the one near 
point, or even in the same package) is the main goal for the identifier 
completion table.

 > and the user shouldn't be forced to type fully qualified names.

Ideally, right. We want to offer the user defaults for both the package 
part (current), and the symbol name (symbol at point), both of which the 
user could override conveniently.

But maybe offering current.package/symbol-at-point as one default value, 
in one completing-read invocation, would be good enough?

The benefit of a backend being able to decide to call `completing-read' 
twice is being able to cleanly offer these two defaults, separately.

The drawback: personally, I can't really choose which part to prompt for 
first. The best result probably depends on whether the user is looking 
for a symbol (and isn't sure about the package), or knows the package 
and wants to explore the symbols it it.

If we're completing both a the same time, the user can choose which part 
to edit, with completion. I'm not sure, though, if the backend would be 
able to actually filter completions for the first part (package) based 
on the text of the second part (symbol name) thus far entered. But 
that's an implementation detail.

To recount, here are arguments in favor of having identifier completion 
table as a part of the backend API, from the older discussion:

- Partial-completion style will let you complete "js.fo" to anything 
that matches "js*.fo*".

- It means the UI can use it for various kinds of completion (e.g. for

- ...the general rule that the backend should not do UI tasks and 
prompting is definitely a UI operation.

Paul Eggert | 16 Dec 20:21 2014

commit-msg line-length limit

The attached patch (emacs-24 commit dated yesterday) increased the Git 
commit message line-length limit to 78 characters.  This will have 
consequences once we start generating ChangeLog files automatically from 
commit messages.  Because ChangeLog entries are indented by a tab, the 
resulting ChangeLog files will typically require 78 + 8 == 86 columns, 
not the 80 columns they have traditionally needed.  Is this 
intentional?  If not, a simple fix is to change the limit back to 72.  
If so, I suppose we could work around the problem with something like 
the following patch, though this will be more of a change to current 

diff --git a/lisp/vc/add-log.el b/lisp/vc/add-log.el
index 8e44c02..93a2ac6 100644
--- a/lisp/vc/add-log.el
+++ b/lisp/vc/add-log.el
 <at>  <at>  -1034,7 +1034,8  <at>  <at>  the change log file in another window."
  (define-derived-mode change-log-mode text-mode "Change Log"
    "Major mode for editing change logs; like Indented Text mode.
-Prevents numeric backups and sets `left-margin' to 8 and `fill-column' 
to 74.
+Prevents numeric backups, and sets `left-margin' to 8, `fill-column' to 74,
+and `tab-width' to 2.
  New log entries are usually made with \\[add-change-log-entry] or 
  Each entry behaves as a paragraph, and the entries for one day as a page.
  Runs `change-log-mode-hook'.
 <at>  <at>  -1042,7 +1043,7  <at>  <at>  Runs `change-log-mode-hook'.
    (setq left-margin 8
      fill-column 74
      indent-tabs-mode t
-    tab-width 8
+    tab-width 2
      show-trailing-whitespace t)
    (set (make-local-variable 'fill-forward-paragraph-function)

Attachment (commit-msg.diff): text/x-patch, 8 KiB
Nicolas Petton | 15 Dec 22:41 2014

[PATCH] New patch for seq.el


Here is a new patch for seq.el with the following changes:

- Documentation for all seq- functions/macro in sequences.texi
- Some small changes in the docstring of several functions
- New unit tests were added 
- seq-drop returns the sequence if the second argument is a negative
  integer or 0
- seq-take returns an empty sequence if the second argument is a negative
  integer or 0
- Version package header
- I also rebased it to master

I keep a branch on github. Here's a link in case that would be
easier: https://github.com/NicolasPetton/emacs/tree/seq

Attachment (seq.diff): text/x-diff, 25 KiB