Xah Emacs Blog Archive 2016-10
the difference a language makes
Apple MacBook Touch Bar 2016. The design of the new MacBook touch bar, and what it means to programers.
Emacs: Cycle Space Hyphen Underscore (updated code. Now will work on inside string quote, if cursor is inside a quote or bracket.)
emacs 25.1 feature. If you open a image, now it scales to fit in the window.
the damage by the hacker types of programers about line formatting.
Emacs: Toggle Comment Current Line ๐ (on its own page. updated code.)
emacs M-TAB key poll
- ใโฎhttps://twitter.com/ErgoEmacs/status/791123458201493504โฏ accessed: 2016-10-25ใ
https://plus.google.com/113859563190964307534/posts/c9j3skGkCpF
Elisp: Keyword Completion (minor update)
emacs info code red
make it red. glorious red.
ใsee Emacs Init: M-x customizeใ
Elisp: Create Function Templates (tutorial complete.)
next tutorial in writing a major mode is indentation.
mouse hover tooltip function doc
the mouse hover tooltip now has better background color, and the iPad bug is fixed. You can close the bubble by clicking on it.
for example, goto this page, hover over a elisp function name. On tablet or phone, click it. Elisp: Quick Start
The Glory of a Real Hacker: Ann Arbor Ambassador 60 Terminal
ใAnn Arbor Ambassador 60 Terminal By jwz. At https://www.jwz.org/blog/2016/10/export-termaaa-60/ , accessed on 2016-10-21ใ
emacs history must read.
Coding Convention? Burn It.
Linus in โLinux kernel coding styleโ said:
โFirst off, I'd suggest printing out a copy of the GNU coding standards, and NOT read it. Burn them, it's a great symbolic gesture.โ
from reddit, on emacs coding convention. https://www.reddit.com/r/emacs/comments/585osx/emacs_lisp_style_guide/d906u1j
That's a good point. But on a separate note, to a lesser degree, programer's practice of coding style, may be questionable.
Google has many coding styles, including python, HTML, and even Common Lisp. Its python style guide does not necessary agree with Guido's.
Many coding style includes name format convention such as camelCase vs pot_hole_case, do we actually have scientific data about these matters? (there's a couple, but not trust worthy.)
the coding styles may serve more of a purpose of bounding a particular community.
The rules given by bbatsov (i assume community driven) isn't followed by one of the most popular package on MELPA. For example, dash.el ends predicate function with a question mark.
also, gnu emacs suggest cutting lines to 70 char per line in doc. This is not a good convention. The 70 char per line came from punch cards. Coding style sometimes stifle innovation.
GNU Emacs also has a convention that parameter names be ALLCAPS in the docstring. This limits the possibility of actually having ALLCAPS as parameter name, since emacs is case sensitive, but more so, it adds manual burden to programer. A better way is to introduce markers, similar to emacs `symbol'
convention.
check this link out, by the guy who created the Mongrel web server that was used by twitter. (also famous for http://programming-motherfucker.com/ )
[ Programming Languages Have Social Mores Not Idioms 2012-08-19 By Zed A Shaw. At http://learncodethehardway.org/blog/AUG_19_2012.html]
Instead of naming convention and other misc conventions, what might be a step forward, and is happening today in many languages, is to make it part of the language, enforced either by syntax or by the lang's compiler. For example, predicate function all ends in ?, mutation functions ends in !, or dollar sign sigils means global system var, Caps var name means global var, @ sigil means instance var, etc, all enforced by the lang.
Some convention seems obviously good. But, we need awareness of the many problems. By keep discussing about coding style as we have done so, we dilute the idea of automated and language enforced.
see
corrected a bug from yesterday. Emacs: comment-line vs comment-dwim
Emacs: Cycle Space Hyphen Underscore (more change. Now, by default it works on current line. (it was current word before))
Emacs: dired Rename File, Space to Hyphen or Lowline ๐ (updated code. Now first check if there's space before rename. So you don't get error like file already exist.)
Emacs: Insert Date Time ๐ (major rewrite. Now choice of several date time formats.)
Emacs Init: Tab, Indent (updated.)
Emacs: Insert Brackets by Pair ๐ (updated code. now, brackets will wrap around symbol when in lisp modes)
Emacs: Reformat Lines for Source Code ๐ (bug fix. Now, run of space will be compacted to 1. Refresh page.)
Emacs: Clean Empty Lines ๐ (fixed a bug that prevents before save hook from working.)
Emacs: xah-replace-pairs.el ๐ฆ
new version. The functions xah-replace-pairs-region
and xah-replace-regexp-pairs-region
now have options to let you highlight. That is, the replaced string will be highlighted in buffer.
Emacs: Open Last Closed File ๐. Add that, if you haven't already.
Emacs: dired Rename File, Space to Hyphen or Lowline ๐ (on its own page)
The command posted yesterday also reverted, so they are not dependent. See Emacs: Cycle Space Hyphen Underscore
Emacs: Cycle Space Hyphen Underscore
new feature. When in dired, it automatically rename current or marked files by replacing space to underscore. You can modify it to rename to using hyphen.
emacs: user-error: tags file doesn't exist
โuser-error: File /home/y/TAGS does not existโ
3 hours wasted trying to find where is that path set.
Couldn't find it in any elisp file in my init, lib, or โ.emacs.dโ.
it seems emacs memorized prev value i used long ago.
Solution:
(setq tags-table-list '())
once.