Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Disable command-line processing for Emacs 24.

There is no longer access to file-count/line/column after lexical
binding was introduced in Emacs 24 and enabled for startup.el, which
means the current implementation no longer works.

Probably it could be reimplemented using advice, but I personally
don't need the feature so I'm just leaving it disabled.
  • Loading branch information...
commit c3ba585e8bdc829bc2247a769c113ff4aa3de8b4 1 parent b2e1eea
@knu authored
Showing with 10 additions and 18 deletions.
  1. +10 −18 elscreen.el
View
28 elscreen.el
@@ -110,6 +110,8 @@ buffer-name and corresponding screen-name."
(elscreen-rebuild-buffer-to-nickname-alist)))
:group 'elscreen)
+(static-when (>= emacs-major-version 24)
+
(defcustom elscreen-startup-command-line-processing t
"*If non-nil, ElScreen processes command line when Emacsen
starts up, and opens files with new screen if needed."
@@ -117,6 +119,8 @@ starts up, and opens files with new screen if needed."
:tag "Enable/Disable ElScreen to Process Command Line Arguments"
:group 'elscreen)
+) ; (>= emacs-major-version 24)
+
(defcustom elscreen-display-screen-number t
"*Non-nil to display the number of current screen in the mode line."
:tag "Show/Hide Screen Number on the mode-line"
@@ -1649,6 +1653,10 @@ Use \\[toggle-read-only] to permit editing."
;;; Command-line processing at startup time
+; In Emacs 24 or later there is no access to file-count, line, column,
+; etc., so we cannot implement command-line processing this way.
+(static-when (>= emacs-major-version 24)
+
(defun elscreen-command-line-funcall (switch-string)
(let ((argval (intern (car command-line-args-left)))
screen elscreen-window-configuration)
@@ -1728,24 +1736,6 @@ Use \\[toggle-read-only] to permit editing."
(add-hook 'after-init-hook (lambda ()
(add-to-list 'command-line-functions
'elscreen-e23-command-line t))))
- ((> emacs-major-version 23) ; Emacs 24 or later
- (defun elscreen-e24-command-line ()
- (when (string-match "\\`-" cl1-argi)
- (error "Unknown option `%s'" cl1-argi))
- (setq file-count (1+ file-count))
- (setq inhibit-startup-buffer-menu t)
- (let* ((file
- (expand-file-name
- (command-line-normalize-file-name orig-argi)
- cl1-dir)))
- (elscreen-command-line-find-file file file-count cl1-line cl1-column))
- (setq cl1-line 0)
- (setq cl1-column 0)
- t)
-
- (add-hook 'after-init-hook (lambda ()
- (add-to-list 'command-line-functions
- 'elscreen-e24-command-line t))))
))
(static-when elscreen-on-xemacs
@@ -1783,6 +1773,8 @@ Use \\[toggle-read-only] to permit editing."
(expand-file-name arg dir) file-count line)
(setq line nil)))))))))
+) ; (>= emacs-major-version 24)
+
;;; Unsupported Functions...
(defun elscreen-link ()
Please sign in to comment.
Something went wrong with that request. Please try again.