Как передать полномочия root другому пользователю

Для Emacs 24+ я написал другую функцию версии, потому что функция Жиля не работает на меня (не знаю почему).

(defun go-to-line-and-column-cond (lc-cond)
  "Allow a specification of LINE:COLUMN or LINE,COLUMN instead of just COLUMN.                                                                                                              
Just :COLUMN or ,COLUMN moves to the specified column on the current line.                                                                                                                  
LINE alone still moves to the beginning of the specified line (like LINE:0 or LINE,0).                                                                                                      
By Default I'm bind it to M-g M-l.                                                                                                                                                          
The default value of the COLUMN is decrement by -1                                                                                                                                          
because all compilers consider the number of COLUMN from 1 (just for copy-past)"
  (interactive "sLine:Column:: ")
  (let (line delim column max-lines)
    (setq max-lines (count-lines (point-min) (point-max)))
    (save-match-data
      (string-match "^\\([0-9]*\\)\\([,:]?\\)\\([0-9]*\\)$" lc-cond)
      (setq line (string-to-number (match-string 1 lc-cond)))
      (setq delim (match-string 2 lc-cond))
      (setq column (string-to-number (match-string 3 lc-cond)))
      (if (not (equal delim "")) (if (> column 0) (setq column (1- column))))
      (if (= 0 line) (setq line (line-number-at-pos)))
      (if (> line max-lines) (setq line max-lines))
      (goto-line line)
      (move-to-column column)
      (message "Marker set to line %d column %s" (line-number-at-pos) (current-column))
      )))

(global-set-key (kbd "M-g M-l") 'go-to-line-and-column-cond)
1
21.06.2019, 23:07
0 ответов

Теги

Похожие вопросы