[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 07/117: Lexical scoping for ergoemacs-menus
From: |
Matthew Fidler |
Subject: |
[elpa] 07/117: Lexical scoping for ergoemacs-menus |
Date: |
Fri, 25 Jul 2014 13:23:49 +0000 |
mlf176f2 pushed a commit to branch externals/ergoemacs-mode
in repository elpa.
commit 0312e5eec12d3d3da84d826fdc934bf8ac2bf91a
Author: Matthew L. Fidler <address@hidden>
Date: Mon Jul 14 08:43:11 2014 -0500
Lexical scoping for ergoemacs-menus
---
ergoemacs-menus.el | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/ergoemacs-menus.el b/ergoemacs-menus.el
index 29a5de0..fcc8183 100644
--- a/ergoemacs-menus.el
+++ b/ergoemacs-menus.el
@@ -1,4 +1,4 @@
-;;; ergoemacs-menus.el --- toggle ErgoEmacs-style menus
+;;; ergoemacs-menus.el --- toggle ErgoEmacs-style menus -*- lexical-binding: t
-*-
;; Copyright (C) 2013, 2014 Free Software Foundation, Inc.
@@ -152,16 +152,17 @@
(text :tag "Alternative Description:")))
:group 'ergoemacs-mode)
-(defun ergoemacs-get-major-mode-name (major-mode)
- "Gets the major-mode language name.
+
+(defun ergoemacs-get-major-mode-name (mode)
+ "Gets the MODE language name.
Tries to get the value from `ergoemacs-mode-names'. If not guess the language
name."
- (let ((ret (assoc major-mode ergoemacs-mode-names)))
+ (let ((ret (assoc mode ergoemacs-mode-names)))
(if (not ret)
(setq ret (replace-regexp-in-string
"-" " "
(replace-regexp-in-string
"-mode" ""
- (symbol-name major-mode))))
+ (symbol-name mode))))
(setq ret (car (cdr ret))))
(setq ret (concat (upcase (substring ret 0 1))
(substring ret 1)))
@@ -180,7 +181,7 @@ All other modes are assumed to be minor modes or
unimportant.
"
;; Get known major modes
(let ((ret '())
- all dups cur-let cur-lst current-letter
+ all dups cur-lst current-letter
added-modes
(modes '()))
(dolist (elt (append
@@ -190,9 +191,7 @@ All other modes are assumed to be minor modes or
unimportant.
auto-mode-alist))
(unless (memq (cdr elt) modes)
(when (and (functionp (cdr elt))
- (string-match "-mode$" (condition-case err
- (symbol-name (cdr elt))
- (error ""))))
+ (ignore-errors (string-match "-mode$" (symbol-name (cdr
elt)))))
(unless (or (memq (cdr elt) ergoemacs-excluded-major-modes)
(member (downcase (symbol-name (cdr elt))) added-modes))
(let* ((name (ergoemacs-get-major-mode-name (cdr elt)))
- [elpa] branch externals/ergoemacs-mode updated (7a30c03 -> 37cbf15), Matthew Fidler, 2014/07/25
- [elpa] 01/117: Lexical binding for ergoemacs-mode, Matthew Fidler, 2014/07/25
- [elpa] 02/117: Lexical binding for ergoemacs-modal, Matthew Fidler, 2014/07/25
- [elpa] 03/117: Lexical binding for ergoemacs-advices, Matthew Fidler, 2014/07/25
- [elpa] 05/117: Only turn on recentf-mode in interactive sessions., Matthew Fidler, 2014/07/25
- [elpa] 07/117: Lexical scoping for ergoemacs-menus,
Matthew Fidler <=
- [elpa] 08/117: Lexical binding for ergoemacs-themes, Matthew Fidler, 2014/07/25
- [elpa] 04/117: Lexical Scoping for ergoemacs-functions, Matthew Fidler, 2014/07/25
- [elpa] 09/117: Fix copyright symbol, Matthew Fidler, 2014/07/25
- [elpa] 11/117: Fix Variable binding byte compile warnings, Matthew Fidler, 2014/07/25
- [elpa] 12/117: Lexical binding for ergoemacs-macros, Matthew Fidler, 2014/07/25
- [elpa] 10/117: Lexical binding for ergoemacs-theme-engine, Matthew Fidler, 2014/07/25
- [elpa] 15/117: Don't exit if region is active., Matthew Fidler, 2014/07/25
- [elpa] 16/117: Advise describe-buffer-bindings, Matthew Fidler, 2014/07/25
- [elpa] 06/117: Lexical binding for ergoemacs-layouts., Matthew Fidler, 2014/07/25
- [elpa] 18/117: Use save-match-data with ergoemacs-pretty-key, Matthew Fidler, 2014/07/25